«Load and play samples from GUI (Qt GUI only)» by rukano

on 22 Apr'12 00:14 in guisamplerloader

Pretty simple GUI (button per sample) for loading samples into buffers and playing them from GUI buttons. !!! Needs Qt GUI !!! (VLayout)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var make;
var dialog = Dialog.openPanel({ |list| make.(list) }, nil, true);
var win = Window("Sample Player 3000").front;
var samples = ();
var buttons = ();
make = { |paths|
	{
		paths.do{ |path|
			[\loaded, path.basename].postln;
			samples[path] = Buffer.read(Server.default, path);
			s.sync;
			buttons[path] = Button()
				.states_([[path.basename]])
				.action_{ samples[path].play };
		};
		win.layout = VLayout(*buttons.asArray);
		win.onClose_{
			samples.do{ |buf|
				buf.close;
				buf.free
			};
		};
	}.fork(AppClock);
};
raw 561 chars (focus & ctrl+a+c to copy)
reception
comments