A Work-In-Progress Raspberry Pi-based MIDI Sequencer & Controller! - Page 1
Forum section: electronics / projects

author: Niisse
author_rank: Newbie
timestamp: July 28, 2021, 02:18:31 pm
content: Hi all,I've been lurking on these forums for a while, but I've decided to make an account to share with you my first real electronics project. As the title says, I'm working on a Raspberry Pi based MIDI sequencer / controller. I am planning for the end result to be completely portable and stand-alone (in a 3D-printed case) with built in battery and audio, but it will also be able to hook it up to any MIDI device, either real hardware or software.The core of this project is a sequencer written in Python. It uses the Pi's GPIO to interface with my hardware - at the moment a bunch of 7-segment displays for showing BPM and the current Pattern no, as well as an array of LEDs for indicating the sequencer's current step - all controlled by a bank of shift registers. I've already implemented all the basic stuff like playing / pausing, turning steps on or off, and more.Inspired by the countless makers I've been watching on YouTube for the past 10 years or so, I've decided I wanna try and document my project's progress. I figured this would be an easy way for people to understand what's going on, and potentially give feedback, suggestions and / or criticism.

author: Renate
author_rank: Super Contributor
timestamp: July 29, 2021, 11:00:12 am
content: Will you be using serial or USB MIDI?A Pi 2, 3 can't be a USB gadget, a Pi Zero or Pi 4 can be.What's the design? Will you use a little USB MIDI keyboard for input?A Pi Zero with the keyboard into the host port and the peripheral port connected to something as a USB keyboard will work.Edit: Pi 4 can be a peripheral over the Type C connector.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 29, 2021, 06:44:47 pm
content: Quote from: Renate on July 29, 2021, 11:00:12 amHow do you configure this software-wise?

author: Renate
author_rank: Super Contributor
timestamp: July 29, 2021, 06:56:44 pm
content: Quote from: SiliconWizard on July 29, 2021, 06:44:47 pmI'm not sure on the RPi 4, but it's something along these lines:Code:/boot/cmdline.txtmodules-load=dwc2,g_hid/boot/config.txt# Enable USB gadgetdtoverlay=dwc2(Replace g_hid with g_midi or something.)

author: Niisse
author_rank: Newbie
timestamp: July 30, 2021, 09:48:29 am
content: Quote from: Renate on July 29, 2021, 11:00:12 amI'm developing it using a Pi 4. There are a couple of options. When it's in stand-alone / portable mode, there is no need for MIDI out as it will all be internal. For hooking it up to other MIDI devices, I'll probably integrate a USB MIDI interface for serial in/out; and I'll expose a USB port for connecting USB-MIDI devices. I'll integrate a MIDI device select function in the device; hooking up multiple MIDI-capable devices will be possible (as will MIDI channel selecting).Quote from: Renate on July 29, 2021, 11:00:12 amI am designing my own input systems. There will be sequencer-like inputs which I am working on right now, and later on I will build a small one or two-octave keyboard-like keys module. I will also build a drumpad module. I will experiment with allowing you to hook up external MIDI devices to this which could be passed on through.

author: Ground_Loop
author_rank: Frequent Contributor
timestamp: August 04, 2021, 01:10:25 am
content: Sequencers are cool. My interest in digital music control started in the 70s with Tangerine Dream. My first sequencer was a 8-step TTL based device tied to a TRS-80 Model 1 computer. Below is my latest which uses a Teensy 3.5 for control. It doesn't do stored patterns, but operates like old school analog sequencers. My daughter did the art work (a nod to 'Look Mum No Computer'). Embedded in the panel is a PAIA MIDI-CV module that interfaces a keyboard and provides triggering.I think having the PI will make yours really versatile. Be sure to post your progress and some audio when you have it. If I may offer a development tip. Instead of using a shift register for each of the digits you can use a single Maxim 7219 to drive up to eight digits with the same serial stream you are using. It will integrate with the LED shift registers as well. Nice looking project.

