rnd:projects:euromidi

Eurorack MIDI-CV module

status:
active
oneline:
a Teensy-based module to convert USB MIDI input to Eurorack CV and gate signals

Accept MIDI input and output Eurorack-compatible CV signals. This project is based around the Teensy platform, as it has a high clock rate and built-in USB MIDI support.

The module will have 4 CV/gate outs, each of which can be non-exclusively mapped by the user to selected channels. For example, outputs 1 and 2 can both be mapped to MIDI channel 4.

We selected the Teensy platform for its small size, high I/O pin count, and built-in USB MIDI support.

The Teensy MIDI library docs recommend using callback functions to handle each MIDI event type. For NoteOn and NoteOff messages, the callbacks require three parameters: channel, note, and velocity, each a single byte. When a NoteOn even is received, we scale the note value to the DAC range, write the scaled value to the correct DAC channel(s), and set the gate pin high. On a NoteOff event, we write 0 to the DAC channel(s) and pull the gate pin low.

Internally, we will represent channel mappings as a four-element array of single bytes. This both reduces storage requirements and simplifies channel reassignments (since we don't have to prevent the user from assigning multiple channels to the same output). Since there are only four channels, a series of cascaded ifs will determine which output channels receive events.

Eurorack voltages are generally 10 Vpp, typically 0–10 V for unipolar signals and -5–5 V for bipolar signals. 0–5 V should be sufficient for pitch CV, as that range will grant a 5-octave spread. Gate signals will need to be higher. A gain of around 3 is required to bring the microcontroller's 3.3 V logic up to a usable level. An even better idea would be to use a comparator (with a threshold of 2 V or so) to drive the gate outputs to 10 V.

The VCV docs contain a section on converting between frequencies and voltages in the 1 V/Oct standard; the basic formula is $f=f_0\cdot 2^V\implies V=\log_2\left(\frac{f}{f_0}\right)$, where $f_0$ is the reference frequency. This should default to C4, or 261.6256 Hz. This page includes information on converting note names to frequencies to MIDI notes.

Special attention must be paid to the power header. Since we're working with unipolar voltages, we should only need the +12 V line. Be sure to clearly identify the -12 V side!

The DAC's reference value should be hardcoded in the firmware as a constant for note scaling. For an $n$-bit DAC, $V_{ref}=2^n-1$ (e.g., the max value of a 12-bit DAC can be received by writing 4095 to the device).

Unfortunately, all the quad DACs I've seen are SMD.

  • rnd/projects/euromidi.txt
  • Last modified: 2023-09-10 17:51
  • by asdf