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

Derive.TrackWarp

Contents

Description

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

# Documentation

data Track Source #

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

Constructors

 Track !RealTime !RealTime !Warp.Warp !BlockId !(Maybe TrackId)

Instances

 # MethodsshowsPrec :: Int -> Track -> ShowS #show :: Track -> String #showList :: [Track] -> ShowS # # Methodsrnf :: Track -> () # # MethodsformatList :: [Track] -> Doc 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.

Constructors

 TrackWarp Fieldstw_start :: !RealTimeThe range over which this warp's tw_warp can be used.tw_end :: !RealTime tw_block :: !BlockId tw_tracks :: !(Set TrackId) tw_warp :: !Warp.Warp

Instances

 # MethodsshowList :: [TrackWarp] -> ShowS # # Methodsrnf :: TrackWarp -> () # # MethodsformatList :: [TrackWarp] -> Doc Source #

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

Collect Tracks together into TrackWarps'.

# functions on TrackWarp

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.

Take RealTime back to the TrackTimes on the various blocks that it corresponds to.