Skip to content

BlackPyramids beside Scale Quantizer over USB: a take hook at 0x4004fc84, and Quantizer on a BlackPyramids track #1542

Done

Description

@Zac-Kyoti

Jannik, a proposal and one question before I open the base PR, so BlackPyramids and Scale Quantizer can be installed together over USB.

The site they share

Since Quantizer 2.21, qz_panel_stage patches the chromatic key's pitch staging at 0x4004fc84 (16 bytes). BlackPyramids' port patches the same 16 bytes (ot_live_chrom_hook: on a BLKPYRAMD track the staged PTCH lock is not written; the machine keeps the key as a note). modules:compat -- --with blackpyramids refuses the pair, as it should.

Proposal: a take hook ev_chromatic_stage at 0x4004fc84, 16 bytes, jmp entry, argument d2 (the track), stock tail = the 16 bytes and jmp 0x4004fc94. BlackPyramids subscribes at order 25 claiming only its own tracks; Quantizer's qz_panel_stage moves to a record at order 50 with no claim, so it keeps every other call as today. One base PR (the events.json entry, the base rebuilt), and Quantizer's port gains one subscribe line replacing qz_panel_stage. Until then the pair is pending-migration in compatibility.json.

The question: Quantizer on a BlackPyramids track

On a BLKPYRAMD track PTCH is a note number (0-96, one semitone a value), not FLEX's pitch. Wherever Quantizer goes through a base hook, BlackPyramids can keep its own tracks to itself without any change to Quantizer: records at order 25 that claim its tracks on ev_knob_store, ev_plock_store and ev_chromatic_pitch, with entry 0 so stock runs (and ev_octave_key, ev_keyboard_draw, ev_chromatic_index as already ported). Your module's behaviour on every other track is unchanged.

qz_atrig (0x4000c614) is not a hook, though: with a scale on and the track's FOLLOW on, it snaps the PTCH every trig resolves in FLEX units, so a BLKPYRAMD line would play wrong notes. Which do you prefer?

  1. A raised hook, say ev_pitch_owned (like ev_mute_keep): a machine answers the tracks whose PTCH is its own unit; Quantizer asks it in qz_atrig (and could in qz_knob / qz_plock) and leaves those tracks alone. Any later machine with its own pitch unit answers the same.
  2. No new hook: Quantizer asks the base's machine registry whether a module machine owns the track, and skips those.
  3. Nothing in Quantizer for now: BlackPyramids' README says to set that track's FOLLOW to OFF (which already makes it SCALE OFF in every path).

The author (Zac Kyoti) is fine with the chromatic keys' layout changing on a BLKPYRAMD track while Quantizer is installed; what should not change is the track's notes, ties, slides and accents.

BlackPyramids' base form is on blackpyramids-usb (local, stacked on #1418): its machine port builds as one package (the base's machine table and four take hooks). Its DSP voice still needs its engine form for the hook chain; I'm doing that next.

