// title: Basic ScopeView example // author: defaultxr // description: // This is a basic example of how to use ScopeView in your GUIs without having to include all the extra bells and whistles that Stethoscope includes. // code: SynthDef(\scopeSynth, { | in=0 bufnum=0 | var output; output = In.ar(in, 2); ScopeOut2.ar(output, bufnum, 1024, 64 ); }).add; ( var win, view, synth, bufnum, scopeView, server=Server.default; win = Window("scope"); bufnum = Buffer.alloc(s, 1024, 2); synth = Synth(\scopeSynth, [\in, 0, \bufnum, bufnum]); scopeView = ScopeView(win, win.view.bounds).resize_(5).style_(0).waveColors = [Color.green, Color.green]; scopeView.server = server; scopeView.canFocus = true; scopeView.bufnum = bufnum; scopeView.start; win.front; ) Synth(\default); // tada! this (and anything else you play after this point) is now being scoped by ScopeView.