Forums > MaxMSP

stopping count~

Feb 26 2010 | 9:24 pm

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!

Feb 26 2010 | 9:30 pm

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?

Feb 26 2010 | 9:55 pm

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.

Feb 26 2010 | 10:09 pm

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~?

Feb 27 2010 | 2:26 am

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. --

Feb 27 2010 | 3:03 am

Actually this is slightly more efficient:

-- Pasted Max Patch, click to expand. --

Viewing 6 posts - 1 through 6 (of 6 total)

Forums > MaxMSP