ableton-js 2.7.0 → 2.7.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/CHANGELOG.md +12 -0
- package/index.js +1 -3
- package/midi-script/Clip.py +3 -0
- package/midi-script/Internal.py +1 -1
- package/ns/clip.d.ts +2 -0
- package/ns/clip.js +7 -6
- package/ns/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,20 @@ 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.2](https://github.com/leolabs/ableton.js/compare/v2.7.1...v2.7.2)
|
|
8
|
+
|
|
9
|
+
- :bug: Fix runtime error caused by accessing a missing variable [`83427ac`](https://github.com/leolabs/ableton.js/commit/83427acafffb276fda2573555332372be608c4bf)
|
|
10
|
+
|
|
11
|
+
#### [v2.7.1](https://github.com/leolabs/ableton.js/compare/v2.7.0...v2.7.1)
|
|
12
|
+
|
|
13
|
+
> 10 November 2022
|
|
14
|
+
|
|
15
|
+
- :sparkles: Add the ability to listen to changes in clip notes [`a1c5112`](https://github.com/leolabs/ableton.js/commit/a1c5112542261493b6c55289c203e7250c7b7d15)
|
|
16
|
+
|
|
7
17
|
#### [v2.7.0](https://github.com/leolabs/ableton.js/compare/v2.6.0...v2.7.0)
|
|
8
18
|
|
|
19
|
+
> 2 November 2022
|
|
20
|
+
|
|
9
21
|
- :sparkles: Add automatic client-side caching of potentially large props [`68c3edd`](https://github.com/leolabs/ableton.js/commit/68c3edda00918c769afa7c88e54a2a566a0e1f23)
|
|
10
22
|
- :art: Clean up the code a bit [`c183cda`](https://github.com/leolabs/ableton.js/commit/c183cda10deb81e176992ed40624d3f57015a703)
|
|
11
23
|
- :memo: Add some docs for caching [`778da44`](https://github.com/leolabs/ableton.js/commit/778da44ab960cb5074b46e4783abf3d0c57d5a9f)
|
package/index.js
CHANGED
|
@@ -267,7 +267,7 @@ var Ableton = /** @class */ (function (_super) {
|
|
|
267
267
|
? command.ns + "(" + command.nsid + ")"
|
|
268
268
|
: command.ns;
|
|
269
269
|
rej(new TimeoutError([
|
|
270
|
-
"The command " + cls + "." + name + "(" + arg + ") timed out after " + timeout + " ms.",
|
|
270
|
+
"The command " + cls + "." + command.name + "(" + arg + ") timed out after " + timeout + " ms.",
|
|
271
271
|
"Please make sure that Ableton is running and that you have the latest",
|
|
272
272
|
"version of AbletonJS' midi script installed and renamed to \"AbletonJS\", listening on port",
|
|
273
273
|
_this.sendPort + " and sending on port " + _this.listenPort + ".",
|
|
@@ -308,13 +308,11 @@ var Ableton = /** @class */ (function (_super) {
|
|
|
308
308
|
throw new Error("Tried to get an object that isn't cached.");
|
|
309
309
|
}
|
|
310
310
|
else {
|
|
311
|
-
console.log("Using cached entry:", { cached: cached });
|
|
312
311
|
return [2 /*return*/, cached.data];
|
|
313
312
|
}
|
|
314
313
|
}
|
|
315
314
|
else {
|
|
316
315
|
if (result.etag) {
|
|
317
|
-
console.log("Setting cached entry:", { cacheKey: cacheKey, result: result });
|
|
318
316
|
this.cache.set(cacheKey, result);
|
|
319
317
|
}
|
|
320
318
|
return [2 /*return*/, result.data];
|
package/midi-script/Clip.py
CHANGED
|
@@ -26,6 +26,9 @@ class Clip(Interface):
|
|
|
26
26
|
def get_available_warp_modes(self, ns):
|
|
27
27
|
return list(ns.available_warp_modes)
|
|
28
28
|
|
|
29
|
+
def get_notes(self, ns, from_time=0, from_pitch=0, time_span=99999999999999, pitch_span=128):
|
|
30
|
+
return ns.get_notes(from_time, from_pitch, time_span, pitch_span)
|
|
31
|
+
|
|
29
32
|
def set_notes(self, ns, notes):
|
|
30
33
|
return ns.set_notes(tuple(notes))
|
|
31
34
|
|
package/midi-script/Internal.py
CHANGED
package/ns/clip.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ export interface GettableProperties {
|
|
|
77
77
|
}
|
|
78
78
|
export interface TransformedProperties {
|
|
79
79
|
color: Color;
|
|
80
|
+
notes: Note[];
|
|
80
81
|
selected_notes: Note[];
|
|
81
82
|
}
|
|
82
83
|
export interface SettableProperties {
|
|
@@ -117,6 +118,7 @@ export interface ObservableProperties {
|
|
|
117
118
|
loop_start: number;
|
|
118
119
|
muted: boolean;
|
|
119
120
|
name: string;
|
|
121
|
+
notes: NoteTuple[];
|
|
120
122
|
pitch_coarse: number;
|
|
121
123
|
pitch_fine: number;
|
|
122
124
|
playing_position: number;
|
package/ns/clip.js
CHANGED
|
@@ -99,6 +99,7 @@ var Clip = /** @class */ (function (_super) {
|
|
|
99
99
|
_this.raw = raw;
|
|
100
100
|
_this.transformers = {
|
|
101
101
|
color: function (c) { return new color_1.Color(c); },
|
|
102
|
+
notes: function (n) { return n.map(note_1.tupleToNote); },
|
|
102
103
|
selected_notes: function (n) { return n.map(note_1.tupleToNote); },
|
|
103
104
|
};
|
|
104
105
|
return _this;
|
|
@@ -183,12 +184,12 @@ var Clip = /** @class */ (function (_super) {
|
|
|
183
184
|
var notes;
|
|
184
185
|
return __generator(this, function (_a) {
|
|
185
186
|
switch (_a.label) {
|
|
186
|
-
case 0: return [4 /*yield*/, this.sendCommand("get_notes",
|
|
187
|
-
fromTime,
|
|
188
|
-
fromPitch,
|
|
189
|
-
timeSpan,
|
|
190
|
-
pitchSpan,
|
|
191
|
-
|
|
187
|
+
case 0: return [4 /*yield*/, this.sendCommand("get_notes", {
|
|
188
|
+
from_time: fromTime,
|
|
189
|
+
from_pitch: fromPitch,
|
|
190
|
+
time_span: timeSpan,
|
|
191
|
+
pitch_span: pitchSpan,
|
|
192
|
+
})];
|
|
192
193
|
case 1:
|
|
193
194
|
notes = _a.sent();
|
|
194
195
|
return [2 /*return*/, notes.map(note_1.tupleToNote)];
|
package/ns/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare class Namespace<GP, TP, SP, OP> {
|
|
|
4
4
|
protected ns: string;
|
|
5
5
|
protected nsid?: string | undefined;
|
|
6
6
|
protected transformers: Partial<{
|
|
7
|
-
[T in
|
|
7
|
+
[T in keyof TP]: (val: T extends keyof GP ? GP[T] : unknown) => TP[T];
|
|
8
8
|
}>;
|
|
9
9
|
protected cachedProps: Partial<{
|
|
10
10
|
[T in keyof GP]: boolean;
|