Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a specific task I want to accomplish...I am trying to figure out if there is an a way of doing this. Basically, for a project I am working on, I want to create sound files for individual music notes.

So, for example, a piano playing a single "A" sound would be one file. A piano playing a "B" sound would be another file.

I would like to do this for a large number of instruments. I know that Mac OS has midi instruments built-in. I been able to create the sorts of files I am looking for by hand in Garage Band by playing a software instrument, saving the file, then altering the pitch.

This is time-consuming, however, and I think the process could be automated. Maybe if I could create a midi file with the command line and then convert that midi file to a sound file, I could do it with a shell script?

Does anybody have any recommendations to put me on the right track?

share|improve this question
up vote 1 down vote accepted

The solution that I used involved abc2midi and Amadeus Pro, although it seems I could have used FluidSynth if I wanted to go full command line. Basically, I made a template abc file that looked like this

%%MIDI program number
note z

then I replaced "number" and "note" with a shell script that looked like this


for i in {0..127}
    for j in C ^C D ^D E F ^F G ^F A ^A B c ^c d ^d e f ^f g ^g a ^a b c\'
        sed "s/number/$i/g" template | sed "s/note/$j/g" > $i$

for file in *.abc
    abc2midi $file

At that point, this basically gave me a folder full of midi files that I could then use a synthesizer to turn into wav files. Here, I batch processed them with Amadeus Pro (which is a commercial application).

I understand that a command line synthesizer like FluidSynth might have also worked, but this was only one (small) step in my project and I was trying to do this in the fastest way possible, not make the most elegant solution, so I didn't take the time to get that running and add it to my shell script.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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