File: SCScope%20view%20x%2Cy%20plot.scd

package info (click to toggle)
supercollider 1%3A3.4.5-1wheezy1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 26,972 kB
  • sloc: cpp: 116,645; lisp: 64,914; ansic: 10,725; python: 3,548; perl: 766; ruby: 487; sh: 152; makefile: 117; xml: 13
file content (101 lines) | stat: -rw-r--r-- 1,665 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//jmc 2003

The SCScope view 'style' property supports 3 styles:
0 = separate waveform plots
1 = overlapping waveform plots
2 = x,y plots of 2 channel pairs.

(
// create a window with a scope view
var f, s;
w = SCWindow("scope test", Rect(128, 64, 512, 512));

n = SCScope(w, Rect(10,10,480,480));
n.bufnum = 0;
n.background = Color.black;
n.resize = 5;
n.style = 2;
n.waveColors = [Color.yellow, Color.blue(1.2), Color.red, Color.green];
w.front;
)

// boot internal server
s = Server.internal;
s.boot;

// allocate a 2 channel buffer
s.sendMsg(\b_alloc, 0, 2048, 2);

// play a 2 channel sound into that buffer using ScopeOut.
(
z = {
	var m, f;
	f = SampleRate.ir / 64;
	m = SinOsc.kr(0.001, 0, 0.8, 1).round(1/60);
	ScopeOut.ar([SinOsc.ar(f + 0.01), SinOsc.ar(f * m)], 0)
}.play(s);
)

z.free;

(
z = {
	var in, f;
	f = MouseX.kr(40,8000,1);
	in = {RLPF.ar(BrownNoise.ar(0.5), f, 0.3) }.dup;
	ScopeOut.ar(in, 0);
	Out.ar(0, in);
}.play(s);
)

z.free;


(
z = {
	var in, f, pw;
	f = MouseX.kr(40,8000,1);
	pw = MouseY.kr(0.01,0.99);
	in = RLPF.ar(Pulse.ar([100,100.2],pw,0.5), f, 0.1).softclip;
	ScopeOut.ar(in, 0);
	Out.ar(0, in);
}.play(s);
)

z.free;

(
z = {
	var in, f;
	f = MouseX.kr(40,8000,1);
	in = RLPF.ar(Saw.ar([100,100.2],0.5), f, 0.1).softclip;
	ScopeOut.ar(in, 0);
	Out.ar(0, in);
}.play(s);
)

z.free;



// allocate a 4 channel buffer
s.sendMsg(\b_alloc, 0, 2048, 4);


(
z = {
	var in, f, pw;
	f = MouseX.kr(40,8000,1);
	pw = MouseY.kr(0.01,0.99);
	in = RLPF.ar(Pulse.ar([120,120.12, 200, 200.1],pw,0.5), f, 
0.1).softclip;
	ScopeOut.ar(in, 0);
	Out.ar(0, Mix(in.clump(2)) * 0.5);
}.play(s);
)

z.free;

n.style = 0;
n.style = 1;
n.style = 2;