
Show HN: An experimental pattern-first DAW that supports MCP
Blokkily is an experimental pattern-first DAW. A single event model drives three
以下正文同步自 Hacker News,版权归原站所有,已转换为易读排版。
Blokkily is an experimental pattern-first DAW. A single event model drives three synchronized editors — a tracker, a piano roll, and a step grid — which are in turn one lane of a multi-track song. CLAP is a required native plugin format, not a compatibility add-on.
The workstation screenshot is the rendered bdd_session_everything session: a song with a tempo ramp, a 7/8 bar, keyed and sliced samplers, CLAP, VST3 and SoundFont instruments, a warped audio clip, built-in and CLAP/VST3 effects, a return/send bus, gain and effect automation, a count-in, and two armed tracks that took MIDI from a deterministic input. Above the editors is the prompt bar of the LLM composition assistant (described below).
The framework-independent musical model and the real-time plugin boundary sit underneath all of it. The model covers notes, semantic chords, inversions, strum, microtiming, probability, ratchets, loop conditions, and parameter locks. It also includes a native CLAP catalog that loads CLAP modules, initializes their entry points, queries factories, and records plugin descriptors and features. The CLAP instance adapter implements creation, initialization, activation, sample-accurate note/parameter events, stereo processing, and state streams. The JUCE-backed VST3 adapter scans bundles and default system locations and instantiates plugins through the same real-time boundary, splitting each block at parameter offsets so VST3 automation is sample-accurate too. Parameter locks are compiled by the scheduler into sample-accurate parameter events and applied by both plugin adapters; automation sets a parameter's value while modulation offsets it, and neither erases the other. The internal FluidSynth adapter loads SF2/SF3 files, accepts sample-offset note events, renders stereo audio, selects presets, and persists its project state. FluidSynth starts a voice only where one of its 64-frame blocks begins, so the adapter keeps a small pool of renderers sharing the bank's sample data and plays each note on one whose block begins on the note's own frame: every pass of a pattern sounds in phase, whatever its length in samples. A bank's own chorus runs on its own clock, as a free-running LFO does. Projects save and reload the whole session: every named pattern with its chords, locks, ratchets, microtiming, and loop conditions, the tracks with their channel strips and clips, and the opaque state of every CLAP, VST3, and SoundFont instrument and effect. The allocation-free real-time transport compiles pattern ticks to sample events, loops patterns, drives either instrument adapter, and feeds a low-latency non-interleaved stereo RtAudio callback.
Editing while the song plays does not interrupt it. An edit recompiles the arrangement and hands it to the render callback at the next block boundary, without allocating on the audio thread, rebuilding the graph, reloading the instrument, or moving the playhead; a note whose step is erased while it is sounding is released rather than left ringing. A note entered in any editor is auditioned through the running engine, on a stopped transport as well as a playing one, and a session that opens with no instrument is given the machine's General MIDI SoundFont — the percussion bank on a drum track — so the workstation makes a sound the moment it opens.
A session is a song rather than a single pattern. Named patterns are placed as clips on the timeline of mixer tracks, each track carrying its own instrument and channel strip: gain in decibels, constant-power pan, mute, solo, and a peak meter, summed through a master fader. The song engine compiles every track's whole timeline once and then renders it without allocating, locking, or doing I/O; each repetition of a clip counts as the next loop of its pattern, so probability and loop conditions keep working across an arrangement. Mixer moves reach the running engine, so a fader can be pulled while the song plays. The same engine bounces the arrangement to a 16-bit, 24-bit, or 32-bit float WAVE file, sample for sample identical to what was auditioned.
A session also says which tuning and which scale it is written in. Tunings are held in cents — equal divisions of any period, rational and historical tunings, and Scala-style lists — so twelve equal semitones are one tuning among many. A note carries the twelve-tone key its instrument is told plus the retune away from it, and so does each voice of a chord, which is how a nineteen-tone or quarter-tone pattern reaches CLAP, VST3, and the SoundFont synth as the pitch it was written at rather than as the nearest approximation. Four playable surfaces project the same tuning and scale: a piano keyboard, isomorphic grids in seven layouts — hexagonal and square, and each running across the window or down it — fretboards for nine string tunings, and chord pads that name each harmony by its numeral and stack a row per inversion. Playing one auditions it through the selected track's instrument even on a stopped transport, and writes it onto the selected step of the canonical pattern, where every editor names it in the song's own tuning.
The tracker shows the section's instrument tracks side by side; Tab and Shift+Tab select the next or previous channel. Long patterns scroll vertically. The piano roll's arrow buttons move its pitch window by octaves, reaching MIDI keys 0–127. The arrangement has horizontal scrolling and +/− zoom controls; long songs keep usable bar widths.
The project panel's MIDI IN / MIDI OUT buttons import and export Standard MIDI Files. Export writes the arranged notes and controllers from the same song scheduler used for playback, with track names, tempo and meter. Import accepts format 0 and 1, splits channels into instrument parts, and appends four-bar sections as one undoable edit. It keeps the current song's tempo and instruments; additional tracks need instruments assigned. Import uses the recording grid: notes on one sixteenth become a chord with shared timing, and note durations are capped at the section length. MIDI exchange omits plugin state, parameter automation, per-note expression, audio clips and microtonal retuning. Tempo ramps export as sixteenth-note tempo steps. It is note exchange, not a project backup.
A MIDI keyboard plays the song too. Its keys arrive on the port's own thread and reach the render callback through a lock-free queue, so a note is not held up behind a busy interface; they sound through the selected track's instrument on a stopped song as well as a playing one, and a key of the controller is a degree of the song's tuning and scale, the way a key of the on-screen piano is. With recording armed, a running song writes what was played into the pattern under the playhead: each note lands on its nearest step with how far off the grid it was kept as micro-timing, lasts as long as the key was held, and joins a note already on that step as a chord. What is written is what the engine heard, at the position it heard it, and one take is one step of undo. A bounce neither hears nor records the keyboard.
A prompt bar above the editors asks an LLM composition assistant to write into the open pattern: a line like "a minor pentatonic ascending" or "offbeat hats" is sent to a chosen backend (a local Ollama model by default, a Gemini or MiniMax endpoint when keyed), the reply is parsed and clamped like any other input, and the result sits as a proposal on the bar until the producer clicks Apply — nothing reaches the song before then, and one generation is one undo step. The assistant is on the GUI thread only; the audio thread never sees an LLM call. See docs/llm-assistant.md for the wire dialect, backends, and the bdd_llm_assistant gate that drives the rendered bar end to end without a network.
Needs Qt 6.5+, FluidSynth, RtAudio, RtMidi, libsndfile, libsamplerate and Rubber Band 4 (found through pkg-config), and a SoundFont for the verification gates.
Licence note: clip warp (time-stretching and pitch-shifting audio clips) links the Rubber Band Library, which is licensed under the GPL (version 2 or later) unless a commercial licence is bought from its authors. A Blokkily binary built with it is therefore subject to the GPL. JUCE and the CLAP headers are vendored under third_party/. The interface typefaces, IBM Plex Sans and JetBrains Mono, are bundled in resources/fonts/ under the SIL Open Font License 1.1 (licence texts beside them), so the layout draws the same on every desktop whatever its default font.
cmake -S . -B build -G Ninja cmake --build build ctest --test-dir build --output-on-failure ./build/blokkily
The main executable is a Qt Quick workstation with synchronized step-grid, tracker, and piano-roll projections over one canonical pattern, a shared playhead, and a step inspector that exposes the model's full expression: transposition, velocity, micro-timing, probability, ratchets, loop conditions, and parameter locks with an automation/modulation switch. Every editor is an input rather than a read-out: clicking a step toggles it, pressing a lane of the piano roll writes that pitch onto the column under the pointer and dragging draws a phrase across lanes, dragging a drawn note moves it and dragging its right edge sets how long it sounds, the tracker's note column takes a click and a drag, its velocity column writes how loud the row is, and its rows are typed the way a tracker has always been typed — ZSXDCVGBHNJM for one octave and the two rows above for the next, with the entry octave on screen and moved by Ctrl+Left and Ctrl+Right, and Backspace clearing a row. Ctrl+C copies the selected step and Ctrl+V pastes it onto the cursor, locks and length included. Whichever one is used, the edit lands on the one canonical pattern, so it shows at once in every other editor, in the inspector, and in what the song plays; the view switcher focuses one editor or shows them all. Above the editors is the arrangement: one lane per track, one cell per bar. A click on an empty bar places a clip of whichever pattern is open; a click on a filled clip opens that pattern in every editor and seeks the song there; a right-click takes the clip away; Shift-click lengthens a clip across bars (one clip with several repeats, not a second placement); Alt-click moves a clip along its lane. The numbers over those bars are a ruler: a click locates the audio engine on that bar. Down the right is the mixer, one strip per track plus the master. The playhead is the audio engine's own position, read in bar.beat.sixteenth across the whole song. Below the editors is the keyboard: the session's tuning, scale, and root, a switch between the piano, the isomorphic grid, the fretboard and the chord pads, and an auto-scale toggle that snaps a played key onto the notes of the scale. The isomorphic grid carries seven layouts — Wicki-Hayden, Bosanquet, the harmonic table and the B-system accordion on a hexagonal tiling, Jankó, fourths and major thirds on a square one. Each is written in cents per step rather than in semitones, so the same fingering lands in whatever tuning the song is in. Any surface runs across the window or down it: turning one is a quarter turn, so pitch that ran to the right runs upward, and it moves keys without touching a note or a pitch. A surface that cannot be drawn at a playable key size scrolls rather than shrinking its keys past the point of being hit. Space plays, Return or Home goes back to the top of the song, the arrow keys move the step cursor (Shift+Up and Shift+Down transpose the step by a semitone, Ctrl+Up and Ctrl+Down by an octave), Insert pushes later rows down and Shift+Backspace pulls them up, Alt+arrows nudge micro-timing and note length, Ctrl+D duplicates the selected step onto the next row, Ctrl+1..0 (and Ctrl+Shift+1..6 for the second half of the bar) toggles a step, Ctrl+M mutes and Ctrl+L solos the selected track, Ctrl+R arms recording, Ctrl+E bounces the arrangement to disk, and Ctrl+K focuses the assistant prompt bar (
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。