First post in a while! Anyway, I was playing around with libao, and I ended up creating a simple program that plays a string of notes on the command line. The only limitations I can think of are that all notes need to be the same length and there are no flats or sharps. There is also a clicking noise in between notes, but I kind of like this as it makes it so consecutive identical notes don't just sound like longer single notes.
The syntax is pretty simple. You run the program with a string of notes as the first argument, and an optional note length (in seconds) as the second argument. As for the string of notes, any letters from A to G play their respective notes, and + and - go up and down an octave respectively. Any other characters act as rests, pausing for the same amount of time as one note.
Here's a link to the source code: http://pastebin.com/4Bwr5hiv
Remember; you need libao (http://xiph.org/ao/) to compile this. Once that library is installed, compile it with gcc -o playnotes -lao playnotes.c.
To adblock users