stopping count~

Feb 26, 2010 at 9:24pm

stopping count~

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!

#48801
Feb 26, 2010 at 9:30pm

will [< ~ 50] work for you? maybe the data would be coming way too fast again though… does your signal vector size affect the way this will work maybe?

#175396
Feb 26, 2010 at 9:55pm

Thanks for your reply mate, I did try [< ~50] but the act of converting the signal to number through number~ and then feeding it to a togedge to send out a bang to a stop message added a latency to the whole process. I just wish that count~ could have a loop on/off message so that is could simply perform the count once when banged.

#175397
Feb 26, 2010 at 10:09pm

what i meant was actually more like sending the output of [< ~ 50] to the input select part of selector, to turn the input on and off.. then passing through to poke~?

#175398
Feb 27, 2010 at 2:26am

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.

– Pasted Max Patch, click to expand. –
#175399
Feb 27, 2010 at 3:03am

Actually this is slightly more efficient:

– Pasted Max Patch, click to expand. –
#175400

You must be logged in to reply to this topic.