MIDI Sound Synthesizer using PIC32MX MCU
The "REMI Synth" is a digital monophonic MIDI-controlled sound synthesizer designed primarily for use with electronic wind instrument (EWI) MIDI controllers. However, it also works well with MIDI keyboards and sequencers.
This project is a spin-off from an earlier Elektor Labs post describing a "recorder-like electronic musical instrument" (REMI) - a MIDI wind controller (EWI) with a companion sound synthesizer; hence the "REMI Synth". The design has evolved into the project presented here.
Provision of a standard 'MIDI IN' port allows the synth to be played by any MIDI controller, for example, a keyboard or another EWI with a standard MIDI output. Using a low-cost MIDI-USB adapter, the REMI synth can be controlled by a computer running music software such as a MIDI sequencer.
The firmware includes several "pre-defined" synth patches providing a good variety of instrument sounds. The source code is freely available, allowing makers with C programming skills to customize the application to suit their own requirements.
Features
The REMI synthesizer is implemented almost entirely in software, requiring minimal circuitry outside of the microcontroller - just a low-pass filter in the audio output circuit. To generate audio tones, the synth uses a dual "wave-table oscillator" algorithm offering a variety of waveforms which can range from very simple to rich and complex sounds.
A PIC32 on-chip timer module can be used to generate a PWM audio output signal. The PWM "DAC" has a resolution of 11 bits, which gives adequate sound quality. For improved sound quality, an optional 12-bit SPI DAC chip (MCP4921) may be fitted.
The synth model comprises a pair of wave-table oscillators which use independent wave-tables. The two oscillator outputs are fed into a "mixer" which scales and adds the two signals in a variable ratio. The mix ratio can be fixed, or it can be varied in time as the note progresses. The "contour" envelope shaper may be patched in to control the oscillator mix ratio. This capability is used to implement "waveform morphing", a technique used to vary the harmonic content of the sound with time. Waveform morphing can be used to realise a range of effects beyond what is possible to achieve with filtering techniques.
(See image: "REMI Synth Software Model".)
The pitch of the secondary oscillator can be "detuned", i.e. increased or decreased relative to the primary oscillator. The "detune" factor is a patch parameter having units of "cents", so that the detune resolution is 1/100th of a semitone. This feature greatly enriches the soundscape possibilities.
The synth can be configured to control the amplitude (loudness) of the note-in-progress in one of two ways:
(1) using a 5-segment envelope shaper having the classic "attack, peak-hold, decay, sustain, release" (AHDSR) amplitude profile, or (2) using breath pressure or other MIDI IN Control Change messages.
The first option (1) is intended for MIDI keyboard controllers and sequencers, while the second option (2) is intended for MIDI wind controllers (EWIs), in particular the REMI 2 handset.
The REMI synth can be programmed (patched) by the user to create a new sound, without needing to modify and re-compile the firmware. Details of REMI synth functionality and operation using the console CLI and front-panel GUI are provided in the Synth User Guide (attached).
A demo video and/or sample sound clips will be posted in a future update.
Construction
Construction of the PIC32 synth (mk3) is based on the 'PIC32-PINGUINO-MICRO' module from Olimex, priced at ā¬9.95. This module is available from major suppliers, e.g. Digikey, Mouser, etc, and from Olimex directly.
The Olimex MCU module is mounted on a base-board (PCB) named "MIDI Audio Module" (MAM), designed by a project collaborator, Jean-Pierre Meyer (in France). The MAM board has provision for MIDI IN and MIDI OUT interface circuits, audio output circuits (PWM or SPI DAC), IIC EEPROM, etc.
The board accepts connectors to interface various on-board or external sub-assemblies including: USB/UART adapter (console CLI port), headphone amplifier, graphics LCD module (128 x 64 pixels) and an optional control panel with 6 potentiometers used to set patch parameters. The board is powered by a 5V USB plug-pack (e.g. phone charger). It can also be powered via the USB/UART bridge module.
For details of construction, see the attached document: "REMI Synth Construction Notes".
Gerber files for PCB fabrication are attached. If there is sufficient interest expressed from prospective makers, a batch of blank boards may be made available for sale. Be sure to contact me if you are interested, and watch for further announcements.
Firmware
REMI firmware is built using Microchip PIC development tools - MPLAB.X IDE with XC32 compiler, free to download from Microchip's website. If you intend to modify or extend the firmware, you will need these tools. Otherwise, you just need to install the PIC programmer application ("IPE", included with MPLAB.X download) on your computer.
A PIC programming tool, Microchip PICkit-3, is required to install the synth firmware.
Low-cost PICkit-3 clones are available from online suppliers (e.g. AliExpress).
External Links
[1] REMI Project website
[2] Firmware Repository
Provision of a standard 'MIDI IN' port allows the synth to be played by any MIDI controller, for example, a keyboard or another EWI with a standard MIDI output. Using a low-cost MIDI-USB adapter, the REMI synth can be controlled by a computer running music software such as a MIDI sequencer.
The firmware includes several "pre-defined" synth patches providing a good variety of instrument sounds. The source code is freely available, allowing makers with C programming skills to customize the application to suit their own requirements.
Features
- Ā Ā High quality audio output: 40kHz sample rate, 11-bit PWM or 12-bit DAC
- Ā Ā High accuracy oscillator pitch for musical application
- Ā Ā Dual wave-table sound synthesis with mix-ratio modulation (morphing)
- Ā Ā Graphical user interface (2.5" monochrome GLCD, 128x64 pixels)
- Ā Ā Command-line interface (CLI) for setup and patching (using PC as terminal)
- Ā Ā Control panel (6 potentiometers) for setting patch parameters (optional)
- Ā Ā Instrument presets selectable from GUI, CLI or MIDI input source
- Ā Ā User-programmable synth patch and wave-table creator (using CLI)
- Ā Ā Noise Generator and Noise Filter (for "pitched noise" sounds)
- Ā Ā Effect modulation by breath pressure (CC2) and/or modulation data (CC1)
- Ā Ā Filter with variable corner frequency and resonance, pitch tracking
- Ā Ā Filter frequency control by MIDI expression, Contour Env, Mod'n (CC1)
- Ā Ā Reverberation effect
The REMI synthesizer is implemented almost entirely in software, requiring minimal circuitry outside of the microcontroller - just a low-pass filter in the audio output circuit. To generate audio tones, the synth uses a dual "wave-table oscillator" algorithm offering a variety of waveforms which can range from very simple to rich and complex sounds.
A PIC32 on-chip timer module can be used to generate a PWM audio output signal. The PWM "DAC" has a resolution of 11 bits, which gives adequate sound quality. For improved sound quality, an optional 12-bit SPI DAC chip (MCP4921) may be fitted.
The synth model comprises a pair of wave-table oscillators which use independent wave-tables. The two oscillator outputs are fed into a "mixer" which scales and adds the two signals in a variable ratio. The mix ratio can be fixed, or it can be varied in time as the note progresses. The "contour" envelope shaper may be patched in to control the oscillator mix ratio. This capability is used to implement "waveform morphing", a technique used to vary the harmonic content of the sound with time. Waveform morphing can be used to realise a range of effects beyond what is possible to achieve with filtering techniques.
(See image: "REMI Synth Software Model".)
The pitch of the secondary oscillator can be "detuned", i.e. increased or decreased relative to the primary oscillator. The "detune" factor is a patch parameter having units of "cents", so that the detune resolution is 1/100th of a semitone. This feature greatly enriches the soundscape possibilities.
The synth can be configured to control the amplitude (loudness) of the note-in-progress in one of two ways:
(1) using a 5-segment envelope shaper having the classic "attack, peak-hold, decay, sustain, release" (AHDSR) amplitude profile, or (2) using breath pressure or other MIDI IN Control Change messages.
The first option (1) is intended for MIDI keyboard controllers and sequencers, while the second option (2) is intended for MIDI wind controllers (EWIs), in particular the REMI 2 handset.
The REMI synth can be programmed (patched) by the user to create a new sound, without needing to modify and re-compile the firmware. Details of REMI synth functionality and operation using the console CLI and front-panel GUI are provided in the Synth User Guide (attached).
A demo video and/or sample sound clips will be posted in a future update.
Construction
Construction of the PIC32 synth (mk3) is based on the 'PIC32-PINGUINO-MICRO' module from Olimex, priced at ā¬9.95. This module is available from major suppliers, e.g. Digikey, Mouser, etc, and from Olimex directly.
The Olimex MCU module is mounted on a base-board (PCB) named "MIDI Audio Module" (MAM), designed by a project collaborator, Jean-Pierre Meyer (in France). The MAM board has provision for MIDI IN and MIDI OUT interface circuits, audio output circuits (PWM or SPI DAC), IIC EEPROM, etc.
The board accepts connectors to interface various on-board or external sub-assemblies including: USB/UART adapter (console CLI port), headphone amplifier, graphics LCD module (128 x 64 pixels) and an optional control panel with 6 potentiometers used to set patch parameters. The board is powered by a 5V USB plug-pack (e.g. phone charger). It can also be powered via the USB/UART bridge module.
For details of construction, see the attached document: "REMI Synth Construction Notes".
Gerber files for PCB fabrication are attached. If there is sufficient interest expressed from prospective makers, a batch of blank boards may be made available for sale. Be sure to contact me if you are interested, and watch for further announcements.
Firmware
REMI firmware is built using Microchip PIC development tools - MPLAB.X IDE with XC32 compiler, free to download from Microchip's website. If you intend to modify or extend the firmware, you will need these tools. Otherwise, you just need to install the PIC programmer application ("IPE", included with MPLAB.X download) on your computer.
A PIC programming tool, Microchip PICkit-3, is required to install the synth firmware.
Low-cost PICkit-3 clones are available from online suppliers (e.g. AliExpress).
External Links
[1] REMI Project website
[2] Firmware Repository
Updates van de auteur