Build the "REMI Synth"
MIDI Sound Synthesizer using PIC32MX micro-controller

A DIY Project by M.J. Bauer

This post describes the design and construction of the "second generation" (mk2) REMI synth module.

There was a "third generation" (mk3) design using an Olimex 'PIC32-Pinguino-micro' module, but the Pinguino module was discontinued and is now hard to obtain, so the project web-page was removed. Note that the synth mk3 model was functionally identical to the mk2, the only difference being the MCU.
Information on the REMI synth mk3 design is still available from the author. Please send email inquiry.
Download firmware for the synth mk3 (PIC32MX440 Pinguino variant) here.

For a general introduction to the REMI EWI project, see: "Introduction to the REMI".

*** New for 2025 ***

Soon to be released... an alternative software synth application which runs on the same hardware platform as the REMI Synth (PIC32MX) described here. The new synth app is named "Sigma-6".

Preview the 'Sigma-6' synth design   

Also planned for development... a low-cost "digital voice module" (DVM) based on the Sigma-6 sound engine, without LCD and control panel. Several of these voice modules may be connected via MIDI to a computer or sequencer to play multi-track musical pieces. Each module may be set to a different program.
Alternatively, several Sigma-6 DVM's could be bussed via MIDI to a "master" controller to realize a simple but very competent polyphonic synth. The master controller will have a control panel of course.
The "Sigma-6 DVM" will be based on the STM32 "Blue Pill" or other low-cost readily available 32-bit MCU dev board supported by Arduino IDE, allowing makers to extend or migrate the software as desired.

(Your comments are welcome... email me!)


Synth mk2 with pots

REMI Synth 'mk2' prototype with optional (removeable) Pot Control Panel

Overview

The REMI Synth Module is a digital monophonic MIDI-controlled sound synthesizer intended primarily for use with electronic wind instument (EWI) MIDI controllers, in particular the REMI 2 handset. However, the synth  works equally well with a MIDI keyboard or any EWI controller with a standard MIDI connection. 

Using a low-cost MIDI-USB adapter, the REMI Synth can also be controlled by a computer running music software, for example a MIDI sequencer or DAW (Digital Audio Wankstation). 

