load_synthdefs path (string)
Load all pre-compiled synth designs in the specified directory. The binary files containing synth designs need to have the extension .scsyndef
. This is useful if you wish to use your own SuperCollider synthesiser designs within Sonic Pi.
If you wish your synth to work with Sonic Pi’s automatic stereo sound infrastructure you need to ensure your synth outputs a stereo signal to an audio bus with an index specified by a synth arg named out_bus
. For example, the following synth would work nicely:
(
SynthDef(\piTest,
{|freq = 200, amp = 1, out_bus = 0 |
Out.ar(out_bus,
SinOsc.ar([freq,freq],0,0.5)* Line.kr(1, 0, 5, amp, doneAction: 2))}
).store;
)
The location of the binary synthdef file written to disk by .store
is platform dependent. In SuperCollider, run Platform.userAppSupportDir
to find out where this directory exists on your machine and then navigate to the synthdefs
folder. For example, on my Mac this dir is:
/Users/sam/Library/Application Support/SuperCollider/synthdefs
Introduced in v2.0
# Example 1 | |
|
|