From 56305feb18be2f52c5d2107993c518a923259ecb Mon Sep 17 00:00:00 2001 From: Lukas Schmolz Date: Thu, 19 Nov 2026 20:48:27 +0100 Subject: [PATCH 001/105] Digitone II base: record the identity that ran on a unit and commit its package Co-Authored-By: Claude Opus 5.5 --- .../modwerk-base-digitone-ii-7a60d82e.elemod | 1799 +++++++++++++++++ sdk/machines/digitone-ii/base-binding.json | 23 + sdk/machines/digitone-ii/elekloader/base.json | 1 - 3 files changed, 1822 insertions(+), 1 deletion(-) create mode 100644 sdk/imports/packages/modwerk-base-digitone-ii/modwerk-base-digitone-ii-7a60d82e.elemod create mode 100644 sdk/machines/digitone-ii/base-binding.json diff --git a/sdk/imports/packages/modwerk-base-digitone-ii/modwerk-base-digitone-ii-7a60d82e.elemod b/sdk/imports/packages/modwerk-base-digitone-ii/modwerk-base-digitone-ii-7a60d82e.elemod new file mode 100644 index 0000000000..c8d89b2b38 --- /dev/null +++ b/sdk/imports/packages/modwerk-base-digitone-ii/modwerk-base-digitone-ii-7a60d82e.elemod @@ -0,0 +1,1799 @@ +{ + "elemod": 2, + "id": "core", + "version": "1.1", + "title": "core", + "description": "The boot copier and the hook bus for the Digitakt II: every other mod needs it. From 1.1 also each frame's per-track parameter values before the stock modulators (ev_frame_params), the key-LED frame before the stock views (ev_key_leds), the mods' project data and kit data, saved and loaded with the project and its kits and copied with the kits (core_projdata, core_kitdata), and value rows for PERSONALIZE and SETTINGS (core_addvalue). On its own it changes nothing the unit does. Modwerk's Digitone II copy (OS 1.12): no .fast area, since SRAM is not qualified there, so no fast.s, core_fast or its copier.", + "category": "Framework", + "author": "irpina", + "license": "GPL-2.0-or-later", + "target": { + "device": "digitone-mk2", + "product": "Digitone II", + "os": "1.12", + "syx_sha256": "7e5b8a733d4ab1fdf7e5d22757f7d8eddaa3cbf71d0858874a791844c02ceb35", + "section3_sha256": "a098f620019b2ad38fd7e0397df39501fb1cf6bc26d0283915f34c49446fdf1a", + "section3_len": 3196288 + }, + "sections": { + ".boot": { + "align": 4, + "len": 50, + "parts": [ + [ + "hex", + "41f90000000043f900000000203c0000000022d8538066fa43f900000000203c0000000067064299538066fa4ef9400019b0" + ] + ] + }, + ".run": { + "align": 4, + "len": 3656, + "parts": [ + [ + "hex", + "2f0a45f900000000201a670c2f2f000820404e90588f60f0245f" + ], + [ + "stock", + "0x4011d5d4", + 10 + ], + [ + "stock", + "0x40025c34", + 8 + ], + [ + "hex", + "4eb94011d60a508f2f0a45f900000000201a67102f2f00082f2f001020404e90508f60ec245f4e752f0a45f9000000006126245f4a8066064ef94002c5c84e752f0a45f900000000610e245f4a8066064ef94002c55c4e75201a6712" + ], + [ + "stock", + "0x40049d1a", + 8 + ], + [ + "hex", + "20404e90508f4a8067ea4e752f0b47f900000000201b670a2f0a20404e90588f60f2265f2052487800024ef94009ff8e4e56ffc0" + ], + [ + "stock", + "0x40001792", + 8 + ], + [ + "stock", + "0x4000f7f2", + 8 + ], + [ + "hex", + "41eeffc0429042a80004203c4018de3e2140000820132140000c41eeffd0208a42a80004203c4018de3e21400008202b00042140000c41eeffe0429042a80004203c4018de3e21400008202b00082140000c41eefff0208a42a80004203c4018de3e21400008202b000c2140000c" + ], + [ + "stock", + "0x4014e98a", + 8 + ], + [ + "hex", + "0544588f2400" + ], + [ + "stock", + "0x40059d22", + 8 + ], + [ + "stock", + "0x400f6f4e", + 8 + ], + [ + "hex", + "486effd0486effc02f02" + ], + [ + "stock", + "0x40059d36", + 8 + ], + [ + "stock", + "0x40016630", + 8 + ], + [ + "hex", + "40116bee508f" + ], + [ + "stock", + "0x4008733e", + 10 + ], + [ + "hex", + "47f900000000201b670a2f0c20404e90588f60f2" + ], + [ + "stock", + "0x4007bea2", + 8 + ], + [ + "hex", + "00804e752f0a45f900000000201a671848780065222f000c0681000000222f0120404e90508f60e4245f4ef9400db3902f2f00044eb94002c3c6588f2f0a45f900000000201a670c2f2f000820404e90588f60f0245f205f2f024ed04210d08c00005d71000028af00000151446488d02f0b2f0a4eb900000000508f223cbacef00c" + ], + [ + "stock", + "0x40186de4", + 8 + ], + [ + "hex", + "00000000508f223cbacef00c4e7526bcbeefbace" + ], + [ + "stock", + "0x4000125c", + 8 + ], + [ + "hex", + "2f0b4eb900000000" + ], + [ + "stock", + "0x40001276", + 10 + ], + [ + "hex", + "4e752f0b4eb900000000588f203cbeefbace4e75" + ], + [ + "stock", + "0x40083612", + 8 + ], + [ + "hex", + "5d716712" + ], + [ + "stock", + "0x4003d640", + 8 + ], + [ + "hex", + "202f000c4ef94013477c" + ], + [ + "stock", + "0x4004e9e6", + 8 + ], + [ + "hex", + "2f2f000c61e04fef000c2f00" + ], + [ + "stock", + "0x4004e9e6", + 8 + ], + [ + "hex", + "4eb900000000508f201f4e754e56ffc0" + ], + [ + "stock", + "0x40001792", + 8 + ], + [ + "stock", + "0x4000f7f2", + 8 + ], + [ + "hex", + "41eeffc0740320ae001042a80004203c4018de3e21400008201b2140000c41e8001053826ae0" + ], + [ + "stock", + "0x4014e98a", + 8 + ], + [ + "hex", + "0544588f2400" + ], + [ + "stock", + "0x40059d22", + 8 + ], + [ + "stock", + "0x400f6f4e", + 8 + ], + [ + "hex", + "486effd0486effc02f02" + ], + [ + "stock", + "0x40059d36", + 8 + ], + [ + "stock", + "0x40016630", + 8 + ], + [ + "hex", + "40116bee508f" + ], + [ + "stock", + "0x4008733e", + 12 + ], + [ + "hex", + "fffc2f022408226e000822512251486effff2f11" + ], + [ + "stock", + "0x400148d0", + 8 + ], + [ + "stock", + "0x400365fe", + 14 + ], + [ + "stock", + "0x401503d2", + 8 + ], + [ + "hex", + "5c004a390000000067103039000000004cd75c004fef00184e752879000000004a8c677072ff47f9000000004def001843ef0010200c204c5880244914d8b08866fa2f6c000400141019e188b3802200ee89e1880281000001fe2041d1fc000000003210b3803200bdc966dc286b0004588b4a8c66ba4a4066027001720133c00000000013c1000000004cd75c004fef00184e7570ff720133c00000000013c100000000" + ], + [ + "stock", + "0x401a2104", + 8 + ], + [ + "hex", + "041c263900000000282f" + ], + [ + "stock", + "0x4000fd14", + 8 + ], + [ + "hex", + "670c200a204ad0834218b08866fa14bc004b4ebaff28e088154000014ebaff1e207900000000154000024a886740240ad68a568245f9000000002228000420039082b28062284a816718200422424c01080020680008d1c02008d08112d8b08866fa206a0004d481588a4a8866cc" + ], + [ + "stock", + "0x400160cc", + 10 + ], + [ + "stock", + "0x400059aa", + 8 + ], + [ + "stock", + "0x4000e716", + 8 + ], + [ + "hex", + "4a8a6700008c7192240a724b5682b28067000084d5f90000000042842079000000004a88674e47f900000000222800042003206800084c010800d1c04a84673e200a9082b280623a20024a81670a2242d08110d9b3c066fa24002004205b2068000c4a8867082f002f034e90508f20534a8866b8" + ], + [ + "stock", + "0x40005a4c", + 10 + ], + [ + "hex", + "4a81670a2008d0814218b1c066fa428060cc428242846086382a00014ebafe18d5f900000000b1844a4457c4790444846000ff6c4feffff4207900000000" + ], + [ + "stock", + "0x40001796", + 8 + ], + [ + "hex", + "4a886754240a06820000020043ea001c52894a29ffff66000082b3c266f243ea001c4219b3c266fa203c454c4b502540001c45ea002047f9000000002228000422412002908a43e9000cb3c06314206b0004588b4a88" + ], + [ + "stock", + "0x40025912", + 12 + ], + [ + "hex", + "2008224a588012d8b1c066fa254100044a816714205343ea0008206800082008d08112d8b08866fa206b0004588b45f218084a8866a460be203c454c4b50b0aa001c6700ff784cd70c0452b900000000" + ], + [ + "stock", + "0x400017da", + 8 + ], + [ + "stock", + "0x4000af64", + 8 + ], + [ + "hex", + "0018242b001c0c82454c4b50671a200b06800000020041eb001c52884a28ffff660000b2b08866f22079000000004a886772260b06830000020049f900000000202800044a80670c20680008d0884218b1c066fa24540c82454c4b50662c41eb0020203c000001e0221051804a81671a22680004b3c06212b292673241f09808200372079088b2806dde4280206a000c4a8867062f004e90588f206c0004588c4a88669c" + ], + [ + "stock", + "0x4000afc6", + 10 + ], + [ + "hex", + "202a0004b3c0640220094a80672243f0080850882009226a000812d8b1c066fa2454700160b852b9000000006000ff4c700160aa20390000000057804e7520790000000020504a88670c20280138727fb28065024e7570ff" + ], + [ + "stock", + "0x40005352", + 8 + ], + [ + "hex", + "0010223900000000226f000cb282620000ca2002908141f9000000004c5000014c5000004a81660000b2727fb280650000aa22004ab9000000006728d3f9000000002039000000002049d089b088671a4a1867f877912043764bb688670c52b900000000241f261f4e7576ffb681663041f900000000428141e80158b4a8fea8672e52817608b68166ee4ab90000000067d24219b08967cc4219b08966f460c42f49" + ], + [ + "stock", + "0x40007856", + 10 + ], + [ + "hex", + "6000fc1e4ab90000000067acc2fc01582039000000002041d1fc00000000d08812d8b1c0679212d8b1c066f4608a72ff6000ff564fefffec" + ], + [ + "stock", + "0x4002c31c", + 8 + ], + [ + "hex", + "223900000000226f001cb282620001282002908141f9000000004c5000014c5000004a8166000110727fb2806500010822004ab900000000676ad3f9000000002039000000002049d089b08867124a1867f87991764bb684676452b900000000161178ffb881671e7183744bb480670293c94cd7041c2f49001c2f41" + ], + [ + "stock", + "0x400d95fc", + 8 + ], + [ + "hex", + "fbec7383784bb881673641f900000000b490671641e80158b1fc0000000066f04cd7041c4fef00144e75429041e80158b1fc0000000066d860e676ffb68166ae428141f90000000041e80158b4a8fea8676652817608b68166ee73b900000000760745f900000000204152882808c88341ef00132f440010283c000001584c014800c2fc015813d000000000258248002041d1fc000000004ab900000000678010d9b0896700ff7a10d9b08966f26000ff7072ff6000fef8c2fc01582041d1fc000000004ab90000000066d46000ff524fefffe8226f001c207900000000" + ], + [ + "stock", + "0x40036bb0", + 8 + ], + [ + "hex", + "b1c96200011c2009908845f9000000004c5200014c5200004a8166000104727fb280650000fc2200b1c2620000fa2002908845f9000000004c5200034c5200004a83660000e2767fb680650000da4ab900000000670000b2b489670000ac4879000000002f00" + ], + [ + "stock", + "0x401219e6", + 8 + ], + [ + "hex", + "4ebafa06508f70ff222f001041f900000000226f000cb08167144cd7040c2f4800202f41001c4fef00186000fa6c45f9000000002f4a0014428045f90000000045ea0158b3eafea8675a52807208b28066ee71b9000000007407246f001422005281c282243c000001584c002800c0fc01582589280013c1000000002240d3fc000000004ab900000000670e203900000000d08812d8b08866fa" + ], + [ + "stock", + "0x40036bf0", + 10 + ], + [ + "hex", + "c0fc01582240d3fc0000000060d272ff6000ff044ab90000000067dab48967d645f90000000042802f4a0014204a41e80158b4a8fea8673252807608b68066ee52814a8166b0b3d2671045ea0158b5fc0000000067a0b3d266f0429245ea0158b5fc0000000066ee608cc0fc0158204070ffd1fc00000000b0816700ff184cd7040c2f4800202f41001c4fef00186000f9640000" + ], + [ + "stock", + "0x40001894", + 10 + ], + [ + "hex", + "242f0014245020522068000c4e90d4804a826d3a205220280008b4806d04240053822068000c4e90b082670c2052" + ], + [ + "stock", + "0x40030ac4", + 8 + ], + [ + "hex", + "588f246a0004" + ], + [ + "stock", + "0x400967b6", + 14 + ], + [ + "hex", + "00000000428260c2" + ], + [ + "stock", + "0x4001b00e", + 10 + ], + [ + "stock", + "0x4008a378", + 8 + ], + [ + "hex", + "b0a800086504245f4e75206800042f300c00" + ], + [ + "stock", + "0x4008d948", + 10 + ], + [ + "hex", + "00285480" + ], + [ + "stock", + "0x400bd54a", + 8 + ], + [ + "hex", + "00132f084879000000002f2f002c4eb900000000" + ], + [ + "stock", + "0x40125d5c", + 8 + ], + [ + "hex", + "487800084eb900000000588f4a80670a206f00084aa8000866024e75222f0004204020af0008214100042f004879000000002f014eb900000000" + ], + [ + "stock", + "0x400120b4", + 8 + ], + [ + "hex", + "0000102120423063408450a560c670e781089129a14ab16bc18cd1ade1cef1ef123102103273225252b5429472f762d693398318b37ba35ad3bdc39cf3ffe3de246234430420140164e674c744a45485a56ab54b85289509e5eef5cfc5acd58d365326721611063076d766f6569546b4b75ba77a97198738f7dfe7fed79dc7bc48c458e5688678a70840186128023823c9ccd9ede98ef9af89489969a90ab92b5af54ad47ab76a961a710a503a332a12dbfdcbdcfbbfeb9e9b798b58bb3bab1a6ca67c874ce45cc52c223c030c601c41edaefd8fcdecddcdad2abd0b8d689d497e976eb65ed54ef43e132e321e510e70ff9fefbedfddcffcbf1baf3a9f598f78918881a9b1caa1ebd10cc12df14ee16f108000a130c220e3500440257046606783b99398a3fbb3dac33dd31ce37ff35e02b1129022f332d24235521462777256b5eaa5cb95a88589f56ee54fd52cc50d34e224c314a004817466644754244405a7dbb7fa879997b8e75ff77ec71dd73c26d336f2069116b06657767646155634d94cc96df90ee92f99c889e9b98aa9ab584448657806682718c008e1388228a3cb7ddb5ceb3ffb1e8bf99bd8abbbbb9a4a755a546a377a160af11ad02ab33a92fd2eed0fdd6ccd4dbdaaad8b9de88dc97c266c075c644c453ca22c831ce00cc1ef1fff3ecf5ddf7caf9bbfba8fd99ff86e177e364e555e742e933eb20ed11ef000000000000000000000000000000000" + ] + ] + }, + ".bss": { + "align": 4, + "size": 3120 + } + }, + "symbols": { + "FRAME_STRIDE": [ + "abs", + 101 + ], + "LEDS_CLEAR": [ + "abs", + 1073923014 + ], + "MODS_STOCK": [ + "abs", + 1074639760 + ], + "PATTERN_OBJ": [ + "abs", + 1147439312 + ], + "KIT_ROOM": [ + "abs", + 337 + ], + "KIT_PAD": [ + "abs", + 10415 + ], + "KIT_SIZE": [ + "abs", + 23921 + ], + "FW_KITS": [ + "abs", + 1108398220 + ], + "MEMCPY": [ + "abs", + 1075005296 + ], + "FW_STR_NEW": [ + "abs", + 1075636920 + ], + "FW_LED_SET": [ + "abs", + 1073922840 + ], + "FW_INVALIDATE": [ + "abs", + 1074907802 + ], + "FW_FONT_MENU": [ + "abs", + 1076446992 + ], + "FW_TEXTBOX": [ + "abs", + 1074878792 + ], + "VBR_FN": [ + "abs", + 1073748400 + ], + "NO_DTIM0": [ + "abs", + 1 + ], + "SETTINGS_RET": [ + "abs", + 1074397070 + ], + "FN_MGR": [ + "abs", + 1075371582 + ], + "MENU_ADD": [ + "abs", + 1074883566 + ], + "ITEM_CTOR": [ + "abs", + 1074885560 + ], + "OP_NEW": [ + "abs", + 1074922820 + ], + "ENCDISP": [ + "abs", + 1073923420 + ], + "KEYDISP": [ + "abs", + 1073923528 + ], + "DRAWALL": [ + "abs", + 1074910730 + ], + "dispatch": [ + ".run", + 132 + ], + "layout": [ + ".run", + 872 + ], + "layout_known": [ + ".bss", + 3114 + ], + "layout_id": [ + ".bss", + 3116 + ], + "pack": [ + ".run", + 1044 + ], + "unpack": [ + ".run", + 1188 + ], + "shadow": [ + ".bss", + 362 + ], + "shadow_next": [ + ".bss", + 360 + ], + "tmp.0": [ + ".bss", + 20 + ], + "select": [ + ".run", + 2884 + ], + "change": [ + ".run", + 2886 + ], + "draw": [ + ".run", + 2976 + ], + "callbacks": [ + ".run", + 3640 + ], + "core_projdata_load": [ + ".run", + 1584 + ], + "core_draw": [ + ".run", + 36 + ], + "core_zero": [ + ".bss", + 0 + ], + "core_memcpy": [ + ".run", + 626 + ], + "core_store_layout": [ + ".run", + 514 + ], + "core_key": [ + ".run", + 84 + ], + "fw_led_set": [ + "abs", + 1073922840 + ], + "core_kit_on": [ + ".run", + 1830 + ], + "fw_invalidate": [ + "abs", + 1074907802 + ], + "core_value_label": [ + ".run", + 826 + ], + "boot": [ + ".boot", + 0 + ], + "core_kit_load": [ + ".run", + 554 + ], + "core_proj_save": [ + ".run", + 574 + ], + "core_addrow": [ + ".run", + 696 + ], + "core_kit_save": [ + ".run", + 534 + ], + "fw_font_menu": [ + "abs", + 1076446992 + ], + "core_store_conflicts": [ + ".bss", + 16 + ], + "fw_op_new": [ + "abs", + 1074922820 + ], + "fw_textbox": [ + "abs", + 1074878792 + ], + "core_tick": [ + ".run", + 0 + ], + "core_frame": [ + ".run", + 426 + ], + "core_enc": [ + ".run", + 108 + ], + "core_projdata_save": [ + ".run", + 1382 + ], + "core_addvalue": [ + ".run", + 3062 + ], + "core_settings": [ + ".run", + 156 + ], + "core_kit_copied": [ + ".run", + 2440 + ], + "core_key_leds": [ + ".run", + 470 + ], + "core_kitdata_room": [ + ".run", + 1820 + ], + "core_kitdata_load": [ + ".run", + 2088 + ], + "core_proj_load": [ + ".run", + 608 + ], + "core_personalize": [ + ".run", + 394 + ], + "core_kitdata_save": [ + ".run", + 1858 + ], + "core_additem": [ + ".run", + 192 + ] + }, + "exports": [ + "boot", + "core_additem", + "core_addrow", + "core_addvalue", + "core_draw", + "core_enc", + "core_frame", + "core_key", + "core_key_leds", + "core_kit_copied", + "core_kit_load", + "core_kit_on", + "core_kit_save", + "core_kitdata_load", + "core_kitdata_room", + "core_kitdata_save", + "core_memcpy", + "core_personalize", + "core_proj_load", + "core_proj_save", + "core_projdata_load", + "core_projdata_save", + "core_settings", + "core_store_conflicts", + "core_store_layout", + "core_tick", + "core_value_label", + "core_zero", + "fw_font_menu", + "fw_invalidate", + "fw_led_set", + "fw_op_new", + "fw_textbox" + ], + "imports": [ + "__bss_start", + "__bss_words", + "__run_load", + "__run_start", + "__run_words", + "core_kitdata", + "core_projdata", + "ev_draw", + "ev_enc", + "ev_frame_params", + "ev_key", + "ev_key_leds", + "ev_personalize", + "ev_settings", + "ev_tick" + ], + "weak": [], + "relocs": [ + [ + ".boot", + 2, + "abs32", + "sym:__run_load", + 0 + ], + [ + ".boot", + 8, + "abs32", + "sym:__run_start", + 0 + ], + [ + ".boot", + 14, + "abs32", + "sym:__run_words", + 0 + ], + [ + ".boot", + 26, + "abs32", + "sym:__bss_start", + 0 + ], + [ + ".boot", + 32, + "abs32", + "sym:__bss_words", + 0 + ], + [ + ".run", + 4, + "abs32", + "sym:ev_tick", + 0 + ], + [ + ".run", + 56, + "abs32", + "sym:ev_draw", + 0 + ], + [ + ".run", + 88, + "abs32", + "sym:ev_key", + 0 + ], + [ + ".run", + 112, + "abs32", + "sym:ev_enc", + 0 + ], + [ + ".run", + 160, + "abs32", + "sym:ev_settings", + 0 + ], + [ + ".run", + 396, + "abs32", + "sym:ev_personalize", + 0 + ], + [ + ".run", + 430, + "abs32", + "sym:ev_frame_params", + 0 + ], + [ + ".run", + 486, + "abs32", + "sym:ev_key_leds", + 0 + ], + [ + ".run", + 540, + "abs32", + "sec:.run", + 1858 + ], + [ + ".run", + 560, + "abs32", + "sec:.run", + 2088 + ], + [ + ".run", + 592, + "abs32", + "sec:.run", + 1382 + ], + [ + ".run", + 612, + "abs32", + "sec:.run", + 1584 + ], + [ + ".run", + 686, + "abs32", + "sec:.run", + 2440 + ], + [ + ".run", + 882, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 890, + "abs32", + "sec:.bss", + 3116 + ], + [ + ".run", + 906, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 918, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 972, + "abs32", + "sec:.run", + 3128 + ], + [ + ".run", + 1006, + "abs32", + "sec:.bss", + 3116 + ], + [ + ".run", + 1012, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 1032, + "abs32", + "sec:.bss", + 3116 + ], + [ + ".run", + 1038, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 1054, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1102, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1122, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1226, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1234, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1244, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1364, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1388, + "abs32", + "sym:core_projdata", + 0 + ], + [ + ".run", + 1456, + "abs32", + "sym:core_projdata", + 0 + ], + [ + ".run", + 1574, + "abs32", + "sec:.bss", + 16 + ], + [ + ".run", + 1636, + "abs32", + "sym:core_projdata", + 0 + ], + [ + ".run", + 1654, + "abs32", + "sym:core_projdata", + 0 + ], + [ + ".run", + 1808, + "abs32", + "sec:.bss", + 16 + ], + [ + ".run", + 1822, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1832, + "abs32", + "sec:.run", + 530 + ], + [ + ".run", + 1868, + "abs32", + "sec:.run", + 514 + ], + [ + ".run", + 1888, + "abs32", + "sec:.run", + 518 + ], + [ + ".run", + 1918, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1926, + "abs32", + "sec:.run", + 522 + ], + [ + ".run", + 1932, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1960, + "abs32", + "sec:.bss", + 16 + ], + [ + ".run", + 1978, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2004, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2042, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2054, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2062, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2102, + "abs32", + "sec:.run", + 514 + ], + [ + ".run", + 2122, + "abs32", + "sec:.run", + 518 + ], + [ + ".run", + 2152, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 2160, + "abs32", + "sec:.run", + 522 + ], + [ + ".run", + 2166, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2192, + "abs32", + "sec:.bss", + 16 + ], + [ + ".run", + 2244, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2258, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 2282, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 2300, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2324, + "abs32", + "sec:.bss", + 360 + ], + [ + ".run", + 2332, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2368, + "abs32", + "sec:.bss", + 360 + ], + [ + ".run", + 2380, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2386, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2424, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2430, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2450, + "abs32", + "sec:.run", + 514 + ], + [ + ".run", + 2474, + "abs32", + "sec:.run", + 518 + ], + [ + ".run", + 2514, + "abs32", + "sec:.run", + 518 + ], + [ + ".run", + 2542, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 2558, + "abs32", + "sec:.bss", + 20 + ], + [ + ".run", + 2586, + "abs32", + "sec:.bss", + 20 + ], + [ + ".run", + 2620, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2632, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2656, + "abs32", + "sec:.bss", + 360 + ], + [ + ".run", + 2692, + "abs32", + "sec:.bss", + 360 + ], + [ + ".run", + 2700, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2706, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2714, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2744, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2758, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 2770, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2816, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 2834, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 2852, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2968, + "abs32", + "abs", + 1074907802 + ], + [ + ".run", + 3040, + "abs32", + "abs", + 1076446992 + ], + [ + ".run", + 3050, + "abs32", + "abs", + 1074878792 + ], + [ + ".run", + 3068, + "abs32", + "abs", + 1074922820 + ], + [ + ".run", + 3108, + "abs32", + "sec:.run", + 3640 + ], + [ + ".run", + 3116, + "abs32", + "sec:.run", + 696 + ], + [ + ".run", + 3640, + "abs32", + "sec:.run", + 826 + ], + [ + ".run", + 3644, + "abs32", + "sec:.run", + 2884 + ], + [ + ".run", + 3648, + "abs32", + "sec:.run", + 2976 + ], + [ + ".run", + 3652, + "abs32", + "sec:.run", + 2886 + ] + ], + "sites": [ + { + "addr": "0x40000538", + "len": 6, + "stock_sha256": "f0c5fc0afd892b3ec3f8803e1d875a2a22c6bb4e2cb987adc582cf8dea48c28a", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:boot", + 0 + ] + ] + }, + { + "addr": "0x4002e464", + "len": 6, + "stock_sha256": "8abc5b3d8941b94f9ec93c348112bcaf09510582ab72977a407b9ce1e213a459", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_tick", + 0 + ] + ] + }, + { + "addr": "0x4002e4ca", + "len": 6, + "stock_sha256": "51e3665db347990c1500cab5b2766706e47605e08a3a01c721fc1958f75c27ab", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_draw", + 0 + ] + ] + }, + { + "addr": "0x4002f20c", + "len": 6, + "stock_sha256": "d1e1f5dd2afbbcebc50c89fdcf5fd704a0a26f28becdcada110ab0c2d14626fc", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_key", + 0 + ] + ] + }, + { + "addr": "0x4002f256", + "len": 6, + "stock_sha256": "786bc53e108e78a53f3bfc32fc57bd91569f6702c55a9566747386c873b91d4a", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_enc", + 0 + ] + ] + }, + { + "addr": "0x4009ff88", + "len": 6, + "stock_sha256": "c7589861366d298dd3e07f1f5ebce25db0435f9cad638eae321d68e7542f6c74", + "new": "4ef900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_settings", + 0 + ] + ] + }, + { + "addr": "0x400987a2", + "len": 6, + "stock_sha256": "10552f30e94896a18c635b43b0f16452187a5e3db5b661ba3255c1ecb054fd50", + "new": "4ef900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_personalize", + 0 + ] + ] + }, + { + "addr": "0x40027196", + "len": 6, + "stock_sha256": "8f4626d425f213c0f0f9f81054e40a51bad034eaa6b154d51fe969ae4a521a8d", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_frame", + 0 + ] + ] + }, + { + "addr": "0x4002c87a", + "len": 6, + "stock_sha256": "3988e55cba5c51c557dcb530885eba6f789018b4345baccd49ebce731fd6f68e", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_key_leds", + 0 + ] + ] + }, + { + "addr": "0x400de0d4", + "len": 6, + "stock_sha256": "1a4f590b6150643d45e52f347f5e32771feeeb47a764c2337fc4d6faefdfeb8f", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_kit_save", + 0 + ] + ] + }, + { + "addr": "0x400ddddc", + "len": 6, + "stock_sha256": "1a4f590b6150643d45e52f347f5e32771feeeb47a764c2337fc4d6faefdfeb8f", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_kit_load", + 0 + ] + ] + }, + { + "addr": "0x400e18be", + "len": 6, + "stock_sha256": "be28bf581aa32f87a3306f04738f1dbdb4b28489865cd0d88145466f2740333c", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_proj_save", + 0 + ] + ] + }, + { + "addr": "0x400e1928", + "len": 6, + "stock_sha256": "39d8feaa0cf09fbdc868baea4e44be238666cbfcbf350883559c99085034a789", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_proj_load", + 0 + ] + ] + }, + { + "addr": "0x40134770", + "len": 12, + "stock_sha256": "a48eab821488cf202e892b5cad063488c972824e57c3d851ab402463dc0f5657", + "new": "4ef9000000004e714e714e71", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_memcpy", + 0 + ] + ] + } + ], + "collections": { + "ev_tick": { + "entry": 4 + }, + "ev_draw": { + "entry": 4 + }, + "ev_key": { + "entry": 4 + }, + "ev_enc": { + "entry": 4 + }, + "ev_settings": { + "entry": 4 + }, + "ev_personalize": { + "entry": 4 + }, + "ev_frame_params": { + "entry": 4 + }, + "ev_key_leds": { + "entry": 4 + }, + "core_projdata": { + "entry": 4 + }, + "core_kitdata": { + "entry": 4 + } + }, + "contribute": [], + "copied": [], + "resources": {}, + "requires": [], + "conflicts": [], + "build": { + "sources": { + "core.s": "dd0074e9b08a254838feae6215404e775ba7ef7aa2afbcce1e5c24794eebddc5", + "settings.s": "8fa715d46d6dbe239bed6d8d0ea4a0c3100c068b39869c938b402f2d6a15a380", + "personalize.s": "10372f64d233a1cc3c5abcb202084c3a8707e17e8d656038754c44a3e7554111", + "fw.s": "ae8bfc9a7f5778162be93fb1aa499e0ad1d7b515cbba52ba6b22b03588458cac", + "frame.s": "92fdd15abac49c2f802cd623af6a841327b3e32b53967795ade3188f46652c14", + "leds.s": "bbccdf836c4ef7cc27b78f8bbc3c3dcce10fa691e0d6a34b6a30c1d7d2375d87", + "store.s": "499d5ad2e71609075fd7461f6081504d91acf0c16aa77b267550af7ec417999b", + "store.c": "442ec9e88128519d5b446d1627b52ec05afdcefda564012734f5fa9430a4a5a4", + "rows.s": "00d971f3ba2372a08c209023edd45458a72ec3a73e56920fb440b82b7327ee4c", + "rows.c": "d6b5b85e86f38d9429c17a1b48ac4a77169583954c56b0707ce11c2821acc58e" + } + }, + "signature": null +} diff --git a/sdk/machines/digitone-ii/base-binding.json b/sdk/machines/digitone-ii/base-binding.json new file mode 100644 index 0000000000..c71007b52d --- /dev/null +++ b/sdk/machines/digitone-ii/base-binding.json @@ -0,0 +1,23 @@ +{ + "schema": 1, + "identity": "7a60d82ebdf30d9e6013f6ab391d4666ea92b6d4a7c7d11f679ad8c958b4bf99", + "package": "core-1.1.elemod", + "sections": { + ".boot": 50, + ".run": 3656, + ".bss": 3120 + }, + "sites": 14, + "built": { + "kit": "3b31ef3c0e43c810e3acd0be6257e2484b20fc40", + "toolchain": { + "cross": "m68k-elf-", + "gcc": "16.2.0", + "binutils": "2.47" + }, + "stock": "7e5b8a733d4ab1fdf7e5d22757f7d8eddaa3cbf71d0858874a791844c02ceb35" + }, + "variants": { + "plain": "7a60d82ebdf30d9e6013f6ab391d4666ea92b6d4a7c7d11f679ad8c958b4bf99" + } +} diff --git a/sdk/machines/digitone-ii/elekloader/base.json b/sdk/machines/digitone-ii/elekloader/base.json index 3a26b0da26..92b5782f64 100644 --- a/sdk/machines/digitone-ii/elekloader/base.json +++ b/sdk/machines/digitone-ii/elekloader/base.json @@ -1,7 +1,6 @@ { "schema": 1, "about": "Modwerk's Digitone II OS 1.12 base, built by npm run machine:base -- digitone-ii: the Digitakt II base's core-dt2 1.1 source (source names that folder) with the Digitone II's addresses and sites (recipe), and Digitone II copies of three of its files (copies: each names the core-dt2 file and SHA-256 it was made from, and the build refuses when that file has changed): mod.json for OS 1.12 without the .fast area, since SRAM is not qualified on this OS; store.s, whose kit load has its registers the other way round; and store.c, whose kit room is larger. The addresses are the ones core-dn2 0.3 (toonst's elekloader fork at 3d7c2e3, GPL-2.0-or-later) builds this source with, and its images ran on a unit (docs/verification/2026-11-18-digitone-ii-core-on-a-unit.md). One variant, plain: none of the Digitakt II base's sequencer and project additions, whose Digitone II sites are not found yet. The device is carried by Modwerk's builder (device.json). Every site names the stock bytes it replaces by length and SHA-256; the build fills them from the user's OS.", - "pending": "No base-binding.json yet: the base ran on a unit (docs/verification/2026-11-19-digitone-ii-base-on-a-unit.md), linked and packed by Elekloader 0.11's patcher, because images the pinned kit packs exceed the unit's update limit. The binding and the profile's SDK budgets come with the machine's SDK profile.", "source": "digitakt-ii", "core": "core-dt2", "include": "sdk/machines/digitakt-ii/include", From 7e16017d6ddb47495b841c02b52746f151e40936 Mon Sep 17 00:00:00 2001 From: Lukas Schmolz Date: Thu, 19 Nov 2026 20:48:44 +0100 Subject: [PATCH 002/105] Digitone II base: its catalog record Co-Authored-By: Claude Opus 5.5 --- ...r-modwerk-base-digitone-ii-2026-11-19.json | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sdk/imports/elekloader-modwerk-base-digitone-ii-2026-11-19.json diff --git a/sdk/imports/elekloader-modwerk-base-digitone-ii-2026-11-19.json b/sdk/imports/elekloader-modwerk-base-digitone-ii-2026-11-19.json new file mode 100644 index 0000000000..9bec070831 --- /dev/null +++ b/sdk/imports/elekloader-modwerk-base-digitone-ii-2026-11-19.json @@ -0,0 +1,22 @@ +{ + "schema": 1, + "kind": "elekloader-catalog", + "revision": "modwerk-base-digitone-ii-2026-11-19", + "cores": [ + { + "file": "modwerk-base-digitone-ii-7a60d82e.elemod", + "sha256": "7a60d82ebdf30d9e6013f6ab391d4666ea92b6d4a7c7d11f679ad8c958b4bf99", + "id": "core", + "version": "1.1", + "device": "digitone-mk2", + "os": "1.12", + "license": "GPL-2.0-or-later", + "source": { + "repo": "repeat98/modwerk", + "commit": "56305feb18be2f52c5d2107993c518a923259ecb", + "path": "sdk/imports/packages/modwerk-base-digitone-ii/modwerk-base-digitone-ii-7a60d82e.elemod" + } + } + ], + "mods": [] +} From 5bef42e76abab96681c51f19494d2246649cae32 Mon Sep 17 00:00:00 2001 From: Lukas Schmolz Date: Thu, 19 Nov 2026 20:50:25 +0100 Subject: [PATCH 003/105] Digitone II base in the site's catalog and builder The update and vendor scripts know the Digitone II (its odd-jump check uses the device Modwerk's builder carries), the catalog serves the base package, and machine-build.ts builds on its plain variant. Co-Authored-By: Claude Opus 5.5 --- scripts/elekloader-update.ts | 2 +- scripts/elekloader-vendor.ts | 4 +- src/engine/elekloader/machine-build.ts | 8 +- .../modwerk-base-digitone-ii-7a60d82e.elemod | 1799 +++++++++++++++++ 4 files changed, 1810 insertions(+), 3 deletions(-) create mode 100644 vendor/elekloader/catalog/modwerk-base-digitone-ii-7a60d82e.elemod diff --git a/scripts/elekloader-update.ts b/scripts/elekloader-update.ts index 140fc084a9..371b53311d 100644 --- a/scripts/elekloader-update.ts +++ b/scripts/elekloader-update.ts @@ -29,7 +29,7 @@ export { mergeCatalogOverlay } from './elekloader-vendor.ts' /** The kit protocol src/engine/elekloader/digi-build.ts is written for. */ export const KIT_PROTOCOL = 1 /** The devices Modwerk builds for: digi-build.ts's DEVICE, the machine folders under sdk/. */ -export const DEVICES: Record = { 'digitakt-mk1': 'digitakt', 'digitakt-mk2': 'digitakt-ii', 'digitone-mk1': 'digitone', 'analog-rytm-mk2': 'analog-rytm-mkii' } +export const DEVICES: Record = { 'digitakt-mk1': 'digitakt', 'digitakt-mk2': 'digitakt-ii', 'digitone-mk1': 'digitone', 'analog-rytm-mk2': 'analog-rytm-mkii', 'digitone-mk2': 'digitone-ii' } /** The kit files Modwerk vendors; the zip's dist/, tools/build.ts and examples/ are for sites without a bundler. */ const VENDORED = (name: string) => name.startsWith('src/') || ['tools/kit.ts', 'LICENSE', 'NOTICE', 'README.md', 'kit.json'].includes(name) diff --git a/scripts/elekloader-vendor.ts b/scripts/elekloader-vendor.ts index fd1ff78f8e..1762fb5caa 100644 --- a/scripts/elekloader-vendor.ts +++ b/scripts/elekloader-vendor.ts @@ -14,6 +14,7 @@ import { fileURLToPath } from 'node:url' import type { Plugin } from 'vite' import { parseCatalog, type Catalog } from '../vendor/elekloader/kit/src/kit/catalog.ts' import { devices } from '../vendor/elekloader/kit/src/devices.ts' +import { carryDevices } from '../src/engine/elekloader/carried-devices.ts' import { oddJumpsInFiles, type PackageFile } from '../src/engine/elektron/odd-jumps.ts' export const ELEKLOADER_SITE = 'elekloader/' @@ -128,13 +129,14 @@ export async function readVendoredElekloader(root: string): Promise<{ lock: Lock const catalog = parseCatalog(site.catalog) const pins = [...catalog.cores, ...catalog.mods], assets: [string, Buffer][] = [[ELEKLOADER_SITE + 'catalog.json', raw]] const packages: PackageFile[] = [], odd: string[] = [] + carryDevices() for (const pin of pins) { const data = await readFile(resolve(dir, pin.file)).catch(() => undefined) if (!data) bad.push('missing: ' + pin.file) else if (sha(data) !== pin.sha256) bad.push('not the pinned file: ' + pin.file) else { assets.push([ELEKLOADER_SITE + pin.file, data]) - // Where the pin's machine runs code, from the kit's own profile of that firmware. + // Where the pin's machine runs code, from the kit's own profile of that firmware, or the one Modwerk's builder carries. const device = devices().find(device => device.key === pin.device), release = device?.releases.find(release => release.version === pin.os) if (device && release) packages.push({ name: pin.file, bytes: data, firmware: pin.device + ' ' + pin.os, machine: { mainLoad: device.mainLoad, mainLength: release.mainLen, areas: [...Object.values(device.areas), device.ddr, device.sramCode] } }) else odd.push(pin.file + ': the kit has no profile of ' + pin.device + ' ' + pin.os + ', so its jumps cannot be checked') diff --git a/src/engine/elekloader/machine-build.ts b/src/engine/elekloader/machine-build.ts index d49aef73e2..2a6bffbb8c 100644 --- a/src/engine/elekloader/machine-build.ts +++ b/src/engine/elekloader/machine-build.ts @@ -4,6 +4,7 @@ import CATALOG_JSON from '../../../vendor/elekloader/catalog/catalog.json' with { type: 'json' } import KIT from '../../../vendor/elekloader/kit/kit.json' with { type: 'json' } import DT2_BASE from '../../../sdk/machines/digitakt-ii/base-binding.json' with { type: 'json' } +import DN2_BASE from '../../../sdk/machines/digitone-ii/base-binding.json' with { type: 'json' } import RYTM_BASE from '../../../sdk/machines/analog-rytm-mkii/base-binding.json' with { type: 'json' } import RYTM_FX_IDS from '../../../sdk/machines/analog-rytm-mkii/fx-ids.json' with { type: 'json' } import RYTM_VOICE_MODULES from '../../../sdk/machines/analog-rytm-mkii/voice-modules.json' with { type: 'json' } @@ -18,7 +19,7 @@ import { carryDevices } from './carried-devices' export { buildStep } from '../../../vendor/elekloader/kit/src/kit/index.ts' export type { Builder } -export const MACHINE_DEVICE = { octatrack: 'octatrack', digitakt: 'digitakt-mk1', 'digitakt-ii': 'digitakt-mk2', digitone: 'digitone-mk1', 'analog-rytm-mkii': 'analog-rytm-mk2' } as const +export const MACHINE_DEVICE = { octatrack: 'octatrack', digitakt: 'digitakt-mk1', 'digitakt-ii': 'digitakt-mk2', digitone: 'digitone-mk1', 'analog-rytm-mkii': 'analog-rytm-mk2', 'digitone-ii': 'digitone-mk2' } as const export type ElekloaderMachine = keyof typeof MACHINE_DEVICE carryDevices() export const BUILDER_CATALOG: Catalog = parseCatalog(CATALOG_JSON) @@ -38,6 +39,11 @@ const MODWERK_BASES: Partial 'base', }, + // The Digitakt II base's source with the Digitone II's recipe (sdk/machines/digitone-ii/elekloader/): one variant. + 'digitone-ii': { + variants: DN2_BASE.variants, + variant: () => 'plain', + }, 'analog-rytm-mkii': { variants: RYTM_BASE.variants, variant: moduleIds => rytmVariant(moduleIds, Object.values(RYTM_FX_IDS.ids), RYTM_VOICE_MODULES.ids), diff --git a/vendor/elekloader/catalog/modwerk-base-digitone-ii-7a60d82e.elemod b/vendor/elekloader/catalog/modwerk-base-digitone-ii-7a60d82e.elemod new file mode 100644 index 0000000000..c8d89b2b38 --- /dev/null +++ b/vendor/elekloader/catalog/modwerk-base-digitone-ii-7a60d82e.elemod @@ -0,0 +1,1799 @@ +{ + "elemod": 2, + "id": "core", + "version": "1.1", + "title": "core", + "description": "The boot copier and the hook bus for the Digitakt II: every other mod needs it. From 1.1 also each frame's per-track parameter values before the stock modulators (ev_frame_params), the key-LED frame before the stock views (ev_key_leds), the mods' project data and kit data, saved and loaded with the project and its kits and copied with the kits (core_projdata, core_kitdata), and value rows for PERSONALIZE and SETTINGS (core_addvalue). On its own it changes nothing the unit does. Modwerk's Digitone II copy (OS 1.12): no .fast area, since SRAM is not qualified there, so no fast.s, core_fast or its copier.", + "category": "Framework", + "author": "irpina", + "license": "GPL-2.0-or-later", + "target": { + "device": "digitone-mk2", + "product": "Digitone II", + "os": "1.12", + "syx_sha256": "7e5b8a733d4ab1fdf7e5d22757f7d8eddaa3cbf71d0858874a791844c02ceb35", + "section3_sha256": "a098f620019b2ad38fd7e0397df39501fb1cf6bc26d0283915f34c49446fdf1a", + "section3_len": 3196288 + }, + "sections": { + ".boot": { + "align": 4, + "len": 50, + "parts": [ + [ + "hex", + "41f90000000043f900000000203c0000000022d8538066fa43f900000000203c0000000067064299538066fa4ef9400019b0" + ] + ] + }, + ".run": { + "align": 4, + "len": 3656, + "parts": [ + [ + "hex", + "2f0a45f900000000201a670c2f2f000820404e90588f60f0245f" + ], + [ + "stock", + "0x4011d5d4", + 10 + ], + [ + "stock", + "0x40025c34", + 8 + ], + [ + "hex", + "4eb94011d60a508f2f0a45f900000000201a67102f2f00082f2f001020404e90508f60ec245f4e752f0a45f9000000006126245f4a8066064ef94002c5c84e752f0a45f900000000610e245f4a8066064ef94002c55c4e75201a6712" + ], + [ + "stock", + "0x40049d1a", + 8 + ], + [ + "hex", + "20404e90508f4a8067ea4e752f0b47f900000000201b670a2f0a20404e90588f60f2265f2052487800024ef94009ff8e4e56ffc0" + ], + [ + "stock", + "0x40001792", + 8 + ], + [ + "stock", + "0x4000f7f2", + 8 + ], + [ + "hex", + "41eeffc0429042a80004203c4018de3e2140000820132140000c41eeffd0208a42a80004203c4018de3e21400008202b00042140000c41eeffe0429042a80004203c4018de3e21400008202b00082140000c41eefff0208a42a80004203c4018de3e21400008202b000c2140000c" + ], + [ + "stock", + "0x4014e98a", + 8 + ], + [ + "hex", + "0544588f2400" + ], + [ + "stock", + "0x40059d22", + 8 + ], + [ + "stock", + "0x400f6f4e", + 8 + ], + [ + "hex", + "486effd0486effc02f02" + ], + [ + "stock", + "0x40059d36", + 8 + ], + [ + "stock", + "0x40016630", + 8 + ], + [ + "hex", + "40116bee508f" + ], + [ + "stock", + "0x4008733e", + 10 + ], + [ + "hex", + "47f900000000201b670a2f0c20404e90588f60f2" + ], + [ + "stock", + "0x4007bea2", + 8 + ], + [ + "hex", + "00804e752f0a45f900000000201a671848780065222f000c0681000000222f0120404e90508f60e4245f4ef9400db3902f2f00044eb94002c3c6588f2f0a45f900000000201a670c2f2f000820404e90588f60f0245f205f2f024ed04210d08c00005d71000028af00000151446488d02f0b2f0a4eb900000000508f223cbacef00c" + ], + [ + "stock", + "0x40186de4", + 8 + ], + [ + "hex", + "00000000508f223cbacef00c4e7526bcbeefbace" + ], + [ + "stock", + "0x4000125c", + 8 + ], + [ + "hex", + "2f0b4eb900000000" + ], + [ + "stock", + "0x40001276", + 10 + ], + [ + "hex", + "4e752f0b4eb900000000588f203cbeefbace4e75" + ], + [ + "stock", + "0x40083612", + 8 + ], + [ + "hex", + "5d716712" + ], + [ + "stock", + "0x4003d640", + 8 + ], + [ + "hex", + "202f000c4ef94013477c" + ], + [ + "stock", + "0x4004e9e6", + 8 + ], + [ + "hex", + "2f2f000c61e04fef000c2f00" + ], + [ + "stock", + "0x4004e9e6", + 8 + ], + [ + "hex", + "4eb900000000508f201f4e754e56ffc0" + ], + [ + "stock", + "0x40001792", + 8 + ], + [ + "stock", + "0x4000f7f2", + 8 + ], + [ + "hex", + "41eeffc0740320ae001042a80004203c4018de3e21400008201b2140000c41e8001053826ae0" + ], + [ + "stock", + "0x4014e98a", + 8 + ], + [ + "hex", + "0544588f2400" + ], + [ + "stock", + "0x40059d22", + 8 + ], + [ + "stock", + "0x400f6f4e", + 8 + ], + [ + "hex", + "486effd0486effc02f02" + ], + [ + "stock", + "0x40059d36", + 8 + ], + [ + "stock", + "0x40016630", + 8 + ], + [ + "hex", + "40116bee508f" + ], + [ + "stock", + "0x4008733e", + 12 + ], + [ + "hex", + "fffc2f022408226e000822512251486effff2f11" + ], + [ + "stock", + "0x400148d0", + 8 + ], + [ + "stock", + "0x400365fe", + 14 + ], + [ + "stock", + "0x401503d2", + 8 + ], + [ + "hex", + "5c004a390000000067103039000000004cd75c004fef00184e752879000000004a8c677072ff47f9000000004def001843ef0010200c204c5880244914d8b08866fa2f6c000400141019e188b3802200ee89e1880281000001fe2041d1fc000000003210b3803200bdc966dc286b0004588b4a8c66ba4a4066027001720133c00000000013c1000000004cd75c004fef00184e7570ff720133c00000000013c100000000" + ], + [ + "stock", + "0x401a2104", + 8 + ], + [ + "hex", + "041c263900000000282f" + ], + [ + "stock", + "0x4000fd14", + 8 + ], + [ + "hex", + "670c200a204ad0834218b08866fa14bc004b4ebaff28e088154000014ebaff1e207900000000154000024a886740240ad68a568245f9000000002228000420039082b28062284a816718200422424c01080020680008d1c02008d08112d8b08866fa206a0004d481588a4a8866cc" + ], + [ + "stock", + "0x400160cc", + 10 + ], + [ + "stock", + "0x400059aa", + 8 + ], + [ + "stock", + "0x4000e716", + 8 + ], + [ + "hex", + "4a8a6700008c7192240a724b5682b28067000084d5f90000000042842079000000004a88674e47f900000000222800042003206800084c010800d1c04a84673e200a9082b280623a20024a81670a2242d08110d9b3c066fa24002004205b2068000c4a8867082f002f034e90508f20534a8866b8" + ], + [ + "stock", + "0x40005a4c", + 10 + ], + [ + "hex", + "4a81670a2008d0814218b1c066fa428060cc428242846086382a00014ebafe18d5f900000000b1844a4457c4790444846000ff6c4feffff4207900000000" + ], + [ + "stock", + "0x40001796", + 8 + ], + [ + "hex", + "4a886754240a06820000020043ea001c52894a29ffff66000082b3c266f243ea001c4219b3c266fa203c454c4b502540001c45ea002047f9000000002228000422412002908a43e9000cb3c06314206b0004588b4a88" + ], + [ + "stock", + "0x40025912", + 12 + ], + [ + "hex", + "2008224a588012d8b1c066fa254100044a816714205343ea0008206800082008d08112d8b08866fa206b0004588b45f218084a8866a460be203c454c4b50b0aa001c6700ff784cd70c0452b900000000" + ], + [ + "stock", + "0x400017da", + 8 + ], + [ + "stock", + "0x4000af64", + 8 + ], + [ + "hex", + "0018242b001c0c82454c4b50671a200b06800000020041eb001c52884a28ffff660000b2b08866f22079000000004a886772260b06830000020049f900000000202800044a80670c20680008d0884218b1c066fa24540c82454c4b50662c41eb0020203c000001e0221051804a81671a22680004b3c06212b292673241f09808200372079088b2806dde4280206a000c4a8867062f004e90588f206c0004588c4a88669c" + ], + [ + "stock", + "0x4000afc6", + 10 + ], + [ + "hex", + "202a0004b3c0640220094a80672243f0080850882009226a000812d8b1c066fa2454700160b852b9000000006000ff4c700160aa20390000000057804e7520790000000020504a88670c20280138727fb28065024e7570ff" + ], + [ + "stock", + "0x40005352", + 8 + ], + [ + "hex", + "0010223900000000226f000cb282620000ca2002908141f9000000004c5000014c5000004a81660000b2727fb280650000aa22004ab9000000006728d3f9000000002039000000002049d089b088671a4a1867f877912043764bb688670c52b900000000241f261f4e7576ffb681663041f900000000428141e80158b4a8fea8672e52817608b68166ee4ab90000000067d24219b08967cc4219b08966f460c42f49" + ], + [ + "stock", + "0x40007856", + 10 + ], + [ + "hex", + "6000fc1e4ab90000000067acc2fc01582039000000002041d1fc00000000d08812d8b1c0679212d8b1c066f4608a72ff6000ff564fefffec" + ], + [ + "stock", + "0x4002c31c", + 8 + ], + [ + "hex", + "223900000000226f001cb282620001282002908141f9000000004c5000014c5000004a8166000110727fb2806500010822004ab900000000676ad3f9000000002039000000002049d089b08867124a1867f87991764bb684676452b900000000161178ffb881671e7183744bb480670293c94cd7041c2f49001c2f41" + ], + [ + "stock", + "0x400d95fc", + 8 + ], + [ + "hex", + "fbec7383784bb881673641f900000000b490671641e80158b1fc0000000066f04cd7041c4fef00144e75429041e80158b1fc0000000066d860e676ffb68166ae428141f90000000041e80158b4a8fea8676652817608b68166ee73b900000000760745f900000000204152882808c88341ef00132f440010283c000001584c014800c2fc015813d000000000258248002041d1fc000000004ab900000000678010d9b0896700ff7a10d9b08966f26000ff7072ff6000fef8c2fc01582041d1fc000000004ab90000000066d46000ff524fefffe8226f001c207900000000" + ], + [ + "stock", + "0x40036bb0", + 8 + ], + [ + "hex", + "b1c96200011c2009908845f9000000004c5200014c5200004a8166000104727fb280650000fc2200b1c2620000fa2002908845f9000000004c5200034c5200004a83660000e2767fb680650000da4ab900000000670000b2b489670000ac4879000000002f00" + ], + [ + "stock", + "0x401219e6", + 8 + ], + [ + "hex", + "4ebafa06508f70ff222f001041f900000000226f000cb08167144cd7040c2f4800202f41001c4fef00186000fa6c45f9000000002f4a0014428045f90000000045ea0158b3eafea8675a52807208b28066ee71b9000000007407246f001422005281c282243c000001584c002800c0fc01582589280013c1000000002240d3fc000000004ab900000000670e203900000000d08812d8b08866fa" + ], + [ + "stock", + "0x40036bf0", + 10 + ], + [ + "hex", + "c0fc01582240d3fc0000000060d272ff6000ff044ab90000000067dab48967d645f90000000042802f4a0014204a41e80158b4a8fea8673252807608b68066ee52814a8166b0b3d2671045ea0158b5fc0000000067a0b3d266f0429245ea0158b5fc0000000066ee608cc0fc0158204070ffd1fc00000000b0816700ff184cd7040c2f4800202f41001c4fef00186000f9640000" + ], + [ + "stock", + "0x40001894", + 10 + ], + [ + "hex", + "242f0014245020522068000c4e90d4804a826d3a205220280008b4806d04240053822068000c4e90b082670c2052" + ], + [ + "stock", + "0x40030ac4", + 8 + ], + [ + "hex", + "588f246a0004" + ], + [ + "stock", + "0x400967b6", + 14 + ], + [ + "hex", + "00000000428260c2" + ], + [ + "stock", + "0x4001b00e", + 10 + ], + [ + "stock", + "0x4008a378", + 8 + ], + [ + "hex", + "b0a800086504245f4e75206800042f300c00" + ], + [ + "stock", + "0x4008d948", + 10 + ], + [ + "hex", + "00285480" + ], + [ + "stock", + "0x400bd54a", + 8 + ], + [ + "hex", + "00132f084879000000002f2f002c4eb900000000" + ], + [ + "stock", + "0x40125d5c", + 8 + ], + [ + "hex", + "487800084eb900000000588f4a80670a206f00084aa8000866024e75222f0004204020af0008214100042f004879000000002f014eb900000000" + ], + [ + "stock", + "0x400120b4", + 8 + ], + [ + "hex", + "0000102120423063408450a560c670e781089129a14ab16bc18cd1ade1cef1ef123102103273225252b5429472f762d693398318b37ba35ad3bdc39cf3ffe3de246234430420140164e674c744a45485a56ab54b85289509e5eef5cfc5acd58d365326721611063076d766f6569546b4b75ba77a97198738f7dfe7fed79dc7bc48c458e5688678a70840186128023823c9ccd9ede98ef9af89489969a90ab92b5af54ad47ab76a961a710a503a332a12dbfdcbdcfbbfeb9e9b798b58bb3bab1a6ca67c874ce45cc52c223c030c601c41edaefd8fcdecddcdad2abd0b8d689d497e976eb65ed54ef43e132e321e510e70ff9fefbedfddcffcbf1baf3a9f598f78918881a9b1caa1ebd10cc12df14ee16f108000a130c220e3500440257046606783b99398a3fbb3dac33dd31ce37ff35e02b1129022f332d24235521462777256b5eaa5cb95a88589f56ee54fd52cc50d34e224c314a004817466644754244405a7dbb7fa879997b8e75ff77ec71dd73c26d336f2069116b06657767646155634d94cc96df90ee92f99c889e9b98aa9ab584448657806682718c008e1388228a3cb7ddb5ceb3ffb1e8bf99bd8abbbbb9a4a755a546a377a160af11ad02ab33a92fd2eed0fdd6ccd4dbdaaad8b9de88dc97c266c075c644c453ca22c831ce00cc1ef1fff3ecf5ddf7caf9bbfba8fd99ff86e177e364e555e742e933eb20ed11ef000000000000000000000000000000000" + ] + ] + }, + ".bss": { + "align": 4, + "size": 3120 + } + }, + "symbols": { + "FRAME_STRIDE": [ + "abs", + 101 + ], + "LEDS_CLEAR": [ + "abs", + 1073923014 + ], + "MODS_STOCK": [ + "abs", + 1074639760 + ], + "PATTERN_OBJ": [ + "abs", + 1147439312 + ], + "KIT_ROOM": [ + "abs", + 337 + ], + "KIT_PAD": [ + "abs", + 10415 + ], + "KIT_SIZE": [ + "abs", + 23921 + ], + "FW_KITS": [ + "abs", + 1108398220 + ], + "MEMCPY": [ + "abs", + 1075005296 + ], + "FW_STR_NEW": [ + "abs", + 1075636920 + ], + "FW_LED_SET": [ + "abs", + 1073922840 + ], + "FW_INVALIDATE": [ + "abs", + 1074907802 + ], + "FW_FONT_MENU": [ + "abs", + 1076446992 + ], + "FW_TEXTBOX": [ + "abs", + 1074878792 + ], + "VBR_FN": [ + "abs", + 1073748400 + ], + "NO_DTIM0": [ + "abs", + 1 + ], + "SETTINGS_RET": [ + "abs", + 1074397070 + ], + "FN_MGR": [ + "abs", + 1075371582 + ], + "MENU_ADD": [ + "abs", + 1074883566 + ], + "ITEM_CTOR": [ + "abs", + 1074885560 + ], + "OP_NEW": [ + "abs", + 1074922820 + ], + "ENCDISP": [ + "abs", + 1073923420 + ], + "KEYDISP": [ + "abs", + 1073923528 + ], + "DRAWALL": [ + "abs", + 1074910730 + ], + "dispatch": [ + ".run", + 132 + ], + "layout": [ + ".run", + 872 + ], + "layout_known": [ + ".bss", + 3114 + ], + "layout_id": [ + ".bss", + 3116 + ], + "pack": [ + ".run", + 1044 + ], + "unpack": [ + ".run", + 1188 + ], + "shadow": [ + ".bss", + 362 + ], + "shadow_next": [ + ".bss", + 360 + ], + "tmp.0": [ + ".bss", + 20 + ], + "select": [ + ".run", + 2884 + ], + "change": [ + ".run", + 2886 + ], + "draw": [ + ".run", + 2976 + ], + "callbacks": [ + ".run", + 3640 + ], + "core_projdata_load": [ + ".run", + 1584 + ], + "core_draw": [ + ".run", + 36 + ], + "core_zero": [ + ".bss", + 0 + ], + "core_memcpy": [ + ".run", + 626 + ], + "core_store_layout": [ + ".run", + 514 + ], + "core_key": [ + ".run", + 84 + ], + "fw_led_set": [ + "abs", + 1073922840 + ], + "core_kit_on": [ + ".run", + 1830 + ], + "fw_invalidate": [ + "abs", + 1074907802 + ], + "core_value_label": [ + ".run", + 826 + ], + "boot": [ + ".boot", + 0 + ], + "core_kit_load": [ + ".run", + 554 + ], + "core_proj_save": [ + ".run", + 574 + ], + "core_addrow": [ + ".run", + 696 + ], + "core_kit_save": [ + ".run", + 534 + ], + "fw_font_menu": [ + "abs", + 1076446992 + ], + "core_store_conflicts": [ + ".bss", + 16 + ], + "fw_op_new": [ + "abs", + 1074922820 + ], + "fw_textbox": [ + "abs", + 1074878792 + ], + "core_tick": [ + ".run", + 0 + ], + "core_frame": [ + ".run", + 426 + ], + "core_enc": [ + ".run", + 108 + ], + "core_projdata_save": [ + ".run", + 1382 + ], + "core_addvalue": [ + ".run", + 3062 + ], + "core_settings": [ + ".run", + 156 + ], + "core_kit_copied": [ + ".run", + 2440 + ], + "core_key_leds": [ + ".run", + 470 + ], + "core_kitdata_room": [ + ".run", + 1820 + ], + "core_kitdata_load": [ + ".run", + 2088 + ], + "core_proj_load": [ + ".run", + 608 + ], + "core_personalize": [ + ".run", + 394 + ], + "core_kitdata_save": [ + ".run", + 1858 + ], + "core_additem": [ + ".run", + 192 + ] + }, + "exports": [ + "boot", + "core_additem", + "core_addrow", + "core_addvalue", + "core_draw", + "core_enc", + "core_frame", + "core_key", + "core_key_leds", + "core_kit_copied", + "core_kit_load", + "core_kit_on", + "core_kit_save", + "core_kitdata_load", + "core_kitdata_room", + "core_kitdata_save", + "core_memcpy", + "core_personalize", + "core_proj_load", + "core_proj_save", + "core_projdata_load", + "core_projdata_save", + "core_settings", + "core_store_conflicts", + "core_store_layout", + "core_tick", + "core_value_label", + "core_zero", + "fw_font_menu", + "fw_invalidate", + "fw_led_set", + "fw_op_new", + "fw_textbox" + ], + "imports": [ + "__bss_start", + "__bss_words", + "__run_load", + "__run_start", + "__run_words", + "core_kitdata", + "core_projdata", + "ev_draw", + "ev_enc", + "ev_frame_params", + "ev_key", + "ev_key_leds", + "ev_personalize", + "ev_settings", + "ev_tick" + ], + "weak": [], + "relocs": [ + [ + ".boot", + 2, + "abs32", + "sym:__run_load", + 0 + ], + [ + ".boot", + 8, + "abs32", + "sym:__run_start", + 0 + ], + [ + ".boot", + 14, + "abs32", + "sym:__run_words", + 0 + ], + [ + ".boot", + 26, + "abs32", + "sym:__bss_start", + 0 + ], + [ + ".boot", + 32, + "abs32", + "sym:__bss_words", + 0 + ], + [ + ".run", + 4, + "abs32", + "sym:ev_tick", + 0 + ], + [ + ".run", + 56, + "abs32", + "sym:ev_draw", + 0 + ], + [ + ".run", + 88, + "abs32", + "sym:ev_key", + 0 + ], + [ + ".run", + 112, + "abs32", + "sym:ev_enc", + 0 + ], + [ + ".run", + 160, + "abs32", + "sym:ev_settings", + 0 + ], + [ + ".run", + 396, + "abs32", + "sym:ev_personalize", + 0 + ], + [ + ".run", + 430, + "abs32", + "sym:ev_frame_params", + 0 + ], + [ + ".run", + 486, + "abs32", + "sym:ev_key_leds", + 0 + ], + [ + ".run", + 540, + "abs32", + "sec:.run", + 1858 + ], + [ + ".run", + 560, + "abs32", + "sec:.run", + 2088 + ], + [ + ".run", + 592, + "abs32", + "sec:.run", + 1382 + ], + [ + ".run", + 612, + "abs32", + "sec:.run", + 1584 + ], + [ + ".run", + 686, + "abs32", + "sec:.run", + 2440 + ], + [ + ".run", + 882, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 890, + "abs32", + "sec:.bss", + 3116 + ], + [ + ".run", + 906, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 918, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 972, + "abs32", + "sec:.run", + 3128 + ], + [ + ".run", + 1006, + "abs32", + "sec:.bss", + 3116 + ], + [ + ".run", + 1012, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 1032, + "abs32", + "sec:.bss", + 3116 + ], + [ + ".run", + 1038, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 1054, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1102, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1122, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1226, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1234, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1244, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1364, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1388, + "abs32", + "sym:core_projdata", + 0 + ], + [ + ".run", + 1456, + "abs32", + "sym:core_projdata", + 0 + ], + [ + ".run", + 1574, + "abs32", + "sec:.bss", + 16 + ], + [ + ".run", + 1636, + "abs32", + "sym:core_projdata", + 0 + ], + [ + ".run", + 1654, + "abs32", + "sym:core_projdata", + 0 + ], + [ + ".run", + 1808, + "abs32", + "sec:.bss", + 16 + ], + [ + ".run", + 1822, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1832, + "abs32", + "sec:.run", + 530 + ], + [ + ".run", + 1868, + "abs32", + "sec:.run", + 514 + ], + [ + ".run", + 1888, + "abs32", + "sec:.run", + 518 + ], + [ + ".run", + 1918, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 1926, + "abs32", + "sec:.run", + 522 + ], + [ + ".run", + 1932, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 1960, + "abs32", + "sec:.bss", + 16 + ], + [ + ".run", + 1978, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2004, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2042, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2054, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2062, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2102, + "abs32", + "sec:.run", + 514 + ], + [ + ".run", + 2122, + "abs32", + "sec:.run", + 518 + ], + [ + ".run", + 2152, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 2160, + "abs32", + "sec:.run", + 522 + ], + [ + ".run", + 2166, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2192, + "abs32", + "sec:.bss", + 16 + ], + [ + ".run", + 2244, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2258, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 2282, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 2300, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2324, + "abs32", + "sec:.bss", + 360 + ], + [ + ".run", + 2332, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2368, + "abs32", + "sec:.bss", + 360 + ], + [ + ".run", + 2380, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2386, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2424, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2430, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2450, + "abs32", + "sec:.run", + 514 + ], + [ + ".run", + 2474, + "abs32", + "sec:.run", + 518 + ], + [ + ".run", + 2514, + "abs32", + "sec:.run", + 518 + ], + [ + ".run", + 2542, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 2558, + "abs32", + "sec:.bss", + 20 + ], + [ + ".run", + 2586, + "abs32", + "sec:.bss", + 20 + ], + [ + ".run", + 2620, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2632, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2656, + "abs32", + "sec:.bss", + 360 + ], + [ + ".run", + 2692, + "abs32", + "sec:.bss", + 360 + ], + [ + ".run", + 2700, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2706, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2714, + "abs32", + "sec:.run", + 526 + ], + [ + ".run", + 2744, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2758, + "abs32", + "sym:core_kitdata", + 0 + ], + [ + ".run", + 2770, + "abs32", + "sec:.bss", + 362 + ], + [ + ".run", + 2816, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 2834, + "abs32", + "sec:.bss", + 3114 + ], + [ + ".run", + 2852, + "abs32", + "sec:.bss", + 366 + ], + [ + ".run", + 2968, + "abs32", + "abs", + 1074907802 + ], + [ + ".run", + 3040, + "abs32", + "abs", + 1076446992 + ], + [ + ".run", + 3050, + "abs32", + "abs", + 1074878792 + ], + [ + ".run", + 3068, + "abs32", + "abs", + 1074922820 + ], + [ + ".run", + 3108, + "abs32", + "sec:.run", + 3640 + ], + [ + ".run", + 3116, + "abs32", + "sec:.run", + 696 + ], + [ + ".run", + 3640, + "abs32", + "sec:.run", + 826 + ], + [ + ".run", + 3644, + "abs32", + "sec:.run", + 2884 + ], + [ + ".run", + 3648, + "abs32", + "sec:.run", + 2976 + ], + [ + ".run", + 3652, + "abs32", + "sec:.run", + 2886 + ] + ], + "sites": [ + { + "addr": "0x40000538", + "len": 6, + "stock_sha256": "f0c5fc0afd892b3ec3f8803e1d875a2a22c6bb4e2cb987adc582cf8dea48c28a", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:boot", + 0 + ] + ] + }, + { + "addr": "0x4002e464", + "len": 6, + "stock_sha256": "8abc5b3d8941b94f9ec93c348112bcaf09510582ab72977a407b9ce1e213a459", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_tick", + 0 + ] + ] + }, + { + "addr": "0x4002e4ca", + "len": 6, + "stock_sha256": "51e3665db347990c1500cab5b2766706e47605e08a3a01c721fc1958f75c27ab", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_draw", + 0 + ] + ] + }, + { + "addr": "0x4002f20c", + "len": 6, + "stock_sha256": "d1e1f5dd2afbbcebc50c89fdcf5fd704a0a26f28becdcada110ab0c2d14626fc", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_key", + 0 + ] + ] + }, + { + "addr": "0x4002f256", + "len": 6, + "stock_sha256": "786bc53e108e78a53f3bfc32fc57bd91569f6702c55a9566747386c873b91d4a", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_enc", + 0 + ] + ] + }, + { + "addr": "0x4009ff88", + "len": 6, + "stock_sha256": "c7589861366d298dd3e07f1f5ebce25db0435f9cad638eae321d68e7542f6c74", + "new": "4ef900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_settings", + 0 + ] + ] + }, + { + "addr": "0x400987a2", + "len": 6, + "stock_sha256": "10552f30e94896a18c635b43b0f16452187a5e3db5b661ba3255c1ecb054fd50", + "new": "4ef900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_personalize", + 0 + ] + ] + }, + { + "addr": "0x40027196", + "len": 6, + "stock_sha256": "8f4626d425f213c0f0f9f81054e40a51bad034eaa6b154d51fe969ae4a521a8d", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_frame", + 0 + ] + ] + }, + { + "addr": "0x4002c87a", + "len": 6, + "stock_sha256": "3988e55cba5c51c557dcb530885eba6f789018b4345baccd49ebce731fd6f68e", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_key_leds", + 0 + ] + ] + }, + { + "addr": "0x400de0d4", + "len": 6, + "stock_sha256": "1a4f590b6150643d45e52f347f5e32771feeeb47a764c2337fc4d6faefdfeb8f", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_kit_save", + 0 + ] + ] + }, + { + "addr": "0x400ddddc", + "len": 6, + "stock_sha256": "1a4f590b6150643d45e52f347f5e32771feeeb47a764c2337fc4d6faefdfeb8f", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_kit_load", + 0 + ] + ] + }, + { + "addr": "0x400e18be", + "len": 6, + "stock_sha256": "be28bf581aa32f87a3306f04738f1dbdb4b28489865cd0d88145466f2740333c", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_proj_save", + 0 + ] + ] + }, + { + "addr": "0x400e1928", + "len": 6, + "stock_sha256": "39d8feaa0cf09fbdc868baea4e44be238666cbfcbf350883559c99085034a789", + "new": "4eb900000000", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_proj_load", + 0 + ] + ] + }, + { + "addr": "0x40134770", + "len": 12, + "stock_sha256": "a48eab821488cf202e892b5cad063488c972824e57c3d851ab402463dc0f5657", + "new": "4ef9000000004e714e714e71", + "kind": "code", + "relocs": [ + [ + 2, + "abs32", + "sym:core_memcpy", + 0 + ] + ] + } + ], + "collections": { + "ev_tick": { + "entry": 4 + }, + "ev_draw": { + "entry": 4 + }, + "ev_key": { + "entry": 4 + }, + "ev_enc": { + "entry": 4 + }, + "ev_settings": { + "entry": 4 + }, + "ev_personalize": { + "entry": 4 + }, + "ev_frame_params": { + "entry": 4 + }, + "ev_key_leds": { + "entry": 4 + }, + "core_projdata": { + "entry": 4 + }, + "core_kitdata": { + "entry": 4 + } + }, + "contribute": [], + "copied": [], + "resources": {}, + "requires": [], + "conflicts": [], + "build": { + "sources": { + "core.s": "dd0074e9b08a254838feae6215404e775ba7ef7aa2afbcce1e5c24794eebddc5", + "settings.s": "8fa715d46d6dbe239bed6d8d0ea4a0c3100c068b39869c938b402f2d6a15a380", + "personalize.s": "10372f64d233a1cc3c5abcb202084c3a8707e17e8d656038754c44a3e7554111", + "fw.s": "ae8bfc9a7f5778162be93fb1aa499e0ad1d7b515cbba52ba6b22b03588458cac", + "frame.s": "92fdd15abac49c2f802cd623af6a841327b3e32b53967795ade3188f46652c14", + "leds.s": "bbccdf836c4ef7cc27b78f8bbc3c3dcce10fa691e0d6a34b6a30c1d7d2375d87", + "store.s": "499d5ad2e71609075fd7461f6081504d91acf0c16aa77b267550af7ec417999b", + "store.c": "442ec9e88128519d5b446d1627b52ec05afdcefda564012734f5fa9430a4a5a4", + "rows.s": "00d971f3ba2372a08c209023edd45458a72ec3a73e56920fb440b82b7327ee4c", + "rows.c": "d6b5b85e86f38d9429c17a1b48ac4a77169583954c56b0707ce11c2821acc58e" + } + }, + "signature": null +} From 42071c377517e824a4256610349ea7c37525a743 Mon Sep 17 00:00:00 2001 From: Lukas Schmolz Date: Thu, 19 Nov 2026 22:51:40 +0100 Subject: [PATCH 004/105] Digitone II: the page builds the base alone for beta users The machine joins the site's builder machines as the Rytm's core build preview did, beta only (hasBetaUi), with an empty module folder and an SDK profile from the base that ran on a unit (owner, board, 19 November 2026). Downloads stay off; the kit-side tests register the carried device as the site's worker does. Co-Authored-By: Claude Opus 5.5 --- changelog/2026-11-19-digitone-ii-site-base.md | 1 + docs/MACHINE_RECIPE.md | 2 +- sdk/digitone-ii/core-profile/interface.json | 160 ++++++++++++++++++ sdk/digitone-ii/modules/README.md | 5 + sdk/machines/digitone-ii/GOAL.md | 4 +- sdk/machines/digitone-ii/elekloader/README.md | 2 +- sdk/machines/digitone-ii/machine.json | 39 ++++- src/App.tsx | 4 +- src/components/DigiBuildPanel.tsx | 2 +- src/components/LibraryDiscovery.test.ts | 2 +- src/components/LibraryResultsBar.test.ts | 2 +- src/components/UsbAudioConfigurator.test.ts | 2 +- src/components/faq-content.tsx | 4 +- src/components/recovery-faq.ts | 1 + src/devices/MachinePages.tsx | 10 +- src/devices/digi-mods.ts | 4 +- src/devices/library-parity.test.ts | 6 +- src/devices/machines.generated.json | 35 +++- src/engine/elekloader/digi-build.test.ts | 14 +- src/engine/elekloader/digi-build.ts | 4 +- src/engine/elekloader/engine.test.ts | 4 + src/engine/elekloader/machine-build.test.ts | 2 +- src/engine/elekloader/protocol.ts | 10 +- src/engine/elektron/ele3.ts | 4 +- src/engine/elektron/firmware.worker.ts | 2 +- src/engine/elektron/odd-jumps.test.ts | 4 + src/hooks/useDigiBuild.ts | 3 +- src/storage/device.ts | 6 +- src/tooling/elekloader-update.test.ts | 2 +- 29 files changed, 298 insertions(+), 42 deletions(-) create mode 100644 changelog/2026-11-19-digitone-ii-site-base.md create mode 100644 sdk/digitone-ii/core-profile/interface.json create mode 100644 sdk/digitone-ii/modules/README.md diff --git a/changelog/2026-11-19-digitone-ii-site-base.md b/changelog/2026-11-19-digitone-ii-site-base.md new file mode 100644 index 0000000000..32e8e91aa6 --- /dev/null +++ b/changelog/2026-11-19-digitone-ii-site-base.md @@ -0,0 +1 @@ +Digitone II: beta users can build Modwerk's Digitone II base on its machine page from their own OS 1.12 file, the base that ran on a unit. There are no modules yet, and downloads stay off until the owner turns them on. diff --git a/docs/MACHINE_RECIPE.md b/docs/MACHINE_RECIPE.md index ca9c6af8a9..cc5503e7b1 100644 --- a/docs/MACHINE_RECIPE.md +++ b/docs/MACHINE_RECIPE.md @@ -42,7 +42,7 @@ Read this before you plan a core, a base or the first modules for any machine ot | Analog Four MKII | research | elekloader core-a4 0.2 | not started | none known | as the Rytm: same platform | | Digitakt II | preview | Modwerk base from core-dt2 1.1's source (elekloader#221 at `0df8409`), with sequencer and project hooks | started: the site builds the [pinned base](../sdk/machines/digitakt-ii/elekloader/README.md) `8650bb8a` (`e88273ed`, which passed on one unit on 17 November 2026, with kit data ended before the project archive); downloads off. The USB link is not started (SysEx over USB MIDI, from the Rytm's) | digikit (emulator only) | the exact build on a second unit, then the USB link ([goal](../sdk/machines/digitakt-ii/GOAL.md)) | | Syntakt | research | Modwerk boot probe | not started | digiemu's port (open upstream pull request; emulator only) | the core stage, planned as the base | -| Digitone II | research | core-dn2 0.3, with the Digitakt II 1.1 additions, in toonst's elekloader fork: boots and its six UI events run on units (18 November 2026) | started: Modwerk's builder carries the device (`machine:base` and the site's kit), and `machine:base` builds a base from the Digitakt II's source at core-dn2 0.3's addresses (19 November 2026), which ran on a unit; the pinned kit packs Digitone II images over the unit's 2 MiB update limit | digikit (the author's; emulator only) | the Modwerk base, reusing the Digitakt II's with its own recipe as the Rytm MKI does, then flashing from the site and the link ([goal](../sdk/machines/digitone-ii/GOAL.md)) | +| Digitone II | research | core-dn2 0.3, with the Digitakt II 1.1 additions, in toonst's elekloader fork: boots and its six UI events run on units (18 November 2026) | started: Modwerk's builder carries the device (`machine:base` and the site's kit), and `machine:base` builds a base from the Digitakt II's source at core-dn2 0.3's addresses (19 November 2026), which ran on a unit and is bound (`base-binding.json`, the site's catalog); the page builds it for beta users, and Modwerk's packer keeps images under the unit's 2 MiB update limit | digikit (the author's; emulator only) | the Modwerk base, reusing the Digitakt II's with its own recipe as the Rytm MKI does, then flashing from the site and the link ([goal](../sdk/machines/digitone-ii/GOAL.md)) | | Analog Keys, Model:Cycles | research | none | not started | none known | the machine steps first ([add a machine](ADD_A_MACHINE.md)) | | Zoom MultiStomp | preview (MS-70CDR); research (MS-50G, MS-60B, G1on) | MIDISTOMP on the MS-70CDR; the MS-50G and MS-60B need builds from their own OS | the base builds in the browser and the MS-70CDR's page installs it over USB (Web MIDI); the page reads MIDISTOMP's SysEx hello and load once a release has them (MIDISTOMP PR #64); loading without a reboot is not built | Ziddle (emulator only) | [another ZDL pedal](ZOOM_MULTISTOMP.md#another-zdl-pedal), [plan](ZOOM_MULTISTOMP.md#plan) | | Zoom G1 FOUR | research | none: effects load on the stock OS | not started: zoom-zt2's file commands work over USB, the pedal page does not speak ZD2 yet | none known | [next steps](ZOOM_ZD2.md#next-steps) | diff --git a/sdk/digitone-ii/core-profile/interface.json b/sdk/digitone-ii/core-profile/interface.json new file mode 100644 index 0000000000..003f3d3950 --- /dev/null +++ b/sdk/digitone-ii/core-profile/interface.json @@ -0,0 +1,160 @@ +{ + "schemaVersion": 1, + "machine": "digitone-ii", + "interface": "1.1", + "status": "Modwerk's Digitone II base for OS 1.12: the Digitakt II base's core-dt2 1.1 source at the Digitone II's addresses (plain variant), selected by the SHA-256 in sdk/machines/digitone-ii/base-binding.json. No SRAM code area, no sequencer events and no project archive: those are the Digitakt II base's additions.", + "events": [ + { + "name": "ev_tick", + "when": "the UI compose check, approximately 30 Hz", + "handler": "void f(void *ctrl); set ctrl + 0x20 to 1 to request redraw; not an audio-rate clock" + }, + { + "name": "ev_draw", + "when": "after the OS composes the 128x64 screen", + "handler": "void f(void *bmp, void *ctrl)" + }, + { + "name": "ev_key", + "when": "a UI key event", + "handler": "int f(void *brain, void *event); nonzero consumes the event" + }, + { + "name": "ev_enc", + "when": "a UI encoder event", + "handler": "int f(void *brain, void *event); nonzero consumes the event" + }, + { + "name": "ev_settings", + "when": "building the SETTINGS menu", + "handler": "void f(void *menu)" + }, + { + "name": "ev_personalize", + "when": "building the PERSONALIZE menu", + "handler": "void f(void *menu)" + }, + { + "name": "ev_frame_params", + "since": "1.1", + "when": "once a frame, in the frame interrupt, before the stock modulators add their values", + "handler": "void f(int16_t *values, int stride); track t's value j at values[stride * t + j], stride 101; add to it, held in the parameter's range; the kit and the pages are untouched", + "site": { + "os": "1.12", + "address": "0x40027196", + "instructions": 1, + "sha256": "8f4626d425f213c0f0f9f81054e40a51bad034eaa6b154d51fe969ae4a521a8d" + }, + "order": "lower order first (shipped mods use 10-90); every handler sees the values the earlier ones left" + }, + { + "name": "ev_key_leds", + "since": "1.1", + "when": "every UI frame, after the frame clears the key LEDs and before the stock views set theirs (UI task)", + "handler": "void f(void *mgr); set an LED with fw_led_set(mgr, logical, 2, value); the first setter of an LED wins, so a handler's LED stays over the stock view's", + "site": { + "os": "1.12", + "address": "0x4002c87a", + "instructions": 2, + "sha256": "3988e55cba5c51c557dcb530885eba6f789018b4345baccd49ebce731fd6f68e" + }, + "order": "lower order first (shipped mods use 10-90); the first handler to set an LED keeps it" + } + ], + "tables": [ + { + "name": "core_projdata", + "since": "1.1", + "entry": 4, + "room": 4, + "purpose": "Pointers to core_projdata_t descriptors {tag[4], size, data, loaded}: each mod's block in the project file's header gap (+0x1c to +0x200), saved with every project save and loaded back. Reader: core's store (project save and load sites). A mod claims projdata:.", + "sites": [ + { + "os": "1.12", + "address": "0x400e18be", + "instructions": 1, + "sha256": "be28bf581aa32f87a3306f04738f1dbdb4b28489865cd0d88145466f2740333c", + "role": "project save" + }, + { + "os": "1.12", + "address": "0x400e1928", + "instructions": 1, + "sha256": "39d8feaa0cf09fbdc868baea4e44be238666cbfcbf350883559c99085034a789", + "role": "project load" + } + ] + }, + { + "name": "core_kitdata", + "since": "1.1", + "entry": 4, + "room": 4, + "purpose": "Pointers to core_kitdata_t descriptors {tag[4], size, data, changed}: each mod's block per kit (128 kits), after each kit record's end mark, saved with the project and SAVE KIT, loaded back and copied with the firmware's kit copies. All mods share 337 bytes a kit record (core_kitdata_room()); a block that does not fit is left out. Reader: core's store. A mod claims kitdata:.", + "sites": [ + { + "os": "1.12", + "address": "0x400de0d4", + "instructions": 1, + "sha256": "1a4f590b6150643d45e52f347f5e32771feeeb47a764c2337fc4d6faefdfeb8f", + "role": "kit save" + }, + { + "os": "1.12", + "address": "0x400ddddc", + "instructions": 1, + "sha256": "1a4f590b6150643d45e52f347f5e32771feeeb47a764c2337fc4d6faefdfeb8f", + "role": "kit load" + }, + { + "os": "1.12", + "address": "0x40134770", + "instructions": 3, + "sha256": "a48eab821488cf202e892b5cad063488c972824e57c3d851ab402463dc0f5657", + "role": "memcpy: follows kit copies in RAM (pattern copy and paste, PASTE KIT, undo)" + } + ] + } + ], + "exports": [ + { + "name": "core_additem", + "prototype": "void core_additem(menu, row)", + "purpose": "Add a SETTINGS or PERSONALIZE row from the corresponding event handler." + }, + { + "name": "core_addvalue", + "since": "1.1", + "prototype": "void core_addvalue(void *menu, const core_value_t *row)", + "purpose": "Add a PERSONALIZE or SETTINGS row that shows a label and, on the right as LED INTENSITY does, values[get()]; from ev_personalize or ev_settings." + }, + { + "name": "core_kit_on", + "since": "1.1", + "prototype": "int core_kit_on(void)", + "purpose": "The kit on (the pattern on's), -1 for none." + }, + { + "name": "core_kitdata_room", + "since": "1.1", + "prototype": "uint32_t core_kitdata_room(void)", + "purpose": "Bytes a kit record holds for the mods' blocks (337)." + }, + { + "name": "core_store_conflicts", + "since": "1.1", + "prototype": "volatile uint32_t core_store_conflicts", + "purpose": "How many times a save or a load met bytes in the mods' areas that are not core's; core left them as they were." + }, + { + "name": "fw_*", + "since": "1.1", + "prototype": "fw_led_set, fw_invalidate, fw_textbox, fw_font_menu, fw_op_new (the base's exports)", + "purpose": "Firmware locations at the Digitone II OS 1.12 addresses in sdk/machines/digitone-ii/elekloader/base.json's recipe. Use these from the UI task." + } + ], + "claims": [], + "memory": { + "area": "0x47f00000-0x47f40000" + } +} diff --git a/sdk/digitone-ii/modules/README.md b/sdk/digitone-ii/modules/README.md new file mode 100644 index 0000000000..ec5479bdd4 --- /dev/null +++ b/sdk/digitone-ii/modules/README.md @@ -0,0 +1,5 @@ +# Digitone II modules + +Each folder here will be a library module for Digitone II OS 1.12. There are none yet: the page builds Modwerk's base alone (beta), and how mods reach the musician is agreed with the owner with the first module (board, 19 November 2026). Downloads stay off until the owner turns them on. + +Create one with `npm run module:new -- my-mod --machine digitone-ii --author your-github-login`; see [the Digitone II goal](../../machines/digitone-ii/GOAL.md) and [base](../../machines/digitone-ii/elekloader/README.md). diff --git a/sdk/machines/digitone-ii/GOAL.md b/sdk/machines/digitone-ii/GOAL.md index 2a3f7f5a36..0d5b7c7258 100644 --- a/sdk/machines/digitone-ii/GOAL.md +++ b/sdk/machines/digitone-ii/GOAL.md @@ -14,8 +14,8 @@ This is the Octatrack's stack ([machine recipe](../../../docs/MACHINE_RECIPE.md) | --- | --- | --- | | Machine steps | Format, rebuild and boot done: modified OS 1.12 builds (toonst's core-dn2 0.3) booted on two units, and stock 1.12 restored them | [OS research](../../../docs/DIGITONE_II_OS_RESEARCH.md#step-3-on-a-unit) | | Build path | Started: Modwerk's linker (`LINK_DEVICES`, `ELE3_DEVICES`) knows OS 1.12 and links core-dn2 0.3 and 0.4, alone and with elekloader's examples, to the same main OS as elekloader, byte for byte. It takes the core's DSP bridge and refuses mods with DSP code. The pinned Elekloader kit stays as it is (owner, 19 November 2026): Modwerk's builder carries the device ([`device.json`](elekloader/device.json)), which `npm run machine:base` registers with the kit's Python SDK and the site with the browser kit; both read stock 1.12 and rewrite it, sealed, byte for byte. What is left is the base itself | [`elemod.ts`](../../../src/engine/elektron/elemod.ts), [`machine-base.py`](../../../scripts/machine-base.py), [`carried-devices.ts`](../../../src/engine/elekloader/carried-devices.ts) | -| Base | Started: the Digitakt II base's core-dt2 1.1 source at core-dn2 0.3's Digitone II addresses, with copies of three files; `npm run machine:base` builds it. It ran on a unit with its hooks, and a project kept a change across a power cycle ([19 November 2026](../../../docs/verification/2026-11-19-digitone-ii-base-on-a-unit.md)), packed by Elekloader 0.11: images the pinned kit packs exceed the unit's 2 MiB update limit and are refused at 99 % | [`elekloader/`](elekloader/README.md) | -| Flashing from the site | Started: the unit refuses an upgrade over about 2 MiB decoded (`update_max` in [`device.json`](elekloader/device.json)), so `fitUpdate` packs a larger build's main OS again with Modwerk's optimal packer, under the limit, and refuses one that still does not fit. Not wired into the page yet; today the owner sends a `.syx` with Elektron Transfer | [`fit-update.ts`](../../../src/engine/elekloader/fit-update.ts); the MS-70CDR's [`ZoomBaseDialog.tsx`](../../../src/components/ZoomBaseDialog.tsx) in [`BaseDialogFrame.tsx`](../../../src/components/BaseDialogFrame.tsx) | +| Base | Started: the Digitakt II base's core-dt2 1.1 source at core-dn2 0.3's Digitone II addresses, with copies of three files; `npm run machine:base` builds it. It ran on a unit with its hooks, and a project kept a change across a power cycle ([19 November 2026](../../../docs/verification/2026-11-19-digitone-ii-base-on-a-unit.md)), and about five hours of playing. `base-binding.json` records that identity (`7a60d82e`), its package is in the site's catalog, and the machine's SDK profile ([`core-profile`](../../digitone-ii/core-profile/interface.json), budgets) describes it. Modwerk's packer keeps its images under the unit's 2 MiB update limit | [`elekloader/`](elekloader/README.md) | +| Flashing from the site | Started: the unit refuses an upgrade over about 2 MiB decoded (`update_max` in [`device.json`](elekloader/device.json)), so `fitUpdate` packs a larger build's main OS again with Modwerk's optimal packer, under the limit, and refuses one that still does not fit. The machine page builds the base alone for beta users (a core build preview, no module yet; downloads off until the owner turns them on); the OS upgrade over USB MIDI (`os-upgrade.ts`) ran on a unit and is not on the page yet. Today the owner sends a `.syx` with Elektron Transfer | [`fit-update.ts`](../../../src/engine/elekloader/fit-update.ts); the MS-70CDR's [`ZoomBaseDialog.tsx`](../../../src/components/ZoomBaseDialog.tsx) in [`BaseDialogFrame.tsx`](../../../src/components/BaseDialogFrame.tsx) | | USB link and diagnostics | Not started | the Rytm's [link](../analog-rytm-mkii/LINK.md), the Octatrack's [`diag.c`](../octatrack/elekloader/diag.c) and [`device-log.ts`](../../../src/engine/elekloader/device-log.ts) | | Loading without a reflash | Not started | [porting the runtime loader](../../runtime/loader/README.md#porting-to-another-machine) | | Base updates over USB | Not started | [two-slot base](../../../docs/OCTATRACK_TWO_SLOT_BASE.md) | diff --git a/sdk/machines/digitone-ii/elekloader/README.md b/sdk/machines/digitone-ii/elekloader/README.md index 1632347f20..235ced38c7 100644 --- a/sdk/machines/digitone-ii/elekloader/README.md +++ b/sdk/machines/digitone-ii/elekloader/README.md @@ -30,6 +30,6 @@ that brings DSP code. npm run machine:base -- digitone-ii --stock /private/Digitone_II_OS1.12.syx ``` -There is no `base-binding.json` until this exact build has run on a unit; then `--write` records its identity. +It matches [`base-binding.json`](../base-binding.json), the identity that ran on a unit; a deliberate change records a new one with `--write` once that build has run on a unit. The site builds the same package from its catalog (`sdk/imports/elekloader-modwerk-base-digitone-ii-2026-11-19.json`). GPL-2.0-or-later, as core-dt2 (irpina); the copies say what they change. diff --git a/sdk/machines/digitone-ii/machine.json b/sdk/machines/digitone-ii/machine.json index 35df935cde..adb9a2932f 100644 --- a/sdk/machines/digitone-ii/machine.json +++ b/sdk/machines/digitone-ii/machine.json @@ -17,7 +17,7 @@ ] } ], - "flash": "Normal OS updates use Elektron Transfer with the owner's own stock OS file. Modwerk has no Digitone II build path yet and downloads stay disabled.", + "flash": "Normal OS updates use Elektron Transfer with the owner's own stock OS file. The page builds Modwerk's Digitone II base alone from that file (beta); downloads stay disabled until the owner turns them on.", "recovery": "Hold FUNC while powering on, choose TRIG 4 (OS UPGRADE), then send the owner's stock .syx over MIDI DIN; recovery mode does not use USB. Checked on toonst's unit with stock 1.12 (23 October 2026, elekloader's build guide); on a second unit only the normal Transfer update back to stock 1.12 was tried (18 November 2026)." }, "steps": { @@ -27,6 +27,9 @@ "core": "started", "mods": "open" }, + "stack": { + "base": "started" + }, "research": [ { "label": "Digitone II OS research", @@ -49,12 +52,40 @@ "note": "prodbysmolec's unit: stock 1.12 with core-dn2 0.3 and hello-marker, then hooks-check-dn2, built with toonst's elekloader at 3d7c2e3 and flashed with Transfer; boot, normal playback, all six UI events and the return to stock 1.12 observed." } ], + "sdk": { + "platform": "elemod", + "modules": "sdk/digitone-ii/modules", + "catalog": null, + "guide": "sdk/machines/digitone-ii/GOAL.md", + "core": { + "version": "1.1", + "path": "sdk/digitone-ii/core-profile" + }, + "toolchain": "m68k-elf GCC and binutils and the pinned Elekloader kit with the device Modwerk's builder carries; builds start from the owner's exact OS 1.12 .syx.", + "budgets": [ + { + "name": "Shared mod memory", + "unit": "bytes", + "value": 262144, + "note": "Digitone II DDR region 0x47F00000–0x47F40000, shared by the base and linked mods." + }, + { + "name": "Core image", + "unit": "bytes", + "value": 6776, + "note": "Pinned Modwerk base: 3,656 bytes .run plus 3,120 bytes .bss. The linker measures each selected set." + }, + { + "name": "Per-event subscriptions", + "unit": "slots", + "value": 4, + "note": "The Modwerk base allocates four hook entries per shared event collection." + } + ] + }, "art": { "body": "compact", "encoders": 8, "trigs": 16 - }, - "stack": { - "base": "started" } } diff --git a/src/App.tsx b/src/App.tsx index 688dff0888..d7291b470a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -293,7 +293,7 @@ export default function App() { const allMachines = allRoute || overviewRoute || (!machineView && !octatrackRoute && remembered === ALL_MACHINES) const currentDevice = DEVICES_BY_ID[zoomHub ? zoomHub.device.id : machineView ? machineRoute!.device.id : octatrackRoute ? 'octatrack' : remembered && remembered !== ALL_MACHINES ? remembered : 'octatrack'] const machineHasMods = !allMachines && (currentDevice.status === 'available' || currentDevice.status === 'preview') - const machineBuildPreview = !allMachines && isCoreBuildPreview(currentDevice.id) && currentDevice.status === 'research' && !!currentDevice.sdk + const machineBuildPreview = !allMachines && isCoreBuildPreview(currentDevice.id, betaUi) && currentDevice.status === 'research' && !!currentDevice.sdk const machineCanConfigure = machineHasMods || machineBuildPreview // The overview shows All machines too, so the forum and other machine-less pages after it don't fall back to an older machine. useEffect(() => { if (allRoute || overviewRoute) rememberDevice(ALL_MACHINES); else if (machineView || octatrackRoute) rememberDevice(currentDevice.id) }, [allRoute, overviewRoute, machineView, octatrackRoute, currentDevice.id]) @@ -685,7 +685,7 @@ export default function App() { {(configuration || machineView === 'configuration' || route.startsWith('module-set')) && } }> {projectsRoute ? : faqRoute ? : route === 'credits' ? : route === 'base' ? : overviewRoute ? : !ready ?
Opening your workspace…
: <> - {onLibrary ? setQuery('')} onBrowse={rememberBrowse} device={allMachines ? undefined : currentDevice} machinePicker={phoneLayout ? undefined : machinePicker} phone={phoneLayout} resultsSlot={resultsSlot} query={query} category={libraryCategory as ModuleCategory | undefined} octatrackModules={visibleModules} family={family} onFamilyChange={setFamily} sort={sort} onSortChange={setSort} statistics={statistics} octatrackBlocks={addBlockMap} onSwapOctatrack={swapModule} comparison={comparison} onCompare={toggleComparison} onOpenComparison={() => setCompareOpen(true)} viewedModuleVersions={viewedModuleVersions} moduleBaseline={moduleBaseline} octatrackSelected={selectedIds} onToggleOctatrack={toggleModule} digiSelected={digiSelected} onToggleDigi={(device, id) => workspace.toggleModule(id, device)} zoomSelected={zoomSelected} onToggleZoom={(device, id) => workspace.toggleModule(id, device)} onClearSearch={() => { setQuery(''); setFamily('all') }}> + {onLibrary ? setQuery('')} onBrowse={rememberBrowse} device={allMachines ? undefined : currentDevice} machinePicker={phoneLayout ? undefined : machinePicker} phone={phoneLayout} resultsSlot={resultsSlot} query={query} category={libraryCategory as ModuleCategory | undefined} octatrackModules={visibleModules} family={family} onFamilyChange={setFamily} sort={sort} onSortChange={setSort} statistics={statistics} octatrackBlocks={addBlockMap} onSwapOctatrack={swapModule} comparison={comparison} onCompare={toggleComparison} onOpenComparison={() => setCompareOpen(true)} viewedModuleVersions={viewedModuleVersions} moduleBaseline={moduleBaseline} octatrackSelected={selectedIds} onToggleOctatrack={toggleModule} digiSelected={digiSelected} onToggleDigi={(device, id) => workspace.toggleModule(id, device)} zoomSelected={zoomSelected} onToggleZoom={(device, id) => workspace.toggleModule(id, device)} onClearSearch={() => { setQuery(''); setFamily('all') }}> {!allMachines && currentDevice.id === 'octatrack' && !!catalog.filter((item,index,items)=>!MODULES.some(module=>module.id===item.module_id)&&items.findIndex(other=>other.module_id===item.module_id)===index).length &&

Community modules

{catalog.filter((item,index,items)=>!MODULES.some(module=>module.id===item.module_id)&&items.findIndex(other=>other.module_id===item.module_id)===index).sort((a,b)=>compareModules({id:a.module_id,name:a.title,authorName:a.author,addedAt:a.added_at??undefined,updatedAt:a.updated_at??undefined},{id:b.module_id,name:b.title,authorName:b.author,addedAt:b.added_at??undefined,updatedAt:b.updated_at??undefined},sort,statistics)).map(item=>)}
}
: digiDevice && digiMod ? toggleMachineModule(digiMod.id)} /> : zoomEffect ? toggleMachineModule(zoomEffect.id)} /> : digiDevice && machineView === 'configuration' ? machineActive && setReportingConfiguration({ machine: digiDevice.id, id: machineActive.id })} device={digiDevice} configuration={machineActive} configurations={machineConfigurations} onSelect={id => { workspace.selectConfiguration(id) }} onDialog={setConfigDialog} onToggle={toggleMachineModule} onImport={item => workspace.importConfiguration(item.name,item.moduleIds,false,item.moduleVersions,digiDevice.id,undefined,undefined,undefined,item.storageLock)} onStorageLock={workspace.saveStorageLock} /> : missingRoute?

{pausedModule ? 'Module temporarily unavailable' : 'Page not found'}

{pausedModule ? pausedModule.name + ' is temporarily unavailable.' : 'This module or page is not in the current catalog.'}

Open module library
:zoomHub? setZoomInstall(true)} {...isZoomSetDevice(zoomHub.device.id) ? { sets: configurationsFor(zoomHub.device.id), selectedId: activeFor(zoomHub.device.id)?.id, onSelect: (id: string) => { workspace.selectConfiguration(id); window.location.assign(zoomHubHref(zoomHub.device.id, 'set')) }, onNew: () => newConfiguration(zoomHub.device.id), onSetAction: setAction, onToggle: (effect: string) => workspace.toggleModule(effect, zoomHub.device.id) } : {}} />:hubRoute?hubPage:route==='module-sets'||route.startsWith('module-set/')?(octatrackUi ? {workspace.importConfiguration(name,ids);window.location.assign('#configuration')}}/> : {workspace.importConfiguration(name,ids);window.location.assign('#configuration')}}/>):forumRoute ? {const device=config.device??'octatrack';workspace.importConfiguration(config.name,config.moduleIds,config.keepStockFx2,config.moduleVersions,device,config.usbAudio);openEditedSet(device)}}/> : developerRoute ? : accountRoute ? betaInvitationRoute ? : : route === 'privacy' ? : ['impressum','community-rules','modding-guidelines','report-content'].includes(route) ? : route.startsWith('submit') ? : route === 'review'||route === 'admin' ? : communityModule ? : detailModule ? swapModule(detailModule.id, removeIds)} usbAudio={active?.usbAudio} configurationName={active?.name} configurationId={active?.id} onConfigureUsbAudio={configureUsbAudio} onToggle={() => toggleModule(detailModule.id)} /> : null} diff --git a/src/components/DigiBuildPanel.tsx b/src/components/DigiBuildPanel.tsx index 31bf797f8e..9ecb010fe3 100644 --- a/src/components/DigiBuildPanel.tsx +++ b/src/components/DigiBuildPanel.tsx @@ -83,7 +83,7 @@ export function DigiBuildPanel({ device, firmware, moduleIds, storage, onExport, {result && downloadsEnabled && setRecoveryKnown(checked ? result.sha256 : '')}/>}
- {busy ? : result && downloadsEnabled ? : null} + {busy ? : result && downloadsEnabled ? : null} {!busy && (state.phase === 'ready' || state.phase === 'failed' || state.phase === 'built' ? : )} diff --git a/src/components/LibraryDiscovery.test.ts b/src/components/LibraryDiscovery.test.ts index 407afee447..27df4ae20c 100644 --- a/src/components/LibraryDiscovery.test.ts +++ b/src/components/LibraryDiscovery.test.ts @@ -27,7 +27,7 @@ const buttonNamed = (name: string) => [...document.querySelectorAll('button')].f const noop = () => {} const library = { query: '', octatrackModules: AVAILABLE_MODULES, octatrackSelected: [], onToggleOctatrack: noop, - digiSelected: { digitakt: [], 'digitakt-ii': [], digitone: [], 'analog-rytm-mkii': [] }, onToggleDigi: noop, + digiSelected: { digitakt: [], 'digitakt-ii': [], digitone: [], 'analog-rytm-mkii': [], 'digitone-ii': [] }, onToggleDigi: noop, family: 'all', onFamilyChange: noop, sort: 'updated', onSortChange: noop, statistics: null, comparison: [], onCompare: noop, onOpenComparison: noop, viewedModuleVersions: {}, moduleBaseline: null, diff --git a/src/components/LibraryResultsBar.test.ts b/src/components/LibraryResultsBar.test.ts index d45a5f3982..d751711811 100644 --- a/src/components/LibraryResultsBar.test.ts +++ b/src/components/LibraryResultsBar.test.ts @@ -35,7 +35,7 @@ describe('phone library results bar', () => { it('replaces the desktop filter row on phones', () => { const props = { - query: '', octatrackModules: AVAILABLE_MODULES, octatrackSelected: [], onToggleOctatrack: noop, digiSelected: { digitakt: [], 'digitakt-ii': [], digitone: [], 'analog-rytm-mkii': [] }, onToggleDigi: noop, + query: '', octatrackModules: AVAILABLE_MODULES, octatrackSelected: [], onToggleOctatrack: noop, digiSelected: { digitakt: [], 'digitakt-ii': [], digitone: [], 'analog-rytm-mkii': [], 'digitone-ii': [] }, onToggleDigi: noop, family: 'all', onFamilyChange: noop, sort: 'updated', onSortChange: noop, statistics: null, comparison: [], onCompare: noop, onOpenComparison: noop, viewedModuleVersions: {}, moduleBaseline: null, device: DEVICES_BY_ID.octatrack, } diff --git a/src/components/UsbAudioConfigurator.test.ts b/src/components/UsbAudioConfigurator.test.ts index 8404923393..29b0c71709 100644 --- a/src/components/UsbAudioConfigurator.test.ts +++ b/src/components/UsbAudioConfigurator.test.ts @@ -22,7 +22,7 @@ describe('USB Audio setup before adding', () => { it('offers configuration instead of quick-add from the library and comparison', () => { expect(card()).toContain('aria-label="Configure USB Audio"') expect(card()).not.toContain('aria-label="Add USB Audio to configuration"') - const comparison = render(createElement(ModuleComparison, { ids: [USB_AUDIO_MODULE], selected: [], digiSelected: { digitakt: [], 'digitakt-ii': [], digitone: [], 'analog-rytm-mkii': [] }, onToggle: noop, onToggleDigi: noop, onClose: noop })) + const comparison = render(createElement(ModuleComparison, { ids: [USB_AUDIO_MODULE], selected: [], digiSelected: { digitakt: [], 'digitakt-ii': [], digitone: [], 'analog-rytm-mkii': [], 'digitone-ii': [] }, onToggle: noop, onToggleDigi: noop, onClose: noop })) expect(comparison).toContain('>Configure USB Audio') expect(comparison).not.toContain('>Add USB Audio') }) diff --git a/src/components/faq-content.tsx b/src/components/faq-content.tsx index c26f377c13..2cba2d4d47 100644 --- a/src/components/faq-content.tsx +++ b/src/components/faq-content.tsx @@ -550,12 +550,12 @@ function syxMachine(machine: 'digi' | 'rytm'): FaqSection[] { { id: 'digi-recovery', title: `How do I recover a ${rytm ? 'Analog Rytm MKII' : 'Digitakt or Digitone'} that will not boot?`, - keywords: 'digitakt ii digitone keys analog rytm mkii recovery restore stock startup midi din sysex transfer usb failed boot brick func trig 4', + keywords: 'digitakt ii digitone ii keys analog rytm mkii recovery restore stock startup midi din sysex transfer usb failed boot brick func trig 4', answer: <>

While an update is running, keep the power on. If it has finished and the machine doesn’t start, install Elektron’s original OS from the startup menu:

  1. Connect a MIDI interface to the machine’s DIN MIDI ports. USB can’t carry this update: the startup menu never appears over USB.
  2. -
  3. {rytm ? <>Hold FUNC while you switch the machine on and choose OS UPGRADE (TRIG 4). : <>Open the startup menu and choose its OS upgrade, as your model’s manual describes. On a Digitakt II: hold FUNC while you switch it on, then choose OS UPGRADE (TRIG 4).}
  4. +
  5. {rytm ? <>Hold FUNC while you switch the machine on and choose OS UPGRADE (TRIG 4). : <>Open the startup menu and choose its OS upgrade, as your model’s manual describes. On a Digitakt II or Digitone II: hold FUNC while you switch it on, then choose OS UPGRADE (TRIG 4).}
  6. In Elektron Transfer, open SYSEX TRANSFER, choose OS upgrade via device startup menu and send the original .syx.

Recovery is not guaranteed. If the startup menu doesn’t appear or the original OS won’t install, contact Elektron support.

diff --git a/src/components/recovery-faq.ts b/src/components/recovery-faq.ts index 6a53d43ef8..7d5488b662 100644 --- a/src/components/recovery-faq.ts +++ b/src/components/recovery-faq.ts @@ -10,4 +10,5 @@ export const RECOVERY_FAQ: Record = { 'digitakt-ii': 'digi-recovery', digitone: 'digi-recovery', 'analog-rytm-mkii': 'digi-recovery', + 'digitone-ii': 'digi-recovery', } diff --git a/src/devices/MachinePages.tsx b/src/devices/MachinePages.tsx index 0e6cb6c544..1016bb6ccd 100644 --- a/src/devices/MachinePages.tsx +++ b/src/devices/MachinePages.tsx @@ -136,12 +136,14 @@ type AllMachinesLibraryProps = { // One mounted library keeps its machine picker, heading and controls in place while the collection changes. // On phones the machine picker sits in the category row and the results bar renders into resultsSlot, beneath it. type MachineLibraryProps = AllMachinesLibraryProps & { + /** Beta users also see the core build previews that are beta only (protocol.ts). */ + betaUi?: boolean; device?: DeviceProfile; children?: ReactNode; categoryNav?: ReactNode; onClearSearch?: () => void; onClearQuery?: () => void phone?: boolean; resultsSlot?: HTMLElement | null; octatrackCatalogue?: readonly FirmwareModule[] buildHref?: string; buildLabel?: string } -export function MachineLibrary({ device, query, category, octatrackModules: octatrack, octatrackSelected, onToggleOctatrack, digiSelected, onToggleDigi, zoomSelected = {}, onToggleZoom, family, onFamilyChange, sort, onSortChange, statistics, octatrackBlocks, onSwapOctatrack, comparison, onCompare, onOpenComparison, viewedModuleVersions, moduleBaseline, machinePicker, categoryNav, children, onClearSearch, onClearQuery, onBrowse, phone = false, resultsSlot, octatrackCatalogue = AVAILABLE_MODULES, buildHref, buildLabel }: MachineLibraryProps) { +export function MachineLibrary({ device, query, category, octatrackModules: octatrack, octatrackSelected, onToggleOctatrack, digiSelected, onToggleDigi, zoomSelected = {}, onToggleZoom, family, onFamilyChange, sort, onSortChange, statistics, octatrackBlocks, onSwapOctatrack, comparison, onCompare, onOpenComparison, viewedModuleVersions, moduleBaseline, machinePicker, categoryNav, children, onClearSearch, onClearQuery, onBrowse, phone = false, resultsSlot, octatrackCatalogue = AVAILABLE_MODULES, buildHref, buildLabel, betaUi = false }: MachineLibraryProps) { const w = useSetWords() const heading = useRef(null) const term = query.toLowerCase().trim() @@ -218,7 +220,7 @@ export function MachineLibrary({ device, query, category, octatrackModules: octa {device &&

{device.id === 'octatrack' ? 'This catalog follows an experimental build. Review each module before preparing a ' + w.set + '.' : 'Built from each author’s pinned public release, with credit and licence.'}

} {device && device.id !== 'octatrack' && } {!device &&
No mods yetHelp open the next machine
{DEVICES.filter(machine => machine.status === 'research' || machine.status === 'open').map(machine => {machine.name}{machine.variants && {machine.variants.join(' · ')}})}
} - : device && } + : device && } {!phone && projectLink}
} @@ -299,13 +301,13 @@ function StackLadder({ device }: { device: DeviceProfile }) { } // Machines without mods: the library page becomes an invitation to open the first one. -export function EmptyMachine({ device, machinePicker, embedded = false }: { device: DeviceProfile; machinePicker?: ReactNode; embedded?: boolean }) { +export function EmptyMachine({ device, machinePicker, embedded = false, betaUi = false }: { device: DeviceProfile; machinePicker?: ReactNode; embedded?: boolean; betaUi?: boolean }) { const repository = issueRepository(), mobile = useMobileWorkspace() const page = FAMILY_PAGE[device.family], ready = readyForMods(device), steps = deviceSteps(device) return (
{machinePicker &&
{machinePicker}
} - +

Be the first to mod the {device.name}

{page.invite} {ready ? DEVELOP_PITCH : page.unlock}

Road to the first mod

{stepsDone(device)} of {steps.length} done
diff --git a/src/devices/digi-mods.ts b/src/devices/digi-mods.ts index ad4a0bece3..eeffa9e403 100644 --- a/src/devices/digi-mods.ts +++ b/src/devices/digi-mods.ts @@ -9,7 +9,7 @@ import type { ElemodPlatform, ModwerkModule } from '../catalog/module-contract-v import { displayName, type ModuleContributor } from '../catalog/module-authors' import { moduleReleasedAt } from '../catalog/module-releases' -export type DigiMachine = 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' +export type DigiMachine = 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'digitone-ii' export type DigiMod = { id: string @@ -42,7 +42,7 @@ export type DigiMod = { // The Modwerk core is not built yet; until it is measured, the estimate reserves room for it. export const CORE_RESERVE_BYTES = 4096 const profile = (id: DigiMachine) => (MACHINES as MachineProfile[]).find(machine => machine.id === id)!.sdk! -export const DIGI_CORES: Record = Object.fromEntries((['digitakt', 'digitakt-ii', 'digitone', 'analog-rytm-mkii'] as const).map(id => { +export const DIGI_CORES: Record = Object.fromEntries((['digitakt', 'digitakt-ii', 'digitone', 'analog-rytm-mkii', 'digitone-ii'] as const).map(id => { const sdk = profile(id) return [id, { version: sdk.core?.version ?? '', ramBytes: sdk.budgets.find(budget => budget.name === 'Core image')?.value ?? CORE_RESERVE_BYTES, areaBytes: sdk.budgets.find(budget => budget.name === 'Shared mod memory')!.value, slots: sdk.budgets.filter(budget => budget.unit === 'slots').map(budget => budget.value + ' ' + budget.name.toLowerCase()).join(' · ') }] })) as Record diff --git a/src/devices/library-parity.test.ts b/src/devices/library-parity.test.ts index df035a37cf..db8cc092c1 100644 --- a/src/devices/library-parity.test.ts +++ b/src/devices/library-parity.test.ts @@ -18,13 +18,13 @@ const AllMachinesLibrary = MachineLibrary type DigiDevice = NonNullable[0]['device']> & { id: DigiMod['device'] } type DigiProps = { device: DigiDevice; selectedIds: string[]; onToggle: (id: string) => void } & Omit[0], 'device' | 'octatrackModules' | 'octatrackSelected' | 'onToggleOctatrack' | 'digiSelected' | 'onToggleDigi' | 'viewedModuleVersions' | 'moduleBaseline'> function DigiLibrary({ device, selectedIds, onToggle, ...rest }: DigiProps) { - return createElement(MachineLibrary, { ...rest, device, octatrackModules: [], octatrackSelected: [], onToggleOctatrack: noop, digiSelected: { digitakt: device.id === 'digitakt' ? selectedIds : [], 'digitakt-ii': device.id === 'digitakt-ii' ? selectedIds : [], digitone: device.id === 'digitone' ? selectedIds : [], 'analog-rytm-mkii': device.id === 'analog-rytm-mkii' ? selectedIds : [] }, onToggleDigi: (_: string, id: string) => onToggle(id), viewedModuleVersions: {}, moduleBaseline: null }) + return createElement(MachineLibrary, { ...rest, device, octatrackModules: [], octatrackSelected: [], onToggleOctatrack: noop, digiSelected: { digitakt: device.id === 'digitakt' ? selectedIds : [], 'digitakt-ii': device.id === 'digitakt-ii' ? selectedIds : [], digitone: device.id === 'digitone' ? selectedIds : [], 'analog-rytm-mkii': device.id === 'analog-rytm-mkii' ? selectedIds : [], 'digitone-ii': device.id === 'digitone-ii' ? selectedIds : [] }, onToggleDigi: (_: string, id: string) => onToggle(id), viewedModuleVersions: {}, moduleBaseline: null }) } // Likes and downloads show the number beside an icon; the word is there for screen readers only. const count = (value: string, word: string) => value + ' ' + word + '' const props = { query: '', octatrackModules: AVAILABLE_MODULES, octatrackSelected: ['miniverb'], - onToggleOctatrack: noop, digiSelected: { digitakt: [], 'digitakt-ii': [], digitone: [], 'analog-rytm-mkii': [] }, onToggleDigi: noop, + onToggleOctatrack: noop, digiSelected: { digitakt: [], 'digitakt-ii': [], digitone: [], 'analog-rytm-mkii': [], 'digitone-ii': [] }, onToggleDigi: noop, family: 'all', onFamilyChange: noop, sort: 'collection', onSortChange: noop, statistics: [{module_id: 'miniverb', average: 4.5, count: 2, likes: 7, downloads: 12, worksReports: 5, downloadsStarted: null}], comparison: ['miniverb'], onCompare: noop, onOpenComparison: noop, @@ -249,7 +249,7 @@ describe('Digi library parity', () => { const other = renderToStaticMarkup(createElement(DigiLibrary, {...digiProps, comparison: ['digitone-digihealth']})) expect(other).not.toContain('type="checkbox" checked=""') } - const dialog = renderToStaticMarkup(createElement(ModuleComparison, {ids:['digitakt-digihealth','digitone-digihealth'], selected: [], digiSelected:{digitakt:['digihealth'],'digitakt-ii':[],digitone:[],'analog-rytm-mkii':[]}, onToggle:noop,onToggleDigi:noop,onClose:noop})) + const dialog = renderToStaticMarkup(createElement(ModuleComparison, {ids:['digitakt-digihealth','digitone-digihealth'], selected: [], digiSelected:{digitakt:['digihealth'],'digitakt-ii':[],digitone:[],'analog-rytm-mkii':[],'digitone-ii':[]}, onToggle:noop,onToggleDigi:noop,onClose:noop})) expect(dialog).toContain('href="/digitakt/module/digihealth/"') expect(dialog).toContain('href="/digitone/module/digihealth/"') expect(dialog).toContain('aria-pressed="true"') diff --git a/src/devices/machines.generated.json b/src/devices/machines.generated.json index bd4dbd3425..8802f22769 100644 --- a/src/devices/machines.generated.json +++ b/src/devices/machines.generated.json @@ -404,7 +404,7 @@ ] } ], - "flash": "Normal OS updates use Elektron Transfer with the owner's own stock OS file. Modwerk has no Digitone II build path yet and downloads stay disabled.", + "flash": "Normal OS updates use Elektron Transfer with the owner's own stock OS file. The page builds Modwerk's Digitone II base alone from that file (beta); downloads stay disabled until the owner turns them on.", "recovery": "Hold FUNC while powering on, choose TRIG 4 (OS UPGRADE), then send the owner's stock .syx over MIDI DIN; recovery mode does not use USB. Checked on toonst's unit with stock 1.12 (23 October 2026, elekloader's build guide); on a second unit only the normal Transfer update back to stock 1.12 was tried (18 November 2026)." }, "research": [ @@ -428,7 +428,38 @@ "url": "https://github.com/repeat98/modwerk/blob/main/docs/verification/2026-11-18-digitone-ii-core-on-a-unit.md", "note": "prodbysmolec's unit: stock 1.12 with core-dn2 0.3 and hello-marker, then hooks-check-dn2, built with toonst's elekloader at 3d7c2e3 and flashed with Transfer; boot, normal playback, all six UI events and the return to stock 1.12 observed." } - ] + ], + "sdk": { + "platform": "elemod", + "modules": "sdk/digitone-ii/modules", + "catalog": null, + "guide": "sdk/machines/digitone-ii/GOAL.md", + "core": { + "version": "1.1", + "path": "sdk/digitone-ii/core-profile" + }, + "toolchain": "m68k-elf GCC and binutils and the pinned Elekloader kit with the device Modwerk's builder carries; builds start from the owner's exact OS 1.12 .syx.", + "budgets": [ + { + "name": "Shared mod memory", + "unit": "bytes", + "value": 262144, + "note": "Digitone II DDR region 0x47F00000–0x47F40000, shared by the base and linked mods." + }, + { + "name": "Core image", + "unit": "bytes", + "value": 6776, + "note": "Pinned Modwerk base: 3,656 bytes .run plus 3,120 bytes .bss. The linker measures each selected set." + }, + { + "name": "Per-event subscriptions", + "unit": "slots", + "value": 4, + "note": "The Modwerk base allocates four hook entries per shared event collection." + } + ] + } }, { "schemaVersion": 1, diff --git a/src/engine/elekloader/digi-build.test.ts b/src/engine/elekloader/digi-build.test.ts index d33a2c6ffd..59d049a902 100644 --- a/src/engine/elekloader/digi-build.test.ts +++ b/src/engine/elekloader/digi-build.test.ts @@ -3,10 +3,11 @@ import { DIGI_MODS } from '../../devices/digi-mods' import MACHINES from '../../devices/machines.generated.json' import { BUILDER_CATALOG, BUILDER_SOURCE, buildLogText, buildStep, builderReleases, planBuild, prepareBuild, type Builder } from './digi-build' import type { Catalog } from '../../../vendor/elekloader/kit/src/kit/catalog' -import { DIGI_DOWNLOADS_ENABLED, digiDownloadsEnabled } from './protocol' +import { DIGI_DOWNLOADS_ENABLED, digiDownloadsEnabled, isCoreBuildPreview } from './protocol' import { baseVariant, rytmVariant } from './machine-build' import DT2_BASE from '../../../sdk/machines/digitakt-ii/base-binding.json' import RYTM_BASE from '../../../sdk/machines/analog-rytm-mkii/base-binding.json' +import DN2_BASE from '../../../sdk/machines/digitone-ii/base-binding.json' const PLAIN = 'modwerk-base-analog-rytm-mkii-' + RYTM_BASE.variants.plain.slice(0, 8) + '.elemod' const SEND_BUS = 'modwerk-base-analog-rytm-mkii-' + RYTM_BASE.variants['send-bus'].slice(0, 8) + '.elemod' @@ -360,8 +361,9 @@ describe('the vendored elekloader catalog', () => { }) }) it('keeps download approval specific to each device', () => { - expect(DIGI_DOWNLOADS_ENABLED).toEqual({ digitakt: true, 'digitakt-ii': false, digitone: true, 'analog-rytm-mkii': true }) + expect(DIGI_DOWNLOADS_ENABLED).toEqual({ digitakt: true, 'digitakt-ii': false, digitone: true, 'analog-rytm-mkii': true, 'digitone-ii': false }) expect(digiDownloadsEnabled('digitakt-ii')).toBe(false) + expect(digiDownloadsEnabled('digitone-ii')).toBe(false) expect(digiDownloadsEnabled('analog-rytm-mkii')).toBe(true) expect(digiDownloadsEnabled('unknown-device')).toBe(false) expect(digiDownloadsEnabled('constructor')).toBe(false) @@ -450,3 +452,11 @@ describe('the build log', () => { expect(text.trimEnd().split('\n').at(-1)).toBe(' 0.01 s mod core 2.1 39 sites (file sha256 f38b0c193677a060)') }) }) + +describe('the Digitone II core build preview', () => { + it('is offered to beta users only, and builds on the base that ran on a unit', () => { + expect(isCoreBuildPreview('digitone-ii')).toBe(false) + expect(isCoreBuildPreview('digitone-ii', true)).toBe(true) + expect(planBuild('digitone-ii', '1.12', [])).toMatchObject({ core: { sha256: DN2_BASE.identity } }) + }) +}) diff --git a/src/engine/elekloader/digi-build.ts b/src/engine/elekloader/digi-build.ts index 61702040fb..c2b0a8bbb8 100644 --- a/src/engine/elekloader/digi-build.ts +++ b/src/engine/elekloader/digi-build.ts @@ -3,5 +3,5 @@ import { MACHINE_DEVICE } from './machine-build.ts' export { BUILDER_CATALOG, BUILDER_SOURCE, buildStep, buildLogText, builderReleases, planBuild, prepareBuild, createMachineBuilder as createDigiBuilder, type Builder, type PreparedBuild } from './machine-build.ts' -// The updater still imports only approved Digitakt/Digitone releases (and the Digitakt II and Analog Rytm MKII previews) until Octatrack ports qualify. -export const DEVICE = { digitakt: MACHINE_DEVICE.digitakt, 'digitakt-ii': MACHINE_DEVICE['digitakt-ii'], digitone: MACHINE_DEVICE.digitone, 'analog-rytm-mkii': MACHINE_DEVICE['analog-rytm-mkii'] } +// The updater still imports only approved Digitakt/Digitone releases (and the Digitakt II, Analog Rytm MKII and Digitone II previews) until Octatrack ports qualify. +export const DEVICE = { digitakt: MACHINE_DEVICE.digitakt, 'digitakt-ii': MACHINE_DEVICE['digitakt-ii'], digitone: MACHINE_DEVICE.digitone, 'analog-rytm-mkii': MACHINE_DEVICE['analog-rytm-mkii'], 'digitone-ii': MACHINE_DEVICE['digitone-ii'] } diff --git a/src/engine/elekloader/engine.test.ts b/src/engine/elekloader/engine.test.ts index edbd9b0985..8a9c017ad9 100644 --- a/src/engine/elekloader/engine.test.ts +++ b/src/engine/elekloader/engine.test.ts @@ -3,6 +3,10 @@ import { describe, expect, it } from 'vitest' import CATALOG from '../../../vendor/elekloader/catalog/catalog.json' import { createService } from '../../../vendor/elekloader/kit/src/kit/serve.ts' import type { Ready } from '../../../vendor/elekloader/kit/src/kit/protocol.ts' +import { carryDevices } from './carried-devices' + +// The site's worker registers the devices Modwerk's builder carries before it serves (kit-worker.ts); so does this. +carryDevices() // The kit's worker logic with the vendored catalog, its cores and mods served as Modwerk serves them under // elekloader/. No firmware: the stock-file side is covered by the recorded parity runs (docs/VERIFICATION.md). diff --git a/src/engine/elekloader/machine-build.test.ts b/src/engine/elekloader/machine-build.test.ts index f1542eadc1..25c15f1393 100644 --- a/src/engine/elekloader/machine-build.test.ts +++ b/src/engine/elekloader/machine-build.test.ts @@ -17,7 +17,7 @@ const localClient = () => { describe('one Elekloader builder for machine extensions', () => { it('uses the same device keys and fails closed until an Octatrack core is in the catalogue', async () => { - expect(MACHINE_DEVICE).toEqual({ octatrack: 'octatrack', digitakt: 'digitakt-mk1', 'digitakt-ii': 'digitakt-mk2', digitone: 'digitone-mk1', 'analog-rytm-mkii': 'analog-rytm-mk2' }) + expect(MACHINE_DEVICE).toEqual({ octatrack: 'octatrack', digitakt: 'digitakt-mk1', 'digitakt-ii': 'digitakt-mk2', digitone: 'digitone-mk1', 'analog-rytm-mkii': 'analog-rytm-mk2', 'digitone-ii': 'digitone-mk2' }) expect(planBuild('octatrack', '1.40C', ['repitch'])).toMatchObject({ core: undefined, missing: ['repitch'] }) const fake = client() await expect(prepareBuild(fake as unknown as Builder, { machine: 'octatrack', release: '1.40C', stock, moduleIds: [] })).resolves.toEqual({ ok: false, error: 'The catalog has no core for octatrack OS 1.40C.' }) diff --git a/src/engine/elekloader/protocol.ts b/src/engine/elekloader/protocol.ts index 4e61ee96eb..4947df9e54 100644 --- a/src/engine/elekloader/protocol.ts +++ b/src/engine/elekloader/protocol.ts @@ -5,7 +5,7 @@ export type { Device as BuilderDevice, Stock as BuilderStock, Mod as BuilderMod, Added as BuilderAdded, Check as BuilderCheck, VersionField as BuilderVersion, Output as BuilderFile, Log as BuilderLog, BuildResult as BuilderResult, } from '../../../vendor/elekloader/kit/src/kit/protocol.ts' -export type BuilderMachine = 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' +export type BuilderMachine = 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'digitone-ii' // Digitakt/Digitone mk1 downloads retain their owner-approved parity gate; Analog Rytm MKII (OS 1.74) downloads are owner-approved too. // Digitakt II (OS 1.17) builds locally with its library modules, but downloads remain disabled pending qualification/review. @@ -14,6 +14,8 @@ export const DIGI_DOWNLOADS_ENABLED: Readonly> = 'digitakt-ii': false, digitone: true, 'analog-rytm-mkii': true, + // The Digitone II's base builds on the page (beta) before any module exists; downloads wait for the owner (board, 19 November 2026). + 'digitone-ii': false, } export function digiDownloadsEnabled(machine: string): boolean { @@ -23,4 +25,8 @@ export function digiDownloadsEnabled(machine: string): boolean { // Research machines whose page offers a local core build before any module is published. Build outcomes count // by machine; download availability remains governed independently above. export const CORE_BUILD_PREVIEWS: readonly BuilderMachine[] = [] -export function isCoreBuildPreview(machine: string): boolean { return (CORE_BUILD_PREVIEWS as readonly string[]).includes(machine) } +// Shown to beta users only (hasBetaUi): the Digitone II's base alone, with no module yet (owner, board, 19 November 2026). +export const BETA_CORE_BUILD_PREVIEWS: readonly BuilderMachine[] = ['digitone-ii'] +export function isCoreBuildPreview(machine: string, beta = false): boolean { + return (CORE_BUILD_PREVIEWS as readonly string[]).includes(machine) || beta && (BETA_CORE_BUILD_PREVIEWS as readonly string[]).includes(machine) +} diff --git a/src/engine/elektron/ele3.ts b/src/engine/elektron/ele3.ts index 50fed8b18e..5d29c7ebb4 100644 --- a/src/engine/elektron/ele3.ts +++ b/src/engine/elektron/ele3.ts @@ -9,9 +9,9 @@ import { CHUNK_SIZE, FIRST_COUNTER, contentChecksum, decodeDataMessages, encodeS const COUNT_OFFSET = 0x1c, TABLE_OFFSET = 0x20, ENTRY_SIZE = 16, VERSION_FIELD = [0x14, 0x18] as const const OFFSET_BIAS = 767, FAR_OFFSET = 3328 -export type DigiMachine = 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' +export type DigiMachine = 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'digitone-ii' // Machines with a container and linker profile; the app's firmware flow covers DigiMachine only. -export type ElemodMachine = DigiMachine | 'syntakt' | 'analog-four-mkii' | 'digitone-ii' +export type ElemodMachine = DigiMachine | 'syntakt' | 'analog-four-mkii' export type Ele3Device = { mainSection: number; mainLoad: number; stage: number; flashAt: number; flashLimit: number; sysexId: number; seal?: 'hmac' } // Facts about each machine's container and loader, from public research (elekloader device profiles). diff --git a/src/engine/elektron/firmware.worker.ts b/src/engine/elektron/firmware.worker.ts index 4e69ca58ea..433afc799b 100644 --- a/src/engine/elektron/firmware.worker.ts +++ b/src/engine/elektron/firmware.worker.ts @@ -4,7 +4,7 @@ import { inspectDigiFirmware, type DigiMachine } from './firmware' self.onmessage = async (event: MessageEvent<{ id: number; machine: DigiMachine; name: string; buffer: ArrayBuffer }>) => { const { id, machine, name, buffer } = event.data try { - if (!['digitakt', 'digitakt-ii', 'digitone', 'analog-rytm-mkii'].includes(machine) || !(buffer instanceof ArrayBuffer)) throw new Error('Invalid local firmware request.') + if (!['digitakt', 'digitakt-ii', 'digitone', 'analog-rytm-mkii', 'digitone-ii'].includes(machine) || !(buffer instanceof ArrayBuffer)) throw new Error('Invalid local firmware request.') const inspection = await inspectDigiFirmware(machine, new Uint8Array(buffer), name) self.postMessage({ id, type: 'inspection', inspection }) } catch (error) { diff --git a/src/engine/elektron/odd-jumps.test.ts b/src/engine/elektron/odd-jumps.test.ts index fb22c8fdfa..cd45ee6403 100644 --- a/src/engine/elektron/odd-jumps.test.ts +++ b/src/engine/elektron/odd-jumps.test.ts @@ -3,6 +3,10 @@ import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' import { oddJumpsIn, oddJumpsInElemod, oddJumpsInFiles, type Machine } from './odd-jumps' import { devices } from '../../../vendor/elekloader/kit/src/devices.ts' +import { carryDevices } from '../elekloader/carried-devices' + +// The devices Modwerk's builder carries (the Digitone II), as the site's worker registers them. +carryDevices() // A synthetic machine: its "stock" image is 0x40000000-0x40001000 and its module RAM 0x41000000-0x41001000. No // Elektron firmware is involved. diff --git a/src/hooks/useDigiBuild.ts b/src/hooks/useDigiBuild.ts index dbfb77cae9..49e090694c 100644 --- a/src/hooks/useDigiBuild.ts +++ b/src/hooks/useDigiBuild.ts @@ -34,7 +34,8 @@ export function useDigiBuild(machine: BuilderMachine, file: File | undefined, re const key = inputs + '#' + attempt const [view, setView] = useState({ phase: 'idle', key: '' }) // Local build outcomes include preview machines; their download gates remain separate. - const usageMachine = machine + // The usage counts name the machines the Worker's contract lists (usage-contract.ts); the Digitone II's beta builds are not among them. + const usageMachine = machine === 'digitone-ii' ? undefined : machine const client = useRef(null), operation = useRef(0), storageRef = useRef(storage) useEffect(() => { storageRef.current = storage }) useEffect(() => () => { client.current?.dispose(); client.current = null }, []) diff --git a/src/storage/device.ts b/src/storage/device.ts index 0837a4365a..9251da98e4 100644 --- a/src/storage/device.ts +++ b/src/storage/device.ts @@ -85,11 +85,11 @@ export function deviceStore(db: IDBDatabase) { compareModuleVersions(module.version, module.version) await transaction('settings', 'readwrite', store => store.put({ id: module.id, version: module.version }, 'module-view/' + module.id)) }, - async readFirmware(machine: 'octatrack' | 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'zoom-ms-70cdr' = 'octatrack'): Promise { return transaction('firmware', 'readonly', store => store.get(machine === 'octatrack' ? 'base' : 'base/' + machine)) }, - async saveFirmware(file: File, machine: 'octatrack' | 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'zoom-ms-70cdr' = 'octatrack') { + async readFirmware(machine: 'octatrack' | 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'digitone-ii' | 'zoom-ms-70cdr' = 'octatrack'): Promise { return transaction('firmware', 'readonly', store => store.get(machine === 'octatrack' ? 'base' : 'base/' + machine)) }, + async saveFirmware(file: File, machine: 'octatrack' | 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'digitone-ii' | 'zoom-ms-70cdr' = 'octatrack') { await transaction('firmware', 'readwrite', store => store.put({ name: file.name, blob: file }, machine === 'octatrack' ? 'base' : 'base/' + machine)) }, - async forgetFirmware(machine: 'octatrack' | 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'zoom-ms-70cdr' = 'octatrack') { await transaction('firmware', 'readwrite', store => store.delete(machine === 'octatrack' ? 'base' : 'base/' + machine)) }, + async forgetFirmware(machine: 'octatrack' | 'digitakt' | 'digitakt-ii' | 'digitone' | 'analog-rytm-mkii' | 'digitone-ii' | 'zoom-ms-70cdr' = 'octatrack') { await transaction('firmware', 'readwrite', store => store.delete(machine === 'octatrack' ? 'base' : 'base/' + machine)) }, } } export type DeviceStore = ReturnType diff --git a/src/tooling/elekloader-update.test.ts b/src/tooling/elekloader-update.test.ts index d05ad79095..0b42225bfa 100644 --- a/src/tooling/elekloader-update.test.ts +++ b/src/tooling/elekloader-update.test.ts @@ -180,7 +180,7 @@ function fixture() { mkdirSync(dirname(join(root, path)), { recursive: true }) cpSync(join(ROOT, path), join(root, path), { recursive: true }) } - for (const path of [...noticePaths, 'LICENSE', 'LICENSES', 'scripts/elekloader-update.ts', 'scripts/elekloader-vendor.ts', 'scripts/licenses.mjs', 'scripts/license-notices.mjs', 'src/engine/elektron/codec', 'src/engine/elektron/odd-jumps.ts']) copy(path) + for (const path of [...noticePaths, 'LICENSE', 'LICENSES', 'scripts/elekloader-update.ts', 'scripts/elekloader-vendor.ts', 'scripts/licenses.mjs', 'scripts/license-notices.mjs', 'src/engine/elektron/codec', 'src/engine/elektron/odd-jumps.ts', 'src/engine/elekloader/carried-devices.ts', 'sdk/machines/digitone-ii/elekloader/device.json']) copy(path) // The module records that add Modwerk-built pins to the upstream catalog. for (const name of readdirSync(join(ROOT, 'sdk/imports')).filter(name => /^elekloader-.*\.json$/.test(name))) copy('sdk/imports/' + name) const manifest = JSON.parse(readFileSync(join(root, 'sdk/octabam/licenses/manifest.json'), 'utf8')) as { moduleComponents: Record } From 546749325dfc95db0ea0d0afcc13ee4f4290abca Mon Sep 17 00:00:00 2001 From: Lukas Schmolz Date: Thu, 19 Nov 2026 22:56:39 +0100 Subject: [PATCH 005/105] Machine profiles: the Digitone II has an SDK section Co-Authored-By: Claude Opus 5.5 --- src/devices/machine-contract.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/machine-contract.test.ts b/src/devices/machine-contract.test.ts index 890a42ba43..f806e49f03 100644 --- a/src/devices/machine-contract.test.ts +++ b/src/devices/machine-contract.test.ts @@ -14,7 +14,7 @@ describe('machine profiles', () => { it('validates every machine and matches the generated registry', () => { const parsed = profiles.map(parseMachineProfile).sort((a, b) => a.order - b.order) expect(parsed.map(profile => profile.id)).toEqual(GENERATED.map(profile => profile.id)) - expect(parsed.filter(profile => profile.sdk).map(profile => profile.id)).toEqual(['octatrack', 'digitakt', 'digitone', 'digitakt-ii', 'analog-rytm-mkii', 'analog-rytm-mki', 'analog-four-mkii', 'zoom-ms-70cdr']) + expect(parsed.filter(profile => profile.sdk).map(profile => profile.id)).toEqual(['octatrack', 'digitakt', 'digitone', 'digitakt-ii', 'digitone-ii', 'analog-rytm-mkii', 'analog-rytm-mki', 'analog-four-mkii', 'zoom-ms-70cdr']) }) it('keeps status, steps and SDK claims consistent', () => { From 4a5d091faf448d4edaeb15e70191243adffe4c8b Mon Sep 17 00:00:00 2001 From: Lukas Schmolz Date: Fri, 20 Nov 2026 10:33:52 +0100 Subject: [PATCH 006/105] Usage: count Digitone II builds (migration 0102, as 0083 did for the Rytm) The owner on the board, 20 November 2026: count Digitone II beta builds, add the usage device and the migration in this pull request, extend the migration test to existing rows and the new device. Co-Authored-By: Claude Opus 5.5 --- changelog/2026-11-19-digitone-ii-site-base.md | 2 +- migrations/0102_usage_digitone_ii.sql | 13 +++++++++++++ src/community/service.test.ts | 9 +++++---- src/community/usage-contract.ts | 2 +- src/community/usage-machine-migration.test.ts | 12 ++++++++++-- 5 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 migrations/0102_usage_digitone_ii.sql diff --git a/changelog/2026-11-19-digitone-ii-site-base.md b/changelog/2026-11-19-digitone-ii-site-base.md index 32e8e91aa6..04dcae3edc 100644 --- a/changelog/2026-11-19-digitone-ii-site-base.md +++ b/changelog/2026-11-19-digitone-ii-site-base.md @@ -1 +1 @@ -Digitone II: beta users can build Modwerk's Digitone II base on its machine page from their own OS 1.12 file, the base that ran on a unit. There are no modules yet, and downloads stay off until the owner turns them on. +Digitone II: beta users can build Modwerk's Digitone II base on its machine page from their own OS 1.12 file, the base that ran on a unit. There are no modules yet, and downloads stay off until the owner turns them on. Its builds count in the usage statistics like every other machine's. diff --git a/migrations/0102_usage_digitone_ii.sql b/migrations/0102_usage_digitone_ii.sql new file mode 100644 index 0000000000..5bd3a8b0e6 --- /dev/null +++ b/migrations/0102_usage_digitone_ii.sql @@ -0,0 +1,13 @@ +-- Count Digitone II beta builds (owner, board, 20 November 2026): widen the closed machine enum again, as 0083 did, +-- keeping every existing row and inventing no historical attribution. +CREATE TABLE usage_device_daily_expanded ( + day TEXT NOT NULL, + device TEXT NOT NULL CHECK(device IN ('octatrack','digitakt','digitone','digitakt-ii','analog-rytm-mkii','digitone-ii')), + builds INTEGER NOT NULL DEFAULT 0, + builds_failed INTEGER NOT NULL DEFAULT 0, + downloads INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY(day,device) +); +INSERT INTO usage_device_daily_expanded SELECT day,device,builds,builds_failed,downloads FROM usage_device_daily; +DROP TABLE usage_device_daily; +ALTER TABLE usage_device_daily_expanded RENAME TO usage_device_daily; diff --git a/src/community/service.test.ts b/src/community/service.test.ts index 95b5b9b3b7..50ab9f6fb9 100644 --- a/src/community/service.test.ts +++ b/src/community/service.test.ts @@ -35,6 +35,7 @@ async function fixture(){ db.exec(readFileSync(new URL('../../migrations/0009_module_downloads.sql',import.meta.url),'utf8')) db.exec(readFileSync(new URL('../../migrations/0042_usage_breakdowns.sql',import.meta.url),'utf8')) db.exec(readFileSync(new URL('../../migrations/0083_usage_machine_coverage.sql',import.meta.url),'utf8')) + db.exec(readFileSync(new URL('../../migrations/0102_usage_digitone_ii.sql',import.meta.url),'utf8')) db.exec(readFileSync(new URL('../../migrations/0051_support_and_hourly_usage.sql',import.meta.url),'utf8')) db.exec(readFileSync(new URL('../../migrations/0052_module_first_download.sql',import.meta.url),'utf8')) db.exec(readFileSync(new URL('../../migrations/0011_forum_accounts.sql',import.meta.url),'utf8')) @@ -774,16 +775,16 @@ describe('usage breakdowns: failed builds, machines and weekly module trends',() const {call,db,admin}=await fixture(),failed={...usageEvent('build_failed'),device:'digitakt'} expect((await call('/usage/events','POST',failed)).status).toBe(200) expect((await call('/usage/events','POST',failed)).status).toBe(200) // A repeated event ID adds nothing, here either. - for(const [event,device] of [['build_succeeded','digitakt'],['build_succeeded','octatrack'],['firmware_download_requested','digitone']])expect((await call('/usage/events','POST',{...usageEvent(event),device})).status).toBe(200) + for(const [event,device] of [['build_succeeded','digitakt'],['build_succeeded','octatrack'],['firmware_download_requested','digitone'],['build_succeeded','digitone-ii']])expect((await call('/usage/events','POST',{...usageEvent(event),device})).status).toBe(200) expect((await call('/usage/events','POST',usageEvent('build_succeeded'))).status).toBe(200) // Older pages send no machine. // A machine only on builds and downloads, from the closed supported list. for(const body of [{...usageEvent(),device:'octatrack'},{...usageEvent('build_succeeded'),device:'syntakt'},{...usageEvent('build_succeeded'),device:1}])expect((await call('/usage/events','POST',body)).status).toBe(400) const today=new Date().toISOString().slice(0,10) - expect(db.prepare('SELECT builds,builds_failed,downloads FROM usage_daily WHERE day=?').get(today)).toEqual({builds:3,builds_failed:1,downloads:1}) + expect(db.prepare('SELECT builds,builds_failed,downloads FROM usage_daily WHERE day=?').get(today)).toEqual({builds:4,builds_failed:1,downloads:1}) const result=await (await call('/admin/statistics?days=7','GET',undefined,'',undefined,admin)).json() - expect(result.rows[0]).toMatchObject({builds:3,builds_failed:1,downloads:1}) + expect(result.rows[0]).toMatchObject({builds:4,builds_failed:1,downloads:1}) expect(result.breakdownsStarted).toMatch(/^\d{4}-\d{2}-\d{2}T/) - expect(result.devices).toEqual([{device:'octatrack',builds:1,builds_failed:0,downloads:0},{device:'digitakt',builds:1,builds_failed:1,downloads:0},{device:'digitone',builds:0,builds_failed:0,downloads:1},{device:'digitakt-ii',builds:0,builds_failed:0,downloads:0},{device:'analog-rytm-mkii',builds:0,builds_failed:0,downloads:0}]) + expect(result.devices).toEqual([{device:'octatrack',builds:1,builds_failed:0,downloads:0},{device:'digitakt',builds:1,builds_failed:1,downloads:0},{device:'digitone',builds:0,builds_failed:0,downloads:1},{device:'digitakt-ii',builds:0,builds_failed:0,downloads:0},{device:'analog-rytm-mkii',builds:0,builds_failed:0,downloads:0},{device:'digitone-ii',builds:1,builds_failed:0,downloads:0}]) expect(JSON.stringify(db.prepare('SELECT * FROM usage_device_daily').all())).not.toContain(failed.visitor) }) it('accepts a machine on identifier-free counts and keeps daily module counts for weekly trends',async()=>{ diff --git a/src/community/usage-contract.ts b/src/community/usage-contract.ts index 466b3b4a1b..d9b6f4e4cf 100644 --- a/src/community/usage-contract.ts +++ b/src/community/usage-contract.ts @@ -6,7 +6,7 @@ export type UsageEvent = typeof USAGE_EVENTS[number] export const ANNOUNCEMENT_COUNTS = { announcement_shown: 'shown', announcement_opened: 'opened', announcement_dismissed: 'dismissed' } as const export type AnnouncementCountEvent = keyof typeof ANNOUNCEMENT_COUNTS /** Machines that build firmware here. Builds, failed builds and download requests may name one; nothing else does. */ -export const USAGE_DEVICES = ['octatrack', 'digitakt', 'digitone', 'digitakt-ii', 'analog-rytm-mkii'] as const +export const USAGE_DEVICES = ['octatrack', 'digitakt', 'digitone', 'digitakt-ii', 'analog-rytm-mkii', 'digitone-ii'] as const export type UsageDevice = typeof USAGE_DEVICES[number] export const DEVICE_EVENTS: readonly UsageEvent[] = ['build_succeeded', 'build_failed', 'firmware_download_requested'] export type DiscordInviteCounts = { discord_member_shown: number; discord_member_joins: number; discord_member_dismissals: number; discord_visitor_shown: number; discord_visitor_signups: number; discord_visitor_joins: number; discord_visitor_dismissals: number; discord_welcome_joins: number } diff --git a/src/community/usage-machine-migration.test.ts b/src/community/usage-machine-migration.test.ts index 9bb79fbfb5..e02af918c0 100644 --- a/src/community/usage-machine-migration.test.ts +++ b/src/community/usage-machine-migration.test.ts @@ -9,6 +9,7 @@ describe('machine attribution coverage', () => { expect([...USAGE_DEVICES].sort()).toEqual(['octatrack', ...Object.keys(DIGI_DOWNLOADS_ENABLED)].sort()) expect(DIGI_DOWNLOADS_ENABLED['digitakt-ii']).toBe(false) expect(DIGI_DOWNLOADS_ENABLED['analog-rytm-mkii']).toBe(true) + expect(DIGI_DOWNLOADS_ENABLED['digitone-ii']).toBe(false) }) it('preserves legacy rows while expanding the SQLite constraint', () => { const { db } = testDatabase() @@ -19,8 +20,15 @@ describe('machine attribution coverage', () => { db.prepare("INSERT INTO usage_device_daily(day,device,builds,builds_failed,downloads) VALUES('2026-10-01','octatrack',12,2,9)").run() db.exec(readFileSync(new URL('../../migrations/0083_usage_machine_coverage.sql', import.meta.url), 'utf8')) expect(db.prepare('SELECT * FROM usage_device_daily').all()).toEqual([{ day: '2026-10-01', device: 'octatrack', builds: 12, builds_failed: 2, downloads: 9 }]) - for (const device of USAGE_DEVICES) db.prepare("INSERT INTO usage_device_daily(day,device) VALUES('2026-10-02',?)").run(device) - expect(() => db.prepare("INSERT INTO usage_device_daily(day,device) VALUES('2026-10-02','unknown')").run()).toThrow() + for (const device of USAGE_DEVICES.filter(device => device !== 'digitone-ii')) db.prepare("INSERT INTO usage_device_daily(day,device) VALUES('2026-10-02',?)").run(device) + expect(() => db.prepare("INSERT INTO usage_device_daily(day,device) VALUES('2026-10-02','digitone-ii')").run()).toThrow() + db.prepare("UPDATE usage_device_daily SET builds=3,builds_failed=1,downloads=2 WHERE day='2026-10-02' AND device='analog-rytm-mkii'").run() + const before = db.prepare('SELECT * FROM usage_device_daily ORDER BY day,device').all() + db.exec(readFileSync(new URL('../../migrations/0102_usage_digitone_ii.sql', import.meta.url), 'utf8')) + expect(db.prepare('SELECT * FROM usage_device_daily ORDER BY day,device').all()).toEqual(before) + db.prepare("INSERT INTO usage_device_daily(day,device,builds) VALUES('2026-10-03','digitone-ii',1)").run() + expect(db.prepare("SELECT builds FROM usage_device_daily WHERE device='digitone-ii'").all()).toEqual([{ builds: 1 }]) + expect(() => db.prepare("INSERT INTO usage_device_daily(day,device) VALUES('2026-10-03','unknown')").run()).toThrow() } finally { db.close() } }) }) From b510fe7607a7c180778990b1d5ae34d08f5e1765 Mon Sep 17 00:00:00 2001 From: Nathaniel Pawelczyk Date: Fri, 20 Nov 2026 23:35:47 -0600 Subject: [PATCH 007/105] Improved Performance 0.1.0 for the Analog Rytm MKII: the audio engine leaves out work that changes nothing One module, no controls: idle sample voices, sends at zero, a silent delay and reverb, modulation with nothing to modulate, parameters at rest, the compressor's control words and the unused USB audio input are skipped block by block. CPU, and OVR when the load is over its limit, show in the bottom status bar's lower right corner in stock's font. Source, manifest, README, TESTING, screenshots, thumbnail and release notes. Not pushed; the release package and its unit run follow. Co-Authored-By: Claude Fable 5.2 --- .../modules/improved-performance/LICENSE | 674 ++++++++++++++ .../modules/improved-performance/README.md | 87 ++ .../modules/improved-performance/TESTING.md | 58 ++ .../modules/improved-performance/build.json | 243 +++++ .../improved-performance/media/LICENSE.md | 7 + .../improved-performance/media/capture.json | 58 ++ .../improved-performance/media/cpu-near.png | Bin 0 -> 12960 bytes .../improved-performance/media/cpu-over.png | Bin 0 -> 12988 bytes .../improved-performance/media/thumbnail.svg | 16 + .../improved-performance/modwerk.module.json | 160 ++++ .../improved-performance/src/cpu-mark.c | 132 +++ .../improved-performance/src/effects.s | 851 ++++++++++++++++++ .../modules/improved-performance/src/engine.s | 620 +++++++++++++ .../improved-performance/src/modulation.s | 393 ++++++++ .../improved-performance/src/sample-voices.s | 577 ++++++++++++ ...analog-rytm-mkii-improved-performance.json | 12 + 16 files changed, 3888 insertions(+) create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/LICENSE create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/README.md create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/TESTING.md create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/build.json create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/media/LICENSE.md create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/media/capture.json create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/media/cpu-near.png create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/media/cpu-over.png create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/media/thumbnail.svg create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/modwerk.module.json create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/src/cpu-mark.c create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/src/effects.s create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/src/engine.s create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/src/modulation.s create mode 100644 sdk/analog-rytm-mkii/modules/improved-performance/src/sample-voices.s create mode 100644 src/community/module-changelogs/analog-rytm-mkii-improved-performance.json diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/LICENSE b/sdk/analog-rytm-mkii/modules/improved-performance/LICENSE new file mode 100644 index 0000000000..f288702d2f --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/README.md b/sdk/analog-rytm-mkii/modules/improved-performance/README.md new file mode 100644 index 0000000000..c1259555e3 --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/README.md @@ -0,0 +1,87 @@ +# Improved Performance + +An Analog Rytm MKII mod by Nathaniel Pavel (@npp1993). Version 0.1.0-experimental, for OS 1.74. + +## Overview + +Stock computes nearly everything in every audio block, whether it is used or not: all eight sample voices, every send, the delay and the reverb, every modulation pass. Improved Performance tests, block by block, whether a piece of that work can change anything, and leaves it out when it cannot. The output is stock's bit for bit, with one exception far below hearing ([How it works](#how-it-works)). With the time saved the unit redraws and reads its keys sooner, and a busy pattern keeps further from dropouts. + +On the author's unit, one 12-track pattern in a set of 17 other modules used 85.4 % of the audio block without it and 72.0 % with it; the longest block fell from 99.4 % to 87.2 %, and the screen's redraw step from 19.1 ms to 8.0 ms ([Tests and measurements](#tests-and-measurements)). + +`CPU` appears in the lower right corner of the screen while the audio load is close to its limit, and `OVR` while it is over. + +## Controls + +None. There is nothing to switch on or set. + +| What you see | Meaning | +| --- | --- | +| `CPU` in the lower right corner, in the bottom status bar | The audio load averaged 88 % or more over the last half second, or several blocks reached 97 %: close to dropouts. | +| `OVR` in the same place | The load averaged 92 % or more, or several blocks used their whole period: the screen and keys slow down, and audio can drop out. | + +Both are written in the bar's own font, on its text line. They show on every screen that has the bottom status bar, and not in menus, lists or browsers. The corner is theirs: a mark another module has put there (Loop Sync's SYNC) is covered for as long as the word shows. The mark stays a second and a half after its cause has gone, so it does not flicker. + +## Usage + +Add it to a set that is short of CPU: big patterns, many modules, a screen that lags while the pattern plays. + +### Quick tutorial + +1. Add it to your set and send the OS: there is nothing to switch on. +2. Play as usual. The sound is unchanged; under load the screen and keys answer sooner. +3. If CPU shows in the lower right corner, the audio load is close to its limit; OVR means it is over. Mute tracks, lower sends or take a module out of the set until it goes. + +## How it works + +All of it sits in the audio interrupt, which runs once for every 32 samples. Each part stands in front of a piece of stock's work, tests in that block whether the work can change anything, and either jumps it or hands over to stock. + +| Part | Left out when | Source | +| --- | --- | --- | +| Sample voices | a voice plays nothing and its filters hold zero: no interpolation, no decimation, no transfer of silence | `src/sample-voices.s` | +| Send mixer | a voice's send gains are zero and not moving | `src/effects.s` | +| Delay, reverb | their input, state and memory windows are zero | `src/effects.s` | +| Slide pass, velocity and pressure lists, performance matrix | no slide runs, a list's value or depths are zero, no performance pad is held | `src/modulation.s` | +| Parameter smoothing | a track's 42 parameters have come to rest on their targets (a changed target is seen in the same block) | `src/engine.s` | +| Compressor control words | the compressor's eight parameters are the same as in the last block | `src/engine.s` | +| USB audio input | nothing streams: its two buffers are not cleared again, and the voice mix runs without that term | `src/engine.s` | + +Where a part runs its own loop in place of stock's (the smoother, the voice mix, the mixer over the busy sends), the loop does stock's arithmetic in stock's order, so the results are the same bit for bit. Each source file's header says what its part assumes and why the result is the same. + +**The one place that is not bit-identical.** Stock's delay and reverb never come back to exact silence after use: their filters settle on a residue of a few hundred in 2^31. Once one of them has had no input for the whole length of its memory (the delay about 11 seconds, the reverb about a third of a second) and everything in it lies below -114 dBFS, this module rests it and its output is exact zero, where stock goes on computing that residue. The first input ends the rest and stock runs on what it left. Before their first use after power-on, nothing differs at all. + +The CPU mark reads the core's own figure for each audio block (`core_audio_load`), patches nothing and draws with stock's own text routine. + +## Changes to stock flows + +- **`CPU` and `OVR`** are written into the lower right corner of the bottom status bar (columns 112 to 125) while the load is high. That corner is empty in stock. The word takes it: a mark another module draws there (Loop Sync's SYNC on the SAMPLE page) is painted over while the load is high and comes back when it has gone, because the warning matters more than what else stands there. On a screen without the bottom bar nothing is drawn. It cannot be turned off. It is there because a module set can now bring the unit to its limit, and stock gives no sign of that before audio drops out. +- Nothing else changes: no page, key, menu, save or load behaves differently. + +## Compatibility and limitations + +- Analog Rytm MKII, OS 1.74 only. +- It patches 18 places in the audio interrupt (`build.json`). No other module in the library patches those bytes. Improved SMPL and Audio In Routing have sites of their own in two of the same routines (the sample engine, the delay's entry); all the tests on the unit ran beside both. +- The after-use rest of the delay and the reverb is not bit-identical to stock (above). +- The savings depend on the project. A sample voice that plays, a send that is up, a modulation that is in use cost what they cost in stock. On the author's project the reverb never rested and the delay only with the sequencer stopped. +- Tested on one unit, with one project. Not tested: a project load while sound rings, a long USB audio stream, a second unit. + +## Tests and measurements + +Full record: [TESTING.md](TESTING.md). + +- **rytm-emu:** the module alone on the release base, and beside 17 other modules, against the same image with its patches put back to stock: parameters, smoother states, control frames, voice records and the audio output were identical in every one of about 69,500 blocks. A kit load while the reverb rang gave identical output too. +- **On the author's unit (OS 1.74):** self-checking builds, in which stock does all the work and every skip is compared with it, counted 0 differences for every part. Audio load, the unit's own meter, the author's pattern in a set of 17 other modules: 85.4 % without, 72.0 % with; longest block 99.4 % and 87.2 %. +- **Memory:** about 4 KB. + +## Screens and audio + +![CPU in the lower right corner: the audio load is close to its limit](media/cpu-near.png) + +![OVR in the lower right corner: the load is over the limit](media/cpu-over.png) + +Both from rytm-emu, from a build of this source with the mark's thresholds lowered so that it shows there ([capture record](media/capture.json)). No audio example: the sound is stock's. + +## Authorship and licences + +Nathaniel Pavel (@npp1993): the mod, its design and code. GPL-3.0-or-later ([LICENSE](LICENSE)). It links with core-ar2 by irpina (Elekloader), whose audio load figure the CPU mark reads. + +The source names firmware addresses only; the patch preconditions in `build.json` are addresses, lengths and SHA-256s. diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/TESTING.md b/sdk/analog-rytm-mkii/modules/improved-performance/TESTING.md new file mode 100644 index 0000000000..e596487e0e --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/TESTING.md @@ -0,0 +1,58 @@ +# Improved Performance testing + +Version 0.1.0-experimental, Analog Rytm MKII, OS 1.74. Tester and unit: Nathaniel Pavel (@npp1993), his own Analog Rytm MKII. Firmware, dumps and built images stay out of this folder. + +**What ran where.** The four assembly sources are the code that ran in every test below: the public files assemble, with `build.json`'s symbols, to the same code and data as the files the tests used (compared object for object). `src/cpu-mark.c`'s counting of the load is the tested code; its drawing was rewritten afterwards (stock's font, the words CPU and OVR, only where the bottom bar is) and has run in rytm-emu only. The unit tests ran in private test builds beside 17 other modules of the author's set, on a development base with the USB link and a load meter. **The release package itself has not run on a unit.** + +## rytm-emu + +A local build of rytm-emu with a cache model and an interrupt profiler added (not upstream's), the audio interrupt run in zero time so that two runs can be compared block for block. Each comparison is one image run twice: as built, and with this module's patch sites written back to stock before the run. One record of engine state every audio block, and the DAC output as a WAV. + +| Image | Session | Blocks | Result | +| --- | --- | --- | --- | +| The plain release base + this module, nothing else | Notes on 12 tracks at 12 velocities, pad pressure, performance controllers, controller ramps on track channels, every controller 16 to 119 on the FX channel | 69,552 | Parameter words, smoother states, control frame, voice records, voice gains and the DAC output identical in every block. Audio interrupt: 20,858 fewer instructions a block than with the exact parts' sites back at stock. | +| The same code beside 17 other modules | the same | 69,551 | The same seven identical; 19,121 fewer instructions a block. | +| The same, a kit loaded from the KIT menu while a long reverb rings | BD notes, then LOAD KIT, kit 02 | 65,801 | Reverb output, delay output, the FX track's words and the DAC output identical to the image with every site back at stock. Stock applies the new kit's FX settings in one block. | +| Self-checking builds, one for each group of parts (stock does all the work; each skip is compared with what stock produced) | each group's own session | 64,301 to 163,301 | 0 differences: sample voices, send mixer, delay, reverb, slide pass, lists, matrix, stream clear, voice mix, compressor words, smoother. | + +**The after-use rest of the delay and the reverb** (the one part that is not bit-identical), its own session of 133,301 blocks: identical in every word from power-on to the first rest after use. At rest the output is zero where stock's was at most 266 (delay) and 60 (reverb) of 2^31; a 24-bit converter step is 256. With feedback raised to 100 and no input, the rest ended and the tone grew out of the residue as in stock. After the next use the two runs were identical again. + +**CPU and OVR** (upstream rytm-emu c5732f0, builds with one threshold lowered so that the word shows): on the main screen and under the TEMPO pop-up the word sits in the bottom bar's lower right corner, in the bar's font and on its text line; with a test module's dark box in that corner (where Loop Sync shows SYNC) the word replaces the box cleanly; on the GLOBAL menu and over the machine list nothing is drawn. + +Not reached in rytm-emu: a USB audio stream, a sample that plays, the interrupt's short path during a project load. + +## On the unit (author's MKII, OS 1.74) + +All from RAM, in test images of the author's 18-module set; the figures are the unit's own meter (the share of each audio block's period that the audio interrupt used). The pattern is one 12-track pattern of the author's project, played hands off. + +**Self-checks: stock does all the work, and each part compares what its skip would have left.** + +| Date | Part | Checks | Differences | +| --- | --- | --- | --- | +| 18 Nov 2026 | Sample voices | 1,885,296 skipped voice-blocks, 3,289,416 transfers | 0 | +| 20 Nov 2026 | Send mixer, delay, reverb (exact form) | 388,252 mixer passes, 194,126 blocks each for delay and reverb | 0 | +| 20 Nov 2026 | Slide pass, lists, matrix | 196,000 blocks, 5,095,584 list calls | 0 | +| 20 Nov 2026 | Stream clear, voice mix, compressor words | about 192,000 blocks each | 0 | +| 20 Nov 2026 | Smoother | 1,331,363 blocks, the author turning knobs for part of it (2 "at rest" marks dropped and set again) | 0 | + +**Audio load, the same pattern.** + +| Build | Pattern, mean | Longest block | Stopped | Redraw step | +| --- | --- | --- | --- | --- | +| The set without this module (17 Nov 2026) | 85.4 % | 99.4 % | not comparable | 19.1 ms | +| The set with this module's code, as one module (20 Nov 2026) | 72.0 % | 87.2 % | 54.3 % | 8.0 ms | + +- The delay rested only with the sequencer stopped, and the reverb never: on this project its input is never exactly zero. +- A kit switch while the reverb rang (the author, 20 Nov 2026): the tail rang out with and without the module; the counters showed the reverb rest never engaged. +- A burst of USB stream frames arrives after each RAM boot (about 1.6 s): the stream part fell back to stock for it and went back to skipping afterwards, in the real build and in its self-check. +- CPU and OVR: not seen on the unit. The load never reached 88 % on a build that carried the mark. + +## Not tested + +- The release package (0.1.0-experimental as built from this folder) on a unit. +- This module as the only module on a unit: every unit run was beside 17 others. +- A project load while sound rings (the audio interrupt takes a shorter path then; read, not run). +- A USB audio stream of more than the 1.6 s above. +- A sample that plays through a rest of its voice in rytm-emu (on the unit the pattern has one sample voice playing). +- The CPU mark on the unit, and its thresholds. +- A second unit; any OS but 1.74. diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/build.json b/sdk/analog-rytm-mkii/modules/improved-performance/build.json new file mode 100644 index 0000000000..00d32e4830 --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/build.json @@ -0,0 +1,243 @@ +{ + "schemaVersion": 1, + "sources": [ + "src/sample-voices.s", + "src/effects.s", + "src/modulation.s", + "src/engine.s", + "src/cpu-mark.c" + ], + "defsym": {}, + "cflags": [], + "weak": [], + "subscribe": [ + { + "event": "ev_render_out", + "fn": "cpu_warning_out", + "order": 50 + }, + { + "event": "ev_tick", + "fn": "cpu_warning_tick", + "order": 90 + }, + { + "event": "ev_draw", + "fn": "cpu_warning_draw", + "order": 95 + } + ], + "contribute": [], + "collections": {}, + "copied": [], + "regions": [], + "claims": [ + "ui:status bar lower right corner while the audio load is high" + ], + "requires": [], + "derive": null, + "releases": { + "1.74": { + "defsym": { + "VERIFY": "0", + "STORE_PHASE": "0x4011ccb6", + "GAIN_STAGE": "0x4011ce5e", + "INTERP_OUT": "0x8000e320", + "DECIM_OUT": "0x8000e1d0", + "VOICE_OUT": "0x800067f8", + "FETCH": "1", + "TRIM": "1", + "TAIL": "0x4011cf5e", + "COUNT": "0", + "GAINS": "0x419c9f98", + "SEND0": "0x80007a44", + "MIX_DONE": "0x4010e7ac", + "MIX_STOCK": "0x4010e764", + "DLY_FLT": "0x8000e11c", + "DLY_GATE": "0x8000dff0", + "DLY_PTR": "0x8000ddb0", + "DLY_PAR": "0x8000e008", + "DLY_OUT": "0x80007c44", + "DLY_TMP": "0x8000e01c", + "DLY_TAIL": "0x4010dd6e", + "REV_FLT": "0x8000cd08", + "REV_ST": "0x8000ccbc", + "REV_IN": "0x80007b44", + "REV_FB": "0x8000cb10", + "REV_LINES": "0x8000d1e0", + "REV_TMP": "0x8000ca10", + "REV_TMP2": "0x8000cc3c", + "REV_LFO": "0x4010d7ee", + "REV_END": "0x4010da1a", + "REV_L0": "0x8000d1f0", + "REV_L5": "0x8000d560", + "DMA_CSR": "0xfc0453de", + "QUIET": "1", + "PAR": "0x8000f774", + "COEF": "0x8000e438", + "SLIDE_END": "0x40120e9e", + "FCE8": "0x8000fce8", + "LIST_BODY": "0x4011de30", + "MX_OFF": "0x8000ed74", + "MX_ENT": "0x8000ebbc", + "MX_SRC": "0x8000ec7c", + "FRAMES": "0x40287ffc", + "FLAGS": "0x8000646c", + "CLR_END": "0x401214f8", + "U0": "0x42ac6f30", + "MEMSET": "0x40097c40", + "NS_RESUME": "0x40005f4c", + "CW_STOCK": "0x4010e20c", + "TGT": "0x8000e57c", + "STATE": "0x8000ee84", + "SM_END": "0x40120d50", + "SM_LOOP": "0x40120d24", + "SM_AFTER": "0x40120d54", + "FEF4": "0x8000fef4", + "VD_TAB": "0x401bed40", + "G_PAIRS": "0x80007000", + "VD_A0": "0x80007040", + "VD_A2": "0x800067f8", + "VD_A3": "0x80006bf8", + "VD_BODY": "0x4010eaa0", + "NSC": "1", + "VDC": "1", + "CMW": "1", + "SMO": "1" + }, + "cflags": [ + "-DTEXT_DRAW_AT=0x4007154c", + "-DTEXT_FONT_AT=0x40071be8", + "-DTEXT_CTX_AT=0x417e389c" + ], + "sites": [ + { + "addr": "0x4011cc08", + "len": 8, + "stockSha256": "238df3d27fa58843b90bcf4f5c0f7d387724fe806037f2962ac5659febd4f7f2", + "op": "jsr", + "target": "dsk_interp" + }, + { + "addr": "0x4011cd46", + "len": 6, + "stockSha256": "65fafa24356ca41b30135033f21e3e99bafdc6aa48560d28bbf3e2cf4da9080b", + "op": "jsr", + "target": "dsk_decim" + }, + { + "addr": "0x4011cbba", + "len": 6, + "stockSha256": "f201122663120f11e43aab2d32b1856b22ea0e508dc2dd106419bc791f2b93b6", + "op": "jsr", + "target": "dsf_a" + }, + { + "addr": "0x4011cd30", + "len": 6, + "stockSha256": "4e3df543d881fba2d1b8a115f11e31bb4f75966586debb8a4bcebf0b145262d6", + "op": "jsr", + "target": "dsf_b" + }, + { + "addr": "0x4011cec6", + "len": 6, + "stockSha256": "e524cbd68388a252309770b7b7793466ad0d3a8028745d8034fccbb1b9574860", + "op": "jsr", + "target": "dsg" + }, + { + "addr": "0x4010e75e", + "len": 6, + "stockSha256": "7ff04c31528c26e4b4e8f71dfdb3ba491bc4ac66923ab6e462276c45f0dd13f7", + "op": "jsr", + "target": "fxr_mix" + }, + { + "addr": "0x4010db14", + "len": 6, + "stockSha256": "d9e3f5734cb482311146e8dae7bb8ea58a51a0b0d8c6f06c5d8de12bddc25090", + "op": "jsr", + "target": "fxr_delay" + }, + { + "addr": "0x4010d544", + "len": 6, + "stockSha256": "0b893db60c8756ba72c03a6d9a4b59664b6b1f28492606f4387c3ef1633061ff", + "op": "jsr", + "target": "fxr_rev1" + }, + { + "addr": "0x4010d842", + "len": 6, + "stockSha256": "c0c7a97cfb72e858460cadaf63b77b20accbbebb6bbaf57fda2fd8549f960358", + "op": "jsr", + "target": "fxr_rev2" + }, + { + "addr": "0x40120e56", + "len": 6, + "stockSha256": "c3516bf848c8d3aa6a430725ddef7d3c7a2bfce6f936e0a02d080863646a7387", + "op": "jsr", + "target": "ms_slide" + }, + { + "addr": "0x4011de2a", + "len": 6, + "stockSha256": "c08255d313d1c37235530e5e20eaf2c657b1eb37fceabf1aacac6b9b7430ede4", + "op": "jmp", + "target": "ms_list" + }, + { + "addr": "0x40120fc0", + "len": 6, + "stockSha256": "0ad0ad115af48d23536363e3730edda6418e324f84343815cc37021883d2ffce", + "op": "jsr", + "target": "ms_matrix" + }, + { + "addr": "0x401214da", + "len": 6, + "stockSha256": "7d4c208ad4c4308b6fbf2fd9cae0fdf5657f81668d786d6c4a45f9d3adcd14eb", + "op": "jmp", + "target": "ms_clr" + }, + { + "addr": "0x40005f2c", + "len": 6, + "stockSha256": "150a9093800a6a18b4dbc4bea16085158a7d540dc031d35aeb556a674a9de12a", + "op": "jmp", + "target": "ns_gate" + }, + { + "addr": "0x4011fc6c", + "len": 6, + "stockSha256": "af758ea834cd1c0080d66ab69934e55b595c00e4a9a9fcefae9fa60bfeef4713", + "op": "jsr", + "target": "ns_dirty" + }, + { + "addr": "0x40121398", + "len": 6, + "stockSha256": "85b9e1195fd802cdd87f294d9faad7107f46795bc5ecf614bd37a3b6e4cde8d5", + "op": "jsr", + "target": "cw_memo" + }, + { + "addr": "0x4010ea98", + "len": 8, + "stockSha256": "3e7c95b32f444fd280cb96b2a6ea90525fe223d6e6b9352086d2cf41941ae854", + "op": "jmp", + "target": "vd_gate" + }, + { + "addr": "0x40120d1c", + "len": 8, + "stockSha256": "370fbd328cbf757cf5bb0069621175eba8d68f3ec2aba8877e555795bece31ac", + "op": "jmp", + "target": "sm_run" + } + ] + } + } +} diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/media/LICENSE.md b/sdk/analog-rytm-mkii/modules/improved-performance/media/LICENSE.md new file mode 100644 index 0000000000..aaca18e4b3 --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/media/LICENSE.md @@ -0,0 +1,7 @@ +# Rytm UI documentation captures + +The Modwerk contributor dedicates their original capture contribution to the public domain under CC0-1.0. This declaration covers the act of capture and accompanying original captions, not the depicted firmware interface. + +Elektron retains rights in its underlying interface and firmware. Module interface additions retain their author's terms in [../LICENSE](../LICENSE). No firmware, extracted stock code, raw memory/framebuffer data, card images or audio samples are included. The images are unmodified firmware-rendered pixels at integer scale. + +Manifest identifier: `LicenseRef-Rytm-UI-Documentation`. Capture identity and inputs: [capture.json](capture.json). diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/media/capture.json b/sdk/analog-rytm-mkii/modules/improved-performance/media/capture.json new file mode 100644 index 0000000000..e4e6c4b5a3 --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/media/capture.json @@ -0,0 +1,58 @@ +{ + "schemaVersion": 2, + "machine": "analog-rytm-mkii", + "moduleId": "improved-performance", + "moduleVersion": "0.1.0-experimental", + "records": [ + { + "schemaVersion": 1, + "machine": "analog-rytm-mkii", + "moduleId": "improved-performance", + "moduleVersion": "0.1.0-experimental", + "firmware": "1.74", + "capturedAt": "2026-11-21T07:50:00Z", + "imageSha256": "ba3c846291b71347dfdf8e16e56fdabef859b09efdd0b74f2e04d5a0a6d67309", + "build": "Modwerk's linker: the plain Rytm base (core-ar2 0.7) + this folder's Improved Performance 0.1.0-experimental compiled with -DCW_NEAR_MEAN=1 (the mark's threshold lowered so that it shows in the emulator, where the audio load stays low; nothing else differs from the release build), materialised against stock OS 1.74, --version IPCN", + "emulator": { + "name": "rytm-emu", + "repository": "https://github.com/trigcondition/rytm-emu", + "binary": "dtboot", + "settings": "no card image (the card starts formatted); JIT on; --every 1000M", + "revision": "c5732f0" + }, + "conditions": "Cold boot; four NO presses clear the notices; the main screen after 7,700 M instructions. The word CPU at the right end of the bottom bar: the warning.", + "captures": [ + { + "path": "media/cpu-near.png", + "plan": "DTBOOT_END_PNG=cpu-near.png dtboot ipcn.syx --instr 7700M --every 1000M --press NO@4503M:80M --press NO@5303M:80M --press NO@6103M:80M --press NO@6903M:80M", + "sha256": "7646cf51b0e7646ccdab3eb09fa3a85c397f8203b1f613ceda9ddd4f08fe76ad" + } + ] + }, + { + "schemaVersion": 1, + "machine": "analog-rytm-mkii", + "moduleId": "improved-performance", + "moduleVersion": "0.1.0-experimental", + "firmware": "1.74", + "capturedAt": "2026-11-21T07:50:00Z", + "imageSha256": "f4244b4a9e1c8685693f940314e2b106db0bfd6c680418f6a86dbf5a5ca3f706", + "build": "Modwerk's linker: the plain Rytm base (core-ar2 0.7) + this folder's Improved Performance 0.1.0-experimental compiled with -DCW_OVER_MEAN=1 (the mark's threshold lowered so that it shows in the emulator, where the audio load stays low; nothing else differs from the release build), materialised against stock OS 1.74, --version IPCO", + "emulator": { + "name": "rytm-emu", + "repository": "https://github.com/trigcondition/rytm-emu", + "binary": "dtboot", + "settings": "no card image (the card starts formatted); JIT on; --every 1000M", + "revision": "c5732f0" + }, + "conditions": "Cold boot; four NO presses clear the notices; the main screen after 7,700 M instructions. The word OVR at the right end of the bottom bar: the overload.", + "captures": [ + { + "path": "media/cpu-over.png", + "plan": "DTBOOT_END_PNG=cpu-over.png dtboot ipco.syx --instr 7700M --every 1000M --press NO@4503M:80M --press NO@5303M:80M --press NO@6103M:80M --press NO@6903M:80M", + "sha256": "4e3566338daec3c9a54ddb1c6b050f9f58220fcce13ac604d976f6994441d4bd" + } + ] + } + ] +} diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/media/cpu-near.png b/sdk/analog-rytm-mkii/modules/improved-performance/media/cpu-near.png new file mode 100644 index 0000000000000000000000000000000000000000..3c5060922ac97a9808af78a9ce267bf35fe55ef9 GIT binary patch literal 12960 zcmeHOeQed`6~09nDiKJxg!r*hpuql-F6g>6eq02Z+_8Y!M#u~kHd~pq9Z}){-Mk1Y zbZU^IG+IVymW%{45R6qE$=GzzDcE#maU7kv%uE;F7^?RvQ#d`ey`lX}rx#8E-zL84J zUYWV|mLIIG_}A-~{I>ds+u!VWYd(7F@Y}oYUwGHvrtS{^-#t(6-2RP0NyIc`N; zZ*_CFxv4PSc5!y`jOIztHSN6Qfc>$-_Lh3RwkuQF^;T`o`s$tAisSF(-moEz#~Gii z#uuq7+Xc_CYzDrKf89}CvEEjJAzL#&%YV|A9cw$m=t*3mX1zDcxGEc2v(=l18}F~# ze>8Wi?ZUlP-9HtUn`3*!T-aO6Ox06&{KGL%cdkBgG>q5TY(qTwtZn$>>Xhw5HaJo= z2Y-c2U=yrD^X3;ep6cUHc6ev>jG@I~lnNV(qsTPccwu_S+13TNi!@A8-?47|VcQ$# zq8nunzY(2GhQNRk9tbnoyt6Ym&g?EVYi~V}5t|j*>3v#$3$_7jWM(=E9!$|n4c-x$ zcs^Z4?C59$XLfw%(BZ~Y*OY)2;Np=C@-t%F!tg|M`3C~r%|8tWG(84~5wGxTtAQQB zhh^cZhK{pcQw#>Q7(H`E%DbEHfhkf|%{;$GVB#mZx8+k4;3;<8H7#qm!pc=XmKZ9) zE8|b=3qf`yn{tE)G$Sy}l@YL-hmgasuO|1Rohz`yA&kek9(n!4^ac;c$XOu{fDWLO&Jt+@YXBd92Y!VSke}lI3D9AM@ky!a z%0q-;lx>rfgj4EoQF@7fWprG!J`NuYOK(cPP|ip#7{r%6dy-EuWIp+0ss(!)fR`FF zjcCpn+>(Jq1K$pNhB>0gj z5p)qf5XX+x0h5i47yZh-3>!1W1Gqx<>f#r{O-alRcA=L8^_InIA{&-~Kkx<)t=tdZ z1vm`r+>DTe5KHnd(|j)6x&^(DefdUEqTY6$_*%JF2pHmY&h%>++@G(}Anuw{0$C1_J|i&_TKo%9i%k)LcnrbGrZR!=FQ1b_kOQ^&e_9Bk^erPEEZ!4w|Y z%fx8%_Hq3v2h8ndrkt?f1{-2Bm2MM-t)G0^X7@{Tf6D5B{0;ov*MPw9pZwQaFhTZO zlP~V}4rB~>ugS&yrUMX71B)LS=vs;Akp3b4avSZ_-C*?40~>Hm(tCZL$(y4JWv9)c@eIO~%k$|24X z#*mz7nSt<=G0?5-&p==nR#IWABEYeCvsxGf z#fh`BmDQha^HgU|1GE63f7(a&w|6C*4>pnrHybq;14Pod?zo8(Wq1ftuziJ{Z`Ml? zAnNvrV=)zbgvM~wZ4zxhUD=avw;jQPQF|yf#@ulR3I}NCtEp@R49IRA+E*H;VH8AU zD6Aa{Xz?mLG@XXFo6Yp4ZJf}+axamA7{+o@Z#~7)qeV&yE`su+hkX{?VTwxdZnZ%0 z8DxQ1QaWxC62O@`6p&C26}oc16~slKvPZOUHp@^tTTM0GNdZb)aiC^{bf4@IO`vWU z@TL-l2&A)Qd()5Ip`}`^-iR0cO-E3!qgilb1Tv9TkBlfgkqJ2 z1nNI|QNYTQuxS@vCf$%$+m?qT^DIu25Gr$>g256FV_)s=C?YK^0=g96oWimhC{r*i zVYJ$)EvSM#J;n#RD%2?aiaZyBnOxEArjs2RG8aI+jB345h+-|@MFFgD7`Y+_QKDxZ z&sbK^gK&(Ju_(I9*d(lqV#tcv-R^4__0x^+&Tnez%+Bgug2Fnxp{XzrB4CnL!spU& z)Vdcyw&U(Q=2pZtYxa4o(Nw9~NVkzqdS9%%dsyO)=jXwROV3Zh;lQW94&Fs7R(;qz zH@|ED(QI8Nk4mvvw+<>Y1=nD9g#n6G2p0DNE5c!GVF0Z(Q)1iLFw$SX6=~v*;YwiC z*8zGV6B+9q^!15XW=bbzs@wmT9+BmR*JQ|jASz$KzRa{Sk5Bilw5aH__B$+IDp;k) z$`r#ELq$JiC;F6O$+V7hO9o4+`K3wS?q#0`_)fxdBU~|-iBYfm+W&0nRV?btNFE>5 z>MeS!ej3Z8t!gC~>YhYUmyx9JT6ztA!C*1gIJ4PQflof(?jd#1p@Dm>dXd`S##}33 z`{qC(Z1#pdFm92auvQQHCSXnpkE~RBT&Ad$J@KY!ai|5g2NbeuQNs@HJX)FR<(2&- z+hHp84T+;L)4W@*GH4nO3MIb49`H&a-#fINul0F~ujwq4pzXBLv;{<^#r-@Qa4}w} zHsfzp-*JtVz1pY0VXTQJkf||jAHCNSSgUl&J*8N+o*E7B(21(@+RX&2mc;sE5HRMT z;@74>%|(W{C#V*wB|DzL$k@ZkBqm4)703u~l*#yX!m$i@@25}Q6E*in@*p`|pWgYYm?KND5njLF)!i)Oh41w|> zw}Z9AU`&p-k$B(#IU2e5+$w^nq&3JIJQ8rtIJ5O6mu=otXd7B$ve=jIr695v72?}6 zt(!4ou}!W+8x4^@(Dm4>Cv&t-Ry01HZeRvcJ%#>g$lzt>onSpwWke*uvlFHdyWgmo zy%%rKp0TJld9kPPP}PP0ELQ{?@>Ld%u@gb&SQlD32RMaL52dKpc{vtciVpPn6A8O@ zqPxcw5M(9L5+tWDgBj-1k}4oQ>aS)a&dTh;AEZ14~Ahxk)zK^{#lze>I53;y0We)vX6#Evr{{6iSWv#+)YpY8n zhn@hEue#+@DrzWEj^=Nho9``JO<*N%q-#-F;}CocsA~q{iA494IV3+}12zjxE2yon z-uXoo9-rCqaMvK*=}Aro{$MrA*AW3z@I+kl54L8ZhULAcqX}hd!vx=Lz{C+kEpMRv z;cH@G5q1k+;qt|5)N)*cQ=_)|7W0};YiQ$fal|^=o z1@Mrn*h+8uehATSPYfXfHZlamp)Uk71Pl1gba8J*alOzzM0-DQ%>5h}3eWf16)C%r z_(!~&J)Pqf3|v9%dmLY$Pi|5n5C+4#*hh-6jyqR<(>#VHo8ZbN?l(_2?R~A?Xe@3{ zp??X#jQFMdRcOUg8p9F?Pv*XiDbIN7@Qo}GF>(QrQ`{ASTl!^gizj(k?X~C9^K0fZ zy9qQQ8yHoweF8X&esy~j+tD`y4Wba9R!0G#$CL1mTN*MZ=hXA~UbhW_TT7Z>poNfh zbWeuGgc??4dZcvxExHp0-bzs-LB;BR8m_v)O$ZaXky$lT3V}J*?kbx1y5tHUVi1Cg zD`INqNV^p|?4?Pi1+B)U4^O~7ylrO{;s-1&lWT)K1pHgVfQi0Q1C;$OyR4V}c5((? zVD(d5e_Z!phrLwA9HQhH-`r`i;u%4Xk`nh7%#wAsTOA@CTAGERr!Y_t4~W#Ft}D6B zBT*?ZGYI80-DuPRc@nNb6{WVmn2%QsCWCs63JuquOUMlDpCjsB35F zPlxzqTfXe=IKc)?r|81q1XD#*ggAuLOQoUGC-)6oqCzG86@QSIA5jRn^U3Abj>W3Cv--v>IOlEz(ziaV1O<7JMH=s5C^%5 z{dFG-hIjLPh5!mAZ=!o~u$vr$q^Nf_5`030d)AjMNEQGZ4AnK6&wYWH`&9Gz!IKXg zPcpBL{F{RKcr&_aTkWo#6d$6z*&OF}dO||5>-`-^()x@PD49GV>SR Kx_9o14gUjv0srU# literal 0 HcmV?d00001 diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/media/cpu-over.png b/sdk/analog-rytm-mkii/modules/improved-performance/media/cpu-over.png new file mode 100644 index 0000000000000000000000000000000000000000..17524abdfdbda82cbf9fed9a44b41f2e7f112c37 GIT binary patch literal 12988 zcmeHOe{7ZI6~5)iK#4%QCBz?-Uj>#dQiHA;(RmSM(6NBoM#u~kH>k|njwo^d+&%;q zIyFd98idiAB_n|h1Y-R$ldD@pV8|M?5G4JBghZRL%%&m4f|vX5InVRH-+jOKwn3eV ze=IS#<@WpD@4V+c=Q+ajm>yygBAOWNN&yT{$t^2U30%PzU68`qv#>RzjPV0+WPi*C%RkM`^>-CuuZ zR@d_LZoSKU>-#a6=IZ|ezFjpufn*>~sc&ZM~}_bMLW zG3K5f-8Icgb5m)WS#e>>^yUfMn|2L9Xn$-l+j8&Jb=FsR9<8fgSF>wt`To0U8w|qz z*yHvZe36@ER&Wo?r{mlB*PS(0>+C6TWNZDI6~EY#j514b_XIwncAa<1m`QeL?H2DE z8s1xb;CSH74@4%`w}s7HrFztIo_m_0h-|I@TUM9`4uP%ph)j=2m=hZO*Ka z4~~`H!Cw&)_ykX(dy9)2&-Kufojw?6M$%(&N|oJ-t;jVpyfm%-LhC}aA`e%rYJYU> z5wi_zF^qDDH$*#=BXGkI7lajT-C6aw&gjazwR;ti5xW)G>3%_R3%&tr}YEOXEL__?IVrnuFHTG;Nq4H^3!AA!tq3NslV!0xwVU zxx`cfUYUP-z7S+vvL%POKq~^Xd@>SN>kxAI72ch>711>$a5e0pZC>gz+?_KB!eTju zuBe)0xJFKd=TD$*0wO&mq`TP>@*fHL92OE5Lu@>Q;BF;2Jqe)Dweo#`1_8x@e*%L5 z)TOBz1`(d<{N?v5j})lZg^1kSInoFBttiT{42VP-5gNroq!}#ls!3KLLXw~83k1XL zj4ThR2|!3ugT1=Z9wjNAkjJ=X@h4YP@`};KNqBfL%tBTR?i^)M@az;E8-ZRMM40d> zFp79KWSt1QY`GFEY{Gbq&m*sYlwa?`7zHcj0nh<-GFT#QU=85I@4&Ax0`gPdKMOjn zGCs+=t};XjM)@|~N!X?S7L}LiS7yiXb#eOOw*1EQ3)PI=!hU?oy{GjAx6CJhOtECI z0Pw6MLygG-M%+)|@B*P%i|KC>RH9!=xS)@~FT!yJ!b!6%su*xqYQ+{Kt+$Vq6FLL; zP~eBAM9@WaL7Y2M2P`&nUi2&LGJMPu58w*bYs+7RFr_)yKZITmtgfG4=*&4H+h+tN|mEvewv9DWI zfz@%D7f~#$hCr!-P)1S#L-(Ze1PUbZZ+6Ep*$Vr^zNV&l5NCit5Mw++_e0Y}%fd}? zR&mDGj)7^ZEg&Kw0svJ6lG0DQ2?jTkd~kcj-FlWT#-}Ny4L%7|9*K&&C<^yO9LD)A z=~NaiS)ID?t+Rz~w(3%sOzv9#(23**|@tHk)ZJkkH_-Emzrn^_Q^d*N4 zvBmt#9VnHhwgXoA-HGw;FOBCwC+?>9N4M0UaaUVr_PXbI%l>Ej)-=SIcYa{H$F1fq z$#*)iI|DWZ4}6(yvI1=?ZgERrzJoDhFp3i`#+1lF#@fjxv;c76eCk*?k2jk-ZRv26 z?PdxO*fKs^ylqS`+5roDg(b%wu$v7r_0?`8g{@zF`6l;-g+FI~K=BrS?r%Wi_fGsr z9he}w!Q_j(vmF(~-EVTSxbYxFQ{R#&`#M+SI+TA%zrqIlba&ZO?v+LmdFiBSvc7Q* zDC)h1ZKe^DZ<)Gs-}nNLT(Z(kWB$Wfv!?dv_Dvh*e{uzlT}3Mv@y|03nH8I#>ihql zMn*$cX~A;~>D3QSo0b+ZwoBM6x~lQ+eRgW{`&eE#l~8Hr zVilG-$|f$KJClFe76&q6-062|Vhw}%;2_K7*=!a^%_%Oh#Vr+p0%2jZH7*8R%VYgx z#XqApNBe%*wlI8B=}&ema?}3#&1hfal+xN{t%1BZ-$DS7@QTz>KE$>+vTJYyeUM*o znobRu%WZPM$3nS;***f`V)GS$ z8?a}V90+K{GyZE*(~(?5hYzd?{<;@YxFnWcwqm?-7W(31&y$z?(<%(K7uzajco>Z+ zG?2F18e|lOt7RpsSGXsYVQ48_W0>4QYDw27SK3z45JOla;+))2p=(@V(H&!RGGsZ# zIno%C6C*PaetHjdE9Wy1n5ETJm}>bTUrmwzc#?T}r1wU4cmT*0o-!U`pm_#TlV7+%#K6#^VmnPy3Er)i z2)=?W^h!$GEkgo0vw#8;>Y>6^&X0ol(C6(E+09`YT4(F22HPn>NiX)*u9xnUKcWRR z?E>D^q7Z=$mV9seu`7&J%iSCCg1>1Cs&#Y=_E0XBQ@% zGPp~jQHX^h!4q%`?X5wRMiT7LOl5y!xsaXGg$bq?Ed;elLzotj!KvpgFrg+i2T#ZC%feZ$NZF^Cd9 z>v+bpejbEll#GXBnhYc1RWw7^#O`s|f2N;qL|1WROGh%ZV<{TzWPMX<9z?(d>x3`n z->q}6fNaM+aKhaa_pHgw)}yIYvpd}e4(WZf>h5EUHx<|V%YAFVCR1AF?AHv=;`@vXv5M!(f!ZVk^qTU4ym2 z=&u9xLM1ZRdDHhNUYV(!ROoI$&2EwHh1X=LeIP2|zrMz@F^^aGthTJ^vGF@Ro)xT8 zV-=cV%b{`{lJUM|STUW=wIze4)cm7K-R?DC2l!6HY9m51iiJ_H`r7_(~UsssDhY$KI*?>k?BWn1eja#eGy}W*4 zXg^G$z9DgxW>|D9bp}m?K_L?h*nn38#qNRae4VdTd`)MS1Y@TSrY#^UE$`>iflKg0 zwHbe-`i^_7g`sHz1_@Iyr92H`~RiHs%}| zp`497>xx(zy1Uc_1fw}@x}t|PFo=gRanlHHhglk?R1DDj^w(e=YBI|FgctRLIRfoL zVJCZs{+JwLcjA5jSLn`t7uOIxnb9D7@JPTlW6w5|T)t^;Yj3j)SmN(__zE!*-o*4{{sNEcS4AhL(>n`#~0$r_7;W%VOU$*T27)qij^zWn*=T zkyj4ei?e1 zVewrYUkODZm&4PSKu}%af^=48_2(U<*fQW@0Fp%{%#xa&eVKIOt0wi1n*Zo+*6ukz zk#yKg9t_v^r-S``QN?RS6KJh9QM32|a#-ine)fSR(hE+A-jG)Pxl08j;L-DohJ9@R zyZ|216okzX3rOR1OrD9d!E6Um(r6|NQC~dF3*u7tmDj8&s2|L$tHwysr$nVP5a(zGa8GB zQhOas5HV^2kW;pbz|DSH*z8H()p+f>?9#(? zS=|JhPz{W#I6eU!MZY?|33K#~K!Yqqq%~0h=y4^YLs7n5lg(Qs4%4)9itE0@A>!b;8}D~j&pvnUPL z4g$7llJEu|#R{jG2fFBt4O^(s7+Z&*JYG1dYx0LOqa!mxYB2{`p>&wi=Gcl{eyWiz_rO_+26@;+ zI2F>pjSk#fd zVotohV*X#q^B}l*71@ewI6z6$FwzUiUjsdRE#tWr;WRp5umuG8GwZ^b +IMPROVED PERFORMANCE +The audio block as a row of pieces of work: the ones that would change nothing are left out, and the load falls. + + + + + + + + + +AUDIO BLOCKEVERY 32 SAMPLES +WORK THAT CHANGES NOTHINGLEFT OUT + + diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/modwerk.module.json b/sdk/analog-rytm-mkii/modules/improved-performance/modwerk.module.json new file mode 100644 index 0000000000..f7bccbdef1 --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/modwerk.module.json @@ -0,0 +1,160 @@ +{ + "schemaVersion": 3, + "id": "improved-performance", + "name": "Improved Performance", + "version": "0.1.0-experimental", + "machine": "analog-rytm-mkii", + "category": "system", + "exclusive": false, + "author": { + "github": "npp1993", + "name": "Nathaniel Pavel", + "credits": [ + "Nathaniel Pavel (@npp1993) — the mod, its design and code, and this Modwerk module.", + "irpina — Elekloader and core-ar2, the core it links with, and its audio load figure." + ] + }, + "maintainers": [ + "npp1993" + ], + "presentation": { + "label": "IMPROVED PERFORMANCE", + "family": "Audio engine", + "summary": "The audio engine leaves out work whose result it already knows, so the same pattern uses less CPU and the screen and keys answer faster. A CPU mark shows when the load gets close to the limit.", + "overview": "Stock computes nearly everything in every audio block, whether it is used or not: all eight sample voices, every send, the delay and the reverb, every modulation pass. Improved Performance tests, block by block, whether a piece of that work can change anything, and leaves it out when it cannot: sample voices that play nothing, sends at zero, a silent delay or reverb, modulation with nothing to modulate, parameters that are not moving, the USB audio input when nothing streams. The output is stock's bit for bit, but for one thing: a delay or reverb that has died away below -114 dBFS and has no input is given exact silence. With the time saved the unit redraws and reads its keys sooner, and a busy pattern keeps further from dropouts. CPU appears in the lower right corner of the bottom status bar while the audio load is close to the limit, and OVR while it is over.", + "highlights": [ + "Less CPU for the same pattern: nothing to set", + "No audible change: stock's output, but for effect tails below -114 dBFS", + "CPU in the lower right corner when the load is close to the limit, OVR when it is over" + ], + "usage": [ + "Add it to your set and send the OS: there is nothing to switch on.", + "Play as usual. The sound is unchanged; under load the screen and keys answer sooner.", + "If CPU shows in the lower right corner, the audio load is close to its limit; OVR means it is over. Mute tracks, lower sends or take a module out of the set until it goes." + ] + }, + "access": { + "location": "Nothing to open: it works by itself. CPU or OVR shows in the lower right corner of the bottom status bar while the audio load is high.", + "steps": [ + "Add it to your set and send the OS: there is nothing to switch on.", + "Play as usual.", + "If CPU shows in the lower right corner the audio load is close to its limit; OVR means it is over." + ], + "screenshots": [ + "media/cpu-near.png", + "media/cpu-over.png" + ] + }, + "controls": [], + "compatibility": { + "releases": [ + "1.74" + ], + "requires": [], + "conflicts": [], + "limitations": [ + "Analog Rytm MKII, OS 1.74 only.", + "One part is not bit-identical to stock: once the delay or the reverb has had no input for the length of its memory and has died away below -114 dBFS, it outputs exact silence where stock keeps computing that residue.", + "CPU and OVR show only on screens with the bottom status bar: not in menus, lists or browsers. They take the bar's lower right corner: another module's mark there (Loop Sync's SYNC) is covered while they show.", + "Tested on one unit, with one project, in a set of 17 other modules. A project load while sound rings and a long USB audio stream are not tested.", + "What it saves depends on the project: a voice, a send or a modulation that is in use costs what it costs in stock." + ] + }, + "platform": { + "kind": "elemod", + "core": "0.7", + "build": "build.json", + "events": [ + "ev_render_out", + "ev_tick", + "ev_draw" + ], + "claims": [ + "ui:status bar lower right corner while the audio load is high" + ] + }, + "resources": { + "memoryBytes": 3880, + "fastBytes": 0, + "load": { + "display": "Lowers the audio load: 85 % to 72 % of the block on one pattern in the author's set (unit)", + "method": "hardware", + "conditions": "The unit's own meter (the core's audio load figure, averaged), the author's Analog Rytm MKII, OS 1.74, one 12-track pattern played hands off in a set of 17 other modules on a development base: 85.4 % without this module's code (17 Nov 2026), 72.0 % with it as one module (20 Nov 2026); longest block 99.4 % and 87.2 %. When no part can skip anything its tests cost about 2 % of the block (read from the source, not measured)." + } + }, + "evidence": { + "tier": "none", + "moduleVersion": "0.1.0-experimental", + "sourceSha256": null, + "reports": [], + "hardware": null, + "verifiedBy": null + }, + "tests": { + "report": "TESTING.md", + "summary": "rytm-emu: alone on the release base and beside 17 other modules, output and engine state identical to stock over about 69,500 blocks; a kit load with the reverb ringing identical. Unit (author, OS 1.74): self-checking builds of every part counted 0 differences against stock; one pattern's audio load 85.4 % without and 72.0 % with, in an 18-module set. See TESTING.md.", + "documentation": { + "tutorial": { + "title": "Quick tutorial", + "steps": [ + "Add it to your set and send the OS: there is nothing to switch on.", + "Play as usual. The sound is unchanged; under load the screen and keys answer sooner.", + "If CPU shows in the lower right corner, the audio load is close to its limit; OVR means it is over. Mute tracks, lower sends or take a module out of the set until it goes." + ] + }, + "screenshots": [ + "media/cpu-near.png", + "media/cpu-over.png" + ], + "captureRecord": "media/capture.json" + } + }, + "license": { + "spdx": "GPL-3.0-or-later", + "file": "LICENSE", + "declaration": "Original work by the author, under GPL-3.0-or-later. The source names firmware addresses only; the patch preconditions are addresses, lengths and SHA-256s." + }, + "media": [ + { + "path": "media/thumbnail.svg", + "kind": "thumbnail", + "caption": "Improved Performance: the audio block with the work left out that changes nothing", + "alt": "A row of blocks, some drawn faint, under a load line that sits lower on the right.", + "credit": "npp1993", + "license": "GPL-3.0-or-later", + "source": "Original illustration in the shared signal-art style." + }, + { + "path": "media/cpu-near.png", + "kind": "screenshot", + "caption": "CPU in the lower right corner: the audio load is close to its limit. Nothing to press: lighten the pattern, lower sends or take a module out until it goes.", + "alt": "The main screen of the BD track; at the right end of the bottom bar the word CPU in the bar's own text.", + "credit": "npp1993", + "license": "LicenseRef-Rytm-UI-Documentation", + "source": "original", + "capture": { + "type": "emulator", + "release": "1.74", + "moduleVersion": "0.1.0-experimental", + "imageSha256": "ba3c846291b71347dfdf8e16e56fdabef859b09efdd0b74f2e04d5a0a6d67309", + "setup": "Headless rytm-emu (dtboot, c5732f0) running IPCN: the plain Rytm base and this folder's Improved Performance 0.1.0-experimental built with -DCW_NEAR_MEAN=1 so that the mark shows, linked by Modwerk on stock OS 1.74. Firmware-rendered 128x64 screen at 3x. UI documentation capture only." + } + }, + { + "path": "media/cpu-over.png", + "kind": "screenshot", + "caption": "OVR in the same place: the load is over the limit, so the screen and keys slow down and audio can drop out. It clears a second and a half after the load has come down.", + "alt": "The same screen; at the right end of the bottom bar the word OVR in the bar's own text.", + "credit": "npp1993", + "license": "LicenseRef-Rytm-UI-Documentation", + "source": "original", + "capture": { + "type": "emulator", + "release": "1.74", + "moduleVersion": "0.1.0-experimental", + "imageSha256": "f4244b4a9e1c8685693f940314e2b106db0bfd6c680418f6a86dbf5a5ca3f706", + "setup": "Headless rytm-emu (dtboot, c5732f0) running IPCO: the plain Rytm base and this folder's Improved Performance 0.1.0-experimental built with -DCW_OVER_MEAN=1 so that the mark shows, linked by Modwerk on stock OS 1.74. Firmware-rendered 128x64 screen at 3x. UI documentation capture only." + } + } + ] +} diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/src/cpu-mark.c b/sdk/analog-rytm-mkii/modules/improved-performance/src/cpu-mark.c new file mode 100644 index 0000000000..862631a346 --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/src/cpu-mark.c @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Improved Performance's CPU mark for the Analog Rytm MKII (Nathaniel Pavel): a word in the status bar while the +// audio interrupt is close to using its whole period (CPU), and another while it does (OVR). +// +// The core measures each audio block (32 frames, 1,500 a second) from its ev_render_in to its +// ev_render_out as a share of the time between two blocks: core_audio_load, 256 = the whole period +// (analog-rytm-mk2/load.h). ev_render_out here reads the last block's figure: it adds it to a sum and +// counts the high ones. ev_tick (about 20 a second) looks at them every CW_TICKS ticks: +// +// over (2) the mean is CW_OVER_MEAN or more, or CW_OVER_BLOCKS blocks or more read 256 (the whole period) +// near (1) the mean is CW_NEAR_MEAN or more, or CW_NEAR_BLOCKS blocks or more reached CW_NEAR_PEAK +// +// One block's figure alone is not trusted: the core divides by the time since the block before began, so a +// block that follows a late one reads high (an 85 % block can read 256). The mean does not have that fault. +// A level stays up for CW_HOLD looks after the last one that found it, so the mark does not flicker. +// ev_draw writes a word into the bottom status bar's lower right corner, in the bar's own font and on its text +// line: CPU for near, OVR for over. The corner is the word's: another module's mark there is painted over while +// it shows. On a screen without the bar (a menu, a list, a browser) nothing is drawn. +// A redraw is asked for only when the level changes. No stock site is patched; the draw calls stock's text routine. +// +// Why these figures (the author's MKII, 17 and 18 Nov 2026, a set of 18 modules): with the mean at +// 80 to 85 % the unit played normally and the UI had about a quarter of the time; with the mean at 92 % +// (blocks over 100 %) the UI got no idle time and its queue grew by the second. The interrupt's own +// entry and exit are outside the figure, so the real share is a little higher. +#include +#include "analog-rytm-mk2/load.h" + +#ifndef CW_NEAR_MEAN +#define CW_NEAR_MEAN 225 // 88 %: the mean of a look +#endif +#ifndef CW_OVER_MEAN +#define CW_OVER_MEAN 236 // 92 % +#endif +#ifndef CW_NEAR_PEAK +#define CW_NEAR_PEAK 248 // 97 %: one block ... +#endif +#ifndef CW_NEAR_BLOCKS +#define CW_NEAR_BLOCKS 8 // ... of which this many in a look (about 750 blocks) show near +#endif +#ifndef CW_OVER_BLOCKS +#define CW_OVER_BLOCKS 8 // blocks reading 256 in a look that show over +#endif +#define CW_TICKS 10 // a look every half second +#define CW_HOLD 3 // looks a level outlasts its cause +#define CTRL_REDRAW 0x20 // ev_tick's ctrl: asks for a redraw + +#define CW_UI __attribute__((cold)) + +static volatile uint32_t sum, blocks, high, full; // written by the audio interrupt, cleared by the tick +static uint8_t ticks, level, near_left, over_left; + +// The audio interrupt: about a dozen instructions a block. +void cpu_warning_out(void) +{ + uint32_t l = core_audio_load; + sum += l; + blocks++; + if (l >= CW_NEAR_PEAK) { + high++; + if (l >= 256) + full++; + } +} + +// The tick reads and clears without masking the interrupt: a block that lands between the two is +// counted in the wrong look or lost, one in 750. +CW_UI void cpu_warning_tick(void *ctrl) +{ + uint32_t s, n, h, f, mean; + uint8_t now; + if (++ticks < CW_TICKS) + return; + ticks = 0; + s = sum; n = blocks; h = high; f = full; + sum = 0; blocks = 0; high = 0; full = 0; + mean = n ? s / n : 0; // no block in a look: the levels run out + if (mean >= CW_OVER_MEAN || f >= CW_OVER_BLOCKS) + over_left = CW_HOLD; + else if (over_left) + over_left--; + if (mean >= CW_NEAR_MEAN || h >= CW_NEAR_BLOCKS) + near_left = CW_HOLD; + else if (near_left) + near_left--; + now = over_left ? 2 : near_left ? 1 : 0; + if (now != level) { + level = now; + ((char *)ctrl)[CTRL_REDRAW] = 1; + } +} + +// The words, in the status bar's own font and on its text line: CPU while the load is near its limit, OVR while +// it is over. Stock's text routine and font (OS 1.74; the addresses come from build.json): x is the text's +// centre, y counts up from the bottom row to the text's bottom, the fifth argument centres, the sixth draws dark +// on a lit ground, the seventh is a string as wide as the widest text. +typedef void (*text_draw_t)(void *bmp, void *font, int x, int y, int centred, int dark, const char *width, + const char *fmt, ...); +typedef void *(*text_font_t)(void *ctx); +#define MARK_Y 2 +// The bar's lower right corner belongs to this word: whatever else stands there (another module's mark) is painted +// over while it shows. The text's right edge is in line with the transport icon's above. +#define CORNER_X 119 // the text's centre: columns 112 to 125, the bar's left margin mirrored +#define CORNER_FROM 108 // the columns painted as empty bar under the word +#define CORNER_TO 127 + +// The bottom status bar is a lit band over rows 55..63 with a dark row above it. A column's first word holds +// the bottom 32 rows, the bottom row in bit 31. +#define BAR_ROWS 0xff800000u // rows 63..55 +#define BAR_ABOVE 0x00400000u // row 54 +static const uint8_t bar_at[2] = { 1, 87 }; // the bar's left end, and the column after the pattern + +// The bitmap: width at +4, height at +8, words a column at +12, the words at +16. +// Nothing is drawn where the bottom status bar is not on screen (a menu, a list, a browser). +CW_UI void cpu_warning_draw(void *bmp, void *ctrl) +{ + uint32_t *w; + int stride, i; + (void)ctrl; + if (!level) + return; + if (*(int *)((char *)bmp + 4) < 128 || *(int *)((char *)bmp + 8) < 64) + return; + stride = *(int *)((char *)bmp + 12); + w = *(uint32_t **)((char *)bmp + 16); + for (i = 0; i < 2; i++) + if ((w[bar_at[i] * stride] & (BAR_ROWS | BAR_ABOVE)) != BAR_ROWS) + return; + for (i = CORNER_FROM; i <= CORNER_TO; i++) + w[i * stride] |= BAR_ROWS; + ((text_draw_t)TEXT_DRAW_AT)(bmp, ((text_font_t)TEXT_FONT_AT)((void *)TEXT_CTX_AT), CORNER_X, MARK_Y, 1, 1, + "XXX", "%s", level == 1 ? "CPU" : "OVR"); +} diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/src/effects.s b/sdk/analog-rytm-mkii/modules/improved-performance/src/effects.s new file mode 100644 index 0000000000..48cb5a6429 --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/src/effects.s @@ -0,0 +1,851 @@ + | SPDX-License-Identifier: GPL-3.0-or-later + | Improved Performance for the Analog Rytm MKII (Nathaniel Pavel), the effects: do not compute the send mixer, the delay + | and the reverb where the result is known to be zero. Stock OS 1.74, audio interrupt, once a block of 32 + | frames. Stock runs all three in full in every block (the three measured 16.4 points of the block on + | the author's MKII, CM02, 17 Nov 2026). With QUIET = 0 nothing here changes a value stock would + | have produced: each part acts only when what stock would compute is zero by its own arithmetic, tested + | in that block. The release build sets QUIET = 1: the delay and the reverb then also rest after use, + | the one place where output words differ from stock's, by less than -114 dBFS (below). + | VERIFY = 1 and COUNT = 1 are test builds: they need sites and symbols that build.json does not carry + | (TESTING.md says how they were built). + | + | MIX = 1. The send mixer (in 0x4010e6bc). For each of the 2 sends stock first computes, for its 8 + | voice slots, a ramp step (target - gain) >> 5 for the left and the right gain (0x4010e6f4, left as it + | is), then for 32 frames adds gain * input word for all 8 slots in two accumulators and steps the gains + | (0x4010e764..0x4010e7aa). A slot whose two gains and two steps are all zero adds exactly zero to both + | sums and its gains stay zero. fxr_mix (from 0x4010e75e, in place of that loop) lists the slots that have + | work and runs the same sum over those only, in the same order (so a saturation, if any, falls where it + | does in stock); with none it writes the 64 zeros; with 6 or more it hands back to stock's loop, which is + | then the shorter one. The accumulators are clear here: stock's ramp loop ends each pass with MOVCLR of + | both. + | + | DLY = 1. The delay (0x4010da24). Its set-up (0x4010da2c..0x4010db12) stores what it derives from the + | FX parameters (0x8000e008..0x8000e018) and is left to run. fxr_delay (from 0x4010db14) then tests, in + | this block: the filter state (0x8000e11c, 4 longs), the input gate's state (0x8000dff0, 6 longs), the + | send buffer as it stands after any module added to it (0x80007a44, 64 longs; Audio In Routing adds at + | the delay's entry, before this), both fetched windows whole (2 x 272 bytes at [0x8000ddb0]; the + | crossfade's last pass adds window B's 65th word into ACC2, which the filter loop then starts from), and + | accumulators 1 to 3 with their extensions (stock adds into them without clearing first; ACC0 was + | cleared at 0x4010daf8). With all of that zero, stock's four loops up to 0x4010dd6c produce: scratch + | 0x8000e01c zero, the window buffer zero (it goes back to the ring), the delay's output 0x80007c44 + | zero, filter and gate state zero, the send buffer unchanged (zero), all four accumulators clear. + | So those loops are jumped: the 12 bytes the set-up pushed are dropped and stock goes on at 0x4010dd6e, + | its last loop, which runs as ever on the zeros (it steps the four input gains at 0x8000ca00 and stores + | them). The output buffer and the scratch are set to zero once, on the first rested block (only the + | delay itself writes them: 0x4010da2c, 0x4010db1a are the only places that name them for writing, + | and the delay's init 0x4010de92 clears the scratch). + | + | REV = 1. The reverb (0x4010d434). Its set-up (to 0x4010d542: values derived from the parameters, the 8 + | allpass gains) is left to run, and so is its modulation step (0x4010d7ee..0x4010d840), which moves on + | every block. fxr_rev1 (from 0x4010d544) tests: the input filter (0x8000cd08, 2 longs), the four tank + | filter sets (0x8000ccbc, 16 longs), the buffer one block hands the next (0x8000cb10, 32 longs: loop E + | reads it before it writes it), the input 0x80007b44 (64 longs, after stock added the delay's output) + | and every byte the 17 fetched line windows can occupy (0x8000d1e0..0x8000dd0f). All accumulators are + | clear at that place (the allpass-gain loop ends with MOVCLR of all four). With all of that zero every + | product in the reverb's loops has a zero factor (the one constant put into an accumulator, -1.0 at + | 0x4010d5d0, makes a coefficient that is then multiplied with line data), so the lines' new samples, + | the output, the states and the hand-over buffer are zero. So the first six loops are jumped to + | 0x4010d7ee, and fxr_rev2 (from 0x4010d842) jumps the other four to the function's end 0x4010da1a. + | The windows are written back to the rings by stock's transfer as fetched: zero. + | Not testing the windows: every ring is written 128 bytes a block at a pointer that advances 128 bytes + | (0x4010e83c, 0x4010e870), the longest ring is 64 KiB, and the transfers wrap inside each ring (their + | descriptors' modulo: fetches 0x4010e082, 0x4010e0c8; writes back 0x4010e14c, 0x4010e1a4). After 512 rested blocks in a row every ring holds only + | zeros, so every later fetch brings zeros, for as long as the rests go on: from then the window test + | is left out. One block that is not rested starts the count again. (The rings' only other writer is the + | clear at 0x4010dfd8.) The loops' scratch (0x8000ca10..0x8000cb0f, 0x8000cb90..0x8000cc0f, + | 0x8000cc38..0x8000ccbb) is set to zero on the first rested block, as stock would leave it. + | While the windows are still tested, the test waits for the fetch chain's last transfer to be done + | (TCD30's DONE bit, at most 127 looks; without it the block is not rested): stock itself only waits + | until that transfer is loaded, and reads its line late in the function. + | + | QUIET = 0: once sound has passed through the delay or the reverb, their state does not come back to + | zero in stock (emulator, 18 Nov 2026: the truncating filters settle on values of a few hundred in + | 2^31), so with QUIET = 0 these two rest from power-on until their first use and not again, and no + | output word differs from stock's. + | + | QUIET = 1 (the default; the author, 19 Nov 2026: part of the base set). What is said above about + | setting buffers to zero and about the 512 rested blocks is QUIET = 0's (QUIET = 1 sets only the + | delay's output to zero, once for a run of rests); with QUIET = 1 the delay and the reverb also rest + | after use, as follows. This is the one place where output words differ from + | stock's: by what stock itself leaves when idle, words of the size of QT (2^QBITS of 2^31) at most. + | For each of the two a count of quiet blocks in a row (fxr_dq, fxr_rq; 0 at power-on and after every + | block that is not quiet), counted to the ring's length in blocks, DHOLD or RHOLD. (So after power-on + | stock runs for that long on its zeros first: nothing is assumed about what the rings hold at boot.) + | A block is quiet when the input is exactly zero (and for the delay the gate state and ACC1..3, as + | before), and the filter states, the hand-over buffer and the fetched window words lie in + | -QT..QT-1 (the reverb: every word the windows can occupy; the delay: the 65 of each window its first + | loop reads). While the count runs, stock runs in full. What stock writes to a ring in a quiet block + | is made of quiet words only, with a loop gain under 1 for the delay (tested, below: a written word + | is then about 2 QT at most, the high-pass) and of 1 at most for the reverb as far as seen (its + | coefficients are not read; at DEC 127 its tail held level without growing in the emulator, two + | settings), and a ring is written through once in its length: when the count is full every word of every ring is small, wherever the taps + | move to later. From then, for as long as the input stays exactly zero, the loops are jumped as above + | and the output is zero. Nothing else is written: the states stay as they are, and stock's own + | transfers go on writing the fetched windows back, so the rings keep what stock left, moved about but + | never amplified (the delay's last loop takes 1 from a positive word in each pass). (A first version + | set states and rings to zero. Stock can build a tone out of what it has left when the delay's + | feedback is raised with no input; from zeros it cannot. Second review, R1.) A block with input ends + | the rest: stock runs on what it left. + | The delay's loop (read in the listing): crossfade weights that sum to [e008] (0.01 + 0.914 * drive) + | while it is steady, three soft-clip stages of slope 2 at most each, the make-up gain [e00c], a shift + | by 4, a low-pass of gain 2 at DC and a high-pass of at most 1, then -[e018] (feedback / 127). So + | 256 * [e008] * [e00c] * |[e018]| is an upper bound of its gain: 1.96 x feedback with no drive, 1 at + | FDBK 65 of 127 (the emulator agrees: 64 dies away, 90 does not). The delay counts and rests only + | while that figure is under DGMAX / 256 = 0.9 and none of the three words changed since the last + | tested block (a change, an LFO on feedback or drive too, starts the count again); otherwise stock runs as ever, at rest too. (So above FDBK 58 with no drive, down to FDBK 24 + | at full drive, the delay never rests; nor does the reverb then, if the delay feeds it.) + | From power-on until the first input nothing differs from stock even so: all of it is zero. + | + | VERIFY = 1 (needs COUNT): nothing is skipped. Each part decides as above, stock runs in full, and what + | stock produced is compared with what the skip would have left: the mixer's result and gains at + | 0x4010e7b6 (fxr_mix_chk), the delay's at its end 0x4010de34 (fxr_dly_chk), the reverb's at its end + | 0x4010da1a (fxr_rev_chk, in place of fxr_rev2's use of that address; fxr_rev2 passes through). + | + | COUNT = 1: counters since boot in fxr_total (longs): +0 mixer passes with no slot, +4 with 1..5, +8 + | handed to stock, +12 delay blocks rested (VERIFY: that would have been), +16 not, +20 reverb rested, + | +24 not, +28 reverb rested without the window test; VERIFY: +32 delay differences, +36 reverb + | differences, +40 mixer differences (its check sits at the top of stock's wait loop, so one difference can count more than + | once), +44 windows not zero in a block rested without the window test; +48 the last fetch was not done + | within the wait; QUIET: +52 the delay's count came full (a rest after use, or the first after + | power-on), +56 the reverb's; +28 is not used then. + | + | ColdFire: a move from an accumulator, its extension or MACSR leaves the condition codes alone, so each + | is followed by TST. MOVEA, LEA, ADDA and ADDQ to an address register leave them alone too. + + .ifndef MIX + .set MIX, 1 + .endif + .ifndef DLY + .set DLY, 1 + .endif + .ifndef REV + .set REV, 1 + .endif + .ifndef VERIFY + .set VERIFY, 0 + .endif + .ifndef COUNT + .set COUNT, 0 + .endif + .ifndef QUIET + .set QUIET, 1 + .endif + .ifndef QBITS + .set QBITS, 12 | QT = 4096 of 2^31: 16 steps of a 24-bit word, -114 dB of full scale + .endif + .set QT, 1 << QBITS + .set DHOLD, 16384 + 64 | the delay's ring: 4 MiB, 256 bytes a block + .set RHOLD, 512 + 8 | the reverb's longest ring: 64 KiB, 128 bytes a block + .set DGMAX, 230 | the delay's loop gain bound, 0.9, in 256ths of 16 fraction bits + .if QBITS > 28 + .error "QBITS: the threshold test needs 2 * QT well inside 32 bits" + .endif + .if VERIFY && QUIET + .error "the self-check compares with stock, which the after-use rest leaves: build it with QUIET=0" + .endif + .if VERIFY && !COUNT + .error "the self-check build reports through its counters" + .endif + + .macro total off + .if COUNT + addq.l #1,fxr_total+\off + .endif + .endm + | 8 longs at (\reg)+ all zero? If not, go to \fail. Uses d0. + .macro scan8 reg, fail + move.l (\reg)+,%d0 + or.l (\reg)+,%d0 + or.l (\reg)+,%d0 + or.l (\reg)+,%d0 + or.l (\reg)+,%d0 + or.l (\reg)+,%d0 + or.l (\reg)+,%d0 + or.l (\reg)+,%d0 + bne \fail + .endm + | \groups x 8 longs at (\reg)+ all zero? Uses d0, d1. + .macro scan reg, groups, fail + moveq #\groups,%d1 +.Lsc\@: scan8 \reg, \fail + subq.l #1,%d1 + bne.s .Lsc\@ + .endm + | 8 longs at (\reg)+ all in -QT..QT-1? If not, go to \fail. Needs d4 = QT, d5 = -2 * QT. Uses d0, d3. + | x + QT is in 0..2*QT-1 exactly for those x, and an OR of such words has no bit above them. + .macro quiet8 reg, fail + move.l (\reg)+,%d0 + add.l %d4,%d0 + .rept 7 + move.l (\reg)+,%d3 + add.l %d4,%d3 + or.l %d3,%d0 + .endr + and.l %d5,%d0 + bne \fail + .endm + | \groups x 8 longs. Uses d0, d1, d3. + .macro quiet reg, groups, fail + moveq #\groups,%d1 +.Lqu\@: quiet8 \reg, \fail + subq.l #1,%d1 + bne.s .Lqu\@ + .endm + | One long. Uses d0. + .macro quiet1 reg, fail + move.l (\reg)+,%d0 + add.l %d4,%d0 + and.l %d5,%d0 + bne \fail + .endm + .macro qconst + move.l #QT,%d4 + move.l #-2*QT,%d5 + .endm + | \groups x 8 longs at (\reg)+ set to zero. Uses d1. + .macro zero reg, groups + moveq #\groups,%d1 +.Lze\@: clr.l (\reg)+ + clr.l (\reg)+ + clr.l (\reg)+ + clr.l (\reg)+ + clr.l (\reg)+ + clr.l (\reg)+ + clr.l (\reg)+ + clr.l (\reg)+ + subq.l #1,%d1 + bne.s .Lze\@ + .endm + + .bss + .balign 4 +fxr_list: .space 64 | the mixer's slots with work: gain pair address, input word offset +fxr_rz: .space 4 | reverb: rested blocks in a row, counted to 512 +fxr_dz: .space 1 | delay: output and scratch were set to zero for this run of rests +fxr_rzd: .space 1 | reverb: scratch was set to zero for this run of rests +fxr_rr: .space 1 | reverb: this block is rested (fxr_rev2 reads it) +fxr_vd: .space 1 | VERIFY: the delay would have rested in this block +fxr_vr: .space 1 | VERIFY: the reverb would have rested in this block +fxr_vm: .space 2 | VERIFY: the mixer's own result for send 0, 1 is there to compare + .balign 4 + .if QUIET +fxr_dp: .space 12 | delay: the last block's [e008], [e00c], [e018] +fxr_dq: .space 4 | delay: quiet blocks in a row, counted to DHOLD; at DHOLD it rests +fxr_rq: .space 4 | reverb: the same, to RHOLD + .endif + .if COUNT + .globl fxr_total +fxr_total: .space 60 + .endif + .if VERIFY +fxr_vg: .space 128 | the mixer's own gains after the pass, 2 sends x 8 pairs +fxr_vo: .space 512 | the mixer's own result, 2 sends x 32 frames + .endif + + .text + + | ------------------------------------------------------------------------------------------------ + .if MIX + | From 0x4010e75e (6 bytes: move.l d3,d1 / move.l d3,d0 / lsl.l #6,d1), once for each send. + | In: d3 = send (0, 1), d7 = the 16 ramp steps (0x419c9f58), 56(sp) = stock's argument, the input + | frames (12 longs each; the 8 slots' words are 2..9). Stock needs d3, d4, d7, a4, a5 kept; it loads + | d0-d2, d5, d6, a0-a3 and fp again before it uses them. Leaves to 0x4010e7ac, or to stock's loop. + .globl fxr_mix + .balign 16 +fxr_mix: + move.l %d3,%d0 + lsl.l #6,%d0 + add.l #GAINS,%d0 + movea.l %d0,%a1 | this send's 8 gain pairs + .if VERIFY + lea fxr_vm,%a0 + clr.b (%a0,%d3.l) + move.l %d3,%d0 + lsl.l #6,%d0 + add.l #fxr_vg,%d0 + movea.l %d0,%a2 + moveq #16,%d1 +1: move.l (%a1)+,(%a2)+ | work on a copy of the gains: stock's loop does the real ones + subq.l #1,%d1 + bne.s 1b + movea.l %d0,%a1 + .endif + move.l %d7,%d6 + sub.l %a1,%d6 | from a slot's gain pair to its two steps + movea.l %d7,%a0 + lea fxr_list,%a2 + moveq #8,%d1 | the slot's input word in a frame: 8 + 4 * slot + moveq #0,%d2 +1: move.l (%a1),%d0 + or.l 4(%a1),%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + beq.s 2f + move.l %a1,(%a2)+ + move.l %d1,(%a2)+ + addq.l #1,%d2 +2: addq.l #8,%a1 + addq.l #4,%d1 + moveq #40,%d0 + cmp.l %d1,%d0 + bne.s 1b + .if VERIFY + move.l %d3,%d0 + lsl.l #8,%d0 + add.l #fxr_vo,%d0 + .else + move.l %d3,%d0 + lsl.l #8,%d0 + add.l #SEND0,%d0 + .endif + movea.l %d0,%a3 | where the 32 frames go + tst.l %d2 + bne.s 3f + total 0 + zero %a3, 8 + bra.s 8f +3: moveq #5,%d1 + cmp.l %d2,%d1 + bcs.s 9f | 6 or more: stock's loop + total 4 + add.l #256,%d0 + move.l %d0,-(%sp) | where they end + lsl.l #3,%d2 + lea fxr_list,%fp + adda.l %d2,%fp | the list's end + movea.l 60(%sp),%a2 +4: lea fxr_list,%a0 +5: movea.l (%a0)+,%a1 + move.l (%a0)+,%d2 + movem.l (%a1),%d0-%d1 + move.l (%a2,%d2.l),%d5 + mac.l %d0,%d5,%acc0 + mac.l %d1,%d5,%acc1 + add.l (%a1,%d6.l),%d0 + add.l 4(%a1,%d6.l),%d1 + movem.l %d0-%d1,(%a1) + cmpa.l %fp,%a0 + bne.s 5b + lea 48(%a2),%a2 + movclr.l %acc0,%d0 + move.l %d0,(%a3)+ + movclr.l %acc1,%d0 + move.l %d0,(%a3)+ + cmpa.l (%sp),%a3 + bne.s 4b + addq.l #4,%sp +8: + .if VERIFY + lea fxr_vm,%a0 + moveq #1,%d0 + move.b %d0,(%a0,%d3.l) + bra.s 10f + .else + addq.l #4,%sp + jmp MIX_DONE + .endif +9: total 8 +10: addq.l #4,%sp + move.l %d3,%d1 | the three instructions the call replaced + move.l %d3,%d0 + lsl.l #6,%d1 + jmp MIX_STOCK + + .if VERIFY + | From 0x4010e7b6 (6 bytes: move.w 0xfc0453de,d0), after both sends were mixed by stock. + | d0-d2, a0-a2 are free here. + .globl fxr_mix_chk + .balign 16 +fxr_mix_chk: + moveq #0,%d2 +1: lea fxr_vm,%a0 + tst.b (%a0,%d2.l) + beq.s 4f + move.l %d2,%d0 + lsl.l #8,%d0 + movea.l %d0,%a0 + movea.l %d0,%a1 + adda.l #fxr_vo,%a0 + adda.l #SEND0,%a1 + moveq #64,%d1 +2: move.l (%a0)+,%d0 + cmp.l (%a1)+,%d0 + bne.s 3f + subq.l #1,%d1 + bne.s 2b + move.l %d2,%d0 + lsl.l #6,%d0 + movea.l %d0,%a0 + movea.l %d0,%a1 + adda.l #fxr_vg,%a0 + adda.l #GAINS,%a1 + moveq #16,%d1 +2: move.l (%a0)+,%d0 + cmp.l (%a1)+,%d0 + bne.s 3f + subq.l #1,%d1 + bne.s 2b + bra.s 4f +3: total 40 +4: addq.l #1,%d2 + moveq #2,%d0 + cmp.l %d2,%d0 + bne.s 1b + move.w 0xfc0453de,%d0 | the instruction the call replaced + rts + .endif + .endif + + | ------------------------------------------------------------------------------------------------ + .if DLY + | From 0x4010db14 (6 bytes: movea.l 0x8000ddb0,a0), after the delay's set-up. On the stack: the return, + | the 3 longs the set-up pushed, stock's frame. Stock holds d6, d7, a2, a5 here and loads every other + | register again before it uses it. + .globl fxr_delay + .balign 16 +fxr_delay: + .if QUIET + | Exactly zero, or stock runs: the gate's state, ACC1..3 with their extensions, the input. + lea DLY_GATE,%a0 + move.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + bne 9f + move.l %acc1,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne 9f + move.l %acc2,%d0 + tst.l %d0 + bne 9f + move.l %acc3,%d0 + tst.l %d0 + bne 9f + move.l %accext01,%d0 + tst.l %d0 + bne 9f + move.l %accext23,%d0 + tst.l %d0 + bne 9f + lea SEND0,%a0 + scan %a0, 8, 9f + | The feedback loop's largest gain for a small signal, 256 * [e008] * [e00c] * |[e018]| (see the + | header), must be under DGMAX / 256, in the block's own values, at rest too: above that stock can + | build a tone out of what it has left, and must be left to. + | The loops ramp from the last block's three values to this block's, and two of them move in opposite + | directions with the drive, so a block in which one of them changed since the last block that came + | this far is not quiet either (third review, R2). (The first counted block after input can still + | ramp; its ring words are written again before the count is full, and what a tap reads is tested.) + lea DLY_PAR,%a0 | 0x8000e008: drive, 0x8000e00c: make-up, 0x8000e018: -feedback + lea fxr_dp,%a1 + move.l (%a0),%d0 + move.l 4(%a0),%d1 + move.l 16(%a0),%d3 + cmp.l (%a1),%d0 + bne.s 7f + cmp.l 4(%a1),%d1 + bne.s 7f + cmp.l 8(%a1),%d3 + beq.s 6f +7: move.l %d0,(%a1)+ + move.l %d1,(%a1)+ + move.l %d3,(%a1) + bra 9f +6: moveq #15,%d1 + tst.l %d0 + bmi 9f + lsr.l %d1,%d0 | 16 fraction bits + move.l 4(%a0),%d3 + bmi 9f + lsr.l %d1,%d3 + mulu.l %d3,%d0 | both under 2^16: no overflow + clr.w %d0 + swap %d0 + move.l 16(%a0),%d3 + neg.l %d3 | -1.0 stays 0x80000000, read as unsigned below + lsr.l %d1,%d3 | 0..65536; a positive [e018] reads as 65536 or more + cmpi.l #65536,%d3 + bhi 9f + mulu.l %d3,%d0 + clr.w %d0 + swap %d0 + cmpi.l #DGMAX,%d0 + bcc 9f + lea fxr_dq,%a1 + move.l (%a1),%d0 + cmpi.l #DHOLD,%d0 + bcc 2f | at rest already + | Not yet: is this block quiet? The filter's state and both windows within -QT..QT-1. + qconst + lea DLY_FLT,%a0 + move.l (%a0)+,%d0 + add.l %d4,%d0 + .rept 3 + move.l (%a0)+,%d3 + add.l %d4,%d3 + or.l %d3,%d0 + .endr + and.l %d5,%d0 + bne 9f + | The 65 longs of each window that stock's loops read (0x4010db20..0x4010dbaa); the last 3 of a window + | are never read or written back, and its last 2 are not always fetched again (third review, N5). + movea.l DLY_PTR,%a0 + quiet %a0, 8, 9f + quiet1 %a0, 9f + lea 12(%a0),%a0 | window B, 272 bytes after A + quiet %a0, 8, 9f + quiet1 %a0, 9f + lea fxr_dq,%a1 + addq.l #1,(%a1) + move.l (%a1),%d0 + cmpi.l #DHOLD,%d0 + bcs 8f | the ring is not written through yet: stock runs + total 52 +2: total 12 + lea fxr_dz,%a0 + tst.b (%a0) + bne.s 1f + move.b #1,(%a0) + lea DLY_OUT,%a0 + zero %a0, 8 | the output: silent. Filter, windows and ring stay as they are +1: lea 16(%sp),%sp | the return and the set-up's 3 longs + jmp DLY_TAIL +9: lea fxr_dq,%a0 + clr.l (%a0) +8: total 16 + lea fxr_dz,%a0 + clr.b (%a0) + movea.l DLY_PTR,%a0 | the instruction the call replaced + rts + .else + lea DLY_FLT,%a0 + move.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + bne 9f + lea DLY_GATE,%a0 + move.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + bne 9f + move.l %acc1,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne 9f + move.l %acc2,%d0 + tst.l %d0 + bne 9f + move.l %acc3,%d0 + tst.l %d0 + bne 9f + move.l %accext01,%d0 + tst.l %d0 + bne 9f + move.l %accext23,%d0 + tst.l %d0 + bne 9f + lea SEND0,%a0 + scan %a0, 8, 9f + movea.l DLY_PTR,%a0 + scan %a0, 17, 9f | both windows, 2 x 272 bytes, one after the other + total 12 + .if VERIFY + lea fxr_vd,%a0 + move.b #1,(%a0) + bra.s 10f + .else + lea fxr_dz,%a0 + tst.b (%a0) + bne.s 1f + move.b #1,(%a0) + lea DLY_OUT,%a0 + zero %a0, 8 + lea DLY_TMP,%a0 + zero %a0, 8 +1: lea 16(%sp),%sp | the return and the set-up's 3 longs + jmp DLY_TAIL + .endif +9: total 16 + .if !VERIFY + lea fxr_dz,%a0 + clr.b (%a0) + .endif +10: movea.l DLY_PTR,%a0 | the instruction the call replaced + rts + + .endif + + .if VERIFY + | From 0x4010de34 (8 bytes: movem.l (sp),d2-d7/a2-fp / lea 68(sp),sp), the delay's end; a jump. + .globl fxr_dly_chk + .balign 16 +fxr_dly_chk: + lea fxr_vd,%a0 + tst.b (%a0) + beq 2f + clr.b (%a0) + lea DLY_OUT,%a0 + scan %a0, 8, 1f + lea DLY_TMP,%a0 + scan %a0, 8, 1f + lea SEND0,%a0 + scan %a0, 8, 1f + movea.l DLY_PTR,%a0 + scan %a0, 8, 1f | what goes back to the ring + lea DLY_FLT,%a0 + move.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + bne.s 1f + lea DLY_GATE,%a0 + move.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + bne.s 1f + move.l %acc0,%d0 + tst.l %d0 + bne.s 1f + move.l %acc1,%d0 + tst.l %d0 + bne.s 1f + move.l %acc2,%d0 + tst.l %d0 + bne.s 1f + move.l %acc3,%d0 + tst.l %d0 + bne.s 1f + move.l %accext01,%d0 + tst.l %d0 + bne.s 1f + move.l %accext23,%d0 + tst.l %d0 + beq.s 2f +1: total 32 +2: movem.l (%sp),%d2-%d7/%a2-%fp | the two instructions the jump replaced, and stock's rts + lea 68(%sp),%sp + rts + .endif + .endif + + | ------------------------------------------------------------------------------------------------ + .if REV + | Every byte the fetched line windows can occupy: 9 x 176 from 0x8000d1f0, 8 x 160 from 0x8000d820 (the + | last 16 of the eighth hold other words, 0x8000dd10), and the 16 below the first (a fetch lands up to + | 12 bytes below its buffer). 716 longs. Uses d0, d1, a0. + .macro lines fail + lea REV_LINES,%a0 + scan %a0, 89, \fail + move.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + or.l (%a0)+,%d0 + bne \fail + .endm + | The states and the input. Uses d0, d1, a0. + .macro revstate fail + lea REV_FLT,%a0 + move.l (%a0)+,%d0 + or.l (%a0),%d0 + bne \fail + lea REV_ST,%a0 + scan %a0, 2, \fail + lea REV_IN,%a0 + scan %a0, 8, \fail + lea REV_FB,%a0 + scan %a0, 4, \fail + .endm + + | From 0x4010d544 (6 bytes: movea.l #0x8000d1f0,a5), after the reverb's set-up. Stock loads every + | register again from here on before it uses it; the stack is the function's frame. + .globl fxr_rev1 + .balign 16 +fxr_rev1: + .if QUIET + lea REV_IN,%a0 + scan %a0, 8, 9f | the input: exactly zero, or stock runs + lea fxr_rq,%a1 + move.l (%a1),%d0 + cmpi.l #RHOLD,%d0 + bcc 2f | at rest already + | Not yet: is this block quiet? States, hand-over buffer and every window word within -QT..QT-1. + qconst + lea REV_FLT,%a0 + move.l (%a0)+,%d0 + add.l %d4,%d0 + move.l (%a0),%d3 + add.l %d4,%d3 + or.l %d3,%d0 + and.l %d5,%d0 + bne 9f + lea REV_ST,%a0 + quiet %a0, 2, 9f + lea REV_FB,%a0 + quiet %a0, 4, 9f + | The windows are fetched as one chain of transfers; stock (0x4010e7b6) waits only until the chain's + | last one, line 8's, is loaded, and reads that line late. Here it is read at once, so wait for that + | transfer's DONE bit (review R1); if it does not come soon the block was not tested, and the count + | starts again (second review, D1). + moveq #127,%d1 +4: move.w DMA_CSR,%d0 + btst #7,%d0 + bne.s 5f + subq.l #1,%d1 + bne.s 4b + total 48 + bra 9f +5: lea REV_LINES,%a0 + quiet %a0, 89, 9f + move.l (%a0)+,%d0 + add.l %d4,%d0 + .rept 3 + move.l (%a0)+,%d3 + add.l %d4,%d3 + or.l %d3,%d0 + .endr + and.l %d5,%d0 + bne 9f + addq.l #1,(%a1) + move.l (%a1),%d0 + cmpi.l #RHOLD,%d0 + bcs 8f | the rings are not written through yet: stock runs + total 56 + | At rest: the output is the input buffer, which is zero. States, hand-over buffer, windows and rings + | stay as they are. +2: total 20 + lea fxr_rr,%a0 + move.b #1,(%a0) + addq.l #4,%sp + jmp REV_LFO +9: lea fxr_rq,%a0 + clr.l (%a0) +8: total 24 + lea fxr_rr,%a0 + clr.b (%a0) + movea.l #REV_L0,%a5 | the instruction the call replaced + rts + .else + revstate 9f + lea fxr_rz,%a1 + move.l (%a1),%d0 + cmpi.l #512,%d0 + bcc 1f + | The windows are fetched as one chain of transfers; stock (0x4010e7b6) waits only until the chain's + | last one, line 8's, is loaded, and reads that line late. Here it is read at once, so wait for that + | transfer's DONE bit (review R1); if it does not come soon, do not rest. + moveq #127,%d1 +4: move.w DMA_CSR,%d0 + btst #7,%d0 + bne.s 5f + subq.l #1,%d1 + bne.s 4b + total 48 + bra 9f +5: lines 9f + addq.l #1,(%a1) + bra 2f +1: total 28 + .if VERIFY + lines 7f + bra.s 2f +7: total 44 + .endif +2: total 20 + .if VERIFY + lea fxr_vr,%a0 + move.b #1,(%a0) + bra.s 10f + .else + lea fxr_rr,%a0 + move.b #1,(%a0) + lea fxr_rzd,%a0 + tst.b (%a0) + bne.s 3f + move.b #1,(%a0) + lea REV_TMP,%a0 + zero %a0, 8 | 0x8000ca10..0x8000cb0f + lea 128(%a0),%a0 | over the hand-over buffer, which is zero + zero %a0, 4 | 0x8000cb90..0x8000cc0f + lea REV_TMP2-4,%a0 + clr.l (%a0)+ | 0x8000cc38: stock's allpass loop stores a zero there (0x4010d5f2) + zero %a0, 4 | 0x8000cc3c..0x8000ccbb +3: addq.l #4,%sp + jmp REV_LFO + .endif +9: total 24 + lea fxr_rz,%a0 + clr.l (%a0) + .if !VERIFY + lea fxr_rzd,%a0 + clr.b (%a0) + lea fxr_rr,%a0 + clr.b (%a0) + .endif +10: movea.l #REV_L0,%a5 | the instruction the call replaced + rts + + .endif + + | From 0x4010d842 (6 bytes: movea.l #0x8000d560,a0), after the modulation step. Stock holds d7 here. + .globl fxr_rev2 + .balign 16 +fxr_rev2: + .if !VERIFY + lea fxr_rr,%a0 + tst.b (%a0) + beq.s 1f + addq.l #4,%sp + jmp REV_END + .endif +1: movea.l #REV_L5,%a0 | the instruction the call replaced + rts + + .if VERIFY + | From 0x4010da1a (8 bytes: movem.l (sp),d2-d7/a2-fp / lea 60(sp),sp), the reverb's end; a jump. + .globl fxr_rev_chk + .balign 16 +fxr_rev_chk: + lea fxr_vr,%a0 + tst.b (%a0) + beq 2f + clr.b (%a0) + revstate 1f + lines 1f + lea REV_TMP,%a0 + scan %a0, 16, 1f | 0x8000ca10..0x8000cc0f + lea REV_TMP2-4,%a0 + tst.l (%a0)+ + bne 1f + scan %a0, 4, 1f + move.l %acc0,%d0 + tst.l %d0 + bne.s 1f + move.l %acc1,%d0 + tst.l %d0 + bne.s 1f + move.l %acc2,%d0 + tst.l %d0 + bne.s 1f + move.l %acc3,%d0 + tst.l %d0 + bne.s 1f + move.l %accext01,%d0 + tst.l %d0 + bne.s 1f + move.l %accext23,%d0 + tst.l %d0 + beq.s 2f +1: total 36 +2: movem.l (%sp),%d2-%d7/%a2-%fp | the two instructions the jump replaced, and stock's rts + lea 60(%sp),%sp + rts + .endif + .endif diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/src/engine.s b/sdk/analog-rytm-mkii/modules/improved-performance/src/engine.s new file mode 100644 index 0000000000..012c28ca9e --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/src/engine.s @@ -0,0 +1,620 @@ + | SPDX-License-Identifier: GPL-3.0-or-later + | Improved Performance for the Analog Rytm MKII (Nathaniel Pavel), the rest of the engine: four places of the audio interrupt + | (stock OS 1.74, vector 191, once a block of 32 frames) where work is left out in the blocks in which + | it would write what is there already. Nothing here changes a value stock would have produced. + | + | NSC = 1. The host stream buffers. Two buffers of 32 frames x 12 longs (1,536 B) at U0 and + | U0 + 1536; each block the stream reader 0x40005e9c fills one (index [0x8000fef4] ^ 1 by its caller, + | 0x4011fda6) and the mixers read the other. With no stream it clears all 32 frames (0x40005f40, the + | library clear 0x40097c40), every block. ns_gate (from 0x40005f2c, in place of the reader's lines up to + | 0x40005f4a: the frame count test, the byte count and the call) keeps one byte a buffer: "all zero". + | It is set after a clear of all 32 frames with no stream frames behind it (d3 = 0), and dropped + | whenever the reader clears less (stream frames follow in the same call: 0x40005fc4, 0x40006108) + | or the other path of the interrupt writes the buffers (0x4011fc6c.., its clear is ns_dirty). + | With the byte set and a full clear due, the clear is left out. Writers of the buffers in OS 1.74, + | by a search of the image for every address in them: the reader, the path at 0x4011fc54..0x4011fd8c; + | readers 0x4010ea98, 0x4010eb92, 0x4010ec6a, 0x4013f738 (the last one takes a pointer and only loads + | through it). No module in the library writes them (`voice-dac` and `comp-preview` name the voice mix's + | stream loop in comments only: release review, 20 Nov 2026). The marks start at 0: the core's boot hook zeroes every module's .bss. + | + | CMW = 1. The compressor's control words 0x4010e20c (call at 0x40121398; frame at 4(sp), 8 parameter + | words at 8(sp)): from words +0, +10, +12, +14 and the upper bytes of +2, +4, +6, +8 it writes frame + | words +2, +4, +6, +8, all 8 bits of byte +162 and bits 1 and 2 of byte +165; one call of the + | exponent 0x40098a24 (a function of its argument, the MAC mode and a clear ACC0); a constant table + | 0x401ef4a0; no other input (it adds into ACC0 without clearing it first, so ACC0 is one). + | cw_memo keeps the 16 input bytes and the outputs of the last call. With the same 16 bytes, clear + | accumulators and MACSR's mode bits at 0x20, it writes the kept outputs (every block, as stock + | does) and does not call. Any other block calls stock and keeps its result. + | + | SMO = 1. The parameter smoother 0x40120d1c..0x40120d4e: for 572 words, state = 0.03 x target + + | 0.97 x state (state 32 bits at STATE, target 16 bits at TGT, coefficients d7 = 0x03d70000 and + | d6 = 0x7c290000, MAC.W upper x upper plus MAC.L, fractional), word = upper half of state + 0x8000, + | written to PAR. sm_run does the same arithmetic in its own loop (sm_full; two words a pass, no + | carry from one pass to the next, so a pass does not depend on its neighbours). The words are taken + | in 14 groups: the 26 in front (always sm_full) and 42 for each of 13 tracks. A track's group gets a + | mark "at rest" after a block in which sm_obs, the same arithmetic, found every one of its 42 states + | unchanged by the update (one unmarked group a block is watched like this, in turn). A marked group + | is not multiplied: for each two words, upper halves of state + 0x8000 are formed and compared with + | the two target words. Equal: these are the words stock would write (the state is where it was when + | the update last left it unchanged, or was set to target << 16 since, and for either the update is + | the identity as long as the target is the one the state stands for), so they are written and the + | state is left. Not equal: the mark is dropped and this and the group's later words go through + | sm_full. Why "equal" means the target did not change: 0.03 and 0.97 are 983/32768 and 31785/32768, + | their sum is 1, so a state the update leaves unchanged lies within 34 of target << 16 whatever the + | rounding, and its upper half after + 0x8000 is the target. What a marked group needs of any other + | writer of STATE is that it stores values of the form X << 16 (the update is then the identity when + | the target is X, in any rounding mode, and the compare sees any other target). Writers in OS 1.74, + | by a search of the image for STATE's addresses and for every use of the base TGT with an index + | (review, 20 Nov 2026): 0x40120d76 (one word a track, after the smoother), 0x4011db4e (a track's 42 + | words, with its targets), 0x4011f3ea and 0x4011f42c (one word, with its target), all word << 16, and + | 0x4011faae (one word, 0x40000000). The target setter 0x4011f704 takes an index nobody checks: one of + | 1156 or more would store half a state (its callers' ranges were not read). A writer of anything + | else into a marked group would not be seen: none found. + | The interrupt's second, short path (while [0x8000e578] is not 0: branch at 0x4011fe02, then the voice + | mix from its other caller 0x4011fe22, the FX, the flag clear) runs neither the reader, the smoother nor + | the compressor call: the marks describe what the buffers and states hold, nothing writes them there, + | and a kit load in that time stores states of the form X << 16 (set review, 20 Nov 2026). + | In the joined module MACSR's condition flags can differ from stock's after any part's skip, not only + | the two named next; the same holds for all of them. + | MACSR's condition flags (not its mode) can differ from stock's after sm_run and after a kept CMW + | block; nothing on the interrupt's path reads them (each read masks 0xf0, the exit restores MACSR). + | If MACSR's mode bits are not 0x20 at entry all marks are dropped and every group goes through + | sm_full (same arithmetic as stock in any mode). + | + | VDC = 1 (needs NSC). The voice mix 0x4010ea98: for 8 voices x 32 frames, DAC word = (A2 + A3 - g x A0 + + | 0.5 x U) >> 8, U the stream buffer [0x8000fef4] of the two above (saturating fractional mode, set + | on entry, 0x20 again on exit; g ramps by (target - current) >> 5 a frame and is stored back). + | vd_gate (from the routine's first two instructions) runs its own loop without the U term when that + | buffer is marked all zero: the term is then a product with 0, and adding it leaves the accumulator + | as it is in any mode. Any other block, a [0x8000fef4] above 1 or a negative byte in the table + | 0x401bed40 (stock then takes another loop): stock's routine, from its third instruction. + | + | VERIFY = 1: stock does all the work. NSC: where the clear would be left out the buffer is tested + | for zero first, then cleared as stock. CMW: stock is always called; where the kept outputs would + | have been used they are compared with what stock wrote. VDC: where the own loop would run it runs first, + | into a second DAC block, and the gains are put back; then stock runs and the 8 x 32 words and the 8 + | gains are compared. SMO: stock's loop runs; smv_pre copies STATE + | before it, smv_post (from 0x40120d4e; 0x40120d54 is a branch target, so the site ends before it) runs sm_core on the copy into a second parameter array and compares both with + | what stock left. Differences are counted. Two false counts are possible: the own voice loop and + | sm_core's run on the copy start from the accumulators as they are then, stock from the entry's; if + | ACC0 or ACC1 were not clear at entry (they are, as far as read) a difference would be counted that + | the real build does not have, and for the voice mix stock's first word would change. + | + | Counters (COUNT = 1; t2_total, longs): +0 clears left out, +4 full clears done, +8 buffer marked + | written, +12 other path, +16 compressor words kept, +20 recomputed, +24 recomputed for the + | accumulators or mode, +28 groups at rest, +32 groups through sm_full, +36 groups watched, +40 marks + | dropped, +44 marks set, +48 smoother blocks in another MAC mode, +52 DIFF stream buffer not zero, + | +56 DIFF compressor, +60 DIFF smoother state, +64 DIFF smoother words, +68 checks stream, + | +72 checks compressor, +76 checks smoother, +80 voice mix own loop, +84 stock's, +88 DIFF voice mix, + | +92 checks voice mix. + + .ifndef NSC + .equ NSC, 1 + .endif + .ifndef CMW + .equ CMW, 1 + .endif + .ifndef SMO + .equ SMO, 1 + .endif + .ifndef VDC + .equ VDC, 1 + .endif + .if VDC && !NSC + .error "VDC needs NSC" + .endif + .ifndef VERIFY + .equ VERIFY, 0 + .endif + .ifndef COUNT + .equ COUNT, 0 + .endif + .if VERIFY && !COUNT + .error "VERIFY needs COUNT" + .endif + + .macro total off + .if COUNT + addq.l #1,t2_total+\off + .endif + .endm + + .bss + .balign 4 + .if COUNT + .globl t2_total +t2_total: .space 96 + .endif +cw_in: .space 16 | the 8 parameter words of the last call +cw_out: .space 8 | frame words +2, +4, +6, +8 + .space 1 | frame byte +162 + .space 1 | bits 1 and 2 of frame byte +165 +cw_valid: .space 1 + .balign 2 +ns_zero: .space 2 | stream buffer 0, 1: all zero +ns_other: .space 1 | stands in for a buffer that is neither: cleared before each test + .balign 4 +sm_conv: .space 13 | a track's 42 words: at rest +sm_rr: .space 1 | the group watched this block, 13 (track 0) .. 1 (track 12) + .balign 4 + .if VERIFY +smv_state: .space 2288 +smv_par: .space 1144 +vdv_blk: .space 2048 | the own loop's DAC words +vdv_g: .space 64 | the 8 gain pairs as found +vdv_c: .space 32 | the own loop's 8 gains +cwv_el: .space 1 + .balign 4 + .endif + + .text + + | ------------------------------------------------------------------------------------------------ + .if NSC + .globl ns_gate, ns_dirty + .balign 16 +ns_gate: | a4 buffer, d2 frames to clear, d3 frames asked for + lea ns_zero,%a0 + move.l %a4,%d0 + sub.l #U0,%d0 + beq.s 1f + addq.l #1,%a0 + cmp.l #1536,%d0 + beq.s 1f + addq.l #1,%a0 | not one of the two buffers (no such caller): a byte + clr.b (%a0) | that is cleared here, so the clear is always done +1: tst.l %d2 + ble.s 5f | nothing to clear: stream frames fill the buffer + sub.l %d2,%d3 | as stock: frames left for the stream + bne.s 3f | stream frames follow the cleared ones + moveq #32,%d0 + cmp.l %d0,%d2 + bne.s 3f + tst.b (%a0) + beq.s 6f + .if VERIFY + total 68 + move.l %a4,%a0 | the buffer must be zero where the clear would be left out + move.l #384,%d0 +7: tst.l (%a0)+ + bne.s 8f + subq.l #1,%d0 + bne.s 7b + bra.s 4f +8: total 52 + bra.s 4f + .else + total 0 + jmp NS_RESUME | all zero already + .endif +6: moveq #1,%d0 + move.b %d0,(%a0) + total 4 + bra.s 4f +3: clr.b (%a0) + total 8 +4: move.l %d2,%d1 | 48 bytes a frame + move.l %d2,%d0 + lsl.l #4,%d0 + lsl.l #6,%d1 + sub.l %d0,%d1 + move.l %d1,-(%sp) + move.l %a4,-(%sp) + jsr MEMSET + addq.l #8,%sp + jmp NS_RESUME +5: clr.l %d2 | as stock + clr.b (%a0) + total 8 + jmp NS_RESUME + +ns_dirty: | the other path's clear (0x4011fc6c): it writes the buffers + clr.w ns_zero | after it (0x4011fcf8, 0x4011fd02): both marks off + total 12 + jmp MEMSET + .endif + + | ------------------------------------------------------------------------------------------------ + .if VDC + .globl vd_gate + .balign 16 +vd_gate: | 4(sp) the DAC block + move.l FEF4,%d0 + moveq #1,%d1 + cmp.l %d1,%d0 + jbhi vd_stock + lea ns_zero,%a0 + tst.b (%a0,%d0.l) + jbeq vd_stock + move.l VD_TAB,%d0 + or.l VD_TAB+4,%d0 + and.l #0x80808080,%d0 + jbne vd_stock + .if VERIFY + total 92 + lea G_PAIRS,%a0 + lea vdv_g,%a1 + moveq #16,%d0 +1: move.l (%a0)+,(%a1)+ + subq.l #1,%d0 + bne.s 1b + pea vdv_blk + bsr vd_own + addq.l #4,%sp + lea G_PAIRS,%a0 | keep the own loop's gains, put the found ones back + lea vdv_g,%a1 + moveq #16,%d0 +2: move.l (%a0),%d1 + move.l (%a1),(%a0)+ + move.l %d1,(%a1)+ + subq.l #1,%d0 + bne.s 2b + move.l 4(%sp),-(%sp) + bsr vd_stock + addq.l #4,%sp + lea G_PAIRS,%a0 + lea vdv_g,%a1 + moveq #16,%d0 +3: move.l (%a0)+,%d1 + cmp.l (%a1)+,%d1 + bne.s 6f + subq.l #1,%d0 + bne.s 3b + move.l 4(%sp),%a0 + lea vdv_blk,%a1 + moveq #32,%d0 +4: move.l %d2,-(%sp) + moveq #8,%d2 +5: move.l (%a0)+,%d1 + cmp.l (%a1)+,%d1 + bne.s 7f + subq.l #1,%d2 + bne.s 5b + move.l (%sp)+,%d2 + lea 32(%a0),%a0 + lea 32(%a1),%a1 + subq.l #1,%d0 + bne.s 4b + rts +7: move.l (%sp)+,%d2 +6: total 88 + rts + .else + total 80 + .endif +vd_own: lea -44(%sp),%sp + movem.l %d2-%d7/%a2-%a6,(%sp) + move.l 48(%sp),%fp + lea VD_A0,%a0 + lea G_PAIRS,%a1 + lea VD_A2,%a2 + lea VD_A3,%a3 + move.l #0xa0,%macsr + move.l #0x80000000,%d1 + move.l (%a2)+,%d7 + moveq #8,%d2 +1: move.l (%a1)+,%d6 | gain: target, current + move.l (%a1),%d3 + sub.l %d3,%d6 + asr.l #5,%d6 + move.l %fp,%a4 + moveq #32,%d4 +2: msac.l %d1,%d7,(%a3)+,%d7,%acc0 | + A2 + msac.l %d1,%d7,(%a0)+,%d7,%acc0 | + A3 + msac.l %d3,%d7,(%a2)+,%d7,%acc0 | - g x A0 + add.l %d6,%d3 + movclr.l %acc0,%d5 + lsr.l #8,%d5 + move.l %d5,(%a4) + lea 64(%a4),%a4 + subq.l #1,%d4 + bne.s 2b + move.l %d3,(%a1)+ + addq.l #4,%fp + subq.l #1,%d2 + bne.s 1b + move.l #0x20,%macsr + movem.l (%sp),%d2-%d7/%a2-%a6 + lea 44(%sp),%sp + rts +vd_stock: + total 84 + lea -68(%sp),%sp | the two instructions the site replaced + movem.l %d2-%d7/%a2-%a6,(%sp) + jmp VD_BODY + .endif + + | ------------------------------------------------------------------------------------------------ + .if CMW + .globl cw_memo + .balign 16 +cw_memo: | 4(sp) frame, 8(sp) the 8 parameter words + move.l %acc0,%d0 + move.l %acc1,%d1 + or.l %d1,%d0 + move.l %accext01,%d1 + or.l %d1,%d0 + jbne cw_unclean + move.l %macsr,%d0 + and.l #0xf0,%d0 + moveq #0x20,%d1 + cmp.l %d1,%d0 + jbne cw_unclean + move.l 8(%sp),%a0 + lea cw_in,%a1 + .rept 4 + move.l (%a0)+,%d0 + cmp.l (%a1)+,%d0 + jbne cw_slow + .endr + tst.b 10(%a1) | cw_valid + jbeq cw_slow + .if VERIFY + moveq #1,%d0 + move.b %d0,cwv_el + jbra cw_call + .else + move.l 4(%sp),%a0 + move.w (%a1)+,2(%a0) + move.w (%a1)+,4(%a0) + move.w (%a1)+,6(%a0) + move.w (%a1)+,8(%a0) + move.b (%a1)+,162(%a0) + mvz.b 165(%a0),%d0 + moveq #-7,%d1 + and.l %d1,%d0 + mvz.b (%a1),%d1 + or.l %d1,%d0 + move.b %d0,165(%a0) + total 16 + rts + .endif +cw_slow: + .if VERIFY + clr.b cwv_el + .endif + total 20 +cw_call: + move.l 8(%sp),%a0 + lea cw_in,%a1 + move.l (%a0)+,(%a1)+ + move.l (%a0)+,(%a1)+ + move.l (%a0)+,(%a1)+ + move.l (%a0)+,(%a1)+ + move.l 8(%sp),-(%sp) + move.l 8(%sp),-(%sp) + jsr CW_STOCK + addq.l #8,%sp + move.l 4(%sp),%a0 + lea cw_out,%a1 + .if VERIFY + tst.b cwv_el + beq.s 2f + total 72 + mvz.b 165(%a0),%d0 + moveq #6,%d1 + and.l %d1,%d0 + mvz.b 9(%a1),%d1 + cmp.l %d1,%d0 + bne.s 1f + mvz.b 162(%a0),%d0 + mvz.b 8(%a1),%d1 + cmp.l %d1,%d0 + bne.s 1f + move.l 2(%a0),%d0 + cmp.l (%a1),%d0 + bne.s 1f + move.l 6(%a0),%d0 + cmp.l 4(%a1),%d0 + beq.s 2f +1: total 56 +2: + .endif + move.w 2(%a0),(%a1)+ + move.w 4(%a0),(%a1)+ + move.w 6(%a0),(%a1)+ + move.w 8(%a0),(%a1)+ + move.b 162(%a0),(%a1)+ + mvz.b 165(%a0),%d0 + moveq #6,%d1 + and.l %d1,%d0 + move.b %d0,(%a1)+ + moveq #1,%d0 + move.b %d0,(%a1) + rts +cw_unclean: + clr.b cw_valid + total 24 + jmp CW_STOCK + .endif + + | ------------------------------------------------------------------------------------------------ + .if SMO + .balign 16 + | a1 targets, a2 states, a5 words out; d2 0x8000, d6 0.97, d7 0.03 (upper word). Uses d0, d1, d3, d4, + | a1, a2, a5; ACC0 and ACC1 are added into and left clear, as stock. +sm_core: + lea -16(%sp),%sp + movem.l %d5/%a3,8(%sp) + lea sm_conv,%a3 + mvz.b 13(%a3),%d0 | the group watched in this block + bne.s 2f + moveq #13,%d0 +2: move.l %d0,(%sp) + subq.l #1,%d0 + move.b %d0,13(%a3) + move.l %macsr,%d0 + and.l #0xf0,%d0 + moveq #0x20,%d1 + cmp.l %d1,%d0 + beq.s 1f + clr.l (%a3) | another mode: no group counts as at rest, + clr.l 4(%a3) + clr.l 8(%a3) + clr.b 12(%a3) + clr.l (%sp) | and none is watched + total 48 +1: + moveq #13,%d3 | the 26 words in front of the tracks + bsr sm_full + moveq #13,%d0 + move.l %d0,4(%sp) +sm_group: + tst.b (%a3)+ + jbne sm_fast + moveq #21,%d3 + move.l 4(%sp),%d0 + cmp.l (%sp),%d0 + beq.s sm_obs + bsr sm_full + total 32 +sm_next: + subq.l #1,4(%sp) + bne.s sm_group + movem.l 8(%sp),%d5/%a3 + lea 16(%sp),%sp + rts + +sm_obs: clr.l %d5 | the update, and whether it changed a state +1: move.l (%a1)+,%d0 + mac.w %d7u,%d0u,(%a2),%d1,%acc0 + mac.w %d7u,%d0l,4(%a2),%d4,%acc1 + mac.l %d6,%d1,%acc0 + mac.l %d6,%d4,%acc1 + movclr.l %acc0,%d0 + sub.l %d0,%d1 + or.l %d1,%d5 + move.l %d0,(%a2)+ + movclr.l %acc1,%d1 + sub.l %d1,%d4 + or.l %d4,%d5 + move.l %d1,(%a2)+ + add.l %d2,%d0 + add.l %d2,%d1 + swap %d1 + move.w %d1,%d0 + move.l %d0,(%a5)+ + subq.l #1,%d3 + bne.s 1b + total 36 + tst.l %d5 + bne.s sm_next + moveq #1,%d0 + move.b %d0,-1(%a3) + total 44 + bra.s sm_next + +sm_fast: + moveq #7,%d3 +1: + .irp k,0,1,2 + move.l (%a2)+,%d1 + add.l %d2,%d1 + move.l (%a2)+,%d4 + add.l %d2,%d4 + swap %d4 + move.w %d4,%d1 + cmp.l (%a1)+,%d1 + jbne sm_miss\k + move.l %d1,(%a5)+ + .endr + subq.l #1,%d3 + bne.s 1b + total 28 + jbra sm_next +sm_miss2: + moveq #2,%d0 + bra.s 2f +sm_miss1: + moveq #1,%d0 + bra.s 2f +sm_miss0: + clr.l %d0 +2: move.l %d3,%d1 | words left in the group: 3 x passes left - place in the pass + add.l %d3,%d3 + add.l %d1,%d3 + sub.l %d0,%d3 + subq.l #8,%a2 + subq.l #4,%a1 + clr.b -1(%a3) + total 40 + bsr sm_full + jbra sm_next + +sm_full: | d3 pairs of words +1: move.l (%a1)+,%d0 + mac.w %d7u,%d0u,(%a2),%d1,%acc0 + mac.w %d7u,%d0l,4(%a2),%d4,%acc1 + mac.l %d6,%d1,%acc0 + mac.l %d6,%d4,%acc1 + movclr.l %acc0,%d1 + movclr.l %acc1,%d4 + move.l %d1,(%a2)+ + move.l %d4,(%a2)+ + add.l %d2,%d1 + add.l %d2,%d4 + swap %d4 + move.w %d4,%d1 + move.l %d1,(%a5)+ + subq.l #1,%d3 + bne.s 1b + rts + + .if VERIFY + .globl smv_pre, smv_post +smv_pre: | from 0x40120d1c: keep the states as stock's loop finds them + lea STATE,%a0 + lea smv_state,%a1 + move.l #572,%d3 +1: move.l (%a0)+,(%a1)+ + subq.l #1,%d3 + bne.s 1b + lea TGT,%a0 | as at the site + move.l %a0,%a1 + move.l -(%a5),%d1 | the two instructions the site replaced + move.l #572,%d3 + jmp SM_LOOP +smv_post: | from 0x40120d4e: stock's loop is done but for its last store + move.l %d1,(%a5)+ | the first of the three instructions the site replaced + lea -16(%sp),%sp + movem.l %a0-%a2/%a5,(%sp) + lea TGT,%a1 + lea smv_state,%a2 + lea smv_par,%a5 + bsr sm_core + total 76 + lea STATE,%a0 + lea smv_state,%a1 + move.l #572,%d3 +1: move.l (%a0)+,%d0 + cmp.l (%a1)+,%d0 + bne.s 2f + subq.l #1,%d3 + bne.s 1b + bra.s 3f +2: total 60 +3: lea PAR,%a0 + lea smv_par,%a1 + move.l #286,%d3 +4: move.l (%a0)+,%d0 + cmp.l (%a1)+,%d0 + bne.s 5f + subq.l #1,%d3 + bne.s 4b + bra.s 6f +5: total 64 +6: movem.l (%sp),%a0-%a2/%a5 + lea 16(%sp),%sp + clr.l %d3 | as stock's loop leaves it + moveq #52,%d0 | the other two + addq.l #4,%sp + jmp SM_AFTER + .else + .globl sm_run +sm_run: | from 0x40120d1c: a1 = TGT, a2 = STATE, a5 = PAR + bsr sm_core + move.l (%a1)+,%d0 | d0 and a1 as stock's loop leaves them (it loads one + clr.l %d3 | long past the targets); d3 too + jmp SM_END + .endif + .endif diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/src/modulation.s b/sdk/analog-rytm-mkii/modules/improved-performance/src/modulation.s new file mode 100644 index 0000000000..7e26fbbb69 --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/src/modulation.s @@ -0,0 +1,393 @@ + | SPDX-License-Identifier: GPL-3.0-or-later + | Improved Performance for the Analog Rytm MKII (Nathaniel Pavel), the modulation: do not run three modulation passes of the + | audio interrupt in the blocks where they change nothing, and clear 56 flags with a shorter loop. + | Stock OS 1.74, vector 191, once a block of 32 frames. Nothing here changes a value stock would have + | produced: each skip is taken only when, by stock's own arithmetic, the pass writes back what it read, + | and that is tested in the block itself. No stock loop is copied: the tests stand in front of stock's + | code and either jump it or hand over to it. + | + | The parameter words: 572 unsigned 16-bit words at PAR (0x8000f774), written new every block by the + | smoother (0x40120d26; in the joined module by sm_run of engine.s, which writes the same words) and then + | changed in place by the passes below. + | Set review, 20 Nov 2026: the accumulators' extension word is not tested here; every EMAC user in front + | of these sites ends with MOVCLR (the handler's entry, the smoother, the coef loop 0x40120e2a), which + | clears it with the accumulator. The interrupt has a second, short path (taken while [0x8000e578] is + | not 0, branch at 0x4011fe02) that runs none of these three passes and ends in the flag clear. + | + | SLD = 1. The per-track pass 0x40120e56..0x40120e9c: for 13 tracks x 42 words, + | word = word - coef_t x depth (two MSAC.W on each half: -(coef's upper word x depth) and + | -(0x8000 x word), fractional mode, MACSR 0x20 set at 0x4011fbfe; the result's upper half is stored). + | With a coef whose upper word is 0 the first product is 0 and the second gives back the word (for the + | word 0x8000 too: 2^31 or the saturated 0x7fffffff, negated, both have the upper half 0x8000). The + | coefs are 13 longs at COEF (0x8000e438), computed just before (0x40120e14). ms_slide (from 0x40120e56, + | in place of `lea 0x8000f7a8,a0`) tests the 13 upper words, that ACC0 and ACC1 are clear (stock adds + | into them without clearing first, and leaves them clear) and that MACSR's mode bits are 0x20 (in + | integer mode the pass would store half of each word): then the pass is jumped (0x40120e9e). The pass + | writes 274 longs from PAR + 0x30: the long before the 13 x 42 words comes back as read too. + | All 13 or none: a block in which one track's coef is not 0 runs stock's pass whole. + | + | LST = 1. The list routine 0x4011de2a (26 calls a block: 2 lists for each of 12 tracks, 2 more): + | for 4 entries (depth in the upper word, word index in the lower, signed), + | acc = -(value's lower word x depth); x = (word << 16) - 2^30 - acc; x = sat(x); x = sat(2x) >> 1; + | word = (x + 2^30) >> 16. With acc = 0 the subtraction cannot overflow, and for a word below 0x8000 + | x lies in -2^30 .. 2^30 - 65536, so doubling does not saturate and the word comes back as it was. (A word + | of 0x8000 or more would come back as 0x7fff or 0: so each of the 4 words is tested.) acc is 0 when the + | value's lower word is 0 or the entry's depth is 0, given ACC0 clear at entry, which is tested. ms_list + | (from the routine's first 6 bytes) returns at once when all 4 entries are so, else runs the two + | instructions it replaced and goes on in stock at 0x4011de30. All 4 or none. + | + | MTX = 1. The 48-slot matrix 0x40120fc8..0x40121012 (run when [0x8000ed74] is 0): for each slot, + | acc = source word x depth, where the source is the parameter word whose index is the slot's byte at + | MX_SRC, and the entry at MX_ENT is depth (upper word) and destination index (lower, unsigned); then + | the same clamp arithmetic as above on the destination word. ms_matrix (from 0x40120fc0, in place of + | `tst.l 0x8000ed74`, returning the flags stock's `bne` then reads) answers "skip" when: parameter words + | 0..11 are all 0, every source byte is under 12 (so every source word is one of those), and all 48 + | destination words are below 0x8000. ACC0 is clear here: the last list call before it either ran + | stock (MOVCLR) or was skipped after testing it. All 48 or none. + | + | CLR = 1. 0x401214d8..0x401214f6 clears the byte at 0x8000646c + 8 i, i = 0..55, with 9 instructions + | for each. ms_clr (from 0x401214da) writes the same 56 zero bytes with 7 instructions for each 4 and + | goes on at 0x401214f8. Stock loads d0-d3 and a0 again before it reads them. + | + | Registers. ms_slide uses d0, d1, a0: stock loads d0-d4, d6, d7, a0, a1, a5 again before it reads + | them, from 0x40120e56 on and from 0x40120e9e on (d5 is not touched by the pass or by this). + | ms_list: stock's routine uses d0, d1, a0, a1 freely and keeps the rest; so does this. ms_matrix uses + | d0-d3, a0, a1, a4: read in the listing from 0x40121014 on, each is written before it is read on + | every path (also with the matrix off, where only d0 is changed here). + | A skip jumps stock code: a module that later takes a site inside 0x40120e5c..e9d, 0x4011de30..de7a, + | 0x40120fc8..0x40121013 or 0x401214e0..f7 would not run in skipped blocks. None does today. + | + | VERIFY = 1 (self-check): nothing is skipped. Where a skip would be taken, the words are copied, + | stock runs, and the words are compared afterwards (two more sites: 0x40120e9e and 0x40121014). + | CLR is left to stock. Differences are counted. It tests the claim "stock gives the words back" + | on the unit's own data; it does not run the real build's leaving paths (the twin run in the + | emulator does), it compares the 572 words only, and its accumulator tests after stock's pass can + | only read 0 (stock's MOVCLR). + | + | COUNT = 1: counters since boot in ms_total (15 longs): +0 slide pass skipped, +4 run, +8 lists + | skipped, +12 lists run, +16 matrix skipped, +20 matrix run, +24 matrix off (stock's own flag), + | +28 not skipped for an accumulator, +32 not skipped for a word of 0x8000 or more, +36/+40/+44 + | VERIFY: differences slide / lists / matrix, +48/+52/+56 VERIFY: comparisons made. + + .ifndef SLD + .set SLD, 1 + .endif + .ifndef LST + .set LST, 1 + .endif + .ifndef MTX + .set MTX, 1 + .endif + .ifndef CLR + .set CLR, 1 + .endif + .ifndef VERIFY + .set VERIFY, 0 + .endif + .ifndef COUNT + .set COUNT, 0 + .endif + .if VERIFY && !COUNT + .error "the self-check build reports through its counters" + .endif + + .macro total off + .if COUNT + addq.l #1,ms_total+\off + .endif + .endm + + .bss + .balign 4 + .if COUNT + .globl ms_total +ms_total: .space 60 + .endif + .if VERIFY +ms_vs: .space 1096 | the slide pass's 274 longs from PAR + 0x30 +ms_vm: .space 1144 | the 572 parameter words +ms_vw: .space 16 | a list's 4 words, as longs +ms_vfs: .space 1 | the slide pass would have been skipped in this block +ms_vfm: .space 1 | the matrix would have been skipped in this block + .balign 4 + .endif + + .text + + | ------------------------------------------------------------------------------------------------ + .if SLD + | jsr from 0x40120e56 (6 bytes: lea 0x8000f7a8,a0). + .globl ms_slide + .balign 16 +ms_slide: + lea COEF,%a0 + move.l (%a0)+,%d0 + .rept 12 + or.l (%a0)+,%d0 + .endr + swap %d0 + tst.w %d0 | the 13 upper words + jbne 9f + move.l %acc0,%d0 | a move from an accumulator does not set the flags + move.l %acc1,%d1 + or.l %d1,%d0 + bne.s 8f + move.l %macsr,%d0 | fractional, signed, no saturation, truncating: 0x20 in bits 7..4 + and.l #0xf0,%d0 | (the overflow flags above them are sticky: not part of the mode) + moveq #0x20,%d1 + cmp.l %d1,%d0 + bne.s 8f + total 0 + .if VERIFY + moveq #1,%d0 + move.b %d0,ms_vfs + lea PAR+0x30,%a0 + lea ms_vs,%a1 + move.l #274,%d0 +1: move.l (%a0)+,(%a1)+ + subq.l #1,%d0 + bne.s 1b + bra.s 7f + .else + addq.l #4,%sp + jmp SLIDE_END + .endif +9: total 4 +7: lea PAR+0x34,%a0 | the instruction the site replaced + rts +8: total 28 + bra.s 7b + + .if VERIFY + | jsr from 0x40120e9e (6 bytes: tst.l 0x8000fce8; stock's beq reads the flags). + .globl msv_slide +msv_slide: + tst.b ms_vfs + beq.s 3f + clr.b ms_vfs + total 48 + lea PAR+0x30,%a0 + lea ms_vs,%a1 + move.l #274,%d0 +1: move.l (%a0)+,%d1 + cmp.l (%a1)+,%d1 + bne.s 2f + subq.l #1,%d0 + bne.s 1b + move.l %acc0,%d0 + move.l %acc1,%d1 + or.l %d1,%d0 + beq.s 3f +2: total 36 +3: tst.l FCE8 + rts + .endif + .endif + + | ------------------------------------------------------------------------------------------------ + .if LST + | jmp from 0x4011de2a (6 bytes: lea -16(sp),sp / moveq #4,d0). 4(sp) = value, 8(sp) = list. + .globl ms_list + .balign 16 +ms_list: + move.l 8(%sp),%a1 + tst.w 6(%sp) | the value's lower word: the factor stock uses + beq.s 1f + tst.w (%a1) | the 4 depths + jbne 9f + tst.w 4(%a1) + jbne 9f + tst.w 8(%a1) + jbne 9f + tst.w 12(%a1) + jbne 9f +1: move.l %acc0,%d0 + tst.l %d0 + bne.s 8f + lea PAR,%a0 + mvs.w 2(%a1),%d0 | the 4 words: below 0x8000? + tst.w (%a0,%d0.l*2) + jbmi 7f + mvs.w 6(%a1),%d0 + tst.w (%a0,%d0.l*2) + jbmi 7f + mvs.w 10(%a1),%d0 + tst.w (%a0,%d0.l*2) + jbmi 7f + mvs.w 14(%a1),%d0 + tst.w (%a0,%d0.l*2) + jbmi 7f + total 8 + .if VERIFY + bra.s ms_list_chk + .else + rts + .endif + .if COUNT +7: total 32 + bra.s ms_list_stock +8: total 28 + bra.s ms_list_stock +9: total 12 + .else +7: +8: +9: + .endif +ms_list_stock: + lea -16(%sp),%sp + moveq #4,%d0 + jmp LIST_BODY + + .if VERIFY + | a1 = list, a0 = PAR. Keep the 4 words, run stock on the same arguments, compare. +ms_list_chk: + .irp k, 0, 1, 2, 3 + mvs.w 2+4*\k(%a1),%d0 + mvz.w (%a0,%d0.l*2),%d1 + move.l %d1,ms_vw+4*\k + .endr + move.l 8(%sp),-(%sp) | list + move.l 8(%sp),-(%sp) | value (4(sp) before the push above) + bsr.s ms_list_stock + addq.l #8,%sp + total 52 + move.l 8(%sp),%a1 + lea PAR,%a0 + .irp k, 0, 1, 2, 3 + mvs.w 2+4*\k(%a1),%d0 + mvz.w (%a0,%d0.l*2),%d1 + cmp.l ms_vw+4*\k,%d1 + bne.s 2f + .endr + move.l %acc0,%d0 + tst.l %d0 + beq.s 3f +2: total 40 +3: rts + .endif + .endif + + | ------------------------------------------------------------------------------------------------ + .if MTX + | jsr from 0x40120fc0 (6 bytes: tst.l 0x8000ed74). Returns NE for "no matrix pass", EQ for stock's loop. + .globl ms_matrix + .balign 16 +ms_matrix: + tst.l MX_OFF + jbne 8f + lea PAR,%a0 + move.l (%a0),%d0 | parameter words 0..11 + or.l 4(%a0),%d0 + or.l 8(%a0),%d0 + or.l 12(%a0),%d0 + or.l 16(%a0),%d0 + or.l 20(%a0),%d0 + jbne 9f + | Every source byte under 12? d2 collects the bytes, d3 the bytes + 4: with no byte of 16 or more + | (d2's upper nibbles clear) no addition carries into the next byte, and a byte + 4 has an upper + | nibble exactly when the byte is 12..15. + lea MX_SRC,%a1 + lea 48(%a1),%a4 + moveq #0,%d2 + moveq #0,%d3 + move.l #0x04040404,%d1 +1: move.l (%a1)+,%d0 + or.l %d0,%d2 + add.l %d1,%d0 + or.l %d0,%d3 + cmpa.l %a4,%a1 + bne.s 1b + or.l %d3,%d2 + and.l #0xf0f0f0f0,%d2 + jbne 9f + lea MX_ENT,%a1 | the 48 destination words: below 0x8000? + lea 192(%a1),%a4 +2: mvz.w 2(%a1),%d0 + tst.w (%a0,%d0.l*2) + jbmi 7f + mvz.w 6(%a1),%d0 + tst.w (%a0,%d0.l*2) + jbmi 7f + mvz.w 10(%a1),%d0 + tst.w (%a0,%d0.l*2) + jbmi 7f + mvz.w 14(%a1),%d0 + tst.w (%a0,%d0.l*2) + jbmi 7f + lea 16(%a1),%a1 + cmpa.l %a4,%a1 + bne.s 2b + total 16 + .if VERIFY + moveq #1,%d0 + move.b %d0,ms_vfm + lea ms_vm,%a1 + move.l #286,%d0 +3: move.l (%a0)+,(%a1)+ + subq.l #1,%d0 + bne.s 3b + moveq #0,%d0 | EQ: stock's loop runs, msv_matrix compares + rts + .else + moveq #1,%d0 | NE + rts + .endif + .if COUNT +7: total 32 + bra.s 6f +9: total 20 + .else +7: +9: + .endif +6: moveq #0,%d0 | EQ + rts +8: total 24 + moveq #1,%d0 | NE, as stock's test gave + rts + + .if VERIFY + | jsr from 0x40121014 (6 bytes: move.l 0x40287ffc,-(sp)). + .globl msv_matrix +msv_matrix: + tst.b ms_vfm + beq.s 3f + clr.b ms_vfm + total 56 + lea PAR,%a0 + lea ms_vm,%a1 + move.l #286,%d0 +1: move.l (%a0)+,%d1 + cmp.l (%a1)+,%d1 + bne.s 2f + subq.l #1,%d0 + bne.s 1b + move.l %acc0,%d0 + tst.l %d0 + beq.s 3f +2: total 44 +3: move.l FRAMES,%d0 + move.l (%sp),-(%sp) | the return address moves down, the argument goes above it + move.l %d0,4(%sp) + rts + .endif + .endif + + | ------------------------------------------------------------------------------------------------ + .if CLR && !VERIFY + | jmp from 0x401214da (6 bytes: lea 0x800063c0,a0). + .globl ms_clr + .balign 16 +ms_clr: + lea FLAGS,%a0 + moveq #14,%d0 +1: clr.b (%a0) + clr.b 8(%a0) + clr.b 16(%a0) + clr.b 24(%a0) + lea 32(%a0),%a0 + subq.l #1,%d0 + bne.s 1b + jmp CLR_END + .endif diff --git a/sdk/analog-rytm-mkii/modules/improved-performance/src/sample-voices.s b/sdk/analog-rytm-mkii/modules/improved-performance/src/sample-voices.s new file mode 100644 index 0000000000..19946b1cbd --- /dev/null +++ b/sdk/analog-rytm-mkii/modules/improved-performance/src/sample-voices.s @@ -0,0 +1,577 @@ + | SPDX-License-Identifier: GPL-3.0-or-later + | Improved Performance for the Analog Rytm MKII (Nathaniel Pavel), the sample voices: skip the sample engine's interpolation and + | decimation for a voice that has nothing to play. + | + | Stock OS 1.74's sample engine (0x4011c6b8, once an audio block) runs, for each of its 8 voices, a 6-tap + | interpolation to 64 samples, a 2:1 decimation to 32 and a gain ramp, also for a voice that plays + | nothing: such a voice is fed a window of zeros. On the author's MKII the whole routine measured 15.1 + | points of the block (CM02, 17 Nov 2026). + | + | A voice is skipped only when all of this holds, tested each block: + | - its active flag (record + 40) is clear; + | - its 12 filter state longs (record + 44 .. + 91) are zero; + | - every word the interpolation would read from its fetched window is zero; + | - the EMAC accumulators and their extensions hold zero, as stock always leaves them here, and as the + | joined module's other skips leave them (each is taken only with them clear, or leaves them as found: + | set review, 20 Nov 2026) (review R1: + | the first interpolated value and the gain stage's first output add to what ACC0 and ACC2 hold). + | Then the interpolation's 64 results are zero, the decimation's 32 results and its new state are zero, + | and the only other thing the two loops leave behind is the play position, which is 64 steps of the + | rate added to the phase. So: the phase is computed in closed form and stored by stock's own three + | stores (0x4011ccb6), the decimation's 32 output longs are set to zero (0x8000e1d0), and stock's gain + | stage (0x4011ce5e) runs as ever on those zeros: it stores the gain and writes the voice's 32 output + | zeros itself. Nothing else that the two loops would have written is used later: their scratch at + | 0x8000e260..0x8000e41f is written again before it is used (the next voice reads 0x8000e31c only to + | store it straight back), and the record's state stays zero. + | + | Sites (build.json): 0x4011cc08 (8 B) -> dsk_interp, 0x4011cd46 (6 B) -> dsk_decim, and in the VERIFY + | build 0x4011cf5e (8 B) -> dsk_tail. + | + | FETCH = 1 adds the second part (S1b): no transfer of zeros. While voice v is worked on, stock fetches + | voice v + 1's window with two eDMA transfers (their descriptors at [0x80005820] and [0x80005824]: + | source +0, 16 bytes a pass +8, destination +16, passes in the low 9 bits of the word +20) into an SRAM + | buffer, and waits for each to finish. For a voice with nothing to play the source is the silence region + | 0x4f9372e0 (0x160 bytes that stock clears once, at 0x4011c132, and that nothing else names; the sample + | pool ends below it, 0x4009dc24). On the author's MKII the engine still measured 9.9 points with all 8 + | voices skipped by the first part: the handler waits for those transfers with nothing left to compute. + | At the two places where stock starts a transfer (0x4011cbba for the first descriptor, 0x4011cd30 for + | the second; voices 1 to 7: voice 0's are started elsewhere and left alone), a descriptor whose source + | is exactly the silence region, with 16 bytes a pass and at most 22 passes (0x160 bytes), is not + | started: its destination range is set to zero here, the "running" flag stays clear, so stock's own + | wait is not entered, and the "programmed" flag is cleared as the start would. The decision reads the + | descriptor as it stands, after any module has changed it (Improved SMPL points a turning loop's + | transfer at its mirror buffer: that source is not the silence region, so it is fetched as ever). + | Sites: 0x4011cbba (6 B) -> dsf_a, 0x4011cd30 (6 B) -> dsf_b. + | Also required, so that the patch tests what it assumes about a descriptor: unit sizes and source step + | as stock sets them once (+4: 0x0401, 16), destination step 2 (+22), and the count word's upper bits as + | stock writes them every pass (0xC000 for the first, 0xBE00 for the second: the channel linked to itself). + | The zeros are written as longs on a long boundary (a destination at 2 mod 4 gets a word first and last). + | VERIFY with FETCH: every transfer is started as stock does, and what it wrote is checked to be zero + | where stock leaves it in the window: the two destination ranges overlap, and stock saves the first + | transfer's words of the overlap before it starts the second and puts them back after it (0x4011cd10, + | 0x4011cbe4). So the first transfer's range is checked whole before the second starts (in dsf_b, or in + | dsk_decim when no second one starts), and the second's from its start up to where the put-back begins + | ([0x8000583c] words, read when it starts), in dsk_interp of the voice it was for. + | Counters: [14] transfers not started (VERIFY: that would not have been), [15] VERIFY differences of + | those ranges; since boot: dsk_total [2] the differences, [3] the transfers. + | + | TRIM = 1 (needs FETCH) adds the third part: write and test nothing that is known to be zero already, + | and skip stock's gain loop for a skipped voice. + | Windows. The two window buffers (0x80005880, 0x800059e0, 176 words each) are fetched in turn. For + | a voice with nothing to play stock fetches words 0..71 with the second transfer and 72..143 with + | the first. dsz_bits keeps, within one block, "this half of this buffer holds zeros": set when such a + | half was zeroed here (the low half only when stock has nothing to put back into the window, + | [0x80005840] <= 0); all cleared when any transfer is really started, and at the end of the block + | (dsg, voice 7), so nothing written between blocks (voice 0's transfers, 0x4011c1e0) matters. A half + | that is known to hold zeros is not zeroed again. (Not testing such a window again in dsk_interp was + | tried and taken out: an idle voice's test reads a few longs, the shortcut cost more than it saved.) + | What stock writes into a window besides the transfers is its + | put-back (0x4011cbe4): the words it saved from the same places before the second transfer + | (0x4011cd10), so it cannot make a half nonzero that held zeros before that transfer. + | Gain. After a skipped voice the decimation's output would be 32 zeros, so stock's gain loop + | (0x4011cf32, 16 passes) writes 32 zeros to the voice's output (0x800067f8 + 128 * voice) whatever the + | gains are, provided ACC2 and ACC3 hold nothing, and leaves all four accumulators clear. The site + | 0x4011cec6 (6 B: `mvz.w 6(a1),d0 ; swap d0`, after stock has stored the voice's new gain) -> dsg: + | for a skipped voice with ACC2, ACC3 and their extension clear, ACC0 and ACC1 are cleared, the 32 + | output longs are zeroed unless dsz_out says they still are (set here, cleared whenever stock's loop + | runs for that voice; nothing else writes that buffer: its other user, the mixer 0x4010ea98, reads), + | and stock resumes after the loop (0x4011cf5e). The decimation's output is then not zeroed at all + | (its only reader is that loop); if the accumulators are not clear it is zeroed and the loop runs. + | VERIFY with TRIM: nothing is skipped; wherever the real build would rely on "still zero" (a + | window half, an output buffer) the bytes are tested at that moment and differences counted. + | dsk_total [4] window halves not zeroed, [5] unused, [6] gain loops skipped, [7] output + | buffers not zeroed (VERIFY: that would not be), [8] VERIFY differences of this part (also in [15]). + | + | 18 Nov 2026: until this date every accumulator test here was `move.l %accN,%d0 ; bne`, and a move from + | an accumulator does not set the condition codes: the branch followed the flags of the instruction + | before (never taken in the real builds, always taken in dsg's VERIFY build, which is how the unit run + | of SV05 showed it: 0 gain loops counted). So SK01 and SK03 ran without those tests; what they were + | meant to enforce held anyway as far as anyone could see (stock clears all four accumulators at the + | handler's entry and after every use). Each test now has its `tst.l`. + | VERIFY = 1: nothing is skipped. Stock runs all of it; for a voice that would have been skipped the + | module checks what stock produced against what the skip assumes (phase, position, 64 interpolated + | longs zero, state zero, 32 output longs zero) and counts every difference. + | Counters (the telemetry base's mw_tl_diag, page 7, a second each): [8] voices skipped (VERIFY: that + | would have been), [9] inactive voices kept for nonzero state, [10] kept for a nonzero window, + | [11] VERIFY differences (must stay 0), [12] active voices, [13] kept for a nonzero accumulator. + | dsk_total: [0] VERIFY differences, [1] voices skipped, both since boot and never cleared (read them + | over the link: the page's counters are cleared as they are sent and could lose a count). + | COUNT = 0 (the standalone build, for an image without the telemetry base): no counters at all, so + | nothing of the measuring base is imported. Every instruction is the same as with COUNT = 1 (the + | default, and what the measured images SK06 / SV06 were built with) except the counters and four + | branches that only jumped over a counter (review data/standalone-review.md: no defect). + .ifndef COUNT + .set COUNT, 0 + .endif + .if VERIFY && !COUNT + .error "the self-check build reports through its counters" + .endif + .if COUNT + .equ DIAG, mw_tl_diag + .extern mw_tl_diag + .endif + .macro diag off + .if COUNT + addq.l #1,DIAG+\off + .endif + .endm + .macro total off + .if COUNT + addq.l #1,dsk_total+\off + .endif + .endm + + .bss + .balign 4 +dsk_pred: .space 12 | VERIFY: phase, samples advanced, position after +dsk_flag: .space 1 | this voice is being skipped (VERIFY: would have been) + .balign 4 + .if COUNT + .globl dsk_total +dsk_total: .space 40 + .endif + .if TRIM +dsz_bits: .space 1 | bit 0, 1: 0x80005880's low and high half hold zeros; 2, 3: 0x800059e0's +dsz_out: .space 1 | bit v: voice v's output buffer holds zeros + .balign 4 + .endif + .if VERIFY +dsf_a_pend: .space 8 | first transfer's range, to check before the second starts: address, words +dsf_b_next: .space 8 | second transfer's range for the next voice: address, words +dsf_b_cur: .space 8 | ... for the voice now worked on + .endif + + .text + .globl dsk_interp, dsk_decim + .balign 16 +| Site 0x4011cc08: `move.l 36(a3),d0 ; lea (a0,d0.l*2),a0`. a3 = the voice's record, a0 = its fetched window. +| Stock writes d0-d7, a1, a2, a4-a6 again before it reads them; a0 and a3 are kept here. +dsk_interp: + .if VERIFY && FETCH + movea.l dsf_b_cur,%a1 | this voice's second transfer was waited for at 0x4011cb40 + move.l dsf_b_cur+4,%d0 + beq.s 22f +21: tst.w (%a1)+ + bne.s 23f + subq.l #1,%d0 + bne.s 21b + bra.s 22f +23: diag 60 + total 8 +22: + .endif + tst.b 40(%a3) + bne 5f | active + lea 44(%a3),%a1 + move.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + or.l (%a1)+,%d0 + bne 6f | filter state not zero + move.l %acc0,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne 4f + move.l %acc2,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne 4f + move.l %accext01,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne 4f + move.l %accext23,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne 4f + | Stock: d2 = rate >> 28 (whole step), d5 = rate << 4 (fraction step), d3 = phase (record + 28), + | d1 = 0; one add before the loop, one in each of 64 passes, one taken back after: 64 steps of the + | 64-bit (d2:d5) added to (d1:d3). + move.l 12(%a3),%d5 + move.l %d5,%d2 + moveq #28,%d0 + asr.l %d0,%d2 + lsl.l #4,%d5 + move.l 28(%a3),%d3 + move.l %d5,%d1 + moveq #26,%d0 + lsr.l %d0,%d1 | high long of 64 * fraction step + move.l %d2,%d0 + lsl.l #6,%d0 + add.l %d0,%d1 | + 64 * whole step + move.l %d5,%d0 + lsl.l #6,%d0 + moveq #0,%d4 + add.l %d0,%d3 | d3 = the phase after + addx.l %d4,%d1 | d1 = samples advanced (signed) + | The words the interpolation reads: 12 bytes at window + 2 * position for every position from 0 to + | d1 (the position only moves one way within a block). + move.l 36(%a3),%d0 + lea (%a0,%d0.l*2),%a2 + tst.b 42(%a3) + beq.s 1f + lea 252(%a2),%a2 +1: move.l %d1,%d0 + bpl.s 2f + lea (%a2,%d1.l*2),%a2 + neg.l %d0 +2: cmpi.l #512,%d0 + bhi 7f | not a step stock plays: leave it to stock + addq.l #7,%d0 + lsr.l #1,%d0 | longs: covers 2 * |d1| + 12 bytes (+ 14 when |d1| is odd) +3: tst.l (%a2)+ + bne 7f + subq.l #1,%d0 + bne.s 3b + diag 32 + total 4 + .if VERIFY + move.l %d3,dsk_pred + move.l %d1,dsk_pred+4 + add.l 4(%a3),%d1 + move.l %d1,dsk_pred+8 + moveq #1,%d0 + move.b %d0,dsk_flag + bra.s 9f + .else + moveq #1,%d0 + move.b %d0,dsk_flag + addq.l #4,%sp | no return to the site + jmp STORE_PHASE | stock: record + 28 = d3, + 32 = d1, + 4 += d1 + .endif + .if COUNT +4: diag 52 + bra.s 9f +5: diag 48 + bra.s 9f +6: diag 36 + bra.s 9f +7: diag 40 + .else +4: +5: +6: +7: + .endif +9: move.l 36(%a3),%d0 | the site's own two instructions + lea (%a0,%d0.l*2),%a0 + rts + + .balign 16 +| Site 0x4011cd46: `lea 44(a3),a0 ; move.l a0,-(sp)`, the decimation's start. Stock loads d0 and a1 next. +dsk_decim: + .if VERIFY && FETCH + bsr dsf_check_a | no second transfer was started in this pass: check the first now + move.l dsf_b_next,%d0 | what was fetched in this pass is the next voice's window + move.l %d0,dsf_b_cur + move.l dsf_b_next+4,%d0 + move.l %d0,dsf_b_cur+4 + clr.l dsf_b_next+4 + .endif + tst.b dsk_flag + beq.s 8f + .if VERIFY + move.l 28(%a3),%d0 + cmp.l dsk_pred,%d0 + bne.s 4f + move.l 32(%a3),%d0 + cmp.l dsk_pred+4,%d0 + bne.s 4f + move.l 4(%a3),%d0 + cmp.l dsk_pred+8,%d0 + bne.s 4f + lea INTERP_OUT,%a0 + moveq #64,%d0 +1: tst.l (%a0)+ + bne.s 4f + subq.l #1,%d0 + bne.s 1b + bra.s 8f +4: diag 44 + total 0 + .else + .if !TRIM + clr.b dsk_flag + lea DECIM_OUT,%a0 + moveq #32,%d0 +1: clr.l (%a0)+ + subq.l #1,%d0 + bne.s 1b + .endif | TRIM: dsg takes the flag and decides + addq.l #4,%sp | no return to the site + jmp GAIN_STAGE + .endif +8: movea.l (%sp)+,%a1 | the site's own two instructions, then back + lea 44(%a3),%a0 + move.l %a0,-(%sp) + jmp (%a1) + + .if VERIFY + .globl dsk_tail + .balign 16 +| Site 0x4011cf5e: `moveq #92,d3 ; moveq #8,d4 ; addq.l #1,88(sp)`, after the gain stage; 88(sp) is the voice. +dsk_tail: + tst.b dsk_flag + beq.s 8f + clr.b dsk_flag + lea -16(%sp),%sp + movem.l %d0-%d1/%a0-%a1,(%sp) + lea 44(%a3),%a1 + moveq #12,%d0 +1: tst.l (%a1)+ + bne.s 4f + subq.l #1,%d0 + bne.s 1b + move.l 16+4+88(%sp),%d0 | the voice, not yet counted on + lsl.l #7,%d0 + addi.l #VOICE_OUT,%d0 + movea.l %d0,%a1 + moveq #32,%d0 +2: tst.l (%a1)+ + bne.s 4f + subq.l #1,%d0 + bne.s 2b + bra.s 5f +4: diag 44 + total 0 +5: movem.l (%sp),%d0-%d1/%a0-%a1 + lea 16(%sp),%sp +8: moveq #92,%d3 + moveq #8,%d4 + addq.l #1,4+88(%sp) + rts + .endif + + .if FETCH + .equ SILENCE, 0x4f9372e0 + .if VERIFY +| The first transfer's range, whole, once it has been waited for (0x4011ccc2) and before the second one can +| write into the overlap. Uses d0 and a1. +dsf_check_a: + move.l dsf_a_pend+4,%d0 + beq.s 3f + movea.l dsf_a_pend,%a1 + clr.l dsf_a_pend+4 +1: tst.w (%a1)+ + bne.s 2f + subq.l #1,%d0 + bne.s 1b + rts +2: diag 60 + total 8 +3: rts + .endif +| A transfer's start: the site is `movea.l ,a0`, and stock then writes 1 to +30 (start), +| sets the running flag and clears the programmed flag. d0 and a1 are written again by stock before it reads +| them, on both ways out (0x4011cbc0 / 0x4011cbd0, 0x4011cd36 / 0x4011cd46); a0 too after the resume address. +| second = 0: the first descriptor (0x4011cbba); 1: the second (0x4011cd30). + .macro fetch name, tcdptr, progflag, resume, linkbits, second + .globl \name + .balign 16 +\name: + .if VERIFY && \second + bsr dsf_check_a + .endif + movea.l \tcdptr,%a0 | the site's own instruction + movea.l (%a0),%a1 + cmpa.l #SILENCE,%a1 + bne 9f | a real source + moveq #16,%d0 + cmp.l 8(%a0),%d0 + bne 9f | not 16 bytes a pass + move.l 4(%a0),%d0 + cmpi.l #0x04010010,%d0 + bne 9f | not 16-byte reads, 16-bit writes, source step 16 + move.l 20(%a0),%d0 | count word, destination step + subi.l #\linkbits+2,%d0 + swap %d0 | = the passes, if the link bits and the step are stock's + beq 9f + cmpi.l #22,%d0 + bhi 9f | past the 0x160 bytes stock keeps at zero, or other bits + movea.l 16(%a0),%a1 | the destination + diag 56 + total 12 + .if TRIM + cmpi.l #9,%d0 + bne.s 47f | not an idle voice's 72 words + move.l %a1,%d0 + subi.l #QBUF+144*(1-\second),%d0 + beq.s 41f + subi.l #PBUF-QBUF,%d0 + bne.s 46f | not a half of a buffer + moveq #3-\second,%d0 | the bit: 0x800059e0's high half (first transfer) or low half + bra.s 42f +41: moveq #1-\second,%d0 | 0x80005880's +42: + .if VERIFY + lea -12(%sp),%sp + movem.l %d1/%a0/%a2,(%sp) + lea dsz_bits,%a0 + btst %d0,(%a0) + beq.s 44f + total 16 | the real build writes nothing here: it must hold zeros now + movea.l %a1,%a2 + moveq #36,%d1 +43: tst.l (%a2)+ + bne.s 48f + subq.l #1,%d1 + bne.s 43b + bra.s 45f +48: diag 60 + total 32 + bra.s 45f +44: + .if \second + tst.l 0x80005840 + bgt.s 45f | stock will put words back into this half: claim nothing + .endif + bset %d0,(%a0) +45: movem.l (%sp),%d1/%a0/%a2 + lea 12(%sp),%sp + .else + lea dsz_bits,%a0 + btst %d0,(%a0) + bne.s 49f | holds zeros already: write nothing + .if \second + tst.l 0x80005840 + bgt.s 46f | stock will put words back into this half: zero it, claim nothing + .endif + bset %d0,(%a0) + lea 144(%a1),%a0 +43: clr.l (%a1)+ | 36 longs; both halves start on a long boundary + cmpa.l %a0,%a1 + bcs.s 43b + bra.s 2f +49: total 16 + bra.s 2f + .endif +46: moveq #9,%d0 +47: + .endif + .if VERIFY + lsl.l #3,%d0 | words + .if \second + cmp.l 0x8000583c,%d0 | stock puts the first transfer's saved words back from here on + bls.s 1f + move.l 0x8000583c,%d0 +1: move.l %a1,dsf_b_next + move.l %d0,dsf_b_next+4 + .else + move.l %a1,dsf_a_pend + move.l %d0,dsf_a_pend+4 + .endif + rts | stock starts it + .else + lsl.l #4,%d0 | bytes + lea (%a1,%d0.l),%a0 | the end + move.l %a1,%d0 + btst #1,%d0 + beq.s 1f + clr.w (%a1)+ | to a long boundary + subq.l #2,%a0 +1: clr.l (%a1)+ + cmpa.l %a0,%a1 + bcs.s 1b + btst #1,%d0 + beq.s 2f + clr.w (%a1) +2: clr.b \progflag | as the start does; the running flag stays clear: no wait + addq.l #4,%sp | no return to the site + jmp \resume + .endif +9: + .if TRIM + clr.b dsz_bits | a transfer is really started: nothing is known any more + .endif + rts + .endm + + .equ QBUF, 0x80005880 + .equ PBUF, 0x800059e0 + fetch dsf_a, 0x80005820, 0x80005828, 0x4011cbd0, 0xC0000000, 0 + fetch dsf_b, 0x80005824, 0x8000582a, 0x4011cd46, 0xBE000000, 1 + .endif + + .if TRIM + .globl dsg + .balign 16 +| Site 0x4011cec6: `mvz.w 6(a1),d0 ; swap d0`, in the gain stage after the new gain is stored (0x4011ceb8). +| a5 = the voice, fp = its output buffer, a1 = its track's record. d0 and a0 are written again by stock +| before it reads them (a0 at 0x4011cf16); after 0x4011cf5e stock reads nothing the loop left. +dsg: + moveq #7,%d0 + cmp.l %a5,%d0 + bne.s 1f + clr.b dsz_bits | the block's last voice: the windows are not known past here +1: tst.b dsk_flag + beq.s 7f | not a skipped voice + .if !VERIFY + clr.b dsk_flag + .endif + move.l %acc2,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne.s 5f + move.l %acc3,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne.s 5f + move.l %accext23,%d0 + tst.l %d0 | a move from an accumulator leaves the condition codes alone + bne.s 5f + total 24 + .if VERIFY + move.l %a5,%d0 + lea dsz_out,%a0 + bset %d0,(%a0) + beq.s 8f | the real build zeroes it now + total 28 | it writes nothing: the buffer must hold zeros now + movea.l %fp,%a0 + moveq #32,%d0 +2: tst.l (%a0)+ + bne.s 3f + subq.l #1,%d0 + bne.s 2b + bra.s 8f +3: diag 60 + total 32 + bra.s 8f +5: + .else + movclr.l %acc0,%d0 | stock's loop leaves all four clear + movclr.l %acc1,%d0 + move.l %a5,%d0 + lea dsz_out,%a0 + bset %d0,(%a0) + .if COUNT + bne.s 3f | still zeros from an earlier block + .else + bne.s 4f | still zeros from an earlier block + .endif + movea.l %fp,%a0 + moveq #32,%d0 +2: clr.l (%a0)+ + subq.l #1,%d0 + bne.s 2b + .if COUNT + bra.s 4f +3: total 28 + .endif +4: addq.l #4,%sp | no return to the site + jmp TAIL +5: lea DECIM_OUT,%a0 | accumulators not clear: give stock's loop its zeros + moveq #32,%d0 +6: clr.l (%a0)+ + subq.l #1,%d0 + bne.s 6b + .endif +7: move.l %a5,%d0 | stock's loop writes this voice's output + lea dsz_out,%a0 + bclr %d0,(%a0) +8: mvz.w 6(%a1),%d0 | the site's own two instructions + swap %d0 + rts + .endif + diff --git a/src/community/module-changelogs/analog-rytm-mkii-improved-performance.json b/src/community/module-changelogs/analog-rytm-mkii-improved-performance.json new file mode 100644 index 0000000000..41a522d789 --- /dev/null +++ b/src/community/module-changelogs/analog-rytm-mkii-improved-performance.json @@ -0,0 +1,12 @@ +[ + { + "version": "0.1.0-experimental", + "date": "2026-11-20", + "changes": [ + "First release. The audio engine leaves out work that cannot change the sound, so the same pattern uses less CPU and the screen and keys answer faster under load.", + "Nothing to set. CPU shows in the lower right corner of the screen when the audio load is close to its limit, and OVR when it is over.", + "The output is stock's, but for one thing: a delay or reverb that has died away below -114 dBFS and has no input is given exact silence.", + "Known limits: OS 1.74 only; tested on one unit beside 17 other modules; a project load while sound rings and long USB audio streams are not tested yet." + ] + } +] From 29a8e68f18669772e2fa54ff787e45319aba9ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20A=C3=9Ffalg?= <67785539+repeat98@users.noreply.github.com> Date: Sat, 21 Nov 2026 09:30:57 +0100 Subject: [PATCH 008/105] Run contributor and post-merge agent evals on historical fixes (#1911) --- .agents/skills/modwerk-pr-ready/SKILL.md | 1 + .claude/skills/modwerk-pr-ready/SKILL.md | 1 + .github/workflows/agent-eval.yml | 85 ++++++++++++++++++++++ AGENTS.md | 2 +- changelog/2026-11-21-agent-evals.md | 1 + docs/AGENT_EVALS.md | 21 ++++++ docs/README.md | 1 + package.json | 1 + scripts/agent-eval/Dockerfile | 3 + scripts/agent-eval/cases.mjs | 24 +++++++ scripts/agent-eval/grade.mjs | 54 ++++++++++++++ scripts/agent-eval/run.mjs | 89 ++++++++++++++++++++++++ scripts/agent-eval/run.test.mjs | 29 ++++++++ scripts/pr-ready.mjs | 7 ++ 14 files changed, 318 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/agent-eval.yml create mode 100644 changelog/2026-11-21-agent-evals.md create mode 100644 docs/AGENT_EVALS.md create mode 100644 scripts/agent-eval/Dockerfile create mode 100644 scripts/agent-eval/cases.mjs create mode 100644 scripts/agent-eval/grade.mjs create mode 100644 scripts/agent-eval/run.mjs create mode 100644 scripts/agent-eval/run.test.mjs diff --git a/.agents/skills/modwerk-pr-ready/SKILL.md b/.agents/skills/modwerk-pr-ready/SKILL.md index 63e69f6f77..6332032e29 100644 --- a/.agents/skills/modwerk-pr-ready/SKILL.md +++ b/.agents/skills/modwerk-pr-ready/SKILL.md @@ -10,6 +10,7 @@ Follow `docs/DEVELOPER_WORKFLOW.md#make-it-mergeable`. 1. **Merge** current `origin/main` into the branch. Never rebase: catalogue rows pin the pull request's own commit. 2. **Regenerate** generated files rather than resolving them by hand: `npm run modules:generate`, `npm run licenses:generate`, `npm run machines:generate`. 3. **Check once.** For a new commit, stage the intended files and run `npm run pr:ready -- --commit "Message"`. For an existing commit, run `npm run pr:ready`. For a registered author, use `npm run pr:ready -- --author ` and include the same `--author` option when committing. Let each command manage its own machine slot so other worktrees can run while you push or watch GitHub. + - On a replay assignment, read the printed TASK.md, attempt it in its snapshot and repeat the same command with `--eval-agent ""`. Do this yourself on the first attempt, including when you could only partly solve it. The score stays on this computer ([agent evals](../../../docs/AGENT_EVALS.md)). - It also claims on the agent board what the branch adds (a new module, hook or table index, migration) and stops when someone else holds one. Never work around a claim: renumber, rename or ask its holder yourself. Signed out, it asks for `npm run board -- login` first. When it notes questions or replies in the developer's board inbox, read them (`npm run board -- inbox`), answer them yourself from what you can check, close your settled ones, and tell the developer what you said; only a decision about their own work goes to them first. When it offers a finding, post it yourself. 4. **Push** and update the pull request; with none open yet, open it as a draft (`gh pr create --draft`), which should have happened early ([Open a draft early](../../../docs/DEVELOPER_WORKFLOW.md#open-a-draft-early)). Mark it ready (`gh pr ready`) when the work is done and pr:ready says Ready. If it changes what runs on an instrument (a `.mwrm` package or `.elemod` base), mark it ready only after the developer has tested that exact build on a unit; the description then names it on a line of its own ("Tested on a unit: base 8d1db124, MKII, what ran", or "Not tested on a unit: "). Draft or ready, it lists the change's edge cases under a line "Edge cases", as the table `npm run test:procedure` writes, or "Edge cases: none, because …" (`docs/TEST_PROCEDURE.md`). CI checks both. A base change opens no pull request of its own: commit it to its machine's cumulative draft from `base/-next`, or open yours against that branch (`gh pr create --base base/-next`). That draft stays a draft until the base has been tested extensively on a unit; never mark it ready, only the owner does ([Change a base](../../../docs/DEVELOPER_WORKFLOW.md#change-a-base)). Ready from pr:ready means the checks pass, not that it was tested. A change outside a module is titled `Fix: …`, `Improvement: …` or `Docs: …`. Write the description in the template's shape: what changed, how you checked it, and a line that answers the guides question ("Guides: nothing" is fine). CI checks it. - Watch `gh pr checks --watch` until green. For a red job, read `gh run view --log-failed`. diff --git a/.claude/skills/modwerk-pr-ready/SKILL.md b/.claude/skills/modwerk-pr-ready/SKILL.md index 63e69f6f77..6332032e29 100644 --- a/.claude/skills/modwerk-pr-ready/SKILL.md +++ b/.claude/skills/modwerk-pr-ready/SKILL.md @@ -10,6 +10,7 @@ Follow `docs/DEVELOPER_WORKFLOW.md#make-it-mergeable`. 1. **Merge** current `origin/main` into the branch. Never rebase: catalogue rows pin the pull request's own commit. 2. **Regenerate** generated files rather than resolving them by hand: `npm run modules:generate`, `npm run licenses:generate`, `npm run machines:generate`. 3. **Check once.** For a new commit, stage the intended files and run `npm run pr:ready -- --commit "Message"`. For an existing commit, run `npm run pr:ready`. For a registered author, use `npm run pr:ready -- --author ` and include the same `--author` option when committing. Let each command manage its own machine slot so other worktrees can run while you push or watch GitHub. + - On a replay assignment, read the printed TASK.md, attempt it in its snapshot and repeat the same command with `--eval-agent ""`. Do this yourself on the first attempt, including when you could only partly solve it. The score stays on this computer ([agent evals](../../../docs/AGENT_EVALS.md)). - It also claims on the agent board what the branch adds (a new module, hook or table index, migration) and stops when someone else holds one. Never work around a claim: renumber, rename or ask its holder yourself. Signed out, it asks for `npm run board -- login` first. When it notes questions or replies in the developer's board inbox, read them (`npm run board -- inbox`), answer them yourself from what you can check, close your settled ones, and tell the developer what you said; only a decision about their own work goes to them first. When it offers a finding, post it yourself. 4. **Push** and update the pull request; with none open yet, open it as a draft (`gh pr create --draft`), which should have happened early ([Open a draft early](../../../docs/DEVELOPER_WORKFLOW.md#open-a-draft-early)). Mark it ready (`gh pr ready`) when the work is done and pr:ready says Ready. If it changes what runs on an instrument (a `.mwrm` package or `.elemod` base), mark it ready only after the developer has tested that exact build on a unit; the description then names it on a line of its own ("Tested on a unit: base 8d1db124, MKII, what ran", or "Not tested on a unit: "). Draft or ready, it lists the change's edge cases under a line "Edge cases", as the table `npm run test:procedure` writes, or "Edge cases: none, because …" (`docs/TEST_PROCEDURE.md`). CI checks both. A base change opens no pull request of its own: commit it to its machine's cumulative draft from `base/-next`, or open yours against that branch (`gh pr create --base base/-next`). That draft stays a draft until the base has been tested extensively on a unit; never mark it ready, only the owner does ([Change a base](../../../docs/DEVELOPER_WORKFLOW.md#change-a-base)). Ready from pr:ready means the checks pass, not that it was tested. A change outside a module is titled `Fix: …`, `Improvement: …` or `Docs: …`. Write the description in the template's shape: what changed, how you checked it, and a line that answers the guides question ("Guides: nothing" is fine). CI checks it. - Watch `gh pr checks --watch` until green. For a red job, read `gh run view --log-failed`. diff --git a/.github/workflows/agent-eval.yml b/.github/workflows/agent-eval.yml new file mode 100644 index 0000000000..622a2b24d9 --- /dev/null +++ b/.github/workflows/agent-eval.yml @@ -0,0 +1,85 @@ +name: Post-merge agent eval +on: + push: + branches: [main] + pull_request: + paths: + - 'scripts/agent-eval/**' + - '.github/workflows/agent-eval.yml' + workflow_dispatch: +permissions: + contents: read +jobs: + controls: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + outputs: + cases: ${{ steps.corpus.outputs.cases }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: 24.21.0 + - run: node scripts/agent-eval/run.mjs verify + - name: Check the solver image on eval changes + if: github.event_name == 'pull_request' + run: | + docker build --tag modwerk-eval-agent scripts/agent-eval + docker run --rm --network none modwerk-eval-agent --version + - id: corpus + run: echo "cases=$(node scripts/agent-eval/run.mjs list)" >> "$GITHUB_OUTPUT" + + replay: + if: github.event_name != 'pull_request' && github.repository == 'repeat98/modwerk' && github.ref == 'refs/heads/main' + needs: controls + runs-on: ubuntu-24.04 + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + case: ${{ fromJSON(needs.controls.outputs.cases) }} + env: + CASE_ID: ${{ matrix.case }} + MODEL: ${{ vars.AGENT_EVAL_MODEL || vars.MAINTENANCE_BOT_MODEL || 'claude-sonnet-5-5' }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: 24.21.0 + - name: Prepare the pre-fix snapshot + run: | + node scripts/agent-eval/run.mjs prepare "$CASE_ID" "$RUNNER_TEMP/case" + docker build --tag modwerk-eval-agent scripts/agent-eval + - name: Attempt the task in the snapshot + env: + CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + run: | + test -n "$CLAUDE_CODE_OAUTH_TOKEN" + docker run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -e CLAUDE_CODE_OAUTH_TOKEN \ + -v "$RUNNER_TEMP/case:/work" -w /work modwerk-eval-agent \ + -p "$(cat "$RUNNER_TEMP/case/TASK.md")" --model "$MODEL" --max-turns 16 --output-format json \ + --tools 'Read,Edit,Glob,Grep' --allowedTools 'Read,Edit,Glob,Grep' > "$RUNNER_TEMP/model.json" + jq -e '.is_error == false' "$RUNNER_TEMP/model.json" > /dev/null + - name: Score in a fresh offline container + run: | + docker run --rm --network none --read-only --cap-drop ALL --security-opt no-new-privileges \ + --pids-limit 64 --memory 384m --cpus 1 -v "$RUNNER_TEMP/case:/case:ro" \ + -v "$PWD/scripts/agent-eval:/grader:ro" node:24.21.0-bookworm-slim \ + node /grader/grade.mjs "$CASE_ID" /case > "$RUNNER_TEMP/score.json" + jq --arg suite "$(node scripts/agent-eval/run.mjs suite)" --arg model "$MODEL" --arg commit "$GITHUB_SHA" \ + '. + {suite: $suite, agent: ("Claude Code 2.1.311 / " + $model), commit: $commit}' \ + "$RUNNER_TEMP/score.json" > "$RUNNER_TEMP/result.json" + jq -r '"**" + .case + "** " + (if .passed then "passed" else "failed" end), (.checks[] | "- " + .name + " — " + (if .passed then "pass" else "fail" end))' \ + "$RUNNER_TEMP/result.json" >> "$GITHUB_STEP_SUMMARY" + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: agent-eval-${{ matrix.case }} + path: ${{ runner.temp }}/result.json + if-no-files-found: error + retention-days: 90 diff --git a/AGENTS.md b/AGENTS.md index 364fb816a4..be77d4b1cb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,7 +22,7 @@ Skills load on clone: Claude Code reads `.claude/skills/`, Codex the identical ` ## Setup and checks - Use Node 24 (`.nvmrc`), then `npm ci`. -- Before marking a pull request ready or pushing to a ready one, and after merging `main`, run `npm run pr:ready` until Ready, then watch the PR checks until green. Registered authors add `--author ` ([Make it mergeable](docs/DEVELOPER_WORKFLOW.md#make-it-mergeable)). Never edit a check, gate, test or workflow to pass it. A wrong check is its own `Fix:` pull request, never part of a module's. +- Run `npm run pr:ready` after merging `main`, before marking a PR ready and before pushing to a ready PR. Complete its [assigned replay](docs/AGENT_EVALS.md), rerun until Ready and watch CI until green. [Registered authors](docs/DEVELOPER_WORKFLOW.md#make-it-mergeable) add `--author `. Never edit a check, gate, test or workflow to pass it. Fix a wrong check in its own `Fix:` PR outside module releases. - Never edit generated files by hand (`src/catalog/module-documents.json`, licence notices, the machine registry): `npm run modules:generate`, `licenses:generate` and `machines:generate` write them. - Every fix ships with its changelog entry in the same pull request: a file `changelog/-.md` for the site, app, Worker, SDK or base (never edit `CHANGELOG.md`), or a version-matched entry in the module's own file in `src/community/module-changelogs/`, at most five short lines for the people who play it ([release notes](docs/ADD_A_MODULE.md#release-notes-required-for-every-fix-and-module-version)). Test evidence and waivers go in the pull request; `npm run check` enforces it. - Never commit firmware, extracted stock code or tables, memory dumps or built images. Firmware stays on the developer's computer and never enters CI. diff --git a/changelog/2026-11-21-agent-evals.md b/changelog/2026-11-21-agent-evals.md new file mode 100644 index 0000000000..08c62f3b06 --- /dev/null +++ b/changelog/2026-11-21-agent-evals.md @@ -0,0 +1 @@ +Contributors’ coding agents replay a past fix during pull request preparation. After each merge, GitHub runs the same collection and records which tasks the agent solved. diff --git a/docs/AGENT_EVALS.md b/docs/AGENT_EVALS.md new file mode 100644 index 0000000000..a79b18e88a --- /dev/null +++ b/docs/AGENT_EVALS.md @@ -0,0 +1,21 @@ +# Agent evals from merged fixes + +An agent gets the task description and the relevant public files from the first parent of a merged fix. A grader outside that snapshot checks the reported behaviour and cases that already worked. A case passes when every check passes. Each case currently covers one Node script. + +## On a contributor’s computer + +Every coding agent following the repository workflow gets one assignment from `npm run pr:ready`, including the staged `--commit` and registered-author paths. The command chooses a case from the tree hash and prepares it under the ignored `.claude/agent-evals/` directory. Exit 2 with a TASK.md path hands the task to the agent already doing the work. This works in Codex, Claude Code and other agents without installing a second client. + +Read TASK.md and solve it inside the supplied directory using only that snapshot and your own checks. Repeat the original readiness command with `--eval-agent ""` after your first attempt, even if incomplete. Readiness scores the attempt and continues its usual checks. Retries on the same tree and suite reuse the first recorded score. A different tree gets a fresh assignment. Scores and candidate edits stay local. This uses the active agent’s session context. + +## After a merge + +Pull requests changing the evals check the historical controls and solver image. The Post-merge agent eval workflow runs the agent on each push to the upstream main branch. It calibrates every case against the original and the merged implementation. A fresh Claude Code process then attempts each task using the snapshot and file tools. The solver container receives the existing maintenance bot’s Claude credential. The grading container runs offline. A provider or setup error fails the job. A completed attempt earns its score, including zero. Per-check results appear in the Actions summary and in the JSON artifacts, retained for 90 days. + +The central run uses Claude Code 2.1.311 and the repository variable `AGENT_EVAL_MODEL`, falling back to the maintenance bot model. To compare configurations, run the workflow on the same main revision with the two model settings and compare the same case and suite IDs. Repeat runs to see how much results vary. Local and central runs use different agent contexts. These cases measure software behaviour only. + +## Add a case + +Choose a merged public fix with an observable failure and a reproducible software check. In `scripts/agent-eval/cases.mjs`, pin the merge commit, list the target script first and include its necessary source files. Describe what the reporter needed in language an agent could have received before the fix. Keep private sessions, diagnostics and firmware out of the corpus. Add independent assertions to `grade.mjs`, including an already-working behaviour. Both local selection and the central matrix pick up new entries. + +Run `npm run agent:eval -- verify` from a clone with full main history. It checks that each parent fails the task, at least one existing behaviour passes there, and all checks pass on the merged fix. For a standalone trial, use `npm run agent:eval -- list`, then `npm run agent:eval -- prepare CASE NEW_DIRECTORY`. After the agent edits that directory, `node scripts/agent-eval/grade.mjs CASE DIRECTORY` prints the score. Compare `passed` and the individual checks, keeping the case, suite revision and model with each result. diff --git a/docs/README.md b/docs/README.md index 9301b308b7..2b3eb0b58d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -81,6 +81,7 @@ Every document in `docs/`, one line each. [AGENTS.md](../AGENTS.md) says which t - [SINGLE_SIGN_ON.md](SINGLE_SIGN_ON.md): accounts and single sign-on. - [DEVELOPER_WORKSPACE.md](DEVELOPER_WORKSPACE.md): creator settings and private report details. - [AGENT_BOARD.md](AGENT_BOARD.md): the agent board: claims every developer's agent sees and makes (module ports, hook, table and migration numbers), the questions and findings agents leave each other, and the commands that check them. +- Coding agents replay merged fixes locally and on GitHub. [Agent evals](AGENT_EVALS.md) - [AGENT_SESSIONS.md](AGENT_SESSIONS.md): the review an agent makes of its own session before it finishes, and sharing the conversation of an agent session with the owner, what is removed before it leaves the computer, and who reads it for how long. - [STATISTICS.md](STATISTICS.md): the admin statistics. - [WEB_PUSH.md](WEB_PUSH.md): device push notifications. diff --git a/package.json b/package.json index 5506cbc5ac..6184d945cd 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "session": "node scripts/agent-session.mjs", "todo": "node scripts/maintenance-bot/todo.mjs", "check": "node scripts/check.mjs", + "agent:eval": "node scripts/agent-eval/run.mjs", "pr:ready": "node scripts/pr-ready.mjs", "preinstall": "node scripts/require-node.mjs", "prepare": "node scripts/require-node.mjs && node scripts/mirror-octatrack-modules.mjs && node scripts/machine-modules.mjs && node scripts/module-changelogs.mjs --write && node scripts/elekloader-vendor.ts --write", diff --git a/scripts/agent-eval/Dockerfile b/scripts/agent-eval/Dockerfile new file mode 100644 index 0000000000..65b1ef0b16 --- /dev/null +++ b/scripts/agent-eval/Dockerfile @@ -0,0 +1,3 @@ +FROM node:24.21.0-bookworm-slim +RUN npm install --global --no-audit --no-fund @anthropic-ai/claude-code@2.1.311 && claude --version +ENTRYPOINT ["claude"] diff --git a/scripts/agent-eval/cases.mjs b/scripts/agent-eval/cases.mjs new file mode 100644 index 0000000000..acfb45b09c --- /dev/null +++ b/scripts/agent-eval/cases.mjs @@ -0,0 +1,24 @@ +// Public, software-only tasks. The merge's first parent supplies the starting files. +export const cases = [ + { + id: 'board-holder', pr: 1889, merge: '6396b149464b2dee3681473fed2dceec31216443', + files: ['scripts/agent-board.mjs'], + task: 'The board claim list treats an incomplete --holder filter as a real query. Reject a missing, blank or option-shaped login with an actionable error before contacting the board. Keep both valid filtered and unfiltered queries working.', + }, + { + id: 'diagnostic-summary', pr: 1855, merge: 'e9ba0bebcd88e4486235432450fa989ad86d0719', + files: ['scripts/diagnostics-pull.mjs', 'src/community/octatrack-diagnostics-contract.ts', 'src/dev/address-names.ts'], + task: 'A musician who cannot establish a USB connection disappears from the Problems section of the diagnostics summary. Include these failures in the usual newest-first list with the reported reason and the browser and OS when available. Keep older records and existing problem types working.', + }, + { + id: 'bold-guides', pr: 1334, merge: 'd9cba731ef5f43bc675af629ac1ac32c3fd41a13', + files: ['scripts/pr-body.mjs', '.github/pull_request_template.md'], + task: 'The PR description check rejects a completed guides answer when the author formats the label or question in bold Markdown. Accept inline answers and a bold question with its answer on the next paragraph. An empty heading followed by another heading still needs an answer. Preserve existing description checks.', + }, +] + +export function findCase(id) { + const item = cases.find(entry => entry.id === id) + if (!item) throw new Error(`Unknown replay case ${id}`) + return item +} diff --git a/scripts/agent-eval/grade.mjs b/scripts/agent-eval/grade.mjs new file mode 100644 index 0000000000..b8dbd396a3 --- /dev/null +++ b/scripts/agent-eval/grade.mjs @@ -0,0 +1,54 @@ +// The grader owns the assertions. Each observation runs the candidate in a fresh Node process. +import { spawnSync } from 'node:child_process' +import { realpathSync } from 'node:fs' +import { pathToFileURL } from 'node:url' +import { findCase } from './cases.mjs' + +export function grade(id, directory) { + const item = findCase(id), cwd = realpathSync(directory), checks = [] + function observe(args, env = {}) { + const result = spawnSync(process.execPath, ['--permission', `--allow-fs-read=${cwd}`, ...args], { + cwd, env: { HOME: cwd, TZ: 'UTC', MODWERK_BOARD: 'off', ...env }, encoding: 'utf8', timeout: 5000, killSignal: 'SIGKILL', + }) + if (result.error && !['ETIMEDOUT', 'ENOBUFS'].includes(result.error.code)) throw result.error + return result + } + function check(name, passed) { checks.push({ name, passed: Boolean(passed) }) } + const [file] = item.files + if (id === 'board-holder') { + for (const [name, args, invalid] of [ + ['missing login', ['--holder'], true], ['blank login', ['--holder', ' '], true], + ['following option', ['--holder', '--released'], true], ['valid login', ['--holder', 'ada'], false], ['unfiltered list', [], false], + ]) { + const { status, stderr } = observe([file, 'list', ...args]) + check(name, status === 1 && (invalid ? /--holder/i.test(stderr) && /login|username|handle/i.test(stderr) : stderr.includes('board is turned off'))) + } + } else if (id === 'bold-guides') { + const description = 'Updates the board listing and checks its behavior with a local fixture.\n\n' + for (const [name, answer, accepted] of [ + ['bold label', '**Guides:** nothing', true], ['bold question', '**What the guides lacked**\n\nUpdated the setup guide.', true], + ['unanswered heading', '**What the guides lacked**\n\n**Related issues**', false], ['plain label', 'Guides: nothing', true], ['missing answer', '', false], + ]) { + const { status, stdout } = observe([file], { PR_BODY: description + answer }) + check(name, accepted ? status === 0 : status === 1 && stdout.includes('Say what the guides lacked')) + } + } else if (id === 'diagnostic-summary') { + const events = [ + { event: 'link_failed', phase: 'idle', failure: 'no-device' }, { event: 'health', phase: 'ready' }, + { event: 'link_failed', phase: 'idle', failure: 'claim-failed', client: { browser: 'chrome', major: 150, os: 'linux' } }, + { event: 'sync_failed', phase: 'sending', error: 'device' }, + ].map((data, n) => ({ data, eventId: `e${n}`, username: 'fixture', createdAt: `2026-10-15T12:00:0${n}Z` })) + const { status, stdout } = observe(['--input-type=module', '-e', `import { summary } from './${file}'; console.log(summary(${JSON.stringify({ events, counts: [] })}))`]) + const problems = (stdout ?? '').split('Problems (')[1] ?? '' + const rows = problems.split('\n').slice(1, 4) + check('three problems, excluding healthy records', status === 0 && problems.startsWith('3,')) + check('existing sync failure first', status === 0 && rows[0]?.includes('sync_failed sending error=device')) + check('reason with client', status === 0 && ['link_failed', 'claim-failed', 'chrome', 'linux'].every(value => rows[1]?.includes(value))) + check('reason without client', status === 0 && ['link_failed', 'no-device'].every(value => rows[2]?.includes(value))) + } else throw new Error(`No grader for ${id}`) + return { case: id, merge: item.merge, passed: checks.every(test => test.passed), checks } +} + +if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) { + console.log(JSON.stringify(grade(process.argv[2], process.argv[3]))) +} diff --git a/scripts/agent-eval/run.mjs b/scripts/agent-eval/run.mjs new file mode 100644 index 0000000000..00709f1f99 --- /dev/null +++ b/scripts/agent-eval/run.mjs @@ -0,0 +1,89 @@ +import { execFileSync } from 'node:child_process' +import { createHash, randomUUID } from 'node:crypto' +import { existsSync, linkSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { dirname, join, resolve } from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' +import { cases, findCase } from './cases.mjs' +import { grade } from './grade.mjs' + +const root = fileURLToPath(new URL('../../', import.meta.url)) +const git = (...args) => execFileSync('git', args, { cwd: root, stdio: ['ignore', 'pipe', 'pipe'] }) +const suite = createHash('sha256') +for (const file of ['cases.mjs', 'grade.mjs', 'run.mjs']) suite.update(readFileSync(new URL(file, import.meta.url))) +const suiteId = suite.digest('hex') + +function revision(item, fixed, remote) { + const ref = fixed ? item.merge : item.merge + '^1' + try { return git('rev-parse', '--verify', `${ref}^{commit}`).toString().trim() } catch { + if (!remote) throw new Error(`Missing replay history for ${item.id}. Fetch the full main branch history.`) + git('fetch', '--no-tags', '--depth=2', remote, item.merge) + return git('rev-parse', '--verify', `${ref}^{commit}`).toString().trim() + } +} + +function prepare(item, directory, fixed = false, remote) { + const ref = revision(item, fixed, remote) + mkdirSync(dirname(directory), { recursive: true }) + const stage = mkdtempSync(join(dirname(directory), '.prepare-')) + try { + for (const name of item.files) { + mkdirSync(dirname(join(stage, name)), { recursive: true }) + writeFileSync(join(stage, name), git('show', `${ref}:${name}`)) + } + writeFileSync(join(stage, 'TASK.md'), `${item.task}\n\nWork only with this snapshot. Make the fix in ${item.files[0]}. Use the supplied files and your own checks. Finish after editing the snapshot.\n`) + renameSync(stage, directory) + } finally { rmSync(stage, { recursive: true, force: true }) } +} + +// The same tree reaches this point both before and after --commit. Keep the first observation on retries. +export function localReplay(tree, remote, agent, { directory = join(root, '.claude/agent-evals'), snapshot = prepare } = {}) { + const item = cases[parseInt(tree.slice(0, 8), 16) % cases.length] + const attempt = join(directory, tree, suiteId), workspace = join(attempt, 'work'), resultFile = join(attempt, 'result.json') + if (!existsSync(workspace)) { + try { snapshot(item, workspace, false, remote) } catch (error) { + if (!['EEXIST', 'ENOTEMPTY'].includes(error.code) || !existsSync(workspace)) throw error + } + // A model label carried over from an earlier tree cannot submit a fresh, untouched assignment. + agent = null + } + if (!existsSync(resultFile) && !agent?.trim()) { + console.log(`Coding agent replay: read ${join(workspace, 'TASK.md')} and solve it in that directory. Then repeat the same pr:ready command with --eval-agent "". An unsuccessful attempt counts. The first score is kept locally.`) + return false + } + if (!existsSync(resultFile)) { + const report = { suite: suiteId, tree, agent: agent.trim(), ...grade(item.id, workspace) } + const file = join(attempt, `result-${randomUUID()}.tmp`) + writeFileSync(file, JSON.stringify(report, null, 2) + '\n') + try { linkSync(file, resultFile) } catch (error) { if (error.code !== 'EEXIST') throw error } finally { rmSync(file) } + } + const record = JSON.parse(readFileSync(resultFile, 'utf8')) + console.log(`Agent replay ${item.id}: ${record.passed ? 'pass' : 'fail'} (${resultFile})`) + return true +} + +function verify() { + const folder = mkdtempSync(join(tmpdir(), 'modwerk-eval-')) + try { + for (const item of cases) { + const observed = [] + for (const fixed of [false, true]) { + const dir = join(folder, `${item.id}-${fixed}`) + prepare(item, dir, fixed) + observed.push(grade(item.id, dir)) + } + const [before, after] = observed + console.log(`${item.id}: before ${before.checks.filter(c => c.passed).length}/${before.checks.length}, merged ${after.checks.filter(c => c.passed).length}/${after.checks.length}`) + if (before.passed || !before.checks.some(c => c.passed) || !after.passed) throw new Error(`Invalid controls: ${JSON.stringify(observed)}`) + } + } finally { rmSync(folder, { recursive: true, force: true }) } +} + +if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) { + const [command, id, directory] = process.argv.slice(2) + if (command === 'list') console.log(JSON.stringify(cases.map(c => c.id))) + else if (command === 'suite') console.log(suiteId) + else if (command === 'verify') verify() + else if (command === 'prepare' && directory && !existsSync(directory)) prepare(findCase(id), resolve(directory)) + else throw new Error('Usage: agent:eval -- list | verify | suite | prepare CASE NEW_DIRECTORY') +} diff --git a/scripts/agent-eval/run.test.mjs b/scripts/agent-eval/run.test.mjs new file mode 100644 index 0000000000..be21e17e9d --- /dev/null +++ b/scripts/agent-eval/run.test.mjs @@ -0,0 +1,29 @@ +import { afterEach, expect, it } from 'vitest' +import { mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { localReplay } from './run.mjs' + +const folders = [] +afterEach(() => { for (const dir of folders.splice(0)) rmSync(dir, { recursive: true, force: true }) }) + +it('assigns before scoring, keeps a failed first attempt and assigns again for a new tree', () => { + const directory = mkdtempSync(join(tmpdir(), 'modwerk-eval-test-')) + folders.push(directory) + const snapshot = (item, work) => { + mkdirSync(join(work, 'scripts'), { recursive: true }) + writeFileSync(join(work, item.files[0]), 'process.exitCode = 1') + } + const replay = (tree, label) => localReplay(tree, 'origin', label, { directory, snapshot }) + const tree = '0'.repeat(40) + expect(replay(tree, 'stale model label')).toBe(false) + expect(replay(tree)).toBe(false) + expect(replay(tree, 'fixture agent')).toBe(true) + const [suite] = readdirSync(join(directory, tree)) + const file = join(directory, tree, suite, 'result.json') + const first = readFileSync(file, 'utf8') + expect(JSON.parse(first)).toMatchObject({ agent: 'fixture agent', case: 'board-holder', suite, tree, passed: false }) + expect(replay(tree, 'another attempt')).toBe(true) + expect(readFileSync(file, 'utf8')).toBe(first) + expect(replay(tree.slice(1) + '1', 'fixture agent')).toBe(false) +}) diff --git a/scripts/pr-ready.mjs b/scripts/pr-ready.mjs index 9e19eb7d0d..c35cdd38f2 100644 --- a/scripts/pr-ready.mjs +++ b/scripts/pr-ready.mjs @@ -170,6 +170,13 @@ async function main(argv) { let behind = false try { git('merge-base', '--is-ancestor', base, head) } catch { behind = true } const python = localPythonProblem(root) + // Assign before the expensive check. Ignored replay files leave the staged tree unchanged. + const eligible = commit ? dirty.length && !git('ls-files', '--others', '--exclude-standard') && !git('diff', '--name-only') : !dirty.length && head !== base + if (!python && !behind && eligible) { + const { localReplay } = await import('./agent-eval/run.mjs') + const tree = commit ? git('write-tree') : git('rev-parse', 'HEAD^{tree}') + if (!localReplay(tree, remote, option('--eval-agent'))) return 2 + } // Each step runs only when the ones before it passed, so the first problem is the one to fix. let regenerated = [], checkPassed = true, scope = null const check = () => npm('check', '--', '--base', base) From e473c609975bd4a646bce89a33845bd5cae220c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20A=C3=9Ffalg?= <67785539+repeat98@users.noreply.github.com> Date: Sat, 21 Nov 2026 09:40:00 +0100 Subject: [PATCH 009/105] Backfill measured Octatrack prices and show hardware DSP load (#1912) --- .../2026-11-21-octatrack-dsp-core-load.md | 2 + docs/MODULE_RESOURCE_GAUGES.md | 4 +- docs/OCTATRACK_DRIVING.md | 2 + scripts/octatrack-price.mjs | 27 ++- scripts/octatrack-price.test.mjs | 13 +- .../module-adapters/candidate-recipes.json | 6 +- sdk/module-cpu-prices-pending.json | 10 - .../arp-key-locks/evidence/cpu-price.json | 112 +++++++++++ .../modules/arp-key-locks/octamod.module.json | 9 + .../beat-slicer/evidence/cpu-price.json | 112 +++++++++++ .../modules/beat-slicer/octamod.module.json | 9 + .../modules/cc-map/evidence/cpu-price.json | 112 +++++++++++ .../modules/cc-map/octamod.module.json | 9 + .../mute-modes/evidence/cpu-price.json | 112 +++++++++++ .../modules/mute-modes/octamod.module.json | 9 + .../output-matrix/evidence/cpu-price.json | 114 +++++++++++ .../modules/output-matrix/octamod.module.json | 9 + .../evidence/cpu-price.json | 112 +++++++++++ .../pattern-sample-locks/octamod.module.json | 9 + .../modules/playmodes/evidence/cpu-price.json | 114 +++++++++++ .../modules/playmodes/octamod.module.json | 9 + .../recorder-loop-fix/evidence/cpu-price.json | 114 +++++++++++ .../recorder-loop-fix/octamod.module.json | 9 + .../evidence/cpu-price.json | 177 ++++++++++++++++++ .../sidechain-compressor/octamod.module.json | 9 + .../modules/slow-lfo/evidence/cpu-price.json | 112 +++++++++++ .../modules/slow-lfo/octamod.module.json | 9 + src/catalog/module-documents.json | 90 +++++++++ .../octatrack-resource-measurements.ts | 106 +++++++++++ src/catalog/resource-indicators.test.ts | 48 ++++- src/catalog/resource-indicators.ts | 49 ++++- src/components/ModuleResourceIndicators.tsx | 5 +- src/devices/module-detail-parity.test.ts | 5 +- 33 files changed, 1618 insertions(+), 30 deletions(-) create mode 100644 changelog/2026-11-21-octatrack-dsp-core-load.md create mode 100644 sdk/octatrack/modules/arp-key-locks/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/beat-slicer/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/cc-map/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/mute-modes/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/output-matrix/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/pattern-sample-locks/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/playmodes/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/recorder-loop-fix/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/sidechain-compressor/evidence/cpu-price.json create mode 100644 sdk/octatrack/modules/slow-lfo/evidence/cpu-price.json create mode 100644 src/catalog/octatrack-resource-measurements.ts diff --git a/changelog/2026-11-21-octatrack-dsp-core-load.md b/changelog/2026-11-21-octatrack-dsp-core-load.md new file mode 100644 index 0000000000..322ae5d299 --- /dev/null +++ b/changelog/2026-11-21-octatrack-dsp-core-load.md @@ -0,0 +1,2 @@ +Octatrack DSP gauges show the hardware-tested change in core load where recorded. Emulator instruction counts and modeled bounds are available in the evidence panel. +Added repeated hardware CPU readings for ten Octatrack modules and the reported peak for eleven stems in Stem Rec. diff --git a/docs/MODULE_RESOURCE_GAUGES.md b/docs/MODULE_RESOURCE_GAUGES.md index 40c5590c19..a066516e5d 100644 --- a/docs/MODULE_RESOURCE_GAUGES.md +++ b/docs/MODULE_RESOURCE_GAUGES.md @@ -1,8 +1,8 @@ # Module resource gauges -Every catalog module needs **CPU, DSP core and memory** ratings before release. On Octatrack module pages, the CPU gauge shows the recorded [CPU price](MODULE_PERFORMANCE.md) as a percentage of an audio frame when available. For a track machine this is the per-track budget based on hardware measurements. The gauge evidence links to the measurement in the Modwerk module folder. +Every catalog module needs **CPU, DSP core and memory** ratings before release. On Octatrack module pages, the CPU gauge shows the recorded [CPU price](MODULE_PERFORMANCE.md) as a percentage of an audio frame when available. For a track machine this is the per-track budget based on hardware measurements. Stem Rec shows its reported peak while recording eleven stems. The gauge evidence links to the measurement in the Modwerk module folder. -The DSP core gauge shows the release package's version-matched DSP price per instance, or the per-instance DSP count from the qualification record for a module without a separate package price. It labels hardware, emulator and modeled figures by their evidence. The memory gauge shows the qualification inventory's total bytes at the supported instance count, with shared and per-instance allocations in the evidence. +The DSP core gauge shows the measured change in core load for one active instance, in percentage points. The evidence gives the base, scene, slot and before/after readings. When the release has hardware-backed cycles per sample, those can also supply a numeric gauge. Emulator counts and modeled bounds appear in the evidence. The memory gauge uses the qualification inventory's total bytes at the supported instance count, with shared and per-instance allocations in the evidence. A measured module-pool and DSP program allocation can supply a scoped quantity when the full inventory is unavailable. When a numeric record is unavailable, the page displays the relative tier labelled **Estimated**. The four tiers are **Minimal, Low, Moderate, High**. A full High arc means the highest relative tier. DSP counts and memory totals use their recorded units and have no percentage arc. diff --git a/docs/OCTATRACK_DRIVING.md b/docs/OCTATRACK_DRIVING.md index 5989bf21bc..6f4070ba56 100644 --- a/docs/OCTATRACK_DRIVING.md +++ b/docs/OCTATRACK_DRIVING.md @@ -302,6 +302,8 @@ not isolated: verify each held-row transition and stock modifier release, and st last time, like stock's, so go UP to its top before counting rows down. On older bases these were SYSTEM > MODWERK and MODWERK TEST. +`device:price --memory --out FILE.json` also records bytes in the module pool and program words on each DSP core after every reading. These are tracked allocations. Pair them with the module's region inventory for state, existing reservations and buffers. + ## Where the state is (OS 1.40C) | What | Where | diff --git a/scripts/octatrack-price.mjs b/scripts/octatrack-price.mjs index d77a564472..bdd9af6694 100644 --- a/scripts/octatrack-price.mjs +++ b/scripts/octatrack-price.mjs @@ -3,7 +3,7 @@ // Copyright (c) 2026 Jannik Aßfalg (repeat98) // What a module costs an Octatrack, measured on a unit: the frame interrupt's share, the CPU meter and both DSPs, // before the module, with it installed but used nowhere (at rest), and for an effect on one slot (in use). -// npm run device:price -- [--out FILE.json] [--base ID --scene TEXT] [--seconds 8] [--slot T1] [--fx-name ID=NAME…] ID|FILE.mwrm… (none: every USB package) +// npm run device:price -- [--memory] [--out FILE.json] [--base ID --scene TEXT] [--seconds 8] [--slot T1] [--fx-name ID=NAME…] ID|FILE.mwrm… (none: every USB package) // --write (needs --base and --scene): each module measured cleanly gets its price in octamod.module.json (resources.cpuPrice) and // its readings in evidence/cpu-price.json, and leaves the pending list; modules:check recomputes the price from those readings. // It needs a development twin of the base (the guard request) behind `npm run device -- serve --share @@ -31,6 +31,14 @@ export function reading(text) { return { frame: Number(guard[3]), frameMax: Number(guard[1]), frames: Number(guard[4]), skipped: Number(guard[5]), cpu: tenth(mean(stats.map(m => m[1] / 10))), dsp1to4: tenth(mean(stats.map(m => m[2] / 10))), dsp5to8: tenth(mean(stats.map(m => m[3] / 10))) } } +/** Tracked allocation only. The module pool and each DSP program arena have distinct units and capacities. */ +export function allocationReading(text) { + const pool = /^pool: (\d+) of \d+ bytes used;/m.exec(text) + const core1 = /^core 1 \(T1-4\): (\d+) of \d+ words/m.exec(text) + const core0 = /^core 0 \(T5-8\): (\d+) of \d+ words/m.exec(text) + if (!pool || !core1 || !core0) return { unavailable: 'The development base did not report the module pool and both DSP program arenas.' } + return { modulePoolBytes: Number(pool[1]), dspProgramWordsT1to4: Number(core1[1]), dspProgramWordsT5to8: Number(core0[1]) } +} /** What the second reading added to the first, in points, one decimal. */ /** What went wrong with a pick, from the session's reply (device.mjs pick's errors), or null when the slot runs it. */ export const pickFailure = reply => /error|refused|not admitted|timed out/i.test(reply) ? reply.trim().split('\n').find(line => /error|refused|not admitted|timed out/i.test(line)).slice(0, 200) : null @@ -76,7 +84,7 @@ export function writePrice({ root, result, base, scene, seconds, measuredAt }) { if (import.meta.filename === process.argv[1]) { const { values: args, positionals } = parseArgs({ allowPositionals: true, options: { out: { type: 'string' }, seconds: { type: 'string', default: '8' }, - slot: { type: 'string', default: 'T1' }, 'fx-name': { type: 'string', multiple: true }, base: { type: 'string' }, scene: { type: 'string' }, write: { type: 'boolean' }, socket: { type: 'string', default: '/tmp/modwerk-dev.sock' }, share: { type: 'string', default: '/tmp/modwerk-share.sock' } } }) + slot: { type: 'string', default: 'T1' }, 'fx-name': { type: 'string', multiple: true }, base: { type: 'string' }, scene: { type: 'string' }, write: { type: 'boolean' }, memory: { type: 'boolean' }, socket: { type: 'string', default: '/tmp/modwerk-dev.sock' }, share: { type: 'string', default: '/tmp/modwerk-share.sock' } } }) const root = resolve(import.meta.dirname, '..'), seconds = Number(args.seconds), measuredAt = new Date().toISOString() const fxNames = new Map((args['fx-name'] ?? []).map(pair => { const at = pair.indexOf('='); if (at < 1) throw new Error('--fx-name takes ID=NAME, the name the FX chooser shows'); return [pair.slice(0, at), pair.slice(at + 1)] })) if (args.write && !(args.base && args.scene)) throw new Error('--write needs --base and --scene: the price names the base and what played (model, project, pattern)') @@ -103,13 +111,22 @@ if (import.meta.filename === process.argv[1]) { for (let i = 0; i < 3; i++) { await wait(seconds * 1000 / 3); text += await send('stats') } const text2 = await send('guard') await send('STOP w500') - return reading(text2 + text) + const load = reading(text2 + text) + if (!args.memory) return load + try { + return { ...load, allocation: allocationReading(await send('memory')) } + } catch { + return { ...load, allocation: { unavailable: 'The development base did not answer the allocation read.' } } + } } const slotNames = async () => /^(.+?)\s{2,}(.+)$/.exec((await send('ui')).split('\n').map(line => line.replace(/^[> ]+/, '')).find(line => line.startsWith(args.slot + ' '))?.slice(args.slot.length + 1).trim() ?? '') ?? [] // [, FX1, FX2] const results = [] for (const row of chosen) { - const before = await measure(), result = { id: row.id, version: row.version, before } - const trial = spawn(process.execPath, [resolve(root, 'scripts/device.mjs'), 'try', row.file ?? resolve(root, 'public', row.path), '--seconds', '600', '--socket', args.share]) + const packagePath = row.file ?? resolve(root, 'public', row.path) + const packageSha256 = createHash('sha256').update(readFileSync(packagePath)).digest('hex') + if (row.sha256 && packageSha256 !== row.sha256) throw new Error('Package SHA-256 differs from the release catalogue for ' + row.id) + const before = await measure(), result = { id: row.id, version: row.version, packageSha256, before } + const trial = spawn(process.execPath, [resolve(root, 'scripts/device.mjs'), 'try', packagePath, '--seconds', '600', '--socket', args.share]) let log = ''; trial.stdout.on('data', chunk => { log += chunk }); trial.stderr.on('data', chunk => { log += chunk }) const ended = new Promise(done => trial.on('exit', done)) // A large package uploads for a minute: wait for the trial or the try's own end, never cut an upload short diff --git a/scripts/octatrack-price.test.mjs b/scripts/octatrack-price.test.mjs index c156dffa48..8d05d8ac7d 100644 --- a/scripts/octatrack-price.test.mjs +++ b/scripts/octatrack-price.test.mjs @@ -2,7 +2,7 @@ // Copyright (c) 2026 Jannik Aßfalg (repeat98) import { expect, it } from 'vitest' import { createHash } from 'node:crypto' -import { added, pickFailure, priceFileTarget, reading, writePrice } from './octatrack-price.mjs' +import { added, allocationReading, pickFailure, priceFileTarget, reading, writePrice } from './octatrack-price.mjs' function runtimeEffect(slots) { const data = Buffer.alloc(76) @@ -40,6 +40,17 @@ it('reads the guard window and the mean of the meter readings, and what a module expect(() => reading('stats cpu 1 T1-4 1/1 T5-8 1/1')).toThrow('No guard') }) +it('records the module pool and each DSP program arena in their own units', () => { + const report = [ + 'pool: 128 of 10912 bytes used; free 10784, largest free run 10784 (100 % of free)', + 'core 1 (T1-4): 388 of 399 words in 1 blocks [id 2 @0+388]; holes 0 words, largest free run 11 of 11 free', + 'core 0 (T5-8): 0 of 399 words in 0 blocks []; holes 0 words, largest free run 399 of 399 free', + 'buffer blocks in use: 0x1', + ].join('\n') + expect(allocationReading(report)).toEqual({ modulePoolBytes: 128, dspProgramWordsT1to4: 388, dspProgramWordsT5to8: 0 }) + expect(allocationReading('error: unavailable')).toHaveProperty('unavailable') +}) + it('writes a clean reading as the module\'s price, its readings beside it, and takes it off the pending list', async () => { const { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } = await import('node:fs') const { join } = await import('node:path'), { tmpdir } = await import('node:os') diff --git a/sdk/machines/octatrack/module-adapters/candidate-recipes.json b/sdk/machines/octatrack/module-adapters/candidate-recipes.json index 92f60138c2..6c62c8b563 100644 --- a/sdk/machines/octatrack/module-adapters/candidate-recipes.json +++ b/sdk/machines/octatrack/module-adapters/candidate-recipes.json @@ -7,7 +7,8 @@ "sources": { "sdk/octabam/modules/cc-map/cc_map.s": "da7280f1f14b09a211928da38aba5da084f3cd00690f150813ed274ea74cd104", "sdk/octabam/modules/cc-map/manifest.py": "a776d7b7d072f96e013f8b43bbdbabaaa455955a594fda8a836d07cfba5c747e", - "sdk/octabam/modules/cc-map/octamod.module.json": "d1b1ad2c3b3dc97e4e42f591e9f870c429f2e158bf2772070738368db095b054", + "sdk/octabam/modules/cc-map/octamod.module.json": "414262462d56f474deacce4a73a1611573783031bf517612f8006526f81c135e", + "sdk/octabam/modules/cc-map/evidence/cpu-price.json": "1f88ae67ba61fede4000b54b78d62aeb86d65bd85211edd6eecd844b66debd2b", "sdk/octabam/modules/cc-map/evidence/software-verification.json": "e882dda9107e0fe5790a1eefb04425a2889c918fda364194cef640d3f5d3c837", "sdk/octabam/modules/cc-map/media/capture.json": "6e96ee40a028f82a98cb96484b73311d8d094e29612b3412fbc9bd39edbc7a33", "sdk/octabam/tools/remix/platform_build.py": "e72b7a29b45851addecf135ad520db98b66f5e10c5cd354adf37fb52d6c2e42f", @@ -104,7 +105,8 @@ "sdk/octabam/modules/mute-modes/patch_mutemode.s": "85b0be45d2ec5540a89d97d8e87884590cc1feb1b6719087acff686e83aba100", "sdk/octabam/modules/mute-modes/manifest.py": "33e06de61d255800107843c44583c6487280ef452c703e79fa07179051d4e1bd", "sdk/octabam/modules/mute-modes/qualification.example.json": "80662f1b39221cc59d933e023ddddedc3bdcc65f10185acd4a6816a420485519", - "sdk/octabam/modules/mute-modes/octamod.module.json": "3a58482dfe3c34b2aece554cd0824a2700eba10787343ab319d7a8b1d51014cb", + "sdk/octabam/modules/mute-modes/octamod.module.json": "d0561449ef2c5ce1441683b55072d6d59ecc9de873f677418ba96d5674add5b7", + "sdk/octabam/modules/mute-modes/evidence/cpu-price.json": "d5607ee4659875cab75293ac94599e673b3138eb7210050d41f0567a854b6dd2", "sdk/octabam/modules/mute-modes/patch_softmute.s": "4fb8d84a6f848299d3de611e20237901110e77041fc46c2620bd149f44ccb2c1", "sdk/octabam/modules/mute-modes/evidence/reproduction.json": "ead6381c5e7c9bfa04ac08572d5d71f90e7318a5cbb26d2fb4182db210b2242f", "sdk/octabam/modules/mute-modes/evidence/source-identity.json": "a46af3e865ca0b920c0ab31a688fe9b5764aa437dd01869432f58007a1bc6aa3", diff --git a/sdk/module-cpu-prices-pending.json b/sdk/module-cpu-prices-pending.json index 43bc49b69a..355f536787 100644 --- a/sdk/module-cpu-prices-pending.json +++ b/sdk/module-cpu-prices-pending.json @@ -3,17 +3,7 @@ "pending": { "amiga": "price not yet measured", "analog-bassdrum": "price not yet measured", - "arp-key-locks": "price not yet measured", - "beat-slicer": "price not yet measured", - "cc-map": "price not yet measured", - "mute-modes": "price not yet measured", - "output-matrix": "price not yet measured", - "pattern-sample-locks": "price not yet measured", - "playmodes": "price not yet measured", "poly8": "price not yet measured", - "recorder-loop-fix": "price not yet measured", - "sidechain-compressor": "price not yet measured", - "slow-lfo": "price not yet measured", "stem-rec": "price not yet measured", "syntiz": "price not yet measured", "usb-audio-out-tracks-main-cue": "price not yet measured", diff --git a/sdk/octatrack/modules/arp-key-locks/evidence/cpu-price.json b/sdk/octatrack/modules/arp-key-locks/evidence/cpu-price.json new file mode 100644 index 0000000000..8c1d9e36cf --- /dev/null +++ b/sdk/octatrack/modules/arp-key-locks/evidence/cpu-price.json @@ -0,0 +1,112 @@ +{ + "module": "arp-key-locks", + "version": "0.1.0-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory", + "seconds": 8, + "measuredAt": "2026-11-21T07:44:50.850Z", + "result": { + "id": "arp-key-locks", + "version": "0.1.0-experimental", + "packageSha256": "907a03cf980996b30b0c3ba89ea0e80b889727ba4d407d04e2f95ceb30b44e8c", + "before": { + "frame": 32.7, + "frameMax": 70.3, + "frames": 22271, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 44.2, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 0, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 70.4, + "frames": 22260, + "skipped": 0, + "cpu": 45.4, + "dsp1to4": 47.9, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 5232, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 0, + "cpu": 0.1, + "dsp1to4": 3.7, + "dsp5to8": 0.1 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:44:50.850Z", + "before": { + "frame": 32.7, + "frameMax": 70.3, + "frames": 22271, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 44.2, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 0, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 70.4, + "frames": 22260, + "skipped": 0, + "cpu": 45.4, + "dsp1to4": 47.9, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 5232, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:45:20.073Z", + "before": { + "frame": 32.7, + "frameMax": 70.4, + "frames": 22256, + "skipped": 0, + "cpu": 45.4, + "dsp1to4": 46.8, + "dsp5to8": 42.3, + "allocation": { + "modulePoolBytes": 5232, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 70.6, + "frames": 22251, + "skipped": 0, + "cpu": 45, + "dsp1to4": 43.9, + "dsp5to8": 41.6, + "allocation": { + "modulePoolBytes": 5232, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ] + } +} diff --git a/sdk/octatrack/modules/arp-key-locks/octamod.module.json b/sdk/octatrack/modules/arp-key-locks/octamod.module.json index c271bcad9d..75197fb278 100644 --- a/sdk/octatrack/modules/arp-key-locks/octamod.module.json +++ b/sdk/octatrack/modules/arp-key-locks/octamod.module.json @@ -236,6 +236,15 @@ "rationale": "4,480 bytes of ColdFire code, data and state in DRAM; locks live in spare bytes the project already has.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.3 % before, 45.4 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/beat-slicer/evidence/cpu-price.json b/sdk/octatrack/modules/beat-slicer/evidence/cpu-price.json new file mode 100644 index 0000000000..50fa9fa72a --- /dev/null +++ b/sdk/octatrack/modules/beat-slicer/evidence/cpu-price.json @@ -0,0 +1,112 @@ +{ + "module": "beat-slicer", + "version": "0.1.66-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory", + "seconds": 8, + "measuredAt": "2026-11-21T07:45:49.294Z", + "result": { + "id": "beat-slicer", + "version": "0.1.66-experimental", + "packageSha256": "6650ef77a837a61a570a300c3bd0b2d4dfd4c9bed6e52bb355034d39bf5ff90d", + "before": { + "frame": 32.7, + "frameMax": 70.9, + "frames": 22277, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.9, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 5232, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71.2, + "frames": 22254, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 45.8, + "dsp5to8": 41.4, + "allocation": { + "modulePoolBytes": 7120, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 0, + "cpu": 0.3, + "dsp1to4": -0.1, + "dsp5to8": 0.5 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:45:49.294Z", + "before": { + "frame": 32.7, + "frameMax": 70.9, + "frames": 22277, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.9, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 5232, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71.2, + "frames": 22254, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 45.8, + "dsp5to8": 41.4, + "allocation": { + "modulePoolBytes": 7120, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:46:18.444Z", + "before": { + "frame": 32.7, + "frameMax": 71, + "frames": 22254, + "skipped": 0, + "cpu": 45.6, + "dsp1to4": 46.2, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 7120, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71, + "frames": 22261, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 45.3, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 7120, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ] + } +} diff --git a/sdk/octatrack/modules/beat-slicer/octamod.module.json b/sdk/octatrack/modules/beat-slicer/octamod.module.json index 8b08eedce8..9436b8f132 100644 --- a/sdk/octatrack/modules/beat-slicer/octamod.module.json +++ b/sdk/octatrack/modules/beat-slicer/octamod.module.json @@ -119,6 +119,15 @@ "rationale": "6,380 bytes of ColdFire code, data and state in DRAM (from the package); the slice table it fills is the sample's own.", "source": "evidence/hardware.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.2 % before, 45.5 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/cc-map/evidence/cpu-price.json b/sdk/octatrack/modules/cc-map/evidence/cpu-price.json new file mode 100644 index 0000000000..1bbde8a599 --- /dev/null +++ b/sdk/octatrack/modules/cc-map/evidence/cpu-price.json @@ -0,0 +1,112 @@ +{ + "module": "cc-map", + "version": "0.1.2-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7 and an empty starting inventory. Release sources rebuilt for this twin’s base binding", + "seconds": 8, + "measuredAt": "2026-11-21T07:50:07.303Z", + "result": { + "id": "cc-map", + "version": "0.1.2-experimental", + "packageSha256": "c7cd39a5f645d69279d3a288c40b8366e6638acdc042cf0fe68dfb9964a68ea2", + "before": { + "frame": 32.7, + "frameMax": 70.5, + "frames": 22257, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.9, + "dsp5to8": 40.7, + "allocation": { + "modulePoolBytes": 3312, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71, + "frames": 22259, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 47, + "dsp5to8": 42.3, + "allocation": { + "modulePoolBytes": 1568, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 0, + "cpu": 0.3, + "dsp1to4": 1.1, + "dsp5to8": 1.6 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:50:07.303Z", + "before": { + "frame": 32.7, + "frameMax": 70.5, + "frames": 22257, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.9, + "dsp5to8": 40.7, + "allocation": { + "modulePoolBytes": 3312, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71, + "frames": 22259, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 47, + "dsp5to8": 42.3, + "allocation": { + "modulePoolBytes": 1568, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:50:36.402Z", + "before": { + "frame": 32.7, + "frameMax": 71.9, + "frames": 22304, + "skipped": 0, + "cpu": 45.6, + "dsp1to4": 46.9, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 1568, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71.2, + "frames": 22258, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.7, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 1568, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ] + } +} diff --git a/sdk/octatrack/modules/cc-map/octamod.module.json b/sdk/octatrack/modules/cc-map/octamod.module.json index b3aa20d369..553ddf76de 100644 --- a/sdk/octatrack/modules/cc-map/octamod.module.json +++ b/sdk/octatrack/modules/cc-map/octamod.module.json @@ -111,6 +111,15 @@ "rationale": "724 authored ROM bytes, up to 127 alignment bytes, no newly allocated heap or persistent RAM. Existing stock state is reused.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7 and an empty starting inventory. Release sources rebuilt for this twin’s base binding; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.2 % before, 45.5 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/mute-modes/evidence/cpu-price.json b/sdk/octatrack/modules/mute-modes/evidence/cpu-price.json new file mode 100644 index 0000000000..b4670156c9 --- /dev/null +++ b/sdk/octatrack/modules/mute-modes/evidence/cpu-price.json @@ -0,0 +1,112 @@ +{ + "module": "mute-modes", + "version": "0.2.2-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory", + "seconds": 8, + "measuredAt": "2026-11-21T07:48:47.968Z", + "result": { + "id": "mute-modes", + "version": "0.2.2-experimental", + "packageSha256": "d8b871e39733ca38101c5fc42b37f3984c38a577eab393d85e3f3a6fa1f1dd00", + "before": { + "frame": 32.7, + "frameMax": 70.8, + "frames": 22256, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 43.6, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 1456, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33.9, + "frameMax": 71.8, + "frames": 22258, + "skipped": 0, + "cpu": 46.3, + "dsp1to4": 47.3, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 3312, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 1.2, + "cpu": 0.8, + "dsp1to4": 3.7, + "dsp5to8": 0 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:48:47.968Z", + "before": { + "frame": 32.7, + "frameMax": 70.8, + "frames": 22256, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 43.6, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 1456, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33.9, + "frameMax": 71.8, + "frames": 22258, + "skipped": 0, + "cpu": 46.3, + "dsp1to4": 47.3, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 3312, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:49:19.120Z", + "before": { + "frame": 32.7, + "frameMax": 70.4, + "frames": 22259, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.9, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 3312, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33.9, + "frameMax": 72.7, + "frames": 22271, + "skipped": 0, + "cpu": 46.7, + "dsp1to4": 48.3, + "dsp5to8": 41.5, + "allocation": { + "modulePoolBytes": 3312, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ] + } +} diff --git a/sdk/octatrack/modules/mute-modes/octamod.module.json b/sdk/octatrack/modules/mute-modes/octamod.module.json index a1c5afb5ed..592958888e 100644 --- a/sdk/octatrack/modules/mute-modes/octamod.module.json +++ b/sdk/octatrack/modules/mute-modes/octamod.module.json @@ -118,6 +118,15 @@ "rationale": "Small authored ROM patches and reused stock state; no new audio buffer allocation.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 1.2, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 33.9 % installed and used nowhere; CPU meter 45.5 % before, 46.3 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/output-matrix/evidence/cpu-price.json b/sdk/octatrack/modules/output-matrix/evidence/cpu-price.json new file mode 100644 index 0000000000..ed37b6b34f --- /dev/null +++ b/sdk/octatrack/modules/output-matrix/evidence/cpu-price.json @@ -0,0 +1,114 @@ +{ + "module": "output-matrix", + "version": "0.1.1-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7 and an empty starting inventory. Release sources rebuilt for this twin’s base binding", + "seconds": 8, + "measuredAt": "2026-11-21T07:52:06.105Z", + "result": { + "id": "output-matrix", + "version": "file", + "packageSha256": "20f409df8ad2c5096d8b4a2bc451337fbba8edd7436f830230eeac68ac486069", + "before": { + "frame": 32.7, + "frameMax": 70.7, + "frames": 22295, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 45.6, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 2208, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.8, + "frameMax": 70.3, + "frames": 22349, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 45.3, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 4544, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 0.1, + "cpu": 0.2, + "dsp1to4": -0.3, + "dsp5to8": -0.1 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:52:06.105Z", + "before": { + "frame": 32.7, + "frameMax": 70.7, + "frames": 22295, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 45.6, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 2208, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.8, + "frameMax": 70.3, + "frames": 22349, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 45.3, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 4544, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:52:35.912Z", + "before": { + "frame": 32.7, + "frameMax": 70.9, + "frames": 22285, + "skipped": 0, + "cpu": 45.6, + "dsp1to4": 45.2, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 4544, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.8, + "frameMax": 70.9, + "frames": 22272, + "skipped": 0, + "cpu": 45.6, + "dsp1to4": 45.6, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 4544, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ], + "releaseSourceVersion": "0.1.1-experimental", + "releaseSourceCommit": "ef6099b0a29b971a23ab397cd284819ca6774727" + } +} diff --git a/sdk/octatrack/modules/output-matrix/octamod.module.json b/sdk/octatrack/modules/output-matrix/octamod.module.json index 6e61dc8530..d401f33ee1 100644 --- a/sdk/octatrack/modules/output-matrix/octamod.module.json +++ b/sdk/octatrack/modules/output-matrix/octamod.module.json @@ -87,6 +87,15 @@ "rationale": "1,678 bytes of DRAM code and data, 671 DSP program words reused from SPRING REV and 193 DSP Y words.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0.1, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7 and an empty starting inventory. Release sources rebuilt for this twin’s base binding; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.8 % installed and used nowhere; CPU meter 45.3 % before, 45.5 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/pattern-sample-locks/evidence/cpu-price.json b/sdk/octatrack/modules/pattern-sample-locks/evidence/cpu-price.json new file mode 100644 index 0000000000..bd05a91b7f --- /dev/null +++ b/sdk/octatrack/modules/pattern-sample-locks/evidence/cpu-price.json @@ -0,0 +1,112 @@ +{ + "module": "pattern-sample-locks", + "version": "0.1.9-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory", + "seconds": 8, + "measuredAt": "2026-11-21T07:46:48.819Z", + "result": { + "id": "pattern-sample-locks", + "version": "0.1.9-experimental", + "packageSha256": "6fea272e2cc6f22afdea9d8561cc2c02e7e45afade5da070c5dafcefb66d3ff3", + "before": { + "frame": 32.7, + "frameMax": 70.6, + "frames": 22261, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 45.8, + "dsp5to8": 41.8, + "allocation": { + "modulePoolBytes": 7120, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71.1, + "frames": 22257, + "skipped": 0, + "cpu": 45.4, + "dsp1to4": 47.1, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 9920, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 0, + "cpu": 0.1, + "dsp1to4": 1.3, + "dsp5to8": -0.9 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:46:48.819Z", + "before": { + "frame": 32.7, + "frameMax": 70.6, + "frames": 22261, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 45.8, + "dsp5to8": 41.8, + "allocation": { + "modulePoolBytes": 7120, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71.1, + "frames": 22257, + "skipped": 0, + "cpu": 45.4, + "dsp1to4": 47.1, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 9920, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:47:20.078Z", + "before": { + "frame": 32.7, + "frameMax": 70.4, + "frames": 22367, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 46.9, + "dsp5to8": 42.3, + "allocation": { + "modulePoolBytes": 9920, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 70.1, + "frames": 22260, + "skipped": 0, + "cpu": 45.4, + "dsp1to4": 44.1, + "dsp5to8": 41.8, + "allocation": { + "modulePoolBytes": 9920, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ] + } +} diff --git a/sdk/octatrack/modules/pattern-sample-locks/octamod.module.json b/sdk/octatrack/modules/pattern-sample-locks/octamod.module.json index 8e5ef7df94..b0c4320403 100644 --- a/sdk/octatrack/modules/pattern-sample-locks/octamod.module.json +++ b/sdk/octatrack/modules/pattern-sample-locks/octamod.module.json @@ -88,6 +88,15 @@ "rationale": "One active copy occupies an exact 10,832-byte extent in the shared runtime pool: 8,748 initialized bytes, 1,328 BSS bytes, 528-byte runtime header and 216 site-record bytes plus alignment. Apply Scene's 2,062-byte code/state is a minimal-tier reference; Temp Save's 42,892-byte buffer is moderate. The 10,048-byte package occupies existing shared upload staging, not another module allocation. The complete shared-task/interrupt stack remains unresolved, so this is not a total-memory qualification; the 21,664-byte overlap assumes two equal candidate extents.", "source": "evidence/memory-lifetimes-20261105.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.3 % before, 45.4 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/playmodes/evidence/cpu-price.json b/sdk/octatrack/modules/playmodes/evidence/cpu-price.json new file mode 100644 index 0000000000..478af7e5a5 --- /dev/null +++ b/sdk/octatrack/modules/playmodes/evidence/cpu-price.json @@ -0,0 +1,114 @@ +{ + "module": "playmodes", + "version": "0.2.0-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7. Private runtime package built from the listed Play Modes 0.2.0 source", + "seconds": 8, + "measuredAt": "2026-11-21T07:53:40.719Z", + "result": { + "id": "playmodes", + "version": "file", + "packageSha256": "feae7bf8d603cce28d2299f9f5ec946354d761f2cf5647a6006a1a59bcbcd289", + "before": { + "frame": 32.6, + "frameMax": 70.3, + "frames": 22494, + "skipped": 0, + "cpu": 45.6, + "dsp1to4": 46, + "dsp5to8": 41.2, + "allocation": { + "modulePoolBytes": 4544, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71.4, + "frames": 22291, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.9, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 17168, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 0.1, + "cpu": -0.4, + "dsp1to4": -0.1, + "dsp5to8": -0.2 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:53:40.719Z", + "before": { + "frame": 32.6, + "frameMax": 70.3, + "frames": 22494, + "skipped": 0, + "cpu": 45.6, + "dsp1to4": 46, + "dsp5to8": 41.2, + "allocation": { + "modulePoolBytes": 4544, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 71.4, + "frames": 22291, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.9, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 17168, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:54:11.521Z", + "before": { + "frame": 32.7, + "frameMax": 70.3, + "frames": 22330, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 46.3, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 17168, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 72, + "frames": 22405, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 45.7, + "dsp5to8": 41.1, + "allocation": { + "modulePoolBytes": 17168, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ], + "releaseSourceVersion": "0.2.0-experimental", + "releaseSourceCommit": "ef6099b0a29b971a23ab397cd284819ca6774727" + } +} diff --git a/sdk/octatrack/modules/playmodes/octamod.module.json b/sdk/octatrack/modules/playmodes/octamod.module.json index 7d2f6047e3..4561eb570f 100644 --- a/sdk/octatrack/modules/playmodes/octamod.module.json +++ b/sdk/octatrack/modules/playmodes/octamod.module.json @@ -116,6 +116,15 @@ "rationale": "About 4.7 KB of DRAM data in the platform reserve plus the unit's code, and a 2,310-byte battery-RAM table; no per-instance copies.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0.1, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7. Private runtime package built from the listed Play Modes 0.2.0 source; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.6 % before, 32.7 % installed and used nowhere; CPU meter 45.6 % before, 45.2 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/recorder-loop-fix/evidence/cpu-price.json b/sdk/octatrack/modules/recorder-loop-fix/evidence/cpu-price.json new file mode 100644 index 0000000000..4ac39db749 --- /dev/null +++ b/sdk/octatrack/modules/recorder-loop-fix/evidence/cpu-price.json @@ -0,0 +1,114 @@ +{ + "module": "recorder-loop-fix", + "version": "0.1.0-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7 and an empty starting inventory. Release sources rebuilt for this twin’s base binding", + "seconds": 8, + "measuredAt": "2026-11-21T07:51:05.800Z", + "result": { + "id": "recorder-loop-fix", + "version": "file", + "packageSha256": "43d26b2761a010e5e6a3ad9a2bcb6bb8beba92b245099acb0b4ed70065d208a4", + "before": { + "frame": 32.7, + "frameMax": 70.7, + "frames": 22310, + "skipped": 0, + "cpu": 45.1, + "dsp1to4": 45.9, + "dsp5to8": 41.1, + "allocation": { + "modulePoolBytes": 1568, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 70.8, + "frames": 22263, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 47.4, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 2208, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 0, + "cpu": 0.4, + "dsp1to4": 1.5, + "dsp5to8": -0.2 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:51:05.800Z", + "before": { + "frame": 32.7, + "frameMax": 70.7, + "frames": 22310, + "skipped": 0, + "cpu": 45.1, + "dsp1to4": 45.9, + "dsp5to8": 41.1, + "allocation": { + "modulePoolBytes": 1568, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 70.8, + "frames": 22263, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 47.4, + "dsp5to8": 40.9, + "allocation": { + "modulePoolBytes": 2208, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:51:35.373Z", + "before": { + "frame": 32.7, + "frameMax": 70.5, + "frames": 22294, + "skipped": 0, + "cpu": 45.5, + "dsp1to4": 48, + "dsp5to8": 42.1, + "allocation": { + "modulePoolBytes": 2208, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 32.7, + "frameMax": 70.2, + "frames": 22286, + "skipped": 0, + "cpu": 45.4, + "dsp1to4": 46.1, + "dsp5to8": 42, + "allocation": { + "modulePoolBytes": 2208, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ], + "releaseSourceVersion": "0.1.0-experimental", + "releaseSourceCommit": "ef6099b0a29b971a23ab397cd284819ca6774727" + } +} diff --git a/sdk/octatrack/modules/recorder-loop-fix/octamod.module.json b/sdk/octatrack/modules/recorder-loop-fix/octamod.module.json index d2ab420305..f2f1648f85 100644 --- a/sdk/octatrack/modules/recorder-loop-fix/octamod.module.json +++ b/sdk/octatrack/modules/recorder-loop-fix/octamod.module.json @@ -109,6 +109,15 @@ "rationale": "Small authored ROM patches and reused stock state; no new audio buffer allocation.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1\u20137 and an empty starting inventory. Release sources rebuilt for this twin\u2019s base binding; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.1 % before, 45.5 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/sidechain-compressor/evidence/cpu-price.json b/sdk/octatrack/modules/sidechain-compressor/evidence/cpu-price.json new file mode 100644 index 0000000000..2f9daf12c8 --- /dev/null +++ b/sdk/octatrack/modules/sidechain-compressor/evidence/cpu-price.json @@ -0,0 +1,177 @@ +{ + "module": "sidechain-compressor", + "version": "0.2.2-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch A01 and saved Part 4 with trigs on tracks 1–7. T5 FX1 NONE at baseline, COMPRESSOR on T5 FX1 keyed from T1 in use. The stock-compressor reading is also retained.", + "seconds": 8, + "measuredAt": "2026-11-21T08:03:10.478Z", + "result": { + "id": "sidechain-compressor", + "version": "file", + "packageSha256": "9f22861f282565e9a95e272220faf49bc403cf0ac7065f50cd5e941217481622", + "before": { + "frame": 32.6, + "frameMax": 70.4, + "frames": 22871, + "skipped": 0, + "cpu": 45, + "dsp1to4": 43.4, + "dsp5to8": 38.2, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33, + "frameMax": 71.1, + "frames": 22772, + "skipped": 0, + "cpu": 45.7, + "dsp1to4": 45.7, + "dsp5to8": 38.9, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "stockCompressor": { + "frame": 32.6, + "frameMax": 70.7, + "frames": 22785, + "skipped": 0, + "cpu": 45, + "dsp1to4": 45.8, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 882 + } + }, + "inUse": { + "frame": 33.1, + "frameMax": 71.2, + "frames": 22850, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 49.7, + "dsp5to8": 43.7, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 882 + } + }, + "inUseOn": "T5 FX1", + "atRestAdds": { + "frame": 0.4, + "cpu": 0.7, + "dsp1to4": 2.3, + "dsp5to8": 0.7 + }, + "inUseAdds": { + "frame": 0.5, + "cpu": 0.3, + "dsp1to4": 6.3, + "dsp5to8": 5.5 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T08:02:02.532Z", + "before": { + "frame": 32.6, + "frameMax": 70.6, + "frames": 22818, + "skipped": 0, + "cpu": 44.9, + "dsp1to4": 45.9, + "dsp5to8": 39.4, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33, + "frameMax": 71.2, + "frames": 23298, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 48.8, + "dsp5to8": 39.8, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "inUse": { + "frame": 33, + "frameMax": 71, + "frames": 23132, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 49.9, + "dsp5to8": 43.2, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 882 + } + } + }, + { + "measuredAt": "2026-11-21T08:03:10.478Z", + "before": { + "frame": 32.6, + "frameMax": 70.4, + "frames": 22871, + "skipped": 0, + "cpu": 45, + "dsp1to4": 43.4, + "dsp5to8": 38.2, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33, + "frameMax": 71.1, + "frames": 22772, + "skipped": 0, + "cpu": 45.7, + "dsp1to4": 45.7, + "dsp5to8": 38.9, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "inUse": { + "frame": 33.1, + "frameMax": 71.2, + "frames": 22850, + "skipped": 0, + "cpu": 45.3, + "dsp1to4": 49.7, + "dsp5to8": 43.7, + "allocation": { + "modulePoolBytes": 2960, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 882 + } + } + } + ], + "releaseSourceVersion": "0.2.2-experimental", + "releaseSourceCommit": "ef6099b0a29b971a23ab397cd284819ca6774727" + } +} diff --git a/sdk/octatrack/modules/sidechain-compressor/octamod.module.json b/sdk/octatrack/modules/sidechain-compressor/octamod.module.json index cce71630a4..05679bf914 100644 --- a/sdk/octatrack/modules/sidechain-compressor/octamod.module.json +++ b/sdk/octatrack/modules/sidechain-compressor/octamod.module.json @@ -215,6 +215,15 @@ "rationale": "26,288 bytes at sixteen instances including inherited stock buffers; no new heap/SDRAM delay storage.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0.5, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch A01 and saved Part 4 with trigs on tracks 1–7. T5 FX1 NONE at baseline, COMPRESSOR on T5 FX1 keyed from T1 in use. The stock-compressor reading is also retained.; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.6 % before, 33 % installed and used nowhere, 33.1 % on T5 FX1; CPU meter 45 % before, 45.7 % at rest, 45.3 % in use.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/sdk/octatrack/modules/slow-lfo/evidence/cpu-price.json b/sdk/octatrack/modules/slow-lfo/evidence/cpu-price.json new file mode 100644 index 0000000000..9cc24886a6 --- /dev/null +++ b/sdk/octatrack/modules/slow-lfo/evidence/cpu-price.json @@ -0,0 +1,112 @@ +{ + "module": "slow-lfo", + "version": "0.1.0-experimental", + "base": "8850f5399c453b9c (development twin, ef6099b0a)", + "scene": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory", + "seconds": 8, + "measuredAt": "2026-11-21T07:47:49.132Z", + "result": { + "id": "slow-lfo", + "version": "0.1.0-experimental", + "packageSha256": "3505194ebe34509b765bb71d38ab6a62ab5f4f5ba18cdfd829c741fec472aeb4", + "before": { + "frame": 32.7, + "frameMax": 71.3, + "frames": 22258, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.8, + "dsp5to8": 41.5, + "allocation": { + "modulePoolBytes": 9920, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33.2, + "frameMax": 71.5, + "frames": 22259, + "skipped": 0, + "cpu": 45.9, + "dsp1to4": 46.5, + "dsp5to8": 42.1, + "allocation": { + "modulePoolBytes": 1456, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRestAdds": { + "frame": 0.5, + "cpu": 0.7, + "dsp1to4": 0.7, + "dsp5to8": 0.6 + }, + "rolledBack": true, + "repetitions": [ + { + "measuredAt": "2026-11-21T07:47:49.132Z", + "before": { + "frame": 32.7, + "frameMax": 71.3, + "frames": 22258, + "skipped": 0, + "cpu": 45.2, + "dsp1to4": 45.8, + "dsp5to8": 41.5, + "allocation": { + "modulePoolBytes": 9920, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33.2, + "frameMax": 71.5, + "frames": 22259, + "skipped": 0, + "cpu": 45.9, + "dsp1to4": 46.5, + "dsp5to8": 42.1, + "allocation": { + "modulePoolBytes": 1456, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + }, + { + "measuredAt": "2026-11-21T07:48:18.542Z", + "before": { + "frame": 32.7, + "frameMax": 71.1, + "frames": 22256, + "skipped": 0, + "cpu": 45.4, + "dsp1to4": 47.1, + "dsp5to8": 41.9, + "allocation": { + "modulePoolBytes": 1456, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + }, + "atRest": { + "frame": 33.2, + "frameMax": 70.9, + "frames": 22262, + "skipped": 0, + "cpu": 45.6, + "dsp1to4": 45.6, + "dsp5to8": 41, + "allocation": { + "modulePoolBytes": 1456, + "dspProgramWordsT1to4": 1504, + "dspProgramWordsT5to8": 702 + } + } + } + ] + } +} diff --git a/sdk/octatrack/modules/slow-lfo/octamod.module.json b/sdk/octatrack/modules/slow-lfo/octamod.module.json index d9d6361256..51829ca706 100644 --- a/sdk/octatrack/modules/slow-lfo/octamod.module.json +++ b/sdk/octatrack/modules/slow-lfo/octamod.module.json @@ -113,6 +113,15 @@ "rationale": "184 bytes of code and labels.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0.5, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 33.2 % installed and used nowhere; CPU meter 45.2 % before, 45.9 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/src/catalog/module-documents.json b/src/catalog/module-documents.json index 147105825e..f5ad7a294b 100644 --- a/src/catalog/module-documents.json +++ b/src/catalog/module-documents.json @@ -5299,6 +5299,15 @@ "rationale": "724 authored ROM bytes, up to 127 alignment bytes, no newly allocated heap or persistent RAM. Existing stock state is reused.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7 and an empty starting inventory. Release sources rebuilt for this twin’s base binding; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.2 % before, 45.5 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -5665,6 +5674,15 @@ "rationale": "26,288 bytes at sixteen instances including inherited stock buffers; no new heap/SDRAM delay storage.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0.5, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch A01 and saved Part 4 with trigs on tracks 1–7. T5 FX1 NONE at baseline, COMPRESSOR on T5 FX1 keyed from T1 in use. The stock-compressor reading is also retained.; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.6 % before, 33 % installed and used nowhere, 33.1 % on T5 FX1; CPU meter 45 % before, 45.7 % at rest, 45.3 % in use.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -6575,6 +6593,15 @@ "rationale": "About 4.7 KB of DRAM data in the platform reserve plus the unit's code, and a 2,310-byte battery-RAM table; no per-instance copies.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0.1, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7. Private runtime package built from the listed Play Modes 0.2.0 source; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.6 % before, 32.7 % installed and used nowhere; CPU meter 45.6 % before, 45.2 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -6782,6 +6809,15 @@ "rationale": "Small authored ROM patches and reused stock state; no new audio buffer allocation.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 1.2, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 33.9 % installed and used nowhere; CPU meter 45.5 % before, 46.3 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -7137,6 +7173,15 @@ "rationale": "Small authored ROM patches and reused stock state; no new audio buffer allocation.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7 and an empty starting inventory. Release sources rebuilt for this twin’s base binding; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.1 % before, 45.5 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -7651,6 +7696,15 @@ "rationale": "1,678 bytes of DRAM code and data, 671 DSP program words reused from SPRING REV and 193 DSP Y words.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0.1, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7 and an empty starting inventory. Release sources rebuilt for this twin’s base binding; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.8 % installed and used nowhere; CPU meter 45.3 % before, 45.5 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -9384,6 +9438,15 @@ "rationale": "4,480 bytes of ColdFire code, data and state in DRAM; locks live in spare bytes the project already has.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.3 % before, 45.4 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -9944,6 +10007,15 @@ "rationale": "6,380 bytes of ColdFire code, data and state in DRAM (from the package); the slice table it fills is the sample's own.", "source": "evidence/hardware.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.2 % before, 45.5 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -10618,6 +10690,15 @@ "rationale": "184 bytes of code and labels.", "source": "TESTING.md" } + }, + "cpuPrice": { + "value": 0.5, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 33.2 % installed and used nowhere; CPU meter 45.2 % before, 45.9 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { @@ -12776,6 +12857,15 @@ "rationale": "One active copy occupies an exact 10,832-byte extent in the shared runtime pool: 8,748 initialized bytes, 1,328 BSS bytes, 528-byte runtime header and 216 site-record bytes plus alignment. Apply Scene's 2,062-byte code/state is a minimal-tier reference; Temp Save's 42,892-byte buffer is moderate. The 10,048-byte package occupies existing shared upload staging, not another module allocation. The complete shared-task/interrupt stack remains unresolved, so this is not a total-memory qualification; the 21,664-byte overlap assumes two equal candidate extents.", "source": "evidence/memory-lifetimes-20261105.md" } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-11-21", + "conditions": "Octatrack MKII, owner scratch bank A pattern A01, saved Part 4, trigs on audio tracks 1–7, stock effects on both slots and an empty starting inventory; base 8850f5399c453b9c (development twin, ef6099b0a); 8 s per reading. Frame interrupt 32.7 % before, 32.7 % installed and used nowhere; CPU meter 45.3 % before, 45.4 % at rest.", + "source": "evidence/cpu-price.json" } }, "tests": { diff --git a/src/catalog/octatrack-resource-measurements.ts b/src/catalog/octatrack-resource-measurements.ts new file mode 100644 index 0000000000..be9669d5ef --- /dev/null +++ b/src/catalog/octatrack-resource-measurements.ts @@ -0,0 +1,106 @@ +import type { ModuleDocument } from './module-contract' + +type AllocationReading = { modulePoolBytes: number; dspProgramWordsT1to4: number; dspProgramWordsT5to8: number } +type LoadReading = { skipped: number; dsp1to4: number; dsp5to8: number; allocation?: Partial } +type DevicePriceRecord = { + module?: string + version?: string + base?: string + scene?: string + result?: { + id?: string + version?: string + releaseSourceVersion?: string + releaseSourceCommit?: string + packageSha256?: string + rolledBack?: boolean + refused?: string + restore?: string + inUseError?: string + inUseOn?: string + before?: LoadReading + atRest?: LoadReading + inUse?: LoadReading + repetitions?: { before?: LoadReading; inUse?: LoadReading }[] + } +} + +const records = import.meta.glob( + '../../sdk/octatrack/modules/*/evidence/cpu-price.json', + { eager: true, import: 'default' }, +) + +const airChorus = { + version: '0.1.3-experimental', before: 40.3, after: 51.1, core: 'T1–4', slot: 'T3 FX2', + base: '0.7.6 development twin 5412b595', + scene: 'Octatrack MKII, MODWERK-TEST2 bank A pattern 1 with sound on T2 and T3, 8 seconds per reading.', + source: 'sdk/octatrack/modules/airwindows-chorus/TESTING.md', +} + +function currentReading(document: ModuleDocument, record: DevicePriceRecord | undefined) { + const result = record?.result + const matchesRelease = result?.version === document.version || result?.version === 'file' + && result.releaseSourceVersion === document.version && /^[a-f0-9]{40}$/.test(result.releaseSourceCommit ?? '') + && /^[a-f0-9]{64}$/.test(result.packageSha256 ?? '') + if (record?.module !== document.id || record.version !== document.version || !record.base || !record.scene + || result?.id !== document.id || !matchesRelease || result.rolledBack !== true + || result.refused || result.restore || result.inUseError || !result.before) return + return { before: result.before, result, base: record.base, scene: record.scene } +} + +const evidencePath = (id: string) => 'sdk/octatrack/modules/' + id + '/evidence/cpu-price.json' +const recordedPrice = (id: string) => records['../../' + evidencePath(id)] + +export function readDspLoad(document: ModuleDocument, record: DevicePriceRecord | undefined) { + const reading = currentReading(document, record) + if (!reading) return + const { before: baseline, result, base, scene } = reading + if (!result.inUse || result.inUse.skipped !== baseline.skipped) return + const slot = /^T([1-8]) FX[12]$/.exec(result.inUseOn ?? '') + if (!slot) return + const firstCore = Number(slot[1]) <= 4 + const core = firstCore ? 'T1–4' : 'T5–8' + const metric = firstCore ? 'dsp1to4' : 'dsp5to8' + const before = baseline[metric], after = result.inUse[metric] + if (![before, after].every(value => Number.isFinite(value) && value >= 0 && value <= 100)) return + for (const repeat of result.repetitions ?? []) { + const start = repeat.before?.[metric], end = repeat.inUse?.[metric] + if (typeof start !== 'number' || typeof end !== 'number' || !Number.isFinite(start) || !Number.isFinite(end) + || repeat.before?.skipped !== repeat.inUse?.skipped || Math.abs((end - start) - (after - before)) > 1) return + } + return { + before, after, core, slot: slot[0], base, scene, + source: evidencePath(document.id), + } +} + +export function measuredDspLoad(document: ModuleDocument) { + const measurement = readDspLoad(document, recordedPrice(document.id)) + if (measurement) return measurement + if (document.id === 'airwindows-chorus' && document.version === airChorus.version) return airChorus +} + +export function readTrackedMemory(document: ModuleDocument, record: DevicePriceRecord | undefined) { + const reading = currentReading(document, record) + if (!reading) return + const phase = reading.result.inUse ?? reading.result.atRest + if (!phase || phase.skipped !== reading.before.skipped) return + const base = reading.before.allocation, after = phase.allocation + // Undo can leave the module pool occupied after the live inventory returns to empty. + if (base?.modulePoolBytes !== 0) return + const differences = (['modulePoolBytes', 'dspProgramWordsT1to4', 'dspProgramWordsT5to8'] as const).map(key => { + const start = base?.[key], end = after?.[key] + return typeof start === 'number' && typeof end === 'number' && Number.isSafeInteger(start) && Number.isSafeInteger(end) && start >= 0 + ? end - start + : -1 + }) + if (differences.some(value => value < 0) || differences.every(value => value === 0)) return + return { + poolBytes: differences[0], dspWordsT1to4: differences[1], dspWordsT5to8: differences[2], + scene: reading.scene, base: reading.base, slot: reading.result.inUseOn, source: evidencePath(document.id), + } +} + +export function measuredTrackedMemory(document: ModuleDocument) { + return readTrackedMemory(document, recordedPrice(document.id)) +} diff --git a/src/catalog/resource-indicators.test.ts b/src/catalog/resource-indicators.test.ts index f6346b3265..7ab9eba72c 100644 --- a/src/catalog/resource-indicators.test.ts +++ b/src/catalog/resource-indicators.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest' import { MODULE_DOCUMENTS } from './documents' import { parseModuleDocument, parseModuleResourceImpact } from './module-contract' import { moduleResourceIndicators } from './resource-indicators' +import { readDspLoad, readTrackedMemory } from './octatrack-resource-measurements' import { parseRetainedResourceImpacts, requireModuleResourceImpact } from './resource-impact' import { resourceImpactFixture } from './test-fixtures/resource-impact' import example from '../../public/module-repository.example.json' @@ -68,27 +69,66 @@ describe('module resource gauges', () => { expect(document.resources.processing.value).toBeNull() }) - it('uses the shipped DSP price with its evidence method and falls back to qualification for hooks', () => { + it('shows only the reported eleven-stem hardware peak for the card build', () => { + const stems = MODULE_DOCUMENTS.find(document => document.id === 'stem-rec')! + expect(moduleResourceIndicators(stems)[0]).toMatchObject({ + value: '14.6%', status: 'Reported peak · 11 stems', score: null, + source: 'sdk/octatrack/modules/stem-rec/TESTING.md', + }) + expect(moduleResourceIndicators({ ...stems, version: '0.2.0' })[0].status).toBe('Estimated') + }) + + it('uses hardware DSP readings and keeps software benchmarks in the evidence', () => { const lofi = MODULE_DOCUMENTS.find(document => document.id === 'lofi2')! const outputMatrix = MODULE_DOCUMENTS.find(document => document.id === 'output-matrix')! const bbd = MODULE_DOCUMENTS.find(document => document.id === 'bbd')! + const chorus = MODULE_DOCUMENTS.find(document => document.id === 'airwindows-chorus')! const lofiPrice = packageManifest.packages.find(entry => entry.id === lofi.id)!.cycles const bbdPrice = packageManifest.packages.find(entry => entry.id === bbd.id)!.cycles const hookPrice = outputMatrix.tests.qualification!.cycles.find(cycle => cycle.processor === 'dsp')! const memory = lofi.tests.qualification!.memory const [, lofiDsp, lofiMemory] = moduleResourceIndicators(lofi) - expect(lofiDsp).toMatchObject({ value: String(lofiPrice), status: 'cycles/sample · Hardware-based', score: null }) + expect(lofiDsp).toMatchObject({ + value: '+10.3 pp', status: 'Measured · T1–4', score: null, + benchmark: { value: lofiPrice + ' cycles per sample per instance', basis: 'cycles/sample · Hardware-based' }, + }) expect(lofiMemory).toMatchObject({ value: memory.totalBytes.toLocaleString('en-US') + ' B', status: 'Accounted total', score: null }) expect(lofiMemory.description).toContain(memory.sharedBytes.toLocaleString('en-US') + ' B shared') expect(lofiMemory.description).toContain(memory.perInstanceBytes.toLocaleString('en-US') + ' B per instance') expect(moduleResourceIndicators(outputMatrix)[1]).toMatchObject({ - value: String(hookPrice.worstCase), status: hookPrice.unit + ' · Emulator', source: 'sdk/octatrack/modules/output-matrix/' + hookPrice.report, + status: 'Estimated', benchmark: { value: hookPrice.worstCase + ' cycles per sample for one instance', source: 'sdk/octatrack/modules/output-matrix/' + hookPrice.report }, }) - expect(moduleResourceIndicators(bbd)[1]).toMatchObject({ value: String(bbdPrice), status: 'instr./sample · Emulator' }) + expect(moduleResourceIndicators(bbd)[1]).toMatchObject({ + value: '+10.8 pp', status: 'Measured · T1–4', + benchmark: { value: bbdPrice + ' instructions per sample per instance', basis: 'instr./sample · Emulator' }, + }) + expect(moduleResourceIndicators(chorus)[1]).toMatchObject({ value: '+10.8 pp', status: 'Measured · T1–4', source: 'sdk/octatrack/modules/airwindows-chorus/TESTING.md' }) const future = { ...rated(), id: lofi.id, version: '99.0.0' } expect(moduleResourceIndicators(future)[1]).toMatchObject({ value: 'High', status: 'Estimated' }) }) + it('uses the selected track’s core and the tracked pools from the same clean trial', () => { + const document = rated() + const before = { skipped: 0, dsp1to4: 30, dsp5to8: 31, allocation: { + modulePoolBytes: 0, dspProgramWordsT1to4: 50, dspProgramWordsT5to8: 80, + } } + const inUse = { skipped: 0, dsp1to4: 29.9, dsp5to8: 42, allocation: { + modulePoolBytes: 512, dspProgramWordsT1to4: 50, dspProgramWordsT5to8: 192, + } } + const result = { id: document.id, version: document.version, rolledBack: true, before, inUse, inUseOn: 'T5 FX2' } + const record = { module: document.id, version: document.version, base: 'test base', scene: 'saved scratch Part', result } + expect(readDspLoad(document, record)).toMatchObject({ before: 31, after: 42, core: 'T5–8', slot: 'T5 FX2' }) + expect(readTrackedMemory(document, record)).toMatchObject({ poolBytes: 512, dspWordsT1to4: 0, dspWordsT5to8: 112 }) + expect(readDspLoad(document, { ...record, version: '99.0.0' })).toBeUndefined() + expect(readDspLoad(document, { ...record, result: { ...result, repetitions: [{ + before, inUse: { ...inUse, dsp5to8: 39 }, + }] } })).toBeUndefined() + expect(readTrackedMemory(document, { ...record, result: { ...result, inUse: { ...inUse, skipped: 1 } } })).toBeUndefined() + expect(readTrackedMemory(document, { ...record, result: { ...result, before: { + ...before, allocation: { ...before.allocation, modulePoolBytes: 128 }, + } } })).toBeUndefined() + }) + it('keeps drafts parseable but blocks releases and gauge rendering without ratings', () => { expect(draft().resources.impact).toBeUndefined() expect(() => requireModuleResourceImpact(draft())).toThrow('release requires populated CPU, DSP core and memory gauges') diff --git a/src/catalog/resource-indicators.ts b/src/catalog/resource-indicators.ts index d6227e68a4..c83e27ae24 100644 --- a/src/catalog/resource-indicators.ts +++ b/src/catalog/resource-indicators.ts @@ -1,5 +1,6 @@ import type { ModuleDocument } from './module-contract' import packageManifest from '../engine/assets/octatrack-module-packages.json' +import { measuredDspLoad, measuredTrackedMemory } from './octatrack-resource-measurements' import { requireModuleResourceImpact } from './resource-impact' const packagesById = new Map(packageManifest.packages.map(entry => [entry.id, entry])) @@ -18,7 +19,7 @@ function dspIndicator(document: ModuleDocument) { if (evidence) { const value = count(entry.cycles) return { - value, score: null, fill: 0, status: evidence.unit + ' · ' + evidence.basis, + value, score: null, fill: 0, status: evidence.unit + ' · ' + evidence.basis, hardware: entry.cyclesKind === 'hardware', valueText: value + ' ' + evidence.unit.replace('instr.', 'instructions').replace('/', ' per ') + ' per instance', description: evidence.description + ' The figure is per active instance before the base applies any admission margin.', source: 'src/engine/assets/octatrack-module-packages.json', @@ -31,7 +32,7 @@ function dspIndicator(document: ModuleDocument) { const value = count(cycle.worstCase) const basis = qualificationDspBasis[cycle.method] return { - value, score: null, fill: 0, status: cycle.unit + ' · ' + basis, + value, score: null, fill: 0, status: cycle.unit + ' · ' + basis, hardware: cycle.method === 'hardware', valueText: value + ' ' + cycle.unit.replace('/', ' per ') + ' for one instance', description: 'Worst-case DSP count for one instance in the qualification record. ' + cycle.conditions.maxLoad, source: 'sdk/octatrack/modules/' + document.id + '/' + cycle.report, @@ -43,7 +44,13 @@ export function moduleResourceIndicators(document: ModuleDocument) { const impact = requireModuleResourceImpact(document) const price = document.resources.cpuPrice const dsp = dspIndicator(document) + const dspLoad = measuredDspLoad(document) const memory = document.tests.qualification?.memory + const tracked = memory ? undefined : measuredTrackedMemory(document) + // The card build reports an observed interrupt peak for eleven stems, with the full configuration still estimated. + const stemPeak = document.id === 'stem-rec' && document.version === '0.1.0-experimental' + ? document.tests.qualification?.cycles.find(record => record.processor === 'coldfire' && record.method === 'hardware' && record.unit === 'cycles/block') + : undefined const levels = { minimal: { score: 1, label: 'Minimal' }, low: { score: 2, label: 'Low' }, moderate: { score: 3, label: 'Moderate' }, high: { score: 4, label: 'High' } } return (['cpu', 'dsp', 'memory'] as const).map(id => { if (id === 'cpu' && price) { @@ -61,7 +68,30 @@ export function moduleResourceIndicators(document: ModuleDocument) { sourceInModwerk: true, } } - if (id === 'dsp' && dsp) return { id, label: 'DSP core', ...dsp } + if (id === 'cpu' && stemPeak?.budget) { + const value = (100 * stemPeak.worstCase / stemPeak.budget).toFixed(1) + '%' + return { + id, label: 'CPU', ariaLabel: 'Reported peak CPU load', value, score: null, fill: 0, + status: 'Reported peak · 11 stems', + valueText: value + ' peak share of an audio block while recording eleven stems', + description: 'Yves Rosius reported a peak of ' + count(stemPeak.worstCase) + ' of ' + count(stemPeak.budget) + + ' cycles per audio block in two eleven-stem, 24-bit takes on an Octatrack MKII. The fourteen-stem measurement is pending.', + source: 'sdk/octatrack/modules/stem-rec/' + stemPeak.report, sourceInModwerk: true, + } + } + if (id === 'dsp' && dspLoad) { + const delta = Math.round((dspLoad.after - dspLoad.before) * 10) / 10 + const value = (delta > 0 ? '+' : '') + delta + return { + id, label: 'DSP core', value: value + ' pp', score: null, fill: 0, status: 'Measured · ' + dspLoad.core, + valueText: value + ' percentage points of DSP core load', + description: 'Core ' + dspLoad.core + ' went from ' + dspLoad.before + '% to ' + dspLoad.after + '% with one instance on ' + + dspLoad.slot + '. ' + dspLoad.scene + ' Base ' + dspLoad.base + '.', + source: dspLoad.source, sourceInModwerk: true, + benchmark: dsp ? { value: dsp.valueText, basis: dsp.status, source: dsp.source } : undefined, + } + } + if (id === 'dsp' && dsp?.hardware) return { id, label: 'DSP core', ...dsp, value: dsp.value + ' cycles' } if (id === 'memory' && memory) { const value = count(memory.totalBytes) + ' B' return { @@ -73,6 +103,18 @@ export function moduleResourceIndicators(document: ModuleDocument) { sourceInModwerk: true, } } + if (id === 'memory' && tracked) { + const words = tracked.dspWordsT1to4 + tracked.dspWordsT5to8 + const bytes = tracked.poolBytes + 3 * words + return { + id, label: 'Memory', value: count(bytes) + ' B', score: null, fill: 0, status: 'Tracked allocation', + valueText: count(bytes) + ' bytes of tracked allocation', + description: count(tracked.poolBytes) + ' B in the module pool and ' + count(words) + ' 24-bit DSP program words across both cores. ' + + 'This count covers the measured pools ' + (tracked.slot ? 'with the effect on ' + tracked.slot : 'with the module installed and unused') + + '. ' + tracked.scene + ' Base ' + tracked.base + '.', + source: tracked.source, sourceInModwerk: true, + } + } const estimate = impact[id] const level = levels[estimate.level] return { @@ -80,6 +122,7 @@ export function moduleResourceIndicators(document: ModuleDocument) { value: level.label, score: level.score, fill: level.score / 4 * 100, status: 'Estimated', description: estimate.rationale, source: estimate.source, + benchmark: id === 'dsp' && dsp ? { value: dsp.valueText, basis: dsp.status, source: dsp.source } : undefined, } }) } diff --git a/src/components/ModuleResourceIndicators.tsx b/src/components/ModuleResourceIndicators.tsx index f9327f49aa..be7b30288f 100644 --- a/src/components/ModuleResourceIndicators.tsx +++ b/src/components/ModuleResourceIndicators.tsx @@ -24,7 +24,10 @@ export function ModuleResourceIndicators({ id, usbLayout }: { id: string; usbLay const href = indicator.sourceInModwerk ? repository + indicator.source : resourceSource(id, indicator.source) return
{indicator.label} {indicator.status}
-
{indicator.description} Read record ↗
+
+ {indicator.description} Read record ↗ + {indicator.benchmark &&

{indicator.benchmark.value} ({indicator.benchmark.basis}). Benchmark record ↗

} +
})} } /> diff --git a/src/devices/module-detail-parity.test.ts b/src/devices/module-detail-parity.test.ts index c765a1487b..f5576e405e 100644 --- a/src/devices/module-detail-parity.test.ts +++ b/src/devices/module-detail-parity.test.ts @@ -99,8 +99,9 @@ describe('module detail parity across machines', () => { const dsp = packageManifest.packages.find(entry => entry.id === module.id)!.cycles const memory = MODULE_DOCUMENTS_BY_ID[module.id].tests.qualification!.memory const html = render(createElement(ModuleDetail, { module, selected: false, onToggle: noop })) - expect(html).toContain(dsp + ' cycles per sample per instance') - expect(html).toContain('cycles/sample · Hardware-based') + expect(html).toContain('+10.3 percentage points of DSP core load') + expect(html).toContain('Measured · T1–4') + expect(html).toContain(dsp + ' cycles per sample per instance (cycles/sample · Hardware-based)') expect(html).toContain(memory.totalBytes.toLocaleString('en-US') + ' bytes at the supported instance limit') expect(html).toContain('Accounted total') expect(html).toContain('/blob/main/src/engine/assets/octatrack-module-packages.json"') From 891b10c1857e18da34db4f6f3b48dfd79ab788db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20A=C3=9Ffalg?= <67785539+repeat98@users.noreply.github.com> Date: Sat, 21 Nov 2026 09:58:05 +0100 Subject: [PATCH 010/105] Run the offline eval grader as the snapshot owner (#1913) --- .github/workflows/agent-eval.yml | 15 +++++++++++---- changelog/2026-11-21-offline-eval-grader.md | 1 + docs/AGENT_EVALS.md | 2 +- scripts/agent-eval/score-offline.sh | 9 +++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 changelog/2026-11-21-offline-eval-grader.md create mode 100644 scripts/agent-eval/score-offline.sh diff --git a/.github/workflows/agent-eval.yml b/.github/workflows/agent-eval.yml index 622a2b24d9..358f885fb5 100644 --- a/.github/workflows/agent-eval.yml +++ b/.github/workflows/agent-eval.yml @@ -29,6 +29,16 @@ jobs: run: | docker build --tag modwerk-eval-agent scripts/agent-eval docker run --rm --network none modwerk-eval-agent --version + - name: Compare offline and host scores on private snapshots + if: github.event_name == 'pull_request' + run: | + node scripts/agent-eval/run.mjs list | jq -r '.[]' | while read -r case_id; do + snapshot="$RUNNER_TEMP/$case_id" + node scripts/agent-eval/run.mjs prepare "$case_id" "$snapshot" + node scripts/agent-eval/grade.mjs "$case_id" "$snapshot" > "$snapshot.host.json" + bash scripts/agent-eval/score-offline.sh "$case_id" "$snapshot" > "$snapshot.offline.json" + diff -u "$snapshot.host.json" "$snapshot.offline.json" + done - id: corpus run: echo "cases=$(node scripts/agent-eval/run.mjs list)" >> "$GITHUB_OUTPUT" @@ -68,10 +78,7 @@ jobs: jq -e '.is_error == false' "$RUNNER_TEMP/model.json" > /dev/null - name: Score in a fresh offline container run: | - docker run --rm --network none --read-only --cap-drop ALL --security-opt no-new-privileges \ - --pids-limit 64 --memory 384m --cpus 1 -v "$RUNNER_TEMP/case:/case:ro" \ - -v "$PWD/scripts/agent-eval:/grader:ro" node:24.21.0-bookworm-slim \ - node /grader/grade.mjs "$CASE_ID" /case > "$RUNNER_TEMP/score.json" + bash scripts/agent-eval/score-offline.sh "$CASE_ID" "$RUNNER_TEMP/case" > "$RUNNER_TEMP/score.json" jq --arg suite "$(node scripts/agent-eval/run.mjs suite)" --arg model "$MODEL" --arg commit "$GITHUB_SHA" \ '. + {suite: $suite, agent: ("Claude Code 2.1.311 / " + $model), commit: $commit}' \ "$RUNNER_TEMP/score.json" > "$RUNNER_TEMP/result.json" diff --git a/changelog/2026-11-21-offline-eval-grader.md b/changelog/2026-11-21-offline-eval-grader.md new file mode 100644 index 0000000000..a3d6b47e18 --- /dev/null +++ b/changelog/2026-11-21-offline-eval-grader.md @@ -0,0 +1 @@ +GitHub can now score agent attempts in their private snapshots and publish the results after a merge. diff --git a/docs/AGENT_EVALS.md b/docs/AGENT_EVALS.md index a79b18e88a..b878395db0 100644 --- a/docs/AGENT_EVALS.md +++ b/docs/AGENT_EVALS.md @@ -10,7 +10,7 @@ Read TASK.md and solve it inside the supplied directory using only that snapshot ## After a merge -Pull requests changing the evals check the historical controls and solver image. The Post-merge agent eval workflow runs the agent on each push to the upstream main branch. It calibrates every case against the original and the merged implementation. A fresh Claude Code process then attempts each task using the snapshot and file tools. The solver container receives the existing maintenance bot’s Claude credential. The grading container runs offline. A provider or setup error fails the job. A completed attempt earns its score, including zero. Per-check results appear in the Actions summary and in the JSON artifacts, retained for 90 days. +Pull requests changing the evals check the historical controls, build the solver image and compare host and offline scores on the same private snapshots. The Post-merge agent eval workflow runs the agent on each push to the upstream main branch. It calibrates every case against the original and the merged implementation. A fresh Claude Code process then attempts each task using the snapshot and file tools. The solver container receives the existing maintenance bot’s Claude credential. The grading container runs offline. A provider or setup error fails the job. A completed attempt earns its score, including zero. Per-check results appear in the Actions summary and in the JSON artifacts, retained for 90 days. The central run uses Claude Code 2.1.311 and the repository variable `AGENT_EVAL_MODEL`, falling back to the maintenance bot model. To compare configurations, run the workflow on the same main revision with the two model settings and compare the same case and suite IDs. Repeat runs to see how much results vary. Local and central runs use different agent contexts. These cases measure software behaviour only. diff --git a/scripts/agent-eval/score-offline.sh b/scripts/agent-eval/score-offline.sh new file mode 100644 index 0000000000..375a710acc --- /dev/null +++ b/scripts/agent-eval/score-offline.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -eu + +# The runner owns the snapshot (mode 0700). Use its UID and GID to enter the read-only mount. +exec docker run --rm --user "$(id -u):$(id -g)" \ + --network none --read-only --cap-drop ALL --security-opt no-new-privileges \ + --pids-limit 64 --memory 384m --cpus 1 -v "$2:/case:ro" \ + -v "$PWD/scripts/agent-eval:/grader:ro" node:24.21.0-bookworm-slim \ + node /grader/grade.mjs "$1" /case From 4bb36d9a45208730a759af308f7819d256d7c7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20A=C3=9Ffalg?= <67785539+repeat98@users.noreply.github.com> Date: Sat, 21 Nov 2026 10:05:47 +0100 Subject: [PATCH 011/105] Restore all three Octatrack resource dials (#1914) --- .../2026-11-21-octatrack-resource-dials.md | 1 + docs/MODULE_RESOURCE_GAUGES.md | 2 +- src/catalog/resource-indicators.test.ts | 9 +++- src/catalog/resource-indicators.ts | 9 ++-- src/components/ModuleResourceIndicators.tsx | 1 + src/components/ModuleResourceSummary.tsx | 41 +++++++++++-------- src/devices/module-detail-parity.test.ts | 10 ++++- src/styles.css | 1 + 8 files changed, 48 insertions(+), 26 deletions(-) create mode 100644 changelog/2026-11-21-octatrack-resource-dials.md diff --git a/changelog/2026-11-21-octatrack-resource-dials.md b/changelog/2026-11-21-octatrack-resource-dials.md new file mode 100644 index 0000000000..d63ef5d3e1 --- /dev/null +++ b/changelog/2026-11-21-octatrack-resource-dials.md @@ -0,0 +1 @@ +Restored the dials for measured Octatrack DSP and memory. DSP load changes fill the arc, and byte or cycle counts use a dotted outline. diff --git a/docs/MODULE_RESOURCE_GAUGES.md b/docs/MODULE_RESOURCE_GAUGES.md index a066516e5d..bc0e9277c5 100644 --- a/docs/MODULE_RESOURCE_GAUGES.md +++ b/docs/MODULE_RESOURCE_GAUGES.md @@ -4,7 +4,7 @@ Every catalog module needs **CPU, DSP core and memory** ratings before release. The DSP core gauge shows the measured change in core load for one active instance, in percentage points. The evidence gives the base, scene, slot and before/after readings. When the release has hardware-backed cycles per sample, those can also supply a numeric gauge. Emulator counts and modeled bounds appear in the evidence. The memory gauge uses the qualification inventory's total bytes at the supported instance count, with shared and per-instance allocations in the evidence. A measured module-pool and DSP program allocation can supply a scoped quantity when the full inventory is unavailable. -When a numeric record is unavailable, the page displays the relative tier labelled **Estimated**. The four tiers are **Minimal, Low, Moderate, High**. A full High arc means the highest relative tier. DSP counts and memory totals use their recorded units and have no percentage arc. +When a numeric record is unavailable, the page displays the relative tier labelled **Estimated**. The four tiers are **Minimal, Low, Moderate, High**. A full High arc means the highest relative tier. A measured DSP load change fills the arc by the magnitude of the change, with the sign shown in the reading. Cycle counts and memory totals use a dotted arc and their recorded units. Ratings are estimates backed by source inspection or a documented comparison. Consider expensive modes, modulation/control changes, active voices and buffers. Audio effects/voices are rated per active instance; project-wide features such as USB Audio are rated while enabled. State a different workload explicitly. Minimal is useful for a small or absent added processing path; it is not a claim that the whole device consumes zero resources. Scores must not be summed across modules, processors or memory spaces. diff --git a/src/catalog/resource-indicators.test.ts b/src/catalog/resource-indicators.test.ts index 7ab9eba72c..a854c659ad 100644 --- a/src/catalog/resource-indicators.test.ts +++ b/src/catalog/resource-indicators.test.ts @@ -45,6 +45,11 @@ describe('module resource gauges', () => { } else if (indicator.score === null) { expect(indicator.valueText).toBeTruthy() expect(indicator.fill).toBe(0) + } else if (indicator.maximum === 100) { + expect(indicator.valueText).toBeTruthy() + expect(indicator.fill).toBe(indicator.score) + expect(indicator.score).toBeGreaterThanOrEqual(0) + expect(indicator.score).toBeLessThanOrEqual(100) } else { expect(['Minimal', 'Low', 'Moderate', 'High']).toContain(indicator.value) expect(indicator.fill).toBeGreaterThan(0) @@ -72,7 +77,7 @@ describe('module resource gauges', () => { it('shows only the reported eleven-stem hardware peak for the card build', () => { const stems = MODULE_DOCUMENTS.find(document => document.id === 'stem-rec')! expect(moduleResourceIndicators(stems)[0]).toMatchObject({ - value: '14.6%', status: 'Reported peak · 11 stems', score: null, + value: '14.6%', status: 'Reported peak · 11 stems', score: 14.6, maximum: 100, fill: 14.6, source: 'sdk/octatrack/modules/stem-rec/TESTING.md', }) expect(moduleResourceIndicators({ ...stems, version: '0.2.0' })[0].status).toBe('Estimated') @@ -89,7 +94,7 @@ describe('module resource gauges', () => { const memory = lofi.tests.qualification!.memory const [, lofiDsp, lofiMemory] = moduleResourceIndicators(lofi) expect(lofiDsp).toMatchObject({ - value: '+10.3 pp', status: 'Measured · T1–4', score: null, + value: '+10.3 pp', status: 'Measured · T1–4', score: 10.3, maximum: 100, fill: 10.3, benchmark: { value: lofiPrice + ' cycles per sample per instance', basis: 'cycles/sample · Hardware-based' }, }) expect(lofiMemory).toMatchObject({ value: memory.totalBytes.toLocaleString('en-US') + ' B', status: 'Accounted total', score: null }) diff --git a/src/catalog/resource-indicators.ts b/src/catalog/resource-indicators.ts index c83e27ae24..b8410ed889 100644 --- a/src/catalog/resource-indicators.ts +++ b/src/catalog/resource-indicators.ts @@ -69,9 +69,10 @@ export function moduleResourceIndicators(document: ModuleDocument) { } } if (id === 'cpu' && stemPeak?.budget) { - const value = (100 * stemPeak.worstCase / stemPeak.budget).toFixed(1) + '%' + const percent = Number((100 * stemPeak.worstCase / stemPeak.budget).toFixed(1)) + const value = percent + '%' return { - id, label: 'CPU', ariaLabel: 'Reported peak CPU load', value, score: null, fill: 0, + id, label: 'CPU', ariaLabel: 'Reported peak CPU load', value, score: percent, maximum: 100, fill: percent, status: 'Reported peak · 11 stems', valueText: value + ' peak share of an audio block while recording eleven stems', description: 'Yves Rosius reported a peak of ' + count(stemPeak.worstCase) + ' of ' + count(stemPeak.budget) @@ -82,8 +83,10 @@ export function moduleResourceIndicators(document: ModuleDocument) { if (id === 'dsp' && dspLoad) { const delta = Math.round((dspLoad.after - dspLoad.before) * 10) / 10 const value = (delta > 0 ? '+' : '') + delta + const change = Math.abs(delta) return { - id, label: 'DSP core', value: value + ' pp', score: null, fill: 0, status: 'Measured · ' + dspLoad.core, + id, label: 'DSP core', ariaLabel: 'DSP core load change', value: value + ' pp', + score: change, maximum: 100, fill: change, status: 'Measured · ' + dspLoad.core, valueText: value + ' percentage points of DSP core load', description: 'Core ' + dspLoad.core + ' went from ' + dspLoad.before + '% to ' + dspLoad.after + '% with one instance on ' + dspLoad.slot + '. ' + dspLoad.scene + ' Base ' + dspLoad.base + '.', diff --git a/src/components/ModuleResourceIndicators.tsx b/src/components/ModuleResourceIndicators.tsx index be7b30288f..2623fcfdc2 100644 --- a/src/components/ModuleResourceIndicators.tsx +++ b/src/components/ModuleResourceIndicators.tsx @@ -19,6 +19,7 @@ export function ModuleResourceIndicators({ id, usbLayout }: { id: string; usbLay

{previewCpu ? 'DSP / memory · ' : ''}v{document.version} · {document.resources.recorded}

{previewCpu && usbLayout &&

The USB 0.2 candidate preview for {usbAudioLayout(usbLayout).name} estimates relative CPU demand from the upstream USB hook. Timing on hardware for this exact build remains unmeasured.

}

Minimal → Low → Moderate → High shows relative demand where a numeric record is unavailable. Load varies with configuration, settings and active tracks.

+

The DSP load arc shows how much core load changed. A dotted arc frames a count in bytes or cycles.

{!previewCpu &&

{document.resources.impact?.conditions}

}
{indicators.map(indicator => { const href = indicator.sourceInModwerk ? repository + indicator.source : resourceSource(id, indicator.source) diff --git a/src/components/ModuleResourceSummary.tsx b/src/components/ModuleResourceSummary.tsx index 46602c1590..be15732bd2 100644 --- a/src/components/ModuleResourceSummary.tsx +++ b/src/components/ModuleResourceSummary.tsx @@ -10,24 +10,29 @@ export function ModuleResourceSummary({ heading = 'Estimated load', indicators, return
diff --git a/src/community/InstallActivityChart.tsx b/src/community/InstallActivityChart.tsx new file mode 100644 index 0000000000..d7af4a701d --- /dev/null +++ b/src/community/InstallActivityChart.tsx @@ -0,0 +1,45 @@ +import { useState } from 'react' +import { installSeries, type installActivityDays } from './install-activity' + +const changeDay = '2026-11-12' +const dateLabel = (day: string) => new Date(day+'T00:00:00Z').toLocaleDateString(undefined, { month: 'short', day: 'numeric', timeZone: 'UTC' }) + +export function InstallActivityChart({ days }: { days: ReturnType }) { + const [selection, setSelection] = useState('') + const selected = days.find(row => row.day === selection) ?? days.at(-1) + if (!selected) return null + const max = Math.max(1, ...days.map(row => row.total ?? 0)) + const changeVisible = days.some(row => row.day === changeDay) + const describe = (row: typeof selected) => row.day + ' · ' + (row.total === null ? 'No counts available' : row.total + ' recorded actions') + + (row.total !== null && row.incomplete ? ' · partial coverage' : '') + const breakdown = (row: typeof selected) => installSeries.map(([,label], i) => label + ': ' + (row.values[i] ?? 'unavailable')).join(', ') + return
+
Firmware and module activity
+

Recorded actions per UTC day · scale 0–{max}

+
+ {days.map((row, index) => )} +
+
{dateLabel(days[0].day)}{dateLabel(days.at(-1)!.day)} · partial
+
+

{describe(selected)}

+
    {installSeries.map(([key,label], i) => +