If you are using C++, then check the on-board examples in the Audio section. Especially Audio/sample-loader
, Audio/sample-piezo-trigger
. For basic button interaction, check out Digital/digital-input
. There is no exact reimplementation of EasyButton
, but there's BelaDebounce
for debouncing. I don't think we have a dedicated example, but it's documented here and it goes more or less:
// global
BelaDebounce button;
// in setup()
button.setup({
.context = context,
.channel = 0,
.debounceMs = 3,
});
// in render(), outside any loops
bool debounced = button.process(context);
Tangential to your question, you can also consider using PureData for higher-level interaction: https://learn.bela.io/tutorials/pure-data/fundamentals/course-introduction/