@blibliki/engine 0.3.7 → 0.3.9
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +218 -215
- package/dist/index.d.ts +218 -215
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/Engine.ts +52 -2
- package/src/core/Note/index.ts +1 -1
- package/src/core/Route.ts +14 -2
- package/src/core/midi/Message.ts +46 -0
- package/src/core/midi/MidiDevice.ts +22 -12
- package/src/core/midi/MidiDeviceManager.ts +68 -36
- package/src/core/midi/MidiEvent.ts +1 -1
- package/src/core/midi/jzz.types.ts +51 -0
- package/src/core/module/Module.ts +0 -38
- package/src/core/module/PolyModule.ts +1 -6
- package/src/index.ts +1 -1
- package/src/modules/MidiSelector.ts +29 -9
- package/src/modules/Oscillator.ts +6 -7
|
@@ -108,7 +108,7 @@ export class MonoOscillator
|
|
|
108
108
|
{
|
|
109
109
|
declare audioNode: OscillatorNode;
|
|
110
110
|
isStated = false;
|
|
111
|
-
|
|
111
|
+
outputGain: GainNode;
|
|
112
112
|
detuneGain!: GainNode;
|
|
113
113
|
|
|
114
114
|
constructor(engineId: string, params: ICreateModule<ModuleType.Oscillator>) {
|
|
@@ -122,7 +122,7 @@ export class MonoOscillator
|
|
|
122
122
|
audioNodeConstructor,
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
this.
|
|
125
|
+
this.outputGain = new GainNode(this.context.audioContext, {
|
|
126
126
|
gain: dbToGain(LOW_GAIN),
|
|
127
127
|
});
|
|
128
128
|
|
|
@@ -152,8 +152,8 @@ export class MonoOscillator
|
|
|
152
152
|
this.updateFrequency();
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
onAfterSetLowGain: OscillatorSetterHooks["onAfterSetLowGain"] = () => {
|
|
156
|
-
this.
|
|
155
|
+
onAfterSetLowGain: OscillatorSetterHooks["onAfterSetLowGain"] = (lowGain) => {
|
|
156
|
+
this.outputGain.gain.value = lowGain ? dbToGain(LOW_GAIN) : 1;
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
start(time: ContextTime) {
|
|
@@ -218,7 +218,7 @@ export class MonoOscillator
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
private applyOutputGain() {
|
|
221
|
-
this.audioNode.connect(this.
|
|
221
|
+
this.audioNode.connect(this.outputGain);
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
private initializeGainDetune() {
|
|
@@ -236,8 +236,7 @@ export class MonoOscillator
|
|
|
236
236
|
private registerOutputs() {
|
|
237
237
|
this.registerAudioOutput({
|
|
238
238
|
name: "out",
|
|
239
|
-
getAudioNode: () =>
|
|
240
|
-
this.props.lowGain ? this.lowOutputGain : this.audioNode,
|
|
239
|
+
getAudioNode: () => this.outputGain,
|
|
241
240
|
});
|
|
242
241
|
}
|
|
243
242
|
}
|