rnd:projects:euromidi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rnd:projects:euromidi [2023-03-19 02:50] – created asdfrnd:projects:euromidi [2023-09-10 17:51] (current) – [Resources] asdf
Line 1: Line 1:
 ====== Eurorack MIDI-CV module ====== ====== Eurorack MIDI-CV module ======
----- struct project ---- +---- dataentry project ---- 
-status: active +status_: active 
-oneline: a module to convert USB MIDI input to Eurorack CV and gate signals+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.
  
-Accept MIDI input and output Eurorack-compatible CV signalsThis project is based around the Teensy platformas it has a high clock rate and built-in MIDI support.+===== Design ===== 
 +The module will have 4 CV/gate outs, each of which can be non-exclusively mapped by the user to selected channelsFor exampleoutputs 1 and 2 can both be mapped to MIDI channel 4.
  
-I'd like to have 4 CV/gate outseach 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. Internally, we will represent these 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) +==== Teensy ==== 
 +We selected the Teensy platform for its small size, high I/O pin countand built-in USB MIDI support.
  
 The [[https://www.pjrc.com/teensy/td_midi.html|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. The [[https://www.pjrc.com/teensy/td_midi.html|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.
  
-Unless the DAC can output Eurorack levels (0--10 V)some amplification will be requiredAmplification will definitely be required to bring the gate outputs to the required 10 VA gain of 3 should suffice for 3.3 V logic+Internallywe will represent channel mappings as a four-element array of single bytesThis 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 ''if''s will determine which output channels receive events.
  
-**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)The VCV docs contain section on [[https://vcvrack.com/manual/VoltageStandards#Pitch-and-Frequencies|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. [[https://newt.phys.unsw.edu.au/jw/notes.html|This page]] includes information on converting note names to frequencies to MIDI notes+==== Eurorack voltages ==== 
 +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 5-octave spreadGate signals will need to be higherA gain of around 3 is required to bring the microcontroller's 3.3 V logic up to usable levelAn even better idea would be to use a comparator (with a threshold of 2 V or soto drive the gate outputs to 10 V
  
-Remember to track power usage on each rail used!+The VCV docs contain a section on [[https://vcvrack.com/manual/VoltageStandards#Pitch-and-Frequencies|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. [[https://newt.phys.unsw.edu.au/jw/notes.html|This page]] includes information on converting note names to frequencies to MIDI notes. 
  
-{{https://division-6.com/media/featured-eurorack-power.gif}}+Special attention must be paid to the power headerSince we're working with unipolar voltages, we should only need the +12 V line. **Be sure to clearly identify the -12 V side!**
  
-Use KiCAD for PCB designWe may try OSH Park for fabrication this time. The front panel can be ordered from [[https://www.frontpanelexpress.com|Front Panel Express]] and designed in either their freeware designer program or something like Inkscape+{{ https://division-6.com/media/featured-eurorack-power.gif }} 
 + 
 +==== DAC ==== 
 +**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.  
 + 
 +==== User interface ==== 
 + 
 + 
 +===== Prototyping ===== 
 +  * Teensy 
 +  * [[https://www.adafruit.com/product/4470|MCP4728 breakout]] 
 + 
 +===== Resources ===== 
 +  * [[https://github.com/pichenettes/eurorack]]: design files for Mutable Instruments modules; the schematics for [[https://pichenettes.github.io/mutable-instruments-documentation/modules/branches/downloads/branches_v40.pdf|Branches]] and [[https://pichenettes.github.io/mutable-instruments-documentation/modules/yarns/downloads/yarns_v03.pdf|Yarns]] are particularly illustrative for this project 
 +  * [[https://playground.arduino.cc/Main/InterfacingWithHardware/#ui]] 
 +  * [[https://code.google.com/archive/p/m2tklib/]] 
 +  * [[https://github.com/Spirik/GEM]] 
 +  * [[https://github.com/olikraus/U8g2_Arduino]] 
 + 
 +{{tag>eurorack electronics midi}}
  • rnd/projects/euromidi.1679194255.txt.gz
  • Last modified: 2023-03-19 02:50
  • by asdf