Safe Haskell | Safe-Inferred |
---|
TrackWarps are collected throughout derivation each time there is a new warp context. By the end, they represent a complete mapping from ScoreTime to RealTime and back again, and can be used to create a TempoFunction and InverseTempoFunction, among other things.
Synopsis
- data Track = Track !RealTime !RealTime !Warp.Warp !BlockId !(Maybe TrackId)
- type WarpMap = Map Stack.Stack Track
- data TrackWarp = TrackWarp {}
- collect_track_warps :: [(BlockId, [Tree.Tree TrackId])] -> WarpMap -> [TrackWarp]
- get_track_trees :: Ui.M m => m [(BlockId, [Tree.Tree TrackId])]
- tempo_func :: [TrackWarp] -> Transport.TempoFunction
- closest_warp :: [TrackWarp] -> Transport.ClosestWarpFunction
- inverse_tempo_func :: [TrackWarp] -> Transport.InverseTempoFunction
Documentation
Collected warp for a single track. start end warp block_id (tempo track if there is one)
Instances
Show Track Source # | |
DeepSeq.NFData Track Source # | |
Defined in Derive.TrackWarp | |
Pretty.Pretty Track Source # | |
type WarpMap = Map Stack.Stack Track Source #
Each Track
is collected at the Stack of the track it represents.
A Track is only saved when the warp changes, which is likely a tempo
track. collect_warps
then fills in the rest of the tracks.
Each track warp is a warp indexed by the block and tracks it covers. These are used by the play monitor to figure out where the play position indicator is at a given point in real time.
Instances
collect_track_warps :: [(BlockId, [Tree.Tree TrackId])] -> WarpMap -> [TrackWarp] Source #
Collect Track
s together into TrackWarps'.
functions on TrackWarp
closest_warp :: [TrackWarp] -> Transport.ClosestWarpFunction Source #
If a block is called in multiple places, a score time on it may occur at multiple real times. Find the Warp which is closest to a given RealTime, or the ID warp if there are none.
Pick the real time from the given selection which is closest to the real time of the selection on the root block.
Return the first real time if there's no root or it doesn't have a selection.
This can't use Transport.TempoFunction because I need to pick the appropriate Warp and then look up multiple ScoreTimes in it.
inverse_tempo_func :: [TrackWarp] -> Transport.InverseTempoFunction Source #
Take RealTime back to the TrackTimes on the various blocks that it corresponds to.