@blibliki/engine 0.1.26 → 0.3.1
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/README.md +252 -76
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +765 -0
- package/dist/index.d.ts +765 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +19 -31
- package/src/Engine.ts +158 -177
- package/src/core/IO/AudioIO.ts +72 -0
- package/src/core/IO/Base.ts +118 -0
- package/src/core/IO/Collection.ts +123 -47
- package/src/core/IO/MidiIO.ts +43 -0
- package/src/core/IO/PolyAudioIO.ts +115 -0
- package/src/core/IO/index.ts +7 -61
- package/src/core/Note/frequencyTable.ts +144 -144
- package/src/core/Note/index.ts +49 -59
- package/src/core/Route.ts +79 -0
- package/src/core/Timing/Scheduler.ts +37 -0
- package/src/core/Timing/Time.ts +103 -0
- package/src/core/Timing/Transport.ts +104 -0
- package/src/core/Timing/index.ts +16 -0
- package/src/core/index.ts +36 -0
- package/src/core/midi/{ComputerKeyboardInput.ts → ComputerKeyboardDevice.ts} +31 -11
- package/src/core/midi/MidiDevice.ts +38 -31
- package/src/core/midi/MidiDeviceManager.ts +54 -55
- package/src/core/midi/MidiEvent.ts +36 -60
- package/src/core/module/Module.ts +233 -0
- package/src/core/module/PolyModule.ts +246 -0
- package/src/core/module/VoiceScheduler.ts +121 -0
- package/src/core/module/index.ts +3 -0
- package/src/core/schema.ts +41 -0
- package/src/index.ts +31 -9
- package/src/modules/BiquadFilter.ts +162 -0
- package/src/modules/Constant.ts +72 -0
- package/src/modules/Envelope.ts +178 -0
- package/src/modules/Filter.ts +109 -104
- package/src/modules/Gain.ts +78 -0
- package/src/modules/Inspector.ts +59 -0
- package/src/modules/Master.ts +18 -21
- package/src/modules/MidiSelector.ts +50 -50
- package/src/modules/Oscillator.ts +202 -148
- package/src/modules/Scale.ts +79 -0
- package/src/modules/StepSequencer.ts +61 -0
- package/src/modules/VirtualMidi.ts +33 -49
- package/src/modules/index.ts +159 -74
- package/src/nodePolyfill.ts +25 -0
- package/src/processors/filter-processor.ts +82 -0
- package/src/processors/index.ts +28 -0
- package/src/processors/scale-processor.ts +81 -0
- package/dist/build/Engine.d.ts +0 -82
- package/dist/build/core/IO/AudioNode.d.ts +0 -35
- package/dist/build/core/IO/Collection.d.ts +0 -13
- package/dist/build/core/IO/ForwardNode/Base.d.ts +0 -18
- package/dist/build/core/IO/ForwardNode/index.d.ts +0 -27
- package/dist/build/core/IO/ForwardNode.d.ts +0 -38
- package/dist/build/core/IO/MidiNode.d.ts +0 -30
- package/dist/build/core/IO/Node.d.ts +0 -40
- package/dist/build/core/IO/index.d.ts +0 -21
- package/dist/build/core/Module/MonoModule.d.ts +0 -67
- package/dist/build/core/Module/PolyModule.d.ts +0 -61
- package/dist/build/core/Module/index.d.ts +0 -6
- package/dist/build/core/Note/frequencyTable.d.ts +0 -4
- package/dist/build/core/Note/index.d.ts +0 -28
- package/dist/build/core/midi/ComputerKeyboardInput.d.ts +0 -11
- package/dist/build/core/midi/MidiDevice.d.ts +0 -29
- package/dist/build/core/midi/MidiDeviceManager.d.ts +0 -14
- package/dist/build/core/midi/MidiEvent.d.ts +0 -21
- package/dist/build/core/midi/index.d.ts +0 -5
- package/dist/build/index.d.ts +0 -9
- package/dist/build/modules/BitCrusher.d.ts +0 -16
- package/dist/build/modules/Delay.d.ts +0 -19
- package/dist/build/modules/Distortion.d.ts +0 -16
- package/dist/build/modules/Effect.d.ts +0 -19
- package/dist/build/modules/Envelope/AmpEnvelope.d.ts +0 -18
- package/dist/build/modules/Envelope/Base.d.ts +0 -66
- package/dist/build/modules/Envelope/FreqEnvelope.d.ts +0 -25
- package/dist/build/modules/Envelope/index.d.ts +0 -3
- package/dist/build/modules/Filter.d.ts +0 -42
- package/dist/build/modules/LFO.d.ts +0 -44
- package/dist/build/modules/Master.d.ts +0 -11
- package/dist/build/modules/MidiSelector.d.ts +0 -21
- package/dist/build/modules/Oscillator.d.ts +0 -55
- package/dist/build/modules/Reverb.d.ts +0 -19
- package/dist/build/modules/Sequencer.d.ts +0 -42
- package/dist/build/modules/VirtualMidi.d.ts +0 -32
- package/dist/build/modules/VoiceScheduler.d.ts +0 -44
- package/dist/build/modules/Volume.d.ts +0 -26
- package/dist/build/modules/index.d.ts +0 -17
- package/dist/build/routes.d.ts +0 -18
- package/dist/build/types.d.ts +0 -5
- package/dist/build/utils.d.ts +0 -1
- package/dist/main.cjs.js +0 -25
- package/dist/main.cjs.js.map +0 -1
- package/dist/main.esm.js +0 -25
- package/dist/main.esm.js.map +0 -1
- package/src/core/IO/AudioNode.ts +0 -82
- package/src/core/IO/ForwardNode/Base.ts +0 -99
- package/src/core/IO/ForwardNode/index.ts +0 -60
- package/src/core/IO/MidiNode.ts +0 -67
- package/src/core/IO/Node.ts +0 -118
- package/src/core/Module/MonoModule.ts +0 -219
- package/src/core/Module/PolyModule.ts +0 -218
- package/src/core/Module/index.ts +0 -15
- package/src/core/midi/index.ts +0 -5
- package/src/modules/BitCrusher.ts +0 -45
- package/src/modules/Delay.ts +0 -53
- package/src/modules/Distortion.ts +0 -45
- package/src/modules/Effect.ts +0 -46
- package/src/modules/Envelope/AmpEnvelope.ts +0 -23
- package/src/modules/Envelope/Base.ts +0 -176
- package/src/modules/Envelope/FreqEnvelope.ts +0 -64
- package/src/modules/Envelope/index.ts +0 -3
- package/src/modules/LFO.ts +0 -149
- package/src/modules/Reverb.ts +0 -53
- package/src/modules/Sequencer.ts +0 -178
- package/src/modules/VoiceScheduler.ts +0 -145
- package/src/modules/Volume.ts +0 -72
- package/src/routes.ts +0 -49
- package/src/types.ts +0 -3
- package/src/utils.ts +0 -18
|
@@ -1,76 +1,152 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { assertNever } from "@blibliki/utils";
|
|
2
|
+
import { ModuleType } from "@/modules";
|
|
3
|
+
import { Module } from "../module";
|
|
4
|
+
import { PolyModule } from "../module/PolyModule";
|
|
5
|
+
import {
|
|
6
|
+
AudioInput,
|
|
7
|
+
AudioInputProps,
|
|
8
|
+
AudioOutput,
|
|
9
|
+
AudioOutputProps,
|
|
10
|
+
} from "./AudioIO";
|
|
11
|
+
import { Base, IOType } from "./Base";
|
|
12
|
+
import {
|
|
13
|
+
MidiInput,
|
|
14
|
+
MidiInputProps,
|
|
15
|
+
MidiOutput,
|
|
16
|
+
MidiOutputProps,
|
|
17
|
+
} from "./MidiIO";
|
|
18
|
+
import {
|
|
19
|
+
PolyAudioInput,
|
|
20
|
+
PolyAudioInputProps,
|
|
21
|
+
PolyAudioOutput,
|
|
22
|
+
PolyAudioOutputProps,
|
|
23
|
+
} from "./PolyAudioIO";
|
|
24
|
+
|
|
25
|
+
export enum CollectionType {
|
|
26
|
+
Input = "Input",
|
|
27
|
+
Output = "Output",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type IMappedIOProps = {
|
|
31
|
+
[CollectionType.Input]:
|
|
32
|
+
| AudioInputProps
|
|
33
|
+
| PolyAudioInputProps
|
|
34
|
+
| MidiInputProps;
|
|
35
|
+
[CollectionType.Output]:
|
|
36
|
+
| AudioOutputProps
|
|
37
|
+
| PolyAudioOutputProps
|
|
38
|
+
| MidiOutputProps;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type IIOTypeTOClass = {
|
|
42
|
+
[IOType.AudioInput]: AudioInput;
|
|
43
|
+
[IOType.AudioOutput]: AudioOutput;
|
|
44
|
+
[IOType.PolyAudioInput]: PolyAudioInput;
|
|
45
|
+
[IOType.PolyAudioOutput]: PolyAudioOutput;
|
|
46
|
+
[IOType.MidiInput]: MidiInput;
|
|
47
|
+
[IOType.MidiOutput]: MidiOutput;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default abstract class IOCollection<T extends CollectionType> {
|
|
51
|
+
module: Module<ModuleType> | PolyModule<ModuleType>;
|
|
52
|
+
collection: Base[] = [];
|
|
53
|
+
collectionType: T;
|
|
54
|
+
|
|
55
|
+
constructor(
|
|
56
|
+
collectionType: T,
|
|
57
|
+
module: Module<ModuleType> | PolyModule<ModuleType>,
|
|
58
|
+
) {
|
|
59
|
+
this.collectionType = collectionType;
|
|
60
|
+
this.module = module;
|
|
14
61
|
}
|
|
15
|
-
|
|
16
|
-
|
|
62
|
+
|
|
63
|
+
add<TT extends IMappedIOProps[T]>(props: TT): IIOTypeTOClass[TT["ioType"]] {
|
|
64
|
+
let io:
|
|
65
|
+
| AudioInput
|
|
66
|
+
| AudioOutput
|
|
67
|
+
| PolyAudioInput
|
|
68
|
+
| PolyAudioOutput
|
|
69
|
+
| MidiInput
|
|
70
|
+
| MidiOutput;
|
|
71
|
+
this.validateUniqName(props.name);
|
|
17
72
|
|
|
18
73
|
switch (props.ioType) {
|
|
19
74
|
case IOType.AudioInput:
|
|
20
|
-
if (this.
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
io = new AudioInput(this.plugableModule, props);
|
|
75
|
+
if (this.module instanceof PolyModule) throw Error("Not compatible");
|
|
76
|
+
io = new AudioInput(this.module, props);
|
|
25
77
|
break;
|
|
26
78
|
case IOType.AudioOutput:
|
|
27
|
-
if (this.
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
io = new AudioOutput(this.plugableModule, props);
|
|
79
|
+
if (this.module instanceof PolyModule) throw Error("Not compatible");
|
|
80
|
+
io = new AudioOutput(this.module, props);
|
|
32
81
|
break;
|
|
33
|
-
case IOType.
|
|
34
|
-
|
|
82
|
+
case IOType.PolyAudioInput:
|
|
83
|
+
if (this.module instanceof Module) throw Error("Not compatible");
|
|
84
|
+
io = new PolyAudioInput(this.module, props);
|
|
35
85
|
break;
|
|
36
|
-
case IOType.
|
|
37
|
-
|
|
86
|
+
case IOType.PolyAudioOutput:
|
|
87
|
+
if (this.module instanceof Module) throw Error("Not compatible");
|
|
88
|
+
io = new PolyAudioOutput(this.module, props);
|
|
38
89
|
break;
|
|
39
|
-
case IOType.
|
|
40
|
-
|
|
41
|
-
throw Error("MonoModule is not supported");
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
io = new ForwardAudioInput(this.plugableModule, props);
|
|
90
|
+
case IOType.MidiInput:
|
|
91
|
+
io = new MidiInput(this.module, props);
|
|
45
92
|
break;
|
|
46
|
-
case IOType.
|
|
47
|
-
|
|
48
|
-
throw Error("MonoModule is not supported");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
io = new ForwardAudioOutput(this.plugableModule, props);
|
|
93
|
+
case IOType.MidiOutput:
|
|
94
|
+
io = new MidiOutput(this.module, props);
|
|
52
95
|
break;
|
|
53
96
|
default:
|
|
54
|
-
|
|
97
|
+
assertNever(props);
|
|
55
98
|
}
|
|
56
99
|
|
|
57
|
-
this.collection.push(io
|
|
58
|
-
|
|
100
|
+
this.collection.push(io);
|
|
101
|
+
|
|
102
|
+
return io as IIOTypeTOClass[TT["ioType"]];
|
|
59
103
|
}
|
|
60
104
|
|
|
61
105
|
unPlugAll() {
|
|
62
|
-
this.collection.forEach((io) =>
|
|
106
|
+
this.collection.forEach((io) => {
|
|
107
|
+
io.unPlugAll();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
rePlugAll(callback?: () => void) {
|
|
112
|
+
this.collection.forEach((io) => {
|
|
113
|
+
io.rePlugAll(callback);
|
|
114
|
+
});
|
|
63
115
|
}
|
|
64
116
|
|
|
65
117
|
find(id: string) {
|
|
66
|
-
|
|
118
|
+
const io = this.collection.find((io) => io.id === id);
|
|
119
|
+
if (!io) throw Error(`The io with id ${id} is not exists`);
|
|
120
|
+
|
|
121
|
+
return io;
|
|
67
122
|
}
|
|
68
123
|
|
|
69
124
|
findByName(name: string) {
|
|
70
|
-
|
|
125
|
+
const io = this.collection.find((io) => io.name === name);
|
|
126
|
+
if (!io) throw Error(`The io with name ${name} is not exists`);
|
|
127
|
+
|
|
128
|
+
return io;
|
|
71
129
|
}
|
|
72
130
|
|
|
73
131
|
serialize() {
|
|
74
132
|
return this.collection.map((io) => io.serialize());
|
|
75
133
|
}
|
|
134
|
+
|
|
135
|
+
private validateUniqName(name: string) {
|
|
136
|
+
if (this.collection.some((io) => io.name === name)) {
|
|
137
|
+
throw Error(`An io with name ${name} is already exists`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export class InputCollection extends IOCollection<CollectionType.Input> {
|
|
143
|
+
constructor(module: Module<ModuleType> | PolyModule<ModuleType>) {
|
|
144
|
+
super(CollectionType.Input, module);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export class OutputCollection extends IOCollection<CollectionType.Output> {
|
|
149
|
+
constructor(module: Module<ModuleType> | PolyModule<ModuleType>) {
|
|
150
|
+
super(CollectionType.Output, module);
|
|
151
|
+
}
|
|
76
152
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ModuleType } from "@/modules";
|
|
2
|
+
import MidiEvent from "../midi/MidiEvent";
|
|
3
|
+
import { Module } from "../module";
|
|
4
|
+
import { PolyModule } from "../module/PolyModule";
|
|
5
|
+
import IO, { IOProps, IOType } from "./Base";
|
|
6
|
+
|
|
7
|
+
export type MidiIO = MidiInput | MidiOutput;
|
|
8
|
+
|
|
9
|
+
export type MidiInputProps = IOProps & {
|
|
10
|
+
ioType: IOType.MidiInput;
|
|
11
|
+
onMidiEvent: (event: MidiEvent) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type MidiOutputProps = IOProps & {
|
|
15
|
+
ioType: IOType.MidiOutput;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export class MidiInput extends IO<MidiOutput> implements MidiInputProps {
|
|
19
|
+
declare ioType: IOType.MidiInput;
|
|
20
|
+
onMidiEvent: MidiInputProps["onMidiEvent"];
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
module: Module<ModuleType> | PolyModule<ModuleType>,
|
|
24
|
+
props: MidiInputProps,
|
|
25
|
+
) {
|
|
26
|
+
super(module, props);
|
|
27
|
+
this.onMidiEvent = props.onMidiEvent;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class MidiOutput extends IO<MidiInput> implements MidiOutputProps {
|
|
32
|
+
declare ioType: IOType.MidiOutput;
|
|
33
|
+
|
|
34
|
+
onMidiEvent = (event: MidiEvent) => {
|
|
35
|
+
this.midiConnections.forEach((input) => {
|
|
36
|
+
input.onMidiEvent(event);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
private get midiConnections() {
|
|
41
|
+
return this.connections.filter((input) => input instanceof MidiInput);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { ModuleType } from "@/modules";
|
|
2
|
+
import { PolyModule } from "../module/PolyModule";
|
|
3
|
+
import { AudioInput, AudioOutput } from "./AudioIO";
|
|
4
|
+
import IO, { IOProps, IOType } from "./Base";
|
|
5
|
+
|
|
6
|
+
export type PolyAudioIO = PolyAudioInput | PolyAudioOutput;
|
|
7
|
+
|
|
8
|
+
export type PolyAudioInputProps = IOProps & {
|
|
9
|
+
ioType: IOType.PolyAudioInput;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type PolyAudioOutputProps = IOProps & {
|
|
13
|
+
ioType: IOType.PolyAudioOutput;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export class PolyAudioInput
|
|
17
|
+
extends IO<PolyAudioOutput | AudioOutput>
|
|
18
|
+
implements PolyAudioInputProps
|
|
19
|
+
{
|
|
20
|
+
declare ioType: IOType.PolyAudioInput;
|
|
21
|
+
declare module: PolyModule<ModuleType>;
|
|
22
|
+
|
|
23
|
+
plug(io: PolyAudioOutput | AudioOutput, plugOther = true) {
|
|
24
|
+
super.plug(io, plugOther);
|
|
25
|
+
if (!plugOther && io instanceof PolyAudioOutput) return;
|
|
26
|
+
|
|
27
|
+
plugOrUnplug(this, io, true);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
unPlug(io: PolyAudioOutput | AudioOutput, plugOther = true) {
|
|
31
|
+
super.unPlug(io, plugOther);
|
|
32
|
+
if (!plugOther && io instanceof PolyAudioOutput) return;
|
|
33
|
+
|
|
34
|
+
plugOrUnplug(this, io, false);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
findIOByVoice(voice: number): AudioInput {
|
|
38
|
+
return this.module
|
|
39
|
+
.findVoice(voice)
|
|
40
|
+
.inputs.findByName(this.name) as AudioInput;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class PolyAudioOutput
|
|
45
|
+
extends IO<PolyAudioInput | AudioInput>
|
|
46
|
+
implements PolyAudioOutputProps
|
|
47
|
+
{
|
|
48
|
+
declare ioType: IOType.PolyAudioOutput;
|
|
49
|
+
declare module: PolyModule<ModuleType>;
|
|
50
|
+
|
|
51
|
+
plug(io: PolyAudioInput | AudioInput, plugOther = true) {
|
|
52
|
+
super.plug(io, plugOther);
|
|
53
|
+
if (!plugOther && io instanceof PolyAudioInput) return;
|
|
54
|
+
|
|
55
|
+
plugOrUnplug(this, io, true);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
unPlug(io: PolyAudioInput | AudioInput, plugOther = true) {
|
|
59
|
+
super.unPlug(io, plugOther);
|
|
60
|
+
if (!plugOther && io instanceof PolyAudioInput) return;
|
|
61
|
+
|
|
62
|
+
plugOrUnplug(this, io, false);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
findIOByVoice(voice: number): AudioOutput {
|
|
66
|
+
return this.module
|
|
67
|
+
.findVoice(voice)
|
|
68
|
+
.outputs.findByName(this.name) as AudioOutput;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function plugOrUnplug(
|
|
73
|
+
thisIO: PolyAudioInput,
|
|
74
|
+
otherIO: PolyAudioOutput | AudioOutput,
|
|
75
|
+
isPlug: boolean,
|
|
76
|
+
): void;
|
|
77
|
+
function plugOrUnplug(
|
|
78
|
+
thisIO: PolyAudioOutput,
|
|
79
|
+
otherIO: PolyAudioInput | AudioInput,
|
|
80
|
+
isPlug: boolean,
|
|
81
|
+
): void;
|
|
82
|
+
function plugOrUnplug(
|
|
83
|
+
thisIO: PolyAudioInput | PolyAudioOutput,
|
|
84
|
+
otherIO: PolyAudioOutput | AudioOutput | PolyAudioInput | AudioInput,
|
|
85
|
+
isPlug: boolean,
|
|
86
|
+
) {
|
|
87
|
+
if (otherIO instanceof PolyAudioInput || otherIO instanceof PolyAudioOutput) {
|
|
88
|
+
const maxVoices = Math.max(thisIO.module.voices, otherIO.module.voices);
|
|
89
|
+
|
|
90
|
+
for (let voice = 0; voice < maxVoices; voice++) {
|
|
91
|
+
const thisMonoIO = thisIO.findIOByVoice(voice % thisIO.module.voices);
|
|
92
|
+
const otherMonoIO = otherIO.findIOByVoice(voice % otherIO.module.voices);
|
|
93
|
+
|
|
94
|
+
if (isPlug) {
|
|
95
|
+
// @ts-expect-error: temp solution until guard this input plug to output
|
|
96
|
+
thisMonoIO.plug(otherMonoIO);
|
|
97
|
+
} else {
|
|
98
|
+
// @ts-expect-error: temp solution until guard this input plug to output
|
|
99
|
+
thisMonoIO.unPlug(otherMonoIO);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
for (let voice = 0; voice < thisIO.module.voices; voice++) {
|
|
104
|
+
const thisMonoIO = thisIO.findIOByVoice(voice);
|
|
105
|
+
|
|
106
|
+
if (isPlug) {
|
|
107
|
+
// @ts-expect-error: temp solution until guard this input plug to output
|
|
108
|
+
thisMonoIO.plug(otherIO);
|
|
109
|
+
} else {
|
|
110
|
+
// @ts-expect-error: temp solution until guard this input plug to output
|
|
111
|
+
thisMonoIO.unPlug(otherIO);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
package/src/core/IO/index.ts
CHANGED
|
@@ -1,62 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
AudioInput,
|
|
5
|
-
AudioOutput,
|
|
6
|
-
IAudioInput,
|
|
7
|
-
IAudioOutput,
|
|
8
|
-
} from "./AudioNode";
|
|
9
|
-
import { IMidiInput, IMidiOutput, MidiInput, MidiOutput } from "./MidiNode";
|
|
10
|
-
import {
|
|
11
|
-
ForwardAudioInput,
|
|
12
|
-
ForwardAudioOutput,
|
|
13
|
-
IForwardAudioInput,
|
|
14
|
-
IForwardAudioOutput,
|
|
15
|
-
} from "./ForwardNode";
|
|
1
|
+
export { InputCollection, OutputCollection } from "./Collection";
|
|
2
|
+
export { AudioInput, AudioOutput } from "./AudioIO";
|
|
3
|
+
export { MidiInput, MidiOutput } from "./MidiIO";
|
|
16
4
|
|
|
17
|
-
|
|
18
|
-
type
|
|
19
|
-
type
|
|
20
|
-
type
|
|
21
|
-
type AnyInput = AnyAudioInput | AnyMidiInput;
|
|
22
|
-
type AnyOuput = AnyAudioOuput | AnyMidiOuput;
|
|
23
|
-
type AnyIO = AnyInput | AnyOuput;
|
|
24
|
-
|
|
25
|
-
type IAnyAudioInput = IAudioInput | IForwardAudioInput;
|
|
26
|
-
type IAnyMidiInput = IMidiInput;
|
|
27
|
-
type IAnyAudioOuput = IAudioOutput | IForwardAudioOutput;
|
|
28
|
-
type IAnyMidiOuput = IMidiOutput;
|
|
29
|
-
type IAnyInput = IAnyAudioInput | IAnyMidiInput;
|
|
30
|
-
type IAnyOutput = IAnyAudioOuput | IAnyMidiOuput;
|
|
31
|
-
type IAnyIO = IAnyInput | IAnyOutput;
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
IOCollection,
|
|
35
|
-
IOType,
|
|
36
|
-
AudioInput,
|
|
37
|
-
AudioOutput,
|
|
38
|
-
MidiInput,
|
|
39
|
-
MidiOutput,
|
|
40
|
-
ForwardAudioInput,
|
|
41
|
-
ForwardAudioOutput,
|
|
42
|
-
};
|
|
43
|
-
export type {
|
|
44
|
-
IAnyIO,
|
|
45
|
-
IIONode,
|
|
46
|
-
IAudioInput,
|
|
47
|
-
IAudioOutput,
|
|
48
|
-
IMidiInput,
|
|
49
|
-
IMidiOutput,
|
|
50
|
-
IForwardAudioInput,
|
|
51
|
-
IForwardAudioOutput,
|
|
52
|
-
IAnyInput,
|
|
53
|
-
IAnyOutput,
|
|
54
|
-
IIOSerialize,
|
|
55
|
-
AnyAudioInput,
|
|
56
|
-
AnyMidiInput,
|
|
57
|
-
AnyAudioOuput,
|
|
58
|
-
AnyMidiOuput,
|
|
59
|
-
AnyInput,
|
|
60
|
-
AnyOuput,
|
|
61
|
-
AnyIO,
|
|
62
|
-
};
|
|
5
|
+
export { IOType } from "./Base";
|
|
6
|
+
export type { IIOSerialize } from "./Base";
|
|
7
|
+
export type { AudioInputProps, AudioOutputProps } from "./AudioIO";
|
|
8
|
+
export type { MidiInputProps, MidiOutputProps } from "./MidiIO";
|