p5.js-sound icon indicating copy to clipboard operation
p5.js-sound copied to clipboard

PolySynth has a constant 440Hz sound after constructor called

Open kovatsgergo opened this issue 4 years ago • 1 comments

Immediately audible when using a lot of voices (e.g. 128). Constant 440Hz sine wave coming from PolySynth.

mySynth = new p5.PolySynth(p5.MonoSynth, 128);

I can hear it on

  • OSX: Chrome, Safari
  • Android: Chrome and native browser.

Even when using default (8) number of voices (but much softer).

This changes the constant drone frequency:

for (var i = 0; i < 128; i++){
    mySynth.audiovoices[i].oscillator.freqNode.value = 1000;
}

I'm not a trained developer, might probably be easy to fix, but I suppose this should not happen by default.

kovatsgergo avatar Mar 15 '21 00:03 kovatsgergo

@kovatsgergo yes, this also happens when multiple MonoSynth constructors called. I don't know if this intended . But I found out a way to fix this.

this.oscillator.output.gain.value = 1.0; // should be changed to
this.oscillator.output.gain.value = 0.0; // this
//and 
triggerAttack(...){
    this.amp(1) 
    ...
}

should I start working on? @therewasaguy

Ajaya1000 avatar Apr 19 '21 06:04 Ajaya1000