@blibliki/engine 0.1.24 → 0.1.26
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/dist/build/Engine.d.ts +2 -1
- package/dist/build/core/IO/AudioNode.d.ts +5 -5
- package/dist/build/core/IO/ForwardNode/Base.d.ts +18 -0
- package/dist/build/core/IO/ForwardNode/index.d.ts +27 -0
- package/dist/build/core/IO/MidiNode.d.ts +5 -5
- package/dist/build/core/IO/Node.d.ts +9 -5
- package/dist/build/core/IO/index.d.ts +17 -8
- package/dist/build/core/Module/PolyModule.d.ts +7 -5
- package/dist/build/routes.d.ts +1 -1
- package/dist/main.cjs.js +4 -4
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.esm.js +4 -4
- package/dist/main.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Engine.ts +14 -1
- package/src/core/IO/AudioNode.ts +8 -7
- package/src/core/IO/Collection.ts +11 -11
- package/src/core/IO/ForwardNode/Base.ts +99 -0
- package/src/core/IO/ForwardNode/index.ts +60 -0
- package/src/core/IO/MidiNode.ts +5 -5
- package/src/core/IO/Node.ts +49 -48
- package/src/core/IO/index.ts +28 -13
- package/src/core/Module/PolyModule.ts +26 -16
- package/src/modules/Filter.ts +2 -2
- package/src/modules/LFO.ts +2 -3
- package/src/modules/Oscillator.ts +2 -3
- package/src/core/IO/ForwardNode.ts +0 -192
package/dist/build/Engine.d.ts
CHANGED
|
@@ -61,10 +61,11 @@ declare class Engine {
|
|
|
61
61
|
addRoute(props: Optional<RouteInterface, "id">): {
|
|
62
62
|
id: string;
|
|
63
63
|
sourceId: string;
|
|
64
|
-
sourceIOId: string;
|
|
65
64
|
destinationId: string;
|
|
65
|
+
sourceIOId: string;
|
|
66
66
|
destinationIOId: string;
|
|
67
67
|
};
|
|
68
|
+
validRoute(props: Optional<RouteInterface, "id">): boolean;
|
|
68
69
|
removeRoute(id: string): void;
|
|
69
70
|
triggerVirtualMidi(id: string, noteName: string, type: "noteOn" | "noteOff"): void;
|
|
70
71
|
dispose(): void;
|
|
@@ -2,7 +2,7 @@ import { InputNode } from "tone";
|
|
|
2
2
|
import IONode, { IOType, IIONode } from "./Node";
|
|
3
3
|
import MonoModule, { Connectable } from "../Module/index";
|
|
4
4
|
import { AnyObject } from "../../types";
|
|
5
|
-
import {
|
|
5
|
+
import { AnyAudioInput, AnyAudioOuput } from ".";
|
|
6
6
|
export type AudioIO = AudioInput | AudioOutput;
|
|
7
7
|
export interface IAudioInput extends IIONode {
|
|
8
8
|
ioType: IOType.AudioInput;
|
|
@@ -19,8 +19,8 @@ export declare class AudioInput extends IONode implements IAudioInput {
|
|
|
19
19
|
internalModule: InputNode;
|
|
20
20
|
connections: AudioOutput[];
|
|
21
21
|
constructor(plugableModule: MonoModule<Connectable, AnyObject>, props: IAudioInput);
|
|
22
|
-
plug(io:
|
|
23
|
-
unPlug(io:
|
|
22
|
+
plug(io: AnyAudioOuput, plugOther?: boolean): void;
|
|
23
|
+
unPlug(io: AnyAudioOuput, plugOther?: boolean): void;
|
|
24
24
|
unPlugAll(): void;
|
|
25
25
|
}
|
|
26
26
|
export declare class AudioOutput extends IONode implements IAudioOutput {
|
|
@@ -28,8 +28,8 @@ export declare class AudioOutput extends IONode implements IAudioOutput {
|
|
|
28
28
|
internalModule: IInternalModule;
|
|
29
29
|
connections: AudioInput[];
|
|
30
30
|
constructor(plugableModule: MonoModule<Connectable, AnyObject>, props: IAudioOutput);
|
|
31
|
-
plug(io:
|
|
32
|
-
unPlug(io:
|
|
31
|
+
plug(io: AnyAudioInput, plugOther?: boolean): void;
|
|
32
|
+
unPlug(io: AnyAudioInput, plugOther?: boolean): void;
|
|
33
33
|
unPlugAll(): void;
|
|
34
34
|
}
|
|
35
35
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import IONode, { IIONode } from "../Node";
|
|
2
|
+
import Module, { Connectable, PolyModule } from "../../Module";
|
|
3
|
+
import { AnyObject } from "../../../types";
|
|
4
|
+
import { AnyIO } from "..";
|
|
5
|
+
export default class ForwardBaseNode extends IONode {
|
|
6
|
+
plugableModule: PolyModule<Module<Connectable, AnyObject>, AnyObject>;
|
|
7
|
+
constructor(plugableModule: PolyModule<Module<Connectable, AnyObject>, AnyObject>, props: IIONode);
|
|
8
|
+
get voices(): number;
|
|
9
|
+
get subModules(): Module<Connectable, AnyObject>[];
|
|
10
|
+
subModule(voiceNo: number): Module<Connectable, AnyObject>;
|
|
11
|
+
get subIOs(): IONode[];
|
|
12
|
+
subIO(voiceNo: number): import("..").AudioInput | import("..").MidiInput | import("..").AudioOutput | import("..").MidiOutput;
|
|
13
|
+
plug(io: AnyIO, plugOther?: boolean): void;
|
|
14
|
+
unPlug(io: AnyIO, plugOther?: boolean): void;
|
|
15
|
+
unPlugAll(): void;
|
|
16
|
+
private plugUnplug;
|
|
17
|
+
private checkNameValidity;
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IOType, IIONode } from "../Node";
|
|
2
|
+
import Module, { Connectable, PolyModule } from "../../Module";
|
|
3
|
+
import { AnyObject } from "../../../types";
|
|
4
|
+
import { AnyAudioInput, AnyAudioOuput, AnyInput, AnyOuput } from "..";
|
|
5
|
+
import ForwardBaseNode from "./Base";
|
|
6
|
+
export interface IForwardAudioInput extends IIONode {
|
|
7
|
+
ioType: IOType.ForwardAudioInput;
|
|
8
|
+
}
|
|
9
|
+
export interface IForwardAudioOutput extends IIONode {
|
|
10
|
+
ioType: IOType.ForwardAudioOutput;
|
|
11
|
+
}
|
|
12
|
+
export declare class ForwardAudioInput extends ForwardBaseNode implements IForwardAudioInput {
|
|
13
|
+
plugableModule: PolyModule<Module<Connectable, AnyObject>, AnyObject>;
|
|
14
|
+
ioType: IOType.ForwardAudioInput;
|
|
15
|
+
connections: AnyAudioOuput[];
|
|
16
|
+
constructor(plugableModule: PolyModule<Module<Connectable, AnyObject>, AnyObject>, props: IForwardAudioInput);
|
|
17
|
+
plug(io: AnyOuput, plugOther?: boolean): void;
|
|
18
|
+
unPlug(io: AnyOuput, plugOther?: boolean): void;
|
|
19
|
+
}
|
|
20
|
+
export declare class ForwardAudioOutput extends ForwardBaseNode implements IForwardAudioOutput {
|
|
21
|
+
plugableModule: PolyModule<Module<Connectable, AnyObject>, AnyObject>;
|
|
22
|
+
ioType: IOType.ForwardAudioOutput;
|
|
23
|
+
connections: AnyAudioInput[];
|
|
24
|
+
constructor(plugableModule: PolyModule<Module<Connectable, AnyObject>, AnyObject>, props: IForwardAudioOutput);
|
|
25
|
+
plug(io: AnyInput, plugOther?: boolean): void;
|
|
26
|
+
unPlug(io: AnyInput, plugOther?: boolean): void;
|
|
27
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { AnyMidiInput, AnyMidiOuput } from ".";
|
|
1
2
|
import { AudioModule } from "../Module";
|
|
2
3
|
import { MidiEvent } from "../midi";
|
|
3
|
-
import { ForwardInput, ForwardOutput } from "./ForwardNode";
|
|
4
4
|
import IONode, { IOType, IIONode } from "./Node";
|
|
5
5
|
export interface IMidiInput extends IIONode {
|
|
6
6
|
ioType: IOType.MidiInput;
|
|
@@ -14,16 +14,16 @@ export declare class MidiInput extends IONode implements IMidiInput {
|
|
|
14
14
|
connections: MidiOutput[];
|
|
15
15
|
onMidiEvent: (event: MidiEvent) => void;
|
|
16
16
|
constructor(plugableModule: AudioModule, props: IMidiInput);
|
|
17
|
-
plug(io:
|
|
18
|
-
unPlug(io:
|
|
17
|
+
plug(io: AnyMidiOuput, plugOther?: boolean): void;
|
|
18
|
+
unPlug(io: AnyMidiOuput, plugOther?: boolean): void;
|
|
19
19
|
unPlugAll(): void;
|
|
20
20
|
}
|
|
21
21
|
export declare class MidiOutput extends IONode implements IMidiOutput {
|
|
22
22
|
ioType: IOType.MidiOutput;
|
|
23
23
|
connections: MidiInput[];
|
|
24
24
|
constructor(plugableModule: AudioModule, props: IIONode);
|
|
25
|
-
plug(io:
|
|
26
|
-
unPlug(io:
|
|
25
|
+
plug(io: AnyMidiInput, plugOther?: boolean): void;
|
|
26
|
+
unPlug(io: AnyMidiInput, plugOther?: boolean): void;
|
|
27
27
|
unPlugAll(): void;
|
|
28
28
|
onMidiEvent: (event: MidiEvent) => void;
|
|
29
29
|
private get midiConnections();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AudioModule } from "../Module";
|
|
2
|
-
import {
|
|
2
|
+
import { AnyIO } from ".";
|
|
3
3
|
export interface IIONode {
|
|
4
4
|
name: string;
|
|
5
5
|
ioType: IOType;
|
|
@@ -16,11 +16,11 @@ export declare enum IOType {
|
|
|
16
16
|
AudioOutput = "audioOutput",
|
|
17
17
|
MidiInput = "midiInput",
|
|
18
18
|
MidiOutput = "midiOutput",
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
ForwardAudioInput = "forwardAudioInput",
|
|
20
|
+
ForwardAudioOutput = "forwardAudioOutput"
|
|
21
21
|
}
|
|
22
|
-
export declare function plugCompatibleIO(
|
|
23
|
-
export declare function unPlugCompatibleIO(
|
|
22
|
+
export declare function plugCompatibleIO(io1: AnyIO, io2: AnyIO): void;
|
|
23
|
+
export declare function unPlugCompatibleIO(io1: AnyIO, io2: AnyIO): void;
|
|
24
24
|
export default abstract class IONode implements IIONode {
|
|
25
25
|
id: string;
|
|
26
26
|
ioType: IOType;
|
|
@@ -31,6 +31,10 @@ export default abstract class IONode implements IIONode {
|
|
|
31
31
|
constructor(plugableModule: AudioModule, props: IIONode);
|
|
32
32
|
plug(io: IONode, plugOther?: boolean): void;
|
|
33
33
|
unPlug(io: IONode, plugOther?: boolean): void;
|
|
34
|
+
get isInput(): boolean;
|
|
35
|
+
get isOutput(): boolean;
|
|
36
|
+
get isAudio(): boolean;
|
|
37
|
+
get isMidi(): boolean;
|
|
34
38
|
abstract unPlugAll(): void;
|
|
35
39
|
serialize(): IIOSerialize;
|
|
36
40
|
}
|
|
@@ -2,11 +2,20 @@ import { default as IOCollection } from "./Collection";
|
|
|
2
2
|
import { IIONode, IOType, IIOSerialize } from "./Node";
|
|
3
3
|
import { AudioInput, AudioOutput, IAudioInput, IAudioOutput } from "./AudioNode";
|
|
4
4
|
import { IMidiInput, IMidiOutput, MidiInput, MidiOutput } from "./MidiNode";
|
|
5
|
-
import {
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
type
|
|
10
|
-
type
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import { ForwardAudioInput, ForwardAudioOutput, IForwardAudioInput, IForwardAudioOutput } from "./ForwardNode";
|
|
6
|
+
type AnyAudioInput = AudioInput | ForwardAudioInput;
|
|
7
|
+
type AnyMidiInput = MidiInput;
|
|
8
|
+
type AnyAudioOuput = AudioOutput | ForwardAudioOutput;
|
|
9
|
+
type AnyMidiOuput = MidiOutput;
|
|
10
|
+
type AnyInput = AnyAudioInput | AnyMidiInput;
|
|
11
|
+
type AnyOuput = AnyAudioOuput | AnyMidiOuput;
|
|
12
|
+
type AnyIO = AnyInput | AnyOuput;
|
|
13
|
+
type IAnyAudioInput = IAudioInput | IForwardAudioInput;
|
|
14
|
+
type IAnyMidiInput = IMidiInput;
|
|
15
|
+
type IAnyAudioOuput = IAudioOutput | IForwardAudioOutput;
|
|
16
|
+
type IAnyMidiOuput = IMidiOutput;
|
|
17
|
+
type IAnyInput = IAnyAudioInput | IAnyMidiInput;
|
|
18
|
+
type IAnyOutput = IAnyAudioOuput | IAnyMidiOuput;
|
|
19
|
+
type IAnyIO = IAnyInput | IAnyOutput;
|
|
20
|
+
export { IOCollection, IOType, AudioInput, AudioOutput, MidiInput, MidiOutput, ForwardAudioInput, ForwardAudioOutput, };
|
|
21
|
+
export type { IAnyIO, IIONode, IAudioInput, IAudioOutput, IMidiInput, IMidiOutput, IForwardAudioInput, IForwardAudioOutput, IAnyInput, IAnyOutput, IIOSerialize, AnyAudioInput, AnyMidiInput, AnyAudioOuput, AnyMidiOuput, AnyInput, AnyOuput, AnyIO, };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { MidiEvent } from "../midi";
|
|
2
2
|
import Module, { Connectable } from "./MonoModule";
|
|
3
|
-
import { IOCollection,
|
|
3
|
+
import { IOCollection, IMidiInput, IMidiOutput, MidiOutput, MidiInput, AnyInput, AnyOuput, ForwardAudioInput } from "../IO";
|
|
4
4
|
import { AudioModule } from "./index";
|
|
5
|
+
import { ForwardAudioOutput, IForwardAudioInput, IForwardAudioOutput } from "../IO/ForwardNode";
|
|
5
6
|
interface PolyModuleInterface<MonoAudioModule, PropsInterface> {
|
|
6
7
|
id?: string;
|
|
7
8
|
name: string;
|
|
@@ -23,8 +24,8 @@ export default abstract class PolyModule<MonoAudioModule extends Module<Connecta
|
|
|
23
24
|
}) => MonoAudioModule;
|
|
24
25
|
_name: string;
|
|
25
26
|
audioModules: MonoAudioModule[];
|
|
26
|
-
inputs: IOCollection<
|
|
27
|
-
outputs: IOCollection<
|
|
27
|
+
inputs: IOCollection<AnyInput>;
|
|
28
|
+
outputs: IOCollection<AnyOuput>;
|
|
28
29
|
private _numberOfVoices;
|
|
29
30
|
constructor(params: PolyModuleInterface<MonoAudioModule, PropsInterface>);
|
|
30
31
|
get name(): string;
|
|
@@ -48,12 +49,13 @@ export default abstract class PolyModule<MonoAudioModule extends Module<Connecta
|
|
|
48
49
|
};
|
|
49
50
|
protected find(callback: (audioModule: MonoAudioModule) => boolean): MonoAudioModule;
|
|
50
51
|
protected findVoice(voiceNo: number): MonoAudioModule | undefined;
|
|
51
|
-
protected
|
|
52
|
-
protected
|
|
52
|
+
protected registerForwardAudioInput(props: Omit<IForwardAudioInput, "ioType">): ForwardAudioInput;
|
|
53
|
+
protected registerForwardAudioOutput(props: Omit<IForwardAudioOutput, "ioType">): ForwardAudioOutput;
|
|
53
54
|
protected registerMidiInput(props: Omit<IMidiInput, "ioType">): MidiInput;
|
|
54
55
|
protected registerMidiOutput(props: Omit<IMidiOutput, "ioType">): MidiOutput;
|
|
55
56
|
protected registerBasicOutputs(): void;
|
|
56
57
|
protected registerBasicInputs(): void;
|
|
58
|
+
protected registerMidiIn(): void;
|
|
57
59
|
private adjustNumberOfModules;
|
|
58
60
|
}
|
|
59
61
|
export {};
|
package/dist/build/routes.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export interface RouteInterface extends RouteProps {
|
|
|
11
11
|
export declare function createRoute(props: Optional<RouteInterface, "id">): {
|
|
12
12
|
id: string;
|
|
13
13
|
sourceId: string;
|
|
14
|
-
sourceIOId: string;
|
|
15
14
|
destinationId: string;
|
|
15
|
+
sourceIOId: string;
|
|
16
16
|
destinationIOId: string;
|
|
17
17
|
};
|
|
18
18
|
export declare function applyRoutes(routes: RouteInterface[]): void;
|