- 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:
parent
e4a35fdd72
commit
8c9e06c329
5 changed files with 11 additions and 7 deletions
|
|
@ -32,7 +32,11 @@ export class Hap {
|
|||
}
|
||||
|
||||
get duration() {
|
||||
return this.whole.end.sub(this.whole.begin);
|
||||
return this.whole.end.sub(this.whole.begin).mul(typeof this.value?.clip === 'number' ? this.value?.clip : 1);
|
||||
}
|
||||
|
||||
get endClipped() {
|
||||
return this.whole.begin.add(this.duration);
|
||||
}
|
||||
|
||||
wholeOrPart() {
|
||||
|
|
|
|||
|
|
@ -83,9 +83,9 @@ Pattern.prototype.pianoroll = function ({
|
|||
ctx.fillRect(0, 0, w, h);
|
||||
}
|
||||
const inFrame = (event) =>
|
||||
(!hideNegative || event.whole.begin >= 0) && event.whole.begin <= t + to && event.whole.end >= t + from;
|
||||
(!hideNegative || event.whole.begin >= 0) && event.whole.begin <= t + to && event.endClipped >= t + from;
|
||||
events.filter(inFrame).forEach((event) => {
|
||||
const isActive = event.whole.begin <= t && event.whole.end > t;
|
||||
const isActive = event.whole.begin <= t && event.endClipped > t;
|
||||
ctx.fillStyle = event.context?.color || inactive;
|
||||
ctx.strokeStyle = event.context?.color || active;
|
||||
ctx.globalAlpha = event.context.velocity ?? event.value?.gain ?? 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue