@opendaw/studio-core 0.0.45 → 0.0.46

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.
@@ -1,3 +1,3 @@
1
- import { ArpeggioDeviceBox, CompressorDeviceBox, CrusherDeviceBox, DelayDeviceBox, ModularDeviceBox, PitchDeviceBox, RevampDeviceBox, ReverbDeviceBox, StereoToolDeviceBox, UnknownAudioEffectDeviceBox, UnknownMidiEffectDeviceBox, ZeitgeistDeviceBox } from "@opendaw/studio-boxes";
2
- export type EffectBox = ArpeggioDeviceBox | PitchDeviceBox | ZeitgeistDeviceBox | UnknownMidiEffectDeviceBox | DelayDeviceBox | ReverbDeviceBox | RevampDeviceBox | StereoToolDeviceBox | ModularDeviceBox | UnknownAudioEffectDeviceBox | CompressorDeviceBox | CrusherDeviceBox;
1
+ import { ArpeggioDeviceBox, CompressorDeviceBox, CrusherDeviceBox, DelayDeviceBox, FoldDeviceBox, ModularDeviceBox, PitchDeviceBox, RevampDeviceBox, ReverbDeviceBox, StereoToolDeviceBox, UnknownAudioEffectDeviceBox, UnknownMidiEffectDeviceBox, ZeitgeistDeviceBox } from "@opendaw/studio-boxes";
2
+ export type EffectBox = ArpeggioDeviceBox | PitchDeviceBox | ZeitgeistDeviceBox | UnknownMidiEffectDeviceBox | DelayDeviceBox | ReverbDeviceBox | RevampDeviceBox | StereoToolDeviceBox | ModularDeviceBox | UnknownAudioEffectDeviceBox | CompressorDeviceBox | CrusherDeviceBox | FoldDeviceBox;
3
3
  //# sourceMappingURL=EffectBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EffectBox.d.ts","sourceRoot":"","sources":["../src/EffectBox.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,EACrB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,MAAM,SAAS,GACf,iBAAiB,GAAG,cAAc,GAAG,kBAAkB,GAAG,0BAA0B,GACpF,cAAc,GAAG,eAAe,GAAG,eAAe,GAAG,mBAAmB,GACxE,gBAAgB,GAAG,2BAA2B,GAAG,mBAAmB,GAAG,gBAAgB,CAAA"}
