[LAU] sending random midi notes from a bash script

Pedro Lopez-Cabanillas pedro.lopez.cabanillas at gmail.com
Sat Feb 6 12:33:34 EST 2010


On Saturday, February 6, 2010, james morris wrote:
> I want to send a random midi note each time a bash script is called...
>
> Not for anything useful, just experimenting...
>
> I guess the tool would best be connecting to a midi-through port rather
> than hard-coding a particular synth?

In addidion to the "amidi" ALSA raw midi utility that has been suggested, you 
can also easily write from a bash script to character devices, either the OSS 
(/dev/midi*) or the ALSA ones (/dev/snd/midiC*). You can even create a 
virtual MIDI port using the ALSA module snd-virmidi, so you can write chars 
to a /dev/midi* node and connect the other side (the ALSA sequencer port) to 
a synth.

> The tool would just be required to send a single midi note to some port.
> The note to be sent should be specifiable on command line, along with
> length/velocity ... probably would be enough.
>
> Any ideas?

As an example, here is a bash script that can be used with cron, to play 
hourly a tune and some strokes.

Regards,
Pedro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: midiclock
Type: application/x-shellscript
Size: 1685 bytes
Desc: not available
Url : http://lists.linuxaudio.org/pipermail/linux-audio-user/attachments/20100206/924644b7/attachment.bin 


More information about the Linux-audio-user mailing list