module Vivid.UGens.Demand (
inf
, dbrown
, demand
, dibrown
, diwhite
, drand
, dseq
, dser
, dshuf
, dwhite
, dxrand
) where
import Vivid.UGens.Args
import Vivid.SynthDef
import Vivid.SynthDef.FromUA
import qualified Data.ByteString.Char8 as BS8
import Data.Proxy
inf :: Float
inf = 1/0
dbrown :: Args '[] '["lo","hi","step","length"] a => a -> SDBody a Signal
dbrown = demandBrownian "Dbrown"
demand :: Args '[] '["trigger","reset","ugen"] a => a -> SDBody a Signal
demand = makeUGen
"Demand" KR
(Vs::Vs '["trigger","reset","ugen"])
NoDefaults
dibrown :: Args '[] '["lo","hi","step","length"] a => a -> SDBody a Signal
dibrown = demandBrownian "Dibrown"
demandBrownian :: String -> (Args '[] '["lo","hi","step","length"] a => a -> SDBody a Signal)
demandBrownian ugName = makeUGen
ugName DR
(Vs::Vs '["length","lo","hi","step"])
(lo_ (0::Float), hi_ (1::Float), step_ (0.01::Float), length_ inf)
diwhite :: Args '[] '["lo","hi","length"] a => a -> SDBody a Signal
diwhite = demandWhite "Diwhite"
drand :: (Args '[] '["repeats"] a, ToSig s (SDBodyArgs a)) => a -> [s] -> SDBody a Signal
drand = drawFromList "Drand"
dseq :: (Args '[] '["repeats"] a, ToSig s (SDBodyArgs a)) => a -> [s] -> SDBody a Signal
dseq = drawFromList "Dseq"
drawFromList :: (Args '[] '["repeats"] a, ToSig s (SDBodyArgs a)) => String -> a -> [s] -> SDBody a Signal
drawFromList ugName args sigs = do
sigs' <- mapM toSig sigs
reps <- uaArgValWDefault (1::Float) args (Proxy::Proxy "repeats")
addUGen $ UGen (UGName_S $ BS8.pack ugName) DR (reps:sigs') 1
dser :: (Args '[] '["repeats"] a, ToSig s (SDBodyArgs a)) => a -> [s] -> SDBody a Signal
dser = drawFromList "Dser"
dshuf :: (Args '[] '["repeats"] a, ToSig s (SDBodyArgs a)) => a -> [s] -> SDBody a Signal
dshuf = drawFromList "Dshuf"
dwhite :: Args '[] '["lo","hi","length"] a => a -> SDBody a Signal
dwhite = demandWhite "Dwhite"
demandWhite :: String -> (Args '[] '["lo","hi","length"] a => a -> SDBody a Signal)
demandWhite ugName = makeUGen
ugName DR
(Vs::Vs '["length","lo","hi"])
(lo_ (0::Float), hi_ (1::Float), length_ inf)
dxrand :: (Args '[] '["repeats"] a, ToSig s (SDBodyArgs a)) => a -> [s] -> SDBody a Signal
dxrand = drawFromList "Dxrand"