Jack to work with SuperCollider in Linux

I am still quite new to Linux in general. I am learning a lot by just trying to use it, and trying not to move back to OSX just to do a simple task. So that this post might be for a person like me, who has struggled a lot on this ‘new’ way of patching sound in and out and configuring in a right way.
I have used Jack before in OSX when I was trying to do a virtual multichannel test, but there was a graphical interface, not at all complicated. There is also ‘system preference’ that OSX offers. When I change the soundcards, or using different inputs/outputs, I didn’t need to do much. But here, it might be a simple thing, but I was in panic.
So that I would like to share my experience if this can help anyone who is like me.

I have two different versions of linux that I am using in different laptop. 11.04/11.10.

Here I am focusing on 11.04, because 11.10 had less issues.

Jack versions and library installed : jackd, libjack-jackd2-dev, jackd2-firewire, jackd2, libjack-jack2-0, libasound2-plugins

First of all, I was at the first moment trying to use ‘qjackctl‘ that offers graphical user interface. But weiredly, the value that I have changed was not applied to the result.

Screenshot of qjackctl setup window

The default sample rate was set to 48000, and I wanted to change it into 44100. Even though I was doing it, it didn’t change.

Asking some people around, I found that pulsa audio can be the cause of issue, so I removed it and tried to use only ‘alsa.’

Jack setup

When I run scvim, I use a bash script in order to reduce any possible complications such as already-running-sclang. I saved it as ‘iscvim’ and fixed chmod to an exacutable, and put it into a path (i.g. /usr/local/bin.).

Here I include jack setup as well.

#!/bin/bash
cd ~
killall jackd
killall sclang
killall scsynth
killall scvim
killall sclangpipe_app
jackd -t 500 -d alsa -d hw:0 -r 44100 -p 1024 -s -S &
sleep 1
scvim

Here I set to use alsa as the driver, and device as hw:0, sample rate: 44100, period 1024, softmode and the last of -S is to cofigure card for 16bit. This configuration can differ from soundcard. I tried to use 32 bit, but my sound card only supports 32 bit-float. But this created problem with sc3, (creating distortion) and I assume that this is because of -float- (it could be supposed to be integer).

Check something like this when you run jack,

ALSA: final selected sample format for capture: 32bit float little-endian

or

ALSA: final selected sample format for capture: 16bit little-endian

In order to know what card you have;

cat /proc/asound/cards

In order to know what other configuration will be possible with your soundcard, use ‘jack_control,’ which shows you all possible options for your setup, and not difficult to use.

For Realtime Scheduling

