Issue with Bang Retriggering
Hey all,
I've been working on an additive synthesis patch and I'm trying to control the volume of each sinewave based on the number of blobs appearing on a camera feed. The tricky part is that when the numbers go up or down, the bang gets retriggered. I want the volume to smoothly go up when increasing the numbers and down when decreasing, without the retriggering issue. I've attached the patch to give you a better idea of what I'm dealing with. In real-time, using a timer or delay isn't ideal since I can't predict when the number will change or in which direction.
Any suggestions on how to deal with this issue would be greatly appreciated! Thanks in advance for your help :)
If I understand well, you may want to increase/decrease volume at sample rate, using [line~] instead of [line] in order to avoid clicks :

Yes, I have already done that in my project with multiple sinewaves, in the patch I uploaded I am just doing a simulation to change the value of a dial, so there is no audio signal involved and thats why I used the line object.
I don't see which is the "retriggering issue" you are referring to, then :-)
Sorry if I have been not clear enough, I will try to explain better!
I have an additive synthesis patch. There is a fundamental frequency and x partials. I have a blob tracking algorithm that outputs the number of objects that stand in front of a camera.
I want to introduce/remove specific partials based on the number of blobs in real-time.
So far, my strategy has been the following:
- The integer number box at the top of the patch representing the number of blobs is fed into a select object.
- The select object triggers a volume ramp (line) for the corresponding partials, either increasing or decreasing their volume based on the number of blobs detected. For example, if the number of blobs is 3, partials such as f0, f1, and f2 are activated.
The issue is that when the n. of blobs = a partial that is already active, the volume ramp gets retriggered, while I want it to be unchanged.
I tried with the onebang and the change +/- objects, but somehow I'm struggling with determining onebang's output to happen at the correct time. Hope this helps clear my question :)
Ah I see. How about something like this ?

Depending on the number of partials, I would recommend using [poly~] or [mc.~], so as to avoid writing n times the same code.
Thank you! Thats exactly what I was looking for :))) much appreciated!