Re: executing arbitrary bash scripts from midi notes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello,

mididings can do that :
http://das.nasophon.de/mididings/
reference to the System("your command here") http://das.nasophon.de/mididings/doc/units.html#calls

an example script would look like :

from mididings import *
config(
    backend='jack-rt',
    client_name='sendanote',
)
run(
    KeyFilter(notes=[43]) >> System("ls /home")
    KeyFilter(notes=[44,45]) >> System("yourscript1.sh")
    KeyFilter(notes=[36]) >> System("sendmail")
)

---

not tested, but should be it
you could add more filters for midi channels, or velocity

Raphaël


Le 2 nov. 2014 à 00:16, Hanspeter Portner <dev@xxxxxxxxxxxxxxxxxxxxxxxxx> a écrit :

> On 01.11.2014 23:27, Athanasios Silis wrote:
>> hello there,
>> is there an application that I am missing that allows programming execution
>> of arbitrary bash scripts (or others) following pressing specific midi
>> notes?
>> googling about it did not provide any results..
>> 
>> Thank you for your help
>> 
>> 
>> 
>> _______________________________________________
>> Linux-audio-user mailing list
>> Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
>> http://lists.linuxaudio.org/listinfo/linux-audio-user
>> 
> 
> e.g. SuperCollider can do that:
> 
> The relevant help files:
> http://doc.sccode.org/Classes/MIDIIn.html
> http://doc.sccode.org/Classes/String.html#-systemCmd
> 
> And a working code samle:
> 
> test.sc
> ----------------------------------------------
> #!/usr/bin/env sclang
> 
> ({
> 	var midii, noteOn;
> 
> 	MIDIClient.init;
> 
> 	noteOn = {|src, chan, num, vel|
> 		if(chan == 0, {
> 			"./test.sh".systemCmd;
> 		})
> 	};
> 
> 	MIDIIn.addFuncTo(\noteOn, noteOn);
> }).value;
> ---------------------------------------------
> 
> test.sh
> ---------------------------------------------
> #!/usr/bin/bash
> 
> echo "bang!"
> ---------------------------------------------
> 
> hp
> _______________________________________________
> Linux-audio-user mailing list
> Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
> http://lists.linuxaudio.org/listinfo/linux-audio-user

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/listinfo/linux-audio-user





[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux