1 import javax.sound.midi.*;
4 * Functional representation of a MIDI note, which contains two MIDI events, note on and note off.
6 * @author Andersson, Andreen, Lanneskog, Pehrson
10 public class MooNote {
12 private MidiEvent noteOn, noteOff;
15 * Creates a MooNote of the given pitch, velocity and length in the current track.
17 public MooNote (int pitch, int velocity, int length) {
22 * Sets the pitch of the current note.
23 + @param pitch the pitch of the note (0-127)
25 public void setPitch(int pitch) {
30 * Sets the velocity of the current note.
31 + @param vel the velocity of the note (0-127)
33 public void setVelocity(int vel) {
38 * Sets the length of the current note (or rather moves the note off event).
39 + @param n the length of the note in ticks (100 per beat)
41 public void setLength(int ticks) {
46 * Returns the note on event of the current note.
47 * @return the note on MidiEvent
49 public MidiEvent getNoteOnEvent() {
54 * Returns the note off event of the current note.
55 * @return the note off MidiEvent
57 public MidiEvent getNoteOffEvent() {
62 * Returns the pitch of the current note.
63 * @return the pitch of the note
65 public int getPitch() {
70 * Returns the velocity of the current note.
71 * @return the velocity of the note
73 public int getVelocity() {
78 * Returns the length of the current note.
79 * @return the length of the note
81 public int getLength() {