mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 13:08:28 +00:00
add duration + legato
This commit is contained in:
parent
05804262f0
commit
7e0b6d7f2a
28
strudel.mjs
28
strudel.mjs
@ -722,26 +722,20 @@ class Pattern {
|
|||||||
hush() {
|
hush() {
|
||||||
return silence;
|
return silence;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
_resolveTies() {
|
// sets absolute duration of events
|
||||||
return this._withEvents((events)=>{
|
_duration(value) {
|
||||||
return events.reduce((tied, event, i) => {
|
return this.withEventSpan((span) => new TimeSpan(span.begin, span.begin.add(value)));
|
||||||
const value = event.value?.value || event.value;
|
}
|
||||||
if (value !== '_') {
|
|
||||||
return tied.concat([event]);
|
// sets event relative duration of events
|
||||||
}
|
_legato(value) {
|
||||||
console.log('tie!', lastEvent);
|
return this.withEventSpan((span) => new TimeSpan(span.begin, span.begin.add(span.end.sub(span.begin).mul(value))));
|
||||||
tied[i - 1] = tied[i - 1].withSpan((span) => span.withEnd((_) => event.part.end));
|
}
|
||||||
// above only works if the tie is not across a cycle boundary... how to do that???
|
|
||||||
// TODO: handle case that there is a gap between tied[i-1].part.end and event.part.begin => tie would make no sense
|
|
||||||
return tied;
|
|
||||||
}, []);
|
|
||||||
})
|
|
||||||
} */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// methods of Pattern that get callable factories
|
// methods of Pattern that get callable factories
|
||||||
Pattern.prototype.patternified = ['apply', 'fast', 'slow', 'early', 'late'];
|
Pattern.prototype.patternified = ['apply', 'fast', 'slow', 'early', 'late', 'duration', 'legato'];
|
||||||
// methods that create patterns, which are added to patternified Pattern methods
|
// methods that create patterns, which are added to patternified Pattern methods
|
||||||
Pattern.prototype.factories = { pure, stack, slowcat, fastcat, cat, timeCat, sequence, polymeter, pm, polyrhythm, pr};
|
Pattern.prototype.factories = { pure, stack, slowcat, fastcat, cat, timeCat, sequence, polymeter, pm, polyrhythm, pr};
|
||||||
// the magic happens in Pattern constructor. Keeping this in prototype enables adding methods from the outside (e.g. see tonal.ts)
|
// the magic happens in Pattern constructor. Keeping this in prototype enables adding methods from the outside (e.g. see tonal.ts)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user