@blibliki/engine 0.1.27 → 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 -19484
- package/dist/index.js.map +1 -0
- package/package.json +16 -27
- 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 +203 -158
- 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/index.umd.cjs +0 -227
- package/dist/src/Engine.d.ts +0 -83
- package/dist/src/core/IO/AudioNode.d.ts +0 -36
- package/dist/src/core/IO/Collection.d.ts +0 -14
- package/dist/src/core/IO/ForwardNode/Base.d.ts +0 -19
- package/dist/src/core/IO/ForwardNode/index.d.ts +0 -28
- package/dist/src/core/IO/MidiNode.d.ts +0 -31
- package/dist/src/core/IO/Node.d.ts +0 -41
- package/dist/src/core/IO/index.d.ts +0 -22
- package/dist/src/core/Module/MonoModule.d.ts +0 -68
- package/dist/src/core/Module/PolyModule.d.ts +0 -62
- package/dist/src/core/Module/index.d.ts +0 -7
- package/dist/src/core/Note/frequencyTable.d.ts +0 -4
- package/dist/src/core/Note/index.d.ts +0 -28
- package/dist/src/core/midi/ComputerKeyboardInput.d.ts +0 -12
- package/dist/src/core/midi/MidiDevice.d.ts +0 -30
- package/dist/src/core/midi/MidiDeviceManager.d.ts +0 -15
- package/dist/src/core/midi/MidiEvent.d.ts +0 -22
- package/dist/src/core/midi/index.d.ts +0 -5
- package/dist/src/index.d.ts +0 -9
- package/dist/src/main.d.ts +0 -0
- package/dist/src/modules/BitCrusher.d.ts +0 -17
- package/dist/src/modules/Delay.d.ts +0 -20
- package/dist/src/modules/Distortion.d.ts +0 -17
- package/dist/src/modules/Effect.d.ts +0 -20
- package/dist/src/modules/Envelope/AmpEnvelope.d.ts +0 -19
- package/dist/src/modules/Envelope/Base.d.ts +0 -67
- package/dist/src/modules/Envelope/FreqEnvelope.d.ts +0 -26
- package/dist/src/modules/Envelope/index.d.ts +0 -3
- package/dist/src/modules/Filter.d.ts +0 -43
- package/dist/src/modules/LFO.d.ts +0 -45
- package/dist/src/modules/Master.d.ts +0 -12
- package/dist/src/modules/MidiSelector.d.ts +0 -22
- package/dist/src/modules/Oscillator.d.ts +0 -56
- package/dist/src/modules/Reverb.d.ts +0 -20
- package/dist/src/modules/Sequencer.d.ts +0 -43
- package/dist/src/modules/VirtualMidi.d.ts +0 -33
- package/dist/src/modules/VoiceScheduler.d.ts +0 -45
- package/dist/src/modules/Volume.d.ts +0 -27
- package/dist/src/modules/index.d.ts +0 -18
- package/dist/src/routes.d.ts +0 -19
- package/dist/src/types.d.ts +0 -5
- package/dist/src/utils.d.ts +0 -1
- package/dist/test/MockingModules.d.ts +0 -22
- package/dist/test/Module/Oscillator.test.d.ts +0 -1
- package/dist/test/core/IO.test.d.ts +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/main.ts +0 -1
- 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
- package/src/vite-env.d.ts +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { default as Note } from '../../core/Note';
|
|
2
|
-
import { default as Module, PolyModule, Connectable, Triggerable } from '../../core/Module';
|
|
3
|
-
import { Envelope as Env } from 'tone';
|
|
4
|
-
|
|
5
|
-
export declare const enum EnvelopeStages {
|
|
6
|
-
Attack = "attack",
|
|
7
|
-
Decay = "decay",
|
|
8
|
-
Sustain = "sustain",
|
|
9
|
-
Release = "release"
|
|
10
|
-
}
|
|
11
|
-
export interface EnvelopeInterface {
|
|
12
|
-
attack: number;
|
|
13
|
-
decay: number;
|
|
14
|
-
sustain: number;
|
|
15
|
-
release: number;
|
|
16
|
-
}
|
|
17
|
-
export default abstract class EnvelopeModule<EnvelopeLike extends Env> extends Module<EnvelopeLike, EnvelopeInterface> implements Triggerable {
|
|
18
|
-
activeNote?: string;
|
|
19
|
-
triggeredAt: number;
|
|
20
|
-
constructor(params: {
|
|
21
|
-
id?: string;
|
|
22
|
-
name: string;
|
|
23
|
-
internalModule: EnvelopeLike;
|
|
24
|
-
props: EnvelopeInterface;
|
|
25
|
-
});
|
|
26
|
-
get attack(): number;
|
|
27
|
-
set attack(value: number);
|
|
28
|
-
get decay(): number;
|
|
29
|
-
set decay(value: number);
|
|
30
|
-
get sustain(): number;
|
|
31
|
-
set sustain(value: number);
|
|
32
|
-
get release(): number;
|
|
33
|
-
set release(value: number);
|
|
34
|
-
setStage(stage: EnvelopeStages, value: number): void;
|
|
35
|
-
triggerAttack: (note: Note, triggeredAt: number) => void;
|
|
36
|
-
triggerRelease: (note: Note, triggeredAt: number) => void;
|
|
37
|
-
private maxTime;
|
|
38
|
-
private minTime;
|
|
39
|
-
}
|
|
40
|
-
export declare abstract class PolyBase<EnvelopeModule extends Module<Connectable, EnvelopeInterface>> extends PolyModule<EnvelopeModule, EnvelopeInterface> {
|
|
41
|
-
constructor(params: {
|
|
42
|
-
id?: string;
|
|
43
|
-
name: string;
|
|
44
|
-
child: new (params: {
|
|
45
|
-
id?: string;
|
|
46
|
-
name: string;
|
|
47
|
-
props: EnvelopeInterface;
|
|
48
|
-
}) => EnvelopeModule;
|
|
49
|
-
props: Partial<EnvelopeInterface>;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
declare class MonoEnvelope extends EnvelopeModule<Env> {
|
|
53
|
-
constructor(params: {
|
|
54
|
-
id?: string;
|
|
55
|
-
name: string;
|
|
56
|
-
props: EnvelopeInterface;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
export declare class Envelope extends PolyBase<MonoEnvelope> {
|
|
60
|
-
static moduleName: string;
|
|
61
|
-
constructor(params: {
|
|
62
|
-
id?: string;
|
|
63
|
-
name: string;
|
|
64
|
-
props: Partial<EnvelopeInterface>;
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { default as Base, EnvelopeInterface, PolyBase } from './Base';
|
|
2
|
-
import { default as Filter } from '../Filter';
|
|
3
|
-
import { FrequencyEnvelope } from 'tone';
|
|
4
|
-
|
|
5
|
-
export declare class MonoFreqEnvelope extends Base<FrequencyEnvelope> {
|
|
6
|
-
private _frequency;
|
|
7
|
-
private _amount;
|
|
8
|
-
filter: Filter;
|
|
9
|
-
constructor(params: {
|
|
10
|
-
id?: string;
|
|
11
|
-
name: string;
|
|
12
|
-
props: EnvelopeInterface;
|
|
13
|
-
});
|
|
14
|
-
get frequency(): number;
|
|
15
|
-
set frequency(value: number);
|
|
16
|
-
get amount(): number;
|
|
17
|
-
set amount(value: number);
|
|
18
|
-
}
|
|
19
|
-
export default class FreqEnvelope extends PolyBase<MonoFreqEnvelope> {
|
|
20
|
-
static moduleName: string;
|
|
21
|
-
constructor(params: {
|
|
22
|
-
id?: string;
|
|
23
|
-
name: string;
|
|
24
|
-
props: Partial<EnvelopeInterface>;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { default as Module, PolyModule } from '../core/Module';
|
|
2
|
-
import { Filter as InternalFilter, FilterRollOff } from 'tone';
|
|
3
|
-
|
|
4
|
-
interface FilterInterface {
|
|
5
|
-
cutoff: number;
|
|
6
|
-
filterType: BiquadFilterType;
|
|
7
|
-
resonance: number;
|
|
8
|
-
slope: FilterRollOff;
|
|
9
|
-
envelopeAmount: number;
|
|
10
|
-
}
|
|
11
|
-
type FilterProps = Partial<FilterInterface>;
|
|
12
|
-
declare class MonoFilter extends Module<InternalFilter, FilterInterface> {
|
|
13
|
-
private _cutoff;
|
|
14
|
-
private _amount;
|
|
15
|
-
constructor(params: {
|
|
16
|
-
id?: string;
|
|
17
|
-
name: string;
|
|
18
|
-
props: FilterProps;
|
|
19
|
-
});
|
|
20
|
-
get cutoff(): number;
|
|
21
|
-
set cutoff(value: number);
|
|
22
|
-
get filterType(): BiquadFilterType;
|
|
23
|
-
set filterType(value: BiquadFilterType);
|
|
24
|
-
get slope(): FilterRollOff;
|
|
25
|
-
set slope(value: FilterRollOff);
|
|
26
|
-
get frequency(): import('tone').Signal<"frequency">;
|
|
27
|
-
get resonance(): number;
|
|
28
|
-
set resonance(value: number);
|
|
29
|
-
get envelopeAmount(): number;
|
|
30
|
-
set envelopeAmount(value: number);
|
|
31
|
-
private registerOutputs;
|
|
32
|
-
private updateAmountFactor;
|
|
33
|
-
}
|
|
34
|
-
export default class Filter extends PolyModule<MonoFilter, FilterInterface> {
|
|
35
|
-
static moduleName: string;
|
|
36
|
-
constructor(params: {
|
|
37
|
-
id?: string;
|
|
38
|
-
name: string;
|
|
39
|
-
props: Partial<FilterInterface>;
|
|
40
|
-
});
|
|
41
|
-
private registerOutputs;
|
|
42
|
-
}
|
|
43
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { default as Note } from '../core/Note';
|
|
2
|
-
import { TWave } from './Oscillator';
|
|
3
|
-
import { default as Module, PolyModule, Startable } from '../core/Module';
|
|
4
|
-
import { LFO as LFOInternal } from 'tone';
|
|
5
|
-
|
|
6
|
-
export interface LFOInterface {
|
|
7
|
-
wave: TWave;
|
|
8
|
-
frequency: number;
|
|
9
|
-
min: number;
|
|
10
|
-
max: number;
|
|
11
|
-
amount: number;
|
|
12
|
-
}
|
|
13
|
-
declare class MonoLFO extends Module<LFOInternal, LFOInterface> implements Startable {
|
|
14
|
-
constructor(params: {
|
|
15
|
-
id?: string;
|
|
16
|
-
name: string;
|
|
17
|
-
props: Partial<LFOInterface>;
|
|
18
|
-
});
|
|
19
|
-
get wave(): TWave;
|
|
20
|
-
set wave(value: TWave);
|
|
21
|
-
get min(): number;
|
|
22
|
-
set min(value: number);
|
|
23
|
-
get max(): number;
|
|
24
|
-
set max(value: number);
|
|
25
|
-
get frequency(): number;
|
|
26
|
-
set frequency(value: number);
|
|
27
|
-
get amount(): number;
|
|
28
|
-
set amount(value: number);
|
|
29
|
-
start(time: number): void;
|
|
30
|
-
stop(time?: number): void;
|
|
31
|
-
triggerAttack: (_: Note, triggeredAt: number) => void;
|
|
32
|
-
triggerRelease: () => void;
|
|
33
|
-
private registerInputs;
|
|
34
|
-
}
|
|
35
|
-
export default class LFO extends PolyModule<MonoLFO, LFOInterface> {
|
|
36
|
-
static moduleName: string;
|
|
37
|
-
constructor(params: {
|
|
38
|
-
id?: string;
|
|
39
|
-
name: string;
|
|
40
|
-
props: Partial<LFOInterface>;
|
|
41
|
-
});
|
|
42
|
-
start(time: number): void;
|
|
43
|
-
stop(time?: number): void;
|
|
44
|
-
}
|
|
45
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { default as Module } from '../core/Module';
|
|
2
|
-
import { Destination } from 'tone';
|
|
3
|
-
|
|
4
|
-
export interface MasterInterface {
|
|
5
|
-
}
|
|
6
|
-
export default class Master extends Module<typeof Destination, MasterInterface> {
|
|
7
|
-
static moduleName: string;
|
|
8
|
-
constructor({ id }: {
|
|
9
|
-
id?: string;
|
|
10
|
-
});
|
|
11
|
-
dispose(): void;
|
|
12
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { MidiOutput } from '../core/IO';
|
|
2
|
-
import { default as Module, DummnyInternalModule } from '../core/Module';
|
|
3
|
-
|
|
4
|
-
export interface MidiSelectorInterface {
|
|
5
|
-
selectedId: string | null;
|
|
6
|
-
}
|
|
7
|
-
export default class MidiSelector extends Module<DummnyInternalModule, MidiSelectorInterface> {
|
|
8
|
-
static moduleName: string;
|
|
9
|
-
midiOutput: MidiOutput;
|
|
10
|
-
constructor(params: {
|
|
11
|
-
id?: string;
|
|
12
|
-
name: string;
|
|
13
|
-
props: Partial<MidiSelectorInterface>;
|
|
14
|
-
});
|
|
15
|
-
get selectedId(): string | null;
|
|
16
|
-
set selectedId(value: string | null);
|
|
17
|
-
dispose(): void;
|
|
18
|
-
private registerOutputs;
|
|
19
|
-
private addEventListener;
|
|
20
|
-
private forwardMidiEvent;
|
|
21
|
-
private removeEventListener;
|
|
22
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { default as Module, PolyModule, Startable } from '../core/Module';
|
|
2
|
-
import { default as Note } from '../core/Note';
|
|
3
|
-
import { Oscillator as Osc, Signal } from 'tone';
|
|
4
|
-
|
|
5
|
-
export type TWave = "sine" | "triangle" | "square" | "sawtooth";
|
|
6
|
-
export interface OscillatorInterface {
|
|
7
|
-
noteName: string;
|
|
8
|
-
fine: number;
|
|
9
|
-
coarse: number;
|
|
10
|
-
wave: TWave;
|
|
11
|
-
volume: number;
|
|
12
|
-
range: number;
|
|
13
|
-
}
|
|
14
|
-
export declare class MonoOscillator extends Module<Osc, OscillatorInterface> implements Startable {
|
|
15
|
-
private _note;
|
|
16
|
-
private _fineMulti;
|
|
17
|
-
private _fineSignal;
|
|
18
|
-
constructor(params: {
|
|
19
|
-
id?: string;
|
|
20
|
-
name: string;
|
|
21
|
-
props: Partial<OscillatorInterface>;
|
|
22
|
-
});
|
|
23
|
-
get note(): Note;
|
|
24
|
-
setNoteAt(value: Note | string, time: number): void;
|
|
25
|
-
set note(value: Note | string);
|
|
26
|
-
get noteName(): string;
|
|
27
|
-
set noteName(value: string);
|
|
28
|
-
get fineSingal(): Signal<"number">;
|
|
29
|
-
get fine(): number;
|
|
30
|
-
set fine(value: number);
|
|
31
|
-
get coarse(): number;
|
|
32
|
-
set coarse(value: number);
|
|
33
|
-
get wave(): TWave;
|
|
34
|
-
set wave(value: TWave);
|
|
35
|
-
get volume(): number;
|
|
36
|
-
set volume(value: number);
|
|
37
|
-
get range(): number;
|
|
38
|
-
set range(value: number);
|
|
39
|
-
start(time: number): void;
|
|
40
|
-
stop(time?: number): void;
|
|
41
|
-
triggerAttack: (note: Note, triggeredAt: number) => void;
|
|
42
|
-
triggerRelease: () => void;
|
|
43
|
-
private updateFrequency;
|
|
44
|
-
private getNote;
|
|
45
|
-
private registerInputs;
|
|
46
|
-
}
|
|
47
|
-
export default class Oscillator extends PolyModule<MonoOscillator, OscillatorInterface> {
|
|
48
|
-
static moduleName: string;
|
|
49
|
-
constructor(params: {
|
|
50
|
-
id?: string;
|
|
51
|
-
name: string;
|
|
52
|
-
props: Partial<OscillatorInterface>;
|
|
53
|
-
});
|
|
54
|
-
start(time: number): void;
|
|
55
|
-
stop(time?: number): void;
|
|
56
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { default as Effect, EffectInterface } from './Effect';
|
|
2
|
-
import { Reverb as InternalReverb } from 'tone';
|
|
3
|
-
|
|
4
|
-
interface ReverbInterface extends EffectInterface {
|
|
5
|
-
decay: number;
|
|
6
|
-
preDelay: number;
|
|
7
|
-
}
|
|
8
|
-
export default class Reverb extends Effect<InternalReverb, ReverbInterface> {
|
|
9
|
-
static moduleName: string;
|
|
10
|
-
constructor(params: {
|
|
11
|
-
id?: string;
|
|
12
|
-
name: string;
|
|
13
|
-
props: Partial<ReverbInterface>;
|
|
14
|
-
});
|
|
15
|
-
get decay(): number;
|
|
16
|
-
set decay(value: number);
|
|
17
|
-
get preDelay(): number;
|
|
18
|
-
set preDelay(value: number);
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { MidiOutput } from '../core/IO';
|
|
2
|
-
import { INote } from '../core/Note';
|
|
3
|
-
import { default as Module, DummnyInternalModule } from '../core/Module';
|
|
4
|
-
|
|
5
|
-
export interface ISequence {
|
|
6
|
-
active: boolean;
|
|
7
|
-
time: string;
|
|
8
|
-
notes: INote[];
|
|
9
|
-
}
|
|
10
|
-
interface ISequencer {
|
|
11
|
-
sequences: ISequence[][];
|
|
12
|
-
steps: number;
|
|
13
|
-
bars: number;
|
|
14
|
-
}
|
|
15
|
-
export default class Sequencer extends Module<DummnyInternalModule, ISequencer> {
|
|
16
|
-
static moduleName: string;
|
|
17
|
-
midiOutput: MidiOutput;
|
|
18
|
-
private part;
|
|
19
|
-
constructor(params: {
|
|
20
|
-
id?: string;
|
|
21
|
-
name: string;
|
|
22
|
-
props: Partial<ISequencer>;
|
|
23
|
-
});
|
|
24
|
-
get props(): ISequencer;
|
|
25
|
-
set props(value: ISequencer);
|
|
26
|
-
get steps(): number;
|
|
27
|
-
set steps(value: number);
|
|
28
|
-
get bars(): number;
|
|
29
|
-
set bars(value: number);
|
|
30
|
-
get sequences(): ISequence[][];
|
|
31
|
-
set sequences(value: ISequence[][]);
|
|
32
|
-
start(time: number): void;
|
|
33
|
-
stop(): void;
|
|
34
|
-
private registerOutputs;
|
|
35
|
-
private initializePart;
|
|
36
|
-
private adjust;
|
|
37
|
-
private adjustNumberOfBars;
|
|
38
|
-
private adjustNumberOfSteps;
|
|
39
|
-
private updateBarParts;
|
|
40
|
-
private get loopEnd();
|
|
41
|
-
private onPartEvent;
|
|
42
|
-
}
|
|
43
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { MidiOutput } from '../core/IO';
|
|
2
|
-
import { default as Module, DummnyInternalModule } from '../core/Module';
|
|
3
|
-
import { default as Note } from '../core/Note';
|
|
4
|
-
import { MidiEvent } from '../core/midi';
|
|
5
|
-
|
|
6
|
-
export interface VirtualMidiInterface {
|
|
7
|
-
activeNotes: string[];
|
|
8
|
-
}
|
|
9
|
-
export default class VirtualMidi extends Module<DummnyInternalModule, VirtualMidiInterface> {
|
|
10
|
-
static moduleName: string;
|
|
11
|
-
midiOutput: MidiOutput;
|
|
12
|
-
constructor(params: {
|
|
13
|
-
id?: string;
|
|
14
|
-
name: string;
|
|
15
|
-
props: VirtualMidiInterface;
|
|
16
|
-
});
|
|
17
|
-
get activeNotes(): string[];
|
|
18
|
-
set activeNotes(value: string[]);
|
|
19
|
-
sendMidi(midiEvent: MidiEvent): void;
|
|
20
|
-
triggerAttack: (note: Note, triggerAttack: number) => void;
|
|
21
|
-
triggerRelease: (note: Note, triggerAttack: number) => void;
|
|
22
|
-
serialize(): {
|
|
23
|
-
activeNotes: string[];
|
|
24
|
-
id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
type: string;
|
|
27
|
-
props: VirtualMidiInterface;
|
|
28
|
-
inputs: import('../core/IO').IIOSerialize[];
|
|
29
|
-
outputs: import('../core/IO').IIOSerialize[];
|
|
30
|
-
};
|
|
31
|
-
private registerInputs;
|
|
32
|
-
private registerOutputs;
|
|
33
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { MidiOutput } from '../core/IO';
|
|
2
|
-
import { default as Module, PolyModule, DummnyInternalModule } from '../core/Module';
|
|
3
|
-
import { MidiEvent } from '../core/midi';
|
|
4
|
-
|
|
5
|
-
export interface VoiceSchedulerInterface {
|
|
6
|
-
polyNumber: number;
|
|
7
|
-
}
|
|
8
|
-
export default class VoiceScheduler extends PolyModule<Voice, VoiceSchedulerInterface> {
|
|
9
|
-
static moduleName: string;
|
|
10
|
-
midiOutput: MidiOutput;
|
|
11
|
-
constructor(params: {
|
|
12
|
-
id?: string;
|
|
13
|
-
name: string;
|
|
14
|
-
props: VoiceSchedulerInterface;
|
|
15
|
-
});
|
|
16
|
-
set polyNumber(value: number);
|
|
17
|
-
get polyNumber(): number;
|
|
18
|
-
onMidiEvent: (midiEvent: MidiEvent) => void;
|
|
19
|
-
serialize(): {
|
|
20
|
-
props: {
|
|
21
|
-
polyNumber: number;
|
|
22
|
-
};
|
|
23
|
-
id: string;
|
|
24
|
-
type: string;
|
|
25
|
-
numberOfVoices: number;
|
|
26
|
-
inputs: import('../core/IO').IIOSerialize[];
|
|
27
|
-
outputs: import('../core/IO').IIOSerialize[];
|
|
28
|
-
name: string;
|
|
29
|
-
};
|
|
30
|
-
private findFreeVoice;
|
|
31
|
-
private registerInputs;
|
|
32
|
-
private registerOutputs;
|
|
33
|
-
}
|
|
34
|
-
declare class Voice extends Module<DummnyInternalModule, VoiceSchedulerInterface> {
|
|
35
|
-
midiEvent: MidiEvent | null;
|
|
36
|
-
activeNote: string | null;
|
|
37
|
-
triggeredAt: number;
|
|
38
|
-
constructor(params: {
|
|
39
|
-
id?: string;
|
|
40
|
-
name: string;
|
|
41
|
-
props: VoiceSchedulerInterface;
|
|
42
|
-
});
|
|
43
|
-
midiTriggered: (midiEvent: MidiEvent) => void;
|
|
44
|
-
}
|
|
45
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { default as Note } from '../core/Note';
|
|
2
|
-
import { default as Module, PolyModule } from '../core/Module';
|
|
3
|
-
import { Volume as Vol } from 'tone';
|
|
4
|
-
|
|
5
|
-
export interface VolumeInterface {
|
|
6
|
-
volume: number;
|
|
7
|
-
}
|
|
8
|
-
declare class MonoVolume extends Module<Vol, VolumeInterface> {
|
|
9
|
-
constructor(params: {
|
|
10
|
-
id?: string;
|
|
11
|
-
name: string;
|
|
12
|
-
props: Partial<VolumeInterface>;
|
|
13
|
-
});
|
|
14
|
-
get volume(): number;
|
|
15
|
-
set volume(value: number);
|
|
16
|
-
triggerAttack: (note: Note, triggeredAt: number) => void;
|
|
17
|
-
triggerRelease: () => void;
|
|
18
|
-
}
|
|
19
|
-
export default class Volume extends PolyModule<MonoVolume, VolumeInterface> {
|
|
20
|
-
static moduleName: string;
|
|
21
|
-
constructor(params: {
|
|
22
|
-
id?: string;
|
|
23
|
-
name: string;
|
|
24
|
-
props: Partial<VolumeInterface>;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AudioModule } from '../core/Module';
|
|
2
|
-
|
|
3
|
-
export { default as Master } from './Master';
|
|
4
|
-
export { default as Filter } from './Filter';
|
|
5
|
-
export { default as Oscillator, MonoOscillator } from './Oscillator';
|
|
6
|
-
export { default as VirtualMidi } from './VirtualMidi';
|
|
7
|
-
export { default as VoiceScheduler } from './VoiceScheduler';
|
|
8
|
-
export { default as Sequencer } from './Sequencer';
|
|
9
|
-
export type { ISequence } from './Sequencer';
|
|
10
|
-
export { Envelope, AmpEnvelope, FreqEnvelope, EnvelopeStages, } from './Envelope';
|
|
11
|
-
export interface ICreateModule {
|
|
12
|
-
id?: string;
|
|
13
|
-
name: string;
|
|
14
|
-
numberOfVoices?: number;
|
|
15
|
-
type: string;
|
|
16
|
-
props: any;
|
|
17
|
-
}
|
|
18
|
-
export declare function createModule(params: ICreateModule): AudioModule;
|
package/dist/src/routes.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Optional } from './types';
|
|
2
|
-
|
|
3
|
-
export interface RouteProps {
|
|
4
|
-
sourceId: string;
|
|
5
|
-
sourceIOId: string;
|
|
6
|
-
destinationId: string;
|
|
7
|
-
destinationIOId: string;
|
|
8
|
-
}
|
|
9
|
-
export interface RouteInterface extends RouteProps {
|
|
10
|
-
id: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function createRoute(props: Optional<RouteInterface, "id">): {
|
|
13
|
-
id: string;
|
|
14
|
-
sourceId: string;
|
|
15
|
-
sourceIOId: string;
|
|
16
|
-
destinationId: string;
|
|
17
|
-
destinationIOId: string;
|
|
18
|
-
};
|
|
19
|
-
export declare function applyRoutes(routes: RouteInterface[]): void;
|
package/dist/src/types.d.ts
DELETED
package/dist/src/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function deterministicId(originalId: string, additionalString: string): string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { default as Module, PolyModule } from '../src/core/Module';
|
|
2
|
-
|
|
3
|
-
interface IMonoMocking {
|
|
4
|
-
}
|
|
5
|
-
export declare class MockInternalModule {
|
|
6
|
-
connect(): void;
|
|
7
|
-
disconnect(): void;
|
|
8
|
-
dispose(): void;
|
|
9
|
-
}
|
|
10
|
-
export declare class MonoMocking extends Module<MockInternalModule, IMonoMocking> {
|
|
11
|
-
constructor(params: {
|
|
12
|
-
name: string;
|
|
13
|
-
props: Partial<IMonoMocking>;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
export declare class PolyMocking extends PolyModule<MonoMocking, IMonoMocking> {
|
|
17
|
-
constructor(params: {
|
|
18
|
-
name: string;
|
|
19
|
-
props: Partial<IMonoMocking>;
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/core/IO/AudioNode.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { InputNode } from "tone";
|
|
2
|
-
import IONode, { IOType, IIONode } from "./Node";
|
|
3
|
-
import MonoModule, { Connectable } from "../Module/index";
|
|
4
|
-
import { AnyObject } from "../../types";
|
|
5
|
-
import { ForwardAudioInput } from "./ForwardNode";
|
|
6
|
-
import { AnyAudioInput, AnyAudioOuput } from ".";
|
|
7
|
-
|
|
8
|
-
export type AudioIO = AudioInput | AudioOutput;
|
|
9
|
-
|
|
10
|
-
export interface IAudioInput extends IIONode {
|
|
11
|
-
ioType: IOType.AudioInput;
|
|
12
|
-
internalModule: InputNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface IAudioOutput extends IIONode {
|
|
16
|
-
ioType: IOType.AudioOutput;
|
|
17
|
-
internalModule: IInternalModule;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface IInternalModule extends Connectable {}
|
|
21
|
-
|
|
22
|
-
export class AudioInput extends IONode implements IAudioInput {
|
|
23
|
-
declare ioType: IOType.AudioInput;
|
|
24
|
-
internalModule!: InputNode;
|
|
25
|
-
declare connections: AudioOutput[];
|
|
26
|
-
|
|
27
|
-
constructor(
|
|
28
|
-
plugableModule: MonoModule<Connectable, AnyObject>,
|
|
29
|
-
props: IAudioInput
|
|
30
|
-
) {
|
|
31
|
-
super(plugableModule, props);
|
|
32
|
-
this.internalModule = props.internalModule;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
plug(io: AnyAudioOuput, plugOther: boolean = true) {
|
|
36
|
-
super.plug(io, plugOther);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
unPlug(io: AnyAudioOuput, plugOther: boolean = true) {
|
|
40
|
-
super.unPlug(io, plugOther);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
unPlugAll() {
|
|
44
|
-
IONode.unPlugAll(this);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export class AudioOutput extends IONode implements IAudioOutput {
|
|
49
|
-
declare ioType: IOType.AudioOutput;
|
|
50
|
-
internalModule!: IInternalModule;
|
|
51
|
-
declare connections: AudioInput[];
|
|
52
|
-
|
|
53
|
-
constructor(
|
|
54
|
-
plugableModule: MonoModule<Connectable, AnyObject>,
|
|
55
|
-
props: IAudioOutput
|
|
56
|
-
) {
|
|
57
|
-
super(plugableModule, props);
|
|
58
|
-
this.internalModule = props.internalModule;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
plug(io: AnyAudioInput, plugOther: boolean = true) {
|
|
62
|
-
super.plug(io, plugOther);
|
|
63
|
-
if (io instanceof ForwardAudioInput) return;
|
|
64
|
-
|
|
65
|
-
this.internalModule.connect(io.internalModule);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
unPlug(io: AnyAudioInput, plugOther: boolean = true) {
|
|
69
|
-
super.unPlug(io, plugOther);
|
|
70
|
-
if (io instanceof ForwardAudioInput) return;
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
this.internalModule.disconnect(io.internalModule);
|
|
74
|
-
} catch (e) {
|
|
75
|
-
console.error(e);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
unPlugAll() {
|
|
80
|
-
IONode.unPlugAll(this);
|
|
81
|
-
}
|
|
82
|
-
}
|