Nodes/ꘇ Genereti/ꘇ mod.drumsequence
ComfyUI Node

ꘇ mod.drumsequence

Drum patterns you type as 0s and 1s

By languel·Created about a month ago·Updated 3 days ago· 1
ꘇ mod.drumsequence
  • clock
  • notes
  • image
◄patternkick:1000100010001000;snare:0000100000001000;hat:1010101010101010►
◄division4►
◄velocity0.65►
◄ratchet1►

ꘇ mod.drumsequence is a three-track step sequencer for the Genereti browser audio rig. You get rows for kick, snare and hi-hat, each one a string of 1s and 0s, and a clock input that decides how fast they go past. It is the fastest way to get a beat under a mod.synth patch without loading a single drum sample.

What it is

Genereti's mod.* family is a live Web Audio patching layer that runs inside the ComfyUI browser tab, connected by GENERETI_AUDIO_BUS cables and named in TouchDesigner's vocabulary. This node is the drum-pattern half of its sequencing pair: mod.sequence does pitches, mod.drumsequence does rhythm. Feed its output into mod.drumkit and you have a bar of drums.

The reason it exists separately is that drum notation and melody notation aren't the same shape. A drum grid is a binary matrix - step 1 or not - and cramming that into a note-number string would be miserable. So the author gave it rows.

How it works

Each hit in a row is turned into a MIDI note number the drum kit already understands: kick is note 36, snare is 38, hat is 42. The drums are synthesised, so those numbers are triggers rather than samples - the kit builds a kick from a pitch-swept sine and the snare and hat from filtered noise.

Timing comes from the clock input, which you take off mod.transport. Note events are scheduled against the AudioContext timeline with up to 120 ms of lookahead on a 25 ms timer, rather than being fired off graph redraws, which is why a beat built here actually holds tempo. division says how many steps land per beat: at the default 4, a 16-character row is one bar of sixteenth notes in 4/4.

The pattern parser is strict about shape. Rows must be named kick, snare or hat, and each row must be 1–64 binary steps. Break that and you get the parser's own complaint: "Use kick/snare/hat rows with 1..64 binary steps".

The inputs and outputs that matter

  • clock - GENERETI_AUDIO_CLOCK from mod.transport. No clock, no rhythm.
  • pattern - the whole grid in one string. Default: kick:1000100010001000;snare:0000100000001000;hat:1010101010101010 Semicolons separate rows, colons separate the name from the bits.
  • division - 1 to 16, default 4. Steps per beat.
  • velocity - 0 to 1, default 0.65, applied to every hit. There's no per-step accent; if you want dynamics, run two patterns through mod.mixer at different levels.

The notes output is a GENERETI_CHOP block - wire it into mod.drumkit's notes socket. It's control data, not audio, and it will not connect to a GENERETI_AUDIO_BUS input. Note that simultaneous events are supported, so a kick and a hat can land on the same step; unit tests in the repo cover exactly that case.

Install

Manager → search Genereti, or from your ComfyUI folder:

git clone https://github.com/languel/genereti.git custom_nodes/genereti
./.venv/bin/python -m pip install -r custom_nodes/genereti/requirements.txt

Restart ComfyUI, refresh the browser. Good news for once: the whole dependency list is a single line (comfyui-frontend-package>=1.53.6), with torch, NumPy, Pillow and aiohttp coming from ComfyUI itself. No model downloads, no separate model server, no extra packs for the mod.* demos. Needs Comfy ≥ 0.38.2, Python ≥ 3.11, modern browser. Open Workflows → Genereti → ꘇ-Modular-Audio for a pre-wired transport → sequence → drum sequence → drum kit → gain → output patch.

Common issues

I queued the workflow and heard nothing. Expected. Every mod.* node returns a route description on queue and never plays sound; playback begins when you press the Start (▷) button on a downstream mod.output. Queued runs of these nodes deliberately produce silent note data.

The pattern is rejected. Count your bits - a single row over 64 steps, or an unknown row name, throws. Also check you used English row names; it's hat, not hihat.

It drifts or stutters. Two causes we can actually point at: heavy browser background throttling can affect event lookahead when the tab isn't focused, and if the browser stalls entirely the sequencer skips missed steps rather than playing a backlog on catch-up. Keep the tab in the foreground while performing.

Editing while it plays. Pattern edits keep the current musical position, but seek/reset and loop discontinuities cancel pending notes - so a live edit can audibly clip a hit that was already scheduled. Pausing stops the voices, though any mod.delay tail will keep decaying for a moment.

One caveat that isn't about this node but will affect you anyway: the pack is a solo alpha (Liuboto, MIT, v0.1.4) whose README says plainly "super alpha - early classroom testing. Back up your workflows before updating."

CategoryGenereti / Modular audio

Inputs (5)

NameTypeDefaultDescription
clockGENERETI_AUDIO_CLOCK—
patternSTRINGkick:1000100010001000;snare:0000100000001000;hat:1010101010101010—
divisionINT41–16—
velocityFLOAT0.650–1—
ratchetoptINT11–8—

Outputs (2)

NameTypeDescription
notesGENERETI_CHOP—
imageIMAGE—