synthesizer-core-0.6: Audio signal processing coded in Haskell: Low level part

Safe HaskellNone




class C a whereSource


outputFromCanonical :: (Bounded int, C int, Monoid out) => (int -> out) -> a -> outSource

numberOfChannels :: a -> IntSource


C Double 
C Float 
C a => C (T a) 
(C a, C b) => C (a, b) 

toCanonical :: (C real, Bounded int, C int) => int -> realSource

fromCanonicalWith :: (C real, Bounded int, C int) => (real -> int) -> real -> intSource

fromCanonicalSimpleWith :: (C real, Bounded int, C int) => (real -> int) -> real -> intSource

Warning: This may produce negative results for positive input in some cases! The problem is that (maxBound :: Int32) cannot be represented exactly as Float, the Float value is actually a bit larger than the Int32 value. Thus when converting the Float back to Int32 it becomes negative. Better use fromCanonicalWith.