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.


Constructor Index

 o MidiNote(int)
Constructor
 o MidiNote(int, long, int, int, long)
Constructor

Method Index

 o clone()
Return a clone of a MidiNote.
 o defaultChannel(int)
Set the default channel used when MidiNotes are created.
 o defaultDuration(long)
Set the default duration used when MidiNotes are created.
 o defaultVelocity(int)
Set the default velocity used when MidiNotes are created.
 o equals(MidiMsg)
Return true if this object equals another.
 o getBytesOff()
Get the bytes representing the ending of the note
 o getBytesOn()
Get the bytes representing the start of the note
 o getChannel()
Get the channel (1-16)
 o getDuration()
Get the duration (in clicks)
 o getPitch()
Get the pitch (0-127)
 o getVelocity()
Get the velocity (0-127)
 o setChannel(int)
Set the channel (1-16)
 o setDuration(long)
Set the duration (in clicks)
 o setPitch(int)
Set the pitch (0-127)
 o setVelocity(int)
Set the velocity (0-127)
 o toString()
Get a human-readable version of the note

Constructors

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

Methods

 o clone
 public Object clone()
Return a clone of a MidiNote. Note that "next" is *not* cloned.

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 defaultDuration
 public static void defaultDuration(long d)
Set the default duration used when MidiNotes are created.

Parameters:
d - duration (in clicks)
 o defaultChannel
 public static void defaultChannel(int c)
Set the default channel used when MidiNotes are created.

Parameters:
c - channel (1-16)
 o defaultVelocity
 public static void defaultVelocity(int v)
Set the default velocity used when MidiNotes are created.

Parameters:
v - velocity (0-127)
 o getPitch
 public int getPitch()
Get the pitch (0-127)

Overrides:
getPitch in class MidiMsg
 o setPitch
 public void setPitch(int p)
Set the pitch (0-127)

Overrides:
setPitch in class MidiMsg
 o setDuration
 public void setDuration(long d)
Set the duration (in clicks)

Overrides:
setDuration in class MidiMsg
 o getDuration
 public long getDuration()
Get the duration (in clicks)

Overrides:
getDuration in class MidiMsg
 o getChannel
 public int getChannel()
Get the channel (1-16)

Overrides:
getChannel in class MidiMsg
 o setChannel
 public void setChannel(int c)
Set the channel (1-16)

Overrides:
setChannel in class MidiMsg
 o getVelocity
 public int getVelocity()
Get the velocity (0-127)

Overrides:
getVelocity in class MidiMsg
 o setVelocity
 public void setVelocity(int v)
Set the velocity (0-127)

Overrides:
setVelocity in class MidiMsg
 o getBytesOn
 public byte[] getBytesOn()
Get the bytes representing the start of the note

Overrides:
getBytesOn in class MidiMsg
 o getBytesOff
 public byte[] getBytesOff()
Get the bytes representing the ending of the note

Overrides:
getBytesOff in class MidiMsg
 o 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