Re: building a bash script for jack midi connect-disconnect with toggle keybindings

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

 



On Tue, Nov 9, 2010 at 5:51 PM, Paul Davis wrote:
> On Tue, Nov 9, 2010 at 11:15 AM, Julien Claassen wrote:
...
>> ÂAnd as I understand, Alex wants to seperate from the GUI as much as
>> possible. I suppose xbindkey needs X to run and only works on the Xserver.
>> If i'm mistaken, shame upon me. :-)
>
> there are ways to listen to raw keyboard events via the kernel. they
> are strongly, strongly not recommended for just about any purpose.
>

this thread got me curious :)

an example using xbindkeys:

setup a script like this for the desired midi switching:

#!/bin/bash
if [ $1 = a ] ; then
    jack_disconnect 'Non-Sequencer:midi_out-1' 'yoshimi-01:midi in'
    jack_connect    'Non-Sequencer:midi_out-1' 'yoshimi:midi in'
elif [ $1 = b ] ; then
    jack_disconnect 'Non-Sequencer:midi_out-1' 'yoshimi:midi in'
    jack_connect    'Non-Sequencer:midi_out-1' 'yoshimi-01:midi in'
fi

for testing, invoke it with its arguments

./jmidiswitch.sh a
./jmidiswitch.sh b

install xbindkeys

create an appropriate file ~/.xbindkeysrc, containing:

# xbindkeys configuration
"$HOME/jmidiswitch.sh a"
  Alt +a
"$HOME/jmidiswitch.sh b"
  Alt +b

run xbindkeys,
     and happy switching.

IIRC only jack2 allows for click-free port switching,
the tests I ran with jack1 and jack2-svn confirm this.


best,
d
_______________________________________________
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