ableton-js 3.1.8 → 3.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 +16 -0
- package/README.md +3 -6
- package/index.d.ts +36 -4
- package/index.js +316 -528
- package/midi-script/Socket.py +27 -4
- package/midi-script/version.py +1 -1
- package/ns/application-view.d.ts +3 -3
- package/ns/application-view.js +30 -116
- package/ns/application-view.spec.js +7 -57
- package/ns/application.js +10 -68
- package/ns/application.spec.js +7 -57
- package/ns/clip-slot.js +26 -43
- package/ns/clip.js +68 -132
- package/ns/cue-point.js +10 -67
- package/ns/device-parameter.js +9 -26
- package/ns/device.js +12 -29
- package/ns/index.d.ts +2 -2
- package/ns/index.js +47 -98
- package/ns/internal.js +11 -73
- package/ns/midi.js +18 -36
- package/ns/mixer-device.js +20 -37
- package/ns/mixer-device.spec.js +9 -64
- package/ns/scene.js +14 -73
- package/ns/song-view.js +21 -79
- package/ns/song-view.spec.js +7 -57
- package/ns/song.js +105 -271
- package/ns/song.spec.js +25 -112
- package/ns/track.js +23 -44
- package/package.json +6 -6
- package/util/cache.d.ts +3 -3
- package/util/cache.js +1 -3
- package/util/color.js +21 -33
- package/util/note.d.ts +1 -1
- package/util/note.js +4 -4
- package/util/package-version.js +5 -5
- package/util/package-version.spec.js +6 -6
- package/util/tests.js +12 -62
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,24 @@ 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
|
+
#### [v3.2.0](https://github.com/leolabs/ableton.js/compare/v3.1.9...v3.2.0)
|
|
8
|
+
|
|
9
|
+
- :package: Upgrade TypeScript and related deps [`f1c3479`](https://github.com/leolabs/ableton.js/commit/f1c34791deaf6ea6f3040d957741756be0cb454c)
|
|
10
|
+
- :sparkles: Allow changing the timeout for commands [`d216432`](https://github.com/leolabs/ableton.js/commit/d21643289b53cb727bd438a1a0aebb3f275bcad7)
|
|
11
|
+
- :memo: Document class options [`b6c8b7c`](https://github.com/leolabs/ableton.js/commit/b6c8b7c2ed6242f78dd3b5d7343f98c984b1f59c)
|
|
12
|
+
|
|
13
|
+
#### [v3.1.9](https://github.com/leolabs/ableton.js/compare/v3.1.8...v3.1.9)
|
|
14
|
+
|
|
15
|
+
> 8 June 2023
|
|
16
|
+
|
|
17
|
+
- :bug: Fix issue that could block the main thread in Live sometimes when no client port file exists [`8990a5d`](https://github.com/leolabs/ableton.js/commit/8990a5d00e0ae3a314a385f6748be39dd87cde90)
|
|
18
|
+
- :memo: Update the link to unofficial API docs [`7a32f90`](https://github.com/leolabs/ableton.js/commit/7a32f90d273a3ef05aac22105e253235b66a6c97)
|
|
19
|
+
- :bug: Fix copying the scripts not working if the Remote Scripts folder doesn't exist yet [`71ecf44`](https://github.com/leolabs/ableton.js/commit/71ecf44aadb843509c4ad92b27ddd0b27badfda1)
|
|
20
|
+
|
|
7
21
|
#### [v3.1.8](https://github.com/leolabs/ableton.js/compare/v3.1.7...v3.1.8)
|
|
8
22
|
|
|
23
|
+
> 10 May 2023
|
|
24
|
+
|
|
9
25
|
- :fire: Remove the postinstall hook [`d55efec`](https://github.com/leolabs/ableton.js/commit/d55efec00110398610d9f62457f5daa86293d985)
|
|
10
26
|
- :bug: Fix type annotations which are unsupported in Live 10 [`b396684`](https://github.com/leolabs/ableton.js/commit/b3966844d1bf5f4d0f4c0d3b789b9386f82d7e72)
|
|
11
27
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Ableton.js lets you control your instance or instances of Ableton using Node.js.
|
|
|
6
6
|
It tries to cover as many functions as possible.
|
|
7
7
|
|
|
8
8
|
This package is still a work-in-progress. My goal is to expose all of
|
|
9
|
-
[Ableton's MIDI Remote Script](https://
|
|
9
|
+
[Ableton's MIDI Remote Script](https://nsuspray.github.io/Live_API_Doc/11.0.0.xml)
|
|
10
10
|
functions to TypeScript. If you'd like to contribute, please feel free to do so.
|
|
11
11
|
|
|
12
12
|
## Sponsored Message
|
|
@@ -23,11 +23,8 @@ get an overview of the current state of your set.
|
|
|
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
25
|
Ableton's Remote Scripts folder and rename it to `AbletonJS`. The MIDI Remote
|
|
26
|
-
Scripts folder is usually located at
|
|
27
|
-
|
|
28
|
-
- **Windows:** {path to Ableton}\Resources\MIDI\Remote Scripts
|
|
29
|
-
- **macOS:** /Applications/Ableton Live {version}/Contents/App-Resources/MIDI
|
|
30
|
-
Remote Scripts
|
|
26
|
+
Scripts folder is usually located at
|
|
27
|
+
`~/Music/Ableton/User Library/Remote Scripts`
|
|
31
28
|
|
|
32
29
|
After starting Ableton Live, add the script to your list of control surfaces:
|
|
33
30
|
|
package/index.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ interface Command {
|
|
|
18
18
|
[k: string]: any;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
type DisconnectEventType = "realtime" | "heartbeat";
|
|
22
|
+
type ConnectEventType = DisconnectEventType | "start";
|
|
23
23
|
interface ConnectionEventEmitter {
|
|
24
24
|
on(e: "connect", l: (t: ConnectEventType) => void): this;
|
|
25
25
|
on(e: "disconnect", l: (t: DisconnectEventType) => void): this;
|
|
@@ -38,10 +38,42 @@ export declare class TimeoutError extends Error {
|
|
|
38
38
|
constructor(message: string, payload: Command);
|
|
39
39
|
}
|
|
40
40
|
export interface AbletonOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Name of the file containing the port of the Remote Script. This
|
|
43
|
+
* file is expected to be in the OS' tmp directory.
|
|
44
|
+
*
|
|
45
|
+
* @default ableton-js-server.port
|
|
46
|
+
*/
|
|
41
47
|
serverPortFile?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Name of the file containing the port of the client. This file
|
|
50
|
+
* is created in the OS' tmp directory if it doesn't exist yet.
|
|
51
|
+
*
|
|
52
|
+
* @default ableton-js-client.port
|
|
53
|
+
*/
|
|
42
54
|
clientPortFile?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Defines how regularly ableton-js should ping the Remote Script
|
|
57
|
+
* to check if it's still reachable, in milliseconds.
|
|
58
|
+
*
|
|
59
|
+
* @default 2000
|
|
60
|
+
*/
|
|
43
61
|
heartbeatInterval?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Defines how long ableton-js waits for an answer from the Remote
|
|
64
|
+
* Script after sending a command before throwing a timeout error.
|
|
65
|
+
*
|
|
66
|
+
* @default 2000
|
|
67
|
+
*/
|
|
68
|
+
commandTimeoutMs?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Options for the response cache.
|
|
71
|
+
*/
|
|
44
72
|
cacheOptions?: LruCache.Options<string, any>;
|
|
73
|
+
/**
|
|
74
|
+
* Set this to allow ableton-js to log messages. If you set this to
|
|
75
|
+
* `console`, log messages are printed to the standard output.
|
|
76
|
+
*/
|
|
45
77
|
logger?: Logger;
|
|
46
78
|
}
|
|
47
79
|
export declare class Ableton extends EventEmitter implements ConnectionEventEmitter {
|
|
@@ -94,8 +126,8 @@ export declare class Ableton extends EventEmitter implements ConnectionEventEmit
|
|
|
94
126
|
* Sends a raw command to Ableton. Usually, you won't need this.
|
|
95
127
|
* A good starting point in general is the `song` prop.
|
|
96
128
|
*/
|
|
97
|
-
sendCommand(command: Omit<Command, "uuid"
|
|
98
|
-
sendCachedCommand(command: Omit<Command, "uuid" | "cache"
|
|
129
|
+
sendCommand(command: Omit<Command, "uuid">): Promise<any>;
|
|
130
|
+
sendCachedCommand(command: Omit<Command, "uuid" | "cache">): Promise<any>;
|
|
99
131
|
getProp(ns: string, nsid: string | undefined, prop: string, cache?: boolean): Promise<any>;
|
|
100
132
|
setProp(ns: string, nsid: string | undefined, prop: string, value: any): Promise<any>;
|
|
101
133
|
addPropListener(ns: string, nsid: string | undefined, prop: string, listener: (data: any) => any): Promise<() => Promise<boolean | undefined>>;
|