fractal-midi 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE +200 -0
  2. package/NOTICE +28 -0
  3. package/README.md +147 -0
  4. package/dist/am4/applicability.d.ts +61 -0
  5. package/dist/am4/applicability.d.ts.map +1 -0
  6. package/dist/am4/applicability.js +285 -0
  7. package/dist/am4/blockTypes.d.ts +43 -0
  8. package/dist/am4/blockTypes.d.ts.map +1 -0
  9. package/dist/am4/blockTypes.js +48 -0
  10. package/dist/am4/cacheEnums.d.ts +46 -0
  11. package/dist/am4/cacheEnums.d.ts.map +1 -0
  12. package/dist/am4/cacheEnums.js +734 -0
  13. package/dist/am4/cacheParams.d.ts +3533 -0
  14. package/dist/am4/cacheParams.d.ts.map +1 -0
  15. package/dist/am4/cacheParams.js +1996 -0
  16. package/dist/am4/editorControlLabels.d.ts +45 -0
  17. package/dist/am4/editorControlLabels.d.ts.map +1 -0
  18. package/dist/am4/editorControlLabels.js +15894 -0
  19. package/dist/am4/index.d.ts +28 -0
  20. package/dist/am4/index.d.ts.map +1 -0
  21. package/dist/am4/index.js +31 -0
  22. package/dist/am4/ir/preset.d.ts +24 -0
  23. package/dist/am4/ir/preset.d.ts.map +1 -0
  24. package/dist/am4/ir/preset.js +12 -0
  25. package/dist/am4/ir/transpile.d.ts +9 -0
  26. package/dist/am4/ir/transpile.d.ts.map +1 -0
  27. package/dist/am4/ir/transpile.js +19 -0
  28. package/dist/am4/locations.d.ts +32 -0
  29. package/dist/am4/locations.d.ts.map +1 -0
  30. package/dist/am4/locations.js +58 -0
  31. package/dist/am4/paramNames.d.ts +55 -0
  32. package/dist/am4/paramNames.d.ts.map +1 -0
  33. package/dist/am4/paramNames.js +863 -0
  34. package/dist/am4/paramNamesGenerated.d.ts +41 -0
  35. package/dist/am4/paramNamesGenerated.d.ts.map +1 -0
  36. package/dist/am4/paramNamesGenerated.js +183 -0
  37. package/dist/am4/parameterBridge.d.ts +46 -0
  38. package/dist/am4/parameterBridge.d.ts.map +1 -0
  39. package/dist/am4/parameterBridge.js +300 -0
  40. package/dist/am4/params.d.ts +9577 -0
  41. package/dist/am4/params.d.ts.map +1 -0
  42. package/dist/am4/params.js +4537 -0
  43. package/dist/am4/setParam.d.ts +414 -0
  44. package/dist/am4/setParam.d.ts.map +1 -0
  45. package/dist/am4/setParam.js +819 -0
  46. package/dist/am4/shared/paramHelpers.d.ts +55 -0
  47. package/dist/am4/shared/paramHelpers.d.ts.map +1 -0
  48. package/dist/am4/shared/paramHelpers.js +146 -0
  49. package/dist/am4/symbolicIds.d.ts +11 -0
  50. package/dist/am4/symbolicIds.d.ts.map +1 -0
  51. package/dist/am4/symbolicIds.js +587 -0
  52. package/dist/am4/typeApplicability.d.ts +39 -0
  53. package/dist/am4/typeApplicability.d.ts.map +1 -0
  54. package/dist/am4/typeApplicability.js +466 -0
  55. package/dist/am4/variantResolverTables.d.ts +51 -0
  56. package/dist/am4/variantResolverTables.d.ts.map +1 -0
  57. package/dist/am4/variantResolverTables.js +3128 -0
  58. package/dist/axe-fx-ii/blockTypes.d.ts +45 -0
  59. package/dist/axe-fx-ii/blockTypes.d.ts.map +1 -0
  60. package/dist/axe-fx-ii/blockTypes.js +116 -0
  61. package/dist/axe-fx-ii/index.d.ts +5 -0
  62. package/dist/axe-fx-ii/index.d.ts.map +1 -0
  63. package/dist/axe-fx-ii/index.js +18 -0
  64. package/dist/axe-fx-ii/paramAliases.d.ts +54 -0
  65. package/dist/axe-fx-ii/paramAliases.d.ts.map +1 -0
  66. package/dist/axe-fx-ii/paramAliases.js +146 -0
  67. package/dist/axe-fx-ii/params.d.ts +11502 -0
  68. package/dist/axe-fx-ii/params.d.ts.map +1 -0
  69. package/dist/axe-fx-ii/params.js +2847 -0
  70. package/dist/axe-fx-ii/setParam.d.ts +560 -0
  71. package/dist/axe-fx-ii/setParam.d.ts.map +1 -0
  72. package/dist/axe-fx-ii/setParam.js +888 -0
  73. package/dist/axe-fx-iii/blockTypes.d.ts +87 -0
  74. package/dist/axe-fx-iii/blockTypes.d.ts.map +1 -0
  75. package/dist/axe-fx-iii/blockTypes.js +156 -0
  76. package/dist/axe-fx-iii/enumOverlay.d.ts +73 -0
  77. package/dist/axe-fx-iii/enumOverlay.d.ts.map +1 -0
  78. package/dist/axe-fx-iii/enumOverlay.js +236 -0
  79. package/dist/axe-fx-iii/index.d.ts +9 -0
  80. package/dist/axe-fx-iii/index.d.ts.map +1 -0
  81. package/dist/axe-fx-iii/index.js +20 -0
  82. package/dist/axe-fx-iii/params.d.ts +179 -0
  83. package/dist/axe-fx-iii/params.d.ts.map +1 -0
  84. package/dist/axe-fx-iii/params.js +6913 -0
  85. package/dist/axe-fx-iii/setParam.d.ts +460 -0
  86. package/dist/axe-fx-iii/setParam.d.ts.map +1 -0
  87. package/dist/axe-fx-iii/setParam.js +910 -0
  88. package/dist/index.d.ts +2 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/index.js +12 -0
  91. package/dist/shared/checksum.d.ts +10 -0
  92. package/dist/shared/checksum.d.ts.map +1 -0
  93. package/dist/shared/checksum.js +14 -0
  94. package/dist/shared/device.d.ts +195 -0
  95. package/dist/shared/device.d.ts.map +1 -0
  96. package/dist/shared/device.js +27 -0
  97. package/dist/shared/index.d.ts +8 -0
  98. package/dist/shared/index.d.ts.map +1 -0
  99. package/dist/shared/index.js +11 -0
  100. package/dist/shared/lineage/amp-lineage.json +8313 -0
  101. package/dist/shared/lineage/axefx2-amp-lineage.json +5871 -0
  102. package/dist/shared/lineage/axefx2-delay-lineage.json +226 -0
  103. package/dist/shared/lineage/axefx2-drive-lineage.json +575 -0
  104. package/dist/shared/lineage/axefx2-reverb-lineage.json +467 -0
  105. package/dist/shared/lineage/cab-lineage.json +10777 -0
  106. package/dist/shared/lineage/chorus-lineage.json +173 -0
  107. package/dist/shared/lineage/compressor-lineage.json +338 -0
  108. package/dist/shared/lineage/delay-lineage.json +313 -0
  109. package/dist/shared/lineage/drive-lineage.json +1844 -0
  110. package/dist/shared/lineage/flanger-lineage.json +313 -0
  111. package/dist/shared/lineage/phaser-lineage.json +208 -0
  112. package/dist/shared/lineage/reverb-lineage.json +793 -0
  113. package/dist/shared/lineage/wah-lineage.json +117 -0
  114. package/dist/shared/lineageLookup.d.ts +69 -0
  115. package/dist/shared/lineageLookup.d.ts.map +1 -0
  116. package/dist/shared/lineageLookup.js +196 -0
  117. package/dist/shared/packValue.d.ts +40 -0
  118. package/dist/shared/packValue.d.ts.map +1 -0
  119. package/dist/shared/packValue.js +105 -0
  120. package/dist/shared/types.d.ts +23 -0
  121. package/dist/shared/types.d.ts.map +1 -0
  122. package/dist/shared/types.js +9 -0
  123. package/package.json +75 -0
