Skip to content

Commit 6390f1e

Browse files
committed
Add midi-schema.json and update README
1 parent dae3da2 commit 6390f1e

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Options:
3434
-s, --song /path/to/song.json JSON config file for all tracks, colours, and audio files (no default)
3535
-m, --midi /path/to/midi.json JSON config file for MIDI file visualization (no default)
3636
-w, --window /path/to/window.json JSON config file for size and scaling of the output video (default: ./window.json)
37+
-p, --window-preset Preset window options: "16x9" (1920x1080), "9x16" (1080x1920), "9x18" (1080x2160)
3738
-h, --help Print this help
3839
-V, --version Print version
3940
```
@@ -70,7 +71,6 @@ Options:
7071
### Midi.json
7172

7273
* `midi_file` is a path name to a .MID file,
73-
* `duration_secs` (optional) - changes how much of the song to display on-screen at once, in seconds. Defaults to `5.0`
7474
* `video_file_out` is a path name to the video file that will be output.
7575
* `use_gradients` (optional) - each channel's background can display a colour that subtly fades from top to bottom. Defaults to `true`
7676
* `channels`, is an object, where each key is the name of a track within the MIDI file. Adding channels is optional, but will default the track to a black background and sort them in alphabetical order. Each sub-object contains the following properties:
@@ -107,12 +107,15 @@ Options:
107107
* For example, the default is 480x270 at a scale of 4, which means the final
108108
output resolution is 1920x1080.
109109
* `frame_rate` the frame rate of the output video
110+
* `duration_secs` (optional) Changes how much of the song to display on-screen at
111+
once, in seconds. Only used for MIDI renders. Defaults to `5.0`
110112

111113
```json
112114
{
113115
"width": 480,
114116
"height": 270,
115117
"scale": 4,
116-
"frame_rate": 30
118+
"frame_rate": 30,
119+
"duration_secs": 5
117120
}
118121
```

midi-example.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://git.tombo.sh/tom/multitrack-visualizer/raw/branch/main/midi-schema.json",
23
"midi_file": "midi-file.mid",
34
"video_file_out": "./song/output.mp4",
45
"use_gradients": true,

midi-schema.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://git.tombo.sh/tom/multitrack-visualizer/raw/branch/main/midi-schema.json",
4+
"title": "MIDI Config Schema",
5+
"type": "object",
6+
"properties": {
7+
"channels": {
8+
"type": "object",
9+
"patternProperties": {
10+
".+": {
11+
"type": "object",
12+
"properties": {
13+
"order": {
14+
"description": "The position this channel appears on-screen",
15+
"type": "number",
16+
"minimum": 0
17+
},
18+
"colour": {
19+
"description": "Defines the red, green, and blue colour values used as the background for this channel",
20+
"type": "array",
21+
"items": {
22+
"type": "number",
23+
"minimum": 0,
24+
"maximum": 255
25+
},
26+
"maxItems": 3,
27+
"minItems": 3,
28+
"default": [
29+
0,
30+
0,
31+
0
32+
]
33+
},
34+
"visible": {
35+
"description": "This will remove the MIDI channel from the video, if you don't wish to use it.",
36+
"type": "boolean",
37+
"default": true
38+
}
39+
}
40+
}
41+
}
42+
},
43+
"midi_file": {
44+
"type": "string"
45+
},
46+
"video_file_out": {
47+
"type": "string",
48+
"default": "./output.mp4"
49+
},
50+
"use_gradients": {
51+
"type": "boolean",
52+
"default": false
53+
}
54+
},
55+
"required": [
56+
"video_file_out",
57+
"midi_file"
58+
]
59+
}

0 commit comments

Comments
 (0)