@jeffy-g/live-midi-types 0.7.3 → 0.8.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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/midi-clip.d.ts +7 -1
- package/dist/midi-event.d.ts +1 -1
- package/dist/project.d.ts +52 -37
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/midi-clip.d.ts
CHANGED
|
@@ -42,8 +42,14 @@ export type TMidiClipData = {
|
|
|
42
42
|
* Array of extracted note events.
|
|
43
43
|
*/
|
|
44
44
|
notes: NoteEvent[];
|
|
45
|
+
/**
|
|
46
|
+
* Control change event map.
|
|
47
|
+
* @version 0.8.0
|
|
48
|
+
*/
|
|
49
|
+
ccMap: Record<string, ControlChangeEvent[]>;
|
|
45
50
|
/**
|
|
46
51
|
* Array of extracted control change events.
|
|
52
|
+
* @version 0.8.0
|
|
47
53
|
*/
|
|
48
|
-
cc: ControlChangeEvent[];
|
|
54
|
+
cc(): ControlChangeEvent[];
|
|
49
55
|
};
|
package/dist/midi-event.d.ts
CHANGED
package/dist/project.d.ts
CHANGED
|
@@ -9,29 +9,31 @@
|
|
|
9
9
|
* @file src/project.ts
|
|
10
10
|
*/
|
|
11
11
|
import type { TempoEvent } from "./midi-event.ts";
|
|
12
|
+
/**
|
|
13
|
+
* Summary information for an Ableton Live MIDI clip.
|
|
14
|
+
*/
|
|
12
15
|
export type TClipSummary<T extends Record<string, any>> = {
|
|
13
16
|
/**
|
|
14
|
-
* Original MidiClip
|
|
15
|
-
* + This is always a simple number.
|
|
17
|
+
* Original `MidiClip` ID from the ALS document.
|
|
16
18
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
+
* + Stored as a numeric string.
|
|
20
|
+
*
|
|
21
|
+
* ```
|
|
19
22
|
* "/Ableton/LiveSet/Tracks/MidiTrack[4]/DeviceChain/MainSequencer/ClipTimeable/ArrangerAutomation/Events/MidiClip[3]/@Id"
|
|
20
23
|
* ```
|
|
21
24
|
* @date 2026/07/02
|
|
22
25
|
*/
|
|
23
26
|
originId: string;
|
|
24
27
|
/**
|
|
25
|
-
*
|
|
28
|
+
* Application-specific ID assigned for use by the UI and other consumers.
|
|
26
29
|
*
|
|
27
30
|
* ```
|
|
28
|
-
*
|
|
29
|
-
* "clip-" + crypto.randomUUID()
|
|
31
|
+
* `clip-${crypto.randomUUID()}`
|
|
30
32
|
* ```
|
|
31
33
|
*/
|
|
32
34
|
id: string;
|
|
33
35
|
/**
|
|
34
|
-
* Live color palette
|
|
36
|
+
* Index into the Ableton Live color palette.
|
|
35
37
|
* + This value is always the index of the color palette.
|
|
36
38
|
* ```
|
|
37
39
|
* // e.g. xpath
|
|
@@ -46,35 +48,42 @@ export type TClipSummary<T extends Record<string, any>> = {
|
|
|
46
48
|
*/
|
|
47
49
|
color: string;
|
|
48
50
|
/**
|
|
49
|
-
*
|
|
51
|
+
* Whether the clip is disabled.
|
|
50
52
|
*/
|
|
51
53
|
disabled: boolean;
|
|
52
54
|
/**
|
|
53
|
-
* Original MidiClip
|
|
55
|
+
* Original name of the `MidiClip`.
|
|
54
56
|
*
|
|
55
|
-
* ```
|
|
57
|
+
* ```
|
|
56
58
|
* // e.g
|
|
57
59
|
* "/Ableton/LiveSet/Tracks/MidiTrack/DeviceChain/MainSequencer/ClipTimeable/ArrangerAutomation/Events/MidiClip/Name/@Value"
|
|
58
60
|
* ```
|
|
59
61
|
*/
|
|
60
62
|
clipName: string;
|
|
61
63
|
/**
|
|
62
|
-
*
|
|
64
|
+
* Name of the parent track.
|
|
63
65
|
*/
|
|
64
66
|
trackName: string;
|
|
65
67
|
/**
|
|
66
|
-
* Annotation
|
|
67
|
-
*
|
|
68
|
-
*
|
|
68
|
+
* Annotation attached to this `MidiClip` in Ableton Live.
|
|
69
|
+
*
|
|
70
|
+
* + Any text value appears to be accepted.
|
|
71
|
+
*
|
|
72
|
+
* ```
|
|
69
73
|
* // e.g
|
|
70
74
|
* "/Ableton/LiveSet/Tracks/MidiTrack/DeviceChain/MainSequencer/ClipTimeable/ArrangerAutomation/Events/MidiClip/Annotation/@Value"
|
|
71
75
|
* ```
|
|
72
76
|
*/
|
|
73
|
-
|
|
77
|
+
annotation: string;
|
|
74
78
|
} & T;
|
|
79
|
+
/**
|
|
80
|
+
* Summary information for an Ableton Live track.
|
|
81
|
+
*/
|
|
75
82
|
export type TTrackInfo<T extends Record<string, any>> = {
|
|
76
83
|
/**
|
|
77
|
-
*
|
|
84
|
+
* Original track ID from the ALS document.
|
|
85
|
+
*
|
|
86
|
+
* ```
|
|
78
87
|
* // e.g
|
|
79
88
|
* "/Ableton/LiveSet/Tracks/MidiTrack[4]/@Id"
|
|
80
89
|
* ```
|
|
@@ -82,7 +91,7 @@ export type TTrackInfo<T extends Record<string, any>> = {
|
|
|
82
91
|
*/
|
|
83
92
|
originId: string;
|
|
84
93
|
/**
|
|
85
|
-
*
|
|
94
|
+
* Application-specific ID assigned for use by the UI and other consumers.
|
|
86
95
|
*
|
|
87
96
|
* ```
|
|
88
97
|
* // e.g.
|
|
@@ -91,64 +100,70 @@ export type TTrackInfo<T extends Record<string, any>> = {
|
|
|
91
100
|
*/
|
|
92
101
|
id: string;
|
|
93
102
|
/**
|
|
94
|
-
* Original
|
|
103
|
+
* Original name of the track.
|
|
95
104
|
*
|
|
96
|
-
* ```
|
|
105
|
+
* ```
|
|
97
106
|
* // e.g MidiTrack
|
|
98
107
|
* "/Ableton/LiveSet/Tracks/MidiTrack/Name/EffectiveName/@Value"
|
|
99
108
|
* ```
|
|
100
109
|
*/
|
|
101
110
|
name: string;
|
|
102
111
|
/**
|
|
103
|
-
* Live color palette
|
|
112
|
+
* Index into the Ableton Live color palette.
|
|
104
113
|
* + This value is always the index of the color palette.
|
|
114
|
+
*
|
|
105
115
|
* ```
|
|
106
116
|
* // e.g. xpath (MidiTrack)
|
|
107
117
|
* "/Ableton/LiveSet/Tracks/MidiTrack/Color/@Value"
|
|
108
118
|
*
|
|
109
|
-
* //
|
|
119
|
+
* // Convert the index to a CSS color:
|
|
110
120
|
* // "0" or "12" to "#ff94a6" / "#e553a0"
|
|
111
121
|
* const hexColor = getColorFromIndex(+clip.color);
|
|
112
122
|
* ```
|
|
113
|
-
*
|
|
114
123
|
* @see {@link getColorFromIndex}
|
|
115
124
|
*/
|
|
116
125
|
color: string;
|
|
117
126
|
/**
|
|
118
|
-
* Annotation
|
|
119
|
-
*
|
|
120
|
-
*
|
|
127
|
+
* Annotation attached to this track in Ableton Live. (MidiTrack etc).
|
|
128
|
+
*
|
|
129
|
+
* + Any text value appears to be accepted.
|
|
130
|
+
* ```
|
|
121
131
|
* // e.g (MidiTrack)
|
|
122
132
|
* "/Ableton/LiveSet/Tracks/MidiTrack/Name/Annotation/@Value"
|
|
123
133
|
* ```
|
|
124
134
|
*/
|
|
125
|
-
|
|
135
|
+
annotation: string;
|
|
126
136
|
/**
|
|
127
|
-
*
|
|
128
|
-
* Record<"clipName", TMidiClipSummary>
|
|
129
|
-
* ```
|
|
137
|
+
* MIDI clips indexed by clip name.
|
|
130
138
|
*/
|
|
131
139
|
clips: Record<string, TClipSummary<T>>;
|
|
132
140
|
};
|
|
141
|
+
/**
|
|
142
|
+
* Parsed data required by the Ableton Live project UI.
|
|
143
|
+
*/
|
|
133
144
|
export type TParsedAbletonLiveSet<T extends Record<string, any>> = {
|
|
134
145
|
/**
|
|
135
|
-
* Ableton Live project name
|
|
136
|
-
*
|
|
146
|
+
* Ableton Live project name.
|
|
147
|
+
*
|
|
148
|
+
* + Usually the `.als` filename without its extension.
|
|
137
149
|
*/
|
|
138
150
|
alsName: string;
|
|
139
151
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
152
|
+
* Pulses per quarter note (PPQ).
|
|
153
|
+
*
|
|
154
|
+
* + This value is not stored in the ALS document; it is supplied by the application.
|
|
142
155
|
*/
|
|
143
156
|
ticksPerQuarter: number;
|
|
144
157
|
/**
|
|
145
158
|
* Tracks in the project.
|
|
146
|
-
*
|
|
159
|
+
*
|
|
160
|
+
* + Currently contains only MIDI tracks.
|
|
147
161
|
*/
|
|
148
162
|
tracks: TTrackInfo<T>[];
|
|
149
163
|
/**
|
|
150
|
-
* Tempo automation events.
|
|
151
|
-
*
|
|
164
|
+
* Tempo automation events extracted from the master track.
|
|
165
|
+
*
|
|
166
|
+
* + Retrieving tempo event data requires a version-dependent XPath.
|
|
152
167
|
* ```
|
|
153
168
|
* // Specific XPath examples (live 12.x)
|
|
154
169
|
* "/Ableton/LiveSet/MasterTrack/AutomationEnvelopes/Envelopes/AutomationEnvelope[2]/Automation/Events"
|