Kautenja / PotatoChips

Eurorack modules based on programmable sound chip emulation.
Other
45 stars 4 forks source link

Support for Polyphony #8

Closed Kautenja closed 3 years ago

Kautenja commented 4 years ago

Polyphony would be a good add, though #7 will need to be resolved first; the current code will not scale very nicely.

road map:

Kautenja commented 3 years ago

Completed for all published modules as of version 1.6.0

Kautenja commented 3 years ago

Re-opening to determine which ports to use for detecting polyphony. Currently, only the VOCT input is used to detect an input signal that is polyphonic

xandramax commented 3 years ago

One small thing I now realize I didn't implement correctly: the VU lights on 2A03 (and maybe others, I haven't checked) should represent the root mean sum of polyphonic output. At present, the light only represents the value of the channel with the highest amplitude.

From Andrew Belt in "Polyphony reminders for plugin developers":

Lights representing polyphonic signals should display the “root mean sum” of the channels.

The root mean sum is defined as sqrt{x_0^2 + x_1^2 + x_2^2 + ... + x_n^2}

This formula returns 1 if any of the channels are 1, and it reduces to the identify function in the monophonic case.

VCV recommends to use blue for polyphonic signals, such as componentlibrary::SCHEME_BLUE.

Kautenja commented 3 years ago

No worries I had compared against how the VU meter in VCMixer from Fundamental was done and copied the procedure from there. Confusingly, that module just takes a sum of all the signals, not the root mean square value, and also doesn't follow the blue=polyphonic semantic. The lights on all the polyphonic patch cables throughout Rack do seem to use the RMS value and blue=polyphonic semantics though. For now I'll leave it following how VCMixer does it, but will ask Andrew about this over on the Fundamental repository in case VCMixer needs updated.

Kautenja commented 3 years ago

Closing, changed to check all input ports for polyphonic cables.