Package eu.bandm.music.entities
Class Keyboard
java.lang.Object
eu.bandm.music.entities.Keyboard
Models the mapping of Functional Pitches to a standard Keyboard structure.
In that, one single key stands for multiple pitches. One key is represented by some
integer numeric value. This model is totally arbitrary, but follows here
the MIDI definition for convenience.
(The range limits of the MIDI definition are not respected, only the
positioning.)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Numeric value of "small" octave, as defined inOctaveRegister
is "0(zero").
Numeric value i.e. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Deliver an index into the keyboard for the given FunctionalPitch.static FunctionalPitch
pitchByKey
(int keyNumber, TwelveToneFunctionalRepresentation rep) Deliver a functional pitch which is represented by this key.
-
Field Details
-
midiKeyOffset
public static final int midiKeyOffsetNumeric value of "small" octave, as defined inOctaveRegister
is "0(zero").
Numeric value i.e. @link{FunctionalPitchModOctave#get_halfTonesFromC()}, is "0(zero") for c.
"c-one" has the midi-key value of decimal 60. This leads to the formula "HalftonesFromC + Octave * 12 +midiKeyOffset
", with midiKeyOffset == 48 .Attention: Using the MIDI encoding for octaves this offset is 12, because MIDI "C1" = "contra-C" = key 24.
- See Also:
-
-
Constructor Details
-
Keyboard
public Keyboard()
-
-
Method Details
-
keyNumber
Deliver an index into the keyboard for the given FunctionalPitch. Being in principle totally arbitrary, this implementation follows the Midi numbering scheme. -
pitchByKey
Deliver a functional pitch which is represented by this key.- Parameters:
keyNumber
- the number of this keyrep
- a mapping of the chromatic scale 0..11 of keys starting with "c" to pitch classes.
-