Or schedule events at a given time
Closed this issue · 4 comments
AlanPaine commented
Here's how to schedule activities at a given time, just like soundfont-player:
soundFont.schedule(0, [
{ note: key, duration: lengthInMs / 1000, gain: sampleVolume * this.GainMultiplier },
]);
danigb commented
To schedule notes in time, use the time
option of the start
function: https://github.com/danigb/smplr#schedule-notes
AlanPaine commented
The important thing is how am I going to set the gain at the start
danigb commented
With the velocity param. 0 means gain = 0. 127 means gain = 1
piano.start({ note: "C4", velocity: 80, time: 5, duration: 1 });