1 {-# LANGUAGE Arrows #-}
3 module Reactogon.Layer.Layer where
6 import Reactogon.Semantics
7 import Reactogon.Global.Clock
10 -- Data representing the state of a layer. It is updated continuously.
11 data Layer = Layer { relTempo :: Double
12 , strength :: Strength
15 layerTempo :: SF () Tempo -> SF Layer Tempo
16 layerTempo globalTempo = proc Layer { relTempo = r } -> do
18 returnA -< floor $ r * fromIntegral t
20 layerMetronome :: SF () Tempo -> SF () (Event Beat)
21 layerMetronome tempo = layerTempo tempo >>> metronome
23 -- A layer is a producer of events triggered by the system beat clock.
24 layer :: SF () (Event Beat) -> SF Layer (Event Note)
25 layer beatSource = undefined