@sean_kc To do this with a [phasor~] based sampler, add this to your patch:
This is kind of complicated, so I'll do my best to explain what's going on.
Two things to keep in mind:
- phase dictates where you are in a soundfile that is playing back. A phase of 0 is the beginning. A phase of 1 is the very end. A phase of 0.5 is halfway through.
- cycles dictates how fast to play through a sound file. A cycle of 1 hz means play the entire soundfile in 1 second. A cycle of 0.333 hz means play the entire soundfile in 3 seconds. A cycle of 3 hz means play the entire soundfile back in 1/3 seconds. A cycle of 0 hz effectively stops playback.
The [catch~] listens to the current phase of the [phasor~]. As @gsagostinho correctly notes, the phase will constantly travel from 0 to 1 indefinitely. When the cycle is just about complete (or when the phase is greater than 0.99 but still less then one) the [expr~] sends out a 1. Once the phase reaches completion, it immediately jumps back to zero. [edge~] outputs a bang when a 1 turns into a 0. When this happens, a 0 is first sent to [ * ~], which silences the audio, and then a bang to the message box below that resets that phase and stops playback (cycles are 0 hz).
When you hit the message box [play_once(, you reopen the audio spigot, set the cycles per second to the rate given by the division object, and restart playback from the beginning (set phase to 0).