This is followed by what ‘jack’ website suggests, and it works very well. (http://jackaudio.org/linux_rt_config)

Open /etc/security/limits.d/audio.conf

Then fix as below.

# Provided by the jackd package.

#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
# dpkg-reconfigure -p high jackd
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19

So far, no issue when I am using SCVim, and I run Jack when I need to use it.  Hope this helps.

SuperCollider 3.5 -rc1

SuperCollider 3.5 beta series were released for few weeks, and now finally moved to rc1 version. Here I write the information;

hi all,

with today’s 3.5-rc1, we finally leave the `beta’ phase. we have to plan to do
one more release candidate before the final 3.5.0. please report bugs to the
sc-dev list or to the bug tracker at
https://sourceforge.net/tracker/?group_id=54622.

please not that we have two different osx packages: a universal binary and a
32bit-only package, because the scapp has a known bug in 64bit mode.

source tarballs:
http://sourceforge.net/projects/supercollider/files/Source/3.5-rc1/SuperCollider-3.5-rc1-Source-linux.tar.bz2
http://sourceforge.net/projects/supercollider/files/Source/3.5-rc1/SuperCollider-3.5-rc1-Source.tar.bz2

osx package (ia32/x86_64, requires at least 10.5):
http://sourceforge.net/projects/supercollider/files/Mac%20OS%20X/3.5-rc1/SuperCollider-3.5-rc1-UB-10.5.dmg
osx package (ia32, requires at least 10.5):
http://sourceforge.net/projects/supercollider/files/Mac%20OS%20X/3.5-rc1/SuperCollider-3.5-rc1-i386-10.5.dmg

git repository (3.5 branch):
git://supercollider.git.sourceforge.net/gitroot/supercollider/supercollider

cheers, tim

changes since 3.5-beta4:
Jakob Leben (30):
qtcollider: implement QView:-acceptsMouse
qtcollider: implement QStackLayout
qtcollider: simplify setting stretch and alignment of layout
items
qtcollider: QcGridLayout: prevent potential null pointer
dereference
help: update layout documentation
help: fix CompositeView documentation
help: document HLayoutView and VLayoutView
help: ScrollView documentation
qtcollider: QScrollView: implement missing ‘action’ and update
documentation
qtcollider: import QStackedLayout from Qt
qtcollider: adjust QStackedLayout for QtCollider
help: update StackLayout documentation
help: Knob documentation
help: SoundFileView documentation
qtcollider: QStackLayout: fix initial stack order
qtcollider: QStethoscope2: improve appearance
help: TabletView documentation
help: improve TabletSlider2D documentation
help: MovieView documentation
help: ScopeView documentation
help: document Bus:-scope
help: Stethoscope documentation
qtcollider: a work-around for gradient support
help: warn about missing Gradient and HiliteGradient support in
Qt GUI
qtcollider: split QSoundFileView implementation into several
files
qtcollider: implement QSoundFileView:-setData
help: update SoundFileView documentation
help: WebView documentation
sclang: bind Ctrl-T to CmdPeriod
sclang: enable internal server on Windows

James Harkins (4):
Fix nasty infinite-loop bug in Buffer:sendCollection
Buffer:sendCollection ‘wait’ arg was used inconsistently; make it
-1
\set example needs an \args key in the Pbind, or it’s
incomplete/misleading
File.openDialog fix for different args between older SwingOSC and
other guis

Jonatan Liljedahl (15):
SCDoc: include MathJax for typesetting mathematics with math::
tag
helpdocs: remove use of old formula:: tag
Buffer.schelp: add missing server argument in read example
(cherry picked from commit
01cc1b3e379b8ef4d7d6bdd0bcba3fe6ca6d37fe)
sc_GetUserConfigDirectory(): add missing return statement.
Updated README for sced     (cherry picked from commit
3ce1974e310a1f13811cb2344cd2ad5fe5e22578)
QcApplication: set argv[0] to “SuperCollider”
Set Server.program only in *Platform’s startup. Don’t change cwd
of scsynth.
Updates to Server and Bus helpfiles     (cherry picked from
commit f62ea68939bd21c371588eb1f3c923a8b618c70b)
More updates to Server and Bus: synchronous bus access works also
for internal server.     (cherry picked from commit
52cc14fdd96c8ea463b0fc4c0fa35e0833a4c4ec)
SCDoc: don’t render empty method div’s     (cherry picked from
commit e04ac0175cffef7d2e39ec0c9a1f90936875fbf8)
String.schelp updates.
SCDoc: store toc pop-out state in persistent localStorage
(cherry picked from commit
24d747fa561e2035aa1f623e8ab45d951b0218d0)
Server.schelp: Document window GUI keyboard shortcuts.
(cherry picked from commit
e6c0b64a820dfb6e59ebd514d7cf2ffb0eafa45f)
sced3: clean up menu, add “raise all windows” item     (cherry
picked from commit fabe78ad7408f34867958b8bea1403a4d3a159b8)
String-runInTerminal: unify linux and osx implementation and
update docs

Scott Wilson (1):
Remove outdated references to OSCArgsMatcher (now private)

Tim Blechmann (17):
sclang: typesafe slot access for prArrayPutSeries
supernova: increase buffer size for cpu time measurement
sclang: increase udp receive buffer size
class library: FreqScope – expose FreqScope server and use it in
the Geko
sclang: fix bytecode generation for empty while loop
class library: Signal – don’t implement performBinaryOpOn methods
sclang: freePyrSlot – only free PyrObject
supernova: allocators – fix construct method
supernova: fixes for boost-1.49 and gcc-4.7
supernova: sc_synthdef – fix move semantics for unit_spec_t
supernova: add sanity checks for node position constraints
sclang: bytecode compiler – fix compilation of if without
function
supernova: osx – do not use thread-local storage for the trace
scratchpad
class library: Server – shutdown server interface on quit
external libraries: nova-tt win32 fixes
supernova: c_string – generate lock via boost headers
bumping version to 3.5-rc1

redFrik (3):
Help: Sweep example
minor: changed arFill to fill
SCImage helpfiles in scdoc format + image resources

SCVim with Auto completion and Snippets

The nicest part of using vim for me is to use the window management. It gives an opportunity to work in a clean environment that windows are not floating around, no need to search for a window behind another.

The second part that I discovered is to use all the functionality on Vim. I love vim more and more everyday. At the beginning, it was too difficult to know all the shorcuts and function keys, but after some time forcing myself to use them more and more and putting some ‘postits’ with some cheat-notes on the frame of my monitor, I think it is a powerful tool.

I would like to introduce some of powerful sides of using vim for SuperColliding. (it works in both Linux and OSX)

Snippets

I use the snippet plugin that you can download from vim website. It is called ‘snipMate‘ and you can also see the screencast.

Download the zip file into ~/.vim and unzip it, then you can find ‘snippets’ folder too. There, you can create your own snippets for any language (that vim supports) you are using.

Here, since I installed scvim, I will give you an example of how this snippets work.

Create a file on ~/.vim/snippets/supercollider/example.snippet
The file name is an important element because you are going to call the snippet with the file name.
In this case, when you edit vim, you are going to write ‘example’ and then tab key.
Here I will write a SynthDef snippet since I make SynthDef a lot.

Here is the example.

(
  SynthDef("${1:synthname}",
  {
  arg ${2:arg1};
  var ${3:var1};
  $3 = ${4:write};
  Out.ar(${5:outbus},${6:output})
  }).store;
 )

In this way, you created a snippet. I named it as ‘syndef’

When you call, you will see this

Because we setup the synth name as an argument by doing ${number:name}, your cursor will stop at the first argument.
After you fill up the synth name, and click ‘TAB’ button, then it will move to the second argument, in this case ‘arg1.’

The best part of this is that the name of argument becomes flexible. In this example, ‘var1’ is used in two places. If you fix one of ‘var1’ name, then the other one will follow. You don’t need to go down to the name and try to fix it!!

This is a simple example. I don’t use a lot of snippet, but some that save lots of time for me.

 

Auto Completion

For auto completion, I use ‘AutoComplPop‘ plugin.

If you have installed correctly, you will find those files ‘sc_object_completion’ and ‘supercollider_objects.vim.’ in ~/.scvim folder. Those files are going to be used to create auto completion.
If you don’t get it successfully, copy those two files into ~/.vim folder. Then when you type in, you will see this :

That’s quite easy!!

I am still exploring what could be useful for coding. I will post when I discover something useful. Hope you enjoy!