Title: MIDI_to_CV part 1 Date: 2026-10-07 Category: Posts Tags: Electronics, Hardware Status: draft [![Photo](https://bxxa.cc/gallery/thumbs/projects/20261001_080127.jpg)](https://bxxa.cc/gallery/image/projects/20261001_080127.jpg "measure once cut twice") After the last post, we were left with a working voltage controlled oscillator (VCO), voltage controlled amplifier (VCA), and an envelope generator. The next logical step would probably have been to make a voltage controlled filter (VCF) module. I didn't do that. Instead, with most of a working synth 'voice', I went back to actually making this thing play music. This was actually one of the first things I worked on when starting this hobby... 3 years ago? Wow, my investors are going to be pissed. [![Photo](https://bxxa.cc/gallery/thumbs/projects/IMG_20230410_152446.jpg)](https://bxxa.cc/gallery/image/projects/IMG_20230410_152446.jpg) The classic way of generating melodies for analog synthesizers would be an [analog sequencer](https://en.wikipedia.org/wiki/Analog_sequencer) or an instrument that directly outputs voltage and gate signals. That's a little limiting today, especially since I want to focus more on the electronic design and mechanical construction. For maximum flexibility, and compatibility with modern instruments, a [MIDI](https://en.wikipedia.org/wiki/MIDI) interface from an actual computer that can output control voltages (CV) and gate signals is ideal. Then we can use things like [MIDI controllers](https://en.wikipedia.org/wiki/MIDI_controller) and MIDI files to drive the analog voice of the synth. This could be done a little more cheaply with a microcontroller, but you'd lose compatibility with OS MIDI libraries like the [ALSA sequencer interface](https://www.alsa-project.org/alsa-doc/alsa-lib/seq.html), existing device drivers, and better programming language support. We'll go into more detail about the software in another post. Mainboard --- Before the current [RAMpocalypse](https://en.wikipedia.org/wiki/2025%E2%80%93present_global_memory_supply_shortage), but during the previous Covid chip shortages, the [Libre Computer](https://libre.computer/products/) single board computers (SBC)s were a good alternative to the more popular raspberry pi boards that were [unavailable](https://www.raspberrypi.com/news/production-and-supply-chain-update/) to consumers. I've continued using these over the Raspberry Pi boards because they do a much better job [upstreaming](https://linux-meson.com/hardware.html) their changes to the linux kernel than the larger, and more popular [Broadcom](https://en.wikipedia.org/wiki/Broadcom)-based project. Meaning that you can just install and run an installation image from many linux distributions without needing to apply (an often unmaintained) patch set from the manufacturer of the chipset/SoC. For this project, I'm using the [le-potato](https://libre.computer/products/aml-s905x-cc/) board from Libre Computer. It has the same form factor as the Raspberry Pi, which means we can use existing '[HATs](https://pip.raspberrypi.com/categories/1215-raspberry-pi-hat)', and PCB [templates](https://github.com/devbisme/RPi_Hat_Template). [![Photo](images/brd_thumb.png)](images/brd.png) For the [prototype](https://bxxa.cc/gitea/cinnaboot/synth-modules/src/branch/main/midi_to_cv), we're using a single [MCP4921](https://ww1.microchip.com/downloads/en/DeviceDoc/21897a.pdf) digital to analog converter (DAC) and an op-amp circuit to level shift the gate signal from the board's 3.3V digital IO to the expected 0-5V gate on/off. The MCP4921 is a 12-bit DAC, which means we have 4096 discrete steps at the output. If we set the DAC reference voltage to ~5.018V, we can get a DAC output of 5V with a digital input value of 4080. This is cleanly divisilbe by `(5 * 12) = 60`, 5 octaves at 1V/octave. It's also divisible by `(10 * 12) = 120`, 10 octaves at 0.5V/octave, which can then be easily level shifted to 0-10V, or -5V-+5V. The prototype uses 0-10V, but -5V-+5V is probably the better option since those are the same levels as the audio signal levels already being passed around (at least now that we learned 10V p-p != -10V - +10V :) ). The current plan is to add dedicated [sample and hold](https://en.wikipedia.org/wiki/Sample_and_hold) and level shifting ICs for 5 CV/Gate channels in the final module. The DAC settling time is supposedly around 4.5 microseconds, according to the datasheet, which seems fast enough for 5 channels: `4.5 * 5 = 22.5us` per channel, and a quarter note at 200BPM is: `1 / (200 * 60 * 4) ~= 20us`. That's plenty fast for more reasonable tempos, but another limitation could be the output slew rate of the DAC at 0.55 V/us, and the unknowns from the sample hold and level shifting circuits. [![Photo](images/midi_to_cv_schematic_thumb.png)](images/midi_to_cv_schematic.png) - 5V input goes through polyfuse/input protection - 40pin header height - removing ground-digital ground resistor/grounding error for DAC ref - future additions: - -5V/+5V CV output - add level shifting IC + SnH for other channels, maybe io expansion - character display + button control - transistors for gate LEDs Front Panel --- - construction: - milling with vcarve (see notes) - bracket woes - top row height difference/case construction - new PSUs/back panel enclosure/breakout board - future addition power + current LEDs and test jumper for current measurement [![Photo]()]() - next steps: - work on tech debt: reverse TRS connections and front panel PCBs - midi to cv front panel + char display mounting - tri-state gate signal?: on/off/trigger - need a way to chain the gate signal, probably out from EG - filter module