Hook scripts - TheTechnobear/NuiLite GitHub Wiki

advanced tip

one I forgot to mention, but very useful Ive introduced a lot more 'hook points', which are optional scripts that can be used to change how things behave... these are like the old post-patch.sh script but a bit more powerful.

they cover things like, PD options, supercolider options, what to do when patches start and stop.

here is a 'real world example' I use :)

using supercollider with an alternative audio interface (ES-8)

I use norns connected to my modular via an ES-8 audio interface.

so by default, sidekick when start a supercollider patch, also starts the 'norns jackd' service, to get jack running. it does this with a script called 'start_sc.sh' (and a stop corresponding stop one)

now I don't want to edit the norns jack service, as I dont want to affect norns behaviour.

so instead I can edit start_sc.sh to launch jackd itself, with new parameters to utilise the ES-8

ok, but that means every SC patch on Sidekick would now use the ES-8, I want it more selective :)

so I put start_sc.sh, into a patch directory - low and behold, it will be used only with that patch. so I can default to normal output, and only that patch will use the ES-8.

nice, but inconvenient if you have a few patches... so, there is another level, sub directories.

I can create a subdirectory for patches called (e.g.) Eurorack, then put my patches in there. then put the start_sc.sh in the Eurorack folder, now anytime a (sc) patch in that folder is invoked it will be connected to the ES8, but other SC patches will be unaffectd.

(and yes for 'linux' heads, you can use symbolic links, so you dont need to even duplicate patches :))

basically hook files, like this work on the principle of...

use file in patch directory , or its parent directory, or the main sidekick folder (aka global)


btw: to do a similar thing with Pure Data , you just need to add a pd-opts.txt file, again hierarchy is respected. of course, this means that your 'Eurorack' folder can now be a mix of Supercollider and Pure data patches :)