@@ -0,0 +1,460 @@
1
+ /** Axe-Fx III model byte. From Fractal's published spec. */
2
+ export declare const AXE_FX_III_MODEL_ID = 16;
3
+ export declare const FN_SET_GET_BYPASS = 10;
4
+ export declare const FN_SET_GET_CHANNEL = 11;
5
+ export declare const FN_SET_GET_SCENE = 12;
6
+ export declare const FN_QUERY_PATCH_NAME = 13;
7
+ export declare const FN_QUERY_SCENE_NAME = 14;
8
+ export declare const FN_SET_GET_LOOPER = 15;
9
+ export declare const FN_TEMPO_TAP = 16;
10
+ export declare const FN_TUNER_ON_OFF = 17;
11
+ export declare const FN_STATUS_DUMP = 19;
12
+ export declare const FN_SET_GET_TEMPO = 20;
13
+ /**
14
+ * 0x64 MULTIPURPOSE_RESPONSE — the III's error channel.
15
+ *
16
+ * When the III receives a malformed SysEx or an unsupported function it
17
+ * replies with:
18
+ *
19
+ * `F0 00 01 74 10 64 [echoed_fn] [result_code] [cs] F7` (10 bytes)
20
+ *
21
+ * `echoed_fn` is the function byte the host sent that the device
22
+ * rejected; `result_code` is the device's reason byte (0x00 has been
23
+ * seen for "general / checksum error", 0x05 has been seen for "NACK"
24
+ * during preset-store experiments). Wire shape is documented in v1.4
25
+ * and confirmed against a 2018 community capture — see
26
+ * `docs/axefx3-fn01-decode.md`.
27
+ */
28
+ export declare const FN_MULTIPURPOSE_RESPONSE = 100;
29
+ /**
30
+ * 0x01 PARAMETER_SETGET — III parameter-write opcode (NOT the II's
31
+ * 0x02 opcode). **Not in the v1.4 III spec** (Fractal deliberately
32
+ * omits parameter writes), but the wire shape is byte-verified
33
+ * against 10 community-captured frames spanning two effect blocks
34
+ * and two sub-action codes — see `docs/axefx3-set-parameter-captures.md`.
35
+ *
36
+ * Evidence chain (Session 97 pivot, 2026-05-18):
37
+ * • FC-12 footswitch captures (4 frames, Session 79 era): Drive 1/2
38
+ * boost ON/OFF. Effect IDs 58/59 (`ID_DISTORT1` / `ID_DISTORT2`),
39
+ * paramId 40, sub-action `52 00` (mouse-drag). Already decoded
40
+ * into the field-layout table in `docs/axefx3-fn01-decode.md`.
41
+ * • Mountain Utilities forum captures (6 frames, gabbernutter
42
+ * 2019-03-13): AxeEdit III writing Delay 1 TIME. Effect ID 70
43
+ * (`ID_DELAY1`), paramId 2. Four frames sub-action `52 00`
44
+ * (mouse-drag, intermediate values mid-drag) + two frames
45
+ * sub-action `09 00` (typed-input, final value). All 10 frames
46
+ * are 23 bytes, checksums validate, fields decode cleanly.
47
+ * • Session 82 Ghidra mining: opcode 0x01 appears in the III
48
+ * message-builder caller list — firmware code path is present.
49
+ *
50
+ * Earlier sessions (85+86) shipped `FN_SET_PARAMETER = 0x02` as a
51
+ * II→III model-byte-swap port. That was WRONG — the III uses fn=0x01
52
+ * with a 2-byte sub-action discriminator, NOT fn=0x02. Session 97
53
+ * reverted to the byte-verified envelope.
54
+ *
55
+ * Sub-actions seen on the wire:
56
+ * • `09 00` — typed-input SET (clean envelope, drag-context bytes
57
+ * zero). This is what we ship for `buildSetParameter`.
58
+ * • `52 00` — mouse-drag SET (drag-context bytes at pos 12-14
59
+ * carry cursor delta). Identical semantically; we don't emit
60
+ * this shape — the device accepts either.
61
+ * • `04 01` — STATE_BROADCAST (device→host, unsolicited state
62
+ * stream emitted on parameter change). NOT a sync SET response
63
+ * — the III appears to have no documented synchronous response
64
+ * to fn=0x01 SET.
65
+ *
66
+ * Status: 🟢 SET verified against 10 public captures, ready to ship.
67
+ * GET shape still 🟡 — no captured GET frames exist on the open web
68
+ * as of Session 97; the implementation uses `09 00` with value=0 as
69
+ * a hypothesis, matching the SET shape with an empty value field.
70
+ */
71
+ export declare const FN_PARAMETER_SETGET = 1;
72
+ /** Query sentinel — when this is the value byte, the device responds with current state. */
73
+ export declare const QUERY_SENTINEL = 127;
74
+ /**
75
+ * Pack a 16-bit unsigned value into the wire's three 7-bit septets.
76
+ *
77
+ * septet 0 = bits 6..0 (lowest seven bits)
78
+ * septet 1 = bits 13..7 (next seven bits)
79
+ * septet 2 = bits 15..14 (top two bits, zero-padded into a 7-bit byte)
80
+ *
81
+ * Valid input range 0..65534 (16-bit minus one — II wiki convention,
82
+ * carried forward to the III on the assumption param-value ranges
83
+ * scaled with firmware). All observed III captures use 14-bit values
84
+ * (pos 17 always zero); the 16-bit slot exists in the envelope shape
85
+ * but isn't exercised by any public capture yet.
86
+ */
87
+ export declare function packValue16(value: number): [number, number, number];
88
+ /** Inverse of `packValue16`. Inputs may have unused upper bits — masked. */
89
+ export declare function unpackValue16(b0: number, b1: number, b2: number): number;
90
+ /**
91
+ * SET PARAMETER (function 0x01, sub-action 0x09 0x00 — typed input).
92
+ *
93
+ * `F0 00 01 74 10 01 09 00 [id_lo id_hi] [pid_lo pid_hi]
94
+ * 00 00 00 [v0 v1 v2] 00 00 00 [cs] F7`
95
+ *
96
+ * 23 bytes. Byte-verified against the typed-input gabbernutter
97
+ * captures (Mountain Utilities forum, 2019). The mouse-drag form
98
+ * (sub-action `52 00`) carries non-zero context at pos 12-14 — the
99
+ * device accepts either, but typed-input is the clean shape
100
+ * appropriate for programmatic writes.
101
+ *
102
+ * 🟢 Outbound wire shape verified across 10 public captures spanning
103
+ * two effect blocks (Drive 1/2, Delay 1) and two paramIds (40 boost,
104
+ * 2 TIME). The device's RESPONSE shape (sync echo or async
105
+ * STATE_BROADCAST `04 01`) is not in any public capture — wrap with
106
+ * `sendAndWatchForError` to surface 0x64 rejects, but don't expect a
107
+ * synchronous SET echo.
108
+ */
109
+ export declare function buildSetParameter(effectId: number, paramId: number, value: number): number[];
110
+ /**
111
+ * GET PARAMETER (function 0x01, sub-action 0x09 0x00 with value=0).
112
+ *
113
+ * 🟡 Hypothesis only — no public GET capture exists. The send shape
114
+ * mirrors SET with the value field zeroed, on the theory that the III
115
+ * either echoes the param's current value or emits a `04 01`
116
+ * STATE_BROADCAST asynchronously. Callers should treat a missing
117
+ * response within ~250 ms as "GET not supported on this firmware,"
118
+ * not as a tool error, and fall back to 0x13 STATUS_DUMP or
119
+ * STATE_BROADCAST listening.
120
+ */
121
+ export declare function buildGetParameter(effectId: number, paramId: number): number[];
122
+ /**
123
+ * Block-bypass via PARAMETER_SETGET (paramId 255 is the bypass
124
+ * register per Axe-Fx II wiki — III binding unverified). The III
125
+ * v1.4 spec exposes a separate 0x0A SET_BYPASS opcode — prefer that
126
+ * one for production bypass writes. This builder exists as a
127
+ * fallback for the 0x02-port era and is kept compatible with the
128
+ * pivoted fn=0x01 envelope.
129
+ *
130
+ * 🟡 III-untested specifically for paramId=255 binding.
131
+ */
132
+ export declare function buildSetParameterBypass(effectId: number, bypassed: boolean): number[];
133
+ /**
134
+ * Predicate: is this an inbound fn=0x01 PARAMETER frame? Accepts any
135
+ * sub-action — `52 00` (echo of host SET, observed in passive sniffs),
136
+ * `04 01` (STATE_BROADCAST), or `09 00` (theoretically a host
137
+ * typed-input echo). The parser disambiguates by sub-action.
138
+ */
139
+ export declare function isSetGetParameterResponse(bytes: readonly number[]): boolean;
140
+ /**
141
+ * Discriminator for `parseSetGetParameterResponse` results so callers can
142
+ * branch on the sub-action without re-reading the sub-action bytes.
143
+ *
144
+ * - `'set_echo'` — sub-action `09 00` or `52 00`. Both `paramId` and
145
+ * `value` are populated. Round-trip self-consistent with
146
+ * `buildSetParameter`.
147
+ * - `'state_broadcast'` — sub-action `04 01`. `paramId` is reported as
148
+ * `0` because the wire frame omits the field; track the last-SET
149
+ * paramId in the caller and attribute the broadcast value to it.
150
+ */
151
+ export type AxeFxIIIParameterFrameKind = 'set_echo' | 'state_broadcast';
152
+ /**
153
+ * Parse an inbound fn=0x01 PARAMETER frame. Returns
154
+ * `{ kind, effectId, paramId, value, subAction }`.
155
+ *
156
+ * Two response shapes seen in captures:
157
+ * • Sub-action `52 00` (23 bytes): host-SET echo. effId at pos 2-3
158
+ * of payload, paramId at 4-5, value at 9-11 (packValue16). Round-
159
+ * trip self-consistent with `buildSetParameter`.
160
+ * • Sub-action `04 01` (23 bytes): STATE_BROADCAST. effId at
161
+ * pos 2-3, paramId field is zero (the broadcast doesn't carry
162
+ * it), value at 6-7 as a 2-septet LS-first pair.
163
+ *
164
+ * For `04 01` STATE_BROADCAST frames we return `paramId: 0` to
165
+ * signal the caller that paramId is unknown — they should track
166
+ * which param was last SET to attribute the broadcast value.
167
+ *
168
+ * For consumers that prefer an explicit broadcast handler, see
169
+ * `parseStateBroadcast`, which throws on non-broadcast frames.
170
+ */
171
+ export declare function parseSetGetParameterResponse(bytes: readonly number[]): {
172
+ kind: AxeFxIIIParameterFrameKind;
173
+ effectId: number;
174
+ paramId: number;
175
+ value: number;
176
+ subAction: number;
177
+ };
178
+ /**
179
+ * Parse the async `04 01` STATE_BROADCAST sub-action specifically.
180
+ * Throws on any other sub-action.
181
+ *
182
+ * Use this when listening for the III's unsolicited state-change push
183
+ * (the closest thing the III has to a GET response — the device emits
184
+ * a broadcast whenever a parameter changes, whether the change was
185
+ * driven by the host, by the front panel, or by another editor).
186
+ *
187
+ * Caller must track which paramId was last SET on this effectId to
188
+ * attribute the broadcast value — the broadcast frame does NOT echo
189
+ * the paramId.
190
+ */
191
+ export declare function parseStateBroadcast(bytes: readonly number[]): {
192
+ effectId: number;
193
+ value: number;
194
+ };
195
+ /**
196
+ * SET_GRID_CELL (function 0x05). Places `blockId` at cell (row, col).
197
+ *
198
+ * `F0 00 01 74 10 05 [blockId_lo blockId_hi] [cell_idx] [0x00] [cs] F7`
199
+ *
200
+ * cell_idx = (col - 1) * rows + (row - 1) — column-major. The II uses
201
+ * 4-row grids so cell_idx = (col-1)*4 + (row-1). The III runs a 4×14
202
+ * grid in Mark II firmware; the cell index shape is the same.
203
+ *
204
+ * 🟡 III-untested. The 8-byte payload was rejected by II firmware as
205
+ * "payload too short" — the II's encoder always sends 4 payload bytes
206
+ * (blockId_lo, blockId_hi, cell_idx, reserved=0). We mirror that.
207
+ */
208
+ export declare function buildSetGridCell(opts: {
209
+ row: number;
210
+ col: number;
211
+ blockId: number;
212
+ }): number[];
213
+ /**
214
+ * SET_PRESET_NAME (function 0x09) — set the working-buffer preset name.
215
+ * Name is padded to 32 ASCII-printable chars (space-padded). The II
216
+ * uses this for the working buffer only; pairing with 0x1D STORE_PRESET
217
+ * is what persists the rename to flash.
218
+ *
219
+ * 🟡 III-untested.
220
+ */
221
+ export declare function buildSetPresetName(name: string): number[];
222
+ /** STORE_PRESET (function 0x1D). 🟡 III-untested. */
223
+ export declare function buildStorePreset(presetNumber: number): number[];
224
+ /**
225
+ * Build the short-MIDI byte sequence to switch the III to preset
226
+ * `presetNumber` (0..1023). Returns 9 bytes:
227
+ *
228
+ * `B0 00 bankMsb` (Control Change 0 = Bank Select MSB)
229
+ * `B0 20 bankLsb` (Control Change 32 = Bank Select LSB)
230
+ * `C0 programNumber` (Program Change on channel 1)
231
+ *
232
+ * Default MIDI channel is 1 (0x0 in the channel nibble). The III
233
+ * listens on its globally-configured MIDI channel — users with a
234
+ * non-default channel will need to call `axefx3_switch_preset` with
235
+ * a `channel` arg (1..16) on a future iteration. For now we default
236
+ * to channel 1, which matches Fractal's factory setting.
237
+ *
238
+ * Per the III v1.4 PDF: 1024 presets are addressed across 8 banks of
239
+ * 128 each. presetNumber 0..127 = bank 0 PC 0..127, presetNumber
240
+ * 128..255 = bank 1 PC 0..127, etc. CC0 carries the bank's MSB and
241
+ * CC32 carries the LSB; both are 7-bit values, so bank = (CC0 << 7)
242
+ * | CC32. The III ignores CC0 when bank fits in CC32 (just CC32 + PC
243
+ * is sufficient for presets 0..16383), but spec-correct usage sends
244
+ * both — we do.
245
+ */
246
+ export declare function buildSwitchPresetPC(presetNumber: number, channel?: number): number[];
247
+ /**
248
+ * SET BYPASS (function 0x0A). Targets the active scene only — per
249
+ * spec the III's bypass writes don't carry a scene argument.
250
+ *
251
+ * `F0 00 01 74 10 0A [id_lo] [id_hi] [dd] [cs] F7`
252
+ *
253
+ * `dd=0` engaged, `dd=1` bypassed.
254
+ */
255
+ export declare function buildSetBypass(effectId: number, bypassed: boolean): number[];
256
+ /** GET BYPASS (function 0x0A with `dd=0x7F`). Device responds with same envelope shape. */
257
+ export declare function buildGetBypass(effectId: number): number[];
258
+ /**
259
+ * SET CHANNEL (function 0x0B). Targets the active scene only.
260
+ * `channel` is 0..3 mapping to A..D.
261
+ *
262
+ * `F0 00 01 74 10 0B [id_lo] [id_hi] [channel] [cs] F7`
263
+ */
264
+ export declare function buildSetChannel(effectId: number, channel: 0 | 1 | 2 | 3): number[];
265
+ /** GET CHANNEL (function 0x0B with `dd=0x7F`). */
266
+ export declare function buildGetChannel(effectId: number): number[];
267
+ /**
268
+ * SET SCENE (function 0x0C). `sceneIndex` is 0..7. Spec also says
269
+ * "Returns: ... where dd is the current scene" — so SET also echoes.
270
+ */
271
+ export declare function buildSetScene(sceneIndex: number): number[];
272
+ /** GET SCENE (function 0x0C with `dd=0x7F`). */
273
+ export declare function buildGetScene(): number[];
274
+ /**
275
+ * QUERY PATCH NAME (function 0x0D).
276
+ *
277
+ * Request: `F0 00 01 74 10 0D [dd dd preset#] [cs] F7`
278
+ * Current: `F0 00 01 74 10 0D 7F 7F [cs] F7`
279
+ * Response: `F0 00 01 74 10 0D [nn nn preset#] [dd*32 name] [cs] F7`
280
+ *
281
+ * Pass a preset number 0..1023 (Mark II) / 0..511 (Mark I) to look
282
+ * up that preset's name, or `'current'` to query the active preset.
283
+ * Response contains BOTH the preset number AND the name — there's no
284
+ * separate "get preset number" function in the v1.4 spec.
285
+ *
286
+ * NB: this is NOT a preset-switching command. To CHANGE the active
287
+ * preset on the III via MIDI, use standard Program Change messages
288
+ * (with CC 0 + CC 32 Bank Select for slots > 127). The III has no
289
+ * SysEx preset-switch in the v1.4 public spec.
290
+ */
291
+ export declare function buildQueryPatchName(presetNumber: number | 'current'): number[];
292
+ /**
293
+ * QUERY SCENE NAME (function 0x0E).
294
+ *
295
+ * Request: `F0 00 01 74 10 0E [dd scene] [cs] F7`
296
+ * Current: `F0 00 01 74 10 0E 7F [cs] F7`
297
+ * Response: `F0 00 01 74 10 0E [nn scene] [dd*32 name] [cs] F7`
298
+ *
299
+ * No SET variant in the spec.
300
+ */
301
+ export declare function buildQuerySceneName(sceneIndex: number | 'current'): number[];
302
+ export type LooperAction = 'record' | 'play' | 'undo' | 'once' | 'reverse' | 'half_speed';
303
+ /**
304
+ * SET LOOPER (function 0x0F). Triggers a looper "button press":
305
+ *
306
+ * `F0 00 01 74 10 0F [dd button] [cs] F7`
307
+ *
308
+ * Buttons per spec: 0=Record, 1=Play, 2=Undo, 3=Once, 4=Reverse,
309
+ * 5=Half-speed.
310
+ */
311
+ export declare function buildSetLooper(action: LooperAction): number[];
312
+ /**
313
+ * GET LOOPER STATE (function 0x0F with `dd=0x7F`). Returns a state
314
+ * bitfield: bit 0=Record, 1=Play, 2=Overdub, 3=Once, 4=Reverse,
315
+ * 5=Half-speed.
316
+ */
317
+ export declare function buildGetLooperState(): number[];
318
+ /**
319
+ * TEMPO TAP (function 0x10). Single-shot, no payload. Each call
320
+ * counts as one tap-tempo press; the III computes BPM from the
321
+ * inter-tap interval the same way as the front-panel TAP button.
322
+ */
323
+ export declare function buildTempoTap(): number[];
324
+ /** TUNER ON/OFF (function 0x11). */
325
+ export declare function buildSetTuner(on: boolean): number[];
326
+ /**
327
+ * STATUS DUMP (function 0x13). One-shot snapshot of the current
328
+ * scene's state across all effect blocks in the preset. Response is
329
+ * a sequence of `id id dd` triples — see `parseStatusDumpResponse`.
330
+ */
331
+ export declare function buildStatusDump(): number[];
332
+ /**
333
+ * SET TEMPO (function 0x14). BPM as a 14-bit value (LS-first septet
334
+ * pair). Range per spec is implicitly 0..16383; in practice the III
335
+ * accepts ~30..250 BPM (front-panel range).
336
+ */
337
+ export declare function buildSetTempo(bpm: number): number[];
338
+ /** GET TEMPO (function 0x14 with `dd dd = 7F 7F`). */
339
+ export declare function buildGetTempo(): number[];
340
+ export declare function isSetGetBypassResponse(bytes: readonly number[]): boolean;
341
+ export declare function isSetGetChannelResponse(bytes: readonly number[]): boolean;
342
+ export declare function isSetGetSceneResponse(bytes: readonly number[]): boolean;
343
+ export declare function isQueryPatchNameResponse(bytes: readonly number[]): boolean;
344
+ export declare function isQuerySceneNameResponse(bytes: readonly number[]): boolean;
345
+ export declare function isSetGetLooperResponse(bytes: readonly number[]): boolean;
346
+ export declare function isStatusDumpResponse(bytes: readonly number[]): boolean;
347
+ export declare function isSetGetTempoResponse(bytes: readonly number[]): boolean;
348
+ export declare function isMultipurposeResponse(bytes: readonly number[]): boolean;
349
+ /**
350
+ * Parse a 0x0A SET/GET BYPASS response. Payload is `[id_lo, id_hi, dd]`.
351
+ */
352
+ export declare function parseBypassResponse(bytes: readonly number[]): {
353
+ effectId: number;
354
+ bypassed: boolean;
355
+ };
356
+ /** Parse a 0x0B SET/GET CHANNEL response. */
357
+ export declare function parseChannelResponse(bytes: readonly number[]): {
358
+ effectId: number;
359
+ channel: number;
360
+ };
361
+ /** Parse a 0x0C SET/GET SCENE response. Payload is `[scene]`. */
362
+ export declare function parseSceneResponse(bytes: readonly number[]): {
363
+ scene: number;
364
+ };
365
+ /**
366
+ * Parse a 0x0D QUERY PATCH NAME response.
367
+ *
368
+ * `F0 00 01 74 10 0D [nn nn preset#] [dd*32 name] [cs] F7`
369
+ *
370
+ * Returns both the preset number AND the 32-char name (trimmed).
371
+ */
372
+ export declare function parseQueryPatchNameResponse(bytes: readonly number[]): {
373
+ presetNumber: number;
374
+ name: string;
375
+ };
376
+ /**
377
+ * Parse a 0x0E QUERY SCENE NAME response.
378
+ *
379
+ * `F0 00 01 74 10 0E [nn scene] [dd*32 name] [cs] F7`
380
+ */
381
+ export declare function parseQuerySceneNameResponse(bytes: readonly number[]): {
382
+ scene: number;
383
+ name: string;
384
+ };
385
+ /**
386
+ * Parse a 0x0F SET/GET LOOPER STATE response. dd is a bitfield:
387
+ * bit0=Record, 1=Play, 2=Overdub, 3=Once, 4=Reverse, 5=Half-speed.
388
+ */
389
+ export interface LooperState {
390
+ recording: boolean;
391
+ playing: boolean;
392
+ overdubbing: boolean;
393
+ once: boolean;
394
+ reverse: boolean;
395
+ halfSpeed: boolean;
396
+ raw: number;
397
+ }
398
+ export declare function parseLooperStateResponse(bytes: readonly number[]): LooperState;
399
+ /** Parse a 0x14 SET/GET TEMPO response. Payload is the BPM as a septet pair. */
400
+ export declare function parseTempoResponse(bytes: readonly number[]): {
401
+ bpm: number;
402
+ };
403
+ /**
404
+ * Parse a 0x64 MULTIPURPOSE_RESPONSE frame. Payload is `[echoed_fn, result_code]`.
405
+ *
406
+ * `F0 00 01 74 10 64 [echoed_fn] [result_code] [cs] F7`
407
+ *
408
+ * Known `result_code` meanings (incomplete — Fractal doesn't publish a
409
+ * full table):
410
+ * - `0x00` — general / checksum error
411
+ * - `0x05` — NACK (seen during preset-store experiments)
412
+ *
413
+ * Anything else surfaces as the raw byte. Callers convert this to a
414
+ * warning string in their tool response.
415
+ */
416
+ export declare function parseMultipurposeResponse(bytes: readonly number[]): {
417
+ echoedFn: number;
418
+ resultCode: number;
419
+ };
420
+ /**
421
+ * Human-readable label for a known `result_code` byte. Returns
422
+ * `undefined` for codes not yet documented; callers fall back to the
423
+ * raw hex value.
424
+ *
425
+ * Source: AxeEdit III 1.14.31 release binary contains a contiguous
426
+ * 8-byte-aligned `MIDI_ERROR_*` string table at `.rdata` offset
427
+ * 0x597108 onward. Entries are accessed by result_code as index.
428
+ * Index 0 = `MIDI_ERROR_BAD_CHKSUM` matches the empirically-verified
429
+ * 0x64 frame whose host-side trigger was a malformed checksum, so the
430
+ * index → result_code mapping is high-confidence. Codes 0x00..0x1B
431
+ * are populated; anything ≥ 0x1C returns undefined.
432
+ *
433
+ * See `docs/axefx3-fn01-decode.md` "0x64 result codes" for the full
434
+ * decode + index-table evidence.
435
+ */
436
+ export declare function describeMultipurposeResultCode(code: number): string | undefined;
437
+ /**
438
+ * One block's row in a STATUS_DUMP response.
439
+ *
440
+ * Per v1.4 PDF: `dd` bit 0 = bypass, bits 3:1 = channel (0..7; current
441
+ * max is 3), bits 6:4 = number of channels supported (0..7).
442
+ */
443
+ export interface StatusDumpEntry {
444
+ /** 14-bit effect ID per v1.4 PDF Appendix 1. */
445
+ effectId: number;
446
+ /** True if the block is bypassed in the active scene. */
447
+ bypassed: boolean;
448
+ /** Current channel index (0..7). Most blocks expose 2 or 4 channels. */
449
+ channel: number;
450
+ /** Number of channels this block supports (0..7). */
451
+ channelCount: number;
452
+ }
453
+ /**
454
+ * Parse a 0x13 STATUS_DUMP response into a list of per-block entries.
455
+ *
456
+ * Wire shape per v1.4 PDF:
457
+ * `F0 00 01 74 10 13 [id id dd]* [cs] F7`
458
+ */
459
+ export declare function parseStatusDumpResponse(bytes: readonly number[]): StatusDumpEntry[];
460
+ //# sourceMappingURL=setParam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setParam.d.ts","sourceRoot":"","sources":["../../src/axe-fx-iii/setParam.ts"],"names":[],"mappings":"AAoCA,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,KAAO,CAAC;AASxC,eAAO,MAAM,iBAAiB,KAAO,CAAC;AACtC,eAAO,MAAM,kBAAkB,KAAO,CAAC;AACvC,eAAO,MAAM,gBAAgB,KAAO,CAAC;AACrC,eAAO,MAAM,mBAAmB,KAAO,CAAC;AACxC,eAAO,MAAM,mBAAmB,KAAO,CAAC;AACxC,eAA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