IPadLogicHandler
#include "crosspad/pad/IPadLogicHandler.hpp"Generated from crosspad/pad/IPadLogicHandler.hpp in crosspad-core. Edit the header’s doxygen comments to change this page.
Recipes that use it: Pads and LEDs, Play a sample, MIDI out
crosspad::IPadLogicHandler
Section titled “crosspad::IPadLogicHandler”Interface for application-specific pad logic handlers.
Each application (sequencer, sampler, etc.) can implement this interface to define custom behavior when pads are pressed, released, or receive pressure.
Used in Pads and LEDs, Play a sample, MIDI out.
Members
| Member | Description |
|---|---|
onActivate | Called when this handler becomes the active pad logic. |
onDeactivate | Called when this handler is deactivated. |
onPadPress | Called when a pad is pressed (padIdx 0-15, velocity 0-127) |
onPadRelease | Called when a pad is released (padIdx 0-15) |
onPadPressure | Called when pad pressure changes — aftertouch (padIdx 0-15, pressure 0-127) |
onPadPan | Called when the press moves across the pad — left/right balance of the two cells under it, 0 centred. Streams while the pad is held, on change only. Optional: a handler that plays notes has no use for it. |
Methods
onActivate
Section titled “onActivate”virtual void onActivate(PadManager &padManager) = 0Called when this handler becomes the active pad logic.
Used in Pads and LEDs, Play a sample.
onDeactivate
Section titled “onDeactivate”Do not free state in onDeactivate that a pad callback may still read; keep it until the app object is destroyed.
virtual void onDeactivate(PadManager &padManager) = 0Called when this handler is deactivated.
Used in Pads and LEDs, Play a sample, MIDI out.
onPadPress
Section titled “onPadPress”virtual void onPadPress(PadManager &padManager, uint8_t padIdx, uint8_t velocity) = 0Called when a pad is pressed (padIdx 0-15, velocity 0-127)
Used in Pads and LEDs, Play a sample, MIDI out.
onPadRelease
Section titled “onPadRelease”virtual void onPadRelease(PadManager &padManager, uint8_t padIdx) = 0Called when a pad is released (padIdx 0-15)
Used in Pads and LEDs, Play a sample, MIDI out.
onPadPressure
Section titled “onPadPressure”virtual void onPadPressure(PadManager &padManager, uint8_t padIdx, uint8_t pressure) = 0Called when pad pressure changes — aftertouch (padIdx 0-15, pressure 0-127)
Used in Pads and LEDs, MIDI out.
onPadPan
Section titled “onPadPan”virtual void onPadPan(PadManager &padManager, uint8_t padIdx, int8_t pan)Called when the press moves across the pad — left/right balance of the two cells under it, 0 centred. Streams while the pad is held, on change only. Optional: a handler that plays notes has no use for it.
Used in MIDI out.
Declared in crosspad/pad/IPadLogicHandler.hpp:15.