2 summary:: lazy function proxy
3 categories:: Libraries>JITLib>Patterns
4 related:: Classes/Pdef, Classes/Tdef, Classes/Pdefn, Classes/Ndef
7 Placeholder for functions to calculate with.
9 See also: link::Classes/Maybe:: and the link::Overviews/JITLib:: overview.
18 if no instance exists with this name, create a new one, otherwise return the existing one.
21 If func is given, replace the old func with the new one.
28 Fdef(\y, Fdef(\x) - 3);
36 Fdef(\x, { |x=0| x });
44 z = Fdef(\x) * Fdef(\y) + { 1.0.rand };
55 { arg out=0, freq=440, sustain=0.05, amp=0.1;
57 env = EnvGen.kr(Env.perc(0.01, sustain), doneAction:2) * amp;
58 Out.ar(out, SinOsc.ar(freq, 0, env))
62 // fork a thread that plays some sounds
69 s.sendMsg("/s_new", "gpdef", -1, 1,1, \freq, Fdef(\freq).value);
70 Fdef(\dur).value.wait;
77 Fdef(\freq, Fdef(\midinote, 60).midicps);
78 Fdef(\midinote, { [67, 64, 65].choose });
79 Fdef(\midinote, { [67, 64, 65].choose } + Fdef(\offset));
80 Fdef(\offset, { 4.rand });