@ac-kit/format-midi 0.0.0-stage → 0.1.1
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/CHANGELOG.md +47 -0
- package/LICENSE +28 -0
- package/README.md +103 -2
- package/dist/errors.d.ts +45 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +36 -0
- package/dist/errors.js.map +1 -0
- package/dist/file/_meta-types.d.ts +33 -0
- package/dist/file/_meta-types.d.ts.map +1 -0
- package/dist/file/_meta-types.js +52 -0
- package/dist/file/_meta-types.js.map +1 -0
- package/dist/file/midi-file.d.ts +68 -0
- package/dist/file/midi-file.d.ts.map +1 -0
- package/dist/file/midi-file.js +2 -0
- package/dist/file/midi-file.js.map +1 -0
- package/dist/file/midi-meta-event.d.ts +74 -0
- package/dist/file/midi-meta-event.d.ts.map +1 -0
- package/dist/file/midi-meta-event.js +2 -0
- package/dist/file/midi-meta-event.js.map +1 -0
- package/dist/file/parse-midi-file.d.ts +29 -0
- package/dist/file/parse-midi-file.d.ts.map +1 -0
- package/dist/file/parse-midi-file.js +265 -0
- package/dist/file/parse-midi-file.js.map +1 -0
- package/dist/file/print-midi-file.d.ts +35 -0
- package/dist/file/print-midi-file.d.ts.map +1 -0
- package/dist/file/print-midi-file.js +184 -0
- package/dist/file/print-midi-file.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/message/_midi-status.d.ts +19 -0
- package/dist/message/_midi-status.d.ts.map +1 -0
- package/dist/message/_midi-status.js +66 -0
- package/dist/message/_midi-status.js.map +1 -0
- package/dist/message/encode-midi-message.d.ts +21 -0
- package/dist/message/encode-midi-message.d.ts.map +1 -0
- package/dist/message/encode-midi-message.js +93 -0
- package/dist/message/encode-midi-message.js.map +1 -0
- package/dist/message/is-midi-note-release.d.ts +24 -0
- package/dist/message/is-midi-note-release.d.ts.map +1 -0
- package/dist/message/is-midi-note-release.js +18 -0
- package/dist/message/is-midi-note-release.js.map +1 -0
- package/dist/message/midi-message-decoder.d.ts +67 -0
- package/dist/message/midi-message-decoder.d.ts.map +1 -0
- package/dist/message/midi-message-decoder.js +254 -0
- package/dist/message/midi-message-decoder.js.map +1 -0
- package/dist/message/midi-message-encoder.d.ts +43 -0
- package/dist/message/midi-message-encoder.d.ts.map +1 -0
- package/dist/message/midi-message-encoder.js +49 -0
- package/dist/message/midi-message-encoder.js.map +1 -0
- package/dist/message/midi-message.d.ts +111 -0
- package/dist/message/midi-message.d.ts.map +1 -0
- package/dist/message/midi-message.js +2 -0
- package/dist/message/midi-message.js.map +1 -0
- package/dist/timeline/compose-midi-timeline.d.ts +42 -0
- package/dist/timeline/compose-midi-timeline.d.ts.map +1 -0
- package/dist/timeline/compose-midi-timeline.js +87 -0
- package/dist/timeline/compose-midi-timeline.js.map +1 -0
- package/package.json +62 -3
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A MIDI 1.0 Channel Voice message, addressed to one of the 16 channels.
|
|
3
|
+
*
|
|
4
|
+
* Channel Mode messages (All Sound Off, Reset All Controllers, Local Control,
|
|
5
|
+
* All Notes Off, Omni and Mono/Poly modes) share the Control Change status and
|
|
6
|
+
* are represented as `controlChange` with `controller` 120–127, as on the
|
|
7
|
+
* wire.
|
|
8
|
+
*
|
|
9
|
+
* A `noteOn` with `velocity` 0 is kept as a note-on: that is what was sent, and
|
|
10
|
+
* it is what lets running status cover a whole phrase. Receivers treat it as a
|
|
11
|
+
* note-off; {@link isMidiNoteRelease} answers that question for both forms.
|
|
12
|
+
*/
|
|
13
|
+
export type MidiChannelMessage = {
|
|
14
|
+
type: "noteOff";
|
|
15
|
+
/** 0–15, shown to users as channels 1–16. */
|
|
16
|
+
channel: number;
|
|
17
|
+
/** 0–127; 60 is middle C. */
|
|
18
|
+
note: number;
|
|
19
|
+
/** Release velocity, 0–127. */
|
|
20
|
+
velocity: number;
|
|
21
|
+
} | {
|
|
22
|
+
type: "noteOn";
|
|
23
|
+
/** 0–15. */
|
|
24
|
+
channel: number;
|
|
25
|
+
/** 0–127. */
|
|
26
|
+
note: number;
|
|
27
|
+
/** 0–127; 0 means note-off to a receiver. */
|
|
28
|
+
velocity: number;
|
|
29
|
+
} | {
|
|
30
|
+
type: "polyphonicKeyPressure";
|
|
31
|
+
/** 0–15. */
|
|
32
|
+
channel: number;
|
|
33
|
+
/** 0–127. */
|
|
34
|
+
note: number;
|
|
35
|
+
/** 0–127. */
|
|
36
|
+
pressure: number;
|
|
37
|
+
} | {
|
|
38
|
+
type: "controlChange";
|
|
39
|
+
/** 0–15. */
|
|
40
|
+
channel: number;
|
|
41
|
+
/** 0–127; 120–127 are the Channel Mode messages. */
|
|
42
|
+
controller: number;
|
|
43
|
+
/** 0–127. */
|
|
44
|
+
value: number;
|
|
45
|
+
} | {
|
|
46
|
+
type: "programChange";
|
|
47
|
+
/** 0–15. */
|
|
48
|
+
channel: number;
|
|
49
|
+
/** 0–127, shown to users as programs 1–128. */
|
|
50
|
+
program: number;
|
|
51
|
+
} | {
|
|
52
|
+
type: "channelPressure";
|
|
53
|
+
/** 0–15. */
|
|
54
|
+
channel: number;
|
|
55
|
+
/** 0–127. */
|
|
56
|
+
pressure: number;
|
|
57
|
+
} | {
|
|
58
|
+
type: "pitchBend";
|
|
59
|
+
/** 0–15. */
|
|
60
|
+
channel: number;
|
|
61
|
+
/**
|
|
62
|
+
* -8192–8191, 0 being the centre. On the wire this is the 14-bit value
|
|
63
|
+
* plus 8192, least significant 7 bits first.
|
|
64
|
+
*/
|
|
65
|
+
value: number;
|
|
66
|
+
};
|
|
67
|
+
/** A MIDI 1.0 System Common message, including System Exclusive. */
|
|
68
|
+
export type MidiSystemCommonMessage = {
|
|
69
|
+
type: "sysEx";
|
|
70
|
+
/**
|
|
71
|
+
* The payload between F0 and F7, both excluded: the manufacturer ID
|
|
72
|
+
* first, every byte 0–127.
|
|
73
|
+
*/
|
|
74
|
+
data: Uint8Array;
|
|
75
|
+
} | {
|
|
76
|
+
type: "timeCodeQuarterFrame";
|
|
77
|
+
/** Which of the eight quarter-frame pieces this is, 0–7. */
|
|
78
|
+
piece: number;
|
|
79
|
+
/** The 4-bit value of that piece, 0–15. */
|
|
80
|
+
value: number;
|
|
81
|
+
} | {
|
|
82
|
+
type: "songPositionPointer";
|
|
83
|
+
/** Position in MIDI beats (sixteenth notes) from the start, 0–16383. */
|
|
84
|
+
position: number;
|
|
85
|
+
} | {
|
|
86
|
+
type: "songSelect";
|
|
87
|
+
/** 0–127. */
|
|
88
|
+
song: number;
|
|
89
|
+
} | {
|
|
90
|
+
type: "tuneRequest";
|
|
91
|
+
};
|
|
92
|
+
/** A MIDI 1.0 System Real-Time message: one status byte, no data. */
|
|
93
|
+
export type MidiSystemRealTimeMessage = {
|
|
94
|
+
type: "timingClock";
|
|
95
|
+
} | {
|
|
96
|
+
type: "start";
|
|
97
|
+
} | {
|
|
98
|
+
type: "continue";
|
|
99
|
+
} | {
|
|
100
|
+
type: "stop";
|
|
101
|
+
} | {
|
|
102
|
+
type: "activeSensing";
|
|
103
|
+
} | {
|
|
104
|
+
type: "systemReset";
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* One MIDI 1.0 message, as defined by the _MIDI 1.0 Detailed Specification_.
|
|
108
|
+
* Discriminated by `type`.
|
|
109
|
+
*/
|
|
110
|
+
export type MidiMessage = MidiChannelMessage | MidiSystemCommonMessage | MidiSystemRealTimeMessage;
|
|
111
|
+
//# sourceMappingURL=midi-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midi-message.d.ts","sourceRoot":"","sources":["../../src/message/midi-message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB,GAC3B;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC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AI,EAAE,qBAAqB,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;CAChB,GACD;IACA,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa;IACb,IAAI,EAAE,MAAM,CAAC;CACZ,GACD;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAE3B,qEAAqE;AACrE,MAAM,MAAM,yBAAyB,GAClC;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAE3B;;;GAGG;AACH,MAAM,MAAM,WAAW,GACpB,kBAAkB,GAClB,uBAAuB,GACvB,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midi-message.js","sourceRoot":"","sources":["../../src/message/midi-message.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { MidiFile, MidiFileEvent } from "../file/midi-file.js";
|
|
2
|
+
/** One event of a {@link MidiFile}, placed on the file's time axis. */
|
|
3
|
+
export type MidiTimelineEvent = {
|
|
4
|
+
/** Index of the track the event came from. */
|
|
5
|
+
trackIndex: number;
|
|
6
|
+
/**
|
|
7
|
+
* Ticks from the start of the track: the sum of the delta times up to the
|
|
8
|
+
* event.
|
|
9
|
+
*/
|
|
10
|
+
tick: number;
|
|
11
|
+
/** Seconds from the start of the track. */
|
|
12
|
+
seconds: number;
|
|
13
|
+
event: MidiFileEvent;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Places every event of a Standard MIDI File on one time axis, in ticks and in
|
|
17
|
+
* seconds — what a player or an exporter iterates over.
|
|
18
|
+
*
|
|
19
|
+
* - **Formats 0 and 1**: the tracks play together, so the result is every event
|
|
20
|
+
* of every track sorted by tick, ties kept in track order then event order.
|
|
21
|
+
* Tempo starts at 120 bpm (500 000 µs per quarter note) and Set Tempo events
|
|
22
|
+
* are honoured in whichever track they appear, although format 1 files
|
|
23
|
+
* conventionally keep the tempo map in track 0.
|
|
24
|
+
* - **Format 2**: each track is an independent sequence, so each starts at 0
|
|
25
|
+
* seconds under its own Set Tempo events only, and the result is the tracks
|
|
26
|
+
* one after another in track order, not interleaved.
|
|
27
|
+
* - **Timecode division**: ticks have a fixed length, `1 / (framesPerSecond ×
|
|
28
|
+
* ticksPerFrame)` seconds with 29 meaning 30000/1001 frames per second, and
|
|
29
|
+
* Set Tempo events do not change it.
|
|
30
|
+
*
|
|
31
|
+
* Time complexity: O(n log n) in the total event count, for the sort; O(n) for
|
|
32
|
+
* format 2. Memory: O(n). The events are shared with `file`, not copied.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // RP-001's format 0 example, 96 ticks per quarter note at 120 bpm:
|
|
36
|
+
* composeMidiTimeline(file).at(-1); // { trackIndex: 0, tick: 384, seconds: 2, … }
|
|
37
|
+
*
|
|
38
|
+
* @param file - A file, typically from {@link parseMidiFile}.
|
|
39
|
+
* @returns One entry per event, in playing order.
|
|
40
|
+
*/
|
|
41
|
+
export declare function composeMidiTimeline(file: MidiFile): MidiTimelineEvent[];
|
|
42
|
+
//# sourceMappingURL=compose-midi-timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-midi-timeline.d.ts","sourceRoot":"","sources":["../../src/timeline/compose-midi-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,aAAa,EAEb,MAAM,sBAAsB,CAAC;AAE9B,uEAAuE;AACvE,MAAM,MAAM,iBAAiB,GAAG;IAC/B,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC;CACrB,CAAC;AA2DF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,iBAAiB,EAAE,CAqBvE"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** RP-001: a file with no Set Tempo event before a tick plays at 120 bpm. */
|
|
2
|
+
const DEFAULT_TEMPO_ = 500000;
|
|
3
|
+
function appendTrackEvents_(target, file, trackIndex) {
|
|
4
|
+
let tick = 0;
|
|
5
|
+
for (const { deltaTime, event } of file.tracks[trackIndex].events) {
|
|
6
|
+
tick += deltaTime;
|
|
7
|
+
target.push({ trackIndex, tick, seconds: 0, event });
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Sets `seconds` on `events[from…]`, sorted by tick, under the tempo changes
|
|
12
|
+
* they contain. Seconds are measured from the last tempo change, not
|
|
13
|
+
* accumulated per event, so rounding does not drift over a long file.
|
|
14
|
+
*/
|
|
15
|
+
function assignSeconds_(events, from, division) {
|
|
16
|
+
if (division.type === "timecode") {
|
|
17
|
+
const framesPerSecond = division.framesPerSecond === 29
|
|
18
|
+
? 30000 / 1001
|
|
19
|
+
: division.framesPerSecond;
|
|
20
|
+
const ticksPerSecond = framesPerSecond * division.ticksPerFrame;
|
|
21
|
+
for (let index = from; index < events.length; index++) {
|
|
22
|
+
events[index].seconds = events[index].tick / ticksPerSecond;
|
|
23
|
+
}
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const microsecondsPerTick = 1000000 * division.ticksPerQuarterNote;
|
|
27
|
+
let segmentTick = 0;
|
|
28
|
+
let segmentSeconds = 0;
|
|
29
|
+
let secondsPerTick = DEFAULT_TEMPO_ / microsecondsPerTick;
|
|
30
|
+
for (let index = from; index < events.length; index++) {
|
|
31
|
+
const timelineEvent = events[index];
|
|
32
|
+
timelineEvent.seconds =
|
|
33
|
+
segmentSeconds + (timelineEvent.tick - segmentTick) * secondsPerTick;
|
|
34
|
+
const { event } = timelineEvent;
|
|
35
|
+
if (event.kind === "meta" && event.meta.type === "setTempo") {
|
|
36
|
+
segmentTick = timelineEvent.tick;
|
|
37
|
+
segmentSeconds = timelineEvent.seconds;
|
|
38
|
+
secondsPerTick =
|
|
39
|
+
event.meta.microsecondsPerQuarterNote / microsecondsPerTick;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Places every event of a Standard MIDI File on one time axis, in ticks and in
|
|
45
|
+
* seconds — what a player or an exporter iterates over.
|
|
46
|
+
*
|
|
47
|
+
* - **Formats 0 and 1**: the tracks play together, so the result is every event
|
|
48
|
+
* of every track sorted by tick, ties kept in track order then event order.
|
|
49
|
+
* Tempo starts at 120 bpm (500 000 µs per quarter note) and Set Tempo events
|
|
50
|
+
* are honoured in whichever track they appear, although format 1 files
|
|
51
|
+
* conventionally keep the tempo map in track 0.
|
|
52
|
+
* - **Format 2**: each track is an independent sequence, so each starts at 0
|
|
53
|
+
* seconds under its own Set Tempo events only, and the result is the tracks
|
|
54
|
+
* one after another in track order, not interleaved.
|
|
55
|
+
* - **Timecode division**: ticks have a fixed length, `1 / (framesPerSecond ×
|
|
56
|
+
* ticksPerFrame)` seconds with 29 meaning 30000/1001 frames per second, and
|
|
57
|
+
* Set Tempo events do not change it.
|
|
58
|
+
*
|
|
59
|
+
* Time complexity: O(n log n) in the total event count, for the sort; O(n) for
|
|
60
|
+
* format 2. Memory: O(n). The events are shared with `file`, not copied.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* // RP-001's format 0 example, 96 ticks per quarter note at 120 bpm:
|
|
64
|
+
* composeMidiTimeline(file).at(-1); // { trackIndex: 0, tick: 384, seconds: 2, … }
|
|
65
|
+
*
|
|
66
|
+
* @param file - A file, typically from {@link parseMidiFile}.
|
|
67
|
+
* @returns One entry per event, in playing order.
|
|
68
|
+
*/
|
|
69
|
+
export function composeMidiTimeline(file) {
|
|
70
|
+
const events = [];
|
|
71
|
+
if (file.format === 2) {
|
|
72
|
+
for (const trackIndex of file.tracks.keys()) {
|
|
73
|
+
const from = events.length;
|
|
74
|
+
appendTrackEvents_(events, file, trackIndex);
|
|
75
|
+
assignSeconds_(events, from, file.timeDivision);
|
|
76
|
+
}
|
|
77
|
+
return events;
|
|
78
|
+
}
|
|
79
|
+
for (const trackIndex of file.tracks.keys()) {
|
|
80
|
+
appendTrackEvents_(events, file, trackIndex);
|
|
81
|
+
}
|
|
82
|
+
// Array.prototype.sort is stable, so equal ticks stay in track then event order.
|
|
83
|
+
events.sort((left, right) => left.tick - right.tick);
|
|
84
|
+
assignSeconds_(events, 0, file.timeDivision);
|
|
85
|
+
return events;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=compose-midi-timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-midi-timeline.js","sourceRoot":"","sources":["../../src/timeline/compose-midi-timeline.ts"],"names":[],"mappings":"AAoBA,6EAA6E;AAC7E,MAAM,cAAc,GAAG,MAAO,CAAC;AAE/B,SAAS,kBAAkB,CAC1B,MAA2B,EAC3B,IAAc,EACd,UAAkB;IAElB,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAE,CAAC,MAAM,EAAE,CAAC;QACpE,IAAI,IAAI,SAAS,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CACtB,MAA2B,EAC3B,IAAY,EACZ,QAA0B;IAE1B,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU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F,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAc;IACjD,MAAM,MAAM,GAAwB,EAAE,CAAC;IAEvC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;YAC3B,kBAAkB,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;YAC7C,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAED,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7C,kBAAkB,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9C,CAAC;IACD,iFAAiF;IACjF,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IACrD,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAE7C,OAAO,MAAM,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/format-midi",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "MIDI 1.0: the message model with a live byte-stream Decoder/Encoder, Standard MIDI File parse/print, and tick-to-seconds timelines.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"midi",
|
|
7
|
+
"midi-file",
|
|
8
|
+
"smf",
|
|
9
|
+
"standard-midi-file",
|
|
10
|
+
"sysex"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://anthochamp.github.io/node-essentials/api/format-midi/",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "BSD-3-Clause",
|
|
17
|
+
"author": "Anthony Champagne <dev@anthonychampagne.fr>",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://git.grenadine.io/anthochamp/node-essentials.git",
|
|
21
|
+
"directory": "packages/format-midi"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"main": "./dist/index.js",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"compile": "tsc -p ./tsconfig.build.json -outDir dist",
|
|
41
|
+
"compile:check": "tsc -noEmit -p ./tsconfig.json",
|
|
42
|
+
"clean": "rimraf dist",
|
|
43
|
+
"build": "yarn clean && yarn compile",
|
|
44
|
+
"test": "yarn run -T vitest run",
|
|
45
|
+
"prepack": "yarn build"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@ac-kit/core": "^0.3.0",
|
|
49
|
+
"@ac-kit/format-core": "^0.1.3",
|
|
50
|
+
"@ac-kit/format-varint": "^0.1.2",
|
|
51
|
+
"@types/web": "^0.0.359"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@ac-kit/tsconfig": "0.1.0",
|
|
55
|
+
"@ac-kit/typedoc-config": "0.1.0",
|
|
56
|
+
"@ac-kit/vitest-config": "0.1.1",
|
|
57
|
+
"@typescript/native": "typescript@7.0.2",
|
|
58
|
+
"rimraf": "6.1.3",
|
|
59
|
+
"typedoc": "0.28.20",
|
|
60
|
+
"typescript": "@typescript/typescript6@6.0.2"
|
|
61
|
+
},
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=24"
|
|
64
|
+
}
|
|
6
65
|
}
|