]> Git — Sourcephile - tmp/julm/arpeggigon.git/blob - Reactogon/Unknown/Time.hs
Sort messages nearly done.
[tmp/julm/arpeggigon.git] / Reactogon / Unknown / Time.hs
1 module Time ( toFrames
2 , fromFrames
3 ) where
4
5 import FRP.Yampa
6 import Sound.JACK (NFrames(NFrames))
7
8 import MIDI
9
10 toFrames :: SampleRate -> DTime -> NFrames
11 toFrames s = NFrames . floor . (fromIntegral s *)
12
13 fromFrames :: SampleRate -> NFrames -> DTime
14 fromFrames s (NFrames n) = fromIntegral n/fromIntegral s