@jeffy-g/live-midi-types 0.8.1 → 0.8.2

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.8.1";
5
+ export declare const version = "v0.8.2";
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.8.1";
5
+ export const version = "v0.8.2";
@@ -28,6 +28,18 @@ export type TMidiClipData = {
28
28
  clipStartInBeats: number;
29
29
  /**
30
30
  * Length of the clip (in beats). Usually `CurrentEnd.Value - CurrentStart.Value`.
31
+ *
32
+ * ```
33
+ * // e.g. obtain `midiClip` object
34
+ * // xpath: "/Ableton/LiveSet/Tracks/MidiTrack[0]/DeviceChain/MainSequencer/ClipTimeable/ArrangerAutomation/Events/MidiClip[0]"
35
+ * const midiClip = Ableton.LiveSet.Tracks.MidiTrack[0].DeviceChain.MainSequencer.ClipTimeable.ArrangerAutomation.Events.MidiClip[0];
36
+ * // clip start position in Live arrangement view
37
+ * const clipStart = midiClip.CurrentStart.Value;
38
+ * // clip end position in Live arrangement view
39
+ * const clipEnd = midiClip.CurrentEnd.Value;
40
+ * // calculate clip range
41
+ * const clipLength = +clipEnd - +clipStart;
42
+ * ```
31
43
  */
32
44
  clipLength: number;
33
45
  /**
@@ -35,7 +47,7 @@ export type TMidiClipData = {
35
47
  */
36
48
  adjustTimeOftempee: number;
37
49
  /**
38
- * List of known CC events in this clip.
50
+ * CC numbers known to this clip, sorted in ascending order.
39
51
  *
40
52
  * {@link TMidiClipData.ccMap __`ccMap`__}
41
53
  */
@@ -24,10 +24,12 @@ export type NoteEvent = {
24
24
  time: number;
25
25
  /**
26
26
  * NOTE: floating number
27
+ * + quarter-note beats
27
28
  */
28
29
  duration: number;
29
30
  /**
30
- * NOTE: Must be an integer. Floating-point values are not valid.
31
+ * NOTE: Must be an integer. Floating-point values are invalid.
32
+ * + `0..127` integer
31
33
  */
32
34
  pitch: number;
33
35
  /**
@@ -45,6 +47,9 @@ export type ControlChangeEvent = {
45
47
  time: number;
46
48
  /**
47
49
  * MIDI controller number.
50
+ *
51
+ * NOTE: Must be an integer. Floating-point values are invalid.
52
+ * + `0..127` integer
48
53
  */
49
54
  controller: number;
50
55
  /**
@@ -55,6 +60,7 @@ export type ControlChangeEvent = {
55
60
  value: number;
56
61
  /**
57
62
  * Source type: "curve" for interpolated, "single" for discrete.
63
+ * + In **LME**, the "curve" is assigned to Bezier events, while it is omitted in regular discrete events.
58
64
  */
59
65
  source?: "curve" | "single";
60
66
  };
package/dist/project.d.ts CHANGED
@@ -40,7 +40,7 @@ export type TClipSummary<T extends Record<string, any>> = {
40
40
  * "/Ableton/LiveSet/Tracks/MidiTrack/DeviceChain/MainSequencer/ClipTimeable/ArrangerAutomation/Events/MidiClip/Color/@Value"
41
41
  *
42
42
  * // how to actual color
43
- * // "0" or "12" to "#ff94a6" / "#e553a0"
43
+ * // e.g - "0" to "#ff94a6", "12" to "#e553a0"
44
44
  * const hexColor = getColorFromIndex(+clip.color);
45
45
  * ```
46
46
  *
@@ -95,7 +95,7 @@ export type TTrackInfo<T extends Record<string, any>> = {
95
95
  *
96
96
  * ```
97
97
  * // e.g.
98
- * "clip-" + crypto.randomUUID()
98
+ * "track-" + crypto.randomUUID()
99
99
  * ```
100
100
  */
101
101
  id: string;
@@ -117,8 +117,8 @@ export type TTrackInfo<T extends Record<string, any>> = {
117
117
  * "/Ableton/LiveSet/Tracks/MidiTrack/Color/@Value"
118
118
  *
119
119
  * // Convert the index to a CSS color:
120
- * // "0" or "12" to "#ff94a6" / "#e553a0"
121
- * const hexColor = getColorFromIndex(+clip.color);
120
+ * // e.g - "0" to "#ff94a6", "12" to "#e553a0"
121
+ * const hexColor = getColorFromIndex(+track.color);
122
122
  * ```
123
123
  * @see {@link getColorFromIndex}
124
124
  */
@@ -134,7 +134,7 @@ export type TTrackInfo<T extends Record<string, any>> = {
134
134
  */
135
135
  annotation: string;
136
136
  /**
137
- * MIDI clips indexed by clip name.
137
+ * MIDI clips indexed by {@linkcode TClipSummary.id TClipSummary.id}
138
138
  */
139
139
  clips: Record<string, TClipSummary<T>>;
140
140
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeffy-g/live-midi-types",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Common TypeScript types for Ableton Live MIDI clip and event data.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",