Standalone MIDI Sequencing Drumming Glove (WIP)

Standalone MIDI Sequencing Drumming Glove (WIP)


Hi everyone, I'm relatively new to the Maker community in general, and I've spent the past few months learning the basics of Arduino IDE, Teensy's various libraries, the core concepts of integrated circuit design, and working through the Notes & Volts - Teensy Synth tutorial series (Parts 1-9). That said, I figured it couldn't hurt to share my conundrum here. We're all busy, so I don't expect to be spoon-fed answers, but if anyone has advice they're willing to offer, I'd listen intently and try it out.... Long story short, my goal is to craft a standalone/DAW-less drum sequencer on which I can record/capture MIDI data by live finger-tapping. To paint a picture of this desired device's usage, I'd like for the experience to go something like this:

---I'm going about my day job duties, and suddenly I get a "kick, snare, ka-kick kick, snare" pattern in my head, and begin tapping my 4 fingers on the steering wheel - keeping track of each new measure in counts of 4, 8, or 16. (The human hand just so happens to be perfect for this!) Once recorded to the Teensy's microSD card, I'd really like to be able to pull the MIDI pattern up within my DAW when I get home. This way I can substitute the MIDI data that's been written to the microSD card with higher fidelity sounds and/or audition sounds of various lengths (i.e. staccato vs. marcato), as this tends to effect the pattern's overall groove or "feel". I'd also like the PPQ resolution to be as high as feasibly possible.---

In terms of design thinking, here's my User Statement:

As a musical creative who has their hands full during the day,​
I need to quickly and accurately record percussive sequences without disengaging from unrelated tasks​
In order to build upon my ideas once I return to my full music studio in the evenings.​

Parts in my inventory:
- Teensy 4.1 microcontroller​
- Teensy Audio Shield​
- (4) 2.2" Flex Sensors​
- Breadboards​
- Jumper Wire​
- Tricolor LEDs, Common Anode​
- Various resistors​
- Opto couplers​
- 5-pin DIN midi sockets​
- Gloves​
Parts still to be purchased:
- audio amplifier/speaker unit of some sort​
- compatible battery​
- Display (either TFT or OLED)​

So here is my current Development Plan (Partitioned By Function):
1) SEQUENCING
A) Time Keeping​
B) Record/Play/Pause user interface​
2) INPUT
A) implement 4 velocity-sensitive sensors (i.e Piezo, Flex Sensors, or FSR).​
3) OUTPUT
A) MIDI​
- Preferably via Micro SD card. The input should be stored from 4 sensors attached to the fingertips. I've read up on the "wav2sketch" functionality of Teensy, which is awesome, but not MIDI-related. Maybe SDFat.h is the way to go with this?​
B) Audio​
- User needs to be able to hear what they are recording. Maybe "Needs" is a strong word here, but it will make using such a device much more intuitive.​
4) DISPLAY
5) BATTERY POWER (Using USB power in the meantime)

Sources of inspiration I am drawing from:
A) Touch Board by Team Bare Conductive
- Although this project doesn't utilize the Teensy, it satisfies 3 functions I'm looking to incorporate, namely:​
1) Standalone​
2) Interprets MIDI input by touch​
3) Battery powered​

B) HomeMadeGarbage's "DIY Sampler Using Teensy Audio Board"
- Which has 1 function I'm looking to incorporate:​
1) Stores input data to microSD card​
- And 1 function that sort of meets my goals:​
1) Record *sound* source to memory via wav2sketch. I'd like to record *MIDI* to memory, while outputting real-time *sound* that is loaded
on the Teensy.​
- Paul & Alysia have an amazing tutorial video on this article that I'm still in the process of working through as well​

C) Drumming MIDI Glove Using Arduino and Light Sensors by MidiGlove8
- This project was my initial blueprint, but I quickly realized that it lacks the bulk of the work necessary, namely standalone time keeping and recording.​

D) "Aftertouch MIDI Glove" by Tomash Ghz
- Which lacks recording capability​
- I followed the wiring diagram in their article and is the furthest I've gotten to my goal to date.​

E) Portable Sampling Synth by Prajwal Mahesh
- Which goes in depth on hardware, 3D printing, and user interface, but, while lacking the glove form-factor and fingertip inputs, the sampler and radio are probably more than I need.​
- PJRC has this listed in Teensy's example projects, and I'm still in awe after reading through Prajwal's blog posts (Parts 1-4) regarding the matter.​

