Tuesday, November 4, 2025

Midi proxy/Voice assigner

A tiny but exciting win today - I wrote the first line for the XM8 main controller, more specifically a midi proxy/distributor that copies all incoming midi to separate outs. This will let me support multiple voice cards without rewriting the interface (yet).

More importantly though, the proxy does a round robin voice assignment, so instead of forwarding note on/off messages directly, it sends the next note on to the least recently used voice (and makes sure to send note off first, at least for now. This paves the way for polyphony, which is something I've litteraly been waiting a decade for!

As for the communication, I use the serial TX and RX pins directly, from a Teensy 4.1 TX to a Teensy 4.0 RX. It worked immediately, no external components necessary.

It should also be possible to send MIDI at a higher bitrate, right now it runs at the standard 31250bps, I expect that at least 115200 should be problem free.

Don't cut the red wire! 
I'm actually reusing the original voice card controller prototype board for the MIDI proxy, as it has everything needed for receiving MIDI onboard and exposes pins for all the teensy pins. 

Next up is connecting two full voice cards. I can't wait, this is sooo cool!
 

Sunday, November 2, 2025

A bit about tuning the VCO

I've created a tuning algorithm that measures the VCO at 11 points one octave apart, and calculates the correct DAC voltage and steps between octaves. This is used to generate a lookup table that serves two purposes:

- It maps the 10.67 octaves available through midi to the 12.82 octaves available from the VCO

- It corrects tuning

I've also made a looping quick-measuring of the real frequencies of the oscillator using the expected DAC-voltage-to-frequency ratio. This allows me to extremely quickly tune the VCO response to as close to perfect 2 x ratio between octave voltages - a full 11 octave measurement takes around 1s so I get countinous feedback across the hole range while turning the trimmer pot .

 

There were a few pitfalls along the way. 

First of all, when the VCO hardware trimmer is tuned to the correct response, the VCO doesn't reach all the way down to the needed 8.18Hz. This has been fixed by adding a 1.5MOhm resistor from the secondary 1V/oct input jumper to -12V.

Second, I had a hard time getting a proper base frequency. I set the base note by measuring the frequency at 0V and then again at what should correspond to 1 octave up. This makes it possible to calculate the actual response (steps/octave), and based on this I guess the correct voltage for the base note.

It seems however, that there are some linearity issues at the very bottom of the response curve. By increasing the initial guess-voltage for the lowest frequency to slightly above 0V, I was able to get a consistent lowest-frequency guess, which is crucial for the rest of the tuning.


At the moment, tuning takes around 6 seconds. Whenever tuning is started, I use the default untuned/expected volts per octave. It is possible that instead using the current values may be better and could lead to a progressively more correct tuning, though at the moment this seems unnecessary.