]> ruin.nu Git - moosique.git/commitdiff
no message
authorEinar Pehrson <einarp@itstud.chalmers.se>
Thu, 1 May 2003 16:28:49 +0000 (16:28 +0000)
committerEinar Pehrson <einarp@itstud.chalmers.se>
Thu, 1 May 2003 16:28:49 +0000 (16:28 +0000)
MooKeyboard.java
To Do.txt

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   =>  # #   # # #   # #
index 907d0a3b8c7910abeeee2dd06359ee4c523e4a9c..00185b384dfcef4e8856fd12b20c6a12176e3403 100644 (file)
--- a/To Do.txt
+++ b/To Do.txt
@@ -29,4 +29,7 @@
                
                InputMap im = rootPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
                KeyStroke helpKey = KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0);
-               im.put(helpKey, "help");
\ No newline at end of file
+               im.put(helpKey, "help");
+
+* Oktavförändring i MooKeyboard
+       Mappa F9-F12 till MooKeyboard.setOctave(n) där n = {2, 4, 6, 8}
\ No newline at end of file