All Packages Class Hierarchy This Package Previous Next Index
Class com.nosuch.midi.MidiNote
java.lang.Object
|
+----com.nosuch.midi.MidiMsg
|
+----com.nosuch.midi.MidiNote
- public class MidiNote
- extends MidiMsg
- implements Cloneable, MidiNoteable
A MidiNote is a MidiMsg that has a duration, and consists of a note-on
and a note-off. By packaging the two MIDI messages in a single item,
algorithmic stuff is easier. The MidiSystem.schedule() method automatically
handles the scheduling of both pieces of a MidiNote message.
-
MidiNote(int)
- Constructor
-
MidiNote(int, long, int, int, long)
- Constructor
-
clone()
- Return a clone of a MidiNote.
-
defaultChannel(int)
- Set the default channel used when MidiNotes are created.
-
defaultDuration(long)
- Set the default duration used when MidiNotes are created.
-
defaultVelocity(int)
- Set the default velocity used when MidiNotes are created.
-
equals(MidiMsg)
- Return true if this object equals another.
-
getBytesOff()
- Get the bytes representing the ending of the note
-
getBytesOn()
- Get the bytes representing the start of the note
-
getChannel()
- Get the channel (1-16)
-
getDuration()
- Get the duration (in clicks)
-
getPitch()
- Get the pitch (0-127)
-
getVelocity()
- Get the velocity (0-127)
-
setChannel(int)
- Set the channel (1-16)
-
setDuration(long)
- Set the duration (in clicks)
-
setPitch(int)
- Set the pitch (0-127)
-
setVelocity(int)
- Set the velocity (0-127)
-
toString()
- Get a human-readable version of the note
MidiNote
public MidiNote(int p,
long t,
int c,
int v,
long d)
- Constructor
- Parameters:
- t - time (in clicks)
- p - pitch (0-127)
- c - channel (1-16)
- v - velocity (0-127)
- d - duration (in clicks)
MidiNote
public MidiNote(int p)
- Constructor
- Parameters:
- p - pitch (0-127)
The default values for channel, velocity, and duration are used.
The default values can be changed with defaultChannel(),
defaultVelocity(), and defaultDuration().
clone
public Object clone()
- Return a clone of a MidiNote. Note that "next" is *not* cloned.
- Overrides:
- clone in class MidiMsg
equals
public boolean equals(MidiMsg m)
- Return true if this object equals another.
- Overrides:
- equals in class MidiMsg
defaultDuration
public static void defaultDuration(long d)
- Set the default duration used when MidiNotes are created.
- Parameters:
- d - duration (in clicks)
defaultChannel
public static void defaultChannel(int c)
- Set the default channel used when MidiNotes are created.
- Parameters:
- c - channel (1-16)
defaultVelocity
public static void defaultVelocity(int v)
- Set the default velocity used when MidiNotes are created.
- Parameters:
- v - velocity (0-127)
getPitch
public int getPitch()
- Get the pitch (0-127)
- Overrides:
- getPitch in class MidiMsg
setPitch
public void setPitch(int p)
- Set the pitch (0-127)
- Overrides:
- setPitch in class MidiMsg
setDuration
public void setDuration(long d)
- Set the duration (in clicks)
- Overrides:
- setDuration in class MidiMsg
getDuration
public long getDuration()
- Get the duration (in clicks)
- Overrides:
- getDuration in class MidiMsg
getChannel
public int getChannel()
- Get the channel (1-16)
- Overrides:
- getChannel in class MidiMsg
setChannel
public void setChannel(int c)
- Set the channel (1-16)
- Overrides:
- setChannel in class MidiMsg
getVelocity
public int getVelocity()
- Get the velocity (0-127)
- Overrides:
- getVelocity in class MidiMsg
setVelocity
public void setVelocity(int v)
- Set the velocity (0-127)
- Overrides:
- setVelocity in class MidiMsg
getBytesOn
public byte[] getBytesOn()
- Get the bytes representing the start of the note
- Overrides:
- getBytesOn in class MidiMsg
getBytesOff
public byte[] getBytesOff()
- Get the bytes representing the ending of the note
- Overrides:
- getBytesOff in class MidiMsg
toString
public String toString()
- Get a human-readable version of the note
- Overrides:
- toString in class MidiMsg
All Packages Class Hierarchy This Package Previous Next Index