Tone.js
Tone.js copied to clipboard
fadeIn and fadeOut Based on Player Loop Size
The feature you'd like Tone.Player appears to fadeIn and fadeOut based on the buffer size. A logical assumption would be that the fadeIn and fadeOut should work for a set loop... i.e. fadeIn at the start of the loop and fadeOut at the end of the loop. If no loop is set then the fadeIn and fadeOut working on the overall buffer makes sense.
Any alternatives you've considered We have achieved by slicing the buffer to the loop size and resampling using an offline context where performance is not an issue. In realtime scenarios, we have used linearRampTo to automate the player volume.