Help please: Example script for the Raspberry Pi

391 views
Skip to first unread message

adam...@gmail.com

unread,
Apr 25, 2013, 1:36:13 AM4/25/13
to midi...@googlegroups.com
Hey there, 
   I am making a Raspberry Pi based guitar effects processor over at http://ampbrownie.com. I was just looking into mididings to help switch between effects patches (which are LADSP/LV2 plugins hosted in Jalv), from my Korg Nano Kontrol controller. 

I am still wrapping my mind around mididings. Could anyone give me a kickstart with a small sample script that might help? It would need to take the input from that contoller, and issue shell commands so Jalv knows which programs to run. From there, each plugin responds to midi control, so that could also be routed through mididings. 

- Adam

Egor Sanin

unread,
Apr 29, 2013, 11:12:16 PM4/29/13
to midi...@googlegroups.com
Hi Adam,

The most basic thing you could do is execute:
$ mididings 'run(Channel (1) >> System("ls"))'

In the above, mididings is invoked from the commandline, and the
program filters incoming MIDI data, responds only to Channel 1 and
executes the system command "ls".

There are a couple of things you can do to modify the above and make
it more robust: make a script, use different mididings units to
execute system commands.

One of the ways to make a script is to wrap the above like so:
#!/usr/bin/python2
from mididings import *
run (Channel (1) >> System ("ls"))

Put the above in a file and make it executable.

The second thing to do is not use the System unit, instead, add a
python function in your script which will call system commands using
all the robust mechanism available in Python, then use the mididings
unit Call to call that function.

Here's an example:
#!/usr/bin/python2
from mididings import *
def helloworld(ev):
print "Hello World!"

run (
Channel (1) >> Call( helloworld)
)

Mididings is extremely powerful, you can read more about the various units here:
http://das.nasophon.de/mididings/doc/index.html

Good luck!
> --
> You received this message because you are subscribed to the Google Groups
> "mididings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mididings+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
Reply all
Reply to author
Forward
0 new messages