Introduction: Automatic Flute
The idea is to automate a flute to be able to play by itself making use of electronics and design.
We are going to send songs in Midi format (Digital Interface of Musical Instruments) from our computer to the Arduino, this will interprete the message from the created code, and get move the solenoids which serves to create the Melody.
Before we start with this project, you need to know that Midi is an universal system to communicate in a standardized digital musical instruments and other instruments that use this protocol, regardless of who the manufacturer. It is not only limited to music and sounds, but also serves to control other things such as lights or motors.
Midi files do not generate sound. A midi file is a message of three bytes: the first one carry the type of message and the channel, the second is the pitch and the third is the velocity. We only need the first, the pitch.
Another important thing is that to be able to send and receive messages, we have to download programs like Cuba or Ableton, in my case I use Ableton and instead of using an Arduino board I am going to use a Teensy board.
We use Teensy board, as this board is able to set the communication to midi without the need of updating the firmware.
In the design we have eight pieces in which the solenoids are going to introduced, a kind of buttons that will stick to the solenoids, those will serve to cover the holes of the flute and a piece that joins the mouthpiece of the flute with an air compressor, but this one is optional.
Step 1: Print the Designs
We start with the part of the design that is the one that takes the longest time to finish. You just have to download the files of the pieces, these are in ".gcode" format, you can find them at the end and print them on a 3D printer.
Step 2: Configurate Arduino and Teensyduino
Once you have the pieces printed, we start with the electronic part
Download the Arduino software from the official website, once installed on your computer, download Teensyduino, as well you can find it on Internet.
Now you just have to download the code made in Arduino to work correctly, in the code is explained step by step what it is doing.
You can see a short video about how you can configurate the arduino with teensyboard, in there you can see which option you have to choose in Arduino tools.
Step 3: Build the Circuit
Now we are going to build the electronic circuit of the solenoids. In the following diagram you can see how the electronic components have to be connected, it is very simple
It is recommended that before you build the
previous circuit, test the code with LEDs, to check that it works correctly.
Before you print the PCB with Othermil machine, you have to install Otherplan program and in my case I used the configuration of the photograh
Step 4: Send Midi Messages
Once we have set up the circuit, we have finished printing all the pieces and placed them on the flute, we open our Arduino code and the Ableton program, in my case. After that we connect the Teensy board to the computer with a simple USB cable.
In Ableton we add the song, in Midi format, that we want to reproduce. It is very important to add it in "external instruments". We also have to make sure that Ableton is connected to our Teensy board, so we go to "Preferences" to make sure.
And it has just left to push the button “ play” to see if your project works.
In the following video you can see much better how to connect everything in Ableton correctly.
Step 5: Material Necessary
We just need the next material:
- 8 transistors Tip 31C
- 8 diodes
- 8 resistors of 330 ohms
- 8 solenoids
- Teensy board 3.2
- USB cable
Step 6: Files of the Project
All necessary files to make the Project works.
- Solenoids code.ino