aboutsummaryrefslogtreecommitdiff
path: root/ignore/instruments2F.sc
blob: 7267601f75348cbaf35698d0a331961c9503dc22 (plain)
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
/*
 * Copyright (c) 2013 Hanspeter Portner (dev@open-music-kontrollers.ch)
 * 
 * This software is provided 'as-is', without any express or implied
 * warranty. In no event will the authors be held liable for any damages
 * arising from the use of this software.
 * 
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 * 
 *     1. The origin of this software must not be misrepresented; you must not
 *     claim that you wrote the original software. If you use this software
 *     in a product, an acknowledgment in the product documentation would be
 *     appreciated but is not required.
 * 
 *     2. Altered source versions must be plainly marked as such, and must not be
 *     misrepresented as being the original software.
 * 
 *     3. This notice may not be removed or altered from any source
 *     distribution.
 */

{|n|
	var baseInst, leadInst, loadInst, win, adrop, bdrop, path;

	/*
	 * populate instrument name arrays
	 */
	baseInst = Array.new(64);
	leadInst = Array.new(64);
	path = "./instruments/2F/";
	p = PathName(path);
	p.filesDo({|n|
		var name = n.fileNameWithoutExtension;
		baseInst.add(name);
		leadInst.add(name);
	});

	/*
	 * load instrument
	 */
	loadInst = {|group, inst|
		(path++inst++".sc").load.value(group, n);
	};

	loadInst.value(\base, baseInst[0]);
	loadInst.value(\lead, leadInst[0]);

	win = Window.new("2F Instruments", Rect(200,200,400,100)).front;

	adrop = PopUpMenu(win, Rect(10,10,180,20));
	adrop.items = baseInst;
	adrop.action = {|menu|
		loadInst.value(\base, menu.item);
	};

	bdrop = PopUpMenu(win, Rect(200,10,180,20));
	bdrop.items = leadInst;
	bdrop.action = {|menu|
		loadInst.value(\lead, menu.item);
	};
}