author: Renate
author_rank: Super Contributor
timestamp: August 04, 2021, 11:29:16 am
content: Quote from: Ground_Loop on August 04, 2021, 01:10:25 amHmm, I learned something here.That chip has a "Code B" ROM in it to map 4 bits to 0-9, -, E, H, L, P.Fortunately, there is a bypass for that.Why you'd want to use the ROM anyway is a bit obscure to me since you have to send 16 bits in any case.By using the ROM you lose the ability to make chasing segments in a circle or deciding for yourself if 6 & 9 have "tails".

author: Niisse
author_rank: Newbie
timestamp: August 04, 2021, 08:01:41 pm
content: Quote from: Ground_Loop on August 04, 2021, 01:10:25 amThat's super cool! I can only imagine what it must have been like experiencing the very start of music synthesis. I love your Teensy-based sequencer, it looks amazing. Have any videos of it in action?Quote from: Ground_Loop on August 04, 2021, 01:10:25 amI will most definitely look into that, especially if, as Renate says, the ROM is bypassable for manual control. It would indeed make my life (and wiring) easier. Once I build the actual thing (as this is after all intended to merely become a fully functional prototype) , I will look into it.I'll for sure continue reporting my progress. I've been working on it a lot and despite the fact that there's much to be done, it's nearly at the stage where it can start playing music. I'd hoped to put out a new video this week, but it will be a while longer. Thank you for your kind words

author: Ground_Loop
author_rank: Frequent Contributor
timestamp: August 04, 2021, 11:22:05 pm
content: Quote from: Niisse on August 04, 2021, 08:01:41 pmHere ya go. Just uploaded, it's a couple years old now. Video is also highlighting a programmable VCF on the proto board.

author: MarkF
author_rank: Super Contributor
timestamp: August 05, 2021, 02:00:39 am
content: I wrote a MIDI Sequencer for my Roland piano some years ago.It's written using DirectMusic and a MIDI to USB interface.(I would highly recommend USB if you don't want to drop notes.)Basically, it reads the piano keys and echos them to four MIDI channels.Each output channel can be assigned a different instrument and use either the entire keyboard orhave the keyboard split. For a split keyboard, only the highlighted keys on that channel will play.The split keyboard can also be moved up or down in octave.The key velocity can be over-ridden so the key will play as a piano or an organ.Instrument and channel selection dialog boxes:

author: Renate
author_rank: Super Contributor
timestamp: August 05, 2021, 10:10:30 am
content: Quote from: MarkF on August 05, 2021, 02:00:39 amPretty nice, but I still hate knobs on GUIs.

author: MarkF
author_rank: Super Contributor
timestamp: August 05, 2021, 10:53:58 am
content: Quote from: Renate on August 05, 2021, 10:10:30 amMe too. They have always been an operational sore spot.Trying to rotate the mouse in a circle to set the value is always awkward.My current programming is that you do NOT turn the knob.You pull in any direction from the center.The value is the linear distance from the knob center.

author: Renate
author_rank: Super Contributor
timestamp: August 05, 2021, 11:52:08 am
content: Mouse scroll wheels on controls is handy, but it only really works for stepwise things.Years ago I worked with a company that used CATIA CAD and they had accessory knob boxes with 8? knobs on their workstations.This is a control I wrote which steals its essence from hardware scopes and uses either mouse click or scroll to select.

author: Niisse
author_rank: Newbie
timestamp: August 06, 2021, 10:13:50 am
content: Quote from: Renate on August 05, 2021, 11:52:08 amLove the UI design on this!Quote from: MarkF on August 05, 2021, 02:00:39 amThis looks really cool, too. I agree on the 'controlling knobs with a mouse'-thing, though, it's usually not a great user experience.Makes me wonder what it will be like to implement physical knobs for my project - obviously it'll need some LED indicators of sorts