Callbacks
The Smart Multibox uses callbacks to communicate system events to the user code. Using one of the below functions, you specify another function that should be called when an event happens, then the system will call that function to report an event. On powerup, none of these callbacks are defined.
multibox_set_button_cb(cb_func)
Sets a callback function to be called when the button is pressed or released. The function should be in the following format:
Where pressed is a Boolean value that is True indicating the button is pressed or False if the button is released.
multibox_set_exp_pedal_cb(cb_func)
Sets a callback function to be called when the connected expression pedal moves. The function should be in the following format:
exp_pedal_cb(value)
Where value is the expression pedal's position, between 0 and 255.
multibox_set_ext_switch_cb(cb_func)
Sets a callback function to be called when the connected external switch changes state. The function should be in the following format:
ext_switch_cb(sw_num, pressed)
Where sw_num is EXTSWITCH_TIP or EXTSWITCH_RING and pressed is a Boolean value that is True indicating the button is pressed or False if the button is released.
multibox_midi_set_receive_cb(cb_func)
Sets a callback function to be called every time a MIDI message is received. The function should be in the following format:
midi_receive_cb(port, msg)
Where port is the MIDI port the message was received on (see the Constants section), and msg is the contents of the MIDI message.
multibox_set_tick_cb(cb_func)
Sets a callback function to be called every time the system tick happens (every 1msec). The function should be in the following format:
tick_cb()
No Comments