I use a program that generates raw MIDI events interpreted and played by an external hardware synth connected via USB cable. This works great, but sometimes I wish to use the same program with a software synth, like Timidity++, especially when composing out of home and don't have the heavy hardware synth with me.

The problem is the program I use expects to talk to a device like hw:2,0,0 while softsynth open only MIDI port like 24:0. Can I bridge the difference and use the program with a softsynth too? How?

New contributor
Antonio Bonifati 'Farmboy' is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

To bridge from a raw MIDI port to a sequencer port, load the snd-virmidi module to create a virtual raw MIDI port, tell that program to use it, and connect the corresponding sequencer port to the soft synth (with aconnect).

If possible, your program should be changed to use the ALSA sequencer API instead.

  • Thanks a lot for your suggestion. I did not need to load the snd-virmidi module, but you suggested me the programmative equivalent. In my C program I use "virtual" as the device name when I call ALSA's snd_rawmidi_open to open a raw MIDI port. Then I can simply use the arecordmidi utility to get a MIDI file from this port. The only trick is to guess the port number in advance, but I think I will make my program to start and stop arecordmidi itself and generate the MIDI file without having to write additional code to support the MIDI format directly! – Antonio Bonifati 'Farmboy' Feb 9 at 15:33

Your Answer

Antonio Bonifati 'Farmboy' is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.