Build the "REMI"
Rudimentary Electronic Musical Instrument

A DIY Project by M.J. Bauer

This is the original article on the REMI project, as posted on Elektor Labs website. Since the project was first published, alternative versions of both the handset and controller module have been developed. The newer versions most likely will be more appealing to the majority of prospective REMI makers.
Go to updated REMI article

Original (alpha prototype) REMI Controller Module
with handset (version 1) which used a "binary" fingering scheme


The concept for the "REMI" came from a desire to create a simple but practical musical instrument which is easy to learn to play. An early design decision was to model the REMI loosely after existing “electronic wind instruments” (EWI's) using touch-sensitive pads for the “keys” to select the pitch of notes. A breath pressure sensor allows notes to be articulated by blowing into a mouth-piece. However, it was decided that the REMI should also be playable just by changing finger positions on the “keys” (touch-pads), without blowing. Played in this mode, the instrument allows the player to sing along.

A major design decision was that the REMI need not emulate the fingering scheme of a  traditional wind instrument such as the saxophone, clarinet, flute or recorder (although a few minor design changes would make this possible). These instruments have complicated fingering schemes, of necessity, due to the physical properties of air columns made to produce sound. In contrast, electronic sound-generating devices are not constrained by such physical properties. Hence, a simplified “binary” fingering scheme (shown below) was devised for the generic REMI to minimise the number of combinations of finger positions required to produce notes on the chromatic scale.

REMI generic fingering chart

The instrument may consist of two main parts: a "handset" incorporating the touch-pads and other playing sensors and controls, plus a "controller module" housing a micro-processor, MIDI and audio circuitry and user interface components (LCD screen and keypad).

It was decided that the generic handset will have eight "keys" (touch-sensitive pads) on the upper playing surface, four of which are operated by the fingers on the right hand to select one of 13 notes in an octave (C-to-C), while three other "keys" are operated by fingers on the left hand to select one of seven octaves. One extra touch-pad operated by the 4th finger on the left hand may be assigned to a momentary effect such as vibrato.

Notes may be triggered (initiated) either by blowing into the mouth-piece (breath pressure sensor) or simply by changing the fingering pattern on the touch-pads. The latter option is called "touch trigger mode". The note trigger mode is a function of the instrument "preset" selection, which is user-configurable and maintained in non-volatile memory (EEPROM).

A “modulation lever” (linear slider pot) typically operated by the thumb can be assigned to control one of a number of patch parameters, for example “pitch bend” or filter corner frequency. In "touch trigger mode", however, the modulation lever would normally be used to vary the loudness of the note in progress.

A push-button switch on the under-side of the handset, operated in conjunction with the RH touch-pads, selects one of several instrument "presets". The presets are chosen from a larger number of available instrument patches built into the micro-controller firmware, by means of a setup function in the user interface. The "presets" also select one of a group of MIDI "programs" (instruments) for use with an external MIDI sound module.

Another design objective was that the controller module should incorporate hardware and software capable of generating a variety of instrument sounds, so that the REMI can be used "stand-alone", i.e. without needing to be plugged into an external MIDI synthesizer or computer. A socket is provided for audio line output to an amplifier or headphones.

The controller module provides a MIDI output (5-pin DIN socket) for direct connection to a MIDI synthesizer or sound module, or to a personal computer via a MIDI/USB adapter.

The parts to build a REMI should cost much less than a commercial EWI.

REMI source code will be made freely available (for non-commercial purposes) allowing makers to tailor the firmware to suit their own design variants.

MIDI Controller

The MIDI OUT (transmit) command set includes: Program Selection, Note-On/Velocity, Note-Off, Channel After-touch (pressure), Pitch Bend (modulation), Control Change, All Sound Off and System Reset. The REMI can be set up to use any one of the 16 MIDI channels.

In normal note trigger mode, the REMI will send a Note-On/Velocity command when the breath pressure exceeds a preset threshold. A corresponding Note-Off command will be sent when the breath pressure drops below the "note-off pressure level". After a new note is initiated, a change in fingering pattern will cause another Note-On/Velocity command to be transmitted without first sending a Note-Off. If the external MIDI sound module is set to Mono mode, this should cause the module to produce a different note, i.e. to change pitch, without "re-attacking" the amplitude envelope. The musical term for this is "legato".

In "touch trigger mode", a new note will be initiated whenever the fingering pattern changes, as long as (or when) one or more of the octave touch pads is also pressed. After the first note is triggered, a Note-Off command will be sent for each note change (before sending a new Note-On) to release the note already sounding. Hence, the envelope shaper will be forced to "attack" for every note played. In this mode, the modulation lever typically controls the loudness of the note. The REMI will send "velocity" and "after-touch" data accordingly. Depending on the selected preset, legato mode may be enabled by the “effect” touch-pad.

Every time a new note is triggered, the position of the modulation lever (linear slider pot) is "re-calibrated" (set to zero), assuming the lever is assigned to the pitch bend function, so that the pitch of the note will be "in tune" as long as the lever position stays put. This scheme avoids the need to construct a complicated “spring-return-to-centre-position” mechanism.

If the PRESET button is pressed while none of the touch-pads is touched, the REMI will transmit an "All Sound Off" command followed by a "System Reset" command. This operation also "zeroes" the modulation lever. Otherwise, if the PRESET button is pressed in conjunction with one or more RH touch-pads, a "Program Change" command will be transmitted. The Program Number sent depends on the user-defined "Preset" configuration".

Built-In Sound Synthesizer

REMI's built-in sound synth will be implemented largely in firmware, requiring minimal additional electronic circuitry -- just a PWM-controlled filter and PWM-controlled signal attenuator in the audio output circuit. To generate audio tones, REMI will use a "wave-table oscillator" offering a selection of arbitrary waveforms which can range from very simple to quite complex. A PIC32MX processor clocked at 80MHz makes possible a sampling rate of 20kHz with 12-bit sample values.

The basic synth model includes, in addition to the wave-table oscillator, a low-frequency oscillator (LFO) used to modulate pitch (for a vibrato effect), a noise generator with variable output level mixed with the oscillator output, plus an analog filter with a roll-off slope of -12dB per octave. The filter can be switched to low-pass or band-pass mode. The corner/centre frequency is variable over a three decade range (10Hz ~ 10kHz) by means of a PWM signal generated by the MCU. The filter can be made to track the pitch of the oscillator, or it can be set to a fixed frequency. The filter has a dedicated envelope shaper allowing the timbre (harmonic content) of the sound to be varied in time as the note progresses.

The amplitude (loudness) of the note-in-progress can be varied with time in a variety of ways depending on the instrument patch. A five-segment envelope shaper provides an "attack, peak, decay, sustain, release" (APDSR) amplitude profile. In addition to the envelope shaper, amplitude can be controlled by the breath pressure sensor signal, or by the "modulation lever" signal, depending on the selected Preset.

Controller Module Design & Construction

The author's first prototype REMI controller module (pictured) was built around a PIC32-MX460 development board made by Olimex plus an I/O extension board implementing the handset interface, MIDI output driver and audio signal processing circuitry. The MCU module also incorporates a "local user interface" (LUI) consisting of a low-cost monochrome LCD screen and 16-button keypad. The LUI provides facilities for instrument preset/patch configuration (built-in sounds), master volume control, MIDI controller setup (channel and preset/program selection) and so on.

The firmware also includes a command-line user interface (CLI), accessible via the "RS-232" serial port provided on the MCU board. The CLI is intended mainly for firmware development, diagnostic and testing purposes, but may also provide some "end-user" facilities.

Alpha Prototype Controller Module based on Olimex PIC32-MX460 Development Board

A more refined "beta" prototype MCU module will use a PIC32MX340 micro-controller, which has much the same spec's as the 'MX460 except that the 'MX340 has no USB peripheral. If needed, MIDI-USB device capability can be achieved easily using a low-cost MIDI-USB adapter cable.

There is an option shown on the schematic to omit parts of the audio circuitry to reduce the construction effort. The reduced version removes the band-pass mode from the PWM-controlled filter. Experimenting with the built-in sound synthesizer will reveal whether it may be worth the extra effort to include the band-pass filter option. The audio circuitry may be omitted altogether if the built-in sound synth is not wanted.

Alpha Prototype I/O Extension Board -- connects to PIC32-MX460 MCU Board

The LCD module chosen for the prototype uses an ST7920 display controller chip with a monochrome back-lit graphical LCD screen of 128 x 64 pixels. Equivalent types are readily available at low cost from online suppliers, e.g. Ali-Express. Be aware that LCD manufacturers make design variations in, for example, supply voltage (3.3V or 5V), connector pin-outs and external wiring requirements. A contrast adjust trim-pot may or may not be needed. Follow the application example for 8-bit parallel bus operation in the data-sheet.

A 16-button numeric keypad (wired in a 4x4 matrix) is interfaced to the micro-controller using only four wires. This scheme works by using ADC voltage readings to determine the row and column addresses of a key when pressed, in similar manner to reading a resistive touch-screen. The 4-wire keypad interface requires six resistors to be wired between the external keypad terminals, as shown in the diagram.

Prototype Handset housed in a gutted reincarnated AC power-board (inset)
The mouth-piece was formed from 12mm garden irrigation tubing

Handset Design & Construction

The generic REMI handset comprises 8 touch-pads, an air-pressure sensor (Freescale MPXV4006-GP), linear slide potentiometer for the modulation lever (e.g. Bourns PTA3043-2010CIB103) plus a push-button switch for PRESET selection, etc. The touch-pads are wired to a Freescale MPR121 capacitive touch sensor IC breakout board from SparkFun, interfaced to the MCU via an I2C serial bus. The handset is connected to the MCU via a 6-wire cable (including +5V DC power, 2-wire I2C bus and 2 analog sensor signals).

"Modulation Lever" sub-assembly with PRESET button and status LED

Handset Circuit Board

The simplest way to make the touch-pads is to use small machine screws (round-head, flat-head, countersink, according to personal preference) inserted into the handset playing surface (an insulating material, e.g. plastic or wood), with solder lugs for wiring to the MPR121.

Alternatively, touch-pads may be formed into a piece of blank PCB laminate, mechanically etched by hand using a Dremel-style power-tool with a small burr, about 1.5mm. The author’s prototype handset (pictured) was made using this method. The enclosure was made out of a gutted AC power-board with the unwanted holes filled with "Plasti-Bond" (2-part epoxy resin). This seemed like a good idea at the time, but took more time and effort than anticipated. With the benefit of hindsight, I don’t recommend this idea. Also, the positioning of pads on the prototype handset was not quite optimal.

Details of a simpler method of construction of the handset, plus a drill template/drawing for locating holes for the touch-pads, will be given in a later post.

Pressure Sensor “plumbing”

Tubing and other bits and pieces needed to make the airways inside the handset may be sourced from the garden irrigation section of your local hardware store. The prototype handset (pictured) used clear nylon tubing (3mm ID, 5.5mm OD) for the internal airways linking the mouth-piece, pressure sensor IC and the "drain tube”. The T-joiner needed the barbs cut off to fit the 3mm tubing. The mouth-piece was formed out of 12mm black irrigation tubing, using a hot-air blower. (There were a few rejects!)

It is not essential to make a special mouth-piece. For simplicity, it suffices to blow directly into a length of nylon tubing extending out of the top end of the handset. It is left to the maker's ingenuity to devise a more stylish mouth-piece arrangement, if desired.

The sensor air inlet barb is slightly less than 3mm in diameter, which is a wee bit too small to make a good seal with the 3mm ID nylon tube. An easy solution is to fit a short bit of 2.5mm (nominal diameter) heat-shrink tubing over the barb, shrink it with a hot air blower or whatever (taking care not to melt the sensor!), then fit the 3mm nylon tube over it.

A drain tube is recommended because moisture condensation occurs inside the airways and it is probably sensible to provide an exit for the moisture rather than let it accumulate. Also, the drain tube allows air-flow, which is preferable to a sealed system for playability. However, the exit air flow needs to be restricted somewhat to produce a sufficient range of pressure inside the sensor. This can be achieved by fitting into the end of the drain-tube a small plug with a 2mm hole through it, perhaps cut from a bit of plastic insulation sleeving if you can find some of suitable size (3mm OD, 2mm ID).

Go to updated REMI article