-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setCycle, similar to resetCycle but for jumping to a specific cycle #709
Comments
To work out what to query the pattern for, tidal first works out what the end of the time arc should be, based on the tempo. Rather than work out the start of the time arc, it just takes the end of the previous time arc. This is so that nothing is lost due to floating point error (cps is still floating point rather than rational), or due to the tempo changing. This seems to works fine if travelling back in time, I guess because you end up with an arc that ends before it begins and returns nothing, so you lose one tick (1/20th of a second)'s worth of events (that might possibly explain while The scheduler does skip frames if it gets too far behind/ahead, but not cycles. I think it's not straightforward to do that, as probably extreme changes in tempo would legitimately result in a large number of cycles being generated.. I think the fix would be adding a flag to the tempo datatype to indicate that the tempo has been reset and that the ticks should too. |
Ah ha! That all totally makes sense, thanks for explaining. So we're looking for a |
Yes, although that would probably be an internal function, called from within resetCycles / setCycle |
Just coming back to this. Why is the tempo being reset? Isn't it just the cycles that are being reset/changed? |
So something like this? Add data Tempo = Tempo {atTime :: O.Time,
atCycle :: Rational,
cps :: O.Time,
paused :: Bool,
nudged :: Double,
localUDP :: O.UDP,
remoteAddr :: N.SockAddr,
synched :: Bool,
reset:: Bool
}
deriving Show Set flag to _setCycle c tempoMV = T.changeTempo tempoMV (\t tempo -> tempo {T.atTime = t, T.atCycle = c, reset = True}) Watch for flag in |
Allows for jumping to any cycle Closes tidalcycles#709
Allows for jumping to any cycle Closes #709
If you run the above, what you'll notice is that jumping backwards by n cycles seems to work fine, however jumping forwards results in a lot of messages being sent before normal service is resumed.
I'll post an OSC log or two here soon to demonstrate...
The text was updated successfully, but these errors were encountered: