Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Derive.TrackWarp

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)

Instances

Instances details
Show Track Source # 
Instance details

Defined in Derive.TrackWarp

Methods

showsPrec :: Int -> Track -> ShowS #

show :: Track -> String #

showList :: [Track] -> ShowS #

DeepSeq.NFData Track Source # 
Instance details

Defined in Derive.TrackWarp

Methods

rnf :: Track -> () #

Pretty.Pretty Track Source # 
Instance details

Defined in Derive.TrackWarp

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.

Constructors

TrackWarp 

Fields

Instances

Instances details
Show TrackWarp Source # 
Instance details

Defined in Derive.TrackWarp

DeepSeq.NFData TrackWarp Source # 
Instance details

Defined in Derive.TrackWarp

Methods

rnf :: TrackWarp -> () #

Pretty.Pretty TrackWarp Source # 
Instance details

Defined in Derive.TrackWarp

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.