@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 CHANGED
@@ -2,4 +2,4 @@ export * from "./midi-event.js";
2
2
  export * from "./midi-clip.js";
3
3
  export * from "./project.js";
4
4
  export * from "./ableton-colors.js";
5
- export declare const version = "v0.7.3";
5
+ export declare const version = "v0.8.0";
package/dist/index.js CHANGED
@@ -2,4 +2,4 @@ export * from "./midi-event.js";
2
2
  export * from "./midi-clip.js";
3
3
  export * from "./project.js";
4
4
  export * from "./ableton-colors.js";
5
- export const version = "v0.7.3";
5
+ export const version = "v0.8.0";
@@ -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
  };
@@ -50,7 +50,7 @@ export type ControlChangeEvent = {
50
50
  /**
51
51
  * `0` to `127`
52
52
  *
53
- * Value of the controller (0-127, may be float).
53
+ * Value of the controller (0-127, floating number).
54
54
  */
55
55
  value: number;
56
56
  /**
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 Id
15
- * + This is always a simple number.
17
+ * Original `MidiClip` ID from the ALS document.
16
18
  *
17
- * ```js
18
- * // e.g
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
- * An ID to be assigned for use in UI and other applications.
28
+ * Application-specific ID assigned for use by the UI and other consumers.
26
29
  *
27
30
  * ```
28
- * // e.g.
29
- * "clip-" + crypto.randomUUID()
31
+ * `clip-${crypto.randomUUID()}`
30
32
  * ```
31
33
  */
32
34
  id: string;
33
35
  /**
34
- * Live color palette index
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
- * Disabled property for the clip.
51
+ * Whether the clip is disabled.
50
52
  */
51
53
  disabled: boolean;
52
54
  /**
53
- * Original MidiClip name
55
+ * Original name of the `MidiClip`.
54
56
  *
55
- * ```js
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
- * Parent track name
64
+ * Name of the parent track.
63
65
  */
64
66
  trackName: string;
65
67
  /**
66
- * Annotation of this MidiClip.
67
- * + It seems that any value can be stored if it's a text value.
68
- * ```js
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
- annotations?: string;
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
- * ```js
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
- * An ID to be assigned for use in UI and other applications.
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 Track name
103
+ * Original name of the track.
95
104
  *
96
- * ```js
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 index
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
- * // how to actual color
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 of this MidiClip.
119
- * + It seems that any value can be stored if it's a text value.
120
- * ```js
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
- annotations?: string;
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
- * Usually the als file name without the extension.
146
+ * Ableton Live project name.
147
+ *
148
+ * + Usually the `.als` filename without its extension.
137
149
  */
138
150
  alsName: string;
139
151
  /**
140
- * ppq (ticks per quarter note)
141
- * + This value is not available in `ALS`, but it is set on the application side.
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
- * NOTE: currently, this is a Midi tracks only.
159
+ *
160
+ * + Currently contains only MIDI tracks.
147
161
  */
148
162
  tracks: TTrackInfo<T>[];
149
163
  /**
150
- * Tempo automation events.
151
- * + Retrieving tempo event data is a bit complicated.
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"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeffy-g/live-midi-types",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "description": "Common TypeScript types for Ableton Live MIDI clip and event data.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",