«fun little instrument» by whillas

on 11 Aug'14 08:41 in feedbackspaceyinstrument

Simple Pulse with some delayed feedback and a 2D Slider as an interface. Sliding around gives different effects to just clicking in different spots.

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
(

// Levels scaling
//m = m ? 0.8;// live
m = m ? 1.2;// rehersal

Ndef(\pul, { | freq=80, rq=0.001, amp = 0.91 |
	RLPF.ar(
		Pulse.ar([100,250],0.5,0.1),
		freq: freq,
		rq: rq,
		mul: amp
	)
	+ (DelayC.ar(Ndef(\pul).ar) * 0.9)
}).play;

// GUI: 2D slider
w = Window("Pulse", Rect(100,Window.screenBounds.height - 400, 300, 300));
w.view.decorator = FlowLayout(w.view.bounds);
t = Slider2D(w, Rect(0, 0,292, 292))
	.y_(1.0)
	.x_(0.0)
	.background_(Color.rand)
	.knobColor_(Color.rand)
	.action_({|pos|
		Ndef(\pul).set(
			\freq, pos.x.linexp(0,1.0, 80, 8000),
			\rq, pos.y.linlin(0, 1.0, 0.001, 1.0)
		)
	});
w.front;
CmdPeriod.doOnce({w.close; Ndef(\pul).clear(4)});

)

// Kill it
w.close; Ndef(\pul).clear(4);
raw 752 chars (focus & ctrl+a+c to copy)
reception
comments
Bryan Christophe Green user 15 Feb'15 22:09

Very cool!