- clip now works like legato in tidal

- supports floats
- hap.duration now respects clip value
- hap.endClipped is now end*clip
- visualizations show clipped length
- clip(0) will now be silence
This commit is contained in:
Felix Roos 2023-06-12 22:39:32 +02:00
parent e4a35fdd72
commit 8c9e06c329
5 changed files with 11 additions and 7 deletions

View file

@ -170,7 +170,7 @@ export async function onTriggerSample(t, value, onended, bank) {
nudge = 0, // TODO: is this in seconds?
cut,
loop,
clip = 0, // if 1, samples will be cut off when the hap ends
clip = undefined, // if 1, samples will be cut off when the hap ends
n = 0,
note,
speed = 1, // sample playback speed
@ -232,7 +232,7 @@ export async function onTriggerSample(t, value, onended, bank) {
out.disconnect();
onended();
};
const stop = (endTime, playWholeBuffer = !clip) => {
const stop = (endTime, playWholeBuffer = [undefined, false, null].includes(clip)) => {
let releaseTime = endTime;
if (playWholeBuffer) {
releaseTime = t + (end - begin) * bufferDuration;