+ track.remove(noteOffEvent);
+ }
+
+ /**
+ * Returns a clone of this note.
+ */
+ public Object clone() {
+ return new MooNote(
+ new MidiEvent((ShortMessage)getMessage().clone(), getTick()),
+ new MidiEvent((ShortMessage)noteOffEvent.getMessage().clone(), noteOffEvent.getTick())
+ );
+ }
+
+ /**
+ * Compares this note to another note.
+ * @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
+ */
+ public int compareTo(Object o) {
+ return (int)(((MidiEvent)o).getTick() - getTick());