Monday, August 22, 2011

quick & easy audio setup

I have been thinking about the easiest and quickest way to configure my current live setup (jack-hydrogen-alsaplayer) that i talked about in previous posts.  The goal is to startup the PC, click 1 shortcut and the setup is running.
You could see this as a 'mini' session, so LADISH could be an option.  However, i wanted to keep it really simple since the configuration of this setup doesn't change often and there are only 3 components in the setup.

I decided to write a small bash script :

#! /bin/bash
/usr/bin/jackd -v -P89 -t1000 -dalsa -dhw:0 -r44100 -p256 -n2 -s &
sleep 5
qjackctl &
hydrogen --driver jack --playlist /home/Music/2011.h2playlist &
alsaplayer -o jack -d system:playback_1,system:playback_2 -s MY-AlsaPlayer &

line by line :

1) the first line (#! /bin/bash) indicates that it's a bash script
2) the second line starts up the jackd audio server with a number of arguments.  If you have a good jack config, you can simply start up QjackCtl like you normally do and take a look at the Messages window to find out your jackd startup arguments.  It should show you something like this :

The line in purple is what you are looking for.

NOTE that all lines in the script end with a & to indicate that the script should not wait for the process to end and that it must keep running in the background.

3) now we wait 5 sec (you might have to play with this a bit) to make sure that the jackd server is running
4) the next line launches QjackCtl.  This is not strictly necessary, but it allows you to see if the jackd server is doing OK.
5) startup Hydrogen with the jack driver option + open the correct playlist
6) finally we also start up alsaplayer with some extra config (see my previous post)

After creating and testing this script i placed a link on my desktop for easy access.

next i'll be looking at creating a similar script for using jack with my outboard Focusrite Saffire LE.

No comments:

Post a Comment