# How do I play a sound immediately (reset to cycle0)?

This post is a wiki. Anyone with karma >1 is welcome to improve it.

Sometimes you want to play a sound IMMEDIATELY starting from the first cycle, which in effect is resetting the current cycle to 0 and starting it immediately. We've discussed this before so what's the best way?

edit retag close merge delete

there is a retrig function defined for Emacs. I can't get the definition to work for Atom, but it would be my preferred method to do this. You can look at the Emacs definition: https://github.com/tidalcycles/Tidal/blob/master/tidal.el#L144

( 2016-09-11 16:46:47 -0600 )edit

Sort by » oldest newest most voted

One way to do it is by defining something like runnow and using it before the Dirt connection:

let runnow d p = do now <- getNow
d $(nextSam now) ~> p runnow d1$ sound "bd sn"


Note: indentation must be kept as shown above.

Just use runnow whenever you wan to reset time back to "zero".

more

This isn't quite the same as "play sound now", but if you stop playback with cps (-1) then when you restart (with a positive cps), the cycle count will begin from zero. So if you evaluate things in this order:

cps (-1)

d1 $some$ really $complicated$ pattern

cps 1.0


then when you evaluate the 3rd line it'll start your pattern from the beginning.

more

Oooh! Sweet. These are both great. Pretty amazing that the first one does it's thing in time w/ no hickups. If someone (me obviously) still wanted that hickup, rough, immediate, out of time restart feel one would get from just really raw retriggering how would one go about doing that?

more