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.


Constructor Index

 o MidiMsg()
 o MidiMsg(long)

Method Index

 o clone()
Return a new copy.
 o compareOrder(MidiMsg)
Return true if this MidiMsg is less than the MidiMsg parameter, in terms of ordering criteria within a MidiPhrase.
 o equals(MidiMsg)
Return true if this object equals another.
 o getBytesOff()
Get the array of bytes representing the end of the message.
 o getBytesOn()
Get the array of bytes representing the start of the message.
 o getChannel()
Get the channel (1 to 16).
 o getDuration()
Get the duration (in clicks).
 o getPitch()
Get the pitch (0 to 127).
 o getTime()
 o getVelocity()
Get the velocity (0 to 127).
 o setChannel(int)
Set the channel (1 to 16).
 o setDuration(long)
Set the duration (in clicks).
 o setPitch(int)
Set the pitch (0 to 127).
 o setTime(long)
 o setVelocity(int)
Set the velocity (0 to 127).
 o toString()
Return a human-readable version.

Constructors

 o MidiMsg
 public MidiMsg()
 o MidiMsg
 public MidiMsg(long tm)

Methods

 o setTime
 public void setTime(long tm)
 o getTime
 public long getTime()
 o getPitch
 public abstract int getPitch()
Get the pitch (0 to 127).

 o setPitch
 public abstract void setPitch(int p)
Set the pitch (0 to 127).

 o getDuration
 public abstract long getDuration()
Get the duration (in clicks).

 o setDuration
 public abstract void setDuration(long d)
Set the duration (in clicks).

 o getChannel
 public abstract int getChannel()
Get the channel (1 to 16).

 o setChannel
 public abstract void setChannel(int c)
Set the channel (1 to 16).

 o getVelocity
 public abstract int getVelocity()
Get the velocity (0 to 127).

 o setVelocity
 public abstract void setVelocity(int v)
Set the velocity (0 to 127).

 o getBytesOn
 public abstract byte[] getBytesOn()
Get the array of bytes representing the start of the message.

 o 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.

 o toString
 public abstract String toString()
Return a human-readable version.

Overrides:
toString in class Object
 o clone
 public abstract Object clone()
Return a new copy.

Overrides:
clone in class Object
 o equals
 public boolean equals(MidiMsg m)
Return true if this object equals another.

 o 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