magenta / magenta-js

Magenta.js: Music and Art Generation with Machine Learning in the browser
https://magenta.tensorflow.org
Apache License 2.0
1.96k stars 311 forks source link

Fix audible pops/clicks in several soundfont instruments #658

Closed AmitTzah closed 1 year ago

AmitTzah commented 1 year ago

Fix a bug that causes audible clicks or pops when playing the FRENCH_HORN or STRING_ENSEMBLE_2 soundfonts (as well as several other soundfonts) in the player demo. The issue is caused by a change in the start() method of the Tone.BufferSource object in newer versions of tone.js, which removed the fifth argument that allowed for the passing of a fadeIn value.

To resolve the issue, this commit adds the missing fadeIn value to releaseSource as a property, ensuring that the sound is properly faded in and out without any clicking or popping.