1
+ {"version":3,"file":"EffectBox.d.ts","sourceRoot":"","sources":["../src/EffectBox.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,EACrB,MAAM,uBAAuB,CAAA;AAE9B,MAAM,MAAM,SAAS,GACf,iBAAiB,GAAG,cAAc,GAAG,kBAAkB,GAAG,0BAA0B,GACpF,cAAc,GAAG,eAAe,GAAG,eAAe,GAAG,mBAAmB,GACxE,gBAAgB,GAAG,2BAA2B,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,aAAa,CAAA"}
@@ -8,6 +8,7 @@ export declare namespace EffectFactories {
8
8
  const Compressor: EffectFactory;
9
9
  const Reverb: EffectFactory;
10
10
  const Crusher: EffectFactory;
11
+ const Fold: EffectFactory;
11
12
  const Revamp: EffectFactory;
12
13
  const Modular: EffectFactory;
13
14
  const MidiNamed: {
@@ -22,6 +23,7 @@ export declare namespace EffectFactories {
22
23
  Reverb: EffectFactory;
23
24
  Revamp: EffectFactory;
24
25
  Crusher: EffectFactory;
26
+ Fold: EffectFactory;
25
27
  Modular: EffectFactory;
26
28
  };
27
29
  const MidiList: ReadonlyArray<Readonly<EffectFactory>>;
@@ -33,6 +35,7 @@ export declare namespace EffectFactories {
33
35
  Reverb: EffectFactory;
34
36
  Revamp: EffectFactory;
35
37
  Crusher: EffectFactory;
38
+ Fold: EffectFactory;
36
39
  Modular: EffectFactory;
37
40
  Arpeggio: EffectFactory;
38
41
  Pitch: EffectFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"EffectFactories.d.ts","sourceRoot":"","sources":["../src/EffectFactories.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAG7C,yBAAiB,eAAe,CAAC;IACtB,MAAM,QAAQ,EAAE,aAWtB,CAAA;IAEM,MAAM,KAAK,EAAE,aAWnB,CAAA;IAEM,MAAM,SAAS,EAAE,aAqBvB,CAAA;IAEM,MAAM,UAAU,EAAE,aAYxB,CAAA;IAEM,MAAM,KAAK,EAAE,aAYnB,CAAA;IAEM,MAAM,UAAU,EAAE,aAYxB,CAAA;IAEM,MAAM,MAAM,EAAE,aAapB,CAAA;IAEM,MAAM,OAAO,EAAE,aAYrB,CAAA;IAEM,MAAM,MAAM,EAAE,aAYpB,CAAA;IAEM,MAAM,OAAO,EAAE,aAoCrB,CAAA;IAEM,MAAM,SAAS;;;;KAA+B,CAAA;IAC9C,MAAM,UAAU;;;;;;;;KAAoE,CAAA;IACpF,MAAM,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAA4B,CAAA;IACjF,MAAM,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAA6B,CAAA;IACnF,MAAM,WAAW;;;;;;;;;;;KAAgC,CAAA;IACxD,KAAY,cAAc,GAAG,MAAM,OAAO,SAAS,CAAA;IACnD,KAAY,eAAe,GAAG,MAAM,OAAO,UAAU,CAAA;CACxD"}
1
+ {"version":3,"file":"EffectFactories.d.ts","sourceRoot":"","sources":["../src/EffectFactories.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAG7C,yBAAiB,eAAe,CAAC;IACtB,MAAM,QAAQ,EAAE,aAWtB,CAAA;IAEM,MAAM,KAAK,EAAE,aAWnB,CAAA;IAEM,MAAM,SAAS,EAAE,aAqBvB,CAAA;IAEM,MAAM,UAAU,EAAE,aAYxB,CAAA;IAEM,MAAM,KAAK,EAAE,aAYnB,CAAA;IAEM,MAAM,UAAU,EAAE,aAYxB,CAAA;IAEM,MAAM,MAAM,EAAE,aAapB,CAAA;IAEM,MAAM,OAAO,EAAE,aAYrB,CAAA;IAEM,MAAM,IAAI,EAAE,aAYlB,CAAA;IAEM,MAAM,MAAM,EAAE,aAYpB,CAAA;IAEM,MAAM,OAAO,EAAE,aAoCrB,CAAA;IAEM,MAAM,SAAS;;;;KAA+B,CAAA;IAC9C,MAAM,UAAU;;;;;;;;;KAA0E,CAAA;IAC1F,MAAM,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAA4B,CAAA;IACjF,MAAM,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAA6B,CAAA;IACnF,MAAM,WAAW;;;;;;;;;;;;KAAgC,CAAA;IACxD,KAAY,cAAc,GAAG,MAAM,OAAO,SAAS,CAAA;IACnD,KAAY,eAAe,GAAG,MAAM,OAAO,UAAU,CAAA;CACxD"}
@@ -1,5 +1,5 @@
1
1
  import { UUID } from "@opendaw/lib-std";
2
- import { ArpeggioDeviceBox, CompressorDeviceBox, CrusherDeviceBox, DelayDeviceBox, GrooveShuffleBox, ModularAudioInputBox, ModularAudioOutputBox, ModularBox, ModularDeviceBox, ModuleConnectionBox, PitchDeviceBox, RevampDeviceBox, ReverbDeviceBox, StereoToolDeviceBox, ZeitgeistDeviceBox } from "@opendaw/studio-boxes";
2
+ import { ArpeggioDeviceBox, CompressorDeviceBox, CrusherDeviceBox, DelayDeviceBox, FoldDeviceBox, GrooveShuffleBox, ModularAudioInputBox, ModularAudioOutputBox, ModularBox, ModularDeviceBox, ModuleConnectionBox, PitchDeviceBox, RevampDeviceBox, ReverbDeviceBox, StereoToolDeviceBox, ZeitgeistDeviceBox } from "@opendaw/studio-boxes";
3
3
  import { IconSymbol } from "@opendaw/studio-adapters";
4
4
  import { EffectParameterDefaults } from "./EffectParameterDefaults";
5
5
  export var EffectFactories;
@@ -111,6 +111,18 @@ export var EffectFactories;
111
111
  box.host.refer(unit);
112
112
  })
113
113
  };
114
+ EffectFactories.Fold = {
115
+ defaultName: "Fold",
116
+ defaultIcon: IconSymbol.Waveform,
117
+ description: "Folds the signal back into audio-range",
118
+ separatorBefore: false,
119
+ type: "audio",
120
+ create: ({ boxGraph }, unit, index) => FoldDeviceBox.create(boxGraph, UUID.generate(), box => {
121
+ box.label.setValue("Fold");
122
+ box.index.setValue(index);
123
+ box.host.refer(unit);
124
+ })
125
+ };
114
126
  EffectFactories.Revamp = {
115
127
  defaultName: "Revamp",
116
128
  defaultIcon: IconSymbol.EQ,
@@ -161,7 +173,7 @@ export var EffectFactories;
161
173
  }
162
174
  };
163
175
  EffectFactories.MidiNamed = { Arpeggio: EffectFactories.Arpeggio, Pitch: EffectFactories.Pitch, Zeitgeist: EffectFactories.Zeitgeist };
164
- EffectFactories.AudioNamed = { StereoTool: EffectFactories.StereoTool, Compressor: EffectFactories.Compressor, Delay: EffectFactories.Delay, Reverb: EffectFactories.Reverb, Revamp: EffectFactories.Revamp, Crusher: EffectFactories.Crusher, Modular: EffectFactories.Modular };
176
+ EffectFactories.AudioNamed = { StereoTool: EffectFactories.StereoTool, Compressor: EffectFactories.Compressor, Delay: EffectFactories.Delay, Reverb: EffectFactories.Reverb, Revamp: EffectFactories.Revamp, Crusher: EffectFactories.Crusher, Fold: EffectFactories.Fold, Modular: EffectFactories.Modular };
165
177
  EffectFactories.MidiList = Object.values(EffectFactories.MidiNamed);
166
178
  EffectFactories.AudioList = Object.values(EffectFactories.AudioNamed);
167
179
  EffectFactories.MergedNamed = { ...EffectFactories.MidiNamed, ...EffectFactories.AudioNamed };
@@ -1,5 +1,5 @@
1
1
  import { Option, Terminable, UUID } from "@opendaw/lib-std";
2
- import { Project } from "../project/Project";
2
+ import { Project } from "../project";
3
3
  import { Capture } from "./Capture";
4
4
  export declare class CaptureDevices implements Terminable {
5
5
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"CaptureDevices.d.ts","sourceRoot":"","sources":["../../src/capture/CaptureDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,MAAM,EAA2B,UAAU,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAElH,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAIjC,qBAAa,cAAe,YAAW,UAAU;;gBAKjC,OAAO,EAAE,OAAO;IAiB5B,IAAI,OAAO,IAAI,OAAO,CAAuB;IAE7C,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC;IAEtC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;IAUlD,WAAW,IAAI,aAAa,CAAC,OAAO,CAAC;IAKrC,SAAS,IAAI,IAAI;CAKpB"}
1
+ {"version":3,"file":"CaptureDevices.d.ts","sourceRoot":"","sources":["../../src/capture/CaptureDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,MAAM,EAA2B,UAAU,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAElH,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AAMjC,qBAAa,cAAe,YAAW,UAAU;;gBAMjC,OAAO,EAAE,OAAO;IA6B5B,IAAI,OAAO,IAAI,OAAO,CAAuB;IAE7C,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC;IAEtC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;IAUlD,WAAW,IAAI,aAAa,CAAC,OAAO,CAAC;IAKrC,SAAS,IAAI,IAAI;CAKpB"}
@@ -6,22 +6,33 @@ export class CaptureDevices {
6
6
  #project;
7
7
  #subscription;
8
8
  #captures;
9
+ #captureSubscriptions;
9
10
  constructor(project) {
10
11
  this.#project = project;
11
- this.#captures = UUID.newSet(unit => unit.uuid);
12
+ this.#captures = UUID.newSet(({ uuid }) => uuid);
13
+ this.#captureSubscriptions = UUID.newSet(({ uuid }) => uuid);
12
14
  this.#subscription = this.#project.rootBox.audioUnits.pointerHub.catchupAndSubscribe({
13
15
  onAdded: ({ box }) => {
16
+ const uuid = box.address.uuid;
14
17
  const audioUnitBox = asInstanceOf(box, AudioUnitBox);
15
- const capture = audioUnitBox.capture.targetVertex
16
- .ifSome(({ box }) => box.accept({
17
- visitCaptureMidiBox: (box) => new CaptureMidi(this, audioUnitBox, box),
18
- visitCaptureAudioBox: (box) => new CaptureAudio(this, audioUnitBox, box)
19
- }));
20
- if (isDefined(capture)) {
21
- this.#captures.add(capture);
22
- }
18
+ const subscription = audioUnitBox.capture.catchupAndSubscribe(pointer => {
19
+ this.#captures.removeByKeyIfExist(uuid)?.terminate();
20
+ pointer.targetVertex.ifSome(({ box }) => {
21
+ const capture = box.accept({
22
+ visitCaptureMidiBox: (box) => new CaptureMidi(this, audioUnitBox, box),
23
+ visitCaptureAudioBox: (box) => new CaptureAudio(this, audioUnitBox, box)
24
+ });
25
+ if (isDefined(capture)) {
26
+ this.#captures.add(capture);
27
+ }
28
+ });
29
+ });
30
+ this.#captureSubscriptions.add({ uuid, subscription });
23
31
  },
24
- onRemoved: ({ box: { address: { uuid } } }) => this.#captures.removeByKeyIfExist(uuid)?.terminate()
32
+ onRemoved: ({ box: { address: { uuid } } }) => {
33
+ this.#captures.removeByKeyIfExist(uuid)?.terminate();
34
+ this.#captureSubscriptions.get(uuid).subscription.terminate();
35
+ }
25
36
  });
26
37
  }
27
38
  get project() { return this.#project; }
@@ -3,7 +3,7 @@ import { Events } from "@opendaw/lib-dom";
3
3
  import { MidiData } from "@opendaw/lib-midi";
4
4
  import { Promises } from "@opendaw/lib-runtime";
5
5
  import { NoteSignal } from "@opendaw/studio-adapters";
6
- import { MidiDevices } from "../midi/MidiDevices";
6
+ import { MidiDevices } from "../midi";
7
7
  import { Capture } from "./Capture";
8
8
  import { RecordMidi } from "./RecordMidi";
9
9
  var warn = Errors.warn;