abc4j API Specification

abc.midi
Interface MidiConverterInterface

All Known Implementing Classes:
BasicMidiConverter, BasicPositionableMidiConverter, MidiConverterAbstract, OldBasicMidiConverter, OldMidiConverterAbstract

public interface MidiConverterInterface

This interface defines methods that should be implemented for any "tune to midi" converter. Improved converters could generate midi sequences depending on the type of tune rhythm, have nice ornaments features etc etc...


Method Summary
 javax.sound.midi.Instrument getInstrument()
          Returns the instrument currently used for sequence playback.
 void setInstrument(javax.sound.midi.Instrument instr)
          Sets the instrument to be used for sequence playback.
 javax.sound.midi.Sequence toMidiSequence(Tune tune)
          Returns the midi sequence corresponding to the given tune.
 

Method Detail

toMidiSequence

javax.sound.midi.Sequence toMidiSequence(Tune tune)
Returns the midi sequence corresponding to the given tune.

Parameters:
tune - A tune with a score.
Returns:
A midi sequence corresponding to the given tune.

getInstrument

javax.sound.midi.Instrument getInstrument()
Returns the instrument currently used for sequence playback.

Returns:
The instrument currently used for sequence playback. Returns null if not set.

setInstrument

void setInstrument(javax.sound.midi.Instrument instr)
                   throws javax.sound.midi.MidiUnavailableException
Sets the instrument to be used for sequence playback. This implicitly loads the given instrument.

Parameters:
instr - The instrument to be used for sequence playback.
Throws:
javax.sound.midi.MidiUnavailableException

abc4j API Specification

Submit a bug or feature