jmusic.midi
Class MidiUtil

java.lang.Object
  extended by jmusic.midi.MidiUtil

public class MidiUtil
extends java.lang.Object


Field Summary
static int STOP_TYPE
           
 
Constructor Summary
MidiUtil()
           
 
Method Summary
static javax.sound.midi.MidiEvent createCChangeEvent(int channel, int controlNum, int value, long tick)
          Create a Control Change event
static javax.sound.midi.MidiEvent createNoteOffEvent(int channel, int pitch, int velocity, long tick)
          Create a Note Off Event
static javax.sound.midi.MidiEvent createNoteOnEvent(int channel, int pitch, int velocity, long tick)
          Create a Note On Event
static javax.sound.midi.MidiEvent createProgramChangeEvent(int channel, int value, long tick)
          Create a Program Change Event
static javax.sound.midi.Sequence scoreToSeq(jm.music.data.Score score)
           
static javax.sound.midi.Sequence scoreToSeq(jm.music.data.Score score, short m_ppqn)
          Converts jmusic score data into a MIDI Sequence
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STOP_TYPE

public static final int STOP_TYPE
See Also:
Constant Field Values
Constructor Detail

MidiUtil

public MidiUtil()
Method Detail

createNoteOnEvent

public static javax.sound.midi.MidiEvent createNoteOnEvent(int channel,
                                                           int pitch,
                                                           int velocity,
                                                           long tick)
                                                    throws javax.sound.midi.InvalidMidiDataException
Create a Note On Event

Parameters:
int - channel is the channel to change
int - pitch is the pitch of the note
int - velocity is the velocity of the note
long - tick is the time this event occurs
Throws:
javax.sound.midi.InvalidMidiDataException

createNoteOffEvent

public static javax.sound.midi.MidiEvent createNoteOffEvent(int channel,
                                                            int pitch,
                                                            int velocity,
                                                            long tick)
                                                     throws javax.sound.midi.InvalidMidiDataException
Create a Note Off Event

Parameters:
int - channel is the channel to change
int - pitch is the pitch of the note
int - velocity is the velocity of the note
long - tick is the time this event occurs
Throws:
javax.sound.midi.InvalidMidiDataException

createProgramChangeEvent

public static javax.sound.midi.MidiEvent createProgramChangeEvent(int channel,
                                                                  int value,
                                                                  long tick)
                                                           throws javax.sound.midi.InvalidMidiDataException
Create a Program Change Event

Parameters:
int - channel is the channel to change
int - value is the new value to use
long - tick is the time this event occurs
Throws:
javax.sound.midi.InvalidMidiDataException

createCChangeEvent

public static javax.sound.midi.MidiEvent createCChangeEvent(int channel,
                                                            int controlNum,
                                                            int value,
                                                            long tick)
                                                     throws javax.sound.midi.InvalidMidiDataException
Create a Control Change event

Parameters:
int - channel is the channel to use
int - controlNum is the control change number to use
int - value is the value of the control change
Throws:
javax.sound.midi.InvalidMidiDataException

scoreToSeq

public static javax.sound.midi.Sequence scoreToSeq(jm.music.data.Score score)
                                            throws javax.sound.midi.InvalidMidiDataException
Throws:
javax.sound.midi.InvalidMidiDataException

scoreToSeq

public static javax.sound.midi.Sequence scoreToSeq(jm.music.data.Score score,
                                                   short m_ppqn)
                                            throws javax.sound.midi.InvalidMidiDataException
Converts jmusic score data into a MIDI Sequence

Parameters:
Score - score - data to play
Returns:
Sequence to be played
Throws:
java.lang.Exception
javax.sound.midi.InvalidMidiDataException