[LAU] MIDI to systemcommand, exute script etc.

James Cameron quozl at us.netrek.org
Sat Nov 8 20:23:29 EST 2008


On Sat, Nov 08, 2008 at 10:31:51PM +0100, Nils Gey wrote:
> Do you know any ways to receive midi events to start programms,
> execute shell-scripts or using other things you normaly do with your
> computer-keyboard and shortcuts?

Yes.

I've used several methods.  One of the most interesting for a while was
rebinding some very high notes on my piano to terminate MIDI capture and
do something with the file.  The same technique could be used to fork
off other shell-scripts in your case.

Here is how it worked:

1.  a change to arecordmidi to detect certain events, stop recording,
and return a specific exit status to a script, (patch attached),

2.  an arecordmidi-loop.sh script (attached) which I would start on my
computer before moving to my piano, it would begin recording MIDI
events to a file named according to the current date and time,

3.  some creative playing might ensue, or might not,

4.  one key on the piano if pressed would stop recording, discard the
file, and start recording again, this was marked with a yellow sticky as
"discard",

5.  another key if pressed would stop the recording, keep the file, and
start recording again, this was marked as "keep",

6.  another key would stop the recording, discard the file, and not
start recording again, this was marked as "terminate".

Each response set or cleared an indicator LED on my parallel port driven
indicator array.  That's what "pung" was doing.  This gave me a visual
indication of current state.

The "discard" and "keep" responses would also briefly play a MIDI
sequence confirming the action ... so I didn't need to watch the screen.

-- 
James Cameron    mailto:quozl at us.netrek.org     http://quozl.netrek.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arecordmidi-loop.sh
Type: application/x-sh
Size: 680 bytes
Desc: not available
Url : http://lists.linuxaudio.org/pipermail/linux-audio-user/attachments/20081109/d1d2af97/attachment.sh 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arecordmidi-quozl-remote-control.patch
Type: text/x-diff
Size: 781 bytes
Desc: not available
Url : http://lists.linuxaudio.org/pipermail/linux-audio-user/attachments/20081109/d1d2af97/attachment.patch 


More information about the Linux-audio-user mailing list