Maximum run time and sleep time?

Hi! I am making an artwork that will run sonic pi 24/7 on a raspberry pi.

I need a sample to play once an hour.
I need another sample to play once a day.
In the meantime it’ll be midi (that works already)

I was going to do this here below, but with very high numbers… (sleep 3,600 for 1 hour, sleep 86,400 for 24 hours) but then it had me thinking… what are the limits here? I am not familiar with ruby.

Is there a maximum run time and maximum sleep time?

live_loop :commemorateSatellite do
with_fx :reverb, room: 1 do
sample :bd_boom, amp: 10, rate: 1
end
sleep 200 # this is 200 seconds (roughly) right?
end

I’m sorry if this is stated in the documentation, I could not find it.

1 Like

This post was flagged by the community and is temporarily hidden.

Hmm. Let’s try that question again then.

I have read the tutorials. Actually twice. Last year and again two weeks ago. And I do not remember seeing the answer to this at all.

So I am looking for anyone who has information on having run something like this 24/7 and if they ran into any issues.

Thank you for your time.

1 Like

Hi - good question. I suspect that longer sleep times might run into issues but I’ve never tried it myself.

Another option in this case would be to have a shorter loop (maybe a minute?) and then only trigger your event every 60 iterations of the loop using ring and tick etc. I’m not at a laptop to check an example but let me know if you have trouble getting that to work

Hi !

That is a great idea.

I tested the one hour sleep run and that does work.

I’ll try your idea too!

1 Like

Hiya,

sounds like a fun project.

Technically, long sleep times are supported and there’s no maximum run time, so you should be good to go. However, this is largely untested, so I’d love to hear if it works for you and if there are any issues so I can resolve them!

Good luck!

1 Like