]> ruin.nu Git - moosique.git/blob - MooInstrumentList.java
Added MooInstrumentList - a subcomponent to MooToolbar -
[moosique.git] / MooInstrumentList.java
1 import javax.sound.midi.*;
2 import javax.swing.*;
3 import java.awt.event.*;
4
5 /*
6  * A Combo Box where the instrument of the currently active channel can be selected.
7  * 
8  * @author  Einar Pehrson
9  */
10  
11 public class MooInstrumentList extends JComboBox implements ActionListener {
12
13         public MooInstrumentList() {
14                 super(instruments);
15                 addActionListener(this);
16         }
17
18         public void actionPerformed(ActionEvent e) {
19                 JComboBox box = (JComboBox)e.getSource();
20                 int instrument = box.getSelectedIndex();
21                 Moosique.getActiveChannel().programChange(instrument);
22         }
23     
24         public static final String[] instruments = {
25                 " 0 Acoustic Grand Piano",
26                 " 1 Bright Acoustic Piano",
27                 " 2 Electric Grand Piano",
28                 " 3 Honky-Tonk Piano",
29                 " 4 Rhodes Piano",
30                 " 5 Chorused Piano",
31                 " 6 Harpischord",
32                 " 7 Clavinet",
33                 " 8 Celesta",
34                 " 9 Glockenspiel",
35                 " 10 Music Box",
36                 " 11 Vibraphone",
37                 " 12 Marimba",
38                 " 13 Xylophone",
39                 " 14 Tubular Bells",
40                 " 15 Dulcimer",
41                 " 16 Hammond Organ",
42                 " 17 Percussive Organ",
43                 " 18 Rock Organ",
44                 " 19 Church Organ",
45                 " 20 Reed Organ",
46                 " 21 Accordion",
47                 " 22 Harmonica",
48                 " 23 Tango Accordion",
49                 " 24 Acoustic Nylon Guitar",
50                 " 25 Acoustic Steel Guitar",
51                 " 26 Electric Jazz Guitar",
52                 " 27 Electric Clean Guitar",
53                 " 28 Electric Muted Guitar",
54                 " 29 Overdriven Guitar",
55                 " 30 Distortion Guitar",
56                 " 31 Guitar Harmonics",
57                 " 32 Acoustic Bass",
58                 " 33 Electric Bass Fingered",
59                 " 34 Electric Bass Picked",
60                 " 35 Fretless Bass",
61                 " 36 Slap Bass 1",
62                 " 37 Slap Bass 2",
63                 " 38 Synth Bass 1",
64                 " 39 Synth Bass 2",
65                 " 40 Violin",
66                 " 41 Viola",
67                 " 42 Cello",
68                 " 43 Contrabass",
69                 " 44 Tremolo Strings",
70                 " 45 Pizzicato Strings",
71                 " 46 Orchestral Harp",
72                 " 47 Timpani",
73                 " 48 String Ensemble 1",
74                 " 49 String Ensemble 2",
75                 " 50 Synth Strings 1",
76                 " 51 Synth Strings 2",
77                 " 52 Choir Aahs",
78                 " 53 Voice Oohs",
79                 " 54 Synth Voice",
80                 " 55 Orchestral Hit",
81                 " 56 Trumpet",
82                 " 57 Trombone",
83                 " 58 Tuba",
84                 " 59 Muted Trumpet",
85                 " 60 French Horn",
86                 " 61 Brass Section",
87                 " 62 Synth Brass 1",
88                 " 63 Synth Brass 2",
89                 " 64 Soprano Sax",
90                 " 65 Alto Sax",
91                 " 66 Tenor Sax",
92                 " 67 Baritone Sax",
93                 " 68 Oboe",
94                 " 69 English Horn",
95                 " 70 Bassoon",
96                 " 71 Clarinet",
97                 " 72 Piccolo",
98                 " 73 Flute",
99                 " 74 Recorder",
100                 " 75 Pan Flute",
101                 " 76 Bottle Blow",
102                 " 77 Shakuhachi",
103                 " 78 Whistle",
104                 " 79 Ocarina",
105                 " 80 Synth Lead 1 Square Wave Lead",
106                 " 81 Synth Lead 2 Sawtooth Wave Lead",
107                 " 82 Synth Lead 3 Caliope Lead",
108                 " 83 Synth Lead 4 Chiff Lead",
109                 " 84 Synth Lead 5 Charang",
110                 " 85 Synth Lead 6 Solo Synth Voice",
111                 " 86 Synth Lead 7 Bright Saw Wave",
112                 " 87 Synth Lead 8 Brass and Lead",
113                 " 88 Synth Pad 1 Fantasia Pad",
114                 " 89 Synth Pad 2 Warm Pad",
115                 " 90 Synth Pad 3 Poly Synth Pad",
116                 " 91 Synth Pad 4 Space Voice Pad",
117                 " 92 Synth Pad 5 Bowed Glass Pad",
118                 " 93 Synth Pad 6 Metal Pad",
119                 " 94 Synth Pad 7 Halo Pad",
120                 " 95 Synth Pad 8 Sweep Pad",
121                 " 96 Synth SFX 1 Ice Rain",
122                 " 97 Synth SFX 2 Sound Track",
123                 " 98 Synth SFX 3 Crystal",
124                 " 99 Synth SFX 4 Atmosphere",
125                 " 100 Synth SFX 5 Brightness",
126                 " 101 Synth SFX 6 Goblin",
127                 " 102 Synth SFX 7 Echo Drops",
128                 " 103 Synth SFX 8 Star Theme",
129                 " 104 Sitar",
130                 " 105 Banjo",
131                 " 106 Shamisen",
132                 " 107 Koto",
133                 " 108 Kalimba",
134                 " 109 Bagpipe",
135                 " 110 Fiddle",
136                 " 111 Shanai",
137                 " 112 Tinkle Bells",
138                 " 113 Agogo",
139                 " 114 Steel Drums",
140                 " 115 Woodblock",
141                 " 116 Taiko Drum",
142                 " 117 Melodic Tom",
143                 " 118 Synth Drum",
144                 " 119 Reverse Cymbal",
145                 " 120 Guitar Fret Noise",
146                 " 121 Breath Noise",
147                 " 122 Seashore",
148                 " 123 Bird Tweet",
149                 " 124 Telephone Ring",
150                 " 125 Helicopter",
151                 " 126 Applause",
152                 " 127 Gunshot"
153         };
154 }