fix volume

This commit is contained in:
Jade (Rose) Rowland 2025-06-04 01:08:36 +01:00
parent 5129fa6677
commit ff4b7ca171

View file

@ -146,7 +146,6 @@ export class ADSR {
startVal = 0; startVal = 0;
update(curTime, gate, attack, decay, susVal, release) { update(curTime, gate, attack, decay, susVal, release) {
console.info('here')
switch (this.state) { switch (this.state) {
case 'off': { case 'off': {
if (gate > 0) { if (gate > 0) {
@ -191,6 +190,7 @@ export class ADSR {
} }
case 'release': { case 'release': {
let time = curTime - this.startTime; let time = curTime - this.startTime;
if (time > release) { if (time > release) {
this.state = 'off'; this.state = 'off';
return 0; return 0;
@ -353,7 +353,7 @@ let getDefaultValue = (key) => defaultDefaultValues[key];
export class Dough { export class Dough {
init(value, sampleRate) { init(value, sampleRate) {
// params without defaults: // params without defaults:
/* /*
bank, bank,
@ -455,7 +455,7 @@ export class Dough {
const env = this._adsr.update(t, gate, this.attack, this.decay, this.sustain, this.release); const env = this._adsr.update(t, gate, this.attack, this.decay, this.sustain, this.release);
s = s * env; s = s * env;
s = s * this.postgain * .3 s = s * this.postgain * .2
return s; return s;
} }
} }