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

Safe HaskellNone

Types

Description

This re-exports especially popular types, since they are frequently mentioned in type signatures. Unlike most of the other modules, it's meant to be imported unqualified.

Synopsis

Documentation

type TrackNum = Int Source #

Index into a block's tracks.

data ScoreTime Source #

Score time is the abstract unit of time, and its mapping to real time is dependent on the score context. ScoreTime units can be negative, but blocks only display events at >=0 ScoreTime.

Instances

Eq ScoreTime # 
Fractional ScoreTime # 
Num ScoreTime # 
Ord ScoreTime # 
Read ScoreTime # 
Real ScoreTime # 
RealFrac ScoreTime # 
Show ScoreTime # 
NFData ScoreTime # 

Methods

rnf :: ScoreTime -> () #

CRC32 ScoreTime # 
Pretty ScoreTime # 
CStorable ScoreTime # 
ApproxEq ScoreTime # 

Methods

eq :: Double -> ScoreTime -> ScoreTime -> Bool Source #

Serialize ScoreTime # 
ShowVal ScoreTime # 
ToVal ScoreTime # 

Methods

to_val :: ScoreTime -> Val Source #

Time ScoreTime # 
TypecheckNum ScoreTime # 
ToVal ScoreTime # 

Methods

to_val :: ScoreTime -> Val Source #

Typecheck ScoreTime # 

type TrackTime = ScoreTime Source #

This is also ScoreTime, but it's relative to the beginning of the track. I.e., UI events are all in track time, but when they get shifted and stretched as by note slicing they're no longer in TrackTime, but not yet in RealTime.

I'd like to make a type-level distinction because it's easy to get confused about whether a time has or hasn't been transformed, but when I tried it seemed like a big hassle since I'd really like for TrackTime to be a subtype of ScoreTime. I could do it with a phantom type, but it would change about a million type declarations. And since Events start in TrackTime but are then ScoreTime if transformed, they would also need a type parameter, along with probably a few other basic data types.

Unless I work up the courage to do that someday, the least I can do is document the difference with a type synonym.

data RealTime Source #

A concrete unit of time.

This must have negative values because it's used for signals, which are used for the warp map, which is oriented with zero at the note start. If a note wants to get the real time before it, it must look up a negative RealTime.

Instances

Eq RealTime # 
Fractional RealTime # 
Num RealTime # 
Ord RealTime # 
Read RealTime # 
Real RealTime # 
RealFrac RealTime # 

Methods

properFraction :: Integral b => RealTime -> (b, RealTime) #

truncate :: Integral b => RealTime -> b #

round :: Integral b => RealTime -> b #

ceiling :: Integral b => RealTime -> b #

floor :: Integral b => RealTime -> b #

Show RealTime # 
Storable RealTime # 
NFData RealTime # 

Methods

rnf :: RealTime -> () #

CRC32 RealTime # 
ToJSON RealTime # 
FromJSON RealTime # 
Pretty RealTime # 
CStorable RealTime # 
ApproxEq RealTime # 

Methods

eq :: Double -> RealTime -> RealTime -> Bool Source #

Serialize RealTime # 
ShowVal RealTime # 
ToVal RealTime # 

Methods

to_val :: RealTime -> Val Source #

Time RealTime # 
TypecheckNum RealTime # 
ToVal RealTime # 

Methods

to_val :: RealTime -> Val Source #

Typecheck RealTime # 
Typecheck Function # 
Typecheck TypedFunction # 

data BlockId Source #

Reference to a Block. Use this to look up Blocks in the State.

The convention is that BlockId should name a block which is expected to exist, and the only way to create a BlockId is via create_block. The name of a block which is to be created is simply Id.

However, since the constructor is exported, this isn't rigorously enforced.

Unlike other Ids, block names have no restrictions, except no spaces. This is because they become note calls, and it's convenient to have arbitrary names for the same reason it's convenient to allow arbitrary characters in call names.