«moving sound» by lambda

on 04 Jul'20 04:33 in lissajous

Genera dos tonos independientes para cada oido. Si lo vemos en el scope en modo X/Y podemos observar figuras de Lissajous

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
//////////
///////////////
////////////////

// sinte cero

(
SynthDef(\cero,{arg freq1=200, freq2=200, phase1=0, phase2=0, gate=0;   //make sure there are control arguments to affect!
 // var x, y;
  // x = SinOsc.ar(freq1, phase1);
  // y = SinOsc.ar(freq2, phase2) ;
  Out.ar(0,SinOsc.ar(freq1, phase1));
  Out.ar(1,SinOsc.ar(freq2, phase2));



}).add;

)

// ejecutor cero
s.scope;

(

var w, f1S, f2S, p1S, p2S;


a = Synth("cero");


///// GUI//////////////
///////////////////
////////////////////////////
w=Window("sineVisualizer", Rect(100, 400, 400, 300));

w.view.decorator = FlowLayout(w.view.bounds);

f1S= EZSlider(w, 300@50, "freq 1", ControlSpec(0, 2000, 'linear',0.1, 200), {|ez|
a.set(\freq1, ez.value)});
w.view.decorator.nextLine;

p1S= EZSlider(w, 300@50, "phase 1", ControlSpec(0, 2*pi, 'linear',0.1, 0), {|ez|
a.set(\phase1, ez.value)});
w.view.decorator.nextLine;

f2S= EZSlider(w, 300@50, "freq2", ControlSpec(0, 2000, 'linear', 0.10, 200), {|ez|
a.set(\freq2, ez.value)});
w.view.decorator.nextLine;


p2S= EZSlider(w, 300@50, "phase 2", ControlSpec(0, 2*pi, 'linear',0.1, 0), {|ez|
a.set(\phase2, ez.value)});

w.front;


)


// ejecutor cero con menor rango (pero mas presicion)

(

var w, f1S, f2S, p1S, p2S;


a = Synth("cero");


///// GUI//////////////
///////////////////
////////////////////////////
w=Window("sineVisualizer", Rect(100, 400, 400, 300));

w.view.decorator = FlowLayout(w.view.bounds);

f1S= EZSlider(w, 600@50, "freq 1", ControlSpec(500, 600, 'linear',0.1, 200), {|ez|
a.set(\freq1, ez.value)});
w.view.decorator.nextLine;

p1S= EZSlider(w, 300@50, "phase 1", ControlSpec(0, 2*pi, 'linear',0.1, 0), {|ez|
a.set(\phase1, ez.value)});
w.view.decorator.nextLine;

f2S= EZSlider(w, 600@50, "freq2", ControlSpec(500, 600, 'linear', 0.10, 200), {|ez|
a.set(\freq2, ez.value)});
w.view.decorator.nextLine;


p2S= EZSlider(w, 300@50, "phase 2", ControlSpec(0, 2*pi, 'linear',0.1, 0), {|ez|
a.set(\phase2, ez.value)});

w.front;


)
raw 2070 chars (focus & ctrl+a+c to copy)
reception
comments