All Packages Class Hierarchy This Package Previous Next Index
Class com.nosuch.midi.MidiBytes
java.lang.Object
|
+----com.nosuch.midi.MidiMsg
|
+----com.nosuch.midi.MidiBytes
- public class MidiBytes
- extends MidiMsg
- implements Cloneable
Manage MIDI messages that consist of just bytes (e.g. sysex).
-
MidiBytes()
- Create a MidiBytes message.
-
MidiBytes(byte)
- Create a MidiBytes message.
-
MidiBytes(byte, byte)
- Create a MidiBytes message.
-
MidiBytes(byte, byte, byte)
- Create a MidiBytes message.
-
MidiBytes(long, byte[])
- Create a MidiBytes message.
-
addByte(byte)
- Add a byte to the end of this message.
-
clone()
- Return a new copy.
-
equals(MidiMsg)
- Return true if this object equals another.
-
getBytesOff()
- Return an array of bytes containing the ending half of the message.
-
getBytesOn()
- Return an array of bytes containing the contents of the message.
-
getChannel()
- Return the channel of this message.
-
getDuration()
- Return the duration of this message.
-
getPitch()
- Return the pitch of this message.
-
getVelocity()
- Return the velocity of this message.
-
setChannel(int)
- Set the channel of this message.
-
setDuration(long)
- Set the duration of this message.
-
setPitch(int)
- Set the pitch of this message.
-
setVelocity(int)
- Set the velocity of this message.
-
toString()
- Return a human-readable representation of the message.
MidiBytes
public MidiBytes(long t,
byte b[])
- Create a MidiBytes message.
- Parameters:
- t - time (in clicks) of the message.
- b - array of bytes to be stored in the message.
MidiBytes
public MidiBytes()
- Create a MidiBytes message.
The default time of the message is is 0.
MidiBytes
public MidiBytes(byte c1)
- Create a MidiBytes message.
The message is initialized with a single byte.
MidiBytes
public MidiBytes(byte c1,
byte c2)
- Create a MidiBytes message.
The message is initialized with two bytes.
MidiBytes
public MidiBytes(byte c1,
byte c2,
byte c3)
- Create a MidiBytes message.
The message is initialized with three bytes.
clone
public Object clone()
- Return a new copy.
- Overrides:
- clone in class MidiMsg
equals
public boolean equals(MidiMsg m)
- Return true if this object equals another.
- Overrides:
- equals in class MidiMsg
getPitch
public int getPitch()
- Return the pitch of this message.
For MidiByte messages, this is meaningless, so -1 is returned.
This method (and the next few methods) are included so that
code can be written conveniently using just the MidiMsg methods.
- Overrides:
- getPitch in class MidiMsg
setPitch
public void setPitch(int p)
- Set the pitch of this message.
For MidiByte messages, this is meaningless, so it is ignored.
- Overrides:
- setPitch in class MidiMsg
getDuration
public long getDuration()
- Return the duration of this message.
For MidiByte messages, this is meaningless, so -1 is returned.
- Overrides:
- getDuration in class MidiMsg
setDuration
public void setDuration(long d)
- Set the duration of this message.
For MidiByte messages, this is meaningless, so it is ignored.
- Overrides:
- setDuration in class MidiMsg
getChannel
public int getChannel()
- Return the channel of this message.
For MidiBytes messages, this is is potentially useful (e.g. for
controller messages and things), but for the moment we return -1.
- Overrides:
- getChannel in class MidiMsg
setChannel
public void setChannel(int c)
- Set the channel of this message.
For MidiBytes messages, this is is potentially useful (e.g. for
controller messages and things), but for the moment we ignore it.
- Overrides:
- setChannel in class MidiMsg
getVelocity
public int getVelocity()
- Return the velocity of this message.
For MidiBytes messages, this is meaningless, so we return -1.
- Overrides:
- getVelocity in class MidiMsg
setVelocity
public void setVelocity(int v)
- Set the velocity of this message.
For MidiBytes messages, this is meaningless, so we ignore it.
- Overrides:
- setVelocity in class MidiMsg
getBytesOn
public byte[] getBytesOn()
- Return an array of bytes containing the contents of the message.
- Overrides:
- getBytesOn in class MidiMsg
getBytesOff
public byte[] getBytesOff()
- Return an array of bytes containing the ending half of the message.
For MidiBytes messages, this is always null. In the future, though,
there might be things other than MidiNote messages (for example,
like MidiSustain messages) that have duration, and which would
make use of getBytesOff().
- Overrides:
- getBytesOff in class MidiMsg
addByte
public void addByte(byte b)
- Add a byte to the end of this message.
toString
public String toString()
- Return a human-readable representation of the message.
- Overrides:
- toString in class MidiMsg
All Packages Class Hierarchy This Package Previous Next Index