Modify plugin to have poly outputs

Hello,

I’m trying to modify Hampton Harmonics Arp module to have poly outputs in rotate mode. That is, I would like each output note to be played in a separate channel. I have partial success, now the output is poly but the gate output is on all channels at the same time. Here is the part that I modified:

int channels = inputs[PITCH_INPUT].getChannels(); outputs[PITCH_OUTPUT].setChannels(channels); outputs[GATE_OUTPUT].setChannels(channels); for (int c = 0; c < channels; c++) { outputs[PITCH_OUTPUT].setVoltage(this->_pitchOut, c); outputs[GATE_OUTPUT].setVoltage(hasHighGate || this->_shouldLatch ? this->_gateGenerator.process (this->_sampleTime) * 5.0f : 0.0f, c); }

You can find the original source code here: https://gitlab.com/hampton-harmonics/hampton-harmonics-modules

I’m a beginner in programming, but I will be glad if you can point me in the right direction.

Thanks in advance

I looks to me like you are outputting the same thing to all channels. The giveaway is that while you are looping over all channels to output pitch and gate, the thing that you are outputting looks to be the same. At least it does not depend on c.

how is this->_pitchOut or hasHighGate || this->_shouldLatch ? this->_gateGenerator.process (this->_sampleTime) * 5.0f : 0.0f expected to generate different values for different channels?

1 Like

Hello, thank you for your reply. Yes, that seems to be the problem. There is a post about this subject here: https://community.vcvrack.com/t/making-your-monophonic-module-polyphonic/6926 And the output line looks like this:

outputs[SINE_OUTPUT].setVoltage(vcoEngine[c].getSine(), c);

So not only the output is multiplied by c, the voltage also depends on c. I will look into it further from here, thank you for pointing in the right direction.

1 Like