Cabbage Logo
Back to Cabbage Site

Lose polyphony and audible clicks when sending to another instrument?

I am building a FM Synth and i have come across a problem that has never before been a problem with my other synths. For some reason, if send the final output of the synth over to another instrument with a global variable it loses polyphony and starts making audible clicks, as if every note is overwriting the previous. However keeping the “outs” opcode in the same instrument, polyphony works fine and there is are no clicks. I cant figure out why this is happening.

Attached the CSD. big HELP where the problem is for easy spotting. Thanks in advance for any helpful tips!

FM2.csd (12.1 KB)

Hey there,

That is quite strange, I’d want to know the answer too.

But I can give you a work around the problem. In the end, you want to patch the delay in with your synth. Instead of sending the entire synth signal to a separate instrument, you can work with global sends. So “send” a part of the output of instrument 1 to the delay instrument, and let the output of the synths stay in instrument 1. Here’s the same sketch with the global sends and delay patched in:

FM2_mod.csd (12.2 KB)

This workaround alleviated the problem, Thank you.

The global variables are being overwritten each time a new instance plays. A better approach would be to declare an audio channel, using chn_a and the use chnmix to accumulate the signal from multiple instances of an instrument. Btw, you .csd file is causing a hang for me here. I’m not sure why. I’ll take a look a little later.

Tried using channels but it yields me the same result as when using global variables. Audible clicks and no polyphony. Do channels too get overwritten every time?

The CSD hangs for a bit in winXound, but plays fine with Cabbage. Not sure why this is, but i’m new to Csound so bear with me.

FM2.csd (19.7 KB)

You will need to use chnmix instead of chnset at the bottom of instr 1. you then need to use chnclear on all three of these at the bottom of instr 3 (or whatever the final instrument is) to clear the channels, ready for the next pass. Whether you use chnset of chnmix in instrs 2 and 3 depends on whether you want to overwrite the original audio with the new audio or whether you want to mix them.
Hope this helps,
Iain