danigb / soundfont-player

Quick soundfont loader and player for browser
MIT License
453 stars 60 forks source link

Increase the volume #94

Open nam-van-nguyen opened 2 years ago

nam-van-nguyen commented 2 years ago

Is it possible to get the player to play louder? Current gain settings set at 1 doesn't help. I compare the soundfont-player and sound produced from musescore and musescore produces much louder sound.

abulka commented 2 years ago

Setting sustain: 3.5 seems to boost the volume quite a bit e.g.

  let envelope = tone.play(
    note,
    when,
    {
      gain: velocity,
      duration: 999,
      sustain: 3.5,    // <---
    })

Its still not as loud as e.g. the webaudiofont library gives us, but that might be because webaudiofont uses channels and effects processing etc. which probably boosts things.