Build the "REMI Synth" (mk3)
Monophonic MIDI Sound Synthesizer based on PIC32MX MCU

A DIY Project by M.J. Bauer

pic32 synth MAM pots

REMI Synth Module complete with LCD, button panel and pot control panel
(Photo courtesy of Jean-Pierre Meyer)

Overview

The REMI Synth is a digital monophonic MIDI-controlled sound synthesizer designed primarily for use with electronic wind instrument (EWI) MIDI controllers, in particular the REMI 2 handset.

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 also be controlled by a computer running music software such as a MIDI sequencer. 

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 etc (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" effects)
  • Effect modulation by breath pressure and/or modulation messages (CC1)
  • Filter with variable cutoff frequency and resonance, pitch tracking
  • Filter frequency control by MIDI expression, Contour Env, Mod'n (CC1), LFO
  • Reverberation effect

Synthesizer Design

The REMI synthesizer is implemented almost entirely in software, requiring minimal circuitry outside of the  microcontroller chip - 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, some resembling acoustic instruments. 

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. 

Software DSP computations use 32-bit normalized fixed-point numbers with 20-bit fractional part, allowing the application to run on 32-bit microcontrollers without hardware floating-point capability.

synth model

Synth Software Model
(To download full-size image:  Right-click and 'Save Image As...')

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.

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. If the detune factor is a fraction of a semitone, typically in the range 3 to 30 cents,  the resulting effect is known as "Voix Celeste" (heavenly voice). This effect greatly enriches the soundscape possibilities of the synthesizer.

In addition to the two wave-table oscillators, a low-frequency oscillator (LFO) is provided. The LFO can be used to modulate the audio oscillator frequency to implement vibrato, or the LFO can be used to modulate the oscillator mix ratio. In the latter case, the mixer envelope output level determines the modulation depth.

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, while the second option (2) is intended for MIDI wind controllers (EWIs), in particular the REMI-2 handset.

The firmware includes several "pre-defined" synth patches providing a good variety of instrument sounds. Any pre-defined patch may be assigned to any of the 8 Presets via the user interface (GUI or CLI).

How the Synthesizer is Patched

The REMI synth can be programmed (patched) by the user to create a new sound, without needing to modify and re-compile the firmware. Instead of using patch-cords, knobs and switches like a modular synthesizer, however, the REMI synth is patched by means of a set of numeric parameters... (see table below). 

A CLI command "patch" is provided for the purpose of setting patch parameter values. A user-created patch can be saved in non-volatile memory (EEPROM) for later recall. The stored "user patch" may be assigned to any of the (8) instrument "Presets".

The optional "Pot Control Panel" allows immediate adjustment of patch parameters.

Table 1: REMI Synth (mk3) Patch Parameters

Oscillators Mixer & Contour Env. Noise Gen. & Filter Ampld Envelope
OSC1 Wave-Table  Mixer Control source Noise Generator Mode
Ampld Envelope Attack
OSC2 Wave-Table  Mixer OSC2 Level (%) Noise Level Control source Ampld Envelope Peak 
OSC2 Detune (cents)
Contour Env Start Level (%) Filter Freq. Control source Ampld Envelope Decay 
LFO Frequency Contour Env Delay Time Filter Frequency / Offset Ampld Envelope Sustain (%)
Vibrato Depth (cents) Contour Env Ramp Time Filter Resonance Ampld Envelope Release 
Vibrato Delay/Ramp Time Contour Env Hold Level (%) Filter Note Tracking (on/off) Audio Level Adjust

The firmware also provides a utility for users to create their own wave-tables. A CLI command "wav" is provided for this purpose. 

REMI synth makers who are prepared to re-compile the firmware can add their own patches and wave-tables, limited only by the amount of MCU flash program memory. CLI commands "patch" and "wav" include options to dump patch parameters and wave-table data as C source code definitions. A future firmware revision is planned to support multiple "user patch" parameter sets (stored in EEPROM).

Details of REMI synth functionality and operation using the console CLI and (optional) front-panel GUI are provided in the Synth User Guide.


Sample sound clips made with the REMI synthesizer

(To download a sound clip:  Right-click on the name and choose 'Save Link As...')

Play Sound ClipRecorder (plain)  [1] Play Sound ClipBach_2-part Invention  [2]
Play Sound ClipStranger on the Shore  [3] Play Sound ClipBach_Joy of Man  [4]

[1] To be replaced with a better clip demonstrating the synth's response to breath pressure (CC02), this sample at least gives you an idea of the sound produced with the simple "Recorder" patch. Using "additive synthesis", the wave-table was populated with harmonics present in the spectrum of an acoustic recorder.

[2] In this sample, each of the two parts was played by a different REMI synth controlled by a MIDI sequencer. The bass part was produced by mixing two filtered sawtooth waves, one slightly detuned, to create a sound resembling that of a vintage analogue synthesizer. (The patch is called "Vinyl Cello".)

[3] This clip was produced using PreSonus 'Studio One' DAW (Prime - free version). The lead voice is a REMI synth with the "Reeded Woodwind" patch, modified to use the Contour Envelope instead of Expression (CC02) to control wave-form "morphing". All other instrument voices were played with "Presence" - the software synthesizer incorporated in Studio One.

[4] Same setup as clip #2, except the melody part comprises various "Hammond-ish" organ sounds changing during the sequence. Hammond organ sounds are easily synthesized (approximately) using wave-tables, because the organ tone-wheel mechanism is based on "additive synthesis". Accurate emulation of the Hammond tone-wheel mechanism, electronically, is not so simple.


Construction

Compared to the previous REMI Synth (mk2), the revised hardware design is much improved and easier to assemble. The earlier synth design was based on a PIC32MX340 micro-controller prototyping board made by Olimex.  Click here for details of the legacy REMI Synth mk2 design, if you are interested.

Construction of the REMI synth mk3 is based on the PIC32-PINGUINO-MICRO module (PIC32MX440 MCU) from Olimex (pictured below), priced at 9.95 (AU$17 approx). This module is available from major suppliers, e.g. Digikey, Mouser, etc, and from Olimex directly. (Check freight charges before commiting to order!)

PIC32 module, tiny

The Olimex MCU module is mounted on a base-board (PCB) named "MIDI Audio Module" (MAM), designed by REMI 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), I2C 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 a control panel with 6 potentiometers (to set patch parameters in real time). 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.

