1 // synthdefs needed by classes
4 classvar <>numChannels = 16;
5 classvar <>tempNamePrefix = "temp__";
6 classvar tempDefCount = 0;
7 classvar <>maxTempDefNames = 512;
10 var name = tempNamePrefix ++ tempDefCount;
11 tempDefCount = tempDefCount + 1 % maxTempDefNames;
16 // clean up any written synthdefs starting with "temp__"
18 var path = SynthDef.synthDefDir ++ tempNamePrefix ++ "*";
19 if(pathMatch(path).notEmpty) { unixCmd("rm -f" + path.quote) };
21 (1..numChannels).do { arg i;
22 SynthDef("system_link_audio_" ++ i,
23 { arg out=0, in=16, vol=1, doneAction=2;
25 env = EnvGate( doneAction:doneAction, curve:'sin') * Lag.kr(vol, 0.05);
26 Out.ar(out, InFeedback.ar(in, i) * env)
27 }, [\kr, \ir, \kr, \ir]).add;
29 SynthDef("system_link_control_" ++ i,
30 { arg out=0, in=16, doneAction=2;
32 env = EnvGate( doneAction:doneAction, curve:'lin');
33 Out.kr(out, In.kr(in, i) * env)
34 }, [\kr, \ir, \kr, \ir]).add;
36 SynthDef("system_diskout_" ++ i, { arg i_in, i_bufNum=0;
37 DiskOut.ar(i_bufNum, InFeedback.ar(i_in, i));