Diatonic Keyboard With Controllers
It is a compound set of DiatonicKeyboard with the following controllers:
it can toggle
NoteExpressionmodeit can change the note expression sensitivity using slider. It ranges from
32to320(2 inches).it can change the base octave.
The list of parameters are almost identical to DiatonicKeyboard, except:
some parameters are named "initial",
there are showXXX parameters that indicate whether it should render each controllers.
For more details, see DiatonicKeyboard documentation.
Parameters
a List of Long that holds note states. It must contain 128 elements. Currently it only expects that note on state holds non-zero value.
a Modifier that applies to its top level Column.
an event handler that is called when a key for a note is pressed
an event handler that is called when a key for a note is released
an event handler that is called when note expression events occur, by dragging (if indicated so by moveAction). The value range for data sent to the handler depends on the target origin. For HorizontalDragging and VerticalDragging they are -1.0f..1.0f. For Pressure it is up to device.
indicates whether the mode (note change vs. note expression) toggle switch is rendered. true by default.
indicates whether the expression sensitivity slider is rendered. true by default.
indicates whether the octave slider is rendered. true by default.
indicates the initial value of moveAction that how dragging works. See the documentation on DiatonicKeyboardMoveAction enumeration type. NoteChange by default.
the initial value of octave (in zero-based counting i.e. 0 to 9 or 10 (up to numWhiteKeys). 4 by default.
the number of white keys to be rendered. 14 by default (which means 2 octaves)
the initial value of the sensitivity parameter over note expression dragging. The value is treated as a Dp value that corresponds to the width for "half" of the motion size towards max or min value. 80 (Dp) by default.
The display size for one white key width. 30.dp by default.
The display size for black key height. 35.dp by default.
The display size for the whole keyboard control. It is automatically calculated as whiteKeyWidth * numWhiteKeys but you can change it. Alternatively, you can explicitly specify null then it will take use Modifier.fillMaxSize() (but note that the number of the rendered key is governed by numWhiteKeys anyways).
The display size for the whole keyboard control. It also means white key height. 60.dp by default.
A Color value for the note on indication on the white keys. Color.Cyan by default.
A Color value for the note on indication on the black keys. whiteNoteOnColor by default.
A Color value for the white keys (when not at note-on state). Color.White by default.
A Color value for the black keys (when not at note-on state). Color.Black by default.