2 Server.default = s = Server.internal.boot;
4 {|in| MoogFF.ar(in, freq: LFCub.kr(0.2).exprange(10, 10000))}.scopeResponse
5 {|in| MoogFF.ar(in)}.scopeResponse
10 BLowPass.scopeResponse
11 BBandPass.scopeResponse
12 BLowShelf.scopeResponse // by default BLowShelf doesn't mangle much
15 Integrator.scopeResponse
17 Median.scopeResponse // nonlinear, and therefore interesting
23 scopeResponse{ |server, freqMode=1, label="Empirical Frequency response", mute = false|
25 var bus1, bus2, synth, win, fs;
28 server = GUI.freqScopeView.server;
30 if (server != GUI.freqScopeView.server) {
31 "Function-scopeReponse: resetting GUI.freqScopeView.server".warn;
32 GUI.freqScopeView.server = server;
36 // Create two private busses
37 bus1 = Bus.audio(server, 1);
38 bus2 = Bus.audio(server, 1);
40 // Create the SCFreqScope.response using the same simple window as in the helpfile
41 // Also, onClose must free the synth and the busses
43 win = GUI.window.new(label, Rect(100, 100, 511, 300));
44 fs = GUI.freqScopeView.response(win, win.view.bounds, bus1, bus2, freqMode);
54 // Create a synth using this function and the busses
56 var noise = PinkNoise.ar;
57 var filtered = this.value(noise);
58 var env = EnvGen.kr(Env.asr(0.1, 1, 0.1, \sine), gate, 0.1, doneAction: 2);
60 Out.ar(0, (filtered * env) ! 2); // filter only
63 Out.ar(bus2, filtered);
64 }.play(server.defaultGroup);
68 [bus1, bus2].do(_.free);
80 *scopeResponse { |server, freqMode=1, label, args|
81 var argNames = this.class.findRespondingMethodFor(\ar).argNames;
82 var hasFreqInput = argNames.includes(\freq);
85 {|in| this.ar(in: in, freq:MouseX.kr(10, 10000, 1)) * Line.ar(0,1,0.1) }
86 .scopeResponse(server, freqMode,
87 label ?? {"%: empirical frequency response (move mouse to change freq)".format(this.asString)}
90 {|in| this.ar(in: in) * Line.ar(0,1,0.1) }
91 .scopeResponse(server, freqMode,
92 label ?? {"%: empirical frequency response".format(this.asString)}