Raspberry Pi drum machine/ sequencer controlled by GPIO/ Python

Discussion of all things Raspberry Pi / Raspberry Pi 2 related

Moderators: MattKingUSA, khz

Post Reply
BPMbee
Established Member
Posts: 3
Joined: Thu Jan 12, 2023 7:06 pm

Raspberry Pi drum machine/ sequencer controlled by GPIO/ Python

Post by BPMbee »

I am looking to create a simple drum machine from a Raspberry that can be controlled via GPIO or Python. What I'd like to do is create 16 buttons that would note on or off in a sequence (e.g. the bassdrum). Users cannot 'play' the drum machine really, they can only create patterns. They will also be able to switch to a different channel to control the snare/ hihat etc.

I've been trying to find an existing sampler/ drum machine that I can control using Python, all Python would do is store the patterns for each channel and send it on to the existing sampler/ drum machine. Python could then change the patterns based on its GPIO inputs. Having Python know the patterns would also allow me to turn on and off LED's above each button and change those when they select a different channel.

Can anyone recommend an application? I looked into several and most support OSC but as far as I can tell I wouldn't be able to do this using OSC? Having a websocket or API connection would be preferred I think.

I've searched this forum in hopes of finding something similar but most are projects to have samples be triggered using MIDI and I want to avoid having to program my own sequencer. I'm 'okay' with Python but not a real programmer, using API's and so on is something I can do though..

Any and all suggestions highly appreciated!

User avatar
MattKingUSA
Moderation Services Senior Administrator
Posts: 795
Joined: Fri Mar 21, 2008 4:01 pm
Location: United States
Has thanked: 52 times
Been thanked: 38 times
Contact:

Re: Raspberry Pi drum machine/ sequencer controlled by GPIO/ Python

Post by MattKingUSA »

A faster way would be making your samples and exporting as ogg or mp3 and using a USB 10 key pad with shortcut keys in your media player. You could just have a keypad with a pi under it. But that's just my thoughts on it. ☺️

-Matt :D

BPMbee
Established Member
Posts: 3
Joined: Thu Jan 12, 2023 7:06 pm

Re: Raspberry Pi drum machine/ sequencer controlled by GPIO/ Python

Post by BPMbee »

Well, the end goal is to create 8 or 16 buttons that people can turn on and off. It's meant to be placed at a festival and my son already offered to program something himself but I know he's very busy so I'd rather not bother him with this..

If there's a drum program out there where I can set notes to on or off using MIDI that would work as well.. Creating pre-made loops is not an option..

User avatar
MattKingUSA
Moderation Services Senior Administrator
Posts: 795
Joined: Fri Mar 21, 2008 4:01 pm
Location: United States
Has thanked: 52 times
Been thanked: 38 times
Contact:

Re: Raspberry Pi drum machine/ sequencer controlled by GPIO/ Python

Post by MattKingUSA »

I really like lmms and it pairs well with USB midi controllers. I'm sure it would save some time to go lmms with a midi pad. There are many midi pads out there you can use for this purpose I believe there are even pad hats for the pi.

-Matt :D

User avatar
MattKingUSA
Moderation Services Senior Administrator
Posts: 795
Joined: Fri Mar 21, 2008 4:01 pm
Location: United States
Has thanked: 52 times
Been thanked: 38 times
Contact:

Re: Raspberry Pi drum machine/ sequencer controlled by GPIO/ Python

Post by MattKingUSA »

In the past I have used lmms with usb midi drum pads and controllers as well as keyboards on the pi 2. It was a bit slow for some voices but the new pi4 works well with lmms. I have the 4gb pi and it does just fine with audio editing.

-Matt :D

BPMbee
Established Member
Posts: 3
Joined: Thu Jan 12, 2023 7:06 pm

Re: Raspberry Pi drum machine/ sequencer controlled by GPIO/ Python

Post by BPMbee »

I guess using pads would mean people would have to stil ‘play it live’ where I would like to see if they can simply turn notes on and off in a pattern so they can create their own beats like you would with an 808 for example. I’ve been told Pure Data might be the way to go so I’ll be looking into that as well.

dirkk0
Established Member
Posts: 5
Joined: Mon Feb 07, 2022 8:17 pm
Been thanked: 1 time

Re: Raspberry Pi drum machine/ sequencer controlled by GPIO/ Python

Post by dirkk0 »

If your budget allows this:
I would pick up a used Novation Launchpad Mini which gives you the 8x8 matrix right away including colored lights.
Then you can program this with RTmidi in Python, NodeJS or in C.
This could then drive Fluidynth drums.

Post Reply