* Creates a MooNote of the given pitch, velocity and length in the current track.
*/
public MooNote (int pitch, int velocity, int length) {
- // MidiEvent(MidiMessage message, long tick)
noteOnMsg = new ShortMessage();
noteOffMsg = new ShortMessage();
- noteOnMsg.setMessage(ShortMessage.NOTE_ON, top.getChannel(), pitch, velocity);
- noteOffMsg.setMessage(ShortMessage.NOTE_OFF, top.getChannel(), pitch, velocity);
+ noteOnMsg.setMessage(ShortMessage.NOTE_ON, pitch, velocity);
+ noteOffMsg.setMessage(ShortMessage.NOTE_OFF, pitch, velocity);
// noteOnTime = ???;
noteOffTime = noteOnTime + length;
- noteOnEvent = new MidiEvent(noteOnMsg, noteOnTime)
- noteOffEvent = new MidiEvent(noteOffMsg, noteOffTime)
+ noteOnEvent = new MidiEvent(noteOnMsg, noteOnTime);
+ noteOffEvent = new MidiEvent(noteOffMsg, noteOffTime);
}
/*
* Sets the pitch of the current note.
- + @param pitch the pitch of the note (0-127)
+ * @param pitch the pitch of the note (0-127)
*/
public void setPitch(int pitch) {
-
+ noteOnMsg.setMessage(ShortMessage.NOTE_ON, pitch, noteOnMsg.getData2());
+ noteOffMsg.setMessage(ShortMessage.NOTE_OFF, pitch, noteOffMsg.getData2());
}
/*
+ @param vel the velocity of the note (0-127)
*/
public void setVelocity(int vel) {
-
+ noteOnMsg.setMessage(ShortMessage.NOTE_ON, noteOnMsg.getData1(), vel);
+ noteOffMsg.setMessage(ShortMessage.NOTE_OFF, noteOffMsg.getData1(), vel);
}
/*
+ @param n the length of the note in ticks (100 per beat)
*/
public void setLength(int ticks) {
-
+
}
/*
* @return the note on MidiEvent
*/
public MidiEvent getNoteOnEvent() {
-
+ return noteOnEvent;
}
/*
* @return the note off MidiEvent
*/
public MidiEvent getNoteOffEvent() {
-
+ return noteOffEvent;
}
/*
* @return the pitch of the note
*/
public int getPitch() {
-
+ return noteOnMsg.getData1();
}
/*
* @return the velocity of the note
*/
public int getVelocity() {
-
+ return noteOnMsg.getData2();
}
/*