implemented duration and *done* handling with ADSR envelope