Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.39k stars 976 forks source link

Polyphony for sampler? #1100

Closed cryptozachary closed 1 year ago

cryptozachary commented 2 years ago

Hello all I've been unsuccessful at determining how to implement a polyphony of 1 for the sampler instrument ( only one note plays at a time ). Is there a property for this? Or a way to check if the sampler is playing a note?

6dyAllen commented 2 years ago

maybe you can release the note before play it

cryptozachary commented 1 year ago

Thank you - I will try that!

cryptozachary commented 1 year ago

This worked - I just had to change the triggerAttackRelease to triggerAttack , and it would release all currently playing notes. Unfortunately , this workaround does not allow me to set the duration of the note , as it seems to be only set with triggerAttackRelease. Hopefully I can solve this particular problem. Thanks for your help Allen!