@r_masseater/song-format 0.0.0 → 0.1.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 +87 -0
- package/README.md +60 -1
- package/dist/app-CdpGdiWq.mjs +190 -0
- package/dist/app-CdpGdiWq.mjs.map +1 -0
- package/dist/convert-midi.d.mts +91 -0
- package/dist/convert-midi.mjs +918 -0
- package/dist/convert-midi.mjs.map +1 -0
- package/dist/fumx-language-server.mjs +23 -0
- package/dist/fumx-language-server.mjs.map +1 -0
- package/dist/mapper.mjs +14 -0
- package/dist/mapper.mjs.map +1 -0
- package/dist/midi-to-fumx.mjs +1128 -0
- package/dist/midi-to-fumx.mjs.map +1 -0
- package/dist/song-report.mjs +28 -0
- package/dist/song-report.mjs.map +1 -0
- package/dist/transform-C24h3upp.mjs +108 -0
- package/dist/transform-C24h3upp.mjs.map +1 -0
- package/dist/vite.d.mts +3 -0
- package/dist/vite.mjs +127 -0
- package/dist/vite.mjs.map +1 -0
- package/package.json +85 -6
- package/skills/use-fumx-tools/SKILL.md +65 -0
package/package.json
CHANGED
|
@@ -1,15 +1,94 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r_masseater/song-format",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Tooling for .fumx songs: import a song from TypeScript with Vite, a language server, MIDI to .fumx conversion that checks the result against the original, and a song report.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"fumx",
|
|
7
|
+
"language-server",
|
|
8
|
+
"midi",
|
|
9
|
+
"music",
|
|
10
|
+
"tanstack-intent",
|
|
11
|
+
"vite-plugin"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/masseater/ecosystems/tree/main/libs/song-format#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/masseater/ecosystems/issues"
|
|
16
|
+
},
|
|
5
17
|
"license": "MIT",
|
|
6
18
|
"repository": {
|
|
7
19
|
"type": "git",
|
|
8
20
|
"url": "git+https://github.com/masseater/ecosystems.git",
|
|
9
21
|
"directory": "libs/song-format"
|
|
10
22
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
23
|
+
"bin": {
|
|
24
|
+
"fumx-language-server": "./dist/fumx-language-server.mjs",
|
|
25
|
+
"midi-to-fumx": "./dist/midi-to-fumx.mjs",
|
|
26
|
+
"song-report": "./dist/song-report.mjs"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"dist",
|
|
31
|
+
"skills/use-fumx-tools"
|
|
32
|
+
],
|
|
33
|
+
"type": "module",
|
|
34
|
+
"imports": {
|
|
35
|
+
"#/*": "./src/*"
|
|
36
|
+
},
|
|
37
|
+
"exports": {
|
|
38
|
+
"./convert-midi": {
|
|
39
|
+
"types": "./dist/convert-midi.d.mts",
|
|
40
|
+
"default": "./dist/convert-midi.mjs"
|
|
41
|
+
},
|
|
42
|
+
"./vite": {
|
|
43
|
+
"types": "./dist/vite.d.mts",
|
|
44
|
+
"default": "./dist/vite.mjs"
|
|
45
|
+
},
|
|
46
|
+
"./mapper": "./dist/mapper.mjs",
|
|
47
|
+
"./package.json": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"provenance": true
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@effect/platform-node-shared": "^4.1.5",
|
|
55
|
+
"@r_masseater/fumx-parser": "^0.2.0",
|
|
56
|
+
"@r_masseater/mapped-import": "^0.1.0",
|
|
57
|
+
"ableton-als": "^0.5.0",
|
|
58
|
+
"fast-xml-parser": "^5.12.1",
|
|
59
|
+
"langium": "^4.4.2",
|
|
60
|
+
"midi-file": "^1.2.4",
|
|
61
|
+
"tonal": "^6.9.0",
|
|
62
|
+
"ts-content-mapper": "^0.1.1",
|
|
63
|
+
"vscode-languageserver": "^11.0.1"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@effect/vitest": "4.1.5",
|
|
67
|
+
"@r_masseater/node-main": "0.1.0",
|
|
68
|
+
"@r_masseater/song-format": "0.1.0",
|
|
69
|
+
"@types/node": "26.6.6",
|
|
70
|
+
"effect": "4.1.5",
|
|
71
|
+
"typescript": "7.1.0-dev.20261124.1",
|
|
72
|
+
"vite-plus": "1.8.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"effect": "^4.1.0",
|
|
76
|
+
"vite-plus": "^1.8.0"
|
|
77
|
+
},
|
|
78
|
+
"typescript": {
|
|
79
|
+
"contentMapper": {
|
|
80
|
+
"compilerOptions": [],
|
|
81
|
+
"dynamicConfig": false,
|
|
82
|
+
"exec": [
|
|
83
|
+
"node",
|
|
84
|
+
"--input-type=module",
|
|
85
|
+
"-e",
|
|
86
|
+
"import \"@r_masseater/song-format/mapper\""
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"engines": {
|
|
91
|
+
"node": ">=26.13.1"
|
|
92
|
+
},
|
|
93
|
+
"scripts": {}
|
|
15
94
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: use-fumx-tools
|
|
3
|
+
description: >
|
|
4
|
+
Use when a .fumx song must be imported from TypeScript, checked or converted: the fumx Vite
|
|
5
|
+
plugin, the TypeScript content mapper, song-report for keys, chords and repeated bars,
|
|
6
|
+
midi-to-fumx for converting a MIDI file with a check against the original, and the language
|
|
7
|
+
server.
|
|
8
|
+
metadata:
|
|
9
|
+
type: core
|
|
10
|
+
library: "@r_masseater/song-format"
|
|
11
|
+
library_version: 0.1.0
|
|
12
|
+
sources:
|
|
13
|
+
- src/**
|
|
14
|
+
- bin/**
|
|
15
|
+
- README.md
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# use-fumx-tools
|
|
19
|
+
|
|
20
|
+
`.fumx` is a text format for music. This package turns it into something TypeScript, an editor and an agent can use. The grammar and the reader are in `@r_masseater/fumx-parser`.
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
vp add @r_masseater/song-format effect vite-plus
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Import a song from TypeScript
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { fumx } from "@r_masseater/song-format/vite";
|
|
32
|
+
import { defineConfig } from "vite-plus";
|
|
33
|
+
|
|
34
|
+
export default defineConfig({ plugins: [fumx()] });
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then `import { song } from "./song.fumx"` gives a typed value. Add the content mapper to `tsconfig.json` so the TypeScript server resolves it:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{ "contentMappers": [{ "package": "@r_masseater/song-format", "extensions": [".fumx"] }] }
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Check what was written
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
vp exec song-report song.fumx
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
It prints the keys, chords and repeated bars as JSON. Read it to confirm that the song you wrote has the harmony and the structure you meant, since you cannot listen to it.
|
|
50
|
+
|
|
51
|
+
## Convert a MIDI file
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
vp exec midi-to-fumx song.mid
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The command writes `song.fumx`, reads it back, and compares it with the events of the MIDI file. It fails if even one event differs. Do not hand edit the output to make it pass.
|
|
58
|
+
|
|
59
|
+
## Common mistakes
|
|
60
|
+
|
|
61
|
+
### Importing `.fumx` without the content mapper
|
|
62
|
+
|
|
63
|
+
Wrong: add only the Vite plugin. The build works, but the editor reports that the module has no declaration.
|
|
64
|
+
|
|
65
|
+
Correct: add the plugin and the `contentMappers` entry, and set `allowArbitraryExtensions`.
|