Mix audio array into a single audio signal

Hi all, I’m trying to develop an oscillator bank UDO with a parametrizable oscillator count. I’m using multiple vco2 in a loop and put their audio output in an audio array:

opcode oscillators, a, iii
  setksmps 1
  iFreq, iDetune, iOscilCount xin
  iIndexOffset = (iOscilCount - 1) / 2
  aOuts[] init iOscilCount
  kIndex = 0
  while kIndex < iOscilCount do
    aOuts[kIndex] vco2 1, iFreq + iDetune * (kIndex - iIndexOffset)
    kIndex += 1
  od
  xout [aOuts as a single audio value]
endop

How to do it?

You can’t do it like this as vco2 had internal state. To do this, modify your UDO so it’s recursive. Then each instance of vco2 will be unique.

1 Like

Thanks for the tip.