@sudobility/music_types 0.11.4 → 0.11.7
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/platform/index.d.ts +1 -0
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js +1 -0
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/mod.d.ts +49 -0
- package/dist/platform/mod.d.ts.map +1 -0
- package/dist/platform/mod.js +12 -0
- package/dist/platform/mod.js.map +1 -0
- package/package.json +59 -59
package/dist/platform/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B;;;;GAIG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B;;;;GAIG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
package/dist/platform/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B;;;;GAIG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B;;;;GAIG;AACH,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A neutral model of an Amiga tracker module, shaped by exactly what the
|
|
3
|
+
* `.MOD` importer in music_lib reads — so that music_lib carries no byte
|
|
4
|
+
* handling of its own, the same split `MidiFile` uses.
|
|
5
|
+
*
|
|
6
|
+
* Decoding stops at this shape deliberately. Turning periods into pitches and
|
|
7
|
+
* speed/tempo into a `TempoMap` is musical work, so it lives in music_lib;
|
|
8
|
+
* only the byte reading is platform-shaped, and even that is shared by all
|
|
9
|
+
* three `MusicIo` implementations rather than reimplemented per platform.
|
|
10
|
+
*/
|
|
11
|
+
/** A sampled instrument slot. Names are free text and often decorative or empty. */
|
|
12
|
+
export type ModSample = {
|
|
13
|
+
index: number;
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* One channel's cell in one row.
|
|
18
|
+
*
|
|
19
|
+
* `period` is the Amiga period value, not a pitch: 0 means "no note here",
|
|
20
|
+
* which is why this is not an optional field. `sample` is 0 for "keep
|
|
21
|
+
* whatever this channel was already playing".
|
|
22
|
+
*/
|
|
23
|
+
export type ModCell = {
|
|
24
|
+
sample: number;
|
|
25
|
+
period: number;
|
|
26
|
+
effect: number;
|
|
27
|
+
param: number;
|
|
28
|
+
};
|
|
29
|
+
export type ModFile = {
|
|
30
|
+
title: string;
|
|
31
|
+
channels: number;
|
|
32
|
+
samples: ModSample[];
|
|
33
|
+
/** Pattern indices in playback order; a pattern played three times appears three times. */
|
|
34
|
+
order: number[];
|
|
35
|
+
/** `patterns[pattern][row][channel]`. */
|
|
36
|
+
patterns: ModCell[][][];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Reading a `.MOD` file.
|
|
40
|
+
*
|
|
41
|
+
* A capability for surface consistency — the app reaches every file format
|
|
42
|
+
* through `getAppServices().io` — even though nothing about parsing is
|
|
43
|
+
* platform-bound. All three implementations delegate to one shared module.
|
|
44
|
+
*/
|
|
45
|
+
export interface ModCodec {
|
|
46
|
+
/** Decode a ProTracker module. Throws on anything that is not one, rather than returning a garbage file that looks imported. */
|
|
47
|
+
decode(bytes: ArrayBuffer): ModFile;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/platform/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,oFAAoF;AACpF,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,2FAA2F;IAC3F,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yCAAyC;IACzC,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,gIAAgI;IAChI,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC;CACrC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A neutral model of an Amiga tracker module, shaped by exactly what the
|
|
3
|
+
* `.MOD` importer in music_lib reads — so that music_lib carries no byte
|
|
4
|
+
* handling of its own, the same split `MidiFile` uses.
|
|
5
|
+
*
|
|
6
|
+
* Decoding stops at this shape deliberately. Turning periods into pitches and
|
|
7
|
+
* speed/tempo into a `TempoMap` is musical work, so it lives in music_lib;
|
|
8
|
+
* only the byte reading is platform-shaped, and even that is shared by all
|
|
9
|
+
* three `MusicIo` implementations rather than reimplemented per platform.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=mod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../src/platform/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
2
|
+
"name": "@sudobility/music_types",
|
|
3
|
+
"version": "0.11.7",
|
|
4
|
+
"description": "TypeScript types and Zod schemas for the ScoreSmith music API - scores, generation contracts, project payloads",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.esm.json",
|
|
16
|
+
"clean": "rimraf dist",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:watch": "vitest",
|
|
19
|
+
"lint": "eslint src",
|
|
20
|
+
"typecheck": "tsc --noEmit",
|
|
21
|
+
"verify": "bun run typecheck && bun run lint && bun run test && bun run build",
|
|
22
|
+
"prepublishOnly": "bun run clean && bun run verify"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/**/*",
|
|
26
|
+
"CLAUDE.md"
|
|
27
|
+
],
|
|
28
|
+
"keywords": [
|
|
29
|
+
"typescript",
|
|
30
|
+
"types",
|
|
31
|
+
"music",
|
|
32
|
+
"scoresmith",
|
|
33
|
+
"api"
|
|
34
|
+
],
|
|
35
|
+
"author": "Sudobility",
|
|
36
|
+
"license": "BUSL-1.1",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"zod": "^4.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@sudobility/types": "^1.9.64"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@eslint/js": "^9.38.0",
|
|
45
|
+
"@sudobility/types": "^1.9.64",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
47
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
48
|
+
"eslint": "^9.38.0",
|
|
49
|
+
"globals": "^16.4.0",
|
|
50
|
+
"rimraf": "^6.0.1",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"vitest": "^4.0.15"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "https://github.com/johnqh/music_types.git"
|
|
60
|
+
}
|
|
61
61
|
}
|