Safe Haskell | None |
---|

- class C a where
- outputFromCanonical :: (Bounded int, C int, Monoid out) => (int -> out) -> a -> out
- numberOfChannels :: a -> Int

- toCanonical :: (C real, Bounded int, C int) => int -> real
- fromCanonicalWith :: (C real, Bounded int, C int) => (real -> int) -> real -> int
- fromCanonicalSimpleWith :: (C real, Bounded int, C int) => (real -> int) -> real -> int
- numberOfSignalChannels :: C yv => sig yv -> Int
- int16ToCanonical :: C a => Int16 -> a
- int16FromCanonical :: C a => a -> Int16
- int16FromFloat :: Float -> Int16
- int16FromDouble :: Double -> Int16

# Documentation

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

numberOfChannels :: a -> IntSource

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`

.

numberOfSignalChannels :: C yv => sig yv -> IntSource

int16ToCanonical :: C a => Int16 -> aSource

int16FromCanonical :: C a => a -> Int16Source

int16FromFloat :: Float -> Int16Source

int16FromDouble :: Double -> Int16Source