ableton-js 3.7.2 → 4.0.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/hooks/prepublish.js +13 -5
  3. package/index.d.ts +16 -15
  4. package/index.js +52 -58
  5. package/midi-script/AbletonJS.py +1 -1
  6. package/midi-script/Socket.py +20 -7
  7. package/midi-script/version.py +1 -1
  8. package/ns/application-view.d.ts +2 -2
  9. package/ns/application-view.js +4 -8
  10. package/ns/application.d.ts +4 -4
  11. package/ns/application.js +6 -10
  12. package/ns/browser-item.d.ts +2 -2
  13. package/ns/browser-item.js +2 -6
  14. package/ns/browser.d.ts +3 -3
  15. package/ns/browser.js +5 -9
  16. package/ns/clip-slot.d.ts +4 -4
  17. package/ns/clip-slot.js +8 -12
  18. package/ns/clip.d.ts +5 -5
  19. package/ns/clip.js +16 -20
  20. package/ns/cue-point.d.ts +2 -2
  21. package/ns/cue-point.js +2 -6
  22. package/ns/device-parameter.d.ts +2 -2
  23. package/ns/device-parameter.js +6 -10
  24. package/ns/device.d.ts +3 -3
  25. package/ns/device.js +6 -10
  26. package/ns/index.d.ts +1 -1
  27. package/ns/index.js +1 -5
  28. package/ns/internal.d.ts +2 -2
  29. package/ns/internal.js +5 -12
  30. package/ns/midi.d.ts +2 -2
  31. package/ns/midi.js +5 -10
  32. package/ns/mixer-device.d.ts +3 -3
  33. package/ns/mixer-device.js +16 -20
  34. package/ns/scene.d.ts +4 -4
  35. package/ns/scene.js +6 -10
  36. package/ns/session.d.ts +2 -2
  37. package/ns/session.js +2 -6
  38. package/ns/song-view.d.ts +8 -8
  39. package/ns/song-view.js +12 -16
  40. package/ns/song.d.ts +7 -7
  41. package/ns/song.js +23 -27
  42. package/ns/track-view.d.ts +3 -3
  43. package/ns/track-view.js +6 -10
  44. package/ns/track.d.ts +8 -8
  45. package/ns/track.js +19 -23
  46. package/package.json +12 -4
  47. package/util/cache.js +1 -5
  48. package/util/color.js +1 -5
  49. package/util/logger.js +1 -2
  50. package/util/note.js +2 -7
  51. package/util/package-version.d.ts +1 -1
  52. package/util/package-version.js +1 -20
  53. package/util/tests.d.ts +1 -1
  54. package/util/tests.js +3 -7
