Example usage for javax.sound.midi Instrument getPatch

List of usage examples for javax.sound.midi Instrument getPatch

Introduction

In this page you can find the example usage for javax.sound.midi Instrument getPatch.

Prototype

public Patch getPatch() 

Source Link

Document

Obtains the Patch object that indicates the bank and program numbers where this instrument is to be stored in the synthesizer.

Usage

From source file:com.rockhoppertech.music.midi.js.MIDITrack.java

/**
 * Changes the patch on all {@code MIDINote}s in this track.
 * /* www. j a v a2  s. c o m*/
 * @param instrument
 *            the {@code Instrument}
 */
public void useInstrument(Instrument instrument) {
    this.instrument = instrument;
    InstrumentModifier mod = new InstrumentModifier(instrument.getPatch().getProgram());
    this.map(mod);
}