packages feed

synthesizer-core-0.4.2: src/Synthesizer/Plain/Miscellaneous.hs

{-# LANGUAGE NoImplicitPrelude #-}
module Synthesizer.Plain.Miscellaneous
   {-# DEPRECATED "Use Synthesizer.Causal.Spatial instead" #-} where

import qualified Synthesizer.Causal.Spatial as Spatial
import qualified Synthesizer.Causal.Process as Causal

import qualified Algebra.NormedSpace.Euclidean as Euc
import qualified Algebra.Field                 as Field

import NumericPrelude.Base
-- import NumericPrelude.Numeric


{- * Spatial effects -}

{-|
simulate an moving sounding object

convert the way of the object through 3D space
into a delay and attenuation information,
sonicDelay is the reciprocal of the sonic velocity
-}
receive3Dsound :: (Field.C a, Euc.C a v) => a -> a -> v -> [v] -> ([a],[a])
receive3Dsound att sonicDelay ear =
   unzip . Causal.apply (Spatial.moveAround att sonicDelay ear)