I struggle with making my synthesizer polyphonic
I'm working on this subtractive synth patch, and I'm currently trying to make it polyphonic. I think followed every step for achieving polyphony, but I'm unable to get it to work. I've encapsulated the oscillators + main envelope, replaced all the inlets/outlets with in/out(~) objects and I've connected the amplitude signal to the 'thispoly~' object. However, it's still not polyphonic for me.
If you want to take a look at the project to help me out, I've included a zip file with the relevant patches ('Subtractive_Synth_v.0.16.4' is the main patch).
You need to send a message to your [poly~] so that it knows which instance to use. If you use (note) then the first free instance will be used. If you use (target) with an integer, that specific instance will be addressed. Subsequent messages will be sent to that instance. The message (target 0) addresses all instances.
I am readying an article on this topic for my Patreon site.
Thank you for responding! But I've already tried the 'target 0' message and it doesn't work in my case. Instead of polyphony, I get one massively clipping monophonic output when I use the 'target' message... Not what I want :D
OK, that's for several reasons.
First, (target 0) sends a message to all your instances, so yes, all will play . You might want (target 1), (target 2) etc. instead.
Second, you need to be sure the final volume is scaled down appropriately. So with 16 voices, each one of which being (potentially) full scale, you need to divide the final signal by 16.
Your patcher is a bit complex for me to follow in my limited time. I have been prioritising writing up articles and will have one on this topic by Friday noon. Because at this point it's more efficient for me to help multiple people in one go!
That said, I can offer more advice.
It's much easier handling the polyphony abstractions if you send all the information each one needs as a single message. Otherwise, any time you tweak a control to one of the inlets, you need to first target the correct instance. Otherwise [poly~] cannot know which instance that control tweak is for. I always pack everything together into one list, preceded by (target 1) or whatever is appropriate.
Often you might simply want to use the next available voice, but don't care which one it is. Prepend you list with "note" and this works magically.
But your [Synth~] instance needs to manage its busy and mute states. I see that is also missing. The Help File has info on this.
Final suggestion: Create a simpler demo to post here and you will get more responses.