Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # a function to run yoshimi on a certain "channel"
- # takes channel number as argument
- function runyoshimi() {
- local CHAN=$1
- # store jack_lsp output before...
- local PRE=`jack_lsp`
- yoshimi &
- sleep 3
- # ... and after application startup
- local POST=`jack_lsp`
- # diff to find the new ports
- local PORTS=`diff <(echo "$PRE") <(echo "$POST")`
- # retrieve the actual port names from the resulting 3 lines
- LEFT=`echo "$PORTS" | grep left | cut -c 3-`
- RIGHT=`echo "$PORTS" | grep right | cut -c 3-`
- MIDI=`echo "$PORTS" | grep midi | cut -c 3-`
- # assign aliases
- jack_alias "$LEFT" ch_${CHAN}_left
- jack_alias "$RIGHT" ch_${CHAN}_right
- jack_alias "$MIDI" ch_${CHAN}_midi
- }
- # call the function
- runyoshimi 4
- # now use the new aliases
- jack_connect ch_4_left system:playback_1
- jack_connect ch_4_right system:playback_2
- jack_connect Non-Sequencer:midi_out-4 ch_4_midi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement