With this PR I try to introduce a "new" way of time altering functions to Tidal. A method which I'll be calling windowing. This method is actually done in some ways by other functions, but this PR simplifies the process and introduces new functions. The idea is that for every query with a given state arc, Tidal queries an expanded window (for example, the whole cycleArc surrounding the query, or by some lookahead), processes the events found and then windows it back down to the original arc via the use of the new encloseEvent function. This function takes an Arc and an Event, and returns Just the Event as if it was queried from the given Arc, or Nothing (if it shouldn't be there in the first place). This makes it easy to implement functions which alter times of events between a single cycleArc.
UI functions added:
quant k: quantizes the times of events to steps of (1/k) cycles. Inputting 0 will bypass the effect.
alterT f: takes a Time modifying function to alter the cyclePos of the events
alterF f: sames as above but uses a Double function
The alter functions have some buggy edge cases I'm trying to explore (events at the exact end of the cycle, negative results, etc).
fill sorts events just in case, but i have no idea if this actually necessary on tidal (it is on strudel, i was replicating jader's work with the events on this one)
I've noted there's an old TODO fill function on the Pattern package, I think it should be easier to implement with the new functions... I'll take a look.
TODO:
[ ] Decide on a name for the proposed fill
[ ] How should encloseEvent actually handle analog events?
This PR is a work in progress, it hasn't been tested with the new tactus functionallity
Related: https://github.com/tidalcycles/strudel/pull/1142
With this PR I try to introduce a "new" way of time altering functions to Tidal. A method which I'll be calling windowing. This method is actually done in some ways by other functions, but this PR simplifies the process and introduces new functions. The idea is that for every query with a given state arc, Tidal queries an expanded window (for example, the whole cycleArc surrounding the query, or by some lookahead), processes the events found and then windows it back down to the original arc via the use of the new
encloseEvent
function. This function takes an Arc and an Event, and returns Just the Event as if it was queried from the given Arc, or Nothing (if it shouldn't be there in the first place). This makes it easy to implement functions which alter times of events between a single cycleArc.UI functions added:
quant k
: quantizes the times of events to steps of (1/k) cycles. Inputting 0 will bypass the effect.fill m
: fills gaps between events, essentially a proper legato (name being debated @ https://github.com/tidalcycles/strudel/pull/1142)alterT f
: takes a Time modifying function to alter the cyclePos of the eventsalterF f
: sames as above but uses a Double functionThe
alter
functions have some buggy edge cases I'm trying to explore (events at the exact end of the cycle, negative results, etc).fill
sorts events just in case, but i have no idea if this actually necessary on tidal (it is on strudel, i was replicating jader's work with the events on this one)I've noted there's an old TODO
fill
function on the Pattern package, I think it should be easier to implement with the new functions... I'll take a look.TODO:
fill
encloseEvent
actually handle analog events?