Sample and hold in iterator ?

yanomano's picture

I'am getting crazy... I'am unable to get the sample and hold patch to work correctly in an iterator... I'am trying to do something like a multi "GPI" to start interpolations patches at different time with a condition. To do this, I need to substract the current patch time with a different sampled value for each index.... But it seems that it's impossible to sample multiple values inside an iterator ....the sample and hold patch return the same value for each index .... Any advice to do this Super Gurus ?

GPI interpolation.qtz11.96 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
js rescue

S&H isn't designed to work inside an iterator (surprise) because it is a stateful patch (like the smooth patch, and a few others). "Stateful" means it has to remember information across frames. It only has room for 1 frame of data, so an iterator (which would require much more) causes it to overwrite the previous data all the time.

I think what you're trying to accomplish is possible in javascript though. If I have a spare moment (I've not had many in the past month or two), I'll try to whip up an example with source to get you started.

yanomano's picture
zap the problem...

thanks mister cwright ! Finally i find a solution : zap the sample function and conditional could work without it ! Something interesting : sample and hold emulation with multiplexers also doesn't work inside iterators...(Probably for the same reason that you explain.)


tobyspark's picture
i also have a plugin...

...that tackles this problem. it currently 'eases out' the input, but does this by building an array of values for each index of the iterator.

so if you hit similar problems again, i could easily modify it.