@blibliki/engine 0.1.23 → 0.1.25
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 +2 -2
- package/dist/build/core/IO/ForwardNode.d.ts +4 -4
- package/dist/build/modules/LFO.d.ts +44 -0
- package/dist/build/modules/Oscillator.d.ts +8 -4
- package/dist/main.cjs.js +4 -12
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.esm.js +4 -12
- package/dist/main.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/core/IO/ForwardNode.ts +4 -2
- package/src/modules/Filter.ts +1 -1
- package/src/modules/LFO.ts +150 -0
- package/src/modules/Oscillator.ts +28 -6
- package/src/modules/index.ts +3 -3
package/README.md
CHANGED
|
@@ -84,8 +84,8 @@ const volume = Engine.addModule({
|
|
|
84
84
|
|
|
85
85
|
```JavaScript
|
|
86
86
|
// Update props
|
|
87
|
-
Engine.
|
|
88
|
-
Engine.
|
|
87
|
+
Engine.updateModule({ id: volume.id, changes: { props: { volume: -20 } } });
|
|
88
|
+
Engine.updateModule({ id: osc.id, changes: { props: { wave: "square", fine: -10 } } });
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
##### Remove audio module
|
|
@@ -13,10 +13,10 @@ export declare class ForwardInput extends IONode implements IForwardInput {
|
|
|
13
13
|
ioType: IOType.ForwardInput;
|
|
14
14
|
connections: ForwardOutput[];
|
|
15
15
|
constructor(plugableModule: PolyModule<Module<Connectable, AnyObject>, AnyObject>, props: IForwardInput);
|
|
16
|
-
get subInputs(): (import("./
|
|
16
|
+
get subInputs(): (import("./MidiNode").MidiInput | import("./AudioNode").AudioInput)[];
|
|
17
17
|
get subModules(): Module<Connectable, AnyObject>[];
|
|
18
18
|
subModule(voiceNo: number): Module<Connectable, AnyObject>;
|
|
19
|
-
subInput(voiceNo: number): import("./
|
|
19
|
+
subInput(voiceNo: number): import("./MidiNode").MidiInput | import("./AudioNode").AudioInput;
|
|
20
20
|
plug(io: AnyOuput, plugOther?: boolean): void;
|
|
21
21
|
unPlug(io: AnyOuput, plugOther?: boolean): void;
|
|
22
22
|
unPlugAll(): void;
|
|
@@ -27,10 +27,10 @@ export declare class ForwardOutput extends IONode implements IForwardOutput {
|
|
|
27
27
|
ioType: IOType.ForwardOutput;
|
|
28
28
|
connections: ForwardInput[];
|
|
29
29
|
constructor(plugableModule: PolyModule<Module<Connectable, AnyObject>, AnyObject>, props: IForwardOutput);
|
|
30
|
-
get subOutputs(): (import("./
|
|
30
|
+
get subOutputs(): (import("./MidiNode").MidiOutput | import("./AudioNode").AudioOutput)[];
|
|
31
31
|
get subModules(): Module<Connectable, AnyObject>[];
|
|
32
32
|
subModule(voiceNo: number): Module<Connectable, AnyObject>;
|
|
33
|
-
subOutput(voiceNo: number): import("./
|
|
33
|
+
subOutput(voiceNo: number): import("./MidiNode").MidiOutput | import("./AudioNode").AudioOutput;
|
|
34
34
|
plug(io: AnyInput, plugOther?: boolean): void;
|
|
35
35
|
unPlug(io: AnyInput, plugOther?: boolean): void;
|
|
36
36
|
unPlugAll(): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LFO as LFOInternal } from "tone";
|
|
2
|
+
import Module, { PolyModule, Startable } from "../core/Module";
|
|
3
|
+
import { TWave } from "./Oscillator";
|
|
4
|
+
import Note from "../core/Note";
|
|
5
|
+
export interface LFOInterface {
|
|
6
|
+
wave: TWave;
|
|
7
|
+
frequency: number;
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
amount: number;
|
|
11
|
+
}
|
|
12
|
+
declare class MonoLFO extends Module<LFOInternal, LFOInterface> implements Startable {
|
|
13
|
+
constructor(params: {
|
|
14
|
+
id?: string;
|
|
15
|
+
name: string;
|
|
16
|
+
props: Partial<LFOInterface>;
|
|
17
|
+
});
|
|
18
|
+
get wave(): TWave;
|
|
19
|
+
set wave(value: TWave);
|
|
20
|
+
get min(): number;
|
|
21
|
+
set min(value: number);
|
|
22
|
+
get max(): number;
|
|
23
|
+
set max(value: number);
|
|
24
|
+
get frequency(): number;
|
|
25
|
+
set frequency(value: number);
|
|
26
|
+
get amount(): number;
|
|
27
|
+
set amount(value: number);
|
|
28
|
+
start(time: number): void;
|
|
29
|
+
stop(time?: number): void;
|
|
30
|
+
triggerAttack: (_: Note, triggeredAt: number) => void;
|
|
31
|
+
triggerRelease: () => void;
|
|
32
|
+
private registerInputs;
|
|
33
|
+
}
|
|
34
|
+
export default class LFO extends PolyModule<MonoLFO, LFOInterface> {
|
|
35
|
+
static moduleName: string;
|
|
36
|
+
constructor(params: {
|
|
37
|
+
id?: string;
|
|
38
|
+
name: string;
|
|
39
|
+
props: Partial<LFOInterface>;
|
|
40
|
+
});
|
|
41
|
+
start(time: number): void;
|
|
42
|
+
stop(time?: number): void;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { Oscillator as Osc } from "tone";
|
|
1
|
+
import { Multiply, Oscillator as Osc } from "tone";
|
|
2
2
|
import Note from "../core/Note";
|
|
3
3
|
import Module, { PolyModule, Startable } from "../core/Module";
|
|
4
|
+
export type TWave = "sine" | "triangle" | "square" | "sawtooth";
|
|
4
5
|
export interface OscillatorInterface {
|
|
5
6
|
noteName: string;
|
|
6
7
|
fine: number;
|
|
7
8
|
coarse: number;
|
|
8
|
-
wave:
|
|
9
|
+
wave: TWave;
|
|
9
10
|
volume: number;
|
|
10
11
|
range: number;
|
|
11
12
|
}
|
|
12
13
|
declare class MonoOscillator extends Module<Osc, OscillatorInterface> implements Startable {
|
|
13
14
|
private _note;
|
|
15
|
+
private _fineSignal;
|
|
14
16
|
constructor(params: {
|
|
15
17
|
id?: string;
|
|
16
18
|
name: string;
|
|
@@ -21,12 +23,13 @@ declare class MonoOscillator extends Module<Osc, OscillatorInterface> implements
|
|
|
21
23
|
set note(value: Note | string);
|
|
22
24
|
get noteName(): string;
|
|
23
25
|
set noteName(value: string);
|
|
26
|
+
get fineSingal(): Multiply<"number">;
|
|
24
27
|
get fine(): number;
|
|
25
28
|
set fine(value: number);
|
|
26
29
|
get coarse(): number;
|
|
27
30
|
set coarse(value: number);
|
|
28
|
-
get wave():
|
|
29
|
-
set wave(value:
|
|
31
|
+
get wave(): TWave;
|
|
32
|
+
set wave(value: TWave);
|
|
30
33
|
get volume(): number;
|
|
31
34
|
set volume(value: number);
|
|
32
35
|
get range(): number;
|
|
@@ -37,6 +40,7 @@ declare class MonoOscillator extends Module<Osc, OscillatorInterface> implements
|
|
|
37
40
|
triggerRelease: () => void;
|
|
38
41
|
private updateFrequency;
|
|
39
42
|
private getNote;
|
|
43
|
+
private registerInputs;
|
|
40
44
|
}
|
|
41
45
|
export default class Oscillator extends PolyModule<MonoOscillator, OscillatorInterface> {
|
|
42
46
|
static moduleName: string;
|