From: Einar Pehrson Date: Thu, 1 May 2003 16:28:49 +0000 (+0000) Subject: no message X-Git-Url: https://ruin.nu/git/?p=moosique.git;a=commitdiff_plain;h=dd6e5fe331907fbbbe9539dd880ce2ec895501d7 no message --- diff --git a/MooKeyboard.java b/MooKeyboard.java index 67664df..8b4389d 100644 --- a/MooKeyboard.java +++ b/MooKeyboard.java @@ -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 => # # # # # # # diff --git a/To Do.txt b/To Do.txt index 907d0a3..00185b3 100644 --- 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