Automating UBS Setup for a project ...
Ralf Mardorf
ralf.mardorf at alice-dsl.net
Sun Jan 9 20:08:48 UTC 2011
On Sat, 2011-01-08 at 13:45 +0100, Rolf Krüger wrote:
> Hi All,
>
>
> When producing a song, I always use several apps on UBS:
> - qjackctl
> - ardour (outs connected to jamin, not to my soundcards system out)
> - Muse (for Midi) (routing the outputs to busses in ardour, the outs of
> muse are never connected to my soundcards system out)
> - Hydrogen (routing the outputs to busses in ardour, the outs of
> hydrogen are never connected to my soundcards system out)
> - jamin (connected to the master outs of ardour, set to bypass during
> recording/mixing, only acive when mastering)
>
> Is there a way to automate/script the setup for a song so that all apps
> are up and running, have loaded the appropriate data files and routed
> correctly by running a single shell script?
> I found out that I´m able to script jack and do the connections, but I
> have no idea to have muse, hydrogen or jamin with the proper data files.
>
>
> Thanx in advance
> Rolf
Some scripts I used and a template:
#!/bin/sh
# sh start-session
song_path=`pwd`
song_name="a64"
song_version="06-slide"
song_date="Jun/04/2010"
song_info="
\n############################
\n# Project: $song_name
\n# Version: $song_version
\n# $song_date Ralf Mardorf
\n############################\n"
if [ $USER = "root" ] ; then
echo "\nOnly a user is allowed to run this script :)\n"
else
echo $song_info
### Killall
apps="qtractor guitarix rakarrack jackd envy24control"
echo "\nkillall -9 -w $apps"
killall -9 -w $apps
### Restore session
echo "\nRestoring session :)"
sample_rate=96000
frames_period=512
echo "\njackd -Rdalsa -dhw:0 -r$sample_rate -p$frames_period -n2"
#envy24control & sleep 2
jackd -Rdalsa -dhw:0 -r$sample_rate -p$frames_period -n2 & sleep 2
#rakarrack & sleep 4
#guitarix & sleep 2
qtractor "$song_path/qtr/$song_name-$song_version.qtr" & sleep 2
echo
fi
exit 0
#!/bin/sh
# sh start-session
song_path=`pwd`
song_name="devoid_of_meaning"
song_version="09"
song_date="Feb/27/2010"
song_info="
\n############################
\n# Project: $song_name
\n# Version: $song_version
\n# $song_date Ralf Mardorf
\n############################\n"
if [ $USER = "root" ] ; then
echo "\nOnly a user is allowed to run this script :)\n"
else
echo $song_info
### CPU ferquency scaling
echo "\nSetting up CPU frequency scaling for 64 Studio 3.0-beta3"
cpufreq-selector -g performance
if [ $? = 0 ] ; then echo "Done" ; fi
### Killall
apps="jack_snapshot qtractor sr-2a jackd"
echo "\nkillall -9 -w $apps"
killall -9 -w $apps
### Restore session
echo "\nRestoring session :)"
sample_rate=96000
frames_period=512
echo "\njackd -Rdalsa -dhw:0 -r$sample_rate -p$frames_period -n2 -Xseq"
jackd -Rdalsa -dhw:0 -r$sample_rate -p$frames_period -n2 -Xseq & sleep
2
sr-2a & sleep 2
qtractor "$song_path/qtr/$song_name-$song_version.qtr" & sleep 2
jack_snapshot restore "$song_path/$song_name-$song_version.jsnap"
echo
fi
exit 0
#!/bin/sh
# sh start-session
song_path=`pwd`
song_name="devoid_of_meaning"
song_version="01.1-notuxguitar"
song_date="Jan/13/2010"
song_info="
\n###########################
\n# Project: $song_name
\n# Version: $song_version
\n# $song_date Ralf Mardorf
\n###########################\n"
if [ $USER = "root" ] ; then
echo "\nOnly a user is allowed to run this script :)\n"
else
echo $song_info
### CPU ferquency scaling
echo "\nSetting up CPU frequency scaling for 64 Studio 3.0-beta3"
cpufreq-selector -g performance
if [ $? = 0 ] ; then echo "Done" ; fi
### Killall
echo "\nkillall patchage a2jmidid qtractor tuxguitar qsynth phasex
arpage sr-2a jackeq qjackctl jackd"
killall patchage a2jmidid qtractor tuxguitar qsynth phasex arpage sr-2a
jackeq qjackctl jackd
### Restore session
echo "\nRestoring session :)"
sample_rate=96000
frames_period=512
echo "\njackd -Rdalsa -dhw:0 -r$sample_rate -p$frames_period -n2 -Xseq"
jackd -Rdalsa -dhw:0 -r$sample_rate -p$frames_period -n2 -Xseq & sleep
2
#qjackctl & sleep 4
#jackeq & sleep 2
#sr-2a & sleep 2
#arpage & sleep 2
#phasex & sleep 4
#qsynth & sleep 2
#tuxguitar "$song_path/$song_name-$song_version.tg" & sleep 8
qtractor "$song_path/qtr/$song_name-$song_version.qtr" & sleep 2
#a2jmidid & sleep 2
#patchage & sleep 2
echo
fi
exit 0
#!/bin/sh
# sh start-session
song_path=""
song_name=""
song_version=""
song_date="Dec/27/2009"
time=1
hpet_max_user_freq=64
song_info="\n
######################################################################\n
# Project: $song_path$song_name$song_version\n
# $song_date Ralf Mardorf\n
# ralf.mardorf at alice-dsl dot net\n
#\n
# License for all artwork in the folder /$song_name:\n
# Creative Commons\n
# by-nc-sa = Attribution-NonCommercial- ShareAlike\n
# http://creativecommons.org/licenses/by-nc-sa/3.0/\n
# Namensnennung-NichtKommerziell-Weitergabe unter gleichen Bedingungen\n
# http://creativecommons.org/licenses/by-nc-sa/3.0/de/\n
######################################################################
\n"
if [ $USER = "root" ] ; then
echo "\nOnly a user is allowed to run this script :)\n"
else
############################################################################################
sudo chgrp audio /dev/hpet
echo "\n/etc/sysctl.conf"
echo -n "dev.hpet.max-user-freq = "
cat /etc/sysctl.conf | grep dev.hpet.max-user-freq=
echo "\n"
echo -n "/proc/sys/dev/hpet/max-user-freq = "
cat /proc/sys/dev/hpet/max-user-freq
echo "\nMaking sure that the value is set to "$hpet_max_user_freq
sudo sysctl -w dev.hpet.max-user-freq=$hpet_max_user_freq
sudo modprobe snd-hrtimer
echo
echo -n "/proc/sys/dev/hpet/max-user-freq = "
cat /proc/sys/dev/hpet/max-user-freq
echo "\nSetting up CPU frequency scaling for 64 Studio."
echo "On Suse as user run the alias \"cpu-p\" or as root run
\"cpufreq-set -gperformance\"."
sudo cpufreq-selector -g performance
echo
############################################################################################
echo "\nRestoring session :)"
echo $song_info
#echo "jackd -Rch -dalsa -dhw:0 -r96000 -p512 -n2 -Xseq"
#jackd -Rch -dalsa -dhw:0 -r96000 -p512 -n2 -Xseq & sleep $time
echo "jackd -Rdalsa -dhw:0 -r96000 -p512 -n2 -Xseq"
jackd -Rdalsa -dhw:0 -r96000 -p512 -n2 -Xseq & sleep $time
#qtractor $song_path$song_name$song_version & sleep $time
qjackctl & sleep $time
a2jmidid & sleep $time
patchage & sleep $time
phasex & sleep $time
Jc_Gui & sleep $time
qtractor $song_path$song_name$song_version
fi
exit 0
More information about the Ubuntu-Studio-users
mailing list