Hi people, I’m developing a polyphonic utility module:
1 polyphonic input → 5 monophonic outputs (which emit the signal of the channel selected by each of the 5 knobs)
Polyphonic main output.
The input works fine.
I haven’t worked on the knobs yet.
The mono outputs work fine.
In the main output I have a bug that I cannot find / fix in the code.
In addition to malfunctioning, it causes some Rack crashes.
Can anyone kindly help me?
Well, first off, output[].channels is deprecated API. Use output[].setChannels(channels) instead.
Second, for clarity, you should use inputs[].getChannels() before your for loop to fetch the number of channels on your inport, and use that variable to decide how many times to loop instead.
In the meantime, thanks to everyone.
@3HR
instead MinGW gave me problems with .setChannels, while it interprets .channels correctly
@jackokring@Richie
putting back “lastChannels = 0” and typing “5” instead of “16”, it seems to work (without removing + c)
I’ll have to try opening Rack several times to see if it still crashes, but at the moment everything seems to be working fine.
I have a question however, having written 5 instead of 16, does this mean that the input receives a maximum of 5 channels?
Let me explain:
The outputs must be 5 (= main), but the input must be able to receive 16 channels of polyphony in order to make a channel selection with the knobs.
Once you have the knobs working, you’ll no longer need to loop through the 16 channels. You’ll loop through the five outputs, and for each one you’ll read the channel from the knob.