]> Git — Sourcephile - tmp/julm/arpeggigon.git/blob - RMCA/Unknown/Time.hs
System producing notes but no sound.
[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