@jeffy-g/live-midi-types 0.8.3 → 0.9.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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/midi-clip.d.ts +1 -0
- package/dist/midi-event.d.ts +42 -21
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/midi-clip.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export type TMidiClipData = {
|
|
|
63
63
|
ccMap: Record<string, ControlChangeEvent[]>;
|
|
64
64
|
/**
|
|
65
65
|
* Array of extracted control change events. (flatten {@link TMidiClipData.ccMap __`ccMap`__}, sort by time)
|
|
66
|
+
* + use `flattenCCEventMap` (recommended)
|
|
66
67
|
* @version 0.8.0
|
|
67
68
|
* @see {@link flattenCCEventMap}
|
|
68
69
|
*/
|
package/dist/midi-event.d.ts
CHANGED
|
@@ -9,6 +9,26 @@
|
|
|
9
9
|
* @file src/midi-event.ts
|
|
10
10
|
* @summary Common MIDI event types for Ableton Live and related tools.
|
|
11
11
|
*/
|
|
12
|
+
export type BaseEvent = {
|
|
13
|
+
/**
|
|
14
|
+
* Time relative to the start of the clip.
|
|
15
|
+
*
|
|
16
|
+
* **This is a floating point number representing the time in quarter notes. (Ableton Live)**
|
|
17
|
+
*
|
|
18
|
+
* + Beat-based timestamps (e.g. 4.5 = 4 beats and an eighth note)
|
|
19
|
+
*/
|
|
20
|
+
time: number;
|
|
21
|
+
/**
|
|
22
|
+
* Interpolation method used to generate this envelope sample.
|
|
23
|
+
*
|
|
24
|
+
* - `"bezier"`: Generated using Bézier interpolation.
|
|
25
|
+
* - `"linear"`: Generated using linear interpolation.
|
|
26
|
+
*
|
|
27
|
+
* Intended for diagnostics. Omitted for original or discrete events.
|
|
28
|
+
* @date 2026/09/16 21:09:00
|
|
29
|
+
*/
|
|
30
|
+
source?: "bezier" | "linear";
|
|
31
|
+
};
|
|
12
32
|
/**
|
|
13
33
|
* ```
|
|
14
34
|
* // Path to `MidiClip` element
|
|
@@ -17,11 +37,7 @@
|
|
|
17
37
|
* `<MidiClip>/Notes/KeyTracks/KeyTrack[]/Notes/MidiNoteEvent[]`
|
|
18
38
|
* ```
|
|
19
39
|
*/
|
|
20
|
-
export type NoteEvent = {
|
|
21
|
-
/**
|
|
22
|
-
* NOTE: floating number
|
|
23
|
-
*/
|
|
24
|
-
time: number;
|
|
40
|
+
export type NoteEvent = BaseEvent & {
|
|
25
41
|
/**
|
|
26
42
|
* NOTE: floating number
|
|
27
43
|
* + quarter-note beats
|
|
@@ -38,13 +54,7 @@ export type NoteEvent = {
|
|
|
38
54
|
*/
|
|
39
55
|
velocity: number;
|
|
40
56
|
};
|
|
41
|
-
export type ControlChangeEvent = {
|
|
42
|
-
/**
|
|
43
|
-
* Time relative to the start of the clip.
|
|
44
|
-
*
|
|
45
|
-
* **This is a floating point number representing the time in quarter notes. (Ableton Live)**
|
|
46
|
-
*/
|
|
47
|
-
time: number;
|
|
57
|
+
export type ControlChangeEvent = BaseEvent & {
|
|
48
58
|
/**
|
|
49
59
|
* MIDI controller number.
|
|
50
60
|
*
|
|
@@ -58,24 +68,35 @@ export type ControlChangeEvent = {
|
|
|
58
68
|
* Value of the controller (0-127, floating number).
|
|
59
69
|
*/
|
|
60
70
|
value: number;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @date 2026/09/14 06:21:51
|
|
74
|
+
*/
|
|
75
|
+
export type ChannelPressureEvent = BaseEvent & {
|
|
61
76
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
77
|
+
* `0` to `127`
|
|
78
|
+
*
|
|
79
|
+
* Value of the ChannelPressure (0-127, floating number).
|
|
64
80
|
*/
|
|
65
|
-
|
|
81
|
+
value: number;
|
|
66
82
|
};
|
|
67
83
|
/**
|
|
68
|
-
*
|
|
84
|
+
* @date 2026/09/14 06:21:51
|
|
69
85
|
*/
|
|
70
|
-
export type
|
|
86
|
+
export type PitchBendEvent = BaseEvent & {
|
|
71
87
|
/**
|
|
72
|
-
*
|
|
88
|
+
* `-8192 to 8191` (Live)
|
|
73
89
|
*
|
|
74
|
-
*
|
|
90
|
+
* Value of the PitchBend (floating number).
|
|
75
91
|
*/
|
|
76
|
-
|
|
92
|
+
value: number;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Tempo event object.
|
|
96
|
+
*/
|
|
97
|
+
export type TempoEvent = BaseEvent & {
|
|
77
98
|
/**
|
|
78
|
-
* Tempo in BPM.
|
|
99
|
+
* Tempo in BPM. (floating number)
|
|
79
100
|
*/
|
|
80
101
|
bpm: number;
|
|
81
102
|
};
|