]> Git — Sourcephile - tmp/julm/arpeggigon.git/blob - RMCA/Unknown/Time.hs
Pieces can now safely be moved without causing crashes or inconsistencies.
[tmp/julm/arpeggigon.git] / RMCA / 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