]> ruin.nu Git - moosique.git/blobdiff - MooKeyboard.java
no message
[moosique.git] / MooKeyboard.java
index 67664dfb1298db17435907fb07b81f4aec17dd1b..8b4389ddbda97bf47f4fbc7f768cae8b386cc30a 100644 (file)
@@ -10,7 +10,7 @@ import java.awt.event.*;
 public class MooKeyboard extends KeyAdapter {
 
        private boolean[] isOn = new boolean[120];
-       private static final int startNote = 48;
+       private static int startNote = 48;
        private static final int[] keyToNote = new int[120];
 
        /**
@@ -43,6 +43,14 @@ public class MooKeyboard extends KeyAdapter {
                }
        }
 
+       /**
+        * Sets the octave of the lower part of the keyboard (default = 4)
+        * @param n     the octave to start at
+        */
+       public void setOctave(int n) {
+               startNote = n * 12;
+       }
+
        /** Maps keycodes (array indices) to MIDI note numbers using the following layout:
         *
         *  2 3   5 6 7   9 0   =>  # #   # # #   # #