Howto: Launch Linuxsampler and Fantasia with a single click

You're new to the LinuxSampler world? You don't know where to start and nothing works? Here's the place to ask for help.
Post Reply
User avatar
dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Location: Linköping / Tranås, Sweden
Contact:

Howto: Launch Linuxsampler and Fantasia with a single click

Post by dahnielson » Sat Feb 02, 2008 7:43 pm

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.
Last edited by dahnielson on Wed Feb 06, 2008 6:02 pm, edited 5 times in total.
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

Alex
Moderator
Posts: 316
Joined: Wed Jan 23, 2008 9:08 pm

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

Post by Alex » Sat Feb 02, 2008 8:56 pm

Great tip Anders.

I'll certainly use this one.

Thanks!

Alex.

User avatar
dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Location: Linköping / Tranås, Sweden
Contact:

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

Post by dahnielson » Sat Feb 02, 2008 9:00 pm

Oops, I just saw that I had left some paths relative my environment in the script. Updated now. :oops:
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

User avatar
dahnielson
Moderator
Posts: 632
Joined: Wed Jan 23, 2008 11:25 pm
Location: Linköping / Tranås, Sweden
Contact:

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

Post by dahnielson » Tue Feb 05, 2008 7:06 pm

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.
Anders Dahnielson

Ardour2, Qtractor, Linuxsampler, M-AUDIO Delta 1010, Axiom 61, Korg D12, AKAI S2000, E-MU Proteus 2k, Roland R-5, Roland HP 1300e, Zoom RFX-1000, 4GB RAM x86_64 Intel Pentium Dual 1.80GHz Gentoo Linux

chip
Newbie
Posts: 1
Joined: Tue Jan 19, 2010 3:56 pm

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

Post by chip » Tue Jan 19, 2010 4:24 pm

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?

Post Reply