package/ns/clip.js CHANGED
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Clip = exports.LaunchQuantization = exports.LaunchMode = exports.WarpMode = void 0;
4
- const _1 = require(".");
5
- const color_1 = require("../util/color");
6
- const note_1 = require("../util/note");
7
- var WarpMode;
1
+ import { Namespace } from "./index.js";
2
+ import { Color } from "../util/color.js";
3
+ import { noteToTuple, tupleToNote, } from "../util/note.js";
4
+ export var WarpMode;
8
5
  (function (WarpMode) {
9
6
  WarpMode[WarpMode["Beats"] = 0] = "Beats";
10
7
  WarpMode[WarpMode["Tones"] = 1] = "Tones";
@@ -12,15 +9,15 @@ var WarpMode;
12
9
  WarpMode[WarpMode["Repitch"] = 3] = "Repitch";
13
10
  WarpMode[WarpMode["Complex"] = 4] = "Complex";
14
11
  WarpMode[WarpMode["ComplexPro"] = 6] = "ComplexPro";
15
- })(WarpMode || (exports.WarpMode = WarpMode = {}));
16
- var LaunchMode;
12
+ })(WarpMode || (WarpMode = {}));
13
+ export var LaunchMode;
17
14
  (function (LaunchMode) {
18
15
  LaunchMode[LaunchMode["Trigger"] = 0] = "Trigger";
19
16
  LaunchMode[LaunchMode["Gate"] = 1] = "Gate";
20
17
  LaunchMode[LaunchMode["Toggle"] = 2] = "Toggle";
21
18
  LaunchMode[LaunchMode["Repeat"] = 3] = "Repeat";
22
- })(LaunchMode || (exports.LaunchMode = LaunchMode = {}));
23
- var LaunchQuantization;
19
+ })(LaunchMode || (LaunchMode = {}));
20
+ export var LaunchQuantization;
24
21
  (function (LaunchQuantization) {
25
22
  LaunchQuantization[LaunchQuantization["QGlobal"] = 0] = "QGlobal";
26
23
  LaunchQuantization[LaunchQuantization["QNone"] = 1] = "QNone";
@@ -37,19 +34,19 @@ var LaunchQuantization;
37
34
  LaunchQuantization[LaunchQuantization["QSixteenth"] = 12] = "QSixteenth";
38
35
  LaunchQuantization[LaunchQuantization["QSixteenthTriplet"] = 13] = "QSixteenthTriplet";
39
36
  LaunchQuantization[LaunchQuantization["QThirtySecond"] = 14] = "QThirtySecond";
40
- })(LaunchQuantization || (exports.LaunchQuantization = LaunchQuantization = {}));
37
+ })(LaunchQuantization || (LaunchQuantization = {}));
41
38
  /**
42
39
  * This class represents an entry in Live's Session view matrix.
43
40
  */
