1 import javax.sound.midi.*;
4 import java.awt.event.*;
7 * A Combo Box where the instrument of the currently active channel can be selected.
9 * @author Einar Pehrson
12 public class MooInstrumentList extends JComboBox implements ActionListener {
14 protected int channel;
16 public MooInstrumentList(int instrument) {
18 setSelectedIndex(instrument);
19 setFont(new Font("Helvetica", Font.PLAIN, 10));
20 addActionListener(this);
23 public void setChannel(int chan){
25 setSelectedIndex(Moosique.getChannel(chan).getProgram());
28 public void actionPerformed(ActionEvent e) {
29 JComboBox box = (JComboBox)e.getSource();
30 int instrument = box.getSelectedIndex();
31 Moosique.getChannel(channel).programChange(instrument);
34 public static final String[] instruments = {
35 " 0 Acoustic Grand Piano",
36 " 1 Bright Acoustic Piano",
37 " 2 Electric Grand Piano",
38 " 3 Honky-Tonk Piano",
52 " 17 Percussive Organ",
58 " 23 Tango Accordion",
59 " 24 Acoustic Nylon Guitar",
60 " 25 Acoustic Steel Guitar",
61 " 26 Electric Jazz Guitar",
62 " 27 Electric Clean Guitar",
63 " 28 Electric Muted Guitar",
64 " 29 Overdriven Guitar",
65 " 30 Distortion Guitar",
66 " 31 Guitar Harmonics",
68 " 33 Electric Bass Fingered",
69 " 34 Electric Bass Picked",
79 " 44 Tremolo Strings",
80 " 45 Pizzicato Strings",
81 " 46 Orchestral Harp",
83 " 48 String Ensemble 1",
84 " 49 String Ensemble 2",
85 " 50 Synth Strings 1",
86 " 51 Synth Strings 2",
115 " 80 Synth Lead 1 Square Wave Lead",
116 " 81 Synth Lead 2 Sawtooth Wave Lead",
117 " 82 Synth Lead 3 Caliope Lead",
118 " 83 Synth Lead 4 Chiff Lead",
119 " 84 Synth Lead 5 Charang",
120 " 85 Synth Lead 6 Solo Synth Voice",
121 " 86 Synth Lead 7 Bright Saw Wave",
122 " 87 Synth Lead 8 Brass and Lead",
123 " 88 Synth Pad 1 Fantasia Pad",
124 " 89 Synth Pad 2 Warm Pad",
125 " 90 Synth Pad 3 Poly Synth Pad",
126 " 91 Synth Pad 4 Space Voice Pad",
127 " 92 Synth Pad 5 Bowed Glass Pad",
128 " 93 Synth Pad 6 Metal Pad",
129 " 94 Synth Pad 7 Halo Pad",
130 " 95 Synth Pad 8 Sweep Pad",
131 " 96 Synth SFX 1 Ice Rain",
132 " 97 Synth SFX 2 Sound Track",
133 " 98 Synth SFX 3 Crystal",
134 " 99 Synth SFX 4 Atmosphere",
135 " 100 Synth SFX 5 Brightness",
136 " 101 Synth SFX 6 Goblin",
137 " 102 Synth SFX 7 Echo Drops",
138 " 103 Synth SFX 8 Star Theme",
154 " 119 Reverse Cymbal",
155 " 120 Guitar Fret Noise",
159 " 124 Telephone Ring",