Activity

  1. repeat98 commented on Nov 16, 2026

    @repeat98
    Owner

    Thanks Zac, that's a clear proposal.

    The take hook. The shape looks right to me: BlackPyramids at order 25 claiming only its own tracks, and Quantizer's qz_panel_stage moving to a record at order 50 with no claim, so every other call stays as it is today. It's base code, so it goes in with the next base change; I'll say here when. Until then the pair stays pending-migration, as you suggest.

    Scale Quantizer is @timhastie's module, so the subscribe line that replaces qz_panel_stage needs his OK. Tim, is that fine with you? Nothing else in Quantizer changes.

    qz_atrig. I'd take 3 for now. FOLLOW OFF on a BLKPYRAMD track already turns the scale off in every path, and it needs no change to Quantizer and no new hook. A line in BlackPyramids' README covers it. If a second machine with its own pitch unit comes along, I'd do 1 then: a raised hook that every such machine answers. I'd rather not do 2, because it ties Quantizer to the machine registry.

  2. timhastie commented on Nov 16, 2026

    @timhastie
    Contributor

    Scale Quantizer 0.1.5 already removes qz_panel_stage at 0x4004fc84 and qz_panel_commit at 0x40005162; in the standalone package they only replay stock instructions. There is therefore no qz_panel_stage detour to migrate in that version.

    I agree with keeping FOLLOW OFF on BlackPyramids tracks for now. Please keep the pair pending until the 0.1.5 package has been checked with BlackPyramids; its PR is currently held on the saved-file question in #1597.

  3. Zac-Kyoti commented on Nov 17, 2026

    @Zac-Kyoti
    ContributorAuthor

    Thanks, Jannik and Tim.

    FOLLOW OFF: done in BlackPyramids' draft. Its README, limitations and release notes say to set FOLLOW to OFF on every BLKPYRAMD track when Scale Quantizer is installed, and why. Its port already keeps knob turns, PTCH locks and the chromatic keys on its own tracks away from Quantizer: take records at order 25 that claim only its tracks on ev_knob_store, ev_plock_store and ev_chromatic_pitch, with no entry, so stock runs there. It ships with the module PR.

    The take hook: if Quantizer 0.1.5 no longer patches 0x4004fc84, BlackPyramids is the only module there, and by the module guide a site only one module needs stays that module's own detour. So I'd drop ev_chromatic_stage rather than add it to the next base change, Jannik, unless you'd like it anyway. Until 0.1.5's package is published the pair stays pending, as you both say. When its PR is up I'll run modules:compat with BlackPyramids against the 0.1.5 package and post the result here.

  4. Zac-Kyoti commented on Nov 17, 2026

    @Zac-Kyoti
    ContributorAuthor

    Jannik, one more thing I ran into while building BlackPyramids' package against a base that carries it (on #1418's branch, local, nothing pushed): the beta base no longer fits one of its USB Audio layouts.

    With BlackPyramids' trust row, its packaged feature (bit 16 in dsp-sites.json, a member of site 5's chain) and its signature in the registry's known[], npm run octatrack:base -- --beta builds the default layout and tracks, then stops at tracks-post: its MAIN image is 1,310,864 bytes, 144 over the 1,310,720 a unit's base takes as a USB update (USB_UPDATE_BYTES). That layout already had only 252 bytes left with empty trust rows. The default layout fits with about 1.3 KB to spare, so a development twin of it builds and is what I'll test BlackPyramids on.

    So any further base-bound machine overflows that layout, not only this one. I don't know the base well enough to say where its 144 bytes should come from: room taken out of tracks-post's USB block, a smaller trust row, or waiting for Phase 2, where controllers are admitted by what they declare and the rows go. How would you like to handle it? Until then BlackPyramids can't join a base that has every layout.

  5. Zac-Kyoti commented on Nov 17, 2026

    @Zac-Kyoti
    ContributorAuthor

    Status update on BlackPyramids over the base: I'm parking the port for now. Here is what I found on my MKI, so nothing gets lost.

    Setup. A RAM-booted development twin of the base (default USB layout, plus BlackPyramids' trust row and feature 16 on site 5's chain), with the package installed only as a trial and never kept.

    1. The voice can't be admitted on any track, in any project. The engine's price is 530 + 5 executed instructions a sample, which is charged at 7/4, so 937. Voice admission books each of a core's eight slots at DSP_RESERVE (DJ EQ, 342). That leaves 384 cycles a sample on core 0 (3120 − 2736) and 829 on core 1 (3565 − 2736). So even a hardware-measured price of about 535 would fit core 1 only, and core 0 never. Analog BD at 411 executed instructions (720 + 6 charged) fits only core 1 for the same reason. Our 530 also counts the whole source span; the extra over the stock source stage it replaces is about 500. The fix there is ours.

    2. When forced in, core 0's frames stop. To measure the engine, I used a test-only copy of the package priced at 379 hardware. It was never shipped and differs only in its 3 price bytes. With it, T1 got a bare DSP FULL with no numbers, and T5 was admitted. Within 20–50 s, core 0's frames stopped: stall record reason 1, host ISR selected core 0xe, RXDF 0. It happened in both runs, and a power cycle recovered the unit. The same engine is bit-exact on our own bench and runs on hardware in the card build, so the difference is in how it sits in the base. Ruled out so far:

    • the system stack (in ot_emu, stock's SP is 0 at P:$39c, and the engine's peak plus the site call and chain bsr is about 10 entries);
    • the exit sequence (move ssh,x0 then the long BRA, the same as Analog BD's);
    • the loader's frame hook.

    I couldn't reproduce the stall in ot_emu: with a stress project loaded, the commit answered RUNTIME_BUSY 60 times in a row.

    3. A small tooling gap. npm run device:test (octatrack-qualify) only places effects. For a machine package it picks the module's name in FX1, so the machine is never placed or played. Machine modules need the test run by hand for now.

    Two questions, no rush:

    • Is the eight-DJ-EQ reservation for machine voices meant to stay? Or could voices be booked against the bank's actual effects, as slots are? Under the current rule, BlackPyramids fits one voice on T1–T4 at most, once it has a hardware price.
    • Is there a sanctioned way to measure a hardware price for a machine voice that can't be admitted yet, for example a development-base allowance override?

    The branch stays local until then. Thanks!

    Zac Kyoti

  6. repeat98 commented on Nov 17, 2026

    @repeat98
    Owner

    Thanks Zac, this is very useful. Short answers:

    Voice reservation: it shouldn't stay as it is. Voices book all eight slots at DJ EQ because a voice stays charged across a bank change and isn't checked again. I'll change the base so voices book against the bank's real effects, as effect picks do, and every bank or project load checks the charged voices again (one that no longer fits goes silent with the DSP FULL box). In a light bank that leaves core 0 most of its 3120 cycles.

    Hardware price: there's no supported path yet. I'll add a development-twin-only switch that admits a voice without the cycle check, so you can measure it with the meters on a Part with NONE in every FX slot. Please don't use inflated "hardware" prices meanwhile: 379 used core 0's spare cycles almost exactly, while the engine probably costs about twice that.

    tracks-post overflow: main takes a 1.5 MiB base since #1564, so after a rebase the 144 bytes don't matter.

    The stall: does it still happen with NONE in every FX slot on T5-T8? That tells an overload apart from something in the #1418 chain path.

    device:test: agreed, it should place machines too; I'll fix that.

  7. Zac-Kyoti commented on Nov 17, 2026

    @Zac-Kyoti
    ContributorAuthor

    Thanks Jannik, that all sounds right, and understood on the inflated prices: none from us again.

    On the stall, what I have from those runs: core 0 measured about 47% of a frame on that Part before the install, with T5's FX1 and FX2 already NONE (T6–T8: FILTER with PLATE REV, DELAY, DELAY), and peaked at 54% with the whole stock project playing. Our engine figure is 530 executed instructions a sample. Even at 1.74 times that, about 920 cycles, it adds roughly 20% of a frame, so core 0 would be near 70–75%. That makes plain overload look unlikely to me, but I can't rule it out. I'll run exactly your test (NONE in every slot on T5–T8, the voice on T5, the meters on) as soon as the development switch is in, and report both the stall and the measured price.

    Zac Kyoti

  8. added
    enhancement
    on Nov 19, 2026
  9. repeat98 commented on Nov 19, 2026

    @repeat98
    Owner

    The voice-admission change and the development build option for measuring voice cost are in the base source now (#1642), and the DSP hook chain landed in #1418. The performance guide has the measurement steps for a Part with all FX slots set to NONE. The pair stays pending until we can check the Scale Quantizer 0.1.5 package alongside BlackPyramids.

  10. repeat98 commented on Nov 21, 2026

    @repeat98
    Owner

    @Zac-Kyoti, on your question from 17 November: agreed, drop ev_chromatic_stage. Scale Quantizer 0.1.5 (#1886) leaves 0x4004fc84 stock, so BlackPyramids is the only module there and a base hook for one user isn't worth it. BlackPyramids can patch that site once 0.1.5 is released. Until then, 0.1.4 still holds it, so the pair can't go together. #1886 is open for your modules:compat run.

  11. repeat98 commented on Nov 28, 2026

    @repeat98
    Owner

    Scale Quantizer 0.1.5 is out on Modwerk since 24 November (#1886), so 0x4004fc84 now belongs to BlackPyramids alone and we're dropping ev_chromatic_stage, as agreed. I'm closing this. When you pick the port back up, please post the modules:compat run on BlackPyramids' own pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions