ableton-js 2.3.4 → 2.4.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 +7 -0
- package/index.js +7 -5
- package/midi-script/Internal.py +1 -1
- package/midi-script/Socket.py +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,15 @@ 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.4.0](https://github.com/leolabs/ableton.js/compare/v2.3.4...v2.4.0)
|
|
8
|
+
|
|
9
|
+
- :wrench: Use ports 39031 and 39041 to avoid collisions with other applications [`e3bd84c`](https://github.com/leolabs/ableton.js/commit/e3bd84cadf92af5d648533fd656c90722f5d8ab2)
|
|
10
|
+
- :sparkles: Run the heartbeat check once after initializing the class [`8db0bd6`](https://github.com/leolabs/ableton.js/commit/8db0bd66f5dec534f38c1319cacd2cc91da89f6a)
|
|
11
|
+
|
|
7
12
|
#### [v2.3.4](https://github.com/leolabs/ableton.js/compare/v2.3.3...v2.3.4)
|
|
8
13
|
|
|
14
|
+
> 1 May 2022
|
|
15
|
+
|
|
9
16
|
- :sparkles: Return the start and end time of clips in the raw clip [`1862efe`](https://github.com/leolabs/ableton.js/commit/1862efe6c6e8bc4d894cdce9b376e1fde93c8c7b)
|
|
10
17
|
|
|
11
18
|
#### [v2.3.3](https://github.com/leolabs/ableton.js/compare/v2.3.2...v2.3.3)
|
package/index.js
CHANGED
|
@@ -84,8 +84,8 @@ var Ableton = /** @class */ (function (_super) {
|
|
|
84
84
|
__extends(Ableton, _super);
|
|
85
85
|
function Ableton(host, sendPort, listenPort, heartbeatInterval) {
|
|
86
86
|
if (host === void 0) { host = "127.0.0.1"; }
|
|
87
|
-
if (sendPort === void 0) { sendPort =
|
|
88
|
-
if (listenPort === void 0) { listenPort =
|
|
87
|
+
if (sendPort === void 0) { sendPort = 39041; }
|
|
88
|
+
if (listenPort === void 0) { listenPort = 39031; }
|
|
89
89
|
if (heartbeatInterval === void 0) { heartbeatInterval = 2000; }
|
|
90
90
|
var _this = _super.call(this) || this;
|
|
91
91
|
_this.host = host;
|
|
@@ -100,10 +100,10 @@ var Ableton = /** @class */ (function (_super) {
|
|
|
100
100
|
_this.song = new song_1.Song(_this);
|
|
101
101
|
_this.application = new application_1.Application(_this);
|
|
102
102
|
_this.internal = new internal_1.Internal(_this);
|
|
103
|
-
_this.client = dgram_1.default.createSocket({ type: "udp4"
|
|
103
|
+
_this.client = dgram_1.default.createSocket({ type: "udp4" });
|
|
104
104
|
_this.client.bind(_this.listenPort, host);
|
|
105
105
|
_this.client.addListener("message", _this.handleIncoming.bind(_this));
|
|
106
|
-
|
|
106
|
+
var heartbeat = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
107
107
|
var e_1;
|
|
108
108
|
return __generator(this, function (_a) {
|
|
109
109
|
switch (_a.label) {
|
|
@@ -133,7 +133,9 @@ var Ableton = /** @class */ (function (_super) {
|
|
|
133
133
|
case 4: return [2 /*return*/];
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
-
}); }
|
|
136
|
+
}); };
|
|
137
|
+
_this.heartbeatInterval = setInterval(heartbeat, heartbeatInterval);
|
|
138
|
+
heartbeat();
|
|
137
139
|
_this.internal
|
|
138
140
|
.get("version")
|
|
139
141
|
.then(function (v) {
|
package/midi-script/Internal.py
CHANGED
package/midi-script/Socket.py
CHANGED
|
@@ -22,10 +22,11 @@ class Socket(object):
|
|
|
22
22
|
def set_message(func):
|
|
23
23
|
Socket.show_message = func
|
|
24
24
|
|
|
25
|
-
def __init__(self, handler, remotehost='127.0.0.1', remoteport=
|
|
25
|
+
def __init__(self, handler, remotehost='127.0.0.1', remoteport=39031, localhost='127.0.0.1', localport=39041):
|
|
26
26
|
self.input_handler = handler
|
|
27
27
|
|
|
28
|
-
self._socket = socket.socket(
|
|
28
|
+
self._socket = socket.socket(
|
|
29
|
+
socket.AF_INET, socket.SOCK_DGRAM)
|
|
29
30
|
self._socket.setblocking(0)
|
|
30
31
|
|
|
31
32
|
self._local_addr = (localhost, localport)
|