ableton-js 2.1.6 → 2.2.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/CHANGELOG.md CHANGED
@@ -4,8 +4,29 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v2.2.0](https://github.com/leolabs/ableton.js/compare/v2.1.8...v2.2.0)
8
+
9
+ - :memo: Fix details in readme [`#36`](https://github.com/leolabs/ableton.js/pull/36)
10
+ - :bug: Fix errors on quick disconnect/connect [`#42`](https://github.com/leolabs/ableton.js/pull/42)
11
+ - :bug: Fix connected status on load of Ableton class [`#40`](https://github.com/leolabs/ableton.js/pull/40)
12
+ - :wrench: Add GitHub repo to NPM page [`#39`](https://github.com/leolabs/ableton.js/pull/39)
13
+
14
+ #### [v2.1.8](https://github.com/leolabs/ableton.js/compare/v2.1.7...v2.1.8)
15
+
16
+ > 18 February 2022
17
+
18
+ - :sparkles: Add observable props for quantization [`ffd192d`](https://github.com/leolabs/ableton.js/commit/ffd192d1590f33cdd18c2e01dbf66a0bc67878e4)
19
+
20
+ #### [v2.1.7](https://github.com/leolabs/ableton.js/compare/v2.1.6...v2.1.7)
21
+
22
+ > 3 February 2022
23
+
24
+ - :label: Improve types for Ableton's song namespace [`05d24fa`](https://github.com/leolabs/ableton.js/commit/05d24fa28512d206e3eee8d83ecdbfd2f77e4dd0)
25
+
7
26
  #### [v2.1.6](https://github.com/leolabs/ableton.js/compare/v2.1.5...v2.1.6)
8
27
 
28
+ > 30 January 2022
29
+
9
30
  - :sparkles: Return the is_grouped state of tracks as well [`15d8bca`](https://github.com/leolabs/ableton.js/commit/15d8bcad49ab0c4ea5f59aa5288e9c2954f29357)
10
31
 
11
32
  #### [v2.1.5](https://github.com/leolabs/ableton.js/compare/v2.1.4...v2.1.5)
package/README.md CHANGED
@@ -22,8 +22,7 @@ get an overview of the current of your set.
22
22
 
23
23
  To use this library, you'll need to install and activate the MIDI Remote Script
24
24
  in Ableton.js. To do that, copy the `midi-script` folder of this repo to
25
- Ableton's Remote Scripts folder. If you prefer, you can rename it to something
26
- like `AbletonJS` for better identification. The MIDI Remote Scripts folder is
25
+ Ableton's Remote Scripts folder and rename it to `AbletonJS`. The MIDI Remote Scripts folder is
27
26
  usually located at:
28
27
 
29
28
  - **Windows:** {path to Ableton}\Resources\MIDI\Remote Scripts
@@ -55,8 +54,8 @@ const test = async () => {
55
54
  ableton.song.addListener("is_playing", (p) => console.log("Playing:", p));
56
55
  ableton.song.addListener("tempo", (t) => console.log("Tempo:", t));
57
56
 
58
- const cues = await ableton.get("cue_points");
59
- console.log(cues.map((c) => c.raw));
57
+ const tempo = await ableton.song.get("tempo");
58
+ console.log(tempo);
60
59
  };
61
60
 
62
61
  test();
package/index.js CHANGED
@@ -92,7 +92,7 @@ var Ableton = /** @class */ (function (_super) {
92
92
  _this.listenPort = listenPort;
93
93
  _this.msgMap = new Map();
94
94
  _this.eventListeners = new Map();
95
- _this._isConnected = true;
95
+ _this._isConnected = false;
96
96
  _this.cancelConnectionEvent = false;
97
97
  _this.buffer = [];
98
98
  _this.latency = 0;
@@ -123,6 +123,7 @@ var Ableton = /** @class */ (function (_super) {
123
123
  if (this._isConnected && !this.cancelConnectionEvent) {
124
124
  this._isConnected = false;
125
125
  this.eventListeners.clear();
126
+ this.msgMap.forEach(function (msg) { return msg.clearTimeout(); });
126
127
  this.msgMap.clear();
127
128
  this.emit("disconnect", "heartbeat");
128
129
  }
@@ -188,8 +189,9 @@ var Ableton = /** @class */ (function (_super) {
188
189
  return functionCallback.rej(new Error(data.data));
189
190
  }
190
191
  if (data.event === "disconnect") {
191
- this.msgMap.clear();
192
192
  this.eventListeners.clear();
193
+ this.msgMap.forEach(function (msg) { return msg.clearTimeout(); });
194
+ this.msgMap.clear();
193
195
  if (this._isConnected === true) {
194
196
  this._isConnected = false;
195
197
  this.cancelConnectionEvent = true;
@@ -236,7 +238,7 @@ var Ableton = /** @class */ (function (_super) {
236
238
  rej(new TimeoutError([
237
239
  "The command " + cls + "." + name + "(" + arg + ") timed out after " + timeout + " ms.",
238
240
  "Please make sure that Ableton is running and that you have the latest",
239
- "version of AbletonJS' midi script installed, listening on port",
241
+ "version of AbletonJS' midi script installed and renamed to \"AbletonJS\", listening on port",
240
242
  _this.sendPort + " and sending on port " + _this.listenPort + ".",
241
243
  ].join(" "), payload));
242
244
  }, timeout);
@@ -248,6 +250,9 @@ var Ableton = /** @class */ (function (_super) {
248
250
  res(data);
249
251
  },
250
252
  rej: rej,
253
+ clearTimeout: function () {
254
+ clearTimeout(timeoutId);
255
+ },
251
256
  });
252
257
  _this.sendRaw(msg);
253
258
  })];
@@ -10,4 +10,4 @@ class Internal(Interface):
10
10
  return self
11
11
 
12
12
  def get_version(self, ns):
13
- return "2.1.6"
13
+ return "2.2.0"
package/ns/song.d.ts CHANGED
@@ -5,13 +5,13 @@ import { CuePoint, RawCuePoint } from "./cue-point";
5
5
  import { SongView } from "./song-view";
6
6
  import { Scene, RawScene } from "./scene";
7
7
  export interface GettableProperties {
8
- arrangement_overdub: number;
8
+ arrangement_overdub: boolean;
9
9
  back_to_arranger: number;
10
- can_capture_midi: number;
11
- can_jump_to_next_cue: number;
12
- can_jump_to_prev_cue: number;
13
- can_redo: number;
14
- can_undo: number;
10
+ can_capture_midi: boolean;
11
+ can_jump_to_next_cue: boolean;
12
+ can_jump_to_prev_cue: boolean;
13
+ can_redo: boolean;
14
+ can_undo: boolean;
15
15
  clip_trigger_quantization: Quantization;
16
16
  count_in_duration: number;
17
17
  cue_points: RawCuePoint[];
@@ -22,17 +22,17 @@ export interface GettableProperties {
22
22
  is_counting_in: boolean;
23
23
  is_playing: boolean;
24
24
  last_event_time: number;
25
- loop: number;
25
+ loop: boolean;
26
26
  loop_length: number;
27
27
  loop_start: number;
28
28
  master_track: RawTrack;
29
29
  metronome: number;
30
30
  midi_recording_quantization: RecordingQuantization;
31
- nudge_down: number;
32
- nudge_up: number;
33
- overdub: number;
34
- punch_in: number;
35
- punch_out: number;
31
+ nudge_down: boolean;
32
+ nudge_up: boolean;
33
+ overdub: boolean;
34
+ punch_in: boolean;
35
+ punch_out: boolean;
36
36
  re_enable_automation_enabled: number;
37
37
  record_mode: number;
38
38
  return_tracks: RawTrack[];
@@ -60,7 +60,7 @@ export interface TransformedProperties {
60
60
  scenes: Scene[];
61
61
  }
62
62
  export interface SettableProperties {
63
- arrangement_overdub: number;
63
+ arrangement_overdub: boolean;
64
64
  back_to_arranger: number;
65
65
  clip_trigger_quantization: Quantization;
66
66
  count_in_duration: number;
@@ -71,17 +71,17 @@ export interface SettableProperties {
71
71
  is_counting_in: boolean;
72
72
  is_playing: boolean;
73
73
  last_event_time: number;
74
- loop: number;
74
+ loop: boolean;
75
75
  loop_length: number;
76
76
  loop_start: number;
77
77
  master_track: number;
78
78
  metronome: number;
79
79
  midi_recording_quantization: RecordingQuantization;
80
- nudge_down: number;
81
- nudge_up: number;
82
- overdub: number;
83
- punch_in: number;
84
- punch_out: number;
80
+ nudge_down: boolean;
81
+ nudge_up: boolean;
82
+ overdub: boolean;
83
+ punch_in: boolean;
84
+ punch_out: boolean;
85
85
  re_enable_automation_enabled: number;
86
86
  record_mode: number;
87
87
  return_tracks: number;
@@ -99,11 +99,12 @@ export interface SettableProperties {
99
99
  visible_tracks: number;
100
100
  }
101
101
  export interface ObservableProperties {
102
- arrangement_overdub: number;
102
+ arrangement_overdub: boolean;
103
103
  back_to_arranger: number;
104
- can_capture_midi: number;
105
- can_jump_to_next_cue: number;
106
- can_jump_to_prev_cue: number;
104
+ can_capture_midi: boolean;
105
+ can_jump_to_next_cue: boolean;
106
+ can_jump_to_prev_cue: boolean;
107
+ clip_trigger_quantization: Quantization;
107
108
  count_in_duration: number;
108
109
  cue_points: number;
109
110
  current_song_time: number;
@@ -113,14 +114,15 @@ export interface ObservableProperties {
113
114
  is_counting_in: boolean;
114
115
  is_playing: boolean;
115
116
  loop_length: number;
116
- loop: number;
117
+ loop: boolean;
117
118
  loop_start: number;
118
119
  metronome: number;
119
- nudge_down: number;
120
- nudge_up: number;
121
- overdub: number;
122
- punch_in: number;
123
- punch_out: number;
120
+ midi_recording_quantization: RecordingQuantization;
121
+ nudge_down: boolean;
122
+ nudge_up: boolean;
123
+ overdub: boolean;
124
+ punch_in: boolean;
125
+ punch_out: boolean;
124
126
  re_enable_automation_enabled: number;
125
127
  record_mode: number;
126
128
  return_tracks: RawTrack[];
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "ableton-js",
3
- "version": "2.1.6",
3
+ "version": "2.2.0",
4
4
  "description": "Control Ableton Live from Node",
5
5
  "main": "index.js",
6
6
  "author": "Leo Bernard <admin@leolabs.org>",
7
7
  "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/leolabs/ableton-js.git"
11
+ },
8
12
  "files": [
9
13
  "**/*.js",
10
14
  "**/*.d.ts",