Page 1 of 1

Howto: Launch Linuxsampler and Fantasia with a single click

Posted: Sat Feb 02, 2008 7:43 pm
by dahnielson
Here's how I launch Fantasia (JSampler) and Linuxsampler with one click on GNU/Linux.

Alternative 1

If you don't already have created a ~/bin/directory, do that now:

Code: Select all

$> cd ~
$> mkdir bin
Append it to the PATH environment in your ~/.bashrc file:

Code: Select all

export PATH=$PATH:$HOME/bin
Now create a file in a text editor, let us call it "startls", with this simple shell script in it and save it to your ~/bin/ directory (adjust the paths to your situation):

Code: Select all

#!/bin/sh
linuxsampler --instruments-db-location /path/to/the/instrument_database.db &
java -jar /path/to/Fantasia-0.8a.jar
kill -INT %1
Make it executable:

Code: Select all

$> chmod +x ~/bin/startls
The final touch: Create an application launcher/link on your KDE/GNOME desktop that launch the script. Or just type "startls" in a console.

Hint: To get a nice looking icon for you launcher/link, look for LinuxSampler-logo.png in the JSample source distribution.

Alternative 2

I've actually changed my mind and now keep LinuxSampler running whenever QJackCtl is running (which is usually always sitting in the system tray).

1.) Open up the "Setup" dialog in QJackCtl and switch to the "Options" page in the notebook.

2.) Check "Execute script after Startup" and fill in "linuxsampler --instruments-db-location /path/to/instruments.db &"

3.) Check "Execute script on Shutdown" and fill in "killall -s INT linuxsampler"

When you now start JACK from the QJackCtl application it will also start an instance of LinuxSampler and shut down and kill all instances of on shut down. Now you can open and close Fantasia or QSampler as many times as you want, LinuxSampler just keep on running in the background until you shut down JACK.

Re: Howto: Launch Linuxsampler and Fantasia with a single click

Posted: Sat Feb 02, 2008 8:56 pm
by Alex
Great tip Anders.

I'll certainly use this one.

Thanks!

Alex.

Re: Howto: Launch Linuxsampler and Fantasia with a single click

Posted: Sat Feb 02, 2008 9:00 pm
by dahnielson
Oops, I just saw that I had left some paths relative my environment in the script. Updated now. :oops:

Re: Howto: Launch Linuxsampler and Fantasia with a single click

Posted: Tue Feb 05, 2008 7:06 pm
by dahnielson
I updated it again, changed the kill signal from TERM to INT. It's less brutal now and you don't get any xruns from it.

Re: Howto: Launch Linuxsampler and Fantasia with a single click

Posted: Tue Jan 19, 2010 4:24 pm
by chip
I'm starting Linuxsampler with following ls.desktop-file (in Ubuntu place it into ~/.local/share/applications, in Suse into ~/.local/share/apps), which starts qjackctrl (if it isn't running) then linuxsampler (if it isn't running), then Classic.jar and finally netcats my script with my midi instruments into it.

Code: Select all

[Desktop Entry]
Exec=ps ax | grep 'qjackctl' | grep -v 'grep'  ||  (qjackctl & sleep 2) ; ps ax | grep 'linuxsampler' | grep -v 'grep'  ||  (xterm -bg blue -fg yellow -T Linuxsampler-Backend -e linuxsampler &); (java -jar /home/_user_/_pathtomysettings_/linuxsampler/Fantasia.jar &); sleep 2; cat /home/_user_/path_to_my_linuxsampler/linuxsampler-default.lscp | netcat localhost 8888
Icon=/home/_user_/_pathtomylsettings_/linuxsampler/LinuxSampler_Logo.svg
Name=Linuxsampler (Fantasia.jar)
GenericName=qjackctrl --> linuxsampler --> Fantasia.jar
NoDisplay=false
StartupNotify=false
Terminal=0
TerminalOptions=
Type=Application
X-KDE-SubstituteUID=false
X-KDE-Username=
Categories=
You should have to modify the both paths _user_ and _pathtomysettings_ to your needs.
But I find the way of dahnielson very interesting and i'm working with following lines in qjackctrl:

Code: Select all

Startup:
(xterm -bg blue -fg yellow -T Linuxsampler-Backend -e linuxsampler &); sleep 2 ; cat ~/dat/setting/linuxsampler-default.lscp | netcat localhost 8888 &
Shutdown:
killall -s INT linuxsampler
You should not use both ways together.

I wonder how to get a midi map into linuxsampler when it is started as a plugin from muse or rosegarden. That would be a nice way to have a "total recall" of you studio setup but i didn't find a way, unless starting the sequencer and after loading a song "netcating" my midi map into linuxsampler.
Is there e easier way?