กลับไปหน้ารวมไฟล์
midi-looper-and-sequencer-with-capacitive-touch-and-encoders-7094c2-en.md

Hi all.

I built a hardware sequencer to do stuff my existing Elektron, Polyend, and other hardware pattern sequencers cannot do. Its the little things, and when Dawless, that can make all the difference - at least to me.

My favourite features of this are:

  • Composer Mode: Awesome for live music. Control multiple synths using your fingers on a keyboard (not a keyboard split). For instance, pinky on left hand can transpose bassline, all 3 fingers on left hand String/pad chords, middle finger left hand Lead 1, and right hand Lead 2, and all notes something else.
  • Chord Follower Mode: Put in a complex melody, and have it change (transpose) notes based on your finger position (not just shifting all up and down). With the ability to press just one or two fingers to change only those notes.
  • Recording using a pedal that starts only when note pressed: Just awesome. Hold the pedal, and (only) when you play a note does it start recording, and it stops recording when you release the pedal - automatically finding the correct loop point, and immediately starts looping on the beat - not halfway in. I really don't understand why this is not a common feature...
  • LPF and HPF on notes: Again, don't know why this is not common. So handy when playing live, to mute part of the sequence and bring in and out. Also is a great way to find the core of the melody and remove notes not doing anything.
  • Pitch Inversion: Kind of a cheat, but you set a reflection plane (note) and then turn the knob, reflecting (well - shifting) the notes with respect to this plane. A way to find new notes without messing with the rhythm of the melody.

Anyway - the code is on Github: https://github.com/CaratacusPotts/Matrix-Sequencer

I specifically made this for Arduino to be easy (I am not a programmer - as you will notice looking at the code..), and in KiCad and EasyEDA for ease of copying.

If you know how to solder SMD, you can do this at home and order the components and boards from your favourite PCB manufacturer (Pcbway etc) and Mouser/Digikey etc.

