[LAU] sending random midi notes from a bash script

Philippe Hezaine philippe.hezaine at free.fr
Sun Feb 7 13:30:08 EST 2010


Pedro Lopez-Cabanillas a écrit :

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

> Regards,
> Pedro

Hi Pedro,

Somehow fascinating!
Sorry for hijacking this thread but I'm wondering if you have any
pointers for the following case: (It's about randomization.)
I'm looking for randomize Note On from a midi file.
I have two way for sending this file, a standard file generated by
Lilypond or a text file by midicomp.
Here is an excert from midicomp file:

062:00:000 On      ch=10  note=f#3  vol=105
063:-1:-576 Off     ch=10  note=f#3  vol=64
063:-1:-384 On      ch=10  note=f#3  vol=95
063:-1:-192 Off     ch=10  note=f#3  vol=64
063:-1:000 On      ch=10  note=f#3  vol=127
063:00:-576 Off     ch=10  note=f#3  vol=64
068:00:000 On      ch=10  note=f#3  vol=127
069:-1:-576 Off     ch=10  note=f#3  vol=64
074:00:000 On      ch=10  note=f#3  vol=127
074:00:192 Off     ch=10  note=f#3  vol=64
074:00:384 On      ch=10  note=f#3  vol=95
074:00:576 Off     ch=10  note=f#3  vol=64
074:01:000 On      ch=10  note=f#3  vol=105
074:01:192 Off     ch=10  note=f#3  vol=64

I'm looking for randomizing the third column: 192 or -576...
between + or -3 units for instance. ( 000 is a special case)

I've googled some info about  $RANDOM  but I haven't been successful in
my rather random! investigations. :)
Have you any advice or pointers?
Midiclocking regards.
-- 
   Phil.






More information about the Linux-audio-user mailing list