Skip to content

Commit

Permalink
Square bleep is truly a square...
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-mackinnon committed Mar 24, 2024
1 parent 8ccbe29 commit d28273d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/engine/sequencerEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ function makeGenerator(
case GeneratorType.ClosedHH:
return new HiHat(destination);
case GeneratorType.SineBleep:
return new Pluck(destination, "sine");
case GeneratorType.SquareBleep:
return new Pluck(destination);
return new Pluck(destination, "square");
case GeneratorType.Snare:
return new Snare(destination);
}
Expand Down
4 changes: 2 additions & 2 deletions src/generators/pluck/pluck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class Pluck implements Generator {
private readonly _ampEnv: AmplitudeEnvelope;
private readonly _osc: PolySynth;

constructor(destination: ToneAudioNode) {
constructor(destination: ToneAudioNode, type: "sine" | "square") {
this._gain = new Gain(1.0).connect(destination);
this._ampEnv = new AmplitudeEnvelope({
attack: 0.01,
Expand All @@ -23,7 +23,7 @@ export class Pluck implements Generator {
this._osc.maxPolyphony = 10;
this._osc.set({
oscillator: {
type: "sine",
type,
},
});
}
Expand Down

0 comments on commit d28273d

Please sign in to comment.