Saturday, February 26, 2011

Taiko Synth - Phase I

Taiko drums are quite expensive. I only get to play them in class, but I want to practice at home. Some people just use a large bucket strapped with duct tape, but of course that's not going to sound quite right.

I'm making a variant of the bucket idea, but on top of the bucket with be a soft surface with some kind of piezo or resistive sensor to detect strikes to the head of the drum. Around the edge will be soft plastic tubing (like Tygon), capped at one end and with a small microphone or pressure transducer inserted into the other end. This will be used to detect the カラ hits. An Arduino will detect the hits, and convert them to the appropriate MIDI messages and send them to a PC running a synthesizer application.


The first step is to install the synthesizer onto the PC. I'm running Ubuntu, so I added Timidity from the software archive.

The Arduino is going to need to talk to Timidity through USB serial. Timidity doesn't know about USB serial - it usually receives data from a MIDI controller. Fortunately, Thiago Teixeira has written a excellent tool called ttymidi. It can be downloaded here.

http://www.varal.org/ttymidi/

Grab the whole package. The ardumidi libraray in the package will be useful on for the Arduino part of the system. Extract the ttymidi code and compile it. It's a good idea to read the source code first, just to make sure it's safe. More or less follow the instructions in the readme file.

Copy the ardumidi library folder to the Arduino /libraries folder. Copy the example program to the sketchbook and compile.

Running the Arduino IDE and ttymidi on the same box doesn't seem to work real well because I think they both want to use the same port. It kind of a hassle working on two boxes. I need to look into how to switch back and forth easily.

Now disconnect from you IDE box and connect to the box running Timidity. On my system, Timidity was started automatically so I was able to omit that step.

Start ttymidi.

./ttymidi -s /dev/ttyUSB0 &

It's not always clear what port the Arduino is on, especially if you are disconnecting and reconnecting it. Look in the /dev directory and see how many USB devices there are and try each one if you have to. Also remember process number so you can kill ttymidi when you need to reconnect the Arduino and restart ttymidi.

Now connect ttymidi to Timidity.


aconnect -i
aconnect -o
aconnect 129:0 128:0
or whatever input and output ports are reported respectively.

Restart Arduino and it should start playing notes.

No comments:

Post a Comment