All Packages Class Hierarchy This Package Previous Next Index
Class com.nosuch.midi.MidiMsg
java.lang.Object
|
+----com.nosuch.midi.MidiMsg
- public abstract class MidiMsg
- extends Object
- implements Cloneable
MidiMsg abstract class. Used for both "notes" (whether
they are complete notes or just isolated NoteOn's or NotOff's)
as well as MIDI system exclusives and controller messages.
The fundamental attribute of a MidiMsg is its time.
MidiPhrase objects are lists of MidiMsg objects, ordered by time.
Some of the methods (like getPitch/setPitch) are only applicable
to "note-like" objects. For non-note-like objects, these are no-ops.
-
MidiMsg()
-
-
MidiMsg(long)
-
-
clone()
- Return a new copy.
-
compareOrder(MidiMsg)
- Return true if this MidiMsg is less than the MidiMsg parameter,
in terms of ordering criteria within a MidiPhrase.
-
equals(MidiMsg)
- Return true if this object equals another.
-
getBytesOff()
- Get the array of bytes representing the end of the message.
-
getBytesOn()
- Get the array of bytes representing the start of the message.
-
getChannel()
- Get the channel (1 to 16).
-
getDuration()
- Get the duration (in clicks).
-
getPitch()
- Get the pitch (0 to 127).
-
getTime()
-
-
getVelocity()
- Get the velocity (0 to 127).
-
setChannel(int)
- Set the channel (1 to 16).
-
setDuration(long)
- Set the duration (in clicks).
-
setPitch(int)
- Set the pitch (0 to 127).
-
setTime(long)
-
-
setVelocity(int)
- Set the velocity (0 to 127).
-
toString()
- Return a human-readable version.
MidiMsg
public MidiMsg()
MidiMsg
public MidiMsg(long tm)
setTime
public void setTime(long tm)
getTime
public long getTime()
getPitch
public abstract int getPitch()
- Get the pitch (0 to 127).
setPitch
public abstract void setPitch(int p)
- Set the pitch (0 to 127).
getDuration
public abstract long getDuration()
- Get the duration (in clicks).
setDuration
public abstract void setDuration(long d)
- Set the duration (in clicks).
getChannel
public abstract int getChannel()
- Get the channel (1 to 16).
setChannel
public abstract void setChannel(int c)
- Set the channel (1 to 16).
getVelocity
public abstract int getVelocity()
- Get the velocity (0 to 127).
setVelocity
public abstract void setVelocity(int v)
- Set the velocity (0 to 127).
getBytesOn
public abstract byte[] getBytesOn()
- Get the array of bytes representing the start of the message.
getBytesOff
public abstract byte[] getBytesOff()
- Get the array of bytes representing the end of the message.
This method will return non-null for things that have duration,
such as a MidiNote.
toString
public abstract String toString()
- Return a human-readable version.
- Overrides:
- toString in class Object
clone
public abstract Object clone()
- Return a new copy.
- Overrides:
- clone in class Object
equals
public boolean equals(MidiMsg m)
- Return true if this object equals another.
compareOrder
public int compareOrder(MidiMsg m2)
- Return true if this MidiMsg is less than the MidiMsg parameter,
in terms of ordering criteria within a MidiPhrase. This method
should NOT be used for determining whether two MidiMsgs are "equal".
- Parameters:
- m - MidiMsg to compare
All Packages Class Hierarchy This Package Previous Next Index