synthesizer-0.0.3: src/Synthesizer/Physical/Displacement.hs
module Synthesizer.Physical.Displacement where
import qualified Synthesizer.SampleRateContext.Displacement as MiscC
import qualified Synthesizer.Physical.Signal as SigP
import qualified Algebra.OccasionallyScalar as OccScalar
import qualified Algebra.Module as Module
-- import qualified Algebra.Transcendental as Trans
import qualified Algebra.Field as Field
import qualified Algebra.Real as Real
-- import qualified Algebra.Ring as Ring
-- import qualified Algebra.Additive as Additive
-- import Algebra.Module ((*>))
import PreludeBase
-- import NumericPrelude
import Prelude ()
{- * Mixing -}
{-| Mix two signals.
In opposition to 'zipWith' the result has the length of the longer signal. -}
mix :: (Eq t', Real.C y', Field.C y', Module.C y yv, OccScalar.C y y') =>
SigP.T t t' y y' yv
-> SigP.T t t' y y' yv
-> SigP.T t t' y y' yv
mix = SigP.lift2 MiscC.mix
{-| Mix one or more signals. -}
mixMulti :: (Eq t', Real.C y', Field.C y', Module.C y yv, OccScalar.C y y') =>
[SigP.T t t' y y' yv]
-> SigP.T t t' y y' yv
mixMulti = SigP.liftList MiscC.mixMulti
{-| Add a number to all of the signal values.
This is useful for adjusting the center of a modulation. -}
raise :: (Eq t', Field.C y', Module.C y yv, OccScalar.C y y') =>
y'
-> yv
-> SigP.T t t' y y' yv
-> SigP.T t t' y y' yv
raise y' yv = SigP.lift1 (MiscC.raise y' yv)