To receive button changes there is a new virtual method: virtual void buttonChanged(PatchButtonId bid, uint16_t value, uint16_t samples)
By implementing this method you will receive Pushbutton changes as well as MIDI note on/off messages. Having an event-based model makes it easier to manage button state in the patch. The ‘samples’ parameter gives the sample position (in the following audio block) at which the event belongs.
Note on and off messages are received with a button ID greater than or equal to MIDI_NOTE_BUTTON (defined to be 128). The note velocity is scaled up to a 12-bit value, with a value of zero for note off events.