Repository navigation
Improvement: Digitakt II base: module filter types on the FLTR page (core_filters) - #2446
Claptom-music wants to merge 12 commits into
Conversation
Filter descriptor lookup, filter-type list, names, knob names on E-G, the parameter-code lookup for slots 35-37 and the kit-load check answer a registered added type as its stand-in. Development base adds a test filter (type 7, Multi-Mode). Emulator panel probe: listed after Equalizer, chosen through FUNC+SRC on the FLTR page, type byte 7, knobs TFRQ TRES TMOR, no fault.
planDt2FilterTable points the track filter-type lookup (0x1c26df) at a 127-word table: the six stock words read from the owner's OS by hash, each registered added type gets its stand-in's per-voice field, every other number none. The builder reads core_filters records and composes it; a set with filters and no machine changes only this site. Tests with the owner's OS: 15 pass.
So a coupled run tells it from the default type. Emulator (dev base 85ccfb78 composed with the filter table and machine parts, image ea693607): Test Filter chosen through the menu runs per-voice field 3 (Lowpass 4) on track 1, and PCM since ready is identical to choosing Lowpass 4 (82c37eb7).
…und chip
planDt2FilterDispatch takes the voice loop's 'field 7 or more' branch (0x1c6c13, now an absolute jump under the same condition) to a base dispatcher in L2 0x200c4300; fields 7-10 are four slots, each called as the stand-in's stock case calls its routine (its per-voice state in R4, the samples in R8/R12, R15 on the stack, CCALL), returning through the stock case tail. Packages name routines in build.dt2_sharc filters [{type, entry}]. Tests with the owner's OS: 17 pass. Emulator (dev base 85ccfb78 + a halving test routine for filter 7, image f3dev): track 1 on the test filter peaks at 0.0315 against 0.0630 on Lowpass 4 in the same run (-6.02 dB), routine called every block, no halt.
…ects A package's sound-chip part declares its worst case per block (build.dt2_sharc cost); the builder sums every part against DT2_SHARC_BUDGET (60,000, the effect slot's cap) and refuses a set past it. A part with filter routines must declare its cost; machine parts released before the budget are listed as uncounted. Emulator, same day: the test filter on track 9 runs for voices 16 and 17 only; the official OS 1.17 loads a project saved with filter type 7 on track 1 (the load routine read stored 7) as the default type, no fault; the development base keeps type 7 through SAVE PROJECT and LOAD PROJECT.
The page's picture switch (0x40074580, types 0-5) answers an added type as the stock type it stands for. Panel probe (dev base 6273bc6b, 53 sites): the test filter's page draws Lowpass 4's box with TFRQ and TRES, no fault.
… and changelog FILTERS.md gives a filter module's record and routine contract; the machine guide points filter modules to it; interface.json declares core_filters (board index tables/7 after core_fx, repeat98#2146); changelog entry. Engine tests: 46 files, 592 tests pass.
…t run of 443ff131
…/dt2-filter-types # Conflicts: # sdk/machines/digitakt-ii/README.md
…er-id claims as machine-id until the board kind exists
|
Thanks, this is careful work. With no filter module installed every new site falls through to stock, the numbers are fixed per module, and a kit naming a type nobody provides loads as Multi-Mode. A separate table is also the right shape: the filter runs per voice inside the voice, where an effect slot can't reach. Plan for the release: #2204, #2477, this one and #2445 go into
Pull requests into |
…ype table, claims and tests A module's build.json names its filter routine in sharc.filters with sharc.cost above 0 (a filter-only part needs no players), and the package build writes both into build.dt2_sharc. The sound chip's type table answers every index from -128 to 255, so no stray stored number reaches a filter slot; the slots and dispatcher move to 0x200c4600 and 0x200c4640. A filter part with cost 0 is refused. FILTERS.md names the filter-id claims 7 and 8. Builder tests cover more than four routines, code over the filter range and the filter-only set.
There was a problem hiding this comment.
Thanks for working through the review so quickly. I checked the new head (99ac881) against the 30 November points:
- 1. Claims: settled.
filter-id digitakt-ii/7and/8are on the board, andFILTERS.mdnames them. - 2. Build path: settled.
build.sharc.filterswith a claimed type from 7 to 126 and acostabove 0 now passes the contract, a filter-only part no longer needs players, and the package build writes both intobuild.dt2_sharc. - 4. Dispatcher bound: settled. The table now answers -128 to 255, with 0 for every unregistered index, so a stored
0xffor a negative word can no longer reach a slot. Thanks also for thed4check. - 6. Builder tests: the new cases cover what was asked.
Two points still stand, as planned: 3 (one I4, one sound-chip budget and the table order) once #2445 is merged in, and 5, the unit cases on the combined image. When both are done, mark this ready.
What was wrong or hard
Filter modules need their own filter types on each track's FLTR page, and several must sit side by side. The per-voice filter is a sound-chip voice site, so the base has to own it. The design was approved in the proposal (#2180, merged); this is the base code for it.
What this changes
Base code for
core_filtersonbase/digitakt-ii-next, as the proposal (docs/verification/2026-11-25-digitakt-ii-filter-types.md) describes. The module author's contract is insdk/machines/digitakt-ii/elekloader/modwerk/FILTERS.md.filters.c,filters-entry.s,mk2/filters.h): tablecore_filters(room 4), and six guarded sites. They cover the filter descriptor lookup0x400c89c6, the filter-type list0x40052c98(FUNC+SRC on the FLTR page), the name and short-name lookups0x400da71eand0x400da744, the kit-load check0x400db492, and the FLTR page's picture switch0x40074580. The parameter-code lookup the base already takes for machines (0x400da3a2) now reads the filter type for slots 35-37. An added type answers as the stock type it stands for, except for its names and its E-G knob names. A kit naming an unregistered type loads as type 0.src/engine/elektron/dt2-sharc.ts):planDt2FilterTablepoints the track filter-type lookup (0x1c26df) at a table in the base's L2 (0x200c4000-0x200c4600). The table answers every index from -128 to 255 (index 0 at0x200c4200). It keeps the six stock words, read from the owner's OS by hash, and has 0 (no filter) for every unregistered number.planDt2FilterDispatchturns the voice loop's "field 7 or more" branch (0x1c6c13) into an absolute jump to a base dispatcher (0x200c4640) with four slots (0x200c4600). Stock fields never reach base code.dt2-render-build.ts): readscore_filtersrecords andbuild.dt2_sharcfilters: [{type, entry}]. Adds one sound-chip budget:cost(instructions per block over the stock work replaced), summed for machines, filters and effects againstDT2_SHARC_BUDGET(60,000). A filter part must declare a cost above 0. Machine parts released before the budget are listed as uncounted.module-contract-v3.ts,build-elemod-packages.mjs): a module'sbuild.jsonnames its routine insharc.filters({type, entry label}), with each type 7-126 claimed asfilter:<type>, andsharc.costabove 0. A filter-only part needs noplayers. The package build writes both intobuild.dt2_sharc.FILTERS.md, the machine guide's line,interface.json'score_filtersentry, a changelog entry, and the proposal's record of what was checked.Review points (30 November)
Claims:
filter-id digitakt-ii/7(Vowel) anddigitakt-ii/8(Notch/Peak) are on the board, andFILTERS.mdsays so.Build path: added (above). The contract refuses:
dt2SharcCostrefuses cost 0 for a filter part too.After Digitakt II base: the effect slot (core_fx) and the FX page #2445 merges in: one
I4constant, one budget for effects plus machines and filters, and the table order ininterface.jsonandbase.json. I'll do these when I mergebase/digitakt-ii-nextin after Digitakt II base: the effect slot (core_fx) and the FX page #2445.The dispatcher's bound:
0x255990as it is (M0 = DM(I1, M4),0x1c26c5). Nothing bounds that index, on stock either. With the old 127-word table, a stored0xff(255, or -1 sign-extended) would have read the base's slots or the effect range.0xbe8000.d4: after0x40074588every case ends at0x40074800, which restoresd4beforerts. The later uses (0x40074670on) are on another path and writed4first. Nothing reads the stand-in type after the switch.Unit cases for the combined image are listed in the record. None has run yet:
Builder tests:
How I checked it
npm run check -- --base upstream/base/digitakt-ii-nexton the new head: passed in 222 s (head99ac88147): SDK checks 665 cases, module-doctor tests.MODWERK_DT2_STOCK):src/engine/elekloader/dt2-render-build.test.ts(20),src/catalog/module-contract-v3.test.ts(15) andsrc/engine/elektronall pass, 189 tests in total.8f54c4ea, gives the same level.443ff13134c316e4e40df919cdc63b859b1a4af0b2d51396ac8de1c03b4fdf58(development base6273bc6bplus the halving routine for type 7, with the earlier 127-word table). Run by Claptom-music on 30 November 2026, who reported every step passed:hook digitakt-ii/tables/6-7, andfilter-id digitakt-ii/7and/8.Still open
Guides
FILTERS.mddescribed a build path the contract didn't accept. It now shows thebuild.jsonform. The guide said filters wait for the base's filter types; it now points filter modules to FILTERS.md.🤖 Generated with Claude Code