Go Down

Topic: ttymidi - software for MIDI-through-USB for Linux (Read 11140 times) previous topic - next topic


Hello, well, I tried reporting a bug on launchpad, but I'm getting "ttymidi doesn't use launchpad as it's bug tracker", so in the meanwhile I'll report here.

I had ttymidi working ok some months ago on my laptop with Ubuntu + arduino. Now I moved to Archlinux and I'm getting strange behaviour. The ardumidi_test the other day worked sometimes yes others no, today I can't get it at all working. It's strange: it compiles, it uploads, and the led blinks correctly (If I change the delay time I see the led blinking accordingly).
Then I run from the source ttymidi directory:
./ttymidi -s /dev/ttyUSB0
and then I connect, in Qjackctl, the out of ttymidi to amSynth. As said, sometimes it will work and I'll here the sound, others it just won't. All the times the synth is working correctly, I'm testing it with vkeybd (a virtual keyboard program).

This is really strange and I am sorry/frustrated I can't get any more details. Could I get some significant output of ttymidi?

Could this somehow be related to udev? (Just guessing)

Also, this may be known and not related to my problem, I noticed that while ttymidi is running, I get an avrdude error if I try uploading another sketch on arduino; I have first to quit ttymidi.



Oct 13, 2009, 07:20 am Last Edit: Oct 13, 2009, 07:30 am by tvst Reason: 1
Hi Nareto. I have fixed the problem with Launchpad. Thanks for reporting it. Now, about your problem:

1) Try installing the default ardumidi sketch, then running ttymidi with your usual settings (something like ttymidi -s /dev/ttyUSB0 -b 115200) and also add the -v argument for verbose output. This should print something like:

$ ttymidi -s /dev/ttyUSB0 -b 115200 -v
0x90 Note on            000 060 127
0x90 Note on            000 075 127
0x90 Note on            000 079 127
0x80 Note off           000 060 127
0x80 Note off           000 075 127
0x80 Note off           000 079 127
0x90 Note on            000 060 127
0x90 Note on            000 075 127
0x90 Note on            000 079 127

If you don't see this, then there's a bug either in the arduino code or in serial part of ttymidi. (This could also mean there's a problem with your arduino or serial port.) So let me know if you don't see the output above so I can run some more tests.

2) If you see the messages above, then there could be a bug in the midi part of ttymidi, or maybe something wrong with your setup. Try this:
- download and run the program called "QSynth". This is the only program I know of that reports when it receives midi input, so this is what I use to debug.
- Connect QSynth to ttymidi (either using qjackctl or whatever other method you prefer).
- The black orb icon next to the plus sign at the bottom of QSynth should start blinking, indicating that it is receiving midi messages from ttymidi.

If you see the blinking, then ttymidi is working properly and the problem is somewhere else. Otherwise, make sure other midi programs are communicating correctly by connecting them to QSynth and verifying that the orb blinks for them.


Also, only now did I get around to checking bolloyo's bug report (from earlier in the thread).

All programs (instruments) work fine on my side. I just tested them.


Hello tvst. I'm not getting that output at point 1. I compiled the ardumidi_test.pde file present in the sources, uploaded it on the arduino and ran exactly
./ttymidi -s /dev/ttyUSB0 -b 115200 -v
and I'm getting no output at all. I tried it on different usb ports on the pc, same result.
I have to admit I don't quite know what the baud rate is, but I could have messed with that with other sketches... Anyways to my understanding the ardumidi_test.pde is setting the baud rate to 115200 so: 1 that should override previous settings on the arduino and 2 the -b 115200 option in the command should be right..

If it is the Arduino having some part damaged, how could I find out? Thanks for the help  


Try this:
1) Run the Arduino programmer app on the PC
2) Install the default Ardumidi sketch
3) Click on the "serial monitor" icon
4) Do you see some crazy characters coming in at the bottom of the window? (seeing crazy characters is the correct behavior, since the Ardumidi sketch sends out binary numbers that do not translate to ASCII letters or numbers.)

A few other things, just to clarify:

In your previous message you said "If I change the delay time I see the led blinking accordingly". What does that mean? The LEDs should blink once per second using the default Arduino sketch. No changes should be necessary. The LED labeled "TX" always blinks whenever some data is transmitted to the PC.

Can you tell me which Arduino you're using? Is it Diecimila, or some Arduino-compatible clone? Maybe it doesn't support 115200 baudrate?


In the serial monitor, with baud rate set to 115200, I do get a short string of crazy characters approx every half a second. The characters print from the top of the window though, not from the bottom.

I meant that if I modify the delay time in the ardumidi_test sketch the change actually takes place in the blinking period of the led on pin13. I said this because it's a clue for what my problem is not.

I'm using straight Arduino Duemilanove, bought it.


The good news is that I think your Arduino is fine. The problem is somewhere in the OS+ttymidi combination. I will add some additional debugging options to ttymidi and get back to you.


Ok: Redownload ttymidi and run it with the new -p argument. Then tell me what you get.

$ ttymidi -b 115200 -s /dev/ttyUSB0 -p


Downloaded (btw on varal.org the link still says "get ttymidi v0.21 here"), compiled ttymidi, compiled ardumidi_test, uploaded, but no output:

./ttymidi -b 115200 -s /dev/ttyUSB0 -p
Super debug mode: Only printing the signal to screen. Nothing else.

I still get activity on arduino's serial monitor (I have to kill the above command first - I mean it's probably sort of grabing the device and not making it avaiable to arduino's serial monitor, isn't it?)

The only strange things I note is that sometimes the TX led stops blinking; it restarts blinking as soon as I open the serial monitor and even when i run ttymidi with the command above, then after some 20-30 seconds it stops


Well, I'm stumped. For some reason ttymidi can't read your serial port. At all.

Do you have SE Linux or something of the sort protecting your ports?

Also, can you try running ttymidi as root? (you shouldn't have to, but maybe there's some issue with permissions somewhere that I'm missing)


Well, I'm stumped. For some reason ttymidi can't read your serial port. At all.

Do you have SE Linux or something of the sort protecting your ports?

Also, can you try running ttymidi as root? (you shouldn't have to, but maybe there's some issue with permissions somewhere that I'm missing)


I have Arch Linux... I have just installed latest kernel from the repos but still same situation, even as root. I'll take some time testing with the system. Even when I wrote the first post, that day I remember that sometimes it was working, so it may be that something that seems totally unrelated is conflicting... don't know, I'll trial and error and hope to come back here soon

(many thanks for the help till here)


Hi everybody,

First thanks for this software. It helps me a lot starting Arduino + Midi project.

My current setup is:
  • Arduino Duemilanove - Arduino 017
  • Ubuntu Studio 9.10
  • ttymidi 0.21 - connected to Timidy thru Jack

Running the midi test, I get some this strange behavior:

If I run Arduino serial monitor before running ttymidi everything -> OK.
If I run ttymidi without first running Arduino serial monitor -> KO.

Is this a normal behavior, a bug or should I configure something ?
What about auto-reset ?

Tx, Stephane


That is not expected behavior, but right now there are some bugs going around on the latest Linux kernel in Ubuntu (and maybe other distros too) that is screwing with the USB-serial behavior. So I'm not going to even try to debug this until the Ubuntu kernel is fixed.

The good news is that Nareto's problem (above) was probably also related to the same kernel bug. I ran into it myself when I updated to 9.10. Then I found this solution in this forum: http://ubuntuforums.org/showpost.php?p=8354600&postcount=10 . All it does is compile the new version of the ftdi_sio kernel module.

The annoying part in that the solution is that takes a while to compile. So I'm providing here the file I compiled on my machine. It will only work if you're using a 32-bit Intel build:

(compiled for Linux 2.6.31-15-generic)

Use it like this:
sudo rmmod ftdi_sio
sudo insmod ./ftdi_sio.ko

I hope this helps.


How does it work if, for example, i want to send Midi data From MidiYoke?
i'm on windows i would like arduino to receive data from midi-yoke (from usb).

thank you so much!

please email me at jkone27@gmail.com if you have an answer! or suggestion

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131