ableton-js 2.7.2 → 2.7.4

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,22 @@ 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.7.4](https://github.com/leolabs/ableton.js/compare/v2.7.3...v2.7.4)
8
+
9
+ - :sparkles: Add a fire() function to scenes [`96e603d`](https://github.com/leolabs/ableton.js/commit/96e603df99df6a0d3b57ed2b4ccc674f2f14695f)
10
+
11
+ #### [v2.7.3](https://github.com/leolabs/ableton.js/compare/v2.7.2...v2.7.3)
12
+
13
+ > 17 December 2022
14
+
15
+ - Add functionality for getting warp markers [`#61`](https://github.com/leolabs/ableton.js/pull/61)
16
+ - :sparkles: Support passing a clip object to duplicateClipToArrangement [`ab9656a`](https://github.com/leolabs/ableton.js/commit/ab9656ac9f45a12afb41327793b0b287c8d798e6)
17
+ - :bug: Fix `create_*_track` functions not working properly [`937edca`](https://github.com/leolabs/ableton.js/commit/937edca2c3bc5ad65d1bccc7f07c9642a25093ab)
18
+
7
19
  #### [v2.7.2](https://github.com/leolabs/ableton.js/compare/v2.7.1...v2.7.2)
8
20
 
21
+ > 10 November 2022
22
+
9
23
  - :bug: Fix runtime error caused by accessing a missing variable [`83427ac`](https://github.com/leolabs/ableton.js/commit/83427acafffb276fda2573555332372be608c4bf)
10
24
 
11
25
  #### [v2.7.1](https://github.com/leolabs/ableton.js/compare/v2.7.0...v2.7.1)
@@ -29,6 +29,15 @@ class Clip(Interface):
29
29
  def get_notes(self, ns, from_time=0, from_pitch=0, time_span=99999999999999, pitch_span=128):
30
30
  return ns.get_notes(from_time, from_pitch, time_span, pitch_span)
31
31
 
32
+ def get_warp_markers(self, ns):
33
+ dict_markers = []
34
+ for warp_marker in ns.warp_markers:
35
+ dict_markers.append({
36
+ "beat_time": warp_marker.beat_time,
37
+ "sample_time": warp_marker.sample_time,
38
+ })
39
+ return dict_markers
40
+
32
41
  def set_notes(self, ns, notes):
33
42
  return ns.set_notes(tuple(notes))
34
43
 
@@ -10,4 +10,4 @@ class Internal(Interface):
10
10
  return self
11
11
 
12
12
  def get_version(self, ns):
13
- return "2.7.2"
13
+ return "2.7.4"
package/ns/clip.d.ts CHANGED
@@ -34,6 +34,10 @@ export declare enum LaunchQuantization {
34
34
  QSixteenthTriplet = 13,
35
35
  QThirtySecond = 14
36
36
  }
37
+ interface WarpMarker {
38
+ beat_time: number;
39
+ sample_time: number;
40
+ }
37
41
  export interface GettableProperties {
38
42
  available_warp_modes: WarpMode[];
39
43
  color: number;
@@ -72,6 +76,7 @@ export interface GettableProperties {
72
76
  start_time: number;
73
77
  velocity_amount: number;
74
78
  warp_mode: WarpMode;
79
+ warp_markers: WarpMarker[];
75
80
  warping: boolean;
76
81
  will_record_on_start: boolean;
77
82
  }
@@ -259,3 +264,4 @@ export declare class Clip extends Namespace<GettableProperties, TransformedPrope
259
264
  */
260
265
  stopScrub(): Promise<void>;
261
266
  }
267
+ export {};
package/ns/scene.d.ts CHANGED
@@ -35,4 +35,9 @@ export interface RawScene {
35
35
  export declare class Scene extends Namespace<GettableProperties, TransformedProperties, SettableProperties, ObservableProperties> {
36
36
  raw: RawScene;
37
37
  constructor(ableton: Ableton, raw: RawScene);
38
+ /**
39
+ * Fire the scene directly. Will fire all clip slots
40
+ * that this scene owns and select the scene itself.
41
+ */
42
+ fire(): Promise<any>;
38
43
  }
package/ns/scene.js CHANGED
@@ -14,6 +14,42 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
17
53
  Object.defineProperty(exports, "__esModule", { value: true });
18
54
  exports.Scene = void 0;
19
55
  var _1 = require(".");
@@ -33,6 +69,17 @@ var Scene = /** @class */ (function (_super) {
33
69
  };
34
70
  return _this;
35
71
  }
72
+ /**
73
+ * Fire the scene directly. Will fire all clip slots
74
+ * that this scene owns and select the scene itself.
75
+ */
76
+ Scene.prototype.fire = function () {
77
+ return __awaiter(this, void 0, void 0, function () {
78
+ return __generator(this, function (_a) {
79
+ return [2 /*return*/, this.sendCommand("fire")];
80
+ });
81
+ });
82
+ };
36
83
  return Scene;
37
84
  }(_1.Namespace));
38
85
  exports.Scene = Scene;
package/ns/song.d.ts CHANGED
@@ -185,7 +185,7 @@ export declare class Song extends Namespace<GettableProperties, TransformedPrope
185
185
  continuePlaying(): Promise<any>;
186
186
  createAudioTrack(index?: number): Promise<any>;
187
187
  createMidiTrack(index?: number): Promise<any>;
188
- createReturnTrack(index?: number): Promise<any>;
188
+ createReturnTrack(): Promise<any>;
189
189
  createScene(index?: number): Promise<any>;
190
190
  deleteReturnTrack(index: number): Promise<any>;
191
191
  deleteScene(index: number): Promise<any>;
package/ns/song.js CHANGED
@@ -135,21 +135,21 @@ var Song = /** @class */ (function (_super) {
135
135
  Song.prototype.createAudioTrack = function (index) {
136
136
  return __awaiter(this, void 0, void 0, function () {
137
137
  return __generator(this, function (_a) {
138
- return [2 /*return*/, this.sendCommand("create_audio_track", [index])];
138
+ return [2 /*return*/, this.sendCommand("create_audio_track", { index: index })];
139
139
  });
140
140
  });
141
141
  };
142
142
  Song.prototype.createMidiTrack = function (index) {
143
143
  return __awaiter(this, void 0, void 0, function () {
144
144
  return __generator(this, function (_a) {
145
- return [2 /*return*/, this.sendCommand("create_midi_track", [index])];
145
+ return [2 /*return*/, this.sendCommand("create_midi_track", { index: index })];
146
146
  });
147
147
  });
148
148
  };
149
- Song.prototype.createReturnTrack = function (index) {
149
+ Song.prototype.createReturnTrack = function () {
150
150
  return __awaiter(this, void 0, void 0, function () {
151
151
  return __generator(this, function (_a) {
152
- return [2 /*return*/, this.sendCommand("create_return_track", [index])];
152
+ return [2 /*return*/, this.sendCommand("create_return_track")];
153
153
  });
154
154
  });
155
155
  };
package/ns/track.d.ts CHANGED
@@ -120,5 +120,9 @@ export interface RawTrack {
120
120
  export declare class Track extends Namespace<GettableProperties, TransformedProperties, SettableProperties, ObservableProperties> {
121
121
  raw: RawTrack;
122
122
  constructor(ableton: Ableton, raw: RawTrack);
123
- duplicateClipToArrangement(clipID: number, time: number): Promise<any>;
123
+ /**
124
+ * Duplicates the given clip into the arrangement of this track at the provided destination time and returns it.
125
+ * When the type of the clip and the type of the track are incompatible, a runtime error is raised.
126
+ */
127
+ duplicateClipToArrangement(clipOrId: Clip | number, time: number): Promise<any>;
124
128
  }
package/ns/track.js CHANGED
@@ -43,9 +43,13 @@ var Track = /** @class */ (function (_super) {
43
43
  };
44
44
  return _this;
45
45
  }
46
- Track.prototype.duplicateClipToArrangement = function (clipID, time) {
46
+ /**
47
+ * Duplicates the given clip into the arrangement of this track at the provided destination time and returns it.
48
+ * When the type of the clip and the type of the track are incompatible, a runtime error is raised.
49
+ */
50
+ Track.prototype.duplicateClipToArrangement = function (clipOrId, time) {
47
51
  return this.sendCommand("duplicate_clip_to_arrangement", {
48
- clip_id: clipID,
52
+ clip_id: typeof clipOrId === "number" ? clipOrId : clipOrId.raw.id,
49
53
  time: time,
50
54
  });
51
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ableton-js",
3
- "version": "2.7.2",
3
+ "version": "2.7.4",
4
4
  "description": "Control Ableton Live from Node",
5
5
  "main": "index.js",
6
6
  "author": "Leo Bernard <admin@leolabs.org>",