scide: LookupDialog - redo lookup on classes after partial lookup
[supercollider.git] / SCClassLibrary / Common / Audio / SystemSynthDefs.sc
blobf443d2e5114cdb384569ed8552c4edfeeb35765b
1 // synthdefs needed by classes
3 SystemSynthDefs {
4         classvar <>numChannels = 16;
5         classvar <>tempNamePrefix = "temp__";
6         classvar tempDefCount = 0;
7         classvar <>maxTempDefNames = 512;
9         *generateTempName {
10                 var name = tempNamePrefix ++ tempDefCount;
11                 tempDefCount = tempDefCount + 1 % maxTempDefNames;
12                 ^name
13         }
15         *initClass {
16                 // clean up any written synthdefs starting with "temp__"
17                 StartUp.add {
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;
24                                                 var env;
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;
31                                                 var env;
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));
38                                 }).add;
39                         };
40                 };
41         }