Project goal
To build USB Midi, monophonic, Bass line synth based on Arduino Pro Micro board.
Concept
Waveforms are analog modulations of single digital frequency source (digital pin, Arduino tone() method) with pure square waveform.
Key (hardware) components:
- Arduino Pro Micro
- Microchip MPC 410 10 CP digital potentiometers (10kOhm, 8bit / 256 values)
- UL741 operational amplifier
- Passive components
Key (firmware) functions:
- MIDI controlled synth, visible as USB MIDI device
- CC values are controlling all variable aspects of synthesis
- Sound preset as 127 bytes for each CC value
- Internal ADSR curves for amplitude modulation and low-pass filter (on master output)
Current architecture of the synth (breadboard model v2.0)
- Waveform A: low-passed sine-2-triangle integrator (sub and bass)
- CC controls waveform shape (from square to sine)
- Waveform B: high-passed sharp saw (“perk”)
- Waveform A/B mixer
- Master low-pass filter (cut-off), with CC controlled gain amplification (res)
- Amplitude modulation at output (ADSR)
Key Arduino libraries:
- SPI
- Protocol used to control MPC410-10 digital potentiometers
- MIDIUSB
- UART/MIDI communication, message reading and sending
- Chrono
- Event scheduler / timer / cycle control
- SoftwareSerial
- DEBUG outputs
Spartan approach
Program size: 10,492 bytes (used 37% of a 28,672 byte maximum) (2.55 secs)
Minimum Memory Usage: 1179 bytes (46% of a 2560 byte maximum)
There are few nice math libraries for Arduino that would ease firmware development – but, after evaluation, I’ve excluded them and wrote my own library in order to exploit Arduino Pro Micro-s resources to the maximum. As example, Math.Spline library seemed as perfect match for ENV / ADSR computation – but it used float (4 bytes) even for point indexes. Current ADSR implementation uses one byte to describe: initial, peak and sustain amplitude, while float is used only during computations. Any number type bigger than byte contradicts to the application scenario: MPC 410-10 is 8bit digital potentiomenter and MIDI CC messages describe values from 0-127.
Breadboard model v0.1
Breadboard model v0.1
GitHub – firmware (Arduino project in Visual Studio 2017):