Project code, CAD files, and build guide

A MIDI baroque recorder/blockflute with responsive touch input using Teensy 3.6's capacitive touch enabled pins.

Design started:

  • December 2020

Build completed:

  • April 2020

Goals of this project:

  • Create a recorder/blockflute styled MIDI controller to allow access to a wider variety of sounds than a real recorder, and to allow for practice without disturbing the household.
  • Design with a focus on durability, ease of construction, low cost and portability.

What was learned from this project:

  • Breath sensing is easy. Quick and accurate breath sensing is really difficult.
  • Capacitive input works amazingly well when fast response is required, and space does not allow for quality buttons.
  • Simple is often better. Original designs used potentiometers, more control buttons, and greater options for expression, which when removed, left a much more friendly, playable instrument.


I went through many design revisions (both virtual and many physical) before arriving at a working configuration.

Finger input was originally handled via cheap momentary push-buttons. These are murder on the fingers however, and quick playing is nearly impossible. These were changed with photoresistors to detect when the finger holes were covered. Once the sensor threshold is dialed in, this works surprisingly well. Unfortunately, temperature seems to have an profound effect on the readings, and values would continue to drift during use until the instrument was unplayable. I also experimented with building load cells from copper clad PCB and conductive foam, but I could never get these to work reliably enough. I had almost given up on this project until discovering the Teensy 3.6 and it's touchRead enabled pins, which coincidentally exactly match the number of finger holes required for a baroque recorder.

Breath sensing was originally handled by blowing across a cheap condenser mic. However strong finger taps would frequently trigger accidental input, and it didn't take long for the components to become fouled with moisture and stop working. Breath input was then upgraded to a MPXV7002DP differential pressure sensor in a sealed chamber. Unfortunately, this part alone costs nearly as much as the microcontroller itself, and applying air pressure vs airspeed never really felt much like playing a wind instrument, no matter how much deliberate air leak was introduced. I eventually settled on a spare arcade button, if only to give a solid reliable input source to use for testing. To my surprise it actually works very well, but I think there is still room for improvement; possibly a DIY anemometer created from a small DC fan. More redesigns are likely to follow soon, but it's very functional as is, and as it's said, perfect is often the enemy of good.

Shopping list used for this build:

Note: In total, parts cost approximately $50 USD for this project without modifications, as built in 2020.

Teensy 3.6:

  • 1 x Teensy 3.6 or other Arduino compatible micro-controller with sufficient I/O pins


  • 1 x Sanwa OBSF-24 White

  • 6 x 6mm x 6mm x 10mm Momentary Push Buttons

  • 11 x Brass Plated Paper Fasteners (1/2" shank, 8mm head)

Panel Mount Jack:

  • 1 x Micro USB 5-pin Male to USB Type B 2.0 Female Extension Panel Mount Jack


  • 1 x Kit 22 AWG Multicolor Wire


  • 1 x Spool PLA Filament 1.75mm - Black

  • 1 x Spool PLA Filament 1.75mm - White

Build Guide:

Wiring Instructions:

Touch Pins:

  • Drill a small hole through the bendable ears of 11 brass plated paper fasteners.
  • Insert fasteners through the button slots leaving the round end on the outside of the instrument.
  • Measure and cut 9 wires for the front, and 2 for the back, to length, from the button slots to the neck piece where the microcontroller is housed.
  • Solder one end of each wire to the hole drilled in each of the 11 fasteners.
  • Hot glue the fasteners securely in place from the inside.

Momentary Push buttons:

  • Place a push button into each of the 6 locations in the rear body.
  • Measure and cut 6 wires to length from button slot to neck piece where the microcontroller is housed.
  • Solder one end of each wire to the top-outside lug of each button.
  • Cut wire to length, and solder the bottom-inside lug of each button together into a common ground.
  • Measure and cut a wire from the the top end of the common ground to the neck piece, and solder it to the lug.
  • Hot glue the buttons securely in place from the inside.

Arcade Button:

  • Cut 2 wires to length from the center of the mouthpiece to the neck piece.
  • Solder a wire to each lug of the arcade button. One will go to an I/O pin, the other to a GND pin on the microcontroller.
  • Snap the button into the mouthpiece.

Wiring everything to the Teensy 3.6:

Note: Left/right perspective is by looking at the face of the instrument with the button on it:

Strip ~5mm of shielding from the end of each the wires, insert through the VIA hole in the Teensy, and solder to the following pins:

Touch Pins

buttonFinger1Pin         = 29;   // Finger 1
buttonFinger2Pin         = 30;   // Finger 2
buttonFinger3Pin         = 23;   // Finger 3
buttonFinger4Pin         = 22;   // Finger 4
buttonFinger5Pin         = 19;   // Finger 5
buttonFinger6LeftPin     = 18;   // Finger 6 Left
buttonFinger6RightPin    = 17;   // Finger 6 Right
buttonFinger7LeftPin     = 16;   // Finger 7 Left
buttonFinger7RightPin    = 15;   // Finger 7 Right
buttonThumbLeftPin       = 0;    // Thumb Left
buttonThumbRightPin      = 1;    // Thumb Right

Momentary Push Buttons

octaveDownPin            = 7;    // Top Left Button
octaveUpPin              = 8;    // Top Right Button
programDownPin           = 11;   // Middle Left Button
programUpPin             = 12;   // Middle Right Button
droneTogglePin           = 9;    // Bottom Left Button
metaKeyPin               = 10;   // Bottom Right Button
Common Ground            = GND

Note: Don't forget to slide the neck piece in place before soldering the arcade button to the Teensy.

Arcade Button

breathButtonPin          = 32;   // Breath button
Common Ground            = GND

USB Panel Mount

Attach the USB panel mount to the bell, fold the cord to fit inside the body of the instrument, and connect to the USB port of the Teensy.

Final Assembly:

  • Once everything is in place, gently fold the wires so that everything fits inside the body when closed.
  • Cut a strip of vinyl electrical tape and wrap one layer around both top and bottom ends of the body, and another around the bottom of the mouth piece, folding a bit over the edge. This will hold the halves together, and allow for a friction fit without glue.
  • Gently press the neck piece, and the bell in place. The tape should provide enough friction to hold everything together.
  • Gently press the mouthpiece in place in the neck. Again, the tape should provide enough friction to hold it in place.

baroque recorder fingering chart: