Skip to content

Commit

Permalink
fix: revert back to ctor for SynthAudioGenerator (dependency on this)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascpixi committed Dec 24, 2024
1 parent 423ddb1 commit 37efd33
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/nodes/SynthNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class SynthNodeData extends InstrumentNodeData {
this.generator.synth.set({ envelope: env });
}

constructor() {
constructor () {
super();

this.generator = new SynthAudioGenerator();
Expand All @@ -84,11 +84,15 @@ export class SynthNodeData extends InstrumentNodeData {
};

export class SynthAudioGenerator implements AudioGenerator {
synth = new tone.PolySynth(tone.Synth, { oscillator: { type: this.waveform} });
synth: tone.PolySynth;
private _waveform: Waveform = "sine";
private _unisonSpread: number = 20;
private _unisonCount: number = 1;

constructor() {
this.synth = new tone.PolySynth(tone.Synth, { oscillator: { type: this.waveform} });
}

/** Fully applies oscillator settings, changing its type. May produce audible clicks. */
private fullyApplyOsc() {
if (this._unisonCount > 1) {
Expand Down

0 comments on commit 37efd33

Please sign in to comment.