Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

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)

Instances

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

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.