MAM plan view

MAM board assembled
(less LCD module, button panel and a few other options)

View synth schematic diagram

The complete synth build incorporates a front-panel user interface (GUI) consisting of a low-cost monochrome graphic LCD module and 6 push-buttons. The MAM board is designed so that the LCD module and push-buttons can be mounted on piggy-back PCB's which plug into connectors on the back (underside) of the main board. 

View/Download detailed Construction Notes (PDF)
___

synth MAM plus

REMI Synth Module complete with LCD, button panel and Pot Control Panel
(PCB designs by Jean-Pierre Meyer)

How to obtain PCB's to build a REMI synth

Gerber files for PCB fabrication are available to download... see links at end of page.

As well as the MAM base board, there is a piggy-back board to carry the LCD module and 6 push-buttons.

To reduce the parts cost and to simplify construction, the LCD module may be wired directly to the base board and the buttons mounted on a piece of prototyping board. This approach allows more flexibility for location of the LCD module and button panel in the enclosure.

If there is sufficient interest from prospective makers, blank boards may be made available for sale.
Be sure to email me if you are interested, and watch for further announcements.

___


REMI Synth 'Lite'

For REMI 2 players wanting more portability with their gear, I have designed a more compact, battery-powered sound module called the "REMI Synth Lite".

remi synth lite


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. Refer to the synth Construction Notes for more details on firmware installation.

Programming Tool

A PIC programming tool, Microchip PICkit-3, is required to install the synth firmware.
Low-cost (
€10, ~AU$15) PICkit-3 clones are available from online suppliers via AliExpress, eBay, etc. 

PICkit3


If you are interested in building a REMI synth module and/or REMI 2 handset, or if you have enjoyed following the project here, kindly send me an email. Support is offerred to readers who wish to build a REMI or similar electronic music device. [MJB]

link to email address

Last update: 12-July-2023

MJB Resources for Embedded Firmware Development

___