1 {-# LANGUAGE MultiParamTypeClasses #-}
3 module RMCA.Global.Clock ( AbsBeat
13 -- The absolute beat is the beat number of the global clock, there are
14 -- 16 starting from 1.
20 -- The global system tempo beats every 16th note, each beat is tagged
21 -- with a beat number modulo sixteen. Each layer is then beating at
22 -- its own fraction, discarding the unecessary beats.
23 metronome :: SF Tempo (Event AbsBeat)
24 metronome = accumBy (\pb _ -> nextBeatNo maxAbsBeat pb) 0 <<<
25 repeatedlyS' () <<^ (15*) <<^ (1/) <<^ fromIntegral
27 -- Tempo is the number of quarter notes per minute.
28 tempoToQNoteIvl :: Tempo -> DTime
29 tempoToQNoteIvl = (15/) . fromIntegral