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.
- package/LICENSE +200 -0
- package/NOTICE +28 -0
- package/README.md +147 -0
- package/dist/am4/applicability.d.ts +61 -0
- package/dist/am4/applicability.d.ts.map +1 -0
- package/dist/am4/applicability.js +285 -0
- package/dist/am4/blockTypes.d.ts +43 -0
- package/dist/am4/blockTypes.d.ts.map +1 -0
- package/dist/am4/blockTypes.js +48 -0
- package/dist/am4/cacheEnums.d.ts +46 -0
- package/dist/am4/cacheEnums.d.ts.map +1 -0
- package/dist/am4/cacheEnums.js +734 -0
- package/dist/am4/cacheParams.d.ts +3533 -0
- package/dist/am4/cacheParams.d.ts.map +1 -0
- package/dist/am4/cacheParams.js +1996 -0
- package/dist/am4/editorControlLabels.d.ts +45 -0
- package/dist/am4/editorControlLabels.d.ts.map +1 -0
- package/dist/am4/editorControlLabels.js +15894 -0
- package/dist/am4/index.d.ts +28 -0
- package/dist/am4/index.d.ts.map +1 -0
- package/dist/am4/index.js +31 -0
- package/dist/am4/ir/preset.d.ts +24 -0
- package/dist/am4/ir/preset.d.ts.map +1 -0
- package/dist/am4/ir/preset.js +12 -0
- package/dist/am4/ir/transpile.d.ts +9 -0
- package/dist/am4/ir/transpile.d.ts.map +1 -0
- package/dist/am4/ir/transpile.js +19 -0
- package/dist/am4/locations.d.ts +32 -0
- package/dist/am4/locations.d.ts.map +1 -0
- package/dist/am4/locations.js +58 -0
- package/dist/am4/paramNames.d.ts +55 -0
- package/dist/am4/paramNames.d.ts.map +1 -0
- package/dist/am4/paramNames.js +863 -0
- package/dist/am4/paramNamesGenerated.d.ts +41 -0
- package/dist/am4/paramNamesGenerated.d.ts.map +1 -0
- package/dist/am4/paramNamesGenerated.js +183 -0
- package/dist/am4/parameterBridge.d.ts +46 -0
- package/dist/am4/parameterBridge.d.ts.map +1 -0
- package/dist/am4/parameterBridge.js +300 -0
- package/dist/am4/params.d.ts +9577 -0
- package/dist/am4/params.d.ts.map +1 -0
- package/dist/am4/params.js +4537 -0
- package/dist/am4/setParam.d.ts +414 -0
- package/dist/am4/setParam.d.ts.map +1 -0
- package/dist/am4/setParam.js +819 -0
- package/dist/am4/shared/paramHelpers.d.ts +55 -0
- package/dist/am4/shared/paramHelpers.d.ts.map +1 -0
- package/dist/am4/shared/paramHelpers.js +146 -0
- package/dist/am4/symbolicIds.d.ts +11 -0
- package/dist/am4/symbolicIds.d.ts.map +1 -0
- package/dist/am4/symbolicIds.js +587 -0
- package/dist/am4/typeApplicability.d.ts +39 -0
- package/dist/am4/typeApplicability.d.ts.map +1 -0
- package/dist/am4/typeApplicability.js +466 -0
- package/dist/am4/variantResolverTables.d.ts +51 -0
- package/dist/am4/variantResolverTables.d.ts.map +1 -0
- package/dist/am4/variantResolverTables.js +3128 -0
- package/dist/axe-fx-ii/blockTypes.d.ts +45 -0
- package/dist/axe-fx-ii/blockTypes.d.ts.map +1 -0
- package/dist/axe-fx-ii/blockTypes.js +116 -0
- package/dist/axe-fx-ii/index.d.ts +5 -0
- package/dist/axe-fx-ii/index.d.ts.map +1 -0
- package/dist/axe-fx-ii/index.js +18 -0
- package/dist/axe-fx-ii/paramAliases.d.ts +54 -0
- package/dist/axe-fx-ii/paramAliases.d.ts.map +1 -0
- package/dist/axe-fx-ii/paramAliases.js +146 -0
- package/dist/axe-fx-ii/params.d.ts +11502 -0
- package/dist/axe-fx-ii/params.d.ts.map +1 -0
- package/dist/axe-fx-ii/params.js +2847 -0
- package/dist/axe-fx-ii/setParam.d.ts +560 -0
- package/dist/axe-fx-ii/setParam.d.ts.map +1 -0
- package/dist/axe-fx-ii/setParam.js +888 -0
- package/dist/axe-fx-iii/blockTypes.d.ts +87 -0
- package/dist/axe-fx-iii/blockTypes.d.ts.map +1 -0
- package/dist/axe-fx-iii/blockTypes.js +156 -0
- package/dist/axe-fx-iii/enumOverlay.d.ts +73 -0
- package/dist/axe-fx-iii/enumOverlay.d.ts.map +1 -0
- package/dist/axe-fx-iii/enumOverlay.js +236 -0
- package/dist/axe-fx-iii/index.d.ts +9 -0
- package/dist/axe-fx-iii/index.d.ts.map +1 -0
- package/dist/axe-fx-iii/index.js +20 -0
- package/dist/axe-fx-iii/params.d.ts +179 -0
- package/dist/axe-fx-iii/params.d.ts.map +1 -0
- package/dist/axe-fx-iii/params.js +6913 -0
- package/dist/axe-fx-iii/setParam.d.ts +460 -0
- package/dist/axe-fx-iii/setParam.d.ts.map +1 -0
- package/dist/axe-fx-iii/setParam.js +910 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/shared/checksum.d.ts +10 -0
- package/dist/shared/checksum.d.ts.map +1 -0
- package/dist/shared/checksum.js +14 -0
- package/dist/shared/device.d.ts +195 -0
- package/dist/shared/device.d.ts.map +1 -0
- package/dist/shared/device.js +27 -0
- package/dist/shared/index.d.ts +8 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +11 -0
- package/dist/shared/lineage/amp-lineage.json +8313 -0
- package/dist/shared/lineage/axefx2-amp-lineage.json +5871 -0
- package/dist/shared/lineage/axefx2-delay-lineage.json +226 -0
- package/dist/shared/lineage/axefx2-drive-lineage.json +575 -0
- package/dist/shared/lineage/axefx2-reverb-lineage.json +467 -0
- package/dist/shared/lineage/cab-lineage.json +10777 -0
- package/dist/shared/lineage/chorus-lineage.json +173 -0
- package/dist/shared/lineage/compressor-lineage.json +338 -0
- package/dist/shared/lineage/delay-lineage.json +313 -0
- package/dist/shared/lineage/drive-lineage.json +1844 -0
- package/dist/shared/lineage/flanger-lineage.json +313 -0
- package/dist/shared/lineage/phaser-lineage.json +208 -0
- package/dist/shared/lineage/reverb-lineage.json +793 -0
- package/dist/shared/lineage/wah-lineage.json +117 -0
- package/dist/shared/lineageLookup.d.ts +69 -0
- package/dist/shared/lineageLookup.d.ts.map +1 -0
- package/dist/shared/lineageLookup.js +196 -0
- package/dist/shared/packValue.d.ts +40 -0
- package/dist/shared/packValue.d.ts.map +1 -0
- package/dist/shared/packValue.js +105 -0
- package/dist/shared/types.d.ts +23 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +9 -0
- package/package.json +75 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { KNOWN_PARAMS, PARAM_ALIASES, SCENE_MIDI_TYPE_ENUM, encode, decode, formatDisplay, formatUnitSuffix, resolveEnumValue, findEnumCandidates, } from './params.js';
|
|
2
|
+
export type { Param, ParamKey, Unit } from './params.js';
|
|
3
|
+
export { PARAM_NAMES, } from './paramNames.js';
|
|
4
|
+
export type { ParamNameEntry } from './paramNames.js';
|
|
5
|
+
export { GENERATED_PARAM_NAMES, GENERATED_PARAM_NAMES_FIRMWARE, } from './paramNamesGenerated.js';
|
|
6
|
+
export { BLOCK_TYPE_VALUES, BLOCK_NAMES_BY_VALUE, resolveBlockType, } from './blockTypes.js';
|
|
7
|
+
export type { BlockTypeName } from './blockTypes.js';
|
|
8
|
+
export { parseLocationCode, formatLocationCode, formatLocationDisplay, TOTAL_LOCATIONS, } from './locations.js';
|
|
9
|
+
export { AM4_MODEL_ID, buildSetFloatParam, buildSetParam, buildSetBlockType, buildSetBlockBypass, buildSetPresetName, buildSetSceneName, buildSwitchScene, buildSwitchPreset, buildSaveToLocation, buildGetPresetName, buildReadParam, buildRequestActiveBufferDump, isCommandAck, isWriteEcho, isReadResponse, isReadResponseLong, parseReadResponse, parseLongReadBypassFlag, parseGetPresetNameResponse, BLOCK_SLOT_PID_LOW, BLOCK_SLOT_PID_HIGH_BASE, READ_TYPE_LONG, LONG_READ_BYPASS_FLAG_BYTE, READ_VALUE_DENOMINATOR, PRESET_NAME_EMPTY_SENTINEL, } from './setParam.js';
|
|
10
|
+
export type { ParamId, ReadResponse, GetPresetNameResponse } from './setParam.js';
|
|
11
|
+
export { CACHE_PARAMS } from './cacheParams.js';
|
|
12
|
+
export type { CacheParamKey } from './cacheParams.js';
|
|
13
|
+
export { AMP_TYPES, DRIVE_TYPES, REVERB_TYPES, DELAY_TYPES, CHORUS_TYPES, FLANGER_TYPES, PHASER_TYPES, WAH_TYPES, COMPRESSOR_TYPES, GEQ_TYPES, FILTER_TYPES, TREMOLO_TYPES, ENHANCER_TYPES, GATE_TYPES, VOLPAN_MODES, TEMPO_DIVISIONS, LFO_WAVEFORMS, AMP_TYPES_VALUES, DRIVE_TYPES_VALUES, REVERB_TYPES_VALUES, DELAY_TYPES_VALUES, CHORUS_TYPES_VALUES, FLANGER_TYPES_VALUES, PHASER_TYPES_VALUES, WAH_TYPES_VALUES, COMPRESSOR_TYPES_VALUES, GEQ_TYPES_VALUES, FILTER_TYPES_VALUES, TREMOLO_TYPES_VALUES, ENHANCER_TYPES_VALUES, GATE_TYPES_VALUES, VOLPAN_MODES_VALUES, TEMPO_DIVISIONS_VALUES, LFO_WAVEFORMS_VALUES, } from './cacheEnums.js';
|
|
14
|
+
export { TYPE_APPLICABILITY, TYPE_APPLICABILITY_FIRMWARE, } from './typeApplicability.js';
|
|
15
|
+
export type { Applicability, ApplicabilityGate } from './typeApplicability.js';
|
|
16
|
+
export { getApplicability, describeApplicability, checkApplicability, findCompatibleTypes, } from './applicability.js';
|
|
17
|
+
export type { ActiveTypeContext, ApplicabilityCheck } from './applicability.js';
|
|
18
|
+
export { EDITOR_CONTROLS, EDITOR_CONTROL_FIRMWARE, EDITOR_CONTROL_PARAMETER_NAMES, resolveEditorControlLabel, } from './editorControlLabels.js';
|
|
19
|
+
export type { EditorControlContext, EditorControlEntry, } from './editorControlLabels.js';
|
|
20
|
+
export { SYMBOLIC_IDS_BY_BLOCK } from './symbolicIds.js';
|
|
21
|
+
export { PARAMETER_BRIDGE, PARAMETER_BRIDGE_FIRMWARE, resolveBridge, preferredDisplayLabel, } from './parameterBridge.js';
|
|
22
|
+
export type { ParameterBridgeEntry } from './parameterBridge.js';
|
|
23
|
+
export { VARIANT_RESOLVER_FIRMWARE, VARIANT_RESOLVER_BY_EFFECT_TYPE, VARIANT_RESOLVER_FALLBACK, PARAMETER_NAME_TO_CACHE_ID, UNIVERSAL_BLOCK_PARAMETERS, resolveCacheId, resolveAllCacheIds, } from './variantResolverTables.js';
|
|
24
|
+
export type { ResolverEntry } from './variantResolverTables.js';
|
|
25
|
+
export { transpile } from './ir/transpile.js';
|
|
26
|
+
export type { WorkingBufferIR } from './ir/preset.js';
|
|
27
|
+
export { DEFAULT_SCRATCH_LOCATION, EnumAmbiguityError, suggestParamName, paramKey, resolveValue, } from './shared/paramHelpers.js';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/am4/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Barrel for fractal-midi/am4.
|
|
2
|
+
//
|
|
3
|
+
// Public surface for AM4 data and codec. Sibling subpaths (`./shared`,
|
|
4
|
+
// future `./axe-fx-ii`, `./axe-fx-iii`) follow the same shape: param
|
|
5
|
+
// dictionary + block-type table + wire builders + parsers.
|
|
6
|
+
//
|
|
7
|
+
// Pure code — no MIDI transport dependency. Bring your own.
|
|
8
|
+
// Data — parameter dictionary, block-type table, location parsing.
|
|
9
|
+
export { KNOWN_PARAMS, PARAM_ALIASES, SCENE_MIDI_TYPE_ENUM, encode, decode, formatDisplay, formatUnitSuffix, resolveEnumValue, findEnumCandidates, } from './params.js';
|
|
10
|
+
export { PARAM_NAMES, } from './paramNames.js';
|
|
11
|
+
export { GENERATED_PARAM_NAMES, GENERATED_PARAM_NAMES_FIRMWARE, } from './paramNamesGenerated.js';
|
|
12
|
+
export { BLOCK_TYPE_VALUES, BLOCK_NAMES_BY_VALUE, resolveBlockType, } from './blockTypes.js';
|
|
13
|
+
export { parseLocationCode, formatLocationCode, formatLocationDisplay, TOTAL_LOCATIONS, } from './locations.js';
|
|
14
|
+
// Codec — wire-byte builders + parsers.
|
|
15
|
+
export { AM4_MODEL_ID, buildSetFloatParam, buildSetParam, buildSetBlockType, buildSetBlockBypass, buildSetPresetName, buildSetSceneName, buildSwitchScene, buildSwitchPreset, buildSaveToLocation, buildGetPresetName, buildReadParam, buildRequestActiveBufferDump, isCommandAck, isWriteEcho, isReadResponse, isReadResponseLong, parseReadResponse, parseLongReadBypassFlag, parseGetPresetNameResponse, BLOCK_SLOT_PID_LOW, BLOCK_SLOT_PID_HIGH_BASE, READ_TYPE_LONG, LONG_READ_BYPASS_FLAG_BYTE, READ_VALUE_DENOMINATOR, PRESET_NAME_EMPTY_SENTINEL, } from './setParam.js';
|
|
16
|
+
// Data tables — cache + type-applicability + enums.
|
|
17
|
+
export { CACHE_PARAMS } from './cacheParams.js';
|
|
18
|
+
export { AMP_TYPES, DRIVE_TYPES, REVERB_TYPES, DELAY_TYPES, CHORUS_TYPES, FLANGER_TYPES, PHASER_TYPES, WAH_TYPES, COMPRESSOR_TYPES, GEQ_TYPES, FILTER_TYPES, TREMOLO_TYPES, ENHANCER_TYPES, GATE_TYPES, VOLPAN_MODES, TEMPO_DIVISIONS, LFO_WAVEFORMS, AMP_TYPES_VALUES, DRIVE_TYPES_VALUES, REVERB_TYPES_VALUES, DELAY_TYPES_VALUES, CHORUS_TYPES_VALUES, FLANGER_TYPES_VALUES, PHASER_TYPES_VALUES, WAH_TYPES_VALUES, COMPRESSOR_TYPES_VALUES, GEQ_TYPES_VALUES, FILTER_TYPES_VALUES, TREMOLO_TYPES_VALUES, ENHANCER_TYPES_VALUES, GATE_TYPES_VALUES, VOLPAN_MODES_VALUES, TEMPO_DIVISIONS_VALUES, LFO_WAVEFORMS_VALUES, } from './cacheEnums.js';
|
|
19
|
+
export { TYPE_APPLICABILITY, TYPE_APPLICABILITY_FIRMWARE, } from './typeApplicability.js';
|
|
20
|
+
export { getApplicability, describeApplicability, checkApplicability, findCompatibleTypes, } from './applicability.js';
|
|
21
|
+
// Editor / bridge labels (RE'd from AM4-Edit binary).
|
|
22
|
+
export { EDITOR_CONTROLS, EDITOR_CONTROL_FIRMWARE, EDITOR_CONTROL_PARAMETER_NAMES, resolveEditorControlLabel, } from './editorControlLabels.js';
|
|
23
|
+
export { SYMBOLIC_IDS_BY_BLOCK } from './symbolicIds.js';
|
|
24
|
+
export { PARAMETER_BRIDGE, PARAMETER_BRIDGE_FIRMWARE, resolveBridge, preferredDisplayLabel, } from './parameterBridge.js';
|
|
25
|
+
// Variant resolver — block.parameterName → cache-id mappings.
|
|
26
|
+
export { VARIANT_RESOLVER_FIRMWARE, VARIANT_RESOLVER_BY_EFFECT_TYPE, VARIANT_RESOLVER_FALLBACK, PARAMETER_NAME_TO_CACHE_ID, UNIVERSAL_BLOCK_PARAMETERS, resolveCacheId, resolveAllCacheIds, } from './variantResolverTables.js';
|
|
27
|
+
// Intermediate representation — preset model + transpiler.
|
|
28
|
+
export { transpile } from './ir/transpile.js';
|
|
29
|
+
// Shared helpers (paramHelpers — the channel-aware resolver lives in
|
|
30
|
+
// the consumer because it needs a MIDI connection).
|
|
31
|
+
export { DEFAULT_SCRATCH_LOCATION, EnumAmbiguityError, suggestParamName, paramKey, resolveValue, } from './shared/paramHelpers.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preset Intermediate Representation.
|
|
3
|
+
*
|
|
4
|
+
* Scope: **working buffer only** — a flat parameter map. The full preset
|
|
5
|
+
* IR (block placement, scenes, per-block channels) is deferred until the
|
|
6
|
+
* relevant protocol pieces are reverse-engineered.
|
|
7
|
+
*
|
|
8
|
+
* A `WorkingBufferIR` describes the parameter values to apply to the
|
|
9
|
+
* AM4's *currently loaded* preset. The transpiler in `./transpile.ts`
|
|
10
|
+
* turns it into an ordered SET_PARAM command sequence.
|
|
11
|
+
*/
|
|
12
|
+
import type { ParamKey } from '../params.js';
|
|
13
|
+
/**
|
|
14
|
+
* Display values keyed by registry param key (e.g. `'amp.gain'`). Values
|
|
15
|
+
* are in human/UI units (the registry handles the scale conversion).
|
|
16
|
+
*
|
|
17
|
+
* Iteration order is preserved by the transpiler, so callers can express
|
|
18
|
+
* apply-order dependencies (e.g. set block type before block params)
|
|
19
|
+
* by ordering insertion.
|
|
20
|
+
*/
|
|
21
|
+
export interface WorkingBufferIR {
|
|
22
|
+
params: Partial<Record<ParamKey, number>>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../src/am4/ir/preset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;CAC3C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preset Intermediate Representation.
|
|
3
|
+
*
|
|
4
|
+
* Scope: **working buffer only** — a flat parameter map. The full preset
|
|
5
|
+
* IR (block placement, scenes, per-block channels) is deferred until the
|
|
6
|
+
* relevant protocol pieces are reverse-engineered.
|
|
7
|
+
*
|
|
8
|
+
* A `WorkingBufferIR` describes the parameter values to apply to the
|
|
9
|
+
* AM4's *currently loaded* preset. The transpiler in `./transpile.ts`
|
|
10
|
+
* turns it into an ordered SET_PARAM command sequence.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Working-buffer IR → wire command sequence.
|
|
3
|
+
*
|
|
4
|
+
* Emits one SET_PARAM message per entry in `ir.params`, in insertion
|
|
5
|
+
* order. Use `sendMessages(...)` from the MIDI layer to dispatch them.
|
|
6
|
+
*/
|
|
7
|
+
import type { WorkingBufferIR } from './preset.js';
|
|
8
|
+
export declare function transpile(ir: WorkingBufferIR): number[][];
|
|
9
|
+
//# sourceMappingURL=transpile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpile.d.ts","sourceRoot":"","sources":["../../../src/am4/ir/transpile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAgB,SAAS,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,EAAE,EAAE,CAUzD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Working-buffer IR → wire command sequence.
|
|
3
|
+
*
|
|
4
|
+
* Emits one SET_PARAM message per entry in `ir.params`, in insertion
|
|
5
|
+
* order. Use `sendMessages(...)` from the MIDI layer to dispatch them.
|
|
6
|
+
*/
|
|
7
|
+
import { buildSetParam } from '../setParam.js';
|
|
8
|
+
export function transpile(ir) {
|
|
9
|
+
const messages = [];
|
|
10
|
+
for (const [key, value] of Object.entries(ir.params)) {
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
continue;
|
|
13
|
+
if (!Number.isFinite(value)) {
|
|
14
|
+
throw new Error(`Param "${key}" has non-finite value: ${value}`);
|
|
15
|
+
}
|
|
16
|
+
messages.push(buildSetParam(key, value));
|
|
17
|
+
}
|
|
18
|
+
return messages;
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AM4 preset-location addressing.
|
|
3
|
+
*
|
|
4
|
+
* The AM4 stores 104 presets across 26 banks (A..Z), 4 presets per bank.
|
|
5
|
+
* Per the AM4 owner's manual, Fractal calls a stored preset's address its
|
|
6
|
+
* "location" (e.g. "Use SELECT and ABCD to choose a location to save to").
|
|
7
|
+
* On the wire, locations are a 0-based index 0..103:
|
|
8
|
+
* A01 = 0, A02 = 1, ..., A04 = 3, B01 = 4, ..., Z04 = 103.
|
|
9
|
+
*
|
|
10
|
+
* Accepts both "A1" and zero-padded "A01" on input; emits the 3-char form
|
|
11
|
+
* on output. Users and the MCP surface always speak the letter form; the
|
|
12
|
+
* wire only sees the index.
|
|
13
|
+
*
|
|
14
|
+
* Reserved terminology: the word "slot" is reserved for block (effect)
|
|
15
|
+
* positions within a preset's signal chain — see buildSetBlockType. Do
|
|
16
|
+
* NOT use "slot" for preset locations in new code or user-facing strings.
|
|
17
|
+
*/
|
|
18
|
+
export declare const TOTAL_LOCATIONS: number;
|
|
19
|
+
/** Parse "A01".."Z04" (or "A1".."Z4") → 0..103 wire index. Throws on bad input. */
|
|
20
|
+
export declare function parseLocationCode(code: string): number;
|
|
21
|
+
/** Inverse: 0..103 → "A01".."Z04" (3-char canonical form for keys + safety comparisons). */
|
|
22
|
+
export declare function formatLocationCode(locationIndex: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* 0..103 → "A1".."Z4" — the unpadded form Fractal uses on the AM4 hardware
|
|
25
|
+
* display and throughout the AM4 Owner's Manual ("preset A1", "C3", "W4",
|
|
26
|
+
* etc.). Use this in user-facing tool output where the founder/user expects
|
|
27
|
+
* to see what the device shows. `formatLocationCode` (zero-padded) stays as
|
|
28
|
+
* the internal canonical form for safety comparisons (SCRATCH_LOCATION) and
|
|
29
|
+
* fingerprint-table keys.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatLocationDisplay(locationIndex: number): string;
|
|
32
|
+
//# sourceMappingURL=locations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locations.d.ts","sourceRoot":"","sources":["../../src/am4/locations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,eAAO,MAAM,eAAe,QAA2C,CAAC;AAExE,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAatD;AAED,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAOhE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAOnE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AM4 preset-location addressing.
|
|
3
|
+
*
|
|
4
|
+
* The AM4 stores 104 presets across 26 banks (A..Z), 4 presets per bank.
|
|
5
|
+
* Per the AM4 owner's manual, Fractal calls a stored preset's address its
|
|
6
|
+
* "location" (e.g. "Use SELECT and ABCD to choose a location to save to").
|
|
7
|
+
* On the wire, locations are a 0-based index 0..103:
|
|
8
|
+
* A01 = 0, A02 = 1, ..., A04 = 3, B01 = 4, ..., Z04 = 103.
|
|
9
|
+
*
|
|
10
|
+
* Accepts both "A1" and zero-padded "A01" on input; emits the 3-char form
|
|
11
|
+
* on output. Users and the MCP surface always speak the letter form; the
|
|
12
|
+
* wire only sees the index.
|
|
13
|
+
*
|
|
14
|
+
* Reserved terminology: the word "slot" is reserved for block (effect)
|
|
15
|
+
* positions within a preset's signal chain — see buildSetBlockType. Do
|
|
16
|
+
* NOT use "slot" for preset locations in new code or user-facing strings.
|
|
17
|
+
*/
|
|
18
|
+
const BANK_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
19
|
+
const LOCATIONS_PER_BANK = 4;
|
|
20
|
+
export const TOTAL_LOCATIONS = BANK_LETTERS.length * LOCATIONS_PER_BANK;
|
|
21
|
+
/** Parse "A01".."Z04" (or "A1".."Z4") → 0..103 wire index. Throws on bad input. */
|
|
22
|
+
export function parseLocationCode(code) {
|
|
23
|
+
const m = /^([A-Za-z])0?(\d)$/.exec(code.trim());
|
|
24
|
+
if (!m) {
|
|
25
|
+
throw new Error(`Preset location must look like "A01".."Z04" (bank A..Z + sub-index 01..04), got "${code}".`);
|
|
26
|
+
}
|
|
27
|
+
const bank = m[1].toUpperCase().charCodeAt(0) - 'A'.charCodeAt(0);
|
|
28
|
+
const sub = parseInt(m[2], 10);
|
|
29
|
+
if (sub < 1 || sub > LOCATIONS_PER_BANK) {
|
|
30
|
+
throw new Error(`Preset sub-index must be 1..${LOCATIONS_PER_BANK}, got ${sub} in "${code}".`);
|
|
31
|
+
}
|
|
32
|
+
return bank * LOCATIONS_PER_BANK + (sub - 1);
|
|
33
|
+
}
|
|
34
|
+
/** Inverse: 0..103 → "A01".."Z04" (3-char canonical form for keys + safety comparisons). */
|
|
35
|
+
export function formatLocationCode(locationIndex) {
|
|
36
|
+
if (!Number.isInteger(locationIndex) || locationIndex < 0 || locationIndex >= TOTAL_LOCATIONS) {
|
|
37
|
+
throw new Error(`Preset location index must be integer 0..${TOTAL_LOCATIONS - 1}, got ${locationIndex}.`);
|
|
38
|
+
}
|
|
39
|
+
const bank = Math.floor(locationIndex / LOCATIONS_PER_BANK);
|
|
40
|
+
const sub = (locationIndex % LOCATIONS_PER_BANK) + 1;
|
|
41
|
+
return `${BANK_LETTERS[bank]}${sub.toString().padStart(2, '0')}`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 0..103 → "A1".."Z4" — the unpadded form Fractal uses on the AM4 hardware
|
|
45
|
+
* display and throughout the AM4 Owner's Manual ("preset A1", "C3", "W4",
|
|
46
|
+
* etc.). Use this in user-facing tool output where the founder/user expects
|
|
47
|
+
* to see what the device shows. `formatLocationCode` (zero-padded) stays as
|
|
48
|
+
* the internal canonical form for safety comparisons (SCRATCH_LOCATION) and
|
|
49
|
+
* fingerprint-table keys.
|
|
50
|
+
*/
|
|
51
|
+
export function formatLocationDisplay(locationIndex) {
|
|
52
|
+
if (!Number.isInteger(locationIndex) || locationIndex < 0 || locationIndex >= TOTAL_LOCATIONS) {
|
|
53
|
+
throw new Error(`Preset location index must be integer 0..${TOTAL_LOCATIONS - 1}, got ${locationIndex}.`);
|
|
54
|
+
}
|
|
55
|
+
const bank = Math.floor(locationIndex / LOCATIONS_PER_BANK);
|
|
56
|
+
const sub = (locationIndex % LOCATIONS_PER_BANK) + 1;
|
|
57
|
+
return `${BANK_LETTERS[bank]}${sub}`;
|
|
58
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hand-maintained name table for cache-derived parameters.
|
|
3
|
+
*
|
|
4
|
+
* Pipeline (P1-010): `scripts/gen-params-from-cache.ts` walks every
|
|
5
|
+
* CONFIRMED cache block, looks up each record's `id` in this table,
|
|
6
|
+
* and emits a `KNOWN_PARAMS`-shape entry if a name is present.
|
|
7
|
+
* Records without a name here are NOT emitted — they stay dormant
|
|
8
|
+
* until a human assigns them a UI label (Session B of P1-010).
|
|
9
|
+
*
|
|
10
|
+
* Why a manual table instead of just emitting `param_{id}` placeholders:
|
|
11
|
+
* MCP tool callers (Claude) need real human names to reason about
|
|
12
|
+
* parameters. `amp.gain=6` is useful; `amp.param_11=6` is not. The
|
|
13
|
+
* cache only stores ids + ranges, not labels.
|
|
14
|
+
*
|
|
15
|
+
* Sources for labels (in priority order):
|
|
16
|
+
* 1. Wire captures that pin a name to a `(pidLow, pidHigh)` pair
|
|
17
|
+
* (highest confidence — see SYSEX-MAP §6a for the decode rule).
|
|
18
|
+
* 2. `docs/manuals/Fractal-Audio-Blocks-Guide.txt` param descriptions.
|
|
19
|
+
* 3. AM4-Edit UI labels observed via AM4-Edit screenshots.
|
|
20
|
+
*
|
|
21
|
+
* Entry shape (two forms):
|
|
22
|
+
* `'name'` — plain string. Generator infers unit from cache `c`
|
|
23
|
+
* (display-scale) via the default mapping (c=10 → knob_0_10,
|
|
24
|
+
* c=100 → percent, c=1000 → ms, c=1 → db, enum → enum).
|
|
25
|
+
* `{ name: 'label', unit: 'hz' }` — object form with an explicit
|
|
26
|
+
* unit override. Required when cache signature is ambiguous
|
|
27
|
+
* (e.g. c=1 could be dB / Hz / seconds / raw-count — the cache
|
|
28
|
+
* doesn't distinguish). Optional `displayMin` / `displayMax`
|
|
29
|
+
* overrides round the cache's internal min/max to a cleaner UI
|
|
30
|
+
* range where needed (e.g. reverb.predelay cache max=0.25s →
|
|
31
|
+
* displayMax=250 ms instead of the floating-point 250.0000…).
|
|
32
|
+
*
|
|
33
|
+
* Seed (2026-04-19, Session 25): every name already registered in
|
|
34
|
+
* `KNOWN_PARAMS`. Session 26 (2026-04-20) added tone-stack + Mix
|
|
35
|
+
* Page + Drive tone/level/mix + reverb predelay + LFO rates +
|
|
36
|
+
* reverb time via the object-form overrides.
|
|
37
|
+
*
|
|
38
|
+
* OUT-OF-BAND PARAMS (not in the cache; hand-registered in
|
|
39
|
+
* `KNOWN_PARAMS` directly, not through this pipeline):
|
|
40
|
+
* - `amp.level` / other-block `level` — pidHigh=0x0000, no cache
|
|
41
|
+
* record at id=0.
|
|
42
|
+
* - `{amp,drive,reverb,delay}.channel` — pidHigh=0x07D2, no cache
|
|
43
|
+
* record (Session 08 decoded this directly from wire captures).
|
|
44
|
+
*
|
|
45
|
+
* These remain in `params.ts` regardless of what this file says.
|
|
46
|
+
*/
|
|
47
|
+
import type { Unit } from './params.js';
|
|
48
|
+
export type ParamNameEntry = string | {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly unit?: Unit;
|
|
51
|
+
readonly displayMin?: number;
|
|
52
|
+
readonly displayMax?: number;
|
|
53
|
+
};
|
|
54
|
+
export declare const PARAM_NAMES: Readonly<Record<string, Readonly<Record<number, ParamNameEntry>>>>;
|
|
55
|
+
//# sourceMappingURL=paramNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paramNames.d.ts","sourceRoot":"","sources":["../../src/am4/paramNames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,cAAc,GACtB,MAAM,GACN;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAgBhH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAi1BjF,CAAC"}
|