Re: [LAU] sending random midi notes from a bash script

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Lorenzo <lsutton@...>
Cc: <linux-audio-user@...>
Date: Thursday, February 11, 2010 - 9:38 am

On Sun, Feb 07, 2010 at 08:03:36PM +0100, Lorenzo wrote:

I used this little script Thursday night to drop some random samples in during stops in a song. First time I've busted out tapeutape live too. It went over pretty well.

Two sets of samples, triggered by two different pads on the Novation.

-ken
---------------
#!/usr/bin/python

import os,sys
import random
import alsaseq
import alsamidi
sys.path.append('/home/music-projects/lib')
import alsaevent

alsaseq.client('randomsamples', 1, 1, False)

def main_loop():
while True:
msg=alsaseq.input()
if msg:
ev=alsaevent.AlsaEv(*msg)
if ev.type == alsaseq.SND_SEQ_EVENT_NOTEON:
if ev.notenum == 36:
alsaseq.output(alsamidi.noteonevent(0, random.randint(0,24), ev.vel))
elif ev.notenum == 38:
alsaseq.output(alsamidi.noteonevent(0, 30+random.randint(0,28), ev.vel))

#### MAIN
if __name__ == '__main__':
main_loop()
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] sending random midi notes from a bash script, james morris, (Sat Feb 6, 2:46 pm)
Re: [LAU] sending random midi notes from a bash script, Pedro Lopez-Cabanillas, (Sat Feb 6, 5:33 pm)
Re: [LAU] sending random midi notes from a bash script, james morris, (Sun Feb 7, 12:42 pm)
Re: [LAU] sending random midi notes from a bash script, Pedro Lopez-Cabanillas, (Sun Feb 7, 1:51 pm)
Re: [LAU] sending random midi notes from a bash script, Ken Restivo, (Thu Feb 11, 9:38 am)
Re: [LAU] sending random midi notes from a bash script, Philippe Hezaine, (Sun Feb 7, 6:29 pm)
Re: [LAU] sending random midi notes from a bash script, Gabriel M. Beddingfield, (Sun Feb 7, 7:43 pm)
Re: [LAU] sending random midi notes from a bash script, Philippe Hezaine, (Sun Feb 7, 8:10 pm)
Re: [LAU] sending random midi notes from a bash script, Philippe Hezaine, (Mon Feb 8, 7:02 pm)
Re: [LAU] sending random midi notes from a bash script, Gabriel M. Beddingfield, (Tue Feb 9, 12:28 am)
Re: [LAU] sending random midi notes from a bash script, Philippe Hezaine, (Tue Feb 9, 8:26 am)
Re: [LAU] sending random midi notes from a bash script, Gordon JC Pearce, (Sat Feb 6, 3:46 pm)
Re: [LAU] sending random midi notes from a bash script, David Santamauro, (Sat Feb 6, 3:46 pm)
Re: [LAU] sending random midi notes from a bash script, james morris, (Sat Feb 6, 4:50 pm)