Can you use GPIO pins instead of MIDI?

TooManyToyz posted Jan 7 '23, 17:59:

Excuse the newbie question. I would like to build a box that plays sound effects rather than music. I need to trigger these effects with momentary pushbuttons. I could connect the buttons to an arduino which would send midi messages to the samplebox, but this seems wasteful since the raspberry pi board already has GPIO pins. Furthermore, some of the effects are single shot (gong, slide whistle), while others are looped (train whistle, drum roll). have looked at he code, but I don't know python well enough to figure out where to put the modifications. Any help would be appreciated.

HansEhv posted Jan 16 '23, 00:16:

Hi TooManyToyz,
Triggering sounds via direct GPIO might causes nasty side-effects (timing, clicks&plops etc).
So having an arduino translating buttons to midi signals is not wasteful.
Single shots and loops are implemented in the samplerbox fork at

samplerrrr posted Feb 14 '23, 14:58:

What about using GPIO just for potentiometers (volume etc).

What pins would we use, and what file do we edit?

David Dawkins posted Nov 29 '23, 16:35:

I modified samplerbox to only use GPIO, as a footpedal while playing guitar. This works fine on a Pi 3. Worth noting that I disabled the MIDI scan loop

Jan posted Jun 24, 09:55:

Are you mind sharing your modifications? Otherwise i need to implement them myself..


  (not published)
  I want to post as guest