F) "Creating an ergonomic glove instrument for portable beat-making and MIDI interaction" by Francisco Rosado Correia (Full PDF is in link's margins)
- Which has everything I'm looking to accomplish, except for standalone and recording/writing MIDI data to the microSD card capabilities.​
- Also a lengthier read, which is only appropriate for this this sort of project.​

...I've also read up on Imogen Heap's Mi.Mu gloves, Flora MIDI Drum Gloves, and various hacks of the Nintendo Power Gloves, but none seem to be obvious choices as a blueprint for the functions I'm going to include.

Thanks sincerely for taking the time to read this if you're still here. If you have any advice on the best route forward, my open ears are eternally grateful. I'll keep chipping away regardless. It's been intensely inspirational to see what has been done with this device. People are awesome:cool:

PXL_20230821_110717498.jpg
View attachment afterTouch_glove_buttons_MIDI_v3.ino
gloveshematic.jpg
 
Last edited:
Sounds like a fun project, and you seem to be well organized so I am sure you will reach the goal. Just a few comments from me as a fellow "sequencer enthusiast":

1A - time keeping: I always use an IntervalTimer at 192PPQ, this has served me well in several projects.

2A - storing midi data: if you want to store data on the SD, the sd.h lib will make it easy for you. However if your goal is also to import said data into your DAW you should probably consider storing in standard midi file format. I have this on my to do list but so far I just store raw "midi event arrays". The standard format is a bit annoying but it is not rocket science. See f.ex: http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html

Feel free to also look at some of my sequencer code for inspiration: https://github.com/canvasus/CreatorMaster2k

Cheers, Daniel
 
Sounds like a fun project, and you seem to be well organized so I am sure you will reach the goal. Just a few comments from me as a fellow "sequencer enthusiast":

1A - time keeping: I always use an IntervalTimer at 192PPQ, this has served me well in several projects.

2A - storing midi data: if you want to store data on the SD, the sd.h lib will make it easy for you. However if your goal is also to import said data into your DAW you should probably consider storing in standard midi file format. I have this on my to do list but so far I just store raw "midi event arrays". The standard format is a bit annoying but it is not rocket science. See f.ex: http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html

Feel free to also look at some of my sequencer code for inspiration: https://github.com/canvasus/CreatorMaster2k

Cheers, Daniel

Daniel,

Thank you kindly for your thoughtful reply! Just a bit of thinking out loud here...

*Regarding 1A - Time Keeping:
- I just read up on the IntervalTimer, and am still digesting the significance of "Volatile" variables and "Interrupts" as they relate to Arduino IDE code and corresponding hardware processes.​
- After searching around for more sequencer projects, it seems like 192PPQ is pretty common, so I'll shoot for that!​
*Regarding 2A - Storing MIDI Data:
- Got you, I started reading through the link you sent me. What does "f.ex" stand for?​
- I'm still at the "Header Chunks" section of the mcgill link, but I'll continue updating the development plan as I stumble onto more relevant considerations​

With the help of the reference documents you've offered, here's my updated development plan #1-#2 (Partitioned By Function):

1) SEQUENCING (Mainly consists of the 3 types of MIDI "System Messages")
A) Time Keeping​
- Considering the syntax for Header Chunks (MThd) in standard MIDI: "<Header Chunk> = <chunk type><length><format><ntrks><DIVISION>", I want to use the Metrical Time" Format (bit 15 = 0) and specify a "PPQ/TPQN" value of 192 (bits 14 through 0 = 192) within the <division> keyword.​
B) Transport Control​
- Will include at least a Record, Play, and Pause function that's physically accessible on the user interface. Code TBD​
C) SysEx​
- Whether or not this will come into play is still TBD​
2) INPUT
A) Storing MIDI data​
- Store standard format midi data on microSD card for later access on home PC​
- Considering the syntax for Header Chunks (MThd) in standard MIDI: "<Header Chunk> = <chunk type><length><FORMAT><ntrks><division>", I think I want to be using format 1 of 3, a single multi-channel track, within the <format> keyword, since I only need to utilize 3 of 16 channels for Kick, Hi-Hat, and Snare respectively.​
B) Implement 4 velocity-sensitive sensors, i.e Piezo, Flex, or FSR sensors TBD (Consists of MIDI "Channel Messages")​

Thanks for sharing your project! It will be a valuable reference moving forward. Particularly the "PUNCH / RECORD / START / STOP" transport controls (SysEx?) displayed on your GUI are elements I'll soon be implementing in my 1) SEQUENCING section. Forgive me for pulling a reference image from your project on GitHub, but if you don't mind me asking, what do the "LEFT LOCATOR / RIGHT LOCATOR" functions do? Are each of the 3 digits various step increments represented by MIDI chunk data?
 

Attachments

  • Inspiration_MrCanvasMIDISequencerGUI.jpg
    Inspiration_MrCanvasMIDISequencerGUI.jpg
    170 KB · Views: 33