44
- class Clip extends _1.Namespace {
41
+ export class Clip extends Namespace {
45
42
  raw;
46
43
  constructor(ableton, raw) {
47
44
  super(ableton, "clip", raw.id);
48
45
  this.raw = raw;
49
46
  this.transformers = {
50
- color: (c) => new color_1.Color(c),
51
- notes: (n) => n.map(note_1.tupleToNote),
52
- selected_notes: (n) => n.map(note_1.tupleToNote),
47
+ color: (c) => new Color(c),
48
+ notes: (n) => n.map(tupleToNote),
49
+ selected_notes: (n) => n.map(tupleToNote),
53
50
  };
54
51
  }
55
52
  /**
@@ -133,7 +130,7 @@ class Clip extends _1.Namespace {
133
130
  time_span: timeSpan,
134
131
  pitch_span: pitchSpan,
135
132
  });
136
- return notes.map(note_1.tupleToNote);
133
+ return notes.map(tupleToNote);
137
134
  }
138
135
  /**
139
136
  * Returns all notes matching the given range with extended properties.
@@ -208,7 +205,7 @@ class Clip extends _1.Namespace {
208
205
  */
209
206
  replaceSelectedNotes(notes) {
210
207
  return this.sendCommand("replace_selected_notes", {
211
- notes: notes.map(note_1.noteToTuple),
208
+ notes: notes.map(noteToTuple),
212
209
  });
213
210
  }
214
211
  /**
@@ -253,7 +250,7 @@ class Clip extends _1.Namespace {
253
250
  * Adds the given notes to the clip.
254
251
  */
255
252
  setNotes(notes) {
256
- return this.sendCommand("set_notes", { notes: notes.map(note_1.noteToTuple) });
253
+ return this.sendCommand("set_notes", { notes: notes.map(noteToTuple) });
257
254
  }
258
255
  /**
259
256
  * Stop playig this clip.
@@ -268,4 +265,3 @@ class Clip extends _1.Namespace {
268
265
  return this.sendCommand("stop_scrub");
269
266
  }
270
267
  }
271
- exports.Clip = Clip;
package/ns/cue-point.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
3
  export interface GettableProperties {
4
4
  name: string;
5
5
  time: number;
package/ns/cue-point.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CuePoint = void 0;
4
- const _1 = require(".");
5
- class CuePoint extends _1.Namespace {
1
+ import { Namespace } from "./index.js";
2
+ export class CuePoint extends Namespace {
6
3
  raw;
7
4
  constructor(ableton, raw) {
8
5
  super(ableton, "cue-point", raw.id);
@@ -12,4 +9,3 @@ class CuePoint extends _1.Namespace {
12
9
  return this.sendCommand("jump");
13
10
  }
14
11
  }
15
- exports.CuePoint = CuePoint;
@@ -1,5 +1,5 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
3
  export interface GettableProperties {
4
4
  automation_state: AutomationState;
5
5
  default_value: string;
@@ -1,24 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceParameter = exports.ParameterState = exports.AutomationState = void 0;
4
- const _1 = require(".");
5
- var AutomationState;
1
+ import { Namespace } from "./index.js";
2
+ export var AutomationState;
6
3
  (function (AutomationState) {
7
4
  AutomationState[AutomationState["None"] = 0] = "None";
8
5
  AutomationState[AutomationState["Playing"] = 1] = "Playing";
9
6
  AutomationState[AutomationState["Overridden"] = 2] = "Overridden";
10
- })(AutomationState || (exports.AutomationState = AutomationState = {}));
11
- var ParameterState;
7
+ })(AutomationState || (AutomationState = {}));
8
+ export var ParameterState;
12
9
  (function (ParameterState) {
13
10
  ParameterState[ParameterState["Enabled"] = 0] = "Enabled";
14
11
  ParameterState[ParameterState["Disabled"] = 1] = "Disabled";
15
12
  ParameterState[ParameterState["Irrelevant"] = 2] = "Irrelevant";
16
- })(ParameterState || (exports.ParameterState = ParameterState = {}));
17
- class DeviceParameter extends _1.Namespace {
13
+ })(ParameterState || (ParameterState = {}));
14
+ export class DeviceParameter extends Namespace {
18
15
  raw;
19
16
  constructor(ableton, raw) {
20
17
  super(ableton, "device-parameter", raw.id);
21
18
  this.raw = raw;
22
19
  }
23
20
  }
24
- exports.DeviceParameter = DeviceParameter;
package/ns/device.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
3
- import { RawDeviceParameter, DeviceParameter } from "./device-parameter";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
+ import { RawDeviceParameter, DeviceParameter } from "./device-parameter.js";
4
4
  export interface GettableProperties {
5
5
  can_have_chains: boolean;
6
6
  can_have_drum_pads: boolean;
package/ns/device.js CHANGED
@@ -1,26 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Device = exports.DeviceType = void 0;
4
- const _1 = require(".");
5
- const device_parameter_1 = require("./device-parameter");
6
- var DeviceType;
1
+ import { Namespace } from "./index.js";
2
+ import { DeviceParameter } from "./device-parameter.js";
3
+ export var DeviceType;
7
4
  (function (DeviceType) {
8
5
  DeviceType["AudioEffect"] = "audio_effect";
9
6
  DeviceType["Instrument"] = "instrument";
10
7
  DeviceType["MidiEffect"] = "midi_effect";
11
8
  DeviceType["Undefined"] = "undefined";
12
- })(DeviceType || (exports.DeviceType = DeviceType = {}));
13
- class Device extends _1.Namespace {
9
+ })(DeviceType || (DeviceType = {}));
10
+ export class Device extends Namespace {
14
11
  raw;
15
12
  constructor(ableton, raw) {
16
13
  super(ableton, "device", raw.id);
17
14
  this.raw = raw;
18
15
  this.transformers = {
19
- parameters: (ps) => ps.map((p) => new device_parameter_1.DeviceParameter(ableton, p)),
16
+ parameters: (ps) => ps.map((p) => new DeviceParameter(ableton, p)),
20
17
  };
21
18
  this.cachedProps = {
22
19
  parameters: true,
23
20
  };
24
21
  }
25
22
  }
26
- exports.Device = Device;
package/ns/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Ableton } from "..";
1
+ import { Ableton } from "../index.js";
2
2
  export declare class Namespace<GP, TP, SP, OP> {
3
3
  protected ableton: Ableton;
4
4
  protected ns: string;
package/ns/index.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Namespace = void 0;
4
- class Namespace {
1
+ export class Namespace {
5
2
  ableton;
6
3
  ns;
7
4
  nsid;
@@ -63,4 +60,3 @@ class Namespace {
63
60
  });
64
61
  }
65
62
  }
66
- exports.Namespace = Namespace;
package/ns/internal.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
3
  export interface GettableProperties {
4
4
  version: string;
5
5
  ping: boolean;
package/ns/internal.js CHANGED
@@ -1,19 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Internal = void 0;
7
- const _1 = require(".");
8
- const package_version_1 = require("../util/package-version");
9
- const semver_1 = __importDefault(require("semver"));
10
- class Internal extends _1.Namespace {
1
+ import { Namespace } from "./index.js";
2
+ import { packageVersion } from "../util/package-version.js";
3
+ import semver from "semver";
4
+ export class Internal extends Namespace {
11
5
  constructor(ableton) {
12
6
  super(ableton, "internal");
13
7
  }
14
8
  async isPluginUpToDate() {
15
9
  const pluginVersion = await this.get("version");
16
- return !semver_1.default.lt(pluginVersion, (0, package_version_1.getPackageVersion)());
10
+ return !semver.lt(pluginVersion, packageVersion);
17
11
  }
18
12
  }
19
- exports.Internal = Internal;
package/ns/midi.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
3
  export declare enum MidiCommand {
4
4
  NoteOn = 128,
5
5
  NoteOff = 144,
package/ns/midi.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Midi = exports.MidiMessage = exports.MidiCommand = void 0;
4
- const _1 = require(".");
5
- var MidiCommand;
1
+ import { Namespace } from "./index.js";
2
+ export var MidiCommand;
6
3
  (function (MidiCommand) {
7
4
  MidiCommand[MidiCommand["NoteOn"] = 128] = "NoteOn";
8
5
  MidiCommand[MidiCommand["NoteOff"] = 144] = "NoteOff";
@@ -23,8 +20,8 @@ var MidiCommand;
23
20
  MidiCommand[MidiCommand["Stop"] = 252] = "Stop";
24
21
  MidiCommand[MidiCommand["ActiveSensing"] = 254] = "ActiveSensing";
25
22
  MidiCommand[MidiCommand["SystemReset"] = 255] = "SystemReset";
26
- })(MidiCommand || (exports.MidiCommand = MidiCommand = {}));
27
- class MidiMessage {
23
+ })(MidiCommand || (MidiCommand = {}));
24
+ export class MidiMessage {
28
25
  command;
29
26
  parameter1 = null;
30
27
  parameter2 = null;
@@ -71,8 +68,7 @@ class MidiMessage {
71
68
  };
72
69
  }
73
70
  }
74
- exports.MidiMessage = MidiMessage;
75
- class Midi extends _1.Namespace {
71
+ export class Midi extends Namespace {
76
72
  constructor(ableton) {
77
73
  super(ableton, "midi");
78
74
  this.transformers = {
@@ -80,4 +76,3 @@ class Midi extends _1.Namespace {
80
76
  };
81
77
  }
82
78
  }
83
- exports.Midi = Midi;
@@ -1,6 +1,6 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
3
- import { DeviceParameter, RawDeviceParameter } from "./device-parameter";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
+ import { DeviceParameter, RawDeviceParameter } from "./device-parameter.js";
4
4
  export declare enum PanningMode {
5
5
  Stereo = 0,
6
6
  StereoSplit = 1
@@ -1,35 +1,31 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MixerDevice = exports.CrossfadeAssignment = exports.PanningMode = void 0;
4
- const _1 = require(".");
5
- const device_parameter_1 = require("./device-parameter");
6
- var PanningMode;
1
+ import { Namespace } from "./index.js";
2
+ import { DeviceParameter } from "./device-parameter.js";
3
+ export var PanningMode;
7
4
  (function (PanningMode) {
8
5
  PanningMode[PanningMode["Stereo"] = 0] = "Stereo";
9
6
  PanningMode[PanningMode["StereoSplit"] = 1] = "StereoSplit";
10
- })(PanningMode || (exports.PanningMode = PanningMode = {}));
11
- var CrossfadeAssignment;
7
+ })(PanningMode || (PanningMode = {}));
8
+ export var CrossfadeAssignment;
12
9
  (function (CrossfadeAssignment) {
13
10
  CrossfadeAssignment[CrossfadeAssignment["A"] = 0] = "A";
14
11
  CrossfadeAssignment[CrossfadeAssignment["None"] = 1] = "None";
15
12
  CrossfadeAssignment[CrossfadeAssignment["B"] = 2] = "B";
16
- })(CrossfadeAssignment || (exports.CrossfadeAssignment = CrossfadeAssignment = {}));
17
- class MixerDevice extends _1.Namespace {
13
+ })(CrossfadeAssignment || (CrossfadeAssignment = {}));
14
+ export class MixerDevice extends Namespace {
18
15
  raw;
19
16
  constructor(ableton, raw) {
20
17
  super(ableton, "mixer-device", raw.id);
21
18
  this.raw = raw;
22
19
  this.transformers = {
23
- crossfader: (v) => new device_parameter_1.DeviceParameter(ableton, v),
24
- cue_volume: (v) => new device_parameter_1.DeviceParameter(ableton, v),
25
- left_split_stereo: (v) => new device_parameter_1.DeviceParameter(ableton, v),
26
- panning: (v) => new device_parameter_1.DeviceParameter(ableton, v),
27
- right_split_stereo: (v) => new device_parameter_1.DeviceParameter(ableton, v),
28
- sends: (v) => v.map((s) => new device_parameter_1.DeviceParameter(ableton, s)),
29
- song_tempo: (v) => new device_parameter_1.DeviceParameter(ableton, v),
30
- track_activator: (v) => new device_parameter_1.DeviceParameter(ableton, v),
31
- volume: (v) => new device_parameter_1.DeviceParameter(ableton, v),
20
+ crossfader: (v) => new DeviceParameter(ableton, v),
21
+ cue_volume: (v) => new DeviceParameter(ableton, v),
22
+ left_split_stereo: (v) => new DeviceParameter(ableton, v),
23
+ panning: (v) => new DeviceParameter(ableton, v),
24
+ right_split_stereo: (v) => new DeviceParameter(ableton, v),
25
+ sends: (v) => v.map((s) => new DeviceParameter(ableton, s)),
26
+ song_tempo: (v) => new DeviceParameter(ableton, v),
27
+ track_activator: (v) => new DeviceParameter(ableton, v),
28
+ volume: (v) => new DeviceParameter(ableton, v),
32
29
  };
33
30
  }
34
31
  }
35
- exports.MixerDevice = MixerDevice;
package/ns/scene.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
3
- import { ClipSlot, RawClipSlot } from "./clip-slot";
4
- import { Color } from "../util/color";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
+ import { ClipSlot, RawClipSlot } from "./clip-slot.js";
4
+ import { Color } from "../util/color.js";
5
5
  export interface GettableProperties {
6
6
  clip_slots: RawClipSlot[];
7
7
  color: number;
package/ns/scene.js CHANGED
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Scene = void 0;
4
- const _1 = require(".");
5
- const clip_slot_1 = require("./clip-slot");
6
- const color_1 = require("../util/color");
7
- class Scene extends _1.Namespace {
1
+ import { Namespace } from "./index.js";
2
+ import { ClipSlot } from "./clip-slot.js";
3
+ import { Color } from "../util/color.js";
4
+ export class Scene extends Namespace {
8
5
  raw;
9
6
  constructor(ableton, raw) {
10
7
  super(ableton, "scene", raw.id);
11
8
  this.raw = raw;
12
9
  this.transformers = {
13
- color: (c) => new color_1.Color(c),
14
- clip_slots: (clip_slots) => clip_slots.map((c) => new clip_slot_1.ClipSlot(this.ableton, c)),
10
+ color: (c) => new Color(c),
11
+ clip_slots: (clip_slots) => clip_slots.map((c) => new ClipSlot(this.ableton, c)),
15
12
  };
16
13
  this.cachedProps = {
17
14
  clip_slots: true,
@@ -25,4 +22,3 @@ class Scene extends _1.Namespace {
25
22
  return this.sendCommand("fire");
26
23
  }
27
24
  }
28
- exports.Scene = Scene;
package/ns/session.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
3
  export interface GettableProperties {
4
4
  }
5
5
  export interface TransformedProperties {
package/ns/session.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Session = void 0;
4
- const _1 = require(".");
5
- class Session extends _1.Namespace {
1
+ import { Namespace } from "./index.js";
2
+ export class Session extends Namespace {
6
3
  constructor(ableton) {
7
4
  super(ableton, "session", undefined);
8
5
  }
@@ -16,4 +13,3 @@ class Session extends _1.Namespace {
16
13
  });
17
14
  }
18
15
  }
19
- exports.Session = Session;
package/ns/song-view.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { Namespace } from ".";
2
- import { Ableton } from "..";
3
- import { Clip, RawClip } from "./clip";
4
- import { ClipSlot, RawClipSlot } from "./clip-slot";
5
- import { Device } from "./device";
6
- import { DeviceParameter, RawDeviceParameter } from "./device-parameter";
7
- import { RawScene, Scene } from "./scene";
8
- import { RawTrack, Track } from "./track";
1
+ import { Namespace } from "./index.js";
2
+ import { Ableton } from "../index.js";
3
+ import { Clip, RawClip } from "./clip.js";
4
+ import { ClipSlot, RawClipSlot } from "./clip-slot.js";
5
+ import { Device } from "./device.js";
6
+ import { DeviceParameter, RawDeviceParameter } from "./device-parameter.js";
7
+ import { RawScene, Scene } from "./scene.js";
8
+ import { RawTrack, Track } from "./track.js";
9
9
  export interface GettableProperties {
10
10
  detail_clip: RawClip;
11
11
  draw_mode: boolean;
package/ns/song-view.js CHANGED
@@ -1,21 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SongView = void 0;
4
- const _1 = require(".");
5
- const clip_1 = require("./clip");
6
- const clip_slot_1 = require("./clip-slot");
7
- const device_parameter_1 = require("./device-parameter");
8
- const scene_1 = require("./scene");
9
- const track_1 = require("./track");
10
- class SongView extends _1.Namespace {
1
+ import { Namespace } from "./index.js";
2
+ import { Clip } from "./clip.js";
3
+ import { ClipSlot } from "./clip-slot.js";
4
+ import { DeviceParameter } from "./device-parameter.js";
5
+ import { Scene } from "./scene.js";
6
+ import { Track } from "./track.js";
7
+ export class SongView extends Namespace {
11
8
  constructor(ableton) {
12
9
  super(ableton, "song-view");
13
10
  this.transformers = {
14
- selected_parameter: (param) => new device_parameter_1.DeviceParameter(ableton, param),
15
- selected_track: (track) => new track_1.Track(ableton, track),
16
- selected_scene: (scene) => new scene_1.Scene(ableton, scene),
17
- highlighted_clip_slot: (slot) => new clip_slot_1.ClipSlot(ableton, slot),
18
- detail_clip: (clip) => new clip_1.Clip(ableton, clip),
11
+ selected_parameter: (param) => new DeviceParameter(ableton, param),
12
+ selected_track: (track) => new Track(ableton, track),
13
+ selected_scene: (scene) => new Scene(ableton, scene),
14
+ highlighted_clip_slot: (slot) => new ClipSlot(ableton, slot),
15
+ detail_clip: (clip) => new Clip(ableton, clip),
19
16
  };
20
17
  this.cachedProps = {
21
18
  detail_clip: true,
@@ -33,4 +30,3 @@ class SongView extends _1.Namespace {
33
30
  });
34
31
  }
35
32
  }
36
- exports.SongView = SongView;
package/ns/song.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
3
- import { Track, RawTrack } from "./track";
4
- import { CuePoint, RawCuePoint } from "./cue-point";
5
- import { SongView } from "./song-view";
6
- import { Scene, RawScene } from "./scene";
7
- import { RawDevice } from "./device";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
+ import { Track, RawTrack } from "./track.js";
4
+ import { CuePoint, RawCuePoint } from "./cue-point.js";
5
+ import { SongView } from "./song-view.js";
6
+ import { Scene, RawScene } from "./scene.js";
7
+ import { RawDevice } from "./device.js";
8
8
  export interface GettableProperties {
9
9
  appointed_device: RawDevice;
10
10
  arrangement_overdub: boolean;
package/ns/song.js CHANGED
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Song = exports.RecordingQuantization = exports.Quantization = exports.TimeFormat = void 0;
4
- const _1 = require(".");
5
- const track_1 = require("./track");
6
- const cue_point_1 = require("./cue-point");
7
- const song_view_1 = require("./song-view");
8
- const scene_1 = require("./scene");
9
- var TimeFormat;
1
+ import { Namespace } from "./index.js";
2
+ import { Track } from "./track.js";
3
+ import { CuePoint } from "./cue-point.js";
4
+ import { SongView } from "./song-view.js";
5
+ import { Scene } from "./scene.js";
6
+ export var TimeFormat;
10
7
  (function (TimeFormat) {
11
8
  TimeFormat[TimeFormat["MsTime"] = 0] = "MsTime";
12
9
  TimeFormat[TimeFormat["Smpte24"] = 1] = "Smpte24";
@@ -14,8 +11,8 @@ var TimeFormat;
14
11
  TimeFormat[TimeFormat["Smpte29"] = 3] = "Smpte29";
15
12
  TimeFormat[TimeFormat["Smpte30"] = 4] = "Smpte30";
16
13
  TimeFormat[TimeFormat["Smpte30Drop"] = 5] = "Smpte30Drop";
17
- })(TimeFormat || (exports.TimeFormat = TimeFormat = {}));
18
- var Quantization;
14
+ })(TimeFormat || (TimeFormat = {}));
15
+ export var Quantization;
19
16
  (function (Quantization) {
20
17
  Quantization["q_8_bars"] = "q_8_bars";
21
18
  Quantization["q_4_bars"] = "q_4_bars";
@@ -31,8 +28,8 @@ var Quantization;
31
28
  Quantization["q_sixtenth_triplet"] = "q_sixtenth_triplet";
32
29
  Quantization["q_thirtytwoth"] = "q_thirtytwoth";
33
30
  Quantization["q_no_q"] = "q_no_q";
34
- })(Quantization || (exports.Quantization = Quantization = {}));
35
- var RecordingQuantization;
31
+ })(Quantization || (Quantization = {}));
32
+ export var RecordingQuantization;
36
33
  (function (RecordingQuantization) {
37
34
  RecordingQuantization["rec_q_eight"] = "rec_q_eight";
38
35
  RecordingQuantization["rec_q_eight_eight_triplet"] = "rec_q_eight_eight_triplet";
@@ -43,17 +40,17 @@ var RecordingQuantization;
43
40
  RecordingQuantization["rec_q_sixtenth_sixtenth_triplet"] = "rec_q_sixtenth_sixtenth_triplet";
44
41
  RecordingQuantization["rec_q_sixtenth_triplet"] = "rec_q_sixtenth_triplet";
45
42
  RecordingQuantization["rec_q_thirtysecond"] = "rec_q_thirtysecond";
46
- })(RecordingQuantization || (exports.RecordingQuantization = RecordingQuantization = {}));
47
- class Song extends _1.Namespace {
43
+ })(RecordingQuantization || (RecordingQuantization = {}));
44
+ export class Song extends Namespace {
48
45
  constructor(ableton) {
49
46
  super(ableton, "song");
50
47
  this.transformers = {
51
- cue_points: (points) => points.map((c) => new cue_point_1.CuePoint(ableton, c)),
52
- master_track: (track) => new track_1.Track(ableton, track),
53
- return_tracks: (tracks) => tracks.map((t) => new track_1.Track(ableton, t)),
54
- tracks: (tracks) => tracks.map((t) => new track_1.Track(ableton, t)),
55
- visible_tracks: (tracks) => tracks.map((t) => new track_1.Track(ableton, t)),
56
- scenes: (scenes) => scenes.map((s) => new scene_1.Scene(ableton, s)),
48
+ cue_points: (points) => points.map((c) => new CuePoint(ableton, c)),
49
+ master_track: (track) => new Track(ableton, track),
50
+ return_tracks: (tracks) => tracks.map((t) => new Track(ableton, t)),
51
+ tracks: (tracks) => tracks.map((t) => new Track(ableton, t)),
52
+ visible_tracks: (tracks) => tracks.map((t) => new Track(ableton, t)),
53
+ scenes: (scenes) => scenes.map((s) => new Scene(ableton, s)),
57
54
  };
58
55
  this.cachedProps = {
59
56
  cue_points: true,
@@ -64,7 +61,7 @@ class Song extends _1.Namespace {
64
61
  scenes: true,
65
62
  };
66
63
  }
67
- view = new song_view_1.SongView(this.ableton);
64
+ view = new SongView(this.ableton);
68
65
  async beginUndoStep() {
69
66
  return this.sendCommand("begin_undo_step");
70
67
  }
@@ -73,19 +70,19 @@ class Song extends _1.Namespace {
73
70
  }
74
71
  async createAudioTrack(index = -1) {
75
72
  const result = await this.sendCommand("create_audio_track", { index });
76
- return new track_1.Track(this.ableton, result);
73
+ return new Track(this.ableton, result);
77
74
  }
78
75
  async createMidiTrack(index = -1) {
79
76
  const result = await this.sendCommand("create_midi_track", { index });
80
- return new track_1.Track(this.ableton, result);
77
+ return new Track(this.ableton, result);
81
78
  }
82
79
  async createReturnTrack() {
83
80
  const result = await this.sendCommand("create_return_track");
84
- return new track_1.Track(this.ableton, result);
81
+ return new Track(this.ableton, result);
85
82
  }
86
83
  async createScene(index = -1) {
87
84
  const result = await this.sendCommand("create_scene", { index });
88
- return new scene_1.Scene(this.ableton, result);
85
+ return new Scene(this.ableton, result);
89
86
  }
90
87
  async deleteReturnTrack(index) {
91
88
  return this.sendCommand("delete_return_track", [index]);
@@ -177,4 +174,3 @@ class Song extends _1.Namespace {
177
174
  return this.sendCommand("undo");
178
175
  }
179
176
  }
180
- exports.Song = Song;
@@ -1,6 +1,6 @@
1
- import { Ableton } from "..";
2
- import { Namespace } from ".";
3
- import { Device, RawDevice } from "./device";
1
+ import { Ableton } from "../index.js";
2
+ import { Namespace } from "./index.js";
3
+ import { Device, RawDevice } from "./device.js";
4
4
  export declare enum DeviceInsertMode {
5
5
  Default = "default",
6
6
  Left = "left",