Features

  • High quality audio output: 40kHz sample rate, 32-bit precision DSP
  • High accuracy oscillator pitch for musical application
  • Dual wave-table sound synthesis with mix-ratio modulation (morphing)
  • Command-line interface (CLI) for setup and patching (using PC as terminal)
  • Graphical user interface (2.5" monochrome GLCD, 128x64 pixels) - optional
  • Control panel (6 potentiometers) for setting patch parameters - optional
  • Instrument presets (8) selectable from GUI, CLI or MIDI input source
  • User-programmable synth patches and wave-table creator (using CLI)
  • Noise Generator and Noise Filter (for "pitched noise" effects)
  • Effect modulation by breath pressure (CC2) 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
RH side panel
Right-hand side connector panel

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.

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
(Click on the picture to view/download full-size image)

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 and sequencers, etc, 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 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 synth

(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

Following is a description of the author's prototype as built. There is enough information given here to allow experienced electronics hobbyists and professionals to replicate the synth design. Detailed information such as step-by-step instructions, parts lists, etc, are not provided.

The REMI synth hardware design is based on a PIC32-MX340 proto board made by Olimex, priced at AU$23.30 from Digikey, or €12.95 direct from Olimex. Other suppliers may still carry stock. The PCB design files may be available from Olimex on request, so you can get your own bare boards fabricated.

The Olimex board has a prototyping area on which parts can be added for the MIDI IN and (optional) MIDI OUT interface circuits, PWM audio output circuitry and I2C EEPROM (24LC08). A 5V regulator (LM7805) is needed for the audio and MIDI circuits and (optional) LCD panel. A separate little proto board may be added to carry a headphone amplifier and volume control if desired.

If you get your own PCB made (Olimex clone), or if you design and assemble a custom PCB, note that some of the components fitted on the Olimex board may be omitted, for example: the 'UEXT' and JTAG pin headers, 32kHz crystal (Q2), the RS232 driver/receiver IC (U2, ST3232) and DE9 connector. A USB-Serial adapter (FTDI FT232 breakout module with 3.3V I/O signals) can be interfaced directly to the MCU UART2 TX/RX pins to implement the CLI serial port. The on-board user button (BUT) and LED are also redundant.

View synth schematic diagram

NB: The schematic shows EEPROM type 24LC64, but the firmware supports type 24LC08-B only.

The complete module incorporates a front-panel user interface (GUI) consisting of a low-cost monochrome graphic LCD panel and 6 push-buttons. The LCD module and key-switches are wired directly to I/O pads on the Olimex PIC32 board. This is the quickest and easiest wiring method. (See internal view below.)

NB: Provision of a front-panel (LCD module and push-buttons) is optional. The REMI synth can be operated completely with the CLI alone. The firmware adapts itself automatically if the front-panel is absent.

PIC32 synth proto
Olimex PIC32MX prototype board with REMI add-ons (excluding optional LCD panel)

A suitable LCD panel is available from Sparkfun. Compatible LCD modules are available at lower cost from online suppliers via Ali-Express. The preferred type of LCD module has overall dimensions of 75 x 53 mm and dot pitch = 0.4 mm. The LCD controller chip-set must be KS0108/09. The module has 20 pins.

GLCD 128x64 KS0108

Internal view - lid off

The internal view above shows the LCD panel and push-button board wired to the PIC32 MCU board. Also shown are the MIDI sockets and volume control. A pre-built headphone amplifier (breakout board with TPA6112 IC) was fitted on the prototyping board later, as shown in the photo below.

Synth headphone amp board

Boards are mounted on plastic spacers or standoffs. The PIC32 MCU board and audio output board are mounted on the bottom panel of the box using 20mm x M3 machine screws (countersink heads). Standoffs for the LCD module and button board are glued to the inside of the lid (with 5-minute epoxy) so that screw heads are not visible on the outside.

Pot Control Panel

The synth firmware supports a “Pot Control Panel” comprising 6 x 10k linear (B-10k) potentiometers connected to MCU analog inputs.  Provision of a pot panel is optional and it may be implemented as a separate plug-in module which can be removed and reconnected when required, as shown in the photo at the top of the page. The prototype synth box has a DE9-P (male) connector added for this purpose.

When a Pot Control Panel is connected, up to six active patch parameters can be adjusted at a time. The current values of 6 parameters are displayed on a GUI screen. The GUI incorporates four Control Panel screens, allowing all 24 patch parameters to be adjusted.  Patch parameter values do not change unless their associated pot knob is moved.  Refer to the Synth User Guide for details of control panel operation.

The diagram below shows how the 6 pots are wired to MCU analog inputs. Pot signals POT.IN1 thru POT.IN6 are wired to ADC inputs AN0/RB0 to AN5/RB5 respectively. Jumper input 'HW-CFG1' (MCU I/O pin RB9) must be connected to GND to enable the Pot Control Panel functions in the firmware. The jumper input should be open-circuit when the pot panel is removed.

pot panel cct

LEFT SIDE VIEW

Left side panel of prototype showing modified ICSP header protruding thru a cut-out
and DE9-P connector for attachment of Pot Control Panel.


User Guide  

Details of REMI synth functionality and operation are provided in the Synth User Guide.

___


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).

The latest firmware release can be found on GitHub - see link below.

Programming Tool

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

PICkit3


If you are interested in building a REMI synth and/or EWI controller, or if you have enjoyed following the project here, kindly send me an email.
Support is offerred to readers building a REMI or other device based on projects posted on this site.

link to email address

Last update: December 2024

MJB Electronic Projects - Index

___