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


Constructor Index

 o MidiBytes()
Create a MidiBytes message.
 o MidiBytes(byte)
Create a MidiBytes message.
 o MidiBytes(byte, byte)
Create a MidiBytes message.
 o MidiBytes(byte, byte, byte)
Create a MidiBytes message.
 o MidiBytes(long, byte[])
Create a MidiBytes message.

Method Index

 o addByte(byte)
Add a byte to the end of this message.
 o clone()
Return a new copy.
 o equals(MidiMsg)
Return true if this object equals another.
 o getBytesOff()
Return an array of bytes containing the ending half of the message.
 o getBytesOn()
Return an array of bytes containing the contents of the message.
 o getChannel()
Return the channel of this message.
 o getDuration()
Return the duration of this message.
 o getPitch()
Return the pitch of this message.
 o getVelocity()
Return the velocity of this message.
 o setChannel(int)
Set the channel of this message.
 o setDuration(long)
Set the duration of this message.
 o setPitch(int)
Set the pitch of this message.
 o setVelocity(int)
Set the velocity of this message.
 o toString()
Return a human-readable representation of the message.

Constructors

 o 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.
 o MidiBytes
 public MidiBytes()
Create a MidiBytes message. The default time of the message is is 0.

 o MidiBytes
 public MidiBytes(byte c1)
Create a MidiBytes message. The message is initialized with a single byte.

 o MidiBytes
 public MidiBytes(byte c1,
                  byte c2)
Create a MidiBytes message. The message is initialized with two bytes.

 o MidiBytes
 public MidiBytes(byte c1,
                  byte c2,
                  byte c3)
Create a MidiBytes message. The message is initialized with three bytes.

Methods

 o clone
 public Object clone()
Return a new copy.

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

Overrides:
equals in class MidiMsg
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o getBytesOn
 public byte[] getBytesOn()
Return an array of bytes containing the contents of the message.

Overrides:
getBytesOn in class MidiMsg
 o 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
 o addByte
 public void addByte(byte b)
Add a byte to the end of this message.

 o 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