Karya, built on 2018-02-23T20:23:55 (patch cf8565b7ac832266878af99a942555d139065f12)

Safe HaskellNone




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.



data Track Source #

Collected warp for a single track. start end warp block_id (tempo track if there is one)

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.

data TrackWarp Source #

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.




collect_track_warps :: [(BlockId, [Tree.Tree TrackId])] -> WarpMap -> [TrackWarp] Source #

Collect Tracks 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.