]> ruin.nu Git - moosique.git/blobdiff - MooNote.java
Implemented some obvious methods.
[moosique.git] / MooNote.java
index 826b4c3c16ba00326eb9e0ebe5c6e8ed908280d9..fcf32e047c8af6d1819937c914cd57a7bd82f498 100644 (file)
@@ -20,8 +20,8 @@ public class MooNote {
                // 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)
@@ -33,7 +33,8 @@ public class MooNote {
         + @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());
        }
 
        /* 
@@ -41,7 +42,8 @@ public class MooNote {
         + @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);
        }
 
        /* 
@@ -49,7 +51,7 @@ public class MooNote {
         + @param n     the length of the note in ticks (100 per beat)
         */
        public void setLength(int ticks) {
-       
+               
        }
 
        /* 
@@ -57,7 +59,7 @@ public class MooNote {
         * @return      the note on MidiEvent
         */
        public MidiEvent getNoteOnEvent() {
-       
+               return noteOnEvent;
        }
 
        /* 
@@ -65,7 +67,7 @@ public class MooNote {
         * @return      the note off MidiEvent
         */
        public MidiEvent getNoteOffEvent() {
-       
+               return noteOffEvent;
        }
 
        /* 
@@ -73,7 +75,7 @@ public class MooNote {
         * @return the pitch of the note
         */
        public int getPitch() {
-       
+               return noteOnMsg.getData1();
        }
 
        /* 
@@ -81,7 +83,7 @@ public class MooNote {
         * @return the velocity of the note
         */
        public int getVelocity() {
-       
+               return noteOnMsg.getData2();
        }
 
        /*