]> ruin.nu Git - moosique.git/blobdiff - MooNote.java
removed exportMIDI method; added quit, getPosition, setPosition and resume
[moosique.git] / MooNote.java
index 826b4c3c16ba00326eb9e0ebe5c6e8ed908280d9..d57772b92be50251ce9a06bb2456344cff570772 100644 (file)
@@ -17,23 +17,23 @@ public class MooNote {
         * 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());
        }
 
        /* 
@@ -41,7 +41,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 +50,7 @@ public class MooNote {
         + @param n     the length of the note in ticks (100 per beat)
         */
        public void setLength(int ticks) {
-       
+               
        }
 
        /* 
@@ -57,7 +58,7 @@ public class MooNote {
         * @return      the note on MidiEvent
         */
        public MidiEvent getNoteOnEvent() {
-       
+               return noteOnEvent;
        }
 
        /* 
@@ -65,7 +66,7 @@ public class MooNote {
         * @return      the note off MidiEvent
         */
        public MidiEvent getNoteOffEvent() {
-       
+               return noteOffEvent;
        }
 
        /* 
@@ -73,7 +74,7 @@ public class MooNote {
         * @return the pitch of the note
         */
        public int getPitch() {
-       
+               return noteOnMsg.getData1();
        }
 
        /* 
@@ -81,7 +82,7 @@ public class MooNote {
         * @return the velocity of the note
         */
        public int getVelocity() {
-       
+               return noteOnMsg.getData2();
        }
 
        /*