In this project we will build a simple USB MIDI plug-and-play breath controller. It is designed using easy to find cheap components so that the total cost remains affordable and well below commercial equivalents. This is the basic version that only uses the air pressure sensor but the plan is to upgrade it to include a bite and nod/tilt sensor in the future.
The project assumes some very basic electronics and Arduino knowledge but even a beginner can build it as there is no soldering involved. Of course more advanced users can solder everything on a perma-protoboard. I am not covering installation of the IDE/libraries and instructions to upload code as there are excellent tutorials on the internet.
Oversampling is used to smooth out the sensor's input with very good results. You can also adjust the range to your liking and even dial in custom curves to adjust the controller's behavior.
Since the sensor can measure negative pressure too, there is a second stream of controller messages that is output when you draw in air instead of blowing. Both types of messages can be set by the user. For example you can set blow to pitch bend up and draw in to pitch bend down. By default both are set to controller no. 2.
Steps to build1. Insert the Arduino to the breadboard as shown in the photo/schematic.
2. Insert the sensor and op amp to their respective positions, notice the orientation based on the small indents on their sides.
3. Insert the resistors after cutting their legs to appropriate lengths.
4. Cut/strip the solid core cables and place them in their respective positions. I have used red for 5V, black for ground and yellow for signal in order to make this easier to understand but you can of course use whatever you have available.
5. Connect the mouthpiece, tubing, 3-way connector and aspirator as shown in the photo. You will need to cut a piece of the tubing for the "exhaust".
6. Press the 3-way connector so that it fits onto the sensor. It should stay put.
7. Install the Arduino IDE and install the two libraries needed (Oversampling and USB-MIDI) from Tools->Manage Libraries. Connect the Arduino with a USB cable to your computer. Upload the attached code.
8. You should be set, the Arduino should now appear as a MIDI device in your DAW/Music Software. Enable it and route it along with your keyboard to a plug-in that supports breath controller.
One physical drawback of this design is the saliva that will inevitably flow in the tube and can cause noticeable air flow fluctuations. The 3-way connector is used to address this issue by routing the saliva to the "exhaust" tube. To minimize trapped saliva in the tube, make sure that there is a continuous slope from the mouthpiece to the 3-way connector by adjusting the tubing length. If the tube hangs beneath the 3-way connector level, saliva will be trapped at its lower point causing fluctuations. The baby-side part of the aspirator including its filter is attached to the exhaust to minimize dripping as well as noise and increase the flow of air to the sensor.
In the code there are values that you can adjust to your liking, including custom curves. Comments describe how to do this. If you find it hard to reach the 127 point decrease the maximum range, or if it is too easy, increase it. Whenever you change values, you will need to reupload the code.
First few readings after Arduino boot are averaged to calibrate the rest position. Do not blow into the tube while connecting/resetting the device.
You can change the name of the MIDI device by editing the boards.txt file (info on how to do this for each platform is available on the internet).
Comments