mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-22 02:58:32 +00:00
filter out event parts from draw
This commit is contained in:
parent
04d14dea90
commit
d5a928e6f7
@ -29,7 +29,9 @@ Pattern.prototype.draw = function (callback, cycleSpan, lookaheadCycles = 1) {
|
|||||||
cycle = currentCycle;
|
cycle = currentCycle;
|
||||||
const begin = currentCycle * cycleSpan;
|
const begin = currentCycle * cycleSpan;
|
||||||
const end = (currentCycle + lookaheadCycles) * cycleSpan;
|
const end = (currentCycle + lookaheadCycles) * cycleSpan;
|
||||||
events = this.add(0).query(new State(new TimeSpan(begin, end)));
|
events = this.add(0)
|
||||||
|
.query(new State(new TimeSpan(begin, end)))
|
||||||
|
.filter((event) => event.part.begin.valueOf() === event.whole.begin.valueOf());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
callback(ctx, events, t, cycleSpan, time);
|
callback(ctx, events, t, cycleSpan, time);
|
||||||
|
|||||||
@ -44,7 +44,7 @@ function useCycle(props: UseCycleProps) {
|
|||||||
.forEach((event) => {
|
.forEach((event) => {
|
||||||
Tone.getTransport().schedule((time) => {
|
Tone.getTransport().schedule((time) => {
|
||||||
const toneEvent = {
|
const toneEvent = {
|
||||||
time: event.part.begin.valueOf(),
|
time: event.whole.begin.valueOf(),
|
||||||
duration: event.whole.end.sub(event.whole.begin).valueOf(),
|
duration: event.whole.end.sub(event.whole.begin).valueOf(),
|
||||||
value: event.value,
|
value: event.value,
|
||||||
context: event.context,
|
context: event.context,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user