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;
15 public MooInstrumentList(int chan) {
18 setFont(new Font("Helvetica", Font.PLAIN, 10));
19 addActionListener(this);
22 public void setChannel(int chan){
24 setSelectedIndex(Moosique.getChannel(chan).getProgram());
26 public void actionPerformed(ActionEvent e) {
27 JComboBox box = (JComboBox)e.getSource();
28 int instrument = box.getSelectedIndex();
29 Moosique.getChannel(channel).programChange(instrument);
32 public static final String[] instruments = {
33 " 0 Acoustic Grand Piano",
34 " 1 Bright Acoustic Piano",
35 " 2 Electric Grand Piano",
36 " 3 Honky-Tonk Piano",
50 " 17 Percussive Organ",
56 " 23 Tango Accordion",
57 " 24 Acoustic Nylon Guitar",
58 " 25 Acoustic Steel Guitar",
59 " 26 Electric Jazz Guitar",
60 " 27 Electric Clean Guitar",
61 " 28 Electric Muted Guitar",
62 " 29 Overdriven Guitar",
63 " 30 Distortion Guitar",
64 " 31 Guitar Harmonics",
66 " 33 Electric Bass Fingered",
67 " 34 Electric Bass Picked",
77 " 44 Tremolo Strings",
78 " 45 Pizzicato Strings",
79 " 46 Orchestral Harp",
81 " 48 String Ensemble 1",
82 " 49 String Ensemble 2",
83 " 50 Synth Strings 1",
84 " 51 Synth Strings 2",
113 " 80 Synth Lead 1 Square Wave Lead",
114 " 81 Synth Lead 2 Sawtooth Wave Lead",
115 " 82 Synth Lead 3 Caliope Lead",
116 " 83 Synth Lead 4 Chiff Lead",
117 " 84 Synth Lead 5 Charang",
118 " 85 Synth Lead 6 Solo Synth Voice",
119 " 86 Synth Lead 7 Bright Saw Wave",
120 " 87 Synth Lead 8 Brass and Lead",
121 " 88 Synth Pad 1 Fantasia Pad",
122 " 89 Synth Pad 2 Warm Pad",
123 " 90 Synth Pad 3 Poly Synth Pad",
124 " 91 Synth Pad 4 Space Voice Pad",
125 " 92 Synth Pad 5 Bowed Glass Pad",
126 " 93 Synth Pad 6 Metal Pad",
127 " 94 Synth Pad 7 Halo Pad",
128 " 95 Synth Pad 8 Sweep Pad",
129 " 96 Synth SFX 1 Ice Rain",
130 " 97 Synth SFX 2 Sound Track",
131 " 98 Synth SFX 3 Crystal",
132 " 99 Synth SFX 4 Atmosphere",
133 " 100 Synth SFX 5 Brightness",
134 " 101 Synth SFX 6 Goblin",
135 " 102 Synth SFX 7 Echo Drops",
136 " 103 Synth SFX 8 Star Theme",
152 " 119 Reverse Cymbal",
153 " 120 Guitar Fret Noise",
157 " 124 Telephone Ring",