Module Duplex.WidgetKeyboard
A custom widget for visualizing an on-screen keyboard
Functions
-
update_all_keys ()
-
iterate through and update all visible keys
-
update_key (pitch)
-
update a given key's visual appearance
state is stored in keystates, also when not currently visible
Parameters:
- pitch
(int) the key we wish to update
-
index_to_midi_msg (key_idx, release)
-
generate output based on the pressed key
Parameters:
-
index_to_note (key_idx)
-
convert a given index to midi note (on/off)
Parameters:
-
note_to_index (pitch)
-
convert a pitch to an index
Parameters:
Returns:
int when pitch is within view, nil when not
Tables
-
self.pressed_keys
-
(table) list of pressed keys
-
self.disabled_keys
-
(table) list of disabled keys
-
self.keystates
-
(table) visual state for each key, indexed by pitch
if not specified, defaults to KEYSCOLORWHITE etc.
{
white = {r,g,b},
whitepressed = {r,g,b},
whitedisabled = {r,g,b},
black = {r,g,b},
blackpressed = {r,g,b},
blackdisabled = {r,g,b},
}
Fields
-
self.voicemgr
-
(OscVoiceMgr) this is where we get our active voices from
-
self.param
-
(table) the control-map parameter that define this widget
-
self.display
-
(Display) where we direct our messages
-
self.id
-
viewbuilder id
-
self.oct_dn
-
transpose down
-
self.oct_up
-
transpose up
-
self.range
-
(int) number of keys
-
self.show_octave
-
(bool) add octave buttons on either side
-
self.upper_note
-
(int) upper boundary
-
self.lower_note
-
(int) lower boundary
-
self.octave
-
(int) current octave (as seen in the left side)
-
self.width
-
(number) relative width
-
self.height
-
(number) relative height
-
self.tooltip
-
(string)
-
self.channel
-
(int) the channel used when generating output