stopping count~

Beep's icon

I am trying to use poke~ to write a small amount of samples to a buffer~, say 50, I am using count~ to provide the sample index. What I would like to do is start count~ and once it reaches 50 for it to stop automatically. Any ideas as to an object that will work alongside count~ and send out a bang when a specific number is reached? Something a bit like select, but which works with signals. I tried feeding count~ into number~ and then hooking number~'s right outlet up to a select object looking out for a 50 but I guess the number stream is coming out way to fast for it register properly. Many thanks all!

the_man361's icon
Beep's icon

Thanks for your reply mate, I did try [

the_man361's icon

what i meant was actually more like sending the output of [

Tim Lloyd's icon
Max Patch
Copy patch and select New From Clipboard in Max.

To do this with native objects you could just clip~ the output of count~ to the max number of samples you want so it can't go over that number, and then use ==~ and edge~, the schedular latency of edge~ no longer an issue because your sample ramp has already stopped. Or you could have a look at Andrew Benson's shot~ and/or cshot~ externals from the share pages which will achieve the same thing with less patching and less cpu load.

Tim Lloyd's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Actually this is slightly more efficient: