@audiofab-io/fv1-core 0.4.0 → 0.6.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/dist/spnbank/index.d.ts +97 -0
- package/dist/spnbank/index.d.ts.map +1 -0
- package/dist/spnbank/index.js +188 -0
- package/dist/spnbank/index.js.map +1 -0
- package/package.json +8 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.spnbank` — Easy Spin Program Bank file format.
|
|
3
|
+
*
|
|
4
|
+
* A `.spnbank` file is a small JSON manifest describing the eight program
|
|
5
|
+
* slots of an Easy Spin pedal. Each slot points at a workspace-relative
|
|
6
|
+
* `.spn` (FV-1 assembly) or `.spndiagram` (block diagram) file, and may
|
|
7
|
+
* optionally carry presentation metadata (display name, description, pot
|
|
8
|
+
* labels) that override what would otherwise be derived from the source
|
|
9
|
+
* file or its sibling `.json`.
|
|
10
|
+
*
|
|
11
|
+
* Slot indices in the manifest are 1-based (slot 1..8) for human readability.
|
|
12
|
+
* The runtime API uses 0-based indices via `bankSlotIndex0()`.
|
|
13
|
+
*
|
|
14
|
+
* Round-trip:
|
|
15
|
+
* parseSpnBankJson(serializeSpnBankJson(b)) === b // structurally equal
|
|
16
|
+
*
|
|
17
|
+
* Format versions:
|
|
18
|
+
* v1 — { name?, slots: [{ slot, path }] }
|
|
19
|
+
* v2 — adds top-level metadata (version, description, author, license)
|
|
20
|
+
* and per-slot metadata (name, description, controls). v2 files
|
|
21
|
+
* carry `"version": "2.0"`. Parsers tolerate v1 files (no version
|
|
22
|
+
* field) and read just the basic fields, leaving extras at default.
|
|
23
|
+
*/
|
|
24
|
+
/** Per-pot label for a bank slot. */
|
|
25
|
+
export interface SpnBankSlotControl {
|
|
26
|
+
/** Pot index, 0..2. */
|
|
27
|
+
pot: 0 | 1 | 2;
|
|
28
|
+
/** Short display name (e.g. "Decay"). */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Optional longer description (tooltip-friendly). */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Optional unit suffix (e.g. "ms", "Hz"). */
|
|
33
|
+
unit?: string;
|
|
34
|
+
}
|
|
35
|
+
/** A single entry in a `.spnbank` file. */
|
|
36
|
+
export interface SpnBankSlot {
|
|
37
|
+
/** 1-based slot number (1..8). */
|
|
38
|
+
slot: number;
|
|
39
|
+
/** Path (relative to the bank file's directory, or absolute) to a
|
|
40
|
+
* `.spn` or `.spndiagram` file. Empty string indicates an unassigned slot. */
|
|
41
|
+
path: string;
|
|
42
|
+
/** Optional display name override. Defaults to the file's basename. */
|
|
43
|
+
name?: string;
|
|
44
|
+
/** Optional description (free-form text). */
|
|
45
|
+
description?: string;
|
|
46
|
+
/** Optional pot label overrides. When present, these take precedence over
|
|
47
|
+
* any controls metadata that might exist in a sibling `.json` or in the
|
|
48
|
+
* source `.spndiagram`'s metadata block. */
|
|
49
|
+
controls?: SpnBankSlotControl[];
|
|
50
|
+
}
|
|
51
|
+
/** Parsed `.spnbank` file. */
|
|
52
|
+
export interface SpnBankFile {
|
|
53
|
+
/** Schema version. v2 files set this to "2.0"; v1 files have no version field. */
|
|
54
|
+
version?: string;
|
|
55
|
+
/** Display name for the bank. Defaults to the filename's basename when not set. */
|
|
56
|
+
name?: string;
|
|
57
|
+
/** Optional bank-level description. */
|
|
58
|
+
description?: string;
|
|
59
|
+
/** Optional bank author / credit. */
|
|
60
|
+
author?: string;
|
|
61
|
+
/** Optional licence string for the bank itself. */
|
|
62
|
+
license?: string;
|
|
63
|
+
/** Always exactly `PROGRAM_SLOT_COUNT` (8) entries, in slot-number order. */
|
|
64
|
+
slots: SpnBankSlot[];
|
|
65
|
+
}
|
|
66
|
+
/** Current schema version emitted by `serializeSpnBankJson`. */
|
|
67
|
+
export declare const SPNBANK_SCHEMA_VERSION = "2.0";
|
|
68
|
+
/** True if a slot has no assigned program. */
|
|
69
|
+
export declare function isSlotEmpty(slot: SpnBankSlot): boolean;
|
|
70
|
+
/** Build an empty bank. All slots unassigned. */
|
|
71
|
+
export declare function createEmptyBank(name?: string): SpnBankFile;
|
|
72
|
+
/**
|
|
73
|
+
* Parse the JSON text of a `.spnbank` file. Always returns a structurally
|
|
74
|
+
* complete bank (8 slots in order); malformed JSON or missing fields fall
|
|
75
|
+
* back to defaults so tooling can render a usable editor over a corrupt or
|
|
76
|
+
* empty file.
|
|
77
|
+
*
|
|
78
|
+
* Backwards-compatible: v1 files (no `version` field, slots with just
|
|
79
|
+
* `{ slot, path }`) parse cleanly and round-trip through serialize without
|
|
80
|
+
* losing fields.
|
|
81
|
+
*
|
|
82
|
+
* @param text Raw file contents.
|
|
83
|
+
* @param fallbackName Display name to use when the file's `name` field is
|
|
84
|
+
* missing — typically the file basename without `.spnbank`.
|
|
85
|
+
*/
|
|
86
|
+
export declare function parseSpnBankJson(text: string, fallbackName?: string): SpnBankFile;
|
|
87
|
+
/**
|
|
88
|
+
* Serialise a `.spnbank` file to JSON text. Output is pretty-printed with
|
|
89
|
+
* 2-space indentation and a trailing newline. Optional fields are omitted
|
|
90
|
+
* when not set, keeping diffs minimal for simple banks.
|
|
91
|
+
*/
|
|
92
|
+
export declare function serializeSpnBankJson(bank: SpnBankFile): string;
|
|
93
|
+
/** Convenience: 0-based index for a slot. */
|
|
94
|
+
export declare function bankSlotIndex0(slot: SpnBankSlot): number;
|
|
95
|
+
/** Re-exported for convenience so callers don't have to also import from `/pedal`. */
|
|
96
|
+
export { PROGRAM_SLOT_COUNT } from '../pedal/constants.js';
|
|
97
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spnbank/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,qCAAqC;AACrC,MAAM,WAAW,kBAAkB;IACjC,uBAAuB;IACvB,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACd,yCAAyC;IAC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cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAExD;AAED,sFAAsF;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.spnbank` — Easy Spin Program Bank file format.
|
|
3
|
+
*
|
|
4
|
+
* A `.spnbank` file is a small JSON manifest describing the eight program
|
|
5
|
+
* slots of an Easy Spin pedal. Each slot points at a workspace-relative
|
|
6
|
+
* `.spn` (FV-1 assembly) or `.spndiagram` (block diagram) file, and may
|
|
7
|
+
* optionally carry presentation metadata (display name, description, pot
|
|
8
|
+
* labels) that override what would otherwise be derived from the source
|
|
9
|
+
* file or its sibling `.json`.
|
|
10
|
+
*
|
|
11
|
+
* Slot indices in the manifest are 1-based (slot 1..8) for human readability.
|
|
12
|
+
* The runtime API uses 0-based indices via `bankSlotIndex0()`.
|
|
13
|
+
*
|
|
14
|
+
* Round-trip:
|
|
15
|
+
* parseSpnBankJson(serializeSpnBankJson(b)) === b // structurally equal
|
|
16
|
+
*
|
|
17
|
+
* Format versions:
|
|
18
|
+
* v1 — { name?, slots: [{ slot, path }] }
|
|
19
|
+
* v2 — adds top-level metadata (version, description, author, license)
|
|
20
|
+
* and per-slot metadata (name, description, controls). v2 files
|
|
21
|
+
* carry `"version": "2.0"`. Parsers tolerate v1 files (no version
|
|
22
|
+
* field) and read just the basic fields, leaving extras at default.
|
|
23
|
+
*/
|
|
24
|
+
import { PROGRAM_SLOT_COUNT } from '../pedal/constants.js';
|
|
25
|
+
/** Current schema version emitted by `serializeSpnBankJson`. */
|
|
26
|
+
export const SPNBANK_SCHEMA_VERSION = '2.0';
|
|
27
|
+
/** True if a slot has no assigned program. */
|
|
28
|
+
export function isSlotEmpty(slot) {
|
|
29
|
+
return !slot.path;
|
|
30
|
+
}
|
|
31
|
+
/** Build an empty bank. All slots unassigned. */
|
|
32
|
+
export function createEmptyBank(name) {
|
|
33
|
+
return {
|
|
34
|
+
version: SPNBANK_SCHEMA_VERSION,
|
|
35
|
+
name,
|
|
36
|
+
slots: Array.from({ length: PROGRAM_SLOT_COUNT }, (_, i) => ({
|
|
37
|
+
slot: i + 1,
|
|
38
|
+
path: '',
|
|
39
|
+
})),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function readControls(input) {
|
|
43
|
+
if (!Array.isArray(input))
|
|
44
|
+
return undefined;
|
|
45
|
+
const out = [];
|
|
46
|
+
for (const entry of input) {
|
|
47
|
+
if (typeof entry !== 'object' || entry === null)
|
|
48
|
+
continue;
|
|
49
|
+
const e = entry;
|
|
50
|
+
const pot = typeof e.pot === 'number' ? e.pot : NaN;
|
|
51
|
+
if (pot !== 0 && pot !== 1 && pot !== 2)
|
|
52
|
+
continue;
|
|
53
|
+
const name = typeof e.name === 'string' ? e.name : '';
|
|
54
|
+
if (!name)
|
|
55
|
+
continue;
|
|
56
|
+
const control = { pot: pot, name };
|
|
57
|
+
if (typeof e.description === 'string' && e.description)
|
|
58
|
+
control.description = e.description;
|
|
59
|
+
if (typeof e.unit === 'string' && e.unit)
|
|
60
|
+
control.unit = e.unit;
|
|
61
|
+
out.push(control);
|
|
62
|
+
}
|
|
63
|
+
return out.length > 0 ? out : undefined;
|
|
64
|
+
}
|
|
65
|
+
function normaliseSlots(input) {
|
|
66
|
+
const empty = () => Array.from({ length: PROGRAM_SLOT_COUNT }, (_, i) => ({ slot: i + 1, path: '' }));
|
|
67
|
+
if (!Array.isArray(input))
|
|
68
|
+
return empty();
|
|
69
|
+
// Build a lookup by slot number, tolerant of duplicate / missing entries
|
|
70
|
+
// and out-of-range slot numbers in the input.
|
|
71
|
+
const bySlot = new Map();
|
|
72
|
+
for (const entry of input) {
|
|
73
|
+
if (typeof entry !== 'object' || entry === null)
|
|
74
|
+
continue;
|
|
75
|
+
const e = entry;
|
|
76
|
+
const slot = typeof e.slot === 'number' ? e.slot : NaN;
|
|
77
|
+
if (!Number.isFinite(slot))
|
|
78
|
+
continue;
|
|
79
|
+
if (slot < 1 || slot > PROGRAM_SLOT_COUNT)
|
|
80
|
+
continue;
|
|
81
|
+
const partial = {
|
|
82
|
+
path: typeof e.path === 'string' ? e.path : '',
|
|
83
|
+
};
|
|
84
|
+
if (typeof e.name === 'string' && e.name)
|
|
85
|
+
partial.name = e.name;
|
|
86
|
+
if (typeof e.description === 'string' && e.description)
|
|
87
|
+
partial.description = e.description;
|
|
88
|
+
const controls = readControls(e.controls);
|
|
89
|
+
if (controls)
|
|
90
|
+
partial.controls = controls;
|
|
91
|
+
bySlot.set(slot, partial);
|
|
92
|
+
}
|
|
93
|
+
const result = empty();
|
|
94
|
+
for (const slot of result) {
|
|
95
|
+
const partial = bySlot.get(slot.slot);
|
|
96
|
+
if (partial)
|
|
97
|
+
Object.assign(slot, partial);
|
|
98
|
+
}
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Parse the JSON text of a `.spnbank` file. Always returns a structurally
|
|
103
|
+
* complete bank (8 slots in order); malformed JSON or missing fields fall
|
|
104
|
+
* back to defaults so tooling can render a usable editor over a corrupt or
|
|
105
|
+
* empty file.
|
|
106
|
+
*
|
|
107
|
+
* Backwards-compatible: v1 files (no `version` field, slots with just
|
|
108
|
+
* `{ slot, path }`) parse cleanly and round-trip through serialize without
|
|
109
|
+
* losing fields.
|
|
110
|
+
*
|
|
111
|
+
* @param text Raw file contents.
|
|
112
|
+
* @param fallbackName Display name to use when the file's `name` field is
|
|
113
|
+
* missing — typically the file basename without `.spnbank`.
|
|
114
|
+
*/
|
|
115
|
+
export function parseSpnBankJson(text, fallbackName) {
|
|
116
|
+
if (!text || !text.trim()) {
|
|
117
|
+
return createEmptyBank(fallbackName);
|
|
118
|
+
}
|
|
119
|
+
let raw;
|
|
120
|
+
try {
|
|
121
|
+
raw = JSON.parse(text);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return createEmptyBank(fallbackName);
|
|
125
|
+
}
|
|
126
|
+
if (typeof raw !== 'object' || raw === null) {
|
|
127
|
+
return createEmptyBank(fallbackName);
|
|
128
|
+
}
|
|
129
|
+
// Build the bank with its keys in the same order the serialiser emits
|
|
130
|
+
// them so parse→serialise round-trips produce identical JSON output.
|
|
131
|
+
// JS preserves insertion order, so we add slots last and use a partial-
|
|
132
|
+
// object pattern to avoid pinning `slots` as the first key.
|
|
133
|
+
const obj = raw;
|
|
134
|
+
const bank = {};
|
|
135
|
+
if (typeof obj.version === 'string' && obj.version)
|
|
136
|
+
bank.version = obj.version;
|
|
137
|
+
const name = typeof obj.name === 'string' && obj.name ? obj.name : fallbackName;
|
|
138
|
+
if (name !== undefined)
|
|
139
|
+
bank.name = name;
|
|
140
|
+
if (typeof obj.description === 'string' && obj.description)
|
|
141
|
+
bank.description = obj.description;
|
|
142
|
+
if (typeof obj.author === 'string' && obj.author)
|
|
143
|
+
bank.author = obj.author;
|
|
144
|
+
if (typeof obj.license === 'string' && obj.license)
|
|
145
|
+
bank.license = obj.license;
|
|
146
|
+
bank.slots = normaliseSlots(obj.slots);
|
|
147
|
+
return bank;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Serialise a `.spnbank` file to JSON text. Output is pretty-printed with
|
|
151
|
+
* 2-space indentation and a trailing newline. Optional fields are omitted
|
|
152
|
+
* when not set, keeping diffs minimal for simple banks.
|
|
153
|
+
*/
|
|
154
|
+
export function serializeSpnBankJson(bank) {
|
|
155
|
+
// Stamp newly-written banks with the current schema version so future
|
|
156
|
+
// tooling can detect older files. Files that never had a version stay
|
|
157
|
+
// unversioned only if the caller deliberately clears it.
|
|
158
|
+
const version = bank.version ?? SPNBANK_SCHEMA_VERSION;
|
|
159
|
+
// Build slots without empty optional fields to keep on-disk output clean.
|
|
160
|
+
const slots = bank.slots.map(slot => {
|
|
161
|
+
const out = { slot: slot.slot, path: slot.path };
|
|
162
|
+
if (slot.name)
|
|
163
|
+
out.name = slot.name;
|
|
164
|
+
if (slot.description)
|
|
165
|
+
out.description = slot.description;
|
|
166
|
+
if (slot.controls && slot.controls.length > 0)
|
|
167
|
+
out.controls = slot.controls;
|
|
168
|
+
return out;
|
|
169
|
+
});
|
|
170
|
+
const json = { version };
|
|
171
|
+
if (bank.name)
|
|
172
|
+
json.name = bank.name;
|
|
173
|
+
if (bank.description)
|
|
174
|
+
json.description = bank.description;
|
|
175
|
+
if (bank.author)
|
|
176
|
+
json.author = bank.author;
|
|
177
|
+
if (bank.license)
|
|
178
|
+
json.license = bank.license;
|
|
179
|
+
json.slots = slots;
|
|
180
|
+
return JSON.stringify(json, null, 2) + '\n';
|
|
181
|
+
}
|
|
182
|
+
/** Convenience: 0-based index for a slot. */
|
|
183
|
+
export function bankSlotIndex0(slot) {
|
|
184
|
+
return slot.slot - 1;
|
|
185
|
+
}
|
|
186
|
+
/** Re-exported for convenience so callers don't have to also import from `/pedal`. */
|
|
187
|
+
export { PROGRAM_SLOT_COUNT } from '../pedal/constants.js';
|
|
188
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/spnbank/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AA+C1D,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAA;AAE3C,8CAA8C;AAC9C,MAAM,UAAU,WAAW,CAAC,IAAiB;IAC3C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA;AACnB,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,OAAO;QACL,OAAO,EAAE,sBAAsB;QAC/B,IAAI;QACJ,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3D,IA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ler, simulator, Intel HEX parser, and block-diagram compiler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
"./blockDiagram/node": {
|
|
23
23
|
"import": "./dist/blockDiagram/blocks/BlockDirectoryLoader.js",
|
|
24
24
|
"types": "./dist/blockDiagram/blocks/BlockDirectoryLoader.d.ts"
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
"./spnbank": {
|
|
27
|
+
"import": "./dist/spnbank/index.js",
|
|
28
|
+
"types": "./dist/spnbank/index.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./package.json": "./package.json"
|
|
26
31
|
},
|
|
27
32
|
"files": [
|
|
28
33
|
"dist",
|
|
@@ -32,6 +37,7 @@
|
|
|
32
37
|
"build:manifest": "node scripts/build-manifest.mjs",
|
|
33
38
|
"build": "npm run build:manifest && tsc",
|
|
34
39
|
"clean": "rm -rf dist src/blockDiagram/builtinBlocks.ts",
|
|
40
|
+
"test": "node test/spnbank-test.mjs",
|
|
35
41
|
"prepublishOnly": "npm run build"
|
|
36
42
|
},
|
|
37
43
|
"dependencies": {
|