The locators are used to set start/stop for looping a pattern and the unit shown is bars/beats/16ths.

In general this UI is a vague copy of the original sequencer software from the 90's so you are probably better off making your own concept.
 
Update On "Standalone MIDI Sequencing Drumming Glove WIP"

The locators are used to set start/stop for looping a pattern and the unit shown is bars/beats/16ths.

In general this UI is a vague copy of the original sequencer software from the 90's so you are probably better off making your own concept.

Thanks Daniel! Copy that regarding the function of your locators. I had a look at your project's video demonstrations, and that is awesome!

SequencingGloveCompressed.gif

I've made some headway on the INPUT portion of this project, and thought I'd share (CHEESY DEMO LINK):

1) INPUT:
Complete - 4 velocity-sensitive FSRs serving as input sensors via Teensy's analog pins

2) OUTPUT:
Complete - Produce MIDI output via USB, triggered via FSR sensors
Complete - Simultaneously produce audio output via the Rev D shield aux. jack, triggered via FSR sensors

...Current code can be found HERE. I've also restructured the project's roadmap as I work on establishing the working "sequencer" component:

3) SEQUENCING / PATTERN-RECORDING:
Not complete - Get Teensy to keep time by itself, likely involving the "IntervalTimer at 192PPQ" as per Daniel's suggestion.
Not complete - Transport control consisting of at least a Record, Play, and Pause function, physically accessible on the user interface. Needs to happen in tandem with most of the features here in "3)".
Not complete - Create additional controls for toggling through existing patterns, creating a new pattern, and hopefully adjusting pattern length.
Not complete - Toggle quantize on/off. This is optional, as unquantized recording is more important overall.
Not complete - Enable variable tempo. Ideally a tap-tempo user input. (possibly GUI dependent)
Not complete - Enable variable time signature (possibly GUI dependent)
Not complete - Have Teensy act as USB Host device, as opposed to Client device, or integrate other hardware that can do this in Teensy's place.

4) FILE STORAGE:
Not complete - Make use of Standard MIDI format (as per Daniel's suggestion) for maximum device compatibility.
Not complete - Store user-sequenced material, either directly- or eventually-, to microSD card. Alternatively integrate some other form of storage. The overall concept here remains to be the recording of MIDI ideas with no computer in sight, and to later open these pre-cooked MIDI(.mid/.midi) files on an actual computer for further editing / auditioning of various sound samples.

5) GUI DISPLAY (optional / highly probable):
Not complete - Create some visual representation of what the Teensy is playing/sequencing/saving. Available options seem to be an LCD, OLED, or TFT display. Unsure if a touchscreen would be more or less work. Whatever results in the most intuitive/useable device is worth it.

6) Power Supply:
Not complete - Integrate a lightweight and reliable power supply to replace the USB power source currently being used.

7) FORM FACTOR:
Not complete - I may be setting myself up to eat my words, so to speak, but I think reshaping the prototype into the envisioned glove-shape will be one of the easiest parts, so this will likely be one of the last things I do.

Thanks again Daniel for sharing your sequencer project, and to Adrian for the FSR-sensor example code - https://forum.pjrc.com/threads/31797-Teensy-FSR-based-MIDI-controller - which have both been great guidance so far. I'm just learning to code with this project, but the Teensy and its surrounding community have been an excellent learning resources!

Best,
Colby
 
I've been busy with school and work, but just wanted to share an update since that last hazy post which was pitifully non-specific. Although I redid the enclosure in Fusion 360:

SF4lw9Q.png

...it's still pretty large compared to the "glove" design I'm shooting for (Something more like this). To that end, I've started to build out the lipo/usb charging and SGTL5000 circuits in KiCad. I'm anticipating at least a few "gotchas" since this will be a mixed-signal board, and the second board I'll make. I'm hoping to fail quickly, and as many times as need be, in order to get this light bulb screwed in for good. Once I've decided on a 2- or 4-layer board and have those two circuits designed correctly, I plan to add the on-board speaker circuit as well. With that I'm hoping to meet the volume and quality of the audio in this demo:


So I'm wondering - does anyone have experience designing boards that incorporate all ~3 of these circuits? Namely:

1) Battery power/charging
2) Sensors via analog pins
3) SGTL5000 + 2.5W Class-D mono audio amplifier + 1 Watt, 8 ohm speaker

If so, I'd be grateful to hear from you! Here is what I've got so far on the eeschema side:

nkUmihT.png


I have a feeling this is oddly esoteric and I'm on my own as far as combining goes. Just putting the feelers out here!

It'll likely be 2-3 weeks before I've finished my first attempt with this board, at which point I'll probably post another update with what I've learned.
 
Last edited:
Back
Top