MIDI Slide Whistle "MEMIDION" 

About the project

I tried to make slide whistle move automatically by MIDI signal. It is MEMIDION.

Project info

Difficulty: Moderate

Platforms: ArduinoSparkFun

Estimated time: 1 hour

Items used in this project

Hardware components

ToF Range Finder Sensor VL6180 ToF Range Finder Sensor VL6180 x 1
Tamiya Track and Wheel Tamiya Track and Wheel x 1
DRV8835 DRV8835 x 1
ProtoBoard Pro- Double Sided ProtoBoard Pro- Double Sided x 1
Mountable Slide Switch Mountable Slide Switch x 1
Genuino Uno Rev3 Genuino Uno Rev3 x 1

Software apps and online services

Reason Reason
Arduino IDE Arduino IDE


I tried to make slide whistle move automatically by MIDI signal. It is MEMIDION.

MEMIDION can be operated as a musical instrument by MIDI keyboard, and it can be used as a MIDI sound source by moving with DAW. But no sound unless you breathe in....

Control was done by Arduino which made it into a USB-MIDI device.


overall structure




1 / 2


Motor (Caterpillar) control via motor driver DRV 8835 at Arduino.

Measure the distance of the tip of the slider of the whistle with the distance sensor VL6180X to control the slide amount.

Arduino USB-MIDI device conversion

Write Moco for LUFA firmware to Arduino and let Arduino recognize it as a MIDI device.

the detail is right below.

Setting of DAW software Reason

Anything is OK if DAW can output MIDI, but we will use Reason this time.

Place the external MIDI instrument and select "MocoLUFA" for the device.

Arduino IDE Code

Move the slider of the whistle with the MIDI signal from the MIDI keyboard or DAW and change the scale. The slide amount is controlled by the measurement value of distance sensor VL6180X.

I used the following as a MIDI library for Arduino.

The library for distance sensor VL6180X is below.

#include <MIDI.h>           
#include <Wire.h>
#include <VL6180X.h>
uint8_t Note, NoteOld;
VL6180X sensor;
int meas;
int aim = 50;
int diff = 5;
int moveTime = 100;
void setup() 
 pinMode(2, OUTPUT);
 pinMode(3, OUTPUT);
void loop() 
 //MIDI detection
 if ( {
   switch(MIDI.getType()) {
     case midi::NoteOn:
       digitalWrite(2, HIGH);
       digitalWrite(3, LOW);
       digitalWrite(2, LOW);
       digitalWrite(3, LOW);
       Note = MIDI.getData1();    // Note = 48-72 ALESIS Q25
     case midi::NoteOff: 
       Note = 255;
 //Slide distance setting
 if(Note == 57) aim = 22;  //A
 if(Note == 58) aim = 33;  //A#
 if(Note == 59) aim = 41;  //B
 if(Note == 60) aim = 52;  //C
 if(Note == 61) aim = 62;  //C#
 if(Note == 62) aim = 71;  //D
 if(Note == 63) aim = 81;  //D#
 if(Note == 64) aim = 90;  //E
 if(Note == 65) aim = 97; //F
 if(Note == 66) aim = 103; //F#
 if(Note == 67) aim = 109; //G
 if(Note == 68) aim = 116; //G#
 if(Note == 69) aim = 121; //A
 if(Note == 70) aim = 126; //A#
 if(Note == 71) aim = 129; //B
 if(Note == 72) aim = 133; //C
 //Distance sensor measurement
 meas = sensor.readRangeSingleMillimeters();
 //Motor operation
 if(meas > (aim - diff) && meas <  (aim + diff)){
   digitalWrite(2, LOW);
   digitalWrite(3, LOW);
 }else if(meas > aim){
   digitalWrite(2, LOW);
   digitalWrite(3, HIGH);
 }else if(meas < aim){
   digitalWrite(2, HIGH);
   digitalWrite(3, LOW);


The amount of slide will change with the MIDI keyboard.

Automatic performance as MIDI sound source with DAW is also possible. My breath has to keep blowing....


Photo of electrouser918


We are family. hobby is D.I.Y!!


Leave your feedback...