1 module RCMA.Global.Clock ( tempo
6 import RCMA.Auxiliary.Auxiliary
12 tempo :: Tempo -> SF () Tempo
15 -- The initial value is arbitrary but never appears because the switch
17 metronome :: SF Tempo (Event Beat)
18 metronome = switch ((repeatedly (tempoToDTime 60) ())
20 (onChange')) (metronome')
21 where metronome' :: Tempo -> SF Tempo (Event Beat)
22 metronome' t = (switch ((repeatedly (tempoToDTime t) ())
24 onChange) (metronome'))
26 tempoToDTime :: Tempo -> DTime
27 tempoToDTime = (60/) . fromIntegral