@jeffy-g/live-midi-types 0.8.3 → 0.9.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
@@ -12,4 +12,4 @@ export * from "./midi-event.js";
12
12
  export * from "./midi-clip.js";
13
13
  export * from "./project.js";
14
14
  export * from "./ableton-colors.js";
15
- export declare const version = "v0.8.3";
15
+ export declare const version = "v0.9.0";
package/dist/index.js CHANGED
@@ -12,4 +12,4 @@ export * from "./midi-event.js";
12
12
  export * from "./midi-clip.js";
13
13
  export * from "./project.js";
14
14
  export * from "./ableton-colors.js";
15
- export const version = "v0.8.3";
15
+ export const version = "v0.9.0";
@@ -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
  */
@@ -9,6 +9,16 @@
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
+ };
12
22
  /**
13
23
  * ```
14
24
  * // Path to `MidiClip` element
@@ -17,11 +27,7 @@
17
27
  * `<MidiClip>/Notes/KeyTracks/KeyTrack[]/Notes/MidiNoteEvent[]`
18
28
  * ```
19
29
  */
20
- export type NoteEvent = {
21
- /**
22
- * NOTE: floating number
23
- */
24
- time: number;
30
+ export type NoteEvent = BaseEvent & {
25
31
  /**
26
32
  * NOTE: floating number
27
33
  * + quarter-note beats
@@ -38,13 +44,7 @@ export type NoteEvent = {
38
44
  */
39
45
  velocity: number;
40
46
  };
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;
47
+ export type ControlChangeEvent = BaseEvent & {
48
48
  /**
49
49
  * MIDI controller number.
50
50
  *
@@ -65,17 +65,33 @@ export type ControlChangeEvent = {
65
65
  source?: "curve" | "single";
66
66
  };
67
67
  /**
68
- * Tempo event object.
68
+ * @date 2026/09/14 06:21:51
69
69
  */
70
- export type TempoEvent = {
70
+ export type ChannelPressureEvent = BaseEvent & {
71
71
  /**
72
- * Time in quarter notes.
72
+ * `0` to `127`
73
73
  *
74
- * Beat-based timestamps (e.g. 4.5 = 4 beats and an eighth note)
74
+ * Value of the ChannelPressure (0-127, floating number).
75
75
  */
76
- time: number;
76
+ value: number;
77
+ };
78
+ /**
79
+ * @date 2026/09/14 06:21:51
80
+ */
81
+ export type PitchBendEvent = BaseEvent & {
82
+ /**
83
+ * `-8192 to 8191` (Live)
84
+ *
85
+ * Value of the PitchBend (floating number).
86
+ */
87
+ value: number;
88
+ };
89
+ /**
90
+ * Tempo event object.
91
+ */
92
+ export type TempoEvent = BaseEvent & {
77
93
  /**
78
- * Tempo in BPM.
94
+ * Tempo in BPM. (floating number)
79
95
  */
80
96
  bpm: number;
81
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeffy-g/live-midi-types",
3
- "version": "0.8.3",
3
+ "version": "0.9.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",