abc.midi
Class MidiConverterAbstract

java.lang.Object
  extended byabc.midi.MidiConverterAbstract
All Implemented Interfaces:
MidiConverterInterface
Direct Known Subclasses:
BasicMidiConverter

public abstract class MidiConverterAbstract
extends java.lang.Object
implements MidiConverterInterface

MidiConverter class defines various static methods to convert abc related stuff to midi : notes, tunes etc...


Constructor Summary
MidiConverterAbstract()
           
 
Method Summary
abstract  javax.sound.midi.MidiMessage getMidiEventFor(Tempo tempo)
          Returns the corresponding midi events for a tempo change.
static byte getMidiNoteNumber(Note note, KeySignature key)
          Returns the midi note number corresponding a note in the given key.
static long getNoteLengthInTicks(MultiNote note)
          Returns the length of the multi note in ticks.
abstract  javax.sound.midi.MidiMessage[] getNoteOffMessageFor(Note note, KeySignature key)
           
abstract  javax.sound.midi.MidiMessage[] getNoteOneMessageFor(Note note, KeySignature key)
           
 javax.sound.midi.Sequence toMidiSequence(Tune tune)
          Converts the given tune to a midi sequence.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiConverterAbstract

public MidiConverterAbstract()
Method Detail

toMidiSequence

public javax.sound.midi.Sequence toMidiSequence(Tune tune)
Converts the given tune to a midi sequence.

Specified by:
toMidiSequence in interface MidiConverterInterface
Parameters:
tune - The tune to be converted.
Returns:
The midi sequence of the tune.

getNoteOneMessageFor

public abstract javax.sound.midi.MidiMessage[] getNoteOneMessageFor(Note note,
                                                                    KeySignature key)
                                                             throws javax.sound.midi.InvalidMidiDataException
Throws:
javax.sound.midi.InvalidMidiDataException

getNoteOffMessageFor

public abstract javax.sound.midi.MidiMessage[] getNoteOffMessageFor(Note note,
                                                                    KeySignature key)
                                                             throws javax.sound.midi.InvalidMidiDataException
Throws:
javax.sound.midi.InvalidMidiDataException

getMidiEventFor

public abstract javax.sound.midi.MidiMessage getMidiEventFor(Tempo tempo)
                                                      throws javax.sound.midi.InvalidMidiDataException
Returns the corresponding midi events for a tempo change.

Throws:
javax.sound.midi.InvalidMidiDataException

getNoteLengthInTicks

public static long getNoteLengthInTicks(MultiNote note)
Returns the length of the multi note in ticks. This length is calculated from the resolution of the midi sequence manipulated internally.

Returns:
The length of the multi note in ticks : this is equal to the length of the longest note of the multi note.

getMidiNoteNumber

public static byte getMidiNoteNumber(Note note,
                                     KeySignature key)
Returns the midi note number corresponding a note in the given key.

Parameters:
note - The note.
key - The key.
Returns:
The midi heigth of the note in the given key.