csound-sampler 0.0.6.4 → 0.0.6.5
raw patch · 2 files changed
+45/−3 lines, 2 filesdep ~csound-expressionPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: csound-expression
API changes (from Hackage documentation)
+ Csound.Sam: instance Csound.SigSpace.At Csound.Typed.Types.Prim.Sig (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig) Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.At Csound.Typed.Types.Prim.Sig (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Tuple.Sig2) Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.At Csound.Typed.Types.Prim.Sig Csound.Typed.Types.Tuple.Sig2 Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.At Csound.Typed.Types.Tuple.Sig2 (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Tuple.Sig2) Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.At Csound.Typed.Types.Tuple.Sig2 Csound.Typed.Types.Tuple.Sig2 Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.MixAt Csound.Typed.Types.Prim.Sig (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Prim.Sig) Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.MixAt Csound.Typed.Types.Prim.Sig (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Tuple.Sig2) Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.MixAt Csound.Typed.Types.Prim.Sig Csound.Typed.Types.Tuple.Sig2 Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.MixAt Csound.Typed.Types.Tuple.Sig2 (Csound.Typed.GlobalState.SE.SE Csound.Typed.Types.Tuple.Sig2) Csound.Sam.Core.Sam
+ Csound.Sam: instance Csound.SigSpace.MixAt Csound.Typed.Types.Tuple.Sig2 Csound.Typed.Types.Tuple.Sig2 Csound.Sam.Core.Sam
Files
- csound-sampler.cabal +2/−2
- src/Csound/Sam.hs +43/−1
csound-sampler.cabal view
@@ -1,5 +1,5 @@ name: csound-sampler-version: 0.0.6.4+version: 0.0.6.5 license: BSD3 license-file: LICENSE author: Anton Kholomiov@@ -25,7 +25,7 @@ library Ghc-Options: -Wall Hs-Source-Dirs: src/- build-depends: base >= 4, base < 5, transformers >= 0.3, csound-expression >= 4.9.0+ build-depends: base >= 4, base < 5, transformers >= 0.3, csound-expression >= 5.0.0 exposed-modules: Csound.Sam Csound.Sam.Core
src/Csound/Sam.hs view
@@ -1,5 +1,5 @@ -- | The sampler-{-# Language TypeFamilies, DeriveFunctor, TypeSynonymInstances, FlexibleInstances #-}+{-# Language TypeFamilies, DeriveFunctor, TypeSynonymInstances, FlexibleInstances, MultiParamTypeClasses #-} module Csound.Sam ( Sample, Sam, Bpm, runSam, -- * Lifters@@ -80,6 +80,48 @@ instance Rest Sam where rest dt = Sam $ reader $ \bpm -> S 0 (Dur $ toSec bpm dt)++instance At Sig2 Sig2 Sam where+ type AtOut Sig2 Sig2 Sam = Sam+ at f x = fmap f x++instance At Sig2 (SE Sig2) Sam where+ type AtOut Sig2 (SE Sig2) Sam = Sam+ at f x = bindSam f x++instance At Sig (SE Sig) Sam where+ type AtOut Sig (SE Sig) Sam = Sam+ at f x = liftSam $ fmap (at f) x++instance At Sig Sig2 Sam where+ type AtOut Sig Sig2 Sam = Sam+ at f x = at phi x+ where + phi (a, b) = 0.5 * (f a + f b)++instance At Sig (SE Sig2) Sam where+ type AtOut Sig (SE Sig2) Sam = Sam+ at f x = at phi x+ where + phi (a, b) = do+ a' <- f a + b' <- f b+ return $ 0.5 * (a' + b')++instance MixAt Sig2 Sig2 Sam where+ mixAt k f sam = at (\x -> cfd k x (f x)) sam++instance MixAt Sig2 (SE Sig2) Sam where+ mixAt k f sam = at (\x -> fmap (cfd k x) (f x)) sam++instance MixAt Sig (SE Sig) Sam where+ mixAt k f sam = at (\x -> fmap (cfd k x) (f x)) sam++instance MixAt Sig Sig2 Sam where+ mixAt k f sam = at (\x -> cfd k (x, x) (f x)) sam++instance MixAt Sig (SE Sig2) Sam where+ mixAt k f sam = at (\x -> fmap (cfd k (x, x)) (f x)) sam -- | Constructs sample from mono signal infSig1 :: Sig -> Sam