Polyphony and VCF
After I got the VCO and VCAs working, the next thing to work on was getting polyphony and VCF working.
The first VCF I attempted was the “Morley Wah” filter. Here’s how it sounded:
I was not happy with the sound and performance of this filter, so I copied Moritz Klein again. Here is a video of how it looked and sounded.
The polyphonic feature was a bit messy. If you want to trace down the code, start here. “doMidiStates()” is a big function that’s called to handle playing notes. This involves figuring out what voltage to set what VCOs to, and to set the state of the VCA and VCFs.
The code runs as a big state machine speeding at 16MHz, constantly reading MIDI inputs and changing the voltage levels to the VCOs, VCAs, and VCF accordingly. Each of the 6 VCOs are represented as an object of the “PitchGenerator” class, and each of the 6 VCAs are represented as an object of the “EnvelopeGenerator” class. The VCF is also represented as an “EnvelopeGenerator” object. The Arduino microcontroller loops through a cycle of pulling serial MIDI data in “checkMidi()”, processing the MIDI information in “getMidiStates()”, and pushing computing and turning those serial messages into voltages in “doMidiStates()”. “doMidiStates()” is probably a bit too big of a function, as it also processes the current state/slope of the envelope, and generates the next state.
The POLYPHONY typedef contains all the combinations of voices per note, and max number of notes. Notice there is no “POLY_6” because that’s really just “MONO_6”
After several weeks of work I celebrated with a bit of jamming.
Morely Wah VCF:
https://electro-music.com/forum/topic-45231.html
Moritz Klein VCF:
https://www.youtube.com/watch?v=jvNNgUl3al0&list=PLHeL0JWdJLvT1PAqW4TtvxtRoXyk741WM&index=5