예제 #1
0
 @Override
 public void decrementInstrument() {
   if (selected_instrument > low) --selected_instrument;
   for (CustomPatchElement cpatch : patches.get(selected_instrument).getPatch()) {
     patch = instrument[cpatch.getInstrument()].getPatch();
     cpatch.getChannel().programChange(patch.getBank(), patch.getProgram());
   }
 }
예제 #2
0
  public CustomControls(MidiChannel[] channels, Instrument[] instrument, Patch patch) {
    this.channels = channels;
    this.instrument = instrument;
    this.patch = patch;
    this.patches = new HashMap<Integer, CustomPatch>();

    HashSet<CustomPatchElement> tmp = new HashSet<CustomPatchElement>();
    tmp.add(new CustomPatchElement(channels[0], 1, 127));
    tmp.add(new CustomPatchElement(channels[1], 20, 102));
    tmp.add(new CustomPatchElement(channels[2], 70, 75));

    patches.put(0, new CustomPatch("mine", tmp));

    for (CustomPatchElement c : patches.get(0).getPatch()) {
      patch = instrument[c.getInstrument()].getPatch();
      c.getChannel().programChange(patch.getBank(), patch.getProgram());
    }

    this.selected_instrument = 0;
  }