tidal-link-1.2.0: Ableton Link integration for Tidal
Safe HaskellNone
LanguageHaskell2010

Sound.Tidal.Clock

Synopsis

Documentation

type Time = Rational Source #

type Clock = ReaderT ClockMemory (StateT ClockState IO) Source #

representation of a tick based clock

data ClockMemory Source #

internal read-only memory of the clock

data ClockState Source #

internal mutable state of the clock

Constructors

ClockState 

Fields

Instances

Instances details
Show ClockState Source # 
Instance details

Defined in Sound.Tidal.Clock

Methods

showsPrec :: Int -> ClockState -> ShowS

show :: ClockState -> String

showList :: [ClockState] -> ShowS

data ClockRef Source #

reference to interact with the clock, while it is running

Constructors

ClockRef 

data ClockConfig Source #

configuration of the clock

Constructors

ClockConfig 

Fields

type TickAction = (Time, Time) -> Double -> ClockConfig -> ClockRef -> (SessionState, SessionState) -> IO () Source #

action to be executed on a tick, | given the current timespan, nudge and reference to the clock

data ClockAction Source #

possible actions for interacting with the clock

Constructors

NoAction 
SetCycle Time 
SetTempo Time 
SetNudge Double 

defaultCps :: Double Source #

clocked :: ClockConfig -> TickAction -> IO ClockRef Source #

creates a clock according to the config and runs it | in a seperate thread

runClock :: ClockConfig -> TickAction -> Clock () -> IO ClockRef Source #

runs the clock on the initial state and memory as given | by initClock, hands the ClockRef for interaction from outside

initClock :: ClockConfig -> TickAction -> IO (ClockMemory, ClockState) Source #

creates a ableton link instance and an MVar for interacting | with the clock from outside and computes the initial clock state

beatToCycles :: ClockConfig -> Double -> Double Source #

cyclesToBeat :: ClockConfig -> Double -> Double Source #

addMicrosToOsc :: Micros -> Time -> Time Source #

setClock :: ClockRef -> Time -> IO () Source #

setBPM :: ClockRef -> Time -> IO () Source #

setNudge :: ClockRef -> Double -> IO () Source #