Hopefully if people like this, we/you can evolve the code and make it better, a little less-buggy and with more features than I have the time to do (I really don't have the time to be working on this much, as I am involved in other things that take my time).

Feel free to contact me directly if you are building it and need to figure something out, as a quick chat could save hours of de-bugging etc.

Hopefully this could turn into a product if you are suitably motivated, and keep the BOM and labour costs down (I might invest!).

Technical Deep-Dive

"Matrix-Loop" is a sophisticated exploration into Embedded Music Theory and High-Density HMI Design. Unlike standard pattern sequencers, it offers an intuitive, dawless interface powered by the ItsyBitsy M0 Express.

  • Capacitive Matrix & I2C Handshake Forensics:
    • The Azoteq QS550 Link: The system utilizes two QS550 multitouch controllers. Instead of traditional switches, the inner PCB layers form a capacitive grid, as shown in the project images. The M0 core polls these controllers over I2C, retrieving touch coordinates and intensity, which are then mapped to MIDI Note Numbers and Velocities.
    • I/O Expansion Diagnostics: To drive the 99-LED visual matrix and scan 15 encoders, the architecture employs a pair of PCAL6524 24-pin expanders. This forensics allows the M0's limited GPIO to scale to a massive mechatronic surface without sacrificing CPU bandwidth.
  • MIDI Protocol & Canon Logic Harmonics:
    • The Pitch Inversion Plane: One of the project's standout forensics is the "Canon" mode. By defining a "Reflection Note" (plane) in the firmware, users can turn an encoder to mathematically mirror the active melody's pitch. For example, a rising major scale is inverted into a falling minor scale in real-time, preserving the rhythmic structure while altering the harmonic profile.
    • Note Filtering (LPF/HPF for MIDI): Unlike analog audio filters, this system implements Logical Sequence Filtering. It selectively mutes specific MIDI indices based on their frequency range or velocity threshold, allowing performers to "carve out" space in a busy mix using tactile encoder nodes.
  • M0 Architecture & Loop Persistence:
    • High-Speed NVIC Management: The ATSAMD21 core utilizes Nested Vectored Interrupt Controllers (NVIC) to process encoder rotations and foot-pedal triggers. The "Auto-Loop" feature utilizes these interrupts to calculate loop length on the fly, locking transitions to the nearest beat with sub-millisecond precision.
    • Non-Volatile Persistence: Sequences are stored in a 512k I2C EEPROM, ensuring that 256-event polyphonic patterns remain accessible across power cycles without requiring external SD card storage.

Engineering & Implementation

  • SMD Assembly & Signal Integrity:
    • Thermal Profiling: The high-density PCB (featuring 99 LEDs and CAT4016 drivers) requires precise SMD reflow. Bypassing resistors are strategically placed to prevent "Ghosting" in the LED matrix during high-speed scanning.
    • VBUS Conditioning: An AP7215-33 LDO regulates the 5V USB-C supply to a clean 3.3V, isolating the logic nodes from the capacitive noise generated by external laptop power supplies.
  • HMI Control Loops:
    • Conductor Mode: Leverages the capacitive keyboard to transpose entire sequences across multiple MIDI channels simultaneously, utilizing finger position as a dynamic transposition offset.
    • Recording Pedals: A dedicated analog-pedal input uses a "Triggered Capture" algorithm, where recording only commences on the first detected MIDI note, automating the loop-truncation process.

Project Specifications

Operates in: Loop Mode, Song Mode, Conductor Mode Can be inserted inline to existing synth 3U Rack compatible

Note: The rows of partially lit LED's represent the black notes on a piano roll. And they also show the start and end points on the loop. The touch comes from the capacitance matrix built into the inner PCB layers, and using a touch IC to read out.

Basic Functions (left row):

  • Start/Stop: Play using internal clock or external MIDI clock
  • BPM change using encoder
  • Loop Start and End points via encoder
  • Record:
    • Overtop: using Encoder button
    • On-Play: holding foot pedal, recording starts when first note played. Recording stops with foot off pedal. Automatically cuts loop to nearest beat, so loops nice.
  • Clear notes (via encoder button)
  • Mode select: Loop Mode, Song Mode, Conductor Mode and Chord Follower

Canon and Note Functions (right rows):

  • Transpose (to scale, on/off beat, via encoder or key input)
  • Phase (by multiples of loop, by amount in steps)
  • Frequency (compress note sequence in time, in fractions of current loop length)
  • Mirror Notes Pitch (with a user defined mirror plane, reflect notes in pitch axis)
  • Mirror Notes Loop (with a user defined mirror plane, reflect notes in time)
  • Note Cutoff Filter (mute notes like a LPF or HPF)
  • Note Velocity (use finger to draw note velocity or encoder)
  • Note Duration (use encoder to increase or decrease all note lengths)

Additional Features:

  • 256 events (not bound by bars or specific steps)
  • Polyphonic
  • Intuitive (basic) scales when transposing. Just choose the notes you what it to transpose to - without having to know archaic names, such as Lydian, Mixolydian, Aeolian...

Conclusion

Matrix-Loop demonstrates the transition from Simple Note Playback to Algorithmic Music Performance. By mastering I2C Expansion Forensics and Capacitive Gesture Analysis, this project engineers a professional-grade sequencer that challenges industry-leading hardware through deep architectural optimization and innovative human-computer interface design.

Please see github for more info. I also made other variations, that are on the git, such as a basic in-line midi-looper.

All the best, Chris Malloy


Harmonic Logic: Mastering MIDI sequencing through capacitive forensics.

Matrix-Loop Sequencer Front View

Matrix-Loop Sequencer PCB View

Matrix-Loop Sequencer Side View

Matrix-Loop Sequencer Rack View

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE"
author: "caratacuspotts"
category: "Audio & Sound"
components:
  - "1x Adafruit ItsyBitsy M0 Express (ATSAMD21 Core)"
  - "2x Azoteq QS550 I2C Multi-Touch Modules (Capacitive Plane)"
  - "15x Bourns PEC11S Incremental Encoders (Parameter Nodes)"
  - "2x PCAL6524 I/O Expanders (24-bit GPIO Extension)"
  - "1x M24512-DFDW 512k I2C EEPROM (Non-Volatile Sequence Storage)"
  - "99x APTR3216 SMD LEDs (Visual Display Matrix)"
  - "2x CAT4016 HV6G LED Latch Drivers (High-Density Current Sink)"
  - "1x USB-C Terminal (MIDI Bridge & Power)"
description: "Intuitive interface for live jaming, with interesting features like composer mode and low-pass and high-pass note filters, Canon functions and lots of other goodies on top of loop and song modes.  Connects via USB-C and 3.5mm MIDI jack"
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles:
  - "https://github.com/CaratacusPotts/Matrix-Sequencer/tree/main/MatrixV2"
encryptedPayload: "U2FsdGVkX19mREIdTXDBntlxfOEUY6ajaTe1PG0u8AtkBaav3NK/3ysKy6fNxnzq3jJvt2Qf3CT/QOi+XUhi12spI+R6nNQgiLlAjulFIWo="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/midi-looper-and-sequencer-with-capacitive-touch-and-encoders-7094c2_cover.jpg"
lang: "en"
likes: 1
passwordHash: "d68766366272de1c239daf34f62ee38cec22b4dce1666fd90c88501910e7b767"
price: 2450
seoDescription: "Build a MIDI Looper and Sequencer with capacitive touch and encoders. Features composer mode, filters, and USB-C/3.5mm MIDI jack for live jamming."
tags:
  - "midi-sequencer"
  - "capacitive-touch"
  - "m0-architecture"
  - "polyphonic-looping"
  - "composer-mode"
  - "i2c-io-expansion"
title: "MIDI Looper and Sequencer with capacitive touch and encoders"
tools:
  - "SMD Rework Station"
  - "Precision Tweezers"
  - "3D Printer (Enclosure Fabrication)"
videoLinks:
  - "https://www.youtube.com/watch?v=TjFpd8f3n0o"
views: 1348