hsc3 0.20 → 0.21
raw patch · 137 files changed
+12574/−10414 lines, 137 filesdep ~hoscPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hosc
API changes (from Hackage documentation)
- Sound.Sc3.Common.Math: type SC3_MulAdd t = t -> t -> t -> t
- Sound.Sc3.Common.Math.Filter.Beq: bPeakEQCoef :: Floating t => t -> t -> t -> t -> (t, t, t, t, t)
- Sound.Sc3.Server.Command.Completion: b_alloc :: Packet -> Int -> Int -> Int -> Message
- Sound.Sc3.Server.Command.Completion: b_allocRead :: Packet -> Int -> String -> Int -> Int -> Message
- Sound.Sc3.Server.Command.Completion: b_allocReadChannel :: Packet -> Int -> String -> Int -> Int -> [Int] -> Message
- Sound.Sc3.Server.Command.Completion: b_close :: Packet -> Int -> Message
- Sound.Sc3.Server.Command.Completion: b_free :: Packet -> Int -> Message
- Sound.Sc3.Server.Command.Completion: b_read :: Packet -> Int -> String -> Int -> Int -> Int -> Bool -> Message
- Sound.Sc3.Server.Command.Completion: b_readChannel :: Packet -> Int -> String -> Int -> Int -> Int -> Bool -> [Int] -> Message
- Sound.Sc3.Server.Command.Completion: b_write :: Packet -> Int -> String -> SoundFileFormat -> SampleFormat -> Int -> Int -> Bool -> Message
- Sound.Sc3.Server.Command.Completion: b_zero :: Packet -> Int -> Message
- Sound.Sc3.Server.Command.Completion: d_load :: Packet -> String -> Message
- Sound.Sc3.Server.Command.Completion: d_loadDir :: Packet -> String -> Message
- Sound.Sc3.Server.Command.Completion: d_recv :: Packet -> Synthdef -> Message
- Sound.Sc3.Server.Command.Completion: encode_blob :: Packet -> Datum
- Sound.Sc3.Server.Command.Generic: withCM :: Message -> Message -> Message
- Sound.Sc3.Server.Command.Generic: with_completion_packet :: Message -> Packet -> Message
- Sound.Sc3.Server.Nrt.Ugen: type Nrt_Ugen_Opt = (FilePath, FilePath, Int, SampleFormat, [String])
- Sound.Sc3.Server.Options: sc3_addr_def :: String
- Sound.Sc3.Server.Transport.Monad: sc3_default_udp :: Sc3_Address
- Sound.Sc3.Ugen.Bindings.Db.External: stkGlobals :: Rate -> Ugen -> Ugen -> Ugen -> Ugen
- Sound.Sc3.Ugen.Hs: type F_ST0 st o = st -> (o, st)
- Sound.Sc3.Ugen.Hs: type F_ST1 st i o = (i, st) -> (o, st)
- Sound.Sc3.Ugen.Util: (.<<.) :: Ugen -> Ugen -> Ugen
- Sound.Sc3.Ugen.Util: (.>>.) :: Ugen -> Ugen -> Ugen
- Sound.Sc3.Ugen.Util: bitAnd :: Ugen -> Ugen -> Ugen
- Sound.Sc3.Ugen.Util: bitNot :: Ugen -> Ugen
- Sound.Sc3.Ugen.Util: bitOr :: Ugen -> Ugen -> Ugen
- Sound.Sc3.Ugen.Util: bitXOr :: Ugen -> Ugen -> Ugen
- Sound.Sc3.Ugen.Util: shiftLeft :: Ugen -> Ugen -> Ugen
- Sound.Sc3.Ugen.Util: shiftRight :: Ugen -> Ugen -> Ugen
- Sound.Sc3.Ugen.Util: unsignedShift :: Ugen -> Ugen -> Ugen
+ Sound.Sc3.Common.Base: lookup_by_note :: String -> (a -> t -> Bool) -> a -> [(t, b)] -> b
+ Sound.Sc3.Common.Base: string_cmp :: Case_Rule -> String -> String -> Ordering
+ Sound.Sc3.Common.Base: string_op :: (String -> String -> t) -> Case_Rule -> String -> String -> t
+ Sound.Sc3.Common.Help: FencedCodeBlock :: CodeBlockType
+ Sound.Sc3.Common.Help: IndentedCodeBlock :: CodeBlockType
+ Sound.Sc3.Common.Help: data CodeBlockType
+ Sound.Sc3.Common.Help: get_help_file_fragments :: String -> [String]
+ Sound.Sc3.Common.Help: instance GHC.Classes.Eq Sound.Sc3.Common.Help.CodeBlockType
+ Sound.Sc3.Common.Help: instance GHC.Enum.Bounded Sound.Sc3.Common.Help.CodeBlockType
+ Sound.Sc3.Common.Help: instance GHC.Enum.Enum Sound.Sc3.Common.Help.CodeBlockType
+ Sound.Sc3.Common.Help: instance GHC.Read.Read Sound.Sc3.Common.Help.CodeBlockType
+ Sound.Sc3.Common.Help: instance GHC.Show.Show Sound.Sc3.Common.Help.CodeBlockType
+ Sound.Sc3.Common.Help: is_doctest_block :: [String] -> Bool
+ Sound.Sc3.Common.Help: is_md_help :: String -> Bool
+ Sound.Sc3.Common.Help: md_help_get_code_blocks :: [String] -> [(CodeBlockType, [String])]
+ Sound.Sc3.Common.Help: md_help_get_fenced_code_blocks :: [String] -> [[String]]
+ Sound.Sc3.Common.Help: md_help_get_tab_indented_code_blocks :: [String] -> [[String]]
+ Sound.Sc3.Common.Math: type Sc3_MulAdd t = t -> t -> t -> t
+ Sound.Sc3.Common.Math.Filter.Beq: bPeakEqCoef :: Floating t => t -> t -> t -> t -> Beq t
+ Sound.Sc3.Common.Math.Filter.Beq: type Beq t = (t, t, t, t, t)
+ Sound.Sc3.Server.Command.Completion: withCm :: Message -> Message -> Message
+ Sound.Sc3.Server.Command.Completion: with_completion_packet :: Message -> PacketOf Message -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_alloc :: PacketOf Message -> Int -> Int -> Int -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_allocRead :: PacketOf Message -> Int -> String -> Int -> Int -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_allocReadChannel :: PacketOf Message -> Int -> String -> Int -> Int -> [Int] -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_close :: PacketOf Message -> Int -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_free :: PacketOf Message -> Int -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_read :: PacketOf Message -> Int -> String -> Int -> Int -> Int -> Bool -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_readChannel :: PacketOf Message -> Int -> String -> Int -> Int -> Int -> Bool -> [Int] -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_write :: PacketOf Message -> Int -> String -> SoundFileFormat -> SampleFormat -> Int -> Int -> Bool -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: b_zero :: PacketOf Message -> Int -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: d_load :: PacketOf Message -> String -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: d_loadDir :: PacketOf Message -> String -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: d_recv :: PacketOf Message -> Synthdef -> Message
+ Sound.Sc3.Server.Command.Plain.Completion: encode_blob :: PacketOf Message -> Datum
+ Sound.Sc3.Server.Graphdef.Text: is_nil_or_comment :: String -> Bool
+ Sound.Sc3.Server.Nrt.Ugen: nrt_encoded_graphdef_rec :: Time -> Blob -> Nrt
+ Sound.Sc3.Server.Nrt.Ugen: nrt_encoded_graphdef_render :: Nrt_Opt -> Time -> Int -> Blob -> IO ()
+ Sound.Sc3.Server.Nrt.Ugen: nrt_graphdef_rec :: Time -> Graphdef -> Nrt
+ Sound.Sc3.Server.Nrt.Ugen: nrt_syndef_rec :: Time -> Synthdef -> Nrt
+ Sound.Sc3.Server.Nrt.Ugen: nrt_syndef_render :: Nrt_Opt -> Time -> Int -> Synthdef -> IO ()
+ Sound.Sc3.Server.Nrt.Ugen: type Nrt_Opt = (FilePath, FilePath, Int, SampleFormat, [String])
+ Sound.Sc3.Server.Options: sc3_host_name_def :: String
+ Sound.Sc3.Server.Options: sc3_protocol_def :: Sc3_Protocol
+ Sound.Sc3.Server.Transport.Fd: defaultSc3OscSocketAddress :: IO OscSocketAddress
+ Sound.Sc3.Server.Transport.Monad: auditionOpt :: Audible e => Play_Opt -> e -> IO ()
+ Sound.Sc3.Server.Transport.Monad: sc3_default_address :: Sc3_Address
+ Sound.Sc3.Server.Transport.Monad: sc3_env_or_default_address :: IO Sc3_Address
+ Sound.Sc3.Server.Transport.Monad: sc_latency :: IO Double
+ Sound.Sc3.Ugen.Bindings.Composite: eqPan2 :: Ugen -> Ugen -> Ugen
+ Sound.Sc3.Ugen.Constant: constantIsInteger :: Constant -> Bool
+ Sound.Sc3.Ugen.Constant: fractionPart :: Double -> Double
+ Sound.Sc3.Ugen.Event: control_spec_name :: ControlSpec t -> String
+ Sound.Sc3.Ugen.Hs: type F_St0 st o = st -> (o, st)
+ Sound.Sc3.Ugen.Hs: type F_St1 st i o = (i, st) -> (o, st)
+ Sound.Sc3.Ugen.Ugen: bitAnd :: Ugen -> Ugen -> Ugen
+ Sound.Sc3.Ugen.Ugen: bitNot :: Ugen -> Ugen
+ Sound.Sc3.Ugen.Ugen: bitOr :: Ugen -> Ugen -> Ugen
+ Sound.Sc3.Ugen.Ugen: bitXOr :: Ugen -> Ugen -> Ugen
+ Sound.Sc3.Ugen.Ugen: shiftLeft :: Ugen -> Ugen -> Ugen
+ Sound.Sc3.Ugen.Ugen: shiftRight :: Ugen -> Ugen -> Ugen
+ Sound.Sc3.Ugen.Ugen: unsignedShift :: Ugen -> Ugen -> Ugen
- Sound.Sc3.Common.Math: linlin_ma :: Fractional a => SC3_MulAdd a -> a -> a -> a -> a -> a -> a
+ Sound.Sc3.Common.Math: linlin_ma :: Fractional a => Sc3_MulAdd a -> a -> a -> a -> a -> a -> a
- Sound.Sc3.Common.Math: range_ma :: Fractional a => SC3_MulAdd a -> a -> a -> a -> a
+ Sound.Sc3.Common.Math: range_ma :: Fractional a => Sc3_MulAdd a -> a -> a -> a -> a
- Sound.Sc3.Common.Math: sc3_mul_add :: Num t => SC3_MulAdd t
+ Sound.Sc3.Common.Math: sc3_mul_add :: Num t => Sc3_MulAdd t
- Sound.Sc3.Common.Math: urange_ma :: Fractional a => SC3_MulAdd a -> a -> a -> a -> a
+ Sound.Sc3.Common.Math: urange_ma :: Fractional a => Sc3_MulAdd a -> a -> a -> a -> a
- Sound.Sc3.Common.Math.Filter.Beq: bAllPassCoef :: Floating t => t -> t -> t -> (t, t, t, t, t)
+ Sound.Sc3.Common.Math.Filter.Beq: bAllPassCoef :: Floating t => t -> t -> t -> Beq t
- Sound.Sc3.Common.Math.Filter.Beq: bBandPassCoef :: Floating t => t -> t -> t -> (t, t, t, t, t)
+ Sound.Sc3.Common.Math.Filter.Beq: bBandPassCoef :: Floating t => t -> t -> t -> Beq t
- Sound.Sc3.Common.Math.Filter.Beq: bBandStopCoef :: Floating t => t -> t -> t -> (t, t, t, t, t)
+ Sound.Sc3.Common.Math.Filter.Beq: bBandStopCoef :: Floating t => t -> t -> t -> Beq t
- Sound.Sc3.Common.Math.Filter.Beq: bHiPassCoef :: Floating t => t -> t -> t -> (t, t, t, t, t)
+ Sound.Sc3.Common.Math.Filter.Beq: bHiPassCoef :: Floating t => t -> t -> t -> Beq t
- Sound.Sc3.Common.Math.Filter.Beq: bHiShelfCoef :: Floating t => t -> t -> t -> t -> (t, t, t, t, t)
+ Sound.Sc3.Common.Math.Filter.Beq: bHiShelfCoef :: Floating t => t -> t -> t -> t -> Beq t
- Sound.Sc3.Common.Math.Filter.Beq: bLowPassCoef :: Floating a => a -> a -> a -> (a, a, a, a, a)
+ Sound.Sc3.Common.Math.Filter.Beq: bLowPassCoef :: Floating t => t -> t -> t -> Beq t
- Sound.Sc3.Common.Math.Filter.Beq: bLowShelfCoef :: Floating t => t -> t -> t -> t -> (t, t, t, t, t)
+ Sound.Sc3.Common.Math.Filter.Beq: bLowShelfCoef :: Floating t => t -> t -> t -> t -> Beq t
- Sound.Sc3.Server.Nrt: Nrt :: [Bundle] -> Nrt
+ Sound.Sc3.Server.Nrt: Nrt :: [BundleOf Message] -> Nrt
- Sound.Sc3.Server.Nrt: [nrt_bundles] :: Nrt -> [Bundle]
+ Sound.Sc3.Server.Nrt: [nrt_bundles] :: Nrt -> [BundleOf Message]
- Sound.Sc3.Server.Nrt: decode_nrt_bundles :: ByteString -> [Bundle]
+ Sound.Sc3.Server.Nrt: decode_nrt_bundles :: ByteString -> [BundleOf Message]
- Sound.Sc3.Server.Nrt: nrt_non_ascending :: Nrt -> [(Bundle, Bundle)]
+ Sound.Sc3.Server.Nrt: nrt_non_ascending :: Nrt -> [(BundleOf Message, BundleOf Message)]
- Sound.Sc3.Server.Nrt: nrt_span :: (Time -> Bool) -> Nrt -> ([Bundle], [Bundle])
+ Sound.Sc3.Server.Nrt: nrt_span :: (Time -> Bool) -> Nrt -> ([BundleOf Message], [BundleOf Message])
- Sound.Sc3.Server.Nrt: oscWithSize :: Bundle -> ByteString
+ Sound.Sc3.Server.Nrt: oscWithSize :: BundleOf Message -> ByteString
- Sound.Sc3.Server.Nrt.Edit: nrt_insert_post :: Bundle -> Nrt -> Nrt
+ Sound.Sc3.Server.Nrt.Edit: nrt_insert_post :: BundleOf Message -> Nrt -> Nrt
- Sound.Sc3.Server.Nrt.Edit: nrt_insert_pre :: Bundle -> Nrt -> Nrt
+ Sound.Sc3.Server.Nrt.Edit: nrt_insert_pre :: BundleOf Message -> Nrt -> Nrt
- Sound.Sc3.Server.Nrt.Ugen: nrt_ugen_render :: Nrt_Ugen_Opt -> Time -> Ugen -> IO ()
+ Sound.Sc3.Server.Nrt.Ugen: nrt_ugen_render :: Nrt_Opt -> Time -> Ugen -> IO ()
- Sound.Sc3.Server.Transport.Fd: run_bundle :: Transport t => t -> Time -> Bundle -> IO ()
+ Sound.Sc3.Server.Transport.Fd: run_bundle :: Transport t => t -> Time -> BundleOf Message -> IO ()
- Sound.Sc3.Server.Transport.Fd: withSc3 :: (Udp -> IO a) -> IO a
+ Sound.Sc3.Server.Transport.Fd: withSc3 :: (OscSocket -> IO a) -> IO a
- Sound.Sc3.Server.Transport.Monad: run_bundle :: Transport m => Time -> Bundle -> m ()
+ Sound.Sc3.Server.Transport.Monad: run_bundle :: Transport m => Double -> Time -> BundleOf Message -> m ()
- Sound.Sc3.Server.Transport.Monad: type Sc3_Address = (String, Int)
+ Sound.Sc3.Server.Transport.Monad: type Sc3_Address = OscSocketAddress
- Sound.Sc3.Server.Transport.Monad: withSc3 :: Connection Udp a -> IO a
+ Sound.Sc3.Server.Transport.Monad: withSc3 :: Connection OscSocket a -> IO a
- Sound.Sc3.Server.Transport.Monad: withSc3At :: Sc3_Address -> Connection Udp a -> IO a
+ Sound.Sc3.Server.Transport.Monad: withSc3At :: Sc3_Address -> Connection OscSocket a -> IO a
- Sound.Sc3.Server.Transport.Monad: withSc3AtSeq :: Sc3_Address -> Int -> Connection Udp a -> IO [a]
+ Sound.Sc3.Server.Transport.Monad: withSc3AtSeq :: Sc3_Address -> Int -> Connection OscSocket a -> IO [a]
- Sound.Sc3.Server.Transport.Monad: withSc3AtSeq_ :: Sc3_Address -> Int -> Connection Udp a -> IO ()
+ Sound.Sc3.Server.Transport.Monad: withSc3AtSeq_ :: Sc3_Address -> Int -> Connection OscSocket a -> IO ()
- Sound.Sc3.Server.Transport.Monad: withSc3_ :: Connection Udp a -> IO ()
+ Sound.Sc3.Server.Transport.Monad: withSc3_ :: Connection OscSocket a -> IO ()
- Sound.Sc3.Server.Transport.Monad: withSc3_tm :: Double -> Connection Udp a -> IO (Maybe a)
+ Sound.Sc3.Server.Transport.Monad: withSc3_tm :: Double -> Connection OscSocket a -> IO (Maybe a)
- Sound.Sc3.Ugen.Hs: as_trig :: (Fractional t, Ord t) => F_ST1 t t Bool
+ Sound.Sc3.Ugen.Hs: as_trig :: (Fractional t, Ord t) => F_St1 t t Bool
- Sound.Sc3.Ugen.Hs: biquad :: F_U5 n -> F_ST1 (T4 n) n n
+ Sound.Sc3.Ugen.Hs: biquad :: F_U5 n -> F_St1 (T4 n) n n
- Sound.Sc3.Ugen.Hs: bpz2 :: Fractional n => F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: bpz2 :: Fractional n => F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: brown_noise :: (RandomGen g, Fractional n, Random n, Ord n) => F_ST0 (g, n) n
+ Sound.Sc3.Ugen.Hs: brown_noise :: (RandomGen g, Fractional n, Random n, Ord n) => F_St0 (g, n) n
- Sound.Sc3.Ugen.Hs: brz2 :: Fractional n => F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: brz2 :: Fractional n => F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: bw_hpf_ir :: Floating n => T2 n -> F_ST1 (T4 n) n n
+ Sound.Sc3.Ugen.Hs: bw_hpf_ir :: Floating n => T2 n -> F_St1 (T4 n) n n
- Sound.Sc3.Ugen.Hs: bw_lpf_ir :: Floating n => T2 n -> F_ST1 (T4 n) n n
+ Sound.Sc3.Ugen.Hs: bw_lpf_ir :: Floating n => T2 n -> F_St1 (T4 n) n n
- Sound.Sc3.Ugen.Hs: fir1 :: F_U2 n -> F_ST1 n n n
+ Sound.Sc3.Ugen.Hs: fir1 :: F_U2 n -> F_St1 n n n
- Sound.Sc3.Ugen.Hs: fir2 :: F_U3 n -> F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: fir2 :: F_U3 n -> F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: fir3 :: F_U4 n -> F_ST1 (T3 n) n n
+ Sound.Sc3.Ugen.Hs: fir3 :: F_U4 n -> F_St1 (T3 n) n n
- Sound.Sc3.Ugen.Hs: fir4 :: F_U5 n -> F_ST1 (T4 n) n n
+ Sound.Sc3.Ugen.Hs: fir4 :: F_U5 n -> F_St1 (T4 n) n n
- Sound.Sc3.Ugen.Hs: fir8 :: F_U9 n -> F_ST1 (T8 n) n n
+ Sound.Sc3.Ugen.Hs: fir8 :: F_U9 n -> F_St1 (T8 n) n n
- Sound.Sc3.Ugen.Hs: hpz1 :: Fractional n => F_ST1 n n n
+ Sound.Sc3.Ugen.Hs: hpz1 :: Fractional n => F_St1 n n n
- Sound.Sc3.Ugen.Hs: hpz2 :: Fractional n => F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: hpz2 :: Fractional n => F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: iir1 :: F_U2 n -> F_ST1 n n n
+ Sound.Sc3.Ugen.Hs: iir1 :: F_U2 n -> F_St1 n n n
- Sound.Sc3.Ugen.Hs: iir2 :: F_U3 n -> F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: iir2 :: F_U3 n -> F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: iir2_ff_fb :: (n -> n -> n -> T2 n) -> F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: iir2_ff_fb :: (n -> n -> n -> T2 n) -> F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: l_apply_f_st0 :: F_ST0 st o -> st -> [o]
+ Sound.Sc3.Ugen.Hs: l_apply_f_st0 :: F_St0 st o -> st -> [o]
- Sound.Sc3.Ugen.Hs: l_apply_f_st1 :: F_ST1 st i o -> st -> [i] -> [o]
+ Sound.Sc3.Ugen.Hs: l_apply_f_st1 :: F_St1 st i o -> st -> [i] -> [o]
- Sound.Sc3.Ugen.Hs: lag :: Floating t => t -> F_ST1 t (t, t) t
+ Sound.Sc3.Ugen.Hs: lag :: Floating t => t -> F_St1 t (t, t) t
- Sound.Sc3.Ugen.Hs: latch :: F_ST1 t (t, Bool) t
+ Sound.Sc3.Ugen.Hs: latch :: F_St1 t (t, Bool) t
- Sound.Sc3.Ugen.Hs: lpz1 :: Fractional n => F_ST1 n n n
+ Sound.Sc3.Ugen.Hs: lpz1 :: Fractional n => F_St1 n n n
- Sound.Sc3.Ugen.Hs: lpz2 :: Fractional n => F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: lpz2 :: Fractional n => F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: mavg5 :: Fractional n => F_ST1 (T4 n) n n
+ Sound.Sc3.Ugen.Hs: mavg5 :: Fractional n => F_St1 (T4 n) n n
- Sound.Sc3.Ugen.Hs: mavg9 :: Fractional n => F_ST1 (T8 n) n n
+ Sound.Sc3.Ugen.Hs: mavg9 :: Fractional n => F_St1 (T8 n) n n
- Sound.Sc3.Ugen.Hs: phasor :: RealFrac t => F_ST1 t (Bool, t, t, t, t) t
+ Sound.Sc3.Ugen.Hs: phasor :: RealFrac t => F_St1 t (Bool, t, t, t, t) t
- Sound.Sc3.Ugen.Hs: resonz_ir :: Floating n => T3 n -> F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: resonz_ir :: Floating n => T3 n -> F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: rlpf_ir :: (Floating n, Ord n) => T3 n -> F_ST1 (T2 n) n n
+ Sound.Sc3.Ugen.Hs: rlpf_ir :: (Floating n, Ord n) => T3 n -> F_St1 (T2 n) n n
- Sound.Sc3.Ugen.Hs: slope :: Num t => t -> F_ST1 t t t
+ Sound.Sc3.Ugen.Hs: slope :: Num t => t -> F_St1 t t t
- Sound.Sc3.Ugen.Hs: sos :: Num n => T5 n -> F_ST1 (T4 n) n n
+ Sound.Sc3.Ugen.Hs: sos :: Num n => T5 n -> F_St1 (T4 n) n n
- Sound.Sc3.Ugen.Hs: white_noise :: (RandomGen g, Fractional n, Random n) => F_ST0 g n
+ Sound.Sc3.Ugen.Hs: white_noise :: (RandomGen g, Fractional n, Random n) => F_St0 g n
Files
- Help/Graph/f0-tw0028.hs +2/−2
- Help/Graph/jl-bitwise.hs +1/−1
- Help/Graph/jmcc-bowed-string.hs +1/−3
- Help/Ugen/bPeakEQ.help.hs +1/−1
- Help/Ugen/bufDur.help.hs +2/−2
- Help/Ugen/bufFrames.help.hs +2/−2
- Help/Ugen/bufGrain.help.hs +1/−1
- Help/Ugen/bufRateScale.help.hs +4/−4
- Help/Ugen/bufRd.help.hs +3/−3
- Help/Ugen/bufSampleRate.help.hs +1/−1
- Help/Ugen/concat.help.hs +1/−1
- Help/Ugen/control.hs +13/−0
- Help/Ugen/dx7.help.hs +7/−7
- Help/Ugen/fm7.help.hs +22/−5
- Help/Ugen/formlet.help.hs +0/−1
- Help/Ugen/freezer.help.hs +14/−13
- Help/Ugen/grainBuf.help.hs +3/−3
- Help/Ugen/grainSin.help.hs +1/−1
- Help/Ugen/max.help.hs +9/−1
- Help/Ugen/membraneHexagon.help.hs +2/−2
- Help/Ugen/miBraids.help.hs +1/−1
- Help/Ugen/miClouds.help.hs +4/−4
- Help/Ugen/miPlaits.help.hs +3/−6
- Help/Ugen/miTides.help.hs +3/−3
- Help/Ugen/phasor.help.hs +2/−2
- Help/Ugen/playBuf.help.hs +7/−7
- Help/Ugen/playBufCF.help.hs +2/−2
- Help/Ugen/pv_BinBufRd.help.hs +1/−1
- Help/Ugen/pv_BinScramble.help.hs +1/−1
- Help/Ugen/pv_Diffuser.help.hs +1/−1
- Help/Ugen/pv_MagFreeze.help.hs +1/−1
- Help/Ugen/pv_SpectralMap.help.hs +1/−1
- Help/Ugen/rSmplrIndex.help.hs +2/−2
- Help/Ugen/radiansPerSample.help.hs +2/−1
- Help/Ugen/select.help.hs +1/−1
- Help/Ugen/shufflerB.help.hs +5/−5
- Help/Ugen/sinOsc.help.hs +0/−3
- Help/Ugen/squiz.help.hs +1/−1
- Help/Ugen/stkInst.help.hs +1/−1
- Help/Ugen/sweep.help.hs +3/−3
- Help/Ugen/tGrains.help.hs +6/−6
- Help/Ugen/warp1.help.hs +2/−2
- README.md +41/−33
- Sound/Sc3.hs +3/−2
- Sound/Sc3/Common/Base.hs +174/−114
- Sound/Sc3/Common/Base/System.hs +2/−1
- Sound/Sc3/Common/Buffer.hs +145/−103
- Sound/Sc3/Common/Buffer/Array.hs +8/−8
- Sound/Sc3/Common/Buffer/Gen.hs +56/−36
- Sound/Sc3/Common/Buffer/Vector.hs +8/−8
- Sound/Sc3/Common/Context.hs +35/−33
- Sound/Sc3/Common/Enum.hs +45/−41
- Sound/Sc3/Common/Envelope.hs +313/−282
- Sound/Sc3/Common/Help.hs +130/−36
- Sound/Sc3/Common/Help/Sc2.hs +228/−171
- Sound/Sc3/Common/Math.hs +551/−351
- Sound/Sc3/Common/Math/Filter.hs +52/−46
- Sound/Sc3/Common/Math/Filter/Beq.hs +28/−25
- Sound/Sc3/Common/Math/Interpolate.hs +64/−53
- Sound/Sc3/Common/Math/Noise.hs +19/−15
- Sound/Sc3/Common/Math/Operator.hs +281/−250
- Sound/Sc3/Common/Math/Warp.hs +36/−26
- Sound/Sc3/Common/Math/Window.hs +3/−3
- Sound/Sc3/Common/Mce.hs +53/−38
- Sound/Sc3/Common/Monad.hs +5/−2
- Sound/Sc3/Common/Monad/Operators.hs +95/−53
- Sound/Sc3/Common/Random.hs +4/−3
- Sound/Sc3/Common/Rate.hs +26/−24
- Sound/Sc3/Common/SoundFile.hs +2/−3
- Sound/Sc3/Common/Uid.hs +14/−14
- Sound/Sc3/Fd.hs +3/−2
- Sound/Sc3/Server.hs +6/−5
- Sound/Sc3/Server/Command.hs +1/−0
- Sound/Sc3/Server/Command/Completion.hs +19/−61
- Sound/Sc3/Server/Command/Enum.hs +130/−124
- Sound/Sc3/Server/Command/Generic.hs +194/−177
- Sound/Sc3/Server/Command/Plain.hs +61/−52
- Sound/Sc3/Server/Command/Plain/Completion.hs +69/−0
- Sound/Sc3/Server/Enum.hs +66/−51
- Sound/Sc3/Server/Graphdef.hs +128/−88
- Sound/Sc3/Server/Graphdef/Binary.hs +32/−27
- Sound/Sc3/Server/Graphdef/Graph.hs +34/−33
- Sound/Sc3/Server/Graphdef/Io.hs +2/−2
- Sound/Sc3/Server/Graphdef/Read.hs +32/−29
- Sound/Sc3/Server/Graphdef/Text.hs +28/−16
- Sound/Sc3/Server/Nrt.hs +24/−20
- Sound/Sc3/Server/Nrt/Edit.hs +12/−10
- Sound/Sc3/Server/Nrt/Render.hs +33/−20
- Sound/Sc3/Server/Nrt/Stat.hs +14/−12
- Sound/Sc3/Server/Nrt/Ugen.hs +45/−23
- Sound/Sc3/Server/Options.hs +68/−54
- Sound/Sc3/Server/Param.hs +23/−18
- Sound/Sc3/Server/Recorder.hs +74/−55
- Sound/Sc3/Server/Scsynth.hs +2/−3
- Sound/Sc3/Server/Status.hs +98/−88
- Sound/Sc3/Server/Synthdef.hs +19/−17
- Sound/Sc3/Server/Transport/Fd.hs +73/−50
- Sound/Sc3/Server/Transport/Monad.hs +175/−115
- Sound/Sc3/Ugen/Analysis.hs +24/−24
- Sound/Sc3/Ugen/Bindings.hs +3/−2
- Sound/Sc3/Ugen/Bindings/Composite.hs +173/−144
- Sound/Sc3/Ugen/Bindings/Composite/External.hs +101/−96
- Sound/Sc3/Ugen/Bindings/Db.hs +3039/−2670
- Sound/Sc3/Ugen/Bindings/Db/External.hs +3538/−3057
- Sound/Sc3/Ugen/Bindings/Hw.hs +24/−22
- Sound/Sc3/Ugen/Bindings/Hw/Construct.hs +3/−3
- Sound/Sc3/Ugen/Bindings/Hw/External/F0.hs +4/−4
- Sound/Sc3/Ugen/Bindings/Hw/External/Sc3_Plugins.hs +44/−18
- Sound/Sc3/Ugen/Bindings/Hw/External/Wavelets.hs +6/−7
- Sound/Sc3/Ugen/Bindings/Hw/External/Zita.hs +17/−16
- Sound/Sc3/Ugen/Bracketed.hs +10/−8
- Sound/Sc3/Ugen/Brackets.hs +3/−2
- Sound/Sc3/Ugen/Constant.hs +20/−6
- Sound/Sc3/Ugen/Control.hs +28/−22
- Sound/Sc3/Ugen/Enum.hs +4/−5
- Sound/Sc3/Ugen/Envelope.hs +14/−14
- Sound/Sc3/Ugen/Event.hs +105/−88
- Sound/Sc3/Ugen/Graph.hs +314/−273
- Sound/Sc3/Ugen/Graph/Reconstruct.hs +85/−78
- Sound/Sc3/Ugen/Graph/Transform.hs +50/−45
- Sound/Sc3/Ugen/Help/Graph.hs +61/−57
- Sound/Sc3/Ugen/Hs.hs +145/−115
- Sound/Sc3/Ugen/Math.hs +6/−6
- Sound/Sc3/Ugen/Math/Composite.hs +15/−11
- Sound/Sc3/Ugen/Mce.hs +3/−3
- Sound/Sc3/Ugen/Mrg.hs +4/−4
- Sound/Sc3/Ugen/Name.hs +46/−28
- Sound/Sc3/Ugen/Optimise.hs +51/−33
- Sound/Sc3/Ugen/Plain.hs +16/−12
- Sound/Sc3/Ugen/Pp.hs +12/−12
- Sound/Sc3/Ugen/Primitive.hs +10/−10
- Sound/Sc3/Ugen/Proxy.hs +4/−4
- Sound/Sc3/Ugen/Types.hs +1/−1
- Sound/Sc3/Ugen/Ugen.hs +381/−304
- Sound/Sc3/Ugen/Util.hs +124/−147
- emacs/hsc3.el +54/−23
- hsc3.cabal +6/−5
Help/Graph/f0-tw0028.hs view
@@ -1,6 +1,6 @@ -- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0) ; slow to start... let fib = 0 : scanl (+) 1 fib- sc3_fib k = take k (tail fib)+ sc3_fib k = take k (drop 1 fib) n = map ((* 99) . (`mod` 8)) (sc3_fib 16) p = dseq dinf (dshuf 8 (mce (map fromInteger n))) q = combN (duty ar (1/8) 0 DoNothing p) 4 4 16@@ -10,7 +10,7 @@ -- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0) ; slow to start... ; id let fib = 0 : scanl (+) 1 fib- sc3_fib k = take k (tail fib)+ sc3_fib k = take k (drop 1 fib) n = map ((* 99) . (`mod` 8)) (sc3_fib 16) p = dseqId 'α' dinf (dshufId 'β' 8 (mce (map fromInteger n))) q = combN (duty ar (1/8) 0 DoNothing p) 4 4 16
Help/Graph/jl-bitwise.hs view
@@ -1,7 +1,7 @@ -- bitwise ; a0f253ff89f6b244ea29a1e431dd9e5df5571a8b (jl) let t = pulseCount (impulse ar 8e3 0) 0 s = ((((t * 15) .&. (t .>>. 5)) .|.- ((t * 5) .&. (t .>>. (mce2 3 4))) .|.+ ((t * 5) .&. (mce2 (t .>>. 3) (t .>>. 4))) .|. ((t * 2) .&. (t .>>. 9)) .|. ((t * 8) .&. (t .>>. 11))) - 3) `modE` 256 in tanh (hpf (((s / 127) - 1) * 3) 20) * 0.02
Help/Graph/jmcc-bowed-string.hs view
@@ -29,13 +29,12 @@ return (softClip (k * 0.1))) -- bowed string (jmcc) ; event control-let f (_,g,x,y,z,_,_,_,p,_,_) =+let f (_,g,_,y,z,_,_,_,p,_,_) = let n0 = mce2 (brownNoise ar) (brownNoise ar) r0 = expRand 0.125 0.5 r1 = rand 0.7 0.9 r2 = X.randN 12 1.0 3.0 fq = unitCps p- n1 = lfNoise1 kr r0 exc = n0 * 0.005 * z * lagUD g (y * 0.1) (y * 4) geom n i m = mce (take n (iterate (* m) i)) iota n i m = mce (take n (iterate (+ m) i))@@ -50,7 +49,6 @@ r1 = randId (c,'δ') 0.7 0.9 r2 = X.randNId 12 (c,'ε') 1.0 3.0 fq = unitCps p- n1 = lfNoise1Id (c,'ζ') kr r0 exc = n0 * 0.005 * z * lagUD g (y * 0.1) (y * 4) geom n i m = mce (take n (iterate (* m) i)) iota n i m = mce (take n (iterate (+ m) i))
Help/Ugen/bPeakEQ.help.hs view
@@ -14,7 +14,7 @@ let i = pinkNoiseId 'α' ar * 0.1 freq = mouseX kr 2200 18000 Exponential 0.2 rq = mouseY kr 10 0.4 Linear 0.2- (a0, a1, a2, b1, b2) = Sound.Sc3.Common.Math.Filter.Beq.bPeakEQCoef sampleRate freq rq 6+ (a0, a1, a2, b1, b2) = Sound.Sc3.Common.Math.Filter.Beq.bPeakEqCoef sampleRate freq rq 6 in sos i a0 a1 a2 b1 b2 * 0.5 -- bPeakEQ ; parametric
Help/Ugen/bufDur.help.hs view
@@ -1,11 +1,11 @@ -- bufDur ; requires=buf ; read without loop, trigger reset based on buffer duration-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) t = impulse ar (recip (bufDur kr b)) 0 p = sweep ar t (bufSampleRate kr b) in bufRd nc ar b p NoLoop LinearInterpolation * 0.1 -- bufDur ; requires=buf ; bufDur = bufFrames / bufSampleRate-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) t = impulse ar (bufSampleRate kr b / bufFrames kr b) 0 p = sweep ar t (bufSampleRate kr b) in bufRd nc ar b p NoLoop LinearInterpolation * 0.1
Help/Ugen/bufFrames.help.hs view
@@ -1,10 +1,10 @@ -- bufFrames ; requires=buf ; read without loop, trigger reset based on buffer duration-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) p = phasor ar 0 (bufRateScale kr b) 0 (bufFrames kr b) 0 in bufRdL nc ar b p NoLoop * 0.1 -- bufFrames ; requires=buf ; mouse location drags play head-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) r = mce [0.05, 0.075 .. 0.15] p = k2a (mouseX kr 0 (bufFrames kr b) Linear r) in mix (bufRdL nc ar b p NoLoop) * 0.1
Help/Ugen/bufGrain.help.hs view
@@ -1,5 +1,5 @@ -- bufGrain ; requires=buf-let b = control kr "buf" 0+let b = control kr "buf" 100 x = mouseX kr 0.5 8 Linear 0.2 y = mouseY kr 0.05 0.2 Linear 0.2 e = envGen kr 1 1 0 1 RemoveSynth (envelope [0, 1, 0] [3, 2] [EnvSin, EnvSin])
Help/Ugen/bufRateScale.help.hs view
@@ -1,23 +1,23 @@ -- bufRateScale ; requires=buf ; read without loop, trigger reset based on buffer duration-let b = control kr "buf" 0+let b = control kr "buf" 100 r = bufRateScale kr b p = phasor ar 0 r 0 (bufFrames kr b) 0 in bufRdL 1 ar b p NoLoop * 0.5 -- bufRateScale ; requires=buf ; read buffer at ~ 3/4 reported sample rate-let b = control kr "buf" 0+let b = control kr "buf" 100 r = midiRatio (-5) * bufRateScale kr b p = phasor ar 0 r 0 (bufFrames kr b) 0 in bufRdL 1 ar b p NoLoop * 0.5 -- bufRateScale ; requires=buf ; bufRateScale = bufSampleRate / sampleRate-let b = control kr "buf" 0+let b = control kr "buf" 100 r = midiRatio (-5) * (bufSampleRate kr b / sampleRate) p = phasor ar 0 r 0 (bufFrames kr b) 0 in bufRdL 1 ar b p NoLoop * 0.5 -- bufRateScale ; requires=buf ; bufRateScale = bufSampleRate * sampleDur-let b = control kr "buf" 0+let b = control kr "buf" 100 r = midiRatio (-5) * (bufSampleRate kr b * sampleDur) p = phasor ar 0 r 0 (bufFrames kr b) 0 in bufRdL 1 ar b p NoLoop * 0.5
Help/Ugen/bufRd.help.hs view
@@ -1,16 +1,16 @@ -- bufRd ; requires=buf ; phasor as phase input ; constructors bufRd{N|L|C} preset interpolation type-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) tr = impulse ar (recip (bufDur kr buf)) 0 ph = phasor ar tr (bufRateScale kr buf) 0 (bufFrames kr buf) 0 in bufRdL nc ar buf ph NoLoop -- bufRd ; requires=buf ; audio rate sine oscillator as phase input-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) phase = sinOsc ar 0.1 0 * bufFrames kr buf * bufRateScale kr buf in bufRdL nc ar buf phase Loop -- bufRd ; requires=buf ; mouse control-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) x = mouseX kr (mce [5, 10]) 100 Linear 0.1 n = lfNoise1Id 'α' ar x in mix (bufRdL nc ar buf (n * bufFrames kr buf * bufRateScale kr buf) Loop)
Help/Ugen/bufSampleRate.help.hs view
@@ -1,5 +1,5 @@ -- bufSampleRate ; requires=buf ; frequency as fraction of buffer sample-rate (ie. 48000 / 100 == 480)-let b = control kr "buf" 0+let b = control kr "buf" 100 f = mce [bufSampleRate kr b * 0.01, 440] in sinOsc ar f 0 * 0.1
Help/Ugen/concat.help.hs view
@@ -1,5 +1,5 @@ -- concat ; requires=buf ; granulator-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) y0 = mouseY kr 0.01 1 Linear 0.2 y1 = mouseY kr b 100 Linear 0.2 n = lfNoise0Id 'α' kr y0 * 3 + 4.5
Help/Ugen/control.hs view
@@ -1,4 +1,7 @@ -- control+out 0 (sinOsc ar (control kr "freq" 440) 0 * 0.1)++-- control sinOsc ar (control kr "freq" 440) 0 * control kr "amp" 0.1 -- control ; ir and kr and tr controls ; setting amp also triggers an envelope@@ -29,3 +32,13 @@ ---- ; command list ui to send messages to set oscillator frequency UI.ui_scsynth_command_list (map (\x -> n_set 1 [("freq1",55 * (x ** 2)),("amp1",0.1 * (1 / x))]) [1 .. 7])++---- ; control ; printing+ugen_dump_ugens (out 0 (sinOsc ar (control kr "freq" 440) 0 * 0.1))++---- ; control ; encoding+import qualified Data.ByteString.Lazy as L+L.unpack (synthdefData (Synthdef "LocalControls" (out 0 (sinOsc ar (control kr "freq" 440) 0 * 0.1))))++-- ; control ; printing+putStrLn $ synthstat (out 0 (sinOsc ar (control kr "freq" 440) 0 * 0.1))
Help/Ugen/dx7.help.hs view
@@ -29,11 +29,11 @@ ,[99,99,99,99,50,50,50,50,3,2,1,29,99,1,0,0,0,1,24]] buf = asLocalBufId 'ε' (map constant (concat vc)) x0 = latch x g- in pan2 (X.dx7 ar buf g 0 0 0 (p * 127) z (0x2000 * (x - x0)) 0 0 0) (o * 2 - 1) 1+ in pan2 (X.dx7 ar buf g 0 0 0 (p * 100) z (0x2000 * (x - x0)) 0 0 0) (o * 2 - 1) 1 in mix (voicer 16 f) * control kr "gain" 1 -- dx7 ; data at shared buffer ; external control-let buf = control kr "dat" 100+let buf = control kr "dat" 400 gate_ = control kr "gate" 0 reset = control kr "reset" 0 data_ = control kr "data" 0@@ -48,7 +48,7 @@ -- dx7 ; data at shared buffer let nv = 32 -- 221- buf = control kr "dat" 100+ buf = control kr "dat" 400 tr = dustId 'α' kr 2.0 gate_ = toggleFF tr reset_ = 0@@ -61,7 +61,7 @@ -- dx7 ; event control ; data at shared buffer let f (_,g,x,_,z,o,_,_,p,_,_) =- let buf = control kr "buf" 100+ let buf = control kr "buf" 400 vc = control_m kr "vc" 0 (0,31,"lin") x0 = latch x g pw = 0x2000 * (1 + (x - x0) * 2)@@ -72,18 +72,18 @@ ---- ; send init voice import qualified Sound.Sc3.Data.Yamaha.DX7 as DX7 {- hsc3-data -} import qualified Sound.Sc3.Data.Yamaha.DX7.Sc3 as DX7 {- hsc3-data -}-DX7.dx7_sc3_data_load 100 [DX7.dx7_init_voice]+DX7.dx7_sc3_data_load 400 [DX7.dx7_init_voice] ---- ; load patch data from .hex.text file hex_fn = "/home/rohan/uc/the-center-is-between-us/trees/text/dx7/tc.hex.text" v <- DX7.dx7_load_hex hex_fn-DX7.dx7_sc3_data_load 100 v+DX7.dx7_sc3_data_load 400 v length v == 221 ---- ; load patch data from .syx sysex file syx_fn = "/home/rohan/sw/hsc3-data/data/yamaha/dx7ii/rom/DX7II-32A.syx" bnk <- DX7.dx7_load_fmt9_sysex_err syx_fn-DX7.dx7_sc3_data_load 100 bnk+DX7.dx7_sc3_data_load 400 bnk length bnk == 32 ---- ; send external control messages
Help/Ugen/fm7.help.hs view
@@ -1,12 +1,29 @@--- fm7 ; two of six-let c = [[xLine kr 300 310 4 DoNothing,0,1]- ,[xLine kr 300 310 8 DoNothing,0,1]+-- fm7 ; two of six ; direct form+let c = mce [xLine kr 300 310 4 DoNothing,0,1+ ,xLine kr 300 310 8 DoNothing,0,1+ ,0,0,1+ ,0,0,1+ ,0,0,1+ ,0,0,1]+ m = mce [line kr 0 0.001 2 DoNothing,line kr 0.1 0 4 DoNothing,0,0,0,0+ ,line kr 0 6 1 DoNothing,0,0,0,0,0+ ,0,0,0,0,0,0+ ,0,0,0,0,0,0+ ,0,0,0,0,0,0+ ,0,0,0,0,0,0]+ [l,r,_,_,_,_] = mceChannels (X.fm7 ar c m)+in mce2 l r * 0.1++-- fm7 ; two of six ; matrix form ; inputs may be audio or control or initialization rate+let rt = ar+ c = [[xLine rt 300 310 4 DoNothing,0,1]+ ,[xLine rt 300 310 8 DoNothing,0,1] ,[0,0,1] ,[0,0,1] ,[0,0,1] ,[0,0,1] ]- m = [[line kr 0 0.001 2 DoNothing,line kr 0.1 0 4 DoNothing,0,0,0,0]- ,[line kr 0 6 1 DoNothing,0,0,0,0,0]+ m = [[line rt 0 0.001 2 DoNothing,line rt 0.1 0 4 DoNothing,0,0,0,0]+ ,[line rt 0 6 1 DoNothing,0,0,0,0,0] ,[0,0,0,0,0,0] ,[0,0,0,0,0,0] ,[0,0,0,0,0,0]
Help/Ugen/formlet.help.hs view
@@ -28,4 +28,3 @@ let s = blip ar (sinOsc kr 5 0 * 20 * constant (c + 1) + 300) (2000 * rx) in pan2 (formlet s (linExp y 0 1 700 2000) 0.005 (linExp x 0 1 0.01 0.2)) (o * 2 - 1) (g * z) in mix (voicer 16 f) * control kr "gain" 1-
Help/Ugen/freezer.help.hs view
@@ -1,50 +1,50 @@ -- freezer ; check buffer-let b = control kr "buf" 0+let b = control kr "buf" 100 s = bufRateScale kr b in playBuf 1 ar b s 1 0 NoLoop RemoveSynth * 0.1 -- freezer ; static instance-let b = control kr "buf" 0+let b = control kr "buf" 100 in X.freezer b 0.35 0.4 0.6 0.1 0.05 0.02 0.1 0 0 6 -- freezer ; static instance-let b = control kr "buf" 0+let b = control kr "buf" 100 in X.freezer b 0.3 0.4 0.6 1 0 0 0 0 0 6 -- freezer ; static instance-let b = control kr "buf" 0+let b = control kr "buf" 100 in X.freezer b 0.3 0.7 0.6 0.35 0 0.5 0.5 0 0 6 -- freezer ; static instance-let b = control kr "buf" 0+let b = control kr "buf" 100 in X.freezer b 0.2500 0.2505 0.1 1 0 0.050 0.005 0 0 24 -- freezer ; k-rate instance-let b = control kr "buf" 0+let b = control kr "buf" 100 n f i j = linLin (lfNoise2 kr f) (-1) 1 i j left = n 1 0.3 0.8 right = left + n 1 0.01 0.05 in X.freezer b left right 0.1 0.5 0.1 0.5 0.05 0 0 24 -- freezer ; k-rate instance ; id-let b = control kr "buf" 0+let b = control kr "buf" 100 nId z f i j = linLin (lfNoise2Id z kr f) (-1) 1 i j left = nId 'α' 1 0.3 0.8 right = left + nId 'β' 1 0.01 0.05 in X.freezer b left right 0.1 0.5 0.1 0.5 0.05 0 0 24 -- freezer ; k-rate instance-let b = control kr "buf" 0+let b = control kr "buf" 100 n i j = linLin (lfNoise2 kr 0.1) (-1) 1 i j in X.freezer b (n 0.3 0.4) (n 0.5 0.6) (n 0.3 0.6) (n 0.95 1.05) (n 0.05 0.15) (n 0.05 0.15) (n 0.05 0.15) 0 0 36 -- freezer ; k-rate instance ; id-let b = control kr "buf" 0+let b = control kr "buf" 100 nId z i j = linLin (lfNoise2Id z kr 0.1) (-1) 1 i j in X.freezer b (nId 'α' 0.3 0.4) (nId 'β' 0.5 0.6) (nId 'γ' 0.3 0.6) (nId 'δ' 0.95 1.05) (nId 'ε' 0.05 0.15) (nId 'ζ' 0.05 0.15) (nId 'η' 0.05 0.15) 0 0 36 -- freezer ; controls-let b = control_m kr "buf" 0 (0,0,"lin")+let b = control_m kr "buf" 100 (0,0,"lin") (lhs,rhs) = control_rng kr "wnd" (0,1) (0,1,"lin") amp = control_m kr "amp" 0.1 (0,1,"amp") incr = control_m kr "incr" 1 (0,4,"lin")@@ -56,8 +56,9 @@ dgr = control_m kr "numLp" 24 (1,64,"lin") in X.freezer b lhs rhs amp incr incrO incrR wndR syncPh randPh dgr ----- ; allocate buffer 0, required for examples-ld fn = withSc3 (async (b_allocRead 0 (sfResolve fn) 0 0))+---- ; allocate buffer 100, required for examples+import Sound.Sc3.Server.Command.MemCpy {- sc3-rdu -}+ld fn = b_allocReadOrSend 100 (sfResolve fn) 0 0 >>= (withSc3 . async) ld "instr/crotales/crotale05(D).wav" ld "saron-panerus-S-0-5.flac" ld "saron-panerus-S-0-6.flac"@@ -75,5 +76,5 @@ Create a set of concurrent loops at a signal buffer. This is the dynamic and gestural variant of RLoopSet. It was written after-reading the manual for the GRM ToolsId 'Freeze' plugin.+reading the manual for the Grm Tools 'Freeze' plugin. -}
Help/Ugen/grainBuf.help.hs view
@@ -1,5 +1,5 @@ -- grainBuf ; requires=buf-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) dur = 15 lin a b = line kr a b dur RemoveSynth tr = impulse kr (lin 7.5 15) 0@@ -10,7 +10,7 @@ in grainBuf nc tr gd buf r i 2 l (-1) 512 * control kr "gain" 0.25 -- grainBuf ; requires=buf ; mouse control-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) e = -1 x = mouseX kr (-1) 1 Linear 0.1 y = mouseY kr 10 45 Linear 0.1@@ -21,7 +21,7 @@ -- grainBuf ; requires=buf ; event control let f (_,g,x,y,z,o,rx,ry,_,_,_) =- let (buf, nc) = (control kr "buf" 0, 2)+ let (buf, nc) = (control kr "buf" 100, 2) e = -1 tr = impulse ar (y * 60 + 10) 0 in grainBuf nc tr (ry * 0.5) buf (1 + (rx * 0.1)) x 2 o e 512 * z * g
Help/Ugen/grainSin.help.hs view
@@ -20,7 +20,7 @@ in grainSin 2 tr du (midiCps ((p * 127) + (ry * 2 - 1))) (o * 2 - 1) (-1) 512 * z * g in mix (voicer 16 f) * control kr "gain" 1 --- grainsin ; mouse control+-- grainSin ; mouse control let overlap = mouseY kr 0 2 Linear 0.2 f = mouseX kr 1 220 Linear 0.2 in grainSin 2 (impulse ar f 0) (overlap / f) 440 0 (-1) 512 * 0.1
Help/Ugen/max.help.hs view
@@ -1,2 +1,10 @@ -- max-(fSinOsc ar 500 0 `max` fSinOsc ar 0.1 0) * 0.1+(sinOsc ar 500 0 `max` sinOsc ar 0.1 0) * 0.1++-- max ; rate selection ; derive from left+let f = (sinOsc ar 0.2 0 `max` sinOsc kr 0.9 0) * 200 + 300+in sinOsc ar f 0 * 0.1++-- max ; rate selection ; derive from right+let f = (sinOsc kr 0.2 0 `max` sinOsc ar 0.9 0) * 200 + 300+in sinOsc ar f 0 * 0.1
Help/Ugen/membraneHexagon.help.hs view
@@ -5,10 +5,10 @@ ex = pinkNoiseId 'α' ar * envGen kr mb 0.4 0 0.1 DoNothing (envPerc 0.01 1) in X.membraneHexagon ar ex mx my --- membraneHexagon ; event control+-- membraneHexagon ; event control ; requires=voicer let f (_,g,x,y,z,o,rx,_,_,_,_) = let ex = pinkNoiseId 'α' ar * envGen kr g z 0 0.1 DoNothing (envPerc (0.02 * rx) 1) tn = x * 0.1 ls = linExp y 0 1 0.999999 0.9999 in pan2 (X.membraneHexagon ar ex tn ls) (o * 2 - 1) 1-in mix (voicer 8 f) * control kr "gain" 1+in mix (voicer 16 f) * control kr "gain" 1
Help/Ugen/miBraids.help.hs view
@@ -44,7 +44,7 @@ in X.miBraids ar pit timb color (X.miBraids_mode "PLUCKED") tr 0 0 0 0 * 0.1 -- MiBraids ; 28:PLUCKED ; event control-let f (_,g,x,y,z,o,rx,_,_,_,_) =+let f (_,g,x,y,_,o,rx,_,_,_,_) = let tr = trig1 g controlDur pit = x * 24 + 45 timb = latch y tr * 0.5 + 0.25
Help/Ugen/miClouds.help.hs view
@@ -1,5 +1,5 @@ -- MiClouds ; basic granulation ; requires=buf (stereo) ; 0=GRANULAR-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) input = playBuf nc ar buf 1 1 0 Loop DoNothing dens = lfNoise1Id 'α' kr 0.3 `in_range` (0.3,0.45) in X.miClouds ar 0 0 0 dens 0.5 1 1 0.5 0 0 0 (X.miClouds_mode "GRANULAR") 0 0 input@@ -17,14 +17,14 @@ in X.miClouds ar pit pos size dens tex 0.5 2 0.5 0.3 0.8 frez (X.miClouds_mode "GRANULAR") 1 0 input -- MiClouds ; using external grain trigger ; requires=buf (stereo)-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) input = playBuf nc ar buf 1 1 0 Loop DoNothing dens = 0.5 tr = dustId 'α' kr 10 in X.miClouds ar (-5) 0 0.2 dens 0.5 1 1 0.5 0 0 0 (X.miClouds_mode "GRANULAR") 0 tr input -- MiClouds ; 3=SPECTRAL ; (this mode causes high CPU peaks)-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) input = playBuf nc ar buf 1 1 0 Loop DoNothing size = 0.35 dens = 0.02@@ -32,7 +32,7 @@ in X.miClouds ar 0 0 size dens tex 1 1 0.5 0.8 0.8 0 (X.miClouds_mode "SPECTRAL") 0 0 input * 0.35 -- MiClouds ; spectral again ; watch volume-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) input = playBuf nc ar buf 1 1 0 Loop DoNothing size = squared (range 0.1 0.5 (lfNoise1Id 'α' kr 0.2)) dens = lfNoise1Id 'β' kr 0.3 * 0.5 + 0.5
Help/Ugen/miPlaits.help.hs view
@@ -36,21 +36,18 @@ let harm = mouseY kr 0 1 Linear 0.2 -- select chord trigger = impulse kr 6 0 lev = tRandId 'α' 0 1 trigger- c0 = head . mceChannels-in c0 (X.miPlaits ar 40 (X.miPlaits_mode "chord") harm 0.5 0.5 trigger (lev * lev) 0 0.4 0 0.5 0.5) * 0.1+in mceChannel 0 (X.miPlaits ar 40 (X.miPlaits_mode "chord") harm 0.5 0.5 trigger (lev * lev) 0 0.4 0 0.5 0.5) * 0.1 -- MiPlaits ; 8=swarm ; super saw let pit = tiRandId 'α' 39 49 (dustId 'β' kr 0.5)- c0 = head . mceChannels-in c0 (X.miPlaits ar pit (X.miPlaits_mode "swarm") 0.16 0 1 0 0 0 0 0 0.5 0.5) * 0.1+in mceChannel 0 (X.miPlaits ar pit (X.miPlaits_mode "swarm") 0.16 0 1 0 0 0 0 0 0.5 0.5) * 0.1 -- MiPlaits ; slow swarm X.miPlaits ar 48 (X.miPlaits_mode "swarm") 0.9 0 0.5 0 0 0 0 0 0.5 0.5 * mce2 0.04 0.15 -- MiPlaits ; 11=string ; inharmonic let harm = range 0 1 (lfNoise2Id 'α' kr 0.2)- c0 = head . mceChannels-in c0 (X.miPlaits ar 60 (X.miPlaits_mode "string") harm 0 0.85 0 0 0 0 0 0.5 0.5)+in mceChannel 0 (X.miPlaits ar 60 (X.miPlaits_mode "string") harm 0 0.85 0 0 0 0 0 0.5 0.5) -- MiPlaits ; 12=modal let harm = range 0 1 (lfNoise2Id 'α' kr 0.2)
Help/Ugen/miTides.help.hs view
@@ -1,11 +1,11 @@ -- MiTides ; shape let shape = lfTri ar 0.11 0 `in_range` (0,1)- c0 = head . mceChannels+ c0 = mceChannel 0 in c0 (X.miTides ar 100 shape 0.5 0.5 0.2 0 0 {-output_mode:-} 2 1 9 1) * 0.25 -- MiTides ; slope let slope = lfTri ar 0.11 0 `in_range` (0,1)- c0 = head . mceChannels+ c0 = mceChannel 0 in c0 (X.miTides ar 100 0.5 slope 0.5 0.2 0 0 {-output_mode:-} 2 1 9 1) * 0.25 -- MiTides ; phasing@@ -61,7 +61,7 @@ tr = lfPulse ar 1 0 0.5 env = X.miTides ar freq shape slope_ smooth 0.8 tr 0 {-output_mode:-} 0 {-ramp_mode:-} 0 1 9 sine = pmOsc ar 150 300 2 0- c0 = head . mceChannels+ c0 = mceChannel 0 in sine * c0 env -- MiTides ; Lightbath -- Loom 4
Help/Ugen/phasor.help.hs view
@@ -14,12 +14,12 @@ in sinOsc ar (x * 500 + 500) 0 * 0.1 -- phasor ; as phase input to bufRd ; requires=buf-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) ph = phasor ar 0 (bufRateScale kr b) 0 (bufFrames kr b) 0 in bufRd nc ar b ph Loop NoInterpolation -- phasor ; audio rate oscillator as phase input to bufRd ; requires=buf (non-wavetable format)-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) f = 440 fr = bufFrames kr b rt = f * (fr / sampleRate)
Help/Ugen/playBuf.help.hs view
@@ -1,38 +1,38 @@ -- playBuf ; requires=buf ; once only-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) in playBuf nc ar b (bufRateScale kr b) 1 0 NoLoop RemoveSynth -- playBuf ; requires=buf ; infinite loop-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) in playBuf nc ar b (bufRateScale kr b) 1 0 Loop DoNothing -- playBuf ; requires=buf ; trigger playback at each pulse-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) t = impulse kr 2 0 s = bufRateScale kr 0 in playBuf nc ar b s t 0 NoLoop DoNothing -- playBuf ; requires=buf ; trigger playback at each pulse (diminishing intervals)-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) f = xLine kr 0.1 100 10 RemoveSynth t = impulse kr f 0 s = bufRateScale kr b in playBuf nc ar b s t 0 NoLoop DoNothing -- playBuf ; requires=buf ; loop playback, accelerating pitch-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) r = xLine kr 0.1 100 60 RemoveSynth in playBuf nc ar b r 1 0 Loop DoNothing -- playBuf ; requires=buf ; sine wave control of playback rate, negative rate plays backwards-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) f = xLine kr 0.2 8 30 RemoveSynth r = fSinOsc kr f 0 * 3 + 0.6 s = bufRateScale kr b * r in playBuf nc ar b s 1 0 Loop DoNothing -- playBuf ; requires=buf ; channel mismatch message in server log ; can acquire second channel (subsequent load)-let (b, nc) = (control kr "buf" 0, 1)+let (b, nc) = (control kr "buf" 100, 1) in playBuf (nc + 1) ar b (bufRateScale kr b) 1 0 Loop DoNothing -- playBuf ; requires=buf ; scan sequence of buffers
Help/Ugen/playBufCF.help.hs view
@@ -1,5 +1,5 @@ -- playBufCF ; wslib ; CF = cross-fade ; control-rate trigger and start-position inputs-let b = control kr "buf" 0+let b = control kr "buf" 100 r = bufRateScale kr b tr = impulse kr 2 0 wn = whiteNoiseId 'α' kr@@ -9,7 +9,7 @@ in mce2 o o' -- playBufCF ; demand ugens inputs-let b = control kr "buf" 0+let b = control kr "buf" 100 r = drandId 'α' dinf (mce [0.95,1,1.05]) tr = dwhiteId 'β' dinf 0.1 0.3 sp = dbrownId 'γ' dinf 0 0.95 0.1 * bufFrames kr b
Help/Ugen/pv_BinBufRd.help.hs view
@@ -1,5 +1,5 @@ -- pv_BinBufRd ; play analysis back ; c.f. pv_RecordBuf help file-let snd_buf = control kr "buf" 0+let snd_buf = control kr "buf" 100 rec_buf = control kr "rec" 10 fft_buf = localBufId 'α' 1 1024 x = mouseX kr 0 1 Linear 0.2
Help/Ugen/pv_BinScramble.help.hs view
@@ -1,5 +1,5 @@ -- pv_BinScramble-let b = control kr "buf" 0+let b = control kr "buf" 100 a = playBuf 1 ar b (bufRateScale kr b) 1 0 Loop DoNothing f = fft' (localBufId 'α' 2048 1) a x = mouseX kr 0.0 1.0 Linear 0.1
Help/Ugen/pv_Diffuser.help.hs view
@@ -1,5 +1,5 @@ -- pv_Diffuser ; trigger revised phase shifts with MouseX crossing center of screen-let b = control kr "buf" 0+let b = control kr "buf" 100 z = playBuf 1 ar b (bufRateScale kr b) 0 0 Loop DoNothing f = fft' (localBufId 'α' 2048 1) z x = mouseX kr 0 1 Linear 0.1
Help/Ugen/pv_MagFreeze.help.hs view
@@ -1,5 +1,5 @@ -- pv_MagFreeze ; mouseX is trigger to freeze-let b = control kr "buf" 0+let b = control kr "buf" 100 z = playBuf 1 ar b (bufRateScale kr b) 0 0 Loop DoNothing f = fft' (localBufId 'α' 2048 1) z x = mouseX kr 0 1 Linear 0.1
Help/Ugen/pv_SpectralMap.help.hs view
@@ -1,7 +1,7 @@ -- pv_SpectralMap let y = mouseY kr (-1) 1 Linear 0.2 x = mouseX kr (-1) 1 Linear 0.2- b = control kr "buf" 0+ b = control kr "buf" 100 c1 = fft' (localBufId 'α' 2048 1) (soundIn 0) c2 = fft' (localBufId 'β' 2048 1) (playBuf 1 ar b 1 1 0 Loop DoNothing) c3 = X.pv_SpectralMap c1 c2 0.0 y x 1 0
Help/Ugen/rSmplrIndex.help.hs view
@@ -45,8 +45,8 @@ hsc3-smplr load pf --dyn=008 --b0=100 ---- ; load SFZ sample data-import Sound.OSC {- hosc -}-import Sound.Sc3.Data.SFZ {- hsc3-data -}+import Sound.Osc {- hosc -}+import Sound.Sc3.Data.Sfz {- hsc3-data -} sfz_fn = sfResolve "instr/bosendorfer/008.sfz" sfz_fn = sfResolve "instr/farfisa/aad/dolce-8.sfz" sfz_fn = sfResolve "instr/casacota/zell_1737_415_MeanTone5/8_i.sfz"
Help/Ugen/radiansPerSample.help.hs view
@@ -1,2 +1,3 @@ -- radiansPerSample ; two pi divided by the nominal sample rate (ie. a very small number)-let f = mce2 radiansPerSample ((2 * pi) / sampleRate) * 5000000 in sinOsc ar f 0 * 0.1+let f = mce2 radiansPerSample ((2 * pi) / sampleRate) * 5000000+in sinOsc ar f 0 * 0.1
Help/Ugen/select.help.hs view
@@ -26,7 +26,7 @@ in saw ar f * 0.1 -- select ; buffer segment player ; requires=buf-let (buf, nc) = (control kr "buf" 0, 2)+let (buf, nc) = (control kr "buf" 100, 2) n_segments = control_m kr "nseg" 32 (1, 64, "lin") sel = control_m kr "sel" 0 (0,3,"lin") buf_size = bufFrames kr buf
Help/Ugen/shufflerB.help.hs view
@@ -1,22 +1,22 @@ -- playBuf ; check buffer-let b = control kr "buf" 0+let b = control kr "buf" 100 s = bufRateScale kr b in playBuf 1 ar b s 1 0 NoLoop RemoveSynth * 0.1 -- shufflerB ; static-let b = control kr "buf" 0+let b = control kr "buf" 100 in X.shufflerB b 0 0.05 0.95 1.05 0.035 0.05 0.1 0.2 0.4 0.6 0.4 0.6 0 1 0.005 0.01 1 0 0 -- shufflerB ; static, quantized-let b = control kr "buf" 0+let b = control kr "buf" 100 in X.shufflerB b 0 1 0.5 2 0.025 0.075 0.2 0.6 0.1 0.9 0.1 0.9 0 1 0.005 0.05 0 0.5 0.005 -- shufflerB ; static, pointilist-let b = control kr "buf" 0+let b = control kr "buf" 100 in X.shufflerB b 0.4 0.5 0.5 2 0.05 0.15 0.2 0.5 0.3 0.7 0.3 0.7 0 1 0.05 0.25 0 0 0 -- shufflerB ; controls-let b = control_m kr "buf" 0 (0,10,"lin")+let b = control_m kr "buf" 100 (0,10,"lin") k nm def = control_m kr nm def k2 nm (d1,d2) = control_rng kr nm (d1,d2) k2_mul m (c1,c2) = (c1 * m,c2 * m)
Help/Ugen/sinOsc.help.hs view
@@ -137,9 +137,6 @@ o3 = pulse ar (1/4) 0.5 in (o1 + o2 + o3) * 0.1 --- jh ; <https://scsynth.org/t/auditory-illusion-with-exponentially-spaced-frequencies/4157>-mix (sinOsc ar (300 * mce (map (4 **) (take 200 [0, 0.002 ..]))) 0 * 0.02)- -- sinOsc ; https://scsynth.org/t/what-kind-of-synthesis-is-this/4318/30 let mratio = 4 amp = 0.2
Help/Ugen/squiz.help.hs view
@@ -12,7 +12,7 @@ in X.squiz (soundIn 0) x y 0.1 * 0.1 -- squiz ; of buffer ; requires=buf-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) zmax = 100 s = sinOsc ar 440 0 x = mouseX kr 1 10 Exponential 0.2
Help/Ugen/stkInst.help.hs view
@@ -116,4 +116,4 @@ in mix (voicer 16 f) * control kr "gain" 1 ---- ; set globals-X.stkGlobals ar 1 1 (label "/home/rohan/opt/src/sc3-plugins/external_libraries/stk/rawwaves")+X.stkGlobals ar 1 1 (label "/home/rohan/opt/src/supercollider/sc3-plugins/external_libraries/stk/rawwaves")
Help/Ugen/sweep.help.hs view
@@ -5,14 +5,14 @@ in sinOsc ar f 0 * 0.2 -- sweep ; using sweep to index into a buffer ; requires=buf-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) x = mouseX kr 0.5 20 Exponential 0.1 t = impulse ar x 0 p = sweep ar t (bufSampleRate kr b) in bufRdL nc ar b p NoLoop -- sweep ; backwards, variable offset ; requires=buf-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) n = lfNoise0Id 'α' kr 15 x = mouseX kr 0.5 10 Exponential 0.1 t = impulse ar x 0@@ -21,7 +21,7 @@ in bufRdL nc ar b p NoLoop -- sweep ; raising rate ; requires=buf-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) x = mouseX kr 0.5 10 Exponential 0.1 t = impulse ar x 0 r = sweep ar t 2 + 0.5
Help/Ugen/tGrains.help.hs view
@@ -1,12 +1,12 @@ -- tGrains ; mouse control ; requires=buf-let b = control kr "buf" 0+let b = control kr "buf" 100 tRate = mouseY kr 2 200 Exponential 0.1 ctr = mouseX kr 0 (bufDur kr b) Linear 0.1 tr = impulse ar tRate 0 in tGrains 2 tr b 1 ctr (4 / tRate) 0 0.25 2 -- tGrains ; mouse control ; requires=buf-let b = control kr "buf" 0+let b = control kr "buf" 100 rt = mouseY kr 8 120 Exponential 0.1 dur = 4 / rt clk = dustId 'α' ar rt@@ -17,7 +17,7 @@ in tGrains 2 clk b 1 pos dur pan 0.25 2 -- tGrains ; mouse control ; requires=buf-let b = control kr "buf" 0+let b = control kr "buf" 100 rt = mouseY kr 2 120 Exponential 0.1 dur = 1.2 / rt clk = impulse ar rt 0@@ -30,7 +30,7 @@ -- tGrains ; demand UGens as inputs ; requires=buf -- ; (Warning: empty sequence in Dseq - ServerId 'localhost' exited with exit code 0) -- ; (also at sclang graph)-let b = control kr "buf" 0+let b = control kr "buf" 100 rt = mouseX kr 1 100 Exponential 0.2 dId uid = dwhiteId uid 1 0.1 0.2 zId u0 u1 u2 u3 u4 u5 u6 u7 = drandId u1 1 (mce [dgeomId u2 (diwhiteId u3 1 20 40) 0.1 (1 + dId u4)@@ -48,7 +48,7 @@ -- ; http://sc-users.bham.ac.narkive.com/sj4Tw3ub/sync-osc#post5 (jmcc) -- ; "A wavetable windowed sync oscillator could be written. -- ; You can actually do a version of this with TGrains."-let b = control kr "buf" 0+let b = control kr "buf" 100 freq = 100 dur = 2 / freq clk = impulse ar freq 0@@ -57,7 +57,7 @@ -- tGrains ; requires=buf ; event control let f (_,g,x,y,z,o,rx,ry,_,_,_) =- let b = control kr "buf" 0+ let b = control kr "buf" 100 tRate = linExp y 0 1 2 200 ctr = x * bufDur kr b du = (ry * 8) / tRate
Help/Ugen/warp1.help.hs view
@@ -1,5 +1,5 @@ -- warp1 ; requires=buf ; interp=2=linear ; nc=2-let (b, nc) = (control kr "buf" 0, 2)+let (b, nc) = (control kr "buf" 100, 2) p = linLin (lfSaw kr 0.05 0) (-1) 1 0 1 x = mouseX kr 0.5 2 Linear 0.1 in warp1 nc b p x 0.1 (-1) 8 0.1 2 * 0.5@@ -18,7 +18,7 @@ -- warp1 ; requires=buf ; event control let f (_,g,x,y,z,o,rx,ry,_,_,_) =- let b = control kr "buf" 0+ let b = control kr "buf" 100 p = linLin (lfSaw kr 0.05 0) (-1) 1 0 1 dur = linLin y 0 1 0.01 0.2 freqScale = linLin ry 0 1 0.75 1.25
README.md view
@@ -11,39 +11,39 @@ [hosc](http://rohandrape.net/?t=hosc). There is an-[introduction](http://rohandrape.net/?t=hsc3-texts&e=lhs/hsc3-introduction.lhs)+[introduction](http://rohandrape.net/?t=hsc3-texts&e=1.1-introduction.md) and a-[tutorial](http://rohandrape.net/?t=hsc3-texts&e=lhs/hsc3-tutorial.lhs)+[tutorial](http://rohandrape.net/?t=hsc3-texts&e=2.1-tutorial.md) at [hsc3-texts](http://rohandrape.net/?t=hsc3-texts). There are a number of related projects: -- [sc3-rdu](http://rohandrape.net/?t=sc3-rdu): SuperCollider UGens (1998)-- [rsc3](http://rohandrape.net/?t=rsc3): Scheme SuperCollider (2004)-- [hsc3-dot](http://rohandrape.net/?t=hsc3-dot): UGen graph drawing (2006)-- [hsc3-graphs](http://rohandrape.net/?t=hsc3-graphs): UGen graph collection (2006)-- [hsc3-db](http://rohandrape.net/?t=hsc3-db): UGen Database (2006)-- [hsc3-sf](http://rohandrape.net/?t=hsc3-sf): Sound file IO (2006)-- [hsc3-unsafe](http://rohandrape.net/?t=hsc3-unsafe): Unsafe UGen variants (2006)-- [hsc3-lang](http://rohandrape.net/?t=hsc3-lang): SC3 language (2007)-- [hsc3-rec](http://rohandrape.net/?t=hsc3-rec): Record UGens (2008)-- [smlsc3](http://rohandrape.net/?t=smlsc3): Standard ML SuperCollider (2008)-- [hsc3-sf-hsndfile](http://rohandrape.net/?t=hsc3-sf-hsndfile): Sound file IO (libsndfile) (2010)-- [hsc3-auditor](http://rohandrape.net/?t=hsc3-auditor): Simple sound event auditioner (2010)-- [hsc3-cairo](http://rohandrape.net/?t=hsc3-cairo): Drawing (2012)+- [hsc3-util](http://rohandrape.net/?t=hsc3-util): hsc3 & related utilities (2020)+- [stsc3](http://rohandrape.net/?t=stsc3): Smalltalk SuperCollider (2019)+- [hsc3-m](http://rohandrape.net/?t=hsc3-m): UGen variants (2018)+- [hsc3-forth](http://rohandrape.net/?t=hsc3-forth): Forth SuperCollider (2014)+- [hsc3-lisp](http://rohandrape.net/?t=hsc3-lisp): Lisp SuperCollider (2014) - [hsc3-plot](http://rohandrape.net/?t=hsc3-plot): Plotting (2013) - [hsc3-data](http://rohandrape.net/?t=hsc3-data): Data formats &etc. (2013) - [hsc3-rw](http://rohandrape.net/?t=hsc3-rw): UGen Graph Re-writing (2013)-- [hsc3-forth](http://rohandrape.net/?t=hsc3-forth): Forth SuperCollider (2014)-- [hsc3-lisp](http://rohandrape.net/?t=hsc3-lisp): Lisp SuperCollider (2014)-- [hsc3-m](http://rohandrape.net/?t=hsc3-m): UGen variants (2018)-- [stsc3](http://rohandrape.net/?t=stsc3): Smalltalk SuperCollider (2019)-- [hsc3-util](http://rohandrape.net/?t=hsc3-util): hsc3 & related utilities (2020)+- [hsc3-cairo](http://rohandrape.net/?t=hsc3-cairo): Drawing (2012)+- [hsc3-sf-hsndfile](http://rohandrape.net/?t=hsc3-sf-hsndfile): Sound file Io (libsndfile) (2010)+- [hsc3-auditor](http://rohandrape.net/?t=hsc3-auditor): Simple sound event auditioner (2010)+- [hsc3-rec](http://rohandrape.net/?t=hsc3-rec): Record UGens (2008)+- [smlsc3](http://rohandrape.net/?t=smlsc3): Standard Ml SuperCollider (2008)+- [hsc3-lang](http://rohandrape.net/?t=hsc3-lang): SC3 language (2007)+- [hsc3-graphs](http://rohandrape.net/?t=hsc3-graphs): UGen graph collection (2006)+- [hsc3-db](http://rohandrape.net/?t=hsc3-db): UGen Database (2006)+- [hsc3-dot](http://rohandrape.net/?t=hsc3-dot): UGen graph drawing (2006)+- [hsc3-sf](http://rohandrape.net/?t=hsc3-sf): Sound file Io (2006)+- [hsc3-unsafe](http://rohandrape.net/?t=hsc3-unsafe): Unsafe UGen variants (2006)+- [rsc3](http://rohandrape.net/?t=rsc3): Scheme SuperCollider (2004)+- [sc3-rdu](http://rohandrape.net/?t=sc3-rdu): SuperCollider UGens (1998) The hsc3 interaction environment ([hsc3.el](http://rohandrape.net/?t=hsc3&e=emacs/hsc3.el)) is written for-[GNU](http://gnu.org/)+[Gnu](http://gnu.org/) [Emacs](http://gnu.org/software/emacs/). <!--@@ -52,26 +52,34 @@ ## help -[UGen Index](http://rohandrape.net/?t=hsc3&e=Help/UGen/ix.md)+[UGen Index](http://rohandrape.net/?t=hsc3&e=Help/Ugen/ix.md) ©-[rohan drape](http://rohandrape.net/)-and others, 2005-2022,-[gpl-3](http://gnu.org/copyleft/)+[Rohan Drape](http://rohandrape.net/)+and others, 2005-2024,+[Gpl-3](http://gnu.org/copyleft/) -with contributions by:+With contributions by: -- henning thielemann-- stefan kersten-- alex mclean-- brent yorgey-- shae erisson+- Henning Thielemann+- Stefan Kersten+- Alex McLean+- Brent Yorgey+- Shae Erisson -see the+See the [git](https://git-scm.com/) [history](http://rohandrape.net/?t=hsc3&q=history) for details -initial announcement:+Initial announcement: [[2005-11-29/haskell-cafe](http://rohandrape.net/?t=hsc3&e=md/announce.text), [haskell.org](http://www.haskell.org/pipermail/haskell-cafe/2005-November/012483.html)]++* * *++```+$ doctest Sound/Sc3+Examples: 370 Tried: 370 Errors: 0 Failures: 0+$+```
Sound/Sc3.hs view
@@ -1,5 +1,6 @@--- | Composite of "Sound.Sc3.Common", "Sound.Sc3.Server.Monad",--- "Sound.Sc3.Ugen" and "Sound.Sc3.Ugen.Bindings".+{- | Composite of "Sound.Sc3.Common", "Sound.Sc3.Server.Monad",+"Sound.Sc3.Ugen" and "Sound.Sc3.Ugen.Bindings".+-} module Sound.Sc3 (module M) where import Sound.Sc3.Common as M
Sound/Sc3/Common/Base.hs view
@@ -6,6 +6,8 @@ import Data.Maybe {- base -} import Data.Ord {- base -} +import qualified Safe {- safe -}+ -- * Function -- | Unary function.@@ -32,10 +34,14 @@ -- | 11-parameter function. type Fn11 a b c d e f g h i j k l = a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l --- | Apply /f/ n times, ie. iterate f x !! n------ > iter 3 (* 2) 1 == 8--- > iterate (* 2) 1 !! 3 == 8+{- | Apply /f/ n times, ie. iterate f x !! n++>>> iter 3 (* 2) 1+8++>>> iterate (* 2) 1 !! 3+8+-} iter :: Int -> (a -> a) -> a -> a iter n f x = if n == 0 then x else f (iter (n - 1) f x) @@ -50,167 +56,214 @@ -- | Variant of 'reads' requiring exact match. reads_exact :: Read a => String -> Maybe a reads_exact s =- case reads s of- [(r,"")] -> Just r- _ -> Nothing+ case reads s of+ [(r, "")] -> Just r+ _ -> Nothing -- * String {- | Similar to Data.List.Split.splitOn, which however hugs doesn't know of. -> string_split_at_char ':' "/usr/local/bin:/usr/bin:/bin" == ["/usr/local/bin","/usr/bin","/bin"]-> string_split_at_char ':' "/usr/local/bin" == ["/usr/local/bin"]+>>> string_split_at_char ':' "/usr/local/bin:/usr/bin:/bin"+["/usr/local/bin","/usr/bin","/bin"]++>>> string_split_at_char ':' "/usr/local/bin"+["/usr/local/bin"] -} string_split_at_char :: Char -> String -> [String] string_split_at_char c s = case break (== c) s of- (lhs,[]) -> [lhs]- (lhs,_:rhs) -> lhs : string_split_at_char c rhs+ (lhs, []) -> [lhs]+ (lhs, _ : rhs) -> lhs : string_split_at_char c rhs -- * String / Case -- | Ci = Case insensitive, Cs = case sensitive, Sci = separator & case insensitive data Case_Rule = Ci | Cs | Sci deriving (Eq) +string_op :: (String -> String -> t) -> Case_Rule -> String -> String -> t+string_op f cr x y =+ let ci_form = map toLower+ sci_form = filter (`notElem` "-_") . ci_form+ in case cr of+ Ci -> f (ci_form x) (ci_form y)+ Cs -> f x y+ Sci -> f (sci_form x) (sci_form y)+ {- | String equality with 'Case_Rule'. -> string_eq Ci "sinOsc" "SinOsc" == True-> string_eq Sci "sin-osc" "SinOsc" == True+>>> string_eq Ci "sinOsc" "SinOsc"+True++>>> string_eq Sci "sin-osc" "SinOsc"+True -} string_eq :: Case_Rule -> String -> String -> Bool-string_eq cr x y =- let ci_form = map toLower- sci_form = filter (`notElem` "-_") . ci_form- in case cr of- Ci -> ci_form x == ci_form y- Cs -> x == y- Sci -> sci_form x == sci_form y+string_eq = string_op (==) +string_cmp :: Case_Rule -> String -> String -> Ordering+string_cmp = string_op compare+ -- | 'rlookup_by' of 'string_eq'.-rlookup_str :: Case_Rule -> String -> [(a,String)] -> Maybe a+rlookup_str :: Case_Rule -> String -> [(a, String)] -> Maybe a rlookup_str = rlookup_by . string_eq {- | 'Enum' parser with 'Case_Rule'. -> parse_enum Ci "false" == Just False+>>> parse_enum Ci "false" :: Maybe Bool+Just False -}-parse_enum :: (Show t,Enum t,Bounded t) => Case_Rule -> String -> Maybe t+parse_enum :: (Show t, Enum t, Bounded t) => Case_Rule -> String -> Maybe t parse_enum cr nm =- let u = [minBound .. maxBound]- t = zip (map show u) u- in lookup_by (string_eq cr) nm t+ let u = [minBound .. maxBound]+ t = zip (map show u) u+ in lookup_by (string_eq cr) nm t -- * List --- | Left to right composition of a list of functions.------ > compose_l [(* 2),(+ 1)] 3 == 7+{- | Left to right composition of a list of functions.++>>> compose_l [(* 2),(+ 1)] 3+7+-} compose_l :: [t -> t] -> t -> t compose_l = flip (foldl (\x f -> f x)) --- | Right to left composition of a list of functions.------ > compose_r [(* 2),(+ 1)] 3 == 8+{- | Right to left composition of a list of functions.++>>> compose_r [(* 2),(+ 1)] 3+8+-} compose_r :: [t -> t] -> t -> t compose_r = flip (foldr ($)) {- | SequenceableCollection.differentiate -> > [3,4,1,1].differentiate == [3,1,-3,0]+> [3,4,1,1].differentiate == [3,1,-3,0] -> d_dx [3,4,1,1] == [3,1,-3,0]-> d_dx [0,1,3,6] == [0,1,2,3]+>>> d_dx [3,4,1,1]+[3,1,-3,0]++>>> d_dx [0,1,3,6]+[0,1,2,3] -} d_dx :: (Num a) => [a] -> [a]-d_dx l = zipWith (-) l (0:l)+d_dx l = zipWith (-) l (0 : l) {- | Variant that does not prepend zero to input, ie. 'tail' of 'd_dx'. -> d_dx' [3,4,1,1] == [1,-3,0]-> d_dx' [0,1,3,6] == [1,2,3]+>> d_dx' [3,4,1,1]+[1,-3,0]++>>> d_dx' [0,1,3,6]+[1,2,3] -} d_dx' :: Num n => [n] -> [n]-d_dx' l = zipWith (-) (tail l) l+d_dx' l = zipWith (-) (Safe.tailNote "d_dx'" l) l {- | SequenceableCollection.integrate -> > [3,4,1,1].integrate == [3,7,8,9]+> [3,4,1,1].integrate == [3,7,8,9] -> dx_d [3,4,1,1] == [3,7,8,9]-> dx_d (d_dx [0,1,3,6]) == [0,1,3,6]-> dx_d [0.5,0.5] == [0.5,1]+>>> dx_d [3,4,1,1]+[3,7,8,9]++>>> dx_d (d_dx [0,1,3,6])+[0,1,3,6]++>>> dx_d [0.5,0.5]+[0.5,1.0] -} dx_d :: Num n => [n] -> [n] dx_d = scanl1 (+) {- | Variant pre-prending zero to output. -> dx_d' [3,4,1,1] == [0,3,7,8,9]-> dx_d' (d_dx' [0,1,3,6]) == [0,1,3,6]-> dx_d' [0.5,0.5] == [0,0.5,1]+>>> dx_d' [3,4,1,1]+[0,3,7,8,9]++>>> dx_d' (d_dx' [0,1,3,6])+[0,1,3,6]++>>> dx_d' [0.5,0.5]+[0.0,0.5,1.0] -} dx_d' :: Num n => [n] -> [n] dx_d' = (0 :) . dx_d -- | 'lookup' with equality function.-lookup_by :: (a -> t -> Bool) -> a -> [(t,b)] -> Maybe b+lookup_by :: (a -> t -> Bool) -> a -> [(t, b)] -> Maybe b lookup_by f x = fmap snd . find (f x . fst) +-- | Erroring variant, with message.+lookup_by_note :: String -> (a -> t -> Bool) -> a -> [(t, b)] -> b+lookup_by_note msg f x = fromMaybe (error ("lookup_by: " ++ msg)) . lookup_by f x+ -- | Erroring variant.-lookup_by_err :: (a -> t -> Bool) -> a -> [(t,b)] -> b-lookup_by_err f x = fromMaybe (error "lookup_by") . lookup_by f x+lookup_by_err :: (a -> t -> Bool) -> a -> [(t, b)] -> b+lookup_by_err = lookup_by_note "error" -- | Reverse 'lookup' with equality function.-rlookup_by :: (b -> b -> Bool) -> b -> [(a,b)] -> Maybe a+rlookup_by :: (b -> b -> Bool) -> b -> [(a, b)] -> Maybe a rlookup_by f x = fmap fst . find (f x . snd) --- | (prev,cur,next) triples.------ > pcn_triples [1..3] == [(Nothing,1,Just 2),(Just 1,2,Just 3),(Just 2,3,Nothing)]-pcn_triples :: [a] -> [(Maybe a,a,Maybe a)]+{- | (prev,cur,next) triples.++>>> pcn_triples [1..3]+[(Nothing,1,Just 2),(Just 1,2,Just 3),(Just 2,3,Nothing)]+-}+pcn_triples :: [a] -> [(Maybe a, a, Maybe a)] pcn_triples =- let f e l = case l of- e1 : e2 : l' -> (e,e1,Just e2) : f (Just e1) (e2 : l')- [e'] -> [(e,e',Nothing)]- [] -> undefined- in f Nothing+ let f e l = case l of+ e1 : e2 : l' -> (e, e1, Just e2) : f (Just e1) (e2 : l')+ [e'] -> [(e, e', Nothing)]+ [] -> undefined+ in f Nothing --- | Separate first list element.------ > sep_first "astring" == Just ('a',"string")-sep_first :: [t] -> Maybe (t,[t])+{- | Separate first list element.++>>> sep_first "astring"+Just ('a',"string")+-}+sep_first :: [t] -> Maybe (t, [t]) sep_first l =- case l of- e:l' -> Just (e,l')- _ -> Nothing+ case l of+ e : l' -> Just (e, l')+ _ -> Nothing --- | Separate last list element.------ > sep_last "stringb" == Just ("string",'b')+{- | Separate last list element.++>>> sep_last "stringb"+Just ("string",'b')+-} sep_last :: [t] -> Maybe ([t], t) sep_last =- let f (e,l) = (reverse l,e)- in fmap f . sep_first . reverse+ let f (e, l) = (reverse l, e)+ in fmap f . sep_first . reverse --- | Are lists of equal length?------ > equal_length_p ["t1","t2"] == True--- > equal_length_p ["t","t1","t2"] == False+{- | Are lists of equal length?++>>> equal_length_p ["t1","t2"]+True++>>> equal_length_p ["t","t1","t2"]+False+-} equal_length_p :: [[a]] -> Bool equal_length_p = (== 1) . length . nub . map length -- | Histogram-histogram :: Ord a => [a] -> [(a,Int)]+histogram :: Ord a => [a] -> [(a, Int)] histogram x =- let g = group (sort x)- in zip (map head g) (map length g)+ let g = group (sort x)+ in zip (map (Safe.headNote "histogram") g) (map length g) -- | !! with localised error message at_with_error_message :: String -> [t] -> Int -> t at_with_error_message msg list index = if index >= length list- then error ("!!: index out of range: " ++ msg)- else list !! index+ then error ("!!: index out of range: " ++ msg)+ else list !! index -- | concat of intersperse. This is the same function as intercalate, which hugs doesn't know of. concat_intersperse :: [a] -> [[a]] -> [a]@@ -218,92 +271,99 @@ {- | Similar to Data.List.Split.splitOn, which however hugs doesn't know of. -> list_split_at_elem ' ' "a sequence of words" == ["a","sequence","of","words"]+>>> list_split_at_elem ' ' "a sequence of words"+["a","sequence","of","words"] -} list_split_at_elem :: Eq t => t -> [t] -> [[t]] list_split_at_elem c s = case break (== c) s of- (lhs,[]) -> [lhs]- (lhs,_:rhs) -> lhs : list_split_at_elem c rhs+ (lhs, []) -> [lhs]+ (lhs, _ : rhs) -> lhs : list_split_at_elem c rhs {- | Data.List.sortOn, which however hugs does not know of. -> sort_on snd [('a',1),('b',0)] == [('b',0),('a',1)]+>>> sort_on snd [('a',1),('b',0)]+[('b',0),('a',1)] -} sort_on :: (Ord b) => (a -> b) -> [a] -> [a] sort_on = sortBy . comparing {- | Inserts at the first position where it compares less but not equal to the next element. -> import Data.Function {- base -}-> insertBy (compare `on` fst) (3,'x') (zip [1..5] ['a'..])-> insertBy_post (compare `on` fst) (3,'x') (zip [1..5] ['a'..])+>>> import Data.Function+>>> insertBy (compare `on` fst) (3,'x') (zip [1..5] ['a'..])+[(1,'a'),(2,'b'),(3,'x'),(3,'c'),(4,'d'),(5,'e')]++>>> insertBy_post (compare `on` fst) (3,'x') (zip [1..5] ['a'..])+[(1,'a'),(2,'b'),(3,'c'),(3,'x'),(4,'d'),(5,'e')] -} insertBy_post :: (a -> a -> Ordering) -> a -> [a] -> [a] insertBy_post cmp e l =- case l of- [] -> [e]- h:l' -> case cmp e h of- LT -> e : l- _ -> h : insertBy_post cmp e l'+ case l of+ [] -> [e]+ h : l' -> case cmp e h of+ LT -> e : l+ _ -> h : insertBy_post cmp e l' -- | 'insertBy_post' using 'compare'. insert_post :: Ord t => t -> [t] -> [t] insert_post = insertBy_post compare --- | Apply /f/ at all but last element, and /g/ at last element.------ > at_last (* 2) negate [1..4] == [2,4,6,-4]+{- | Apply /f/ at all but last element, and /g/ at last element.++>>> at_last (* 2) negate [1..4]+[2,4,6,-4]+-} at_last :: (a -> b) -> (a -> b) -> [a] -> [b] at_last f g x =- case x of- [] -> []- [i] -> [g i]- i:x' -> f i : at_last f g x'+ case x of+ [] -> []+ [i] -> [g i]+ i : x' -> f i : at_last f g x' -- * Tuples -- | Zip two 4-tuples.-p4_zip :: (a,b,c,d) -> (e,f,g,h) -> ((a,e),(b,f),(c,g),(d,h))-p4_zip (a,b,c,d) (e,f,g,h) = ((a,e),(b,f),(c,g),(d,h))+p4_zip :: (a, b, c, d) -> (e, f, g, h) -> ((a, e), (b, f), (c, g), (d, h))+p4_zip (a, b, c, d) (e, f, g, h) = ((a, e), (b, f), (c, g), (d, h)) -- | Two-tuple.-type T2 a = (a,a)+type T2 a = (a, a) -- | Three-tuple.-type T3 a = (a,a,a)+type T3 a = (a, a, a) -- | Four-tuple.-type T4 a = (a,a,a,a)+type T4 a = (a, a, a, a) -- | t -> (t,t) dup2 :: t -> T2 t-dup2 t = (t,t)+dup2 t = (t, t) -- | t -> (t,t,t) dup3 :: t -> T3 t-dup3 t = (t,t,t)+dup3 t = (t, t, t) -- | t -> (t,t,t,t) dup4 :: t -> T4 t-dup4 t = (t,t,t,t)+dup4 t = (t, t, t, t) -- | 'concatMap' of /f/ at /x/ and /g/ at /y/. mk_duples :: (a -> c) -> (b -> c) -> [(a, b)] -> [c]-mk_duples a b = concatMap (\(x,y) -> [a x, b y])+mk_duples a b = concatMap (\(x, y) -> [a x, b y]) -- | Length prefixed list variant of 'mk_duples'.-mk_duples_l :: (Int -> c) -> (a -> c) -> (b -> c) -> [(a,[b])] -> [c]-mk_duples_l i a b = concatMap (\(x,y) -> a x : i (length y) : map b y)+mk_duples_l :: (Int -> c) -> (a -> c) -> (b -> c) -> [(a, [b])] -> [c]+mk_duples_l i a b = concatMap (\(x, y) -> a x : i (length y) : map b y) -- | 'concatMap' of /f/ at /x/ and /g/ at /y/ and /h/ at /z/. mk_triples :: (a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d]-mk_triples a b c = concatMap (\(x,y,z) -> [a x, b y, c z])+mk_triples a b c = concatMap (\(x, y, z) -> [a x, b y, c z]) -- | [x,y] -> (x,y) t2_from_list :: [t] -> T2 t-t2_from_list l = case l of {[p,q] -> (p,q);_ -> error "t2_from_list"}+t2_from_list l = case l of [p, q] -> (p, q); _ -> error "t2_from_list" -- | [x,y,z] -> (x,y,z)-t3_from_list :: [t] -> (t,t,t)-t3_from_list l = case l of {[p,q,r] -> (p,q,r);_ -> error "t3_from_list"}+t3_from_list :: [t] -> (t, t, t)+t3_from_list l = case l of [p, q, r] -> (p, q, r); _ -> error "t3_from_list"
Sound/Sc3/Common/Base/System.hs view
@@ -6,7 +6,8 @@ {- | 'getEnv' with error handler to return default value. This almost works in hugs (IOException should be Exception, the signature can be elided) -> get_env_with_default "undefined_environment_variable" "default" -- > "default"+>>> get_env_with_default "undefined_environment_variable" "default"+"default" -} get_env_with_default :: String -> String -> IO String get_env_with_default variableName defaultValue =
Sound/Sc3/Common/Buffer.hs view
@@ -7,159 +7,202 @@ {- | /z/ ranges from 0 (for /i/) to 1 (for /j/). -> > 1.5.blend(2.0,0.50) == 1.75-> > 1.5.blend(2.0,0.75) == 1.875+> 1.5.blend(2.0,0.50)+1.75+> 1.5.blend(2.0,0.75)+1.875 -> blend 0.50 1.5 2 == 1.75-> blend 0.75 1.5 2 == 1.875+>>> blend 0.50 1.5 2+1.75++>>> blend 0.75 1.5 2+1.875 -} blend :: Num a => a -> a -> a -> a blend z i j = i + (z * (j - i)) --- | Variant of '(!!)' but values for index greater than the size of--- the collection will be clipped to the last index.------ > map (\x -> clipAt x "abc") [-1,0,1,2,3] == "aabcc"+{- | Variant of '(!!)' but values for index greater than the size of the collection will be clipped to the last index.++>>> map (\x -> clipAt x "abc") [-1,0,1,2,3]+"aabcc"+-} clipAt :: Int -> [a] -> a clipAt ix c = if ix > length c - 1 then last c else if ix < 0 then c !! 0 else c !! ix -- | 'blendAt' with @clip@ function as argument.-blendAtBy :: (Integral i,RealFrac n) => (i -> t -> n) -> n -> t -> n+blendAtBy :: (Integral i, RealFrac n) => (i -> t -> n) -> n -> t -> n blendAtBy f ix c =- let m = floor ix- m' = fromIntegral m- in blend (S.absdif ix m') (f m c) (f (m + 1) c)+ let m = floor ix+ m' = fromIntegral m+ in blend (S.absdif ix m') (f m c) (f (m + 1) c) --- | @SequenceableCollection.blendAt@ returns a linearly interpolated--- value between the two closest indices. Inverse operation is--- 'indexInBetween'.------ > > [2,5,6].blendAt(0.4) == 3.2------ > blendAt 0 [2,5,6] == 2--- > blendAt 0.4 [2,5,6] == 3.2+{- | @SequenceableCollection.blendAt@ returns a linearly interpolated value between the two closest indices.+Inverse operation is 'indexInBetween'.++> [2,5,6].blendAt(0.4)+3.2++>>> blendAt 0 [2,5,6]+2.0+>>> blendAt 0.4 [2,5,6]+3.2+-} blendAt :: RealFrac a => a -> [a] -> a blendAt = blendAtBy clipAt --- | Resampling function, /n/ is destination length, /r/ is source--- length, /f/ is the indexing function, /c/ is the collection.-resamp1_gen :: (Integral i,RealFrac n) => i -> i -> (i -> t -> n) -> t -> i -> n+-- | Resampling function, /n/ is destination length, /r/ is source length, /f/ is the indexing function, /c/ is the collection.+resamp1_gen :: (Integral i, RealFrac n) => i -> i -> (i -> t -> n) -> t -> i -> n resamp1_gen n r f c =- let n' = fromIntegral n- fwd = (fromIntegral r - 1) / (n' - 1)- gen i = blendAtBy f (fromIntegral i * fwd) c- in gen+ let n' = fromIntegral n+ fwd = (fromIntegral r - 1) / (n' - 1)+ gen i = blendAtBy f (fromIntegral i * fwd) c+ in gen --- | @SequenceableCollection.resamp1@ returns a new collection of the--- desired length, with values resampled evenly-spaced from the--- receiver with linear interpolation.------ > > [1].resamp1(3) == [1,1,1]--- > > [1,2,3,4].resamp1(12)--- > > [1,2,3,4].resamp1(3) == [1,2.5,4]------ > resamp1 3 [1] == [1,1,1]--- > resamp1 12 [1,2,3,4]--- > resamp1 3 [1,2,3,4] == [1,2.5,4]+{- | @SequenceableCollection.resamp1@ returns a new collection of the desired length, with values resampled evenly-spaced from the receiver with linear interpolation.++> [1].resamp1(3) == [1,1,1]+> [1,2,3,4].resamp1(12)+> [1,2,3,4].resamp1(3) == [1,2.5,4]++>>> resamp1 3 [1]+[1.0,1.0,1.0]++>>> resamp1 7 [1,2,3,4]+[1.0,1.5,2.0,2.5,3.0,3.5,4.0]++>>> resamp1 3 [1,2,3,4]+[1.0,2.5,4.0]+-} resamp1 :: RealFrac n => Int -> [n] -> [n] resamp1 n c =- let gen = resamp1_gen n (length c) clipAt c- in map gen [0 .. n - 1]+ let gen = resamp1_gen n (length c) clipAt c+ in map gen [0 .. n - 1] --- | @ArrayedCollection.normalizeSum@ ensures sum of elements is one.------ > > [1,2,3].normalizeSum == [1/6,1/3,0.5]--- > normalizeSum [1,2,3] == [1/6,2/6,3/6]+{- | @ArrayedCollection.normalizeSum@ ensures sum of elements is one.++> [1,2,3].normalizeSum == [1/6,1/3,0.5]++>>> normalizeSum [1,2,3] == [1/6,2/6,3/6]+True+-} normalizeSum :: (Fractional a) => [a] -> [a] normalizeSum l = let n = sum l in map (/ n) l -- | Variant that specifies range of input sequence separately.-normalise_rng :: Fractional n => (n,n) -> (n,n) -> [n] -> [n]-normalise_rng (il,ir) (l,r) = map (\e -> S.sc3_linlin e il ir l r)+normalise_rng :: Fractional n => (n, n) -> (n, n) -> [n] -> [n]+normalise_rng (il, ir) (l, r) = map (\e -> S.sc3_linlin e il ir l r) --- | @ArrayedCollection.normalize@ returns a new Array with the receiver--- items normalized between min and max.------ > > [1,2,3].normalize == [0,0.5,1]--- > > [1,2,3].normalize(-20,10) == [-20,-5,10]------ > normalize 0 1 [1,2,3] == [0,0.5,1]--- > normalize (-20) 10 [1,2,3] == [-20,-5,10]+{- | @ArrayedCollection.normalize@ returns a new Array with the receiver items normalized between min and max.++> [1,2,3].normalize == [0,0.5,1]+> [1,2,3].normalize(-20,10) == [-20,-5,10]++>>> normalize 0 1 [1,2,3]+[0.0,0.5,1.0]++>>> normalize (-20) 10 [1,2,3]+[-20.0,-5.0,10.0]+-} normalize :: (Fractional n, Ord n) => n -> n -> [n] -> [n]-normalize l r c = normalise_rng (minimum c,maximum c) (l,r) c+normalize l r c = normalise_rng (minimum c, maximum c) (l, r) c --- | List of 2-tuples of elements at distance (stride) /n/.------ > t2_window 3 [1..9] == [(1,2),(4,5),(7,8)]-t2_window :: Integral i => i -> [t] -> [(t,t)]+{- | List of 2-tuples of elements at distance (stride) /n/.++>>> t2_window 3 [1..9]+[(1,2),(4,5),(7,8)]+-}+t2_window :: Integral i => i -> [t] -> [(t, t)] t2_window n x =- case x of- i:j:_ -> (i,j) : t2_window n (genericDrop n x)- _ -> []+ case x of+ i : j : _ -> (i, j) : t2_window n (genericDrop n x)+ _ -> [] --- | List of 2-tuples of adjacent elements.------ > t2_adjacent [1..6] == [(1,2),(3,4),(5,6)]--- > t2_adjacent [1..5] == [(1,2),(3,4)]-t2_adjacent :: [t] -> [(t,t)]-t2_adjacent = t2_window (2::Int)+{- | List of 2-tuples of adjacent elements. --- | List of 2-tuples of overlapping elements.------ > t2_overlap [1..4] == [(1,2),(2,3),(3,4)]-t2_overlap :: [b] -> [(b,b)]-t2_overlap x = zip x (tail x)+>>> t2_adjacent [1..6]+[(1,2),(3,4),(5,6)] --- | Concat of 2-tuples.------ > t2_concat (t2_adjacent [1..6]) == [1..6]--- > t2_concat (t2_overlap [1..4]) == [1,2,2,3,3,4]-t2_concat :: [(a,a)] -> [a]+>>> t2_adjacent [1..5]+[(1,2),(3,4)]+-}+t2_adjacent :: [t] -> [(t, t)]+t2_adjacent = t2_window (2 :: Int)++{- | List of 2-tuples of overlapping elements.++>>> t2_overlap [1..4]+[(1,2),(2,3),(3,4)]+-}+t2_overlap :: [b] -> [(b, b)]+t2_overlap x =+ case uncons x of+ Nothing -> error "t2_overlap"+ Just (_, t) -> zip x t++{- | Concat of 2-tuples.++>>> t2_concat (t2_adjacent [1..6])+[1,2,3,4,5,6]++>>> t2_concat (t2_overlap [1..4])+[1,2,2,3,3,4]+-}+t2_concat :: [(a, a)] -> [a] t2_concat x =- case x of- [] -> []- (i,j):x' -> i : j : t2_concat x'+ case x of+ [] -> []+ (i, j) : x' -> i : j : t2_concat x' {- | A Signal is half the size of a Wavetable, each element is the sum of two adjacent elements of the Wavetable. -> from_wavetable [-0.5,0.5,0,0.5,1.5,-0.5,1,-0.5] == [0.0,0.5,1.0,0.5]-> let s = [0,0.5,1,0.5] in from_wavetable (to_wavetable s) == s+>>> from_wavetable [-0.5,0.5,0,0.5,1.5,-0.5,1,-0.5]+[0.0,0.5,1.0,0.5]++>>> let s = [0,0.5,1,0.5]+>>> from_wavetable (to_wavetable s) == s+True -} from_wavetable :: Num n => [n] -> [n] from_wavetable = map (uncurry (+)) . t2_adjacent -{- | A Wavetable has n * 2 + 2 elements, where n is the number of elements of the Signal.+{- | A Wavetable has n * 2 elements, where n is the number of elements of the Signal. Each signal element e0 expands to the two elements (2 * e0 - e1, e1 - e0) where e1 is the next element, or zero at the final element. Properly wavetables are only of power of two element signals. -> > Signal[0,0.5,1,0.5].asWavetable == Wavetable[-0.5,0.5,0,0.5,1.5,-0.5,1,-0.5]-> to_wavetable [0,0.5,1,0.5] == [-0.5,0.5,0,0.5,1.5,-0.5,1,-0.5]+> Signal[0,0.5,1,0.5].asWavetable == Wavetable[-0.5,0.5,0,0.5,1.5,-0.5,1,-0.5]++>>> to_wavetable [0,0.5,1,0.5]+[-0.5,0.5,0.0,0.5,1.5,-0.5,1.0,-0.5] -} to_wavetable :: Num a => [a] -> [a]-to_wavetable = to_wavetable_nowrap . (++ [0])+to_wavetable = to_wavetable_nowrap . (++ [0]) --- | Shaper requires wavetables without wrap.------ > to_wavetable_nowrap [0,0.5,1,0.5] == [-0.5,0.5,0,0.5,1.5,-0.5]+{- | Shaper requires wavetables without wrap.++>>> to_wavetable_nowrap [0,0.5,1,0.5]+[-0.5,0.5,0.0,0.5,1.5,-0.5]+-} to_wavetable_nowrap :: Num a => [a] -> [a] to_wavetable_nowrap =- let f (e0,e1) = (2 * e0 - e1,e1 - e0)- in t2_concat . map f . t2_overlap+ let f (e0, e1) = (2 * e0 - e1, e1 - e0)+ in t2_concat . map f . t2_overlap {- | Variant of 'sineFill' that gives each component table. -> let t = sineGen 1024 (map recip [1, 2, 3, 5, 8, 13, 21, 34, 55]) (replicate 9 0)-> map length t == replicate 9 1024+>>> let t = sineGen 1024 (map recip [1, 2, 3, 5, 8, 13, 21, 34, 55]) (replicate 9 0)+>>> map length t == replicate 9 1024+True+ > Sound.Sc3.Plot.plot_p1_ln t -}-sineGen :: (Floating n,Enum n) => Int -> [n] -> [n] -> [[n]]+sineGen :: (Floating n, Enum n) => Int -> [n] -> [n] -> [[n]] sineGen n =- let incr = (2 * pi) / fromIntegral n- ph partial = take n [0,incr * partial ..]- f h amp iph = map (\z -> sin (z + iph) * amp) (ph h)- in zipWith3 f [1..]+ let incr = (2 * pi) / fromIntegral n+ ph partial = take n [0, incr * partial ..]+ f h amp iph = map (\z -> sin (z + iph) * amp) (ph h)+ in zipWith3 f [1 ..] {- | @Signal.*sineFill@ is a table generator. Frequencies are partials, amplitudes and initial phases are as given.@@ -168,9 +211,8 @@ > let a = [[21,5,34,3,2,13,1,8,55],[13,8,55,34,5,21,3,1,2],[55,34,1,3,2,13,5,8,21]] > let t = map (\amp -> sineFill 1024 (map recip amp) (replicate 9 0)) a > Sound.Sc3.Plot.plot_p1_ln t- -}-sineFill :: (Ord n,Floating n,Enum n) => Int -> [n] -> [n] -> [n]+sineFill :: (Ord n, Floating n, Enum n) => Int -> [n] -> [n] -> [n] sineFill n amp iph =- let t = sineGen n amp iph- in normalize (-1) 1 (map sum (transpose t))+ let t = sineGen n amp iph+ in normalize (-1) 1 (map sum (transpose t))
Sound/Sc3/Common/Buffer/Array.hs view
@@ -5,14 +5,14 @@ import qualified Data.Array as A {- array -} -import qualified Sound.Sc3.Common.Buffer as Common.Buffer {- hsc3 -}+import qualified Sound.Sc3.Common.Buffer as Common.Buffer {- hsc3 -} -- | 'Common.Buffer.clipAt'. clipAt :: Int -> A.Array Int a -> a clipAt ix c =- let (l,r) = A.bounds c- f = (A.!) c- in if ix < l then f l else if ix > r then f r else f ix+ let (l, r) = A.bounds c+ f = (A.!) c+ in if ix < l then f l else if ix > r then f r else f ix {- | 'C.blendAtBy' of 'clipAt'. @@ -29,7 +29,7 @@ -} resamp1 :: RealFrac n => Int -> A.Array Int n -> A.Array Int n resamp1 n c =- let (_,r) = A.bounds c- gen = Common.Buffer.resamp1_gen n (r + 1) clipAt c- rs = map gen [0 .. n - 1]- in A.listArray (0,n - 1) rs+ let (_, r) = A.bounds c+ gen = Common.Buffer.resamp1_gen n (r + 1) clipAt c+ rs = map gen [0 .. n - 1]+ in A.listArray (0, n - 1) rs
Sound/Sc3/Common/Buffer/Gen.hs view
@@ -1,7 +1,8 @@--- | Implementaion of server b_gen routines.------ The naming scheme is: _p generates one partial, _l generates a list--- of partials, _nrm is the unit normalised form.+{- | Implementation of server b_gen routines.++The naming scheme is: _p generates one partial, _l generates a list+of partials, _nrm is the unit normalised form.+-} module Sound.Sc3.Common.Buffer.Gen where import Data.List {- base -}@@ -19,21 +20,23 @@ -- * sine1 --- | 'sine3_p' with zero phase.------ > import Sound.Sc3.Plot {- hsc3-plot -}--- > plot_p1_ln [sine1_p 512 (1, 1)]-sine1_p :: (Enum n, Floating n) => Int -> (n,n) -> [n]-sine1_p n (pfreq,ampl) = sine3_p n (pfreq,ampl,0)+{- | 'sine3_p' with zero phase. +> import Sound.Sc3.Plot+> plot_p1_ln [sine1_p 512 (1, 1)]+-}+sine1_p :: (Enum n, Floating n) => Int -> (n, n) -> [n]+sine1_p n (pfreq, ampl) = sine3_p n (pfreq, ampl, 0)+ -- | Series of sine wave harmonics using specified amplitudes.-sine1_l :: (Enum n,Floating n) => Int -> [n] -> [[n]]-sine1_l n = zipWith (curry (sine1_p n)) [1..]+sine1_l :: (Enum n, Floating n) => Int -> [n] -> [[n]]+sine1_l n = zipWith (curry (sine1_p n)) [1 ..] --- | 'sum_l' of 'sine1_l'.------ > plot_p1_ln [sine1 256 [1, 0.95 .. 0.5]]-sine1 :: (Enum n,Floating n) => Int -> [n] -> [n]+{- | 'sum_l' of 'sine1_l'.++> plot_p1_ln [sine1 256 [1, 0.95 .. 0.5]]+-}+sine1 :: (Enum n, Floating n) => Int -> [n] -> [n] sine1 n = sum_l . sine1_l n {- | 'nrm_u' of 'sine1_l'.@@ -41,7 +44,7 @@ > Sound.Sc3.Plot.plot_p1_ln [sine1_nrm 256 [1, 0.95 .. 0.5]] > Sound.Sc3.Plot.plot_p1_ln [sine1_nrm 256 [1, 1/2, 1/3, 1/4, 1/5]] -}-sine1_nrm :: (Enum n,Floating n,Ord n) => Int -> [n] -> [n]+sine1_nrm :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n] sine1_nrm n = nrm_u . sine1 n -- | Variant that generates a wavetable (without guard point) suitable for the Shaper Ugen.@@ -51,7 +54,7 @@ -- * sine2 -- | Series of /n/ sine wave partials using specified frequencies and amplitudes.-sine2_l :: (Enum n,Floating n) => Int -> [(n,n)] -> [[n]]+sine2_l :: (Enum n, Floating n) => Int -> [(n, n)] -> [[n]] sine2_l n = map (sine1_p n) {- | 'sum_l' of 'sine2_l'.@@ -59,45 +62,62 @@ > Sound.Sc3.Plot.plot_p1_ln [sine2 256 (zip [1, 2..] [1, 0.95 .. 0.5])] > Sound.Sc3.Plot.plot_p1_ln [sine2 256 (zip [1, 1.5 ..] [1, 0.95 .. 0.5])] -}-sine2 :: (Enum n,Floating n) => Int -> [(n,n)] -> [n]+sine2 :: (Enum n, Floating n) => Int -> [(n, n)] -> [n] sine2 n = sum_l . sine2_l n -- | 'nrm_u' of 'sine2_l'.-sine2_nrm :: (Enum n,Floating n,Ord n) => Int -> [n] -> [n]+sine2_nrm :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n] sine2_nrm n = nrm_u . sine1 n -- * sine3 --- | Sine wave table at specified frequency, amplitude and phase.-sine3_p :: (Enum n,Floating n) => Int -> (n,n,n) -> [n]+{- | Sine wave table at specified frequency, amplitude and phase.+The table does not arrive back at the starting point.++>>> map (round . (* 100)) (sine3_p 8 (1, 1, 0))+[0,71,100,71,0,-71,-100,-71]+-}+sine3_p :: (Enum n, Floating n) => Int -> (n, n, n) -> [n] sine3_p n (pfreq, ampl, phase) =- let incr = (Math.two_pi / (fromIntegral n - 0)) * pfreq -- the table should not arrive back at zero- in map ((*) ampl . sin) (take n [phase, phase + incr ..])+ let incr = (Math.two_pi / (fromIntegral n - 0)) * pfreq+ in map ((*) ampl . sin) (take n [phase, phase + incr ..]) -- | 'map' of 'sine3_p'.-sine3_l :: (Enum n,Floating n) => Int -> [(n,n,n)] -> [[n]]+sine3_l :: (Enum n, Floating n) => Int -> [(n, n, n)] -> [[n]] sine3_l n = map (sine3_p n) --- | 'sum_l' of 'sine3_l'.------ > plot_p1_ln [sine3 256 (zip3 [1,1.5 ..] [1,0.95 .. 0.5] [0,pi/7..])]-sine3 :: (Enum n,Floating n) => Int -> [(n,n,n)] -> [n]+{- | 'sum_l' of 'sine3_l'.++> plot_p1_ln [sine3 256 (zip3 [1,1.5 ..] [1,0.95 .. 0.5] [0,pi/7..])]+-}+sine3 :: (Enum n, Floating n) => Int -> [(n, n, n)] -> [n] sine3 n = sum_l . sine3_l n -- * cheby {- | Generate Chebyshev waveshaping table, see b_gen_cheby.+Cf. <https://www.csounds.com/manual/html/GEN13.html> -> Sound.Sc3.Plot.plot_p1_ln [gen_cheby 256 [1, 0, 1, 1, 0, 1]]+> import Sound.Sc3.Plot+> let p x = plot_p1_ln [gen_cheby 512 x]++> p [1, 0, 1, 1, 0, 1]+> p [100, -50, -33, 25, 20, -16.7, -14.2, 12.5, 11.1, -10, -9.09, 8.333, 7.69, -7.14, -6.67, 6.25, 5.88, -5.55, -5.26, 5]+> p [100, 0, -33, 0, 20, 0, -14.2, 0, 11.1, 0, -9.09, 0, 7.69, 0, -6.67, 0, 5.88, 0, -5.26]+> p [100, 0, -11.11, 0, 4, 0, -2.04, 0, 1.23, 0, -0.826, 0, 0.59, 0, -0.444, 0, 0.346, 0, -0.277]+> p [1, -0.8, 0, 0.6, 0, 0, 0, 0.4, 0, 0, 0, 0, 0.1, -0.2, -0.3, 0.5]+> p [0, 0, -0.1, 0, 0.3, 0, -0.5, 0, 0.7, 0, -0.9, 0, 1, 0, -1, 0]+> p [0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, -0.1, 0, 0.1, 0, -0.2, 0.3, 0, -0.7, 0, 0.2, 0, -0.1]+> p [5, 0, 3, 0, 1] -} gen_cheby :: (Enum n, Floating n, Ord n, Integral i) => i -> [n] -> [n] gen_cheby n =- let acos' x = if x > 1 then 0 else if x < -1 then pi else acos x- c k x = cos (k * acos' x)- ix = [-1, -1 + (2 / (fromIntegral n - 1)) .. 1] -- increment?- mix = map sum . transpose- c_normalize x = let m = maximum (map abs x) in map (* recip m) x- in c_normalize . mix . zipWith (\k a -> map ((* a) . c k) ix) [1..]+ let acos' x = if x > 1 then 0 else if x < -1 then pi else acos x+ c k x = cos (k * acos' x)+ ix = [-1, -1 + (2 / (fromIntegral n - 1)) .. 1] -- increment?+ mix = map sum . transpose+ c_normalize x = let m = maximum (map abs x) in map (* recip m) x+ in c_normalize . mix . zipWith (\k a -> map ((* a) . c k) ix) [1 ..] -- | Type specialised 'gen_cheby'. cheby :: (Enum n, Floating n, Ord n) => Int -> [n] -> [n]
Sound/Sc3/Common/Buffer/Vector.hs view
@@ -10,9 +10,9 @@ -- | 'C.clipAt'. clipAt :: V.Storable t => Int -> V.Vector t -> t clipAt ix c =- let r = V.length c- f = (V.!) c- in if ix > r - 1 then f (r - 1) else f ix+ let r = V.length c+ f = (V.!) c+ in if ix > r - 1 then f (r - 1) else f ix {- | 'C.blendAtBy' of 'clipAt'. @@ -20,14 +20,14 @@ > Sound.Sc3.Common.Buffer.Vector.blendAt 0.4 (V.fromList [2,5,6]) == 3.2 > Sound.Sc3.Common.Buffer.Vector.blendAt 2.1 (V.fromList [2,5,6]) == 6 -}-blendAt :: (V.Storable t,RealFrac t) => t -> V.Vector t -> t+blendAt :: (V.Storable t, RealFrac t) => t -> V.Vector t -> t blendAt = C.blendAtBy clipAt {- | 'C.from_wavetable' > Sound.Sc3.Common.Buffer.Vector.from_wavetable (V.fromList [-0.5,0.5,0,0.5,1.5,-0.5,1,-0.5]) -}-from_wavetable :: (V.Storable t,Num t) => V.Vector t -> V.Vector t+from_wavetable :: (V.Storable t, Num t) => V.Vector t -> V.Vector t from_wavetable wt = let n = V.length wt f k = let k2 = k * 2 in (wt V.! k2) + (wt V.! (k2 + 1))@@ -38,7 +38,7 @@ > Sound.Sc3.Common.Buffer.Vector.resamp1 12 (V.fromList [1,2,3,4]) > Sound.Sc3.Common.Buffer.Vector.resamp1 3 (V.fromList [1,2,3,4]) == V.fromList [1,2.5,4] -}-resamp1 :: (V.Storable t,RealFrac t) => Int -> V.Vector t -> V.Vector t+resamp1 :: (V.Storable t, RealFrac t) => Int -> V.Vector t -> V.Vector t resamp1 n c =- let gen = C.resamp1_gen n (V.length c) clipAt c- in V.generate n gen+ let gen = C.resamp1_gen n (V.length c) clipAt c+ in V.generate n gen
Sound/Sc3/Common/Context.hs view
@@ -9,7 +9,7 @@ -- | Format a Context as a sequence of import commands. context_format :: Context -> [String] context_format =- let f (moduleName,qualifier,packageName) =+ let f (moduleName, qualifier, packageName) = case qualifier of Nothing -> printf "import %s {- %s -}" moduleName packageName Just qualifierName -> printf "import qualified %s as %s {- %s -}" moduleName qualifierName packageName@@ -22,39 +22,41 @@ -- | Minimal hsc3 context min_context :: Context min_context =- [("Prelude",Nothing,"base")- ,("Control.Monad",Nothing,"base")- ,("Data.Bits",Nothing,"base")- ,("Data.Function",Nothing,"base")- ,("Data.List",Nothing,"base")- ,("Sound.Sc3",Nothing,"hsc3")]+ [ ("Prelude", Nothing, "base")+ , ("Control.Monad", Nothing, "base")+ , ("Data.Bits", Nothing, "base")+ , ("Data.Function", Nothing, "base")+ , ("Data.List", Nothing, "base")+ , ("Sound.Sc3", Nothing, "hsc3")+ ] -- | Standard hsc3 context std_context :: Context std_context =- [("Prelude",Nothing,"base")- ,("Control.Monad",Nothing,"base")- ,("Data.Bits",Nothing,"base")- ,("Data.Function",Nothing,"base")- ,("Data.List",Nothing,"base")- ,("System.Random",Nothing,"random")- ,("Sound.Osc",Nothing,"hosc")- ,("Sound.Sc3",Nothing,"hsc3")- ,("Sound.Sc3.Common.Base",Just "Sound.Sc3.Common.Base","hsc3")- ,("Sound.Sc3.Common.Buffer.Gen",Just "Gen","hsc3")- ,("Sound.Sc3.Common.Math.Filter.Beq",Just "Sound.Sc3.Common.Math.Filter.Beq","hsc3")- ,("Sound.Sc3.Ugen.Bindings.Db.External",Just "X","hsc3")- ,("Sound.Sc3.Ugen.Bindings.Composite.External",Just "X","hsc3")- ,("Sound.Sc3.Ugen.Bindings.Hw.External.F0",Just "X","hsc3")- ,("Sound.Sc3.Ugen.Bindings.Hw.External.SC3_Plugins",Just "X","hsc3")- ,("Sound.Sc3.Ugen.Bindings.Hw.External.Zita",Just "X","hsc3")- ,("Sound.Sc3.Ugen.Bindings.Db.Rdu",Just "X","sc3-rdu")- ,("Sound.Sc3.Ugen.Dot",Just "Sound.Sc3.Ugen.Dot","hsc3-dot")- ,("Sound.Sc3.Ugen.Unsafe",Nothing,"hsc3-unsafe")- ,("Sound.Sc3.Ugen.Unsafe",Nothing,"hsc3-unsafe")- ,("Sound.Sc3.Ugen.Protect",Just "Protect","hsc3-rw")- ,("Sound.Sc3.Ui.Html",Just "Ui","hsc3-ui")- ,("Sound.Sc3.Ui.Plot",Just "Ui","hsc3-ui")- ,("Sound.Sc3.Ui.Qarma",Just "Ui","hsc3-ui")- ,("Sound.Sc3.Ui.ScLang",Just "Ui","hsc3-ui")- ,("Sound.Sc3.Ui.ScLang.Control",Just "Ui","hsc3-ui")]+ [ ("Prelude", Nothing, "base")+ , ("Control.Monad", Nothing, "base")+ , ("Data.Bits", Nothing, "base")+ , ("Data.Function", Nothing, "base")+ , ("Data.List", Nothing, "base")+ , ("System.Random", Nothing, "random")+ , ("Sound.Osc", Nothing, "hosc")+ , ("Sound.Sc3", Nothing, "hsc3")+ , ("Sound.Sc3.Common.Base", Just "Sound.Sc3.Common.Base", "hsc3")+ , ("Sound.Sc3.Common.Buffer.Gen", Just "Gen", "hsc3")+ , ("Sound.Sc3.Common.Math.Filter.Beq", Just "Sound.Sc3.Common.Math.Filter.Beq", "hsc3")+ , ("Sound.Sc3.Ugen.Bindings.Db.External", Just "X", "hsc3")+ , ("Sound.Sc3.Ugen.Bindings.Composite.External", Just "X", "hsc3")+ , ("Sound.Sc3.Ugen.Bindings.Hw.External.F0", Just "X", "hsc3")+ , ("Sound.Sc3.Ugen.Bindings.Hw.External.SC3_Plugins", Just "X", "hsc3")+ , ("Sound.Sc3.Ugen.Bindings.Hw.External.Zita", Just "X", "hsc3")+ , ("Sound.Sc3.Ugen.Bindings.Db.Rdu", Just "X", "sc3-rdu")+ , ("Sound.Sc3.Ugen.Dot", Just "Sound.Sc3.Ugen.Dot", "hsc3-dot")+ , ("Sound.Sc3.Ugen.Unsafe", Nothing, "hsc3-unsafe")+ , ("Sound.Sc3.Ugen.Unsafe", Nothing, "hsc3-unsafe")+ , ("Sound.Sc3.Ugen.Protect", Just "Protect", "hsc3-rw")+ , ("Sound.Sc3.Ui.Html", Just "Ui", "hsc3-ui")+ , ("Sound.Sc3.Ui.Plot", Just "Ui", "hsc3-ui")+ , ("Sound.Sc3.Ui.Qarma", Just "Ui", "hsc3-ui")+ , ("Sound.Sc3.Ui.ScLang", Just "Ui", "hsc3-ui")+ , ("Sound.Sc3.Ui.ScLang.Control", Just "Ui", "hsc3-ui")+ ]
Sound/Sc3/Common/Enum.hs view
@@ -4,9 +4,11 @@ -- * Loop -- | Loop indicator input.-data Loop t =- NoLoop -- ^ 0- | Loop -- ^ 1+data Loop t+ = -- | 0+ NoLoop+ | -- | 1+ Loop | WithLoop t deriving (Eq, Show) @@ -25,16 +27,16 @@ -- | Resolve 'Loop'. from_loop :: Num t => Loop t -> t from_loop e =- case e of- NoLoop -> 0- Loop -> 1- WithLoop u -> u+ case e of+ NoLoop -> 0+ Loop -> 1+ WithLoop u -> u -- * Interpolation -- | Interpolation indicator input.-data Interpolation t =- NoInterpolation+data Interpolation t+ = NoInterpolation | LinearInterpolation | CubicInterpolation | WithInterpolation t@@ -43,11 +45,11 @@ -- | Resolve 'Interpolation'. from_interpolation :: Num t => Interpolation t -> t from_interpolation e =- case e of- NoInterpolation -> 1- LinearInterpolation -> 2- CubicInterpolation -> 4- WithInterpolation u -> u+ case e of+ NoInterpolation -> 1+ LinearInterpolation -> 2+ CubicInterpolation -> 4+ WithInterpolation u -> u -- * DoneAction @@ -63,12 +65,12 @@ -- | Apply /f/ at 'WithDoneAction'. done_action_map :: (t -> u) -> DoneAction t -> DoneAction u done_action_map f e =- case e of- DoNothing -> DoNothing- PauseSynth -> PauseSynth- RemoveSynth -> RemoveSynth- RemoveGroup -> RemoveGroup- WithDoneAction x -> WithDoneAction (f x)+ case e of+ DoNothing -> DoNothing+ PauseSynth -> PauseSynth+ RemoveSynth -> RemoveSynth+ RemoveGroup -> RemoveGroup+ WithDoneAction x -> WithDoneAction (f x) -- | fmap is 'done_action_map' instance Functor DoneAction where@@ -77,39 +79,41 @@ -- | Resolve 'DoneAction'. from_done_action :: Num t => DoneAction t -> t from_done_action e =- case e of- DoNothing -> 0- PauseSynth -> 1- RemoveSynth -> 2- RemoveGroup -> 14- WithDoneAction x -> x+ case e of+ DoNothing -> 0+ PauseSynth -> 1+ RemoveSynth -> 2+ RemoveGroup -> 14+ WithDoneAction x -> x -- * Warp -- | Warp interpolation indicator input.-data Warp t =- Linear+data Warp t+ = Linear | Exponential | WithWarp t deriving (Eq, Show) --- | Resolve 'Warp'.------ > map from_warp [Linear,Exponential] == [0,1]+{- | Resolve 'Warp'.++>>> map from_warp [Linear,Exponential]+[0,1]+-} from_warp :: Num t => Warp t -> t from_warp e =- case e of- Linear -> 0- Exponential -> 1- WithWarp u -> u+ case e of+ Linear -> 0+ Exponential -> 1+ WithWarp u -> u -- | Apply /f/ at 'WithWarp' warp_map :: (t -> u) -> Warp t -> Warp u warp_map f e =- case e of- Linear -> Linear- Exponential -> Exponential- WithWarp u -> WithWarp (f u)+ case e of+ Linear -> Linear+ Exponential -> Exponential+ WithWarp u -> WithWarp (f u) -- | fmap = 'warp_map' instance Functor Warp where@@ -118,7 +122,7 @@ -- * Buffer -- | Unification of integer and 'Ugen' buffer identifiers.-data Buffer t =- Buffer_Id Int+data Buffer t+ = Buffer_Id Int | Buffer t deriving (Eq, Show)
Sound/Sc3/Common/Envelope.hs view
@@ -4,18 +4,21 @@ import Data.List {- base -} import Data.Maybe {- base -} +import qualified Safe {- safe -}+ import qualified Sound.Sc3.Common.Base as Base {- hsc3 -} import qualified Sound.Sc3.Common.Math.Interpolate as Interpolate {- hsc3 -} -- * Curve -- | Envelope curve indicator input.-data Envelope_Curve a =- EnvStep+data Envelope_Curve a+ = EnvStep | EnvLin | EnvExp | EnvSin- | EnvWelch -- ^ Note: not implemented at Sc3+ | -- | Note: not implemented at Sc3+ EnvWelch | EnvNum a | EnvSqr | EnvCub@@ -31,78 +34,87 @@ -- | Envelope curve quadruple. type Envelope_Curve_4 a = Base.T4 (Envelope_Curve a) --- | Convert 'Envelope_Curve' to shape value.------ > map env_curve_shape [EnvSin,EnvSqr] == [3,6]+{- | Convert 'Envelope_Curve' to shape value.++>>> map env_curve_shape [EnvSin,EnvSqr]+[3,6]+-} env_curve_shape :: Num a => Envelope_Curve a -> a env_curve_shape e =- case e of- EnvStep -> 0- EnvLin -> 1- EnvExp -> 2- EnvSin -> 3- EnvWelch -> 4- EnvNum _ -> 5- EnvSqr -> 6- EnvCub -> 7- EnvHold -> 8+ case e of+ EnvStep -> 0+ EnvLin -> 1+ EnvExp -> 2+ EnvSin -> 3+ EnvWelch -> 4+ EnvNum _ -> 5+ EnvSqr -> 6+ EnvCub -> 7+ EnvHold -> 8 --- | The /value/ of 'EnvCurve' is non-zero for 'EnvNum'.------ > map env_curve_value [EnvWelch,EnvNum 2] == [0,2]+{- | The /value/ of 'EnvCurve' is non-zero for 'EnvNum'.++>>> map env_curve_value [EnvWelch,EnvNum 2]+[0,2]+-} env_curve_value :: Num a => Envelope_Curve a -> a env_curve_value e =- case e of- EnvNum u -> u- _ -> 0+ case e of+ EnvNum u -> u+ _ -> 0 -- | 'Interpolation_f' of 'Envelope_Curve'. env_curve_interpolation_f :: (Ord t, Floating t) => Envelope_Curve t -> Interpolate.Interpolation_f t env_curve_interpolation_f c =- case c of- EnvStep -> Interpolate.step- EnvLin -> Interpolate.linear- EnvExp -> Interpolate.exponential- EnvSin -> Interpolate.sine- EnvWelch -> Interpolate.welch- EnvNum n -> Interpolate.curve n- EnvSqr -> Interpolate.squared- EnvCub -> Interpolate.cubed- EnvHold -> undefined+ case c of+ EnvStep -> Interpolate.step+ EnvLin -> Interpolate.linear+ EnvExp -> Interpolate.exponential+ EnvSin -> Interpolate.sine+ EnvWelch -> Interpolate.welch+ EnvNum n -> Interpolate.curve n+ EnvSqr -> Interpolate.squared+ EnvCub -> Interpolate.cubed+ EnvHold -> undefined -- | Apply /f/ to 'EnvNum' value. env_curve_map :: (a -> b) -> Envelope_Curve a -> Envelope_Curve b env_curve_map f e =- case e of- EnvStep -> EnvStep- EnvLin -> EnvLin- EnvExp -> EnvExp- EnvSin -> EnvSin- EnvWelch -> EnvWelch- EnvNum x -> EnvNum (f x)- EnvSqr -> EnvSqr- EnvCub -> EnvCub- EnvHold -> EnvHold+ case e of+ EnvStep -> EnvStep+ EnvLin -> EnvLin+ EnvExp -> EnvExp+ EnvSin -> EnvSin+ EnvWelch -> EnvWelch+ EnvNum x -> EnvNum (f x)+ EnvSqr -> EnvSqr+ EnvCub -> EnvCub+ EnvHold -> EnvHold -- * Envelope -- | Sc3 envelope segment model-data Envelope a =- Envelope- {env_levels :: [a] -- ^ Set of /n/ levels, n is >= 1- ,env_times :: [a] -- ^ Set of /n-1/ time intervals- ,env_curves :: [Envelope_Curve a] -- ^ Possibly empty curve set- ,env_release_node :: Maybe Int -- ^ Maybe index to release node- ,env_loop_node :: Maybe Int -- ^ Maybe index to loop node- ,env_offset :: a -- ^ An offset for all time values (IEnvGen only)- }- deriving (Eq,Show)+data Envelope a = Envelope+ { env_levels :: [a]+ -- ^ Set of /n/ levels, n is >= 1+ , env_times :: [a]+ -- ^ Set of /n-1/ time intervals+ , env_curves :: [Envelope_Curve a]+ -- ^ Possibly empty curve set+ , env_release_node :: Maybe Int+ -- ^ Maybe index to release node+ , env_loop_node :: Maybe Int+ -- ^ Maybe index to loop node+ , env_offset :: a+ -- ^ An offset for all time values (IEnvGen only)+ }+ deriving (Eq, Show) -- | Apply /f/ to all /a/ at 'Envelope'. envelope_map :: (a -> b) -> Envelope a -> Envelope b envelope_map f e =- let Envelope l t c rn ln os = e- in Envelope (map f l) (map f t) (map (env_curve_map f) c) rn ln (f os)+ let Envelope l t c rn ln os = e+ in Envelope (map f l) (map f t) (map (env_curve_map f) c) rn ln (f os) -- | fmap = 'envelope_map' instance Functor Envelope where@@ -126,139 +138,142 @@ -- | Determine which envelope segment a given time /t/ falls in. envelope_segment_ix :: (Ord a, Num a) => Envelope a -> a -> Maybe Int envelope_segment_ix e t =- let d = Base.dx_d (env_times e)- in findIndex (>= t) d+ let d = Base.dx_d (env_times e)+ in findIndex (>= t) d -- | A set of start time, start level, end time, end level and curve.-type Envelope_Segment t = (t,t,t,t,Envelope_Curve t)+type Envelope_Segment t = (t, t, t, t, Envelope_Curve t) -- | Extract envelope segment given at index /i/. envelope_segment :: Num t => Envelope t -> Int -> Envelope_Segment t envelope_segment e i =- let l = env_levels e- t = env_times e- x0 = l !! i- x1 = l !! (i + 1)- t0 = (0 : Base.dx_d t) !! i- t1 = t0 + t !! i- c = envelope_curves e !! i- in (t0,x0,t1,x1,c)+ let l = env_levels e+ t = env_times e+ x0 = l !! i+ x1 = l !! (i + 1)+ t0 = (0 : Base.dx_d t) !! i+ t1 = t0 + t !! i+ c = envelope_curves e !! i+ in (t0, x0, t1, x1, c) -- | Extract all segments. envelope_segments :: Num t => Envelope t -> [Envelope_Segment t] envelope_segments e =- let n = envelope_n_segments e- in map (envelope_segment e) [0 .. n - 1]+ let n = envelope_n_segments e+ in map (envelope_segment e) [0 .. n - 1] -- | Transform list of 'Envelope_Segment's into lists ('env_levels','env_times','env_curves').-pack_envelope_segments :: Num t => [Envelope_Segment t] -> ([t],[t],[Envelope_Curve t])+pack_envelope_segments :: Num t => [Envelope_Segment t] -> ([t], [t], [Envelope_Curve t]) pack_envelope_segments s =- case s of- [] -> error ""- [(t0,l0,t1,l1,c)] -> ([l0,l1],[t1 - t0],[c])- (_,l0,_,_,_) : _ ->- let t (t0,_,t1,_,_) = t1 - t0- c (_,_,_,_,x) = x- l (_,_,_,x,_) = x- in (l0 : map l s,map t s,map c s)+ case s of+ [] -> error ""+ [(t0, l0, t1, l1, c)] -> ([l0, l1], [t1 - t0], [c])+ (_, l0, _, _, _) : _ ->+ let t (t0, _, t1, _, _) = t1 - t0+ c (_, _, _, _, x) = x+ l (_, _, _, x, _) = x+ in (l0 : map l s, map t s, map c s) -- | An envelope is /normal/ if it has no segments with zero duration.-envelope_is_normal :: (Eq n,Num n) => Envelope n -> Bool+envelope_is_normal :: (Eq n, Num n) => Envelope n -> Bool envelope_is_normal = notElem 0 . env_times -- | Normalise envelope by deleting segments of zero duration. envelope_normalise :: (Num a, Ord a) => Envelope a -> Envelope a envelope_normalise e =- let s = envelope_segments e- f (t0,_,t1,_,_) = t1 <= t0- s' = filter (not . f) s- (l,t,c) = pack_envelope_segments s'- in case e of- Envelope _ _ _ Nothing Nothing os -> Envelope l t c Nothing Nothing os- _ -> error "envelope_normalise: has release or loop node..."+ let s = envelope_segments e+ f (t0, _, t1, _, _) = t1 <= t0+ s' = filter (not . f) s+ (l, t, c) = pack_envelope_segments s'+ in case e of+ Envelope _ _ _ Nothing Nothing os -> Envelope l t c Nothing Nothing os+ _ -> error "envelope_normalise: has release or loop node..." --- | Get value for 'Envelope' at time /t/, or zero if /t/ is out of--- range. By convention if the envelope has a segment of zero--- duration we give the rightmost value.+{- | Get value for 'Envelope' at time /t/, or zero if /t/ is out of+range. By convention if the envelope has a segment of zero+duration we give the rightmost value.+-} envelope_at :: (Ord t, Floating t) => Envelope t -> t -> t envelope_at e t =- case envelope_segment_ix e t of- Just n -> let (t0,x0,t1,x1,c) = envelope_segment e n- d = t1 - t0- t' = (t - t0) / d- f = env_curve_interpolation_f c- in if d <= 0- then x1- else f x0 x1 t'- Nothing -> 0+ case envelope_segment_ix e t of+ Just n ->+ let (t0, x0, t1, x1, c) = envelope_segment e n+ d = t1 - t0+ t' = (t - t0) / d+ f = env_curve_interpolation_f c+ in if d <= 0+ then x1+ else f x0 x1 t'+ Nothing -> 0 -- | Render 'Envelope' to breakpoint set of /n/ equi-distant places.-envelope_render :: (Ord t, Floating t, Enum t) => Int -> Envelope t -> [(t,t)]+envelope_render :: (Ord t, Floating t, Enum t) => Int -> Envelope t -> [(t, t)] envelope_render n e =- let d = envelope_duration e- k = d / (fromIntegral n - 1)- t = [0,k .. d]- in zip t (map (envelope_at e) t)+ let d = envelope_duration e+ k = d / (fromIntegral n - 1)+ t = [0, k .. d]+ in zip t (map (envelope_at e) t) -- | Contruct a lookup table of /n/ places from 'Envelope'. envelope_table :: (Ord t, Floating t, Enum t) => Int -> Envelope t -> [t] envelope_table n = map snd . envelope_render n --- | Variant on 'env_curves' that expands the, possibly empty, user--- list by cycling (if not empty) or by filling with 'EnvLin'.+{- | Variant on 'env_curves' that expands the, possibly empty, user+list by cycling (if not empty) or by filling with 'EnvLin'.+-} envelope_curves :: Envelope a -> [Envelope_Curve a] envelope_curves e =- let c = env_curves e- n = envelope_n_segments e- in if null c- then replicate n EnvLin- else take n (cycle c)+ let c = env_curves e+ n = envelope_n_segments e+ in if null c+ then replicate n EnvLin+ else take n (cycle c) {- | Linear Sc3 form of 'Envelope' data. Form is: l0 #t reset loop l1 t0 c0 c0' ... -envelope_sc3_array (envelope [0,1] [0.1] [EnvLin]) == Just [0,1,-99,-99,1,0.1,1,0]+>>> envelope_sc3_array (envelope [0,1] [0.1] [EnvLin])+Just [0.0,1.0,-99.0,-99.0,1.0,0.1,1.0,0.0] -> let l = [0,0.6,0.3,1.0,0]-> let t = [0.1,0.02,0.4,1.1]-> let c = [EnvLin,EnvExp,EnvNum (-6),EnvSin]-> let e = Envelope l t c Nothing Nothing 0-> let r = [0,4,-99,-99,0.6,0.1,1,0,0.3,0.02,2,0,1,0.4,5,-6,0,1.1,3,0]-> envelope_sc3_array e == Just r+>>> let l = [0,0.6,0.3,1.0,0]+>>> let t = [0.1,0.02,0.4,1.1]+>>> let c = [EnvLin,EnvExp,EnvNum (-6),EnvSin]+>>> envelope_sc3_array (Envelope l t c Nothing Nothing 0)+Just [0.0,4.0,-99.0,-99.0,0.6,0.1,1.0,0.0,0.3,2.0e-2,2.0,0.0,1.0,0.4,5.0,-6.0,0.0,1.1,3.0,0.0] -} envelope_sc3_array :: Num a => Envelope a -> Maybe [a] envelope_sc3_array e =- let Envelope l t _ rn ln _ = e- n = length t- n' = fromIntegral n- rn' = fromIntegral (fromMaybe (-99) rn)- ln' = fromIntegral (fromMaybe (-99) ln)- c = envelope_curves e- f i j k = [i,j,env_curve_shape k,env_curve_value k]- in case l of- l0:l' -> Just (l0 : n' : rn' : ln' : concat (zipWith3 f l' t c))- _ -> Nothing+ let Envelope l t _ rn ln _ = e+ n = length t+ n' = fromIntegral n+ rn' = fromIntegral (fromMaybe (-99) rn)+ ln' = fromIntegral (fromMaybe (-99) ln)+ c = envelope_curves e+ f i j k = [i, j, env_curve_shape k, env_curve_value k]+ in case l of+ l0 : l' -> Just (l0 : n' : rn' : ln' : concat (zipWith3 f l' t c))+ _ -> Nothing {- | @IEnvGen@ Sc3 form of 'Envelope' data. -> l = [0,0.6,0.3,1.0,0]-> t = [0.1,0.02,0.4,1.1]-> c = [EnvLin,EnvExp,EnvNum (-6),EnvSin]-> e = Envelope l t c Nothing Nothing 0-> r = [0,0,4,1.62,0.1,1,0,0.6,0.02,2,0,0.3,0.4,5,-6,1,1.1,3,0,0]-> envelope_sc3_ienvgen_array e == Just r+>>> let l = [0,0.6,0.3,1.0,0]+>>> let t = [0.1,0.02,0.4,1.1]+>>> let c = [EnvLin,EnvExp,EnvNum (-6),EnvSin]+>>> let e = Envelope l t c Nothing Nothing 0+>>> envelope_sc3_ienvgen_array e+Just [0.0,0.0,4.0,1.62,0.1,1.0,0.0,0.6,2.0e-2,2.0,0.0,0.3,0.4,5.0,-6.0,1.0,1.1,3.0,0.0,0.0] -} envelope_sc3_ienvgen_array :: Num a => Envelope a -> Maybe [a] envelope_sc3_ienvgen_array e =- let Envelope l t _ _ _ os = e- n = length t- n' = fromIntegral n- c = envelope_curves e- f i j k = [j,env_curve_shape k,env_curve_value k,i]- in case l of- l0:l' -> Just (os : l0 : n' : sum t : concat (zipWith3 f l' t c))- _ -> Nothing+ let Envelope l t _ _ _ os = e+ n = length t+ n' = fromIntegral n+ c = envelope_curves e+ f i j k = [j, env_curve_shape k, env_curve_value k, i]+ in case l of+ l0 : l' -> Just (os : l0 : n' : sum t : concat (zipWith3 f l' t c))+ _ -> Nothing -- | 'True' if 'env_release_node' is not 'Nothing'. env_is_sustained :: Envelope a -> Bool@@ -267,31 +282,34 @@ -- | Delay the onset of the envelope (add initial segment). env_delay :: Envelope a -> a -> Envelope a env_delay (Envelope l t c rn ln os) d =- let l0 = head l- l' = l0 : l- t' = d : t- c' = EnvLin : c- rn' = fmap (+ 1) rn- ln' = fmap (+ 1) ln- in Envelope l' t' c' rn' ln' os+ let l0 = Safe.headNote "env_delay" l+ l' = l0 : l+ t' = d : t+ c' = EnvLin : c+ rn' = fmap (+ 1) rn+ ln' = fmap (+ 1) ln+ in Envelope l' t' c' rn' ln' os --- | Connect releaseNode (or end) to first node of envelope.--- z is a value that is first zero and thereafter one.--- tc & cc are time and curve from first to last.+{- | Connect releaseNode (or end) to first node of envelope.+z is a value that is first zero and thereafter one.+tc & cc are time and curve from first to last.+-} env_circle_z :: Fractional a => a -> a -> Envelope_Curve a -> Envelope a -> Envelope a env_circle_z z tc cc (Envelope l t c rn _ os) =- let n = length t- in case rn of- Nothing -> let l' = 0 : l ++ [0]- t' = z * tc : t ++ [1] -- inf (but drawings are poor)- c' = cc : take n (cycle c) ++ [EnvLin]- rn' = Just (n + 1)- in Envelope l' t' c' rn' (Just 0) os- Just i -> let l' = 0 : l- t' = z * tc : t- c' = cc : take n (cycle c)- rn' = Just (i + 1)- in Envelope l' t' c' rn' (Just 0) os+ let n = length t+ in case rn of+ Nothing ->+ let l' = 0 : l ++ [0]+ t' = z * tc : t ++ [1] -- inf (but drawings are poor)+ c' = cc : take n (cycle c) ++ [EnvLin]+ rn' = Just (n + 1)+ in Envelope l' t' c' rn' (Just 0) os+ Just i ->+ let l' = 0 : l+ t' = z * tc : t+ c' = cc : take n (cycle c)+ rn' = Just (i + 1)+ in Envelope l' t' c' rn' (Just 0) os -- | env_circle_z with cycle time of zero. env_circle_0 :: Fractional a => Envelope a -> Envelope a@@ -308,87 +326,94 @@ envelope; 2. @skew@ determines the attack\/decay ratio, zero is an immediate attack and a slow decay, one a slow attack and an immediate decay; 3. @duration@ in seconds; 4. @amplitude@ as linear gain.- -}-envTrapezoid_f :: Num t => (t -> t -> t,t -> t -> t) -> t -> t -> t -> t -> Envelope t-envTrapezoid_f (lte_f,gte_f) shape skew dur amp =- let x1 = skew * (1 - shape)- bp = [(0,lte_f skew 0)- ,(x1,1)- ,(shape + x1,1)- ,(1,gte_f skew 1)]- in envCoord bp dur amp EnvLin+envTrapezoid_f :: Num t => (t -> t -> t, t -> t -> t) -> t -> t -> t -> t -> Envelope t+envTrapezoid_f (lte_f, gte_f) shape skew dur amp =+ let x1 = skew * (1 - shape)+ bp =+ [ (0, lte_f skew 0)+ , (x1, 1)+ , (shape + x1, 1)+ , (1, gte_f skew 1)+ ]+ in envCoord bp dur amp EnvLin {- | Coordinate based static envelope generator. Points are (time,value) pairs. -> let e = envCoord [(0,0),(1/4,1),(1,0)] 1 1 EnvLin-> envelope_sc3_array e == Just [0,2,-99,-99,1,1/4,1,0,0,3/4,1,0]+>>> let e = envCoord [(0,0),(1/4,1),(1,0)] 1 1 EnvLin+>>> envelope_sc3_array e+Just [0.0,2.0,-99.0,-99.0,1.0,0.25,1.0,0.0,0.0,0.75,1.0,0.0] -> import Sound.Sc3.Plot {- hsc3-plot -}+> import Sound.Sc3.Plot {\- hsc3-plot -\} > plotEnvelope [envCoord [(0,0),(1/4,1),(1,0)] 1 1 EnvLin] -}-envCoord :: Num n => [(n,n)] -> n -> n -> Envelope_Curve n -> Envelope n-envCoord xy dur amp c = envXyc (map (\(x,y) -> (x * dur,y * amp,c)) xy)+envCoord :: Num n => [(n, n)] -> n -> n -> Envelope_Curve n -> Envelope n+envCoord xy dur amp c = envXyc (map (\(x, y) -> (x * dur, y * amp, c)) xy) --- | Segments given as pairs of (time,level).--- The input is sorted by time before processing.------ > envPairs [(0, 1), (3, 1.4), (2.1, 0.5)] EnvSin-envPairs :: (Num n,Ord n) => [(n,n)] -> Envelope_Curve n -> Envelope n+{- | Segments given as pairs of (time,level).+The input is sorted by time before processing.++>>> env_levels (envPairs [(0, 1), (3, 1.4), (2.1, 0.5)] EnvSin)+[1.0,0.5,1.4]+-}+envPairs :: (Num n, Ord n) => [(n, n)] -> Envelope_Curve n -> Envelope n envPairs xy = envCoord (Base.sort_on fst xy) 1 1 -- | Percussive envelope, with attack, release, level and curve inputs. envPerc_c :: Num a => a -> a -> a -> Envelope_Curve_2 a -> Envelope a-envPerc_c atk rls lvl (c0,c1) =- let c = [c0,c1]- in Envelope [0,lvl,0] [atk,rls] c Nothing Nothing 0+envPerc_c atk rls lvl (c0, c1) =+ let c = [c0, c1]+ in Envelope [0, lvl, 0] [atk, rls] c Nothing Nothing 0 -- | Percussive envelope, with attack and release inputs. envPerc :: Num a => a -> a -> Envelope a envPerc atk rls =- let cn = EnvNum (-4)- in envPerc_c atk rls 1 (cn,cn)+ let cn = EnvNum (-4)+ in envPerc_c atk rls 1 (cn, cn) --- | Triangular envelope, with duration and level inputs.------ > let e = envTriangle 1 0.1--- > envelope_sc3_array e == Just [0,2,-99,-99,0.1,0.5,1,0,0,0.5,1,0]+{- | Triangular envelope, with duration and level inputs.++>>> let e = envTriangle 1 0.1+>>> envelope_sc3_array e+Just [0.0,2.0,-99.0,-99.0,0.1,0.5,1.0,0.0,0.0,0.5,1.0,0.0]+-} envTriangle :: Fractional a => a -> a -> Envelope a envTriangle dur lvl =- let c = replicate 2 EnvLin- d = replicate 2 (dur / 2)- in Envelope [0,lvl,0] d c Nothing Nothing 0+ let c = replicate 2 EnvLin+ d = replicate 2 (dur / 2)+ in Envelope [0, lvl, 0] d c Nothing Nothing 0 --- | Sine envelope, with duration and level inputs.------ > let e = envSine 0 0.1--- > envelope_sc3_array e == Just [0,2,-99,-99,0.1,0.5,1,0,0,0.5,1,0]+{- | Sine envelope, with duration and level inputs.++>>> envelope_sc3_array (envSine 0 0.1)+Just [0.0,2.0,-99.0,-99.0,0.1,0.0,3.0,0.0,0.0,0.0,3.0,0.0]+-} envSine :: Fractional a => a -> a -> Envelope a envSine dur lvl =- let c = replicate 2 EnvSin- d = replicate 2 (dur / 2)- in Envelope [0,lvl,0] d c Nothing Nothing 0+ let c = replicate 2 EnvSin+ d = replicate 2 (dur / 2)+ in Envelope [0, lvl, 0] d c Nothing Nothing 0 -- | Parameters for Linen envelopes.-data Linen a =- Linen- {linen_attackTime :: a- ,linen_sustainTime :: a- ,linen_releaseTime :: a- ,linen_level :: a- ,linen_curve :: Envelope_Curve_3 a}+data Linen a = Linen+ { linen_attackTime :: a+ , linen_sustainTime :: a+ , linen_releaseTime :: a+ , linen_level :: a+ , linen_curve :: Envelope_Curve_3 a+ } -- | Sc3 defaults for Linen. linen_def :: Fractional t => Linen t-linen_def = let c = EnvLin in Linen 0.01 1 1 1 (c,c,c)+linen_def = let c = EnvLin in Linen 0.01 1 1 1 (c, c, c) -- | Record ('Linen') variant of 'envLinen'. envLinen_r :: Num a => Linen a -> Envelope a-envLinen_r (Linen aT sT rT lv (c0,c1,c2)) =- let l = [0,lv,lv,0]- t = [aT,sT,rT]- c = [c0,c1,c2]- in Envelope l t c Nothing Nothing 0+envLinen_r (Linen aT sT rT lv (c0, c1, c2)) =+ let l = [0, lv, lv, 0]+ t = [aT, sT, rT]+ c = [c0, c1, c2]+ in Envelope l t c Nothing Nothing 0 -- | Variant of 'envLinen' with user specified 'Envelope_Curve a'. envLinen_c :: Num a => a -> a -> a -> a -> Envelope_Curve_3 a -> Envelope a@@ -396,35 +421,37 @@ {- | Linear envelope parameter constructor. -> e = envLinen 0 1 0 1-> s = envelope_segments e-> p = pack_envelope_segments s-> p == (env_levels e,env_times e,env_curves e)+>>> let e = envLinen 0 1 0 1+>>> let s = envelope_segments e+>>> let p = pack_envelope_segments s+>>> p == (env_levels e,env_times e,env_curves e)+True -} envLinen :: Num a => a -> a -> a -> a -> Envelope a envLinen aT sT rT lv =- let c = (EnvLin,EnvLin,EnvLin)- in envLinen_c aT sT rT lv c+ let c = (EnvLin, EnvLin, EnvLin)+ in envLinen_c aT sT rT lv c --- | Parameters for Adsr envelopes.--- The sustain level is given as a proportion of the peak level.-data Adsr a =- Adsr- {adsr_attackTime :: a- ,adsr_decayTime :: a- ,adsr_sustainLevel :: a- ,adsr_releaseTime :: a- ,adsr_peakLevel :: a- ,adsr_curve :: Envelope_Curve_3 a- ,adsr_bias :: a}+{- | Parameters for Adsr envelopes.+ The sustain level is given as a proportion of the peak level.+-}+data Adsr a = Adsr+ { adsr_attackTime :: a+ , adsr_decayTime :: a+ , adsr_sustainLevel :: a+ , adsr_releaseTime :: a+ , adsr_peakLevel :: a+ , adsr_curve :: Envelope_Curve_3 a+ , adsr_bias :: a+ } -- | Sc3 defaults for Adsr. adsr_def :: Fractional n => Adsr n-adsr_def = let c = EnvNum (-4) in Adsr 0.01 0.3 0.5 1 1 (c,c,c) 0+adsr_def = let c = EnvNum (-4) in Adsr 0.01 0.3 0.5 1 1 (c, c, c) 0 -- | Attack, decay, sustain, release envelope parameter constructor. envAdsr :: Num a => a -> a -> a -> a -> a -> Envelope_Curve a -> a -> Envelope a-envAdsr aT dT sL rT pL c b = envAdsr_r (Adsr aT dT sL rT pL (c,c,c) b)+envAdsr aT dT sL rT pL c b = envAdsr_r (Adsr aT dT sL rT pL (c, c, c) b) -- | Variant with defaults for pL, c and b. envAdsr_def :: Num a => a -> a -> a -> a -> Envelope a@@ -432,48 +459,48 @@ -- | Record ('Adsr') variant of 'envAdsr'. envAdsr_r :: Num a => Adsr a -> Envelope a-envAdsr_r (Adsr aT dT sL rT pL (c0,c1,c2) b) =- let l = map (+ b) [0,pL,pL*sL,0]- t = [aT,dT,rT]- c = [c0,c1,c2]- in Envelope l t c (Just 2) Nothing 0+envAdsr_r (Adsr aT dT sL rT pL (c0, c1, c2) b) =+ let l = map (+ b) [0, pL, pL * sL, 0]+ t = [aT, dT, rT]+ c = [c0, c1, c2]+ in Envelope l t c (Just 2) Nothing 0 -- | Parameters for Roland type Adssr envelopes.-data Adssr a =- Adssr- {adssr_attackTime :: a- ,adssr_attackLevel :: a- ,adssr_decayTime :: a- ,adssr_decayLevel :: a- ,adssr_slopeTime :: a- ,adssr_sustainLevel :: a- ,adssr_releaseTime :: a- ,adssr_curve :: Envelope_Curve_4 a- ,adssr_bias :: a}+data Adssr a = Adssr+ { adssr_attackTime :: a+ , adssr_attackLevel :: a+ , adssr_decayTime :: a+ , adssr_decayLevel :: a+ , adssr_slopeTime :: a+ , adssr_sustainLevel :: a+ , adssr_releaseTime :: a+ , adssr_curve :: Envelope_Curve_4 a+ , adssr_bias :: a+ } -- | Attack, decay, slope, sustain, release envelope parameter constructor. envAdssr :: Num a => a -> a -> a -> a -> a -> a -> a -> Envelope_Curve a -> a -> Envelope a-envAdssr t1 l1 t2 l2 t3 l3 t4 c b = envAdssr_r (Adssr t1 l1 t2 l2 t3 l3 t4 (c,c,c,c) b)+envAdssr t1 l1 t2 l2 t3 l3 t4 c b = envAdssr_r (Adssr t1 l1 t2 l2 t3 l3 t4 (c, c, c, c) b) -- | Record ('Adssr') variant of 'envAdssr'. envAdssr_r :: Num a => Adssr a -> Envelope a-envAdssr_r (Adssr t1 l1 t2 l2 t3 l3 t4 (c1,c2,c3,c4) b) =- let l = map (+ b) [0,l1,l2,l3,0]- t = [t1,t2,t3,t4]- c = [c1,c2,c3,c4]- in Envelope l t c (Just 3) Nothing 0+envAdssr_r (Adssr t1 l1 t2 l2 t3 l3 t4 (c1, c2, c3, c4) b) =+ let l = map (+ b) [0, l1, l2, l3, 0]+ t = [t1, t2, t3, t4]+ c = [c1, c2, c3, c4]+ in Envelope l t c (Just 3) Nothing 0 -- | Parameters for Asr envelopes.-data Asr a =- Asr- {asr_attackTime :: a- ,asr_sustainLevel :: a- ,asr_releaseTime :: a- ,asr_curve :: Envelope_Curve_2 a}+data Asr a = Asr+ { asr_attackTime :: a+ , asr_sustainLevel :: a+ , asr_releaseTime :: a+ , asr_curve :: Envelope_Curve_2 a+ } -- | Sc3 default values for Asr. asr_def :: Fractional t => Asr t-asr_def = let c = EnvNum (-4) in Asr 0.01 1 1 (c,c)+asr_def = let c = EnvNum (-4) in Asr 0.01 1 1 (c, c) -- | Sc3 .asr has singular curve argument, hence _c suffix. envAsr_c :: Num a => a -> a -> a -> Envelope_Curve_2 a -> Envelope a@@ -481,41 +508,45 @@ {- | Attack, sustain, release envelope parameter constructor. -> c = 3-> r = Just [0,2,1,-99,0.1,3,c,0,0,2,c,0]-> envelope_sc3_array (envAsr 3 0.1 2 EnvSin) == r+>>> envelope_sc3_array (envAsr 3 0.1 2 EnvSin)+Just [0.0,2.0,1.0,-99.0,0.1,3.0,3.0,0.0,0.0,2.0,3.0,0.0] -} envAsr :: Num a => a -> a -> a -> Envelope_Curve a -> Envelope a-envAsr aT sL rT c = envAsr_c aT sL rT (c,c)+envAsr aT sL rT c = envAsr_c aT sL rT (c, c) -- | Record ('Asr') variant of 'envAsr'. envAsr_r :: Num a => Asr a -> Envelope a-envAsr_r (Asr aT sL rT (c0,c1)) =- let l = [0,sL,0]- t = [aT,rT]- c' = [c0,c1]- in Envelope l t c' (Just 1) Nothing 0+envAsr_r (Asr aT sL rT (c0, c1)) =+ let l = [0, sL, 0]+ t = [aT, rT]+ c' = [c0, c1]+ in Envelope l t c' (Just 1) Nothing 0 -- | All segments are horizontal lines. envStep :: Num a => [a] -> [a] -> Maybe Int -> Maybe Int -> Envelope a envStep levels times releaseNode loopNode =- if length levels /= length times+ if length levels /= length times then error "envStep: levels and times must have same size"- else let levels' = head levels : levels- in Envelope levels' times [EnvStep] releaseNode loopNode 0+ else+ let levels' = Safe.headNote "envStep" levels : levels+ in Envelope levels' times [EnvStep] releaseNode loopNode 0 --- | Segments given as triples of (time,level,curve). The final curve is ignored.------ > envXyc [(0, 1, EnvSin), (2.1, 0.5, EnvLin), (3, 1.4, EnvLin)]-envXyc :: Num n => [(n,n,Envelope_Curve n)] -> Envelope n+{- | Segments given as triples of (time,level,curve). The final curve is ignored.++>>> env_levels (envXyc [(0, 1, EnvSin), (2.1, 0.5, EnvLin), (3, 1.4, EnvLin)])+[1.0,0.5,1.4]+-}+envXyc :: Num n => [(n, n, Envelope_Curve n)] -> Envelope n envXyc xyc = let n = length xyc- (times,levels,curves) = unzip3 xyc+ (times, levels, curves) = unzip3 xyc offset = times !! 0 in Envelope levels (Base.d_dx' times) (take (n - 1) curves) Nothing Nothing offset --- | Variant where the input is sorted by time before processing.------ > envXyc_sort [(0, 1, EnvSin), (3, 1.4, EnvLin), (2.1, 0.5, EnvLin)]-envXyc_sort :: (Num n,Ord n) => [(n,n,Envelope_Curve n)] -> Envelope n-envXyc_sort = envXyc . Base.sort_on (\(x,_,_) -> x)+{- | Variant where the input is sorted by time before processing.++>>> env_levels (envXyc_sort [(0, 1, EnvSin), (3, 1.4, EnvLin), (2.1, 0.5, EnvLin)])+[1.0,0.5,1.4]+-}+envXyc_sort :: (Num n, Ord n) => [(n, n, Envelope_Curve n)] -> Envelope n+envXyc_sort = envXyc . Base.sort_on (\(x, _, _) -> x)
Sound/Sc3/Common/Help.hs view
@@ -18,7 +18,7 @@ -- | Directory containing Sc3 Rtf help files. sc3_rtf_help_dir :: IO FilePath-sc3_rtf_help_dir = getEnv "SC3_RTF_HELP_DIR"+sc3_rtf_help_dir = getEnv "Sc3_Rtf_Help_Dir" {- | Find (case-insensitively) indicated file at 'sc3_rtf_help_dir'. Runs the command "find -name" (so Unix only).@@ -30,7 +30,7 @@ sc3_rtf_find_file :: FilePath -> IO (Maybe FilePath) sc3_rtf_find_file fn = do d <- sc3_rtf_help_dir- r <- System.Process.readProcess "find" [d,"-iname",fn] ""+ r <- System.Process.readProcess "find" [d, "-iname", fn] "" case lines r of [] -> return Nothing [r0] -> return (Just r0)@@ -43,7 +43,7 @@ -- | Run the command unrtf (so UNIX only) to convert an RTF file to a TEXT (.scd) file. sc3_rtf_to_scd :: FilePath -> FilePath -> IO () sc3_rtf_to_scd rtf_fn scd_fn = do- txt <- System.Process.readProcess "unrtf" ["--text",rtf_fn] ""+ txt <- System.Process.readProcess "unrtf" ["--text", rtf_fn] "" let delete_trailing_whitespace = reverse . dropWhile isSpace . reverse tidy = unlines . map delete_trailing_whitespace . drop 4 . lines writeFile scd_fn (tidy txt)@@ -58,8 +58,8 @@ return scd_fn -- | 'sc3_rtf_help_translate' and run editor.-sc3_rtf_help_scd_open :: (String,[String]) -> String -> IO ()-sc3_rtf_help_scd_open (cmd,arg) nm = do+sc3_rtf_help_scd_open :: (String, [String]) -> String -> IO ()+sc3_rtf_help_scd_open (cmd, arg) nm = do scd_fn <- sc3_rtf_help_translate nm System.Process.callProcess cmd (arg ++ [scd_fn]) @@ -68,7 +68,7 @@ > sc3_rtf_help_scd_open_emacs "lfsaw" -} sc3_rtf_help_scd_open_emacs :: String -> IO ()-sc3_rtf_help_scd_open_emacs = sc3_rtf_help_scd_open ("emacsclient",["--no-wait"])+sc3_rtf_help_scd_open_emacs = sc3_rtf_help_scd_open ("emacsclient", ["--no-wait"]) -- * Sc-Doc (Html) @@ -76,65 +76,78 @@ sc3_scdoc_help_url :: String sc3_scdoc_help_url = "http://doc.sccode.org/" --- | Read the environment variable @SC3_SCDOC_HTML_HELP_DIR@.--- The default value is @~\/.local\/share\/SuperCollider/Help@.+{- | Read the environment variable @Sc3_ScDoc_Html_Help_Dir@.+ The default value is @~\/.local\/share\/SuperCollider/Help@.+-} sc3_scdoc_help_dir :: IO String sc3_scdoc_help_dir = do h <- getEnv "HOME" let d = h </> ".local/share/SuperCollider/Help"- Base.System.get_env_default "SC3_SCDOC_HTML_HELP_DIR" d+ Base.System.get_env_default "Sc3_ScDoc_Html_Help_Dir" d {- | Path to indicated Sc3 class help file. -> sc3_scdoc_help_class "SinOsc" == "Classes/SinOsc.html"+>>> sc3_scdoc_help_class "SinOsc"+"Classes/SinOsc.html" -} sc3_scdoc_help_class :: String -> String sc3_scdoc_help_class c = "Classes" </> c <.> "html" {- | Generate path to indicated Sc3 operator help file. -> sc3_scdoc_help_operator "+" == "Overviews/Operators.html#+"+>>> sc3_scdoc_help_operator "+"+"Overviews/Operators.html#+" -} sc3_scdoc_help_operator :: String -> FilePath sc3_scdoc_help_operator = (++) "Overviews/Operators.html#" {- | Generate path to indicated Sc3 method help. -> sc3_scdoc_help_method '*' ("C","m") == "Classes/C.html#*m"+>>> sc3_scdoc_help_method '*' ("C","m")+"Classes/C.html#*m" -}-sc3_scdoc_help_method :: Char -> (String,String) -> FilePath-sc3_scdoc_help_method z (c,m) = "Classes" </> c <.> "html#" ++ [z] ++ m+sc3_scdoc_help_method :: Char -> (String, String) -> FilePath+sc3_scdoc_help_method z (c, m) = "Classes" </> c <.> "html#" ++ [z] ++ m {- | Generate path to indicated Sc3 class method help. -> sc3_scdoc_help_class_method ("C","m") == "Classes/C.html#*m"+>>> sc3_scdoc_help_class_method ("C","m")+"Classes/C.html#*m" -}-sc3_scdoc_help_class_method :: (String,String) -> FilePath+sc3_scdoc_help_class_method :: (String, String) -> FilePath sc3_scdoc_help_class_method = sc3_scdoc_help_method '*' {- | Generate path to indicated Sc3 instance method help. -> sc3_scdoc_help_instance_method ("C","m") == "Classes/C.html#-m"+>>> sc3_scdoc_help_instance_method ("C","m")+"Classes/C.html#-m" -}-sc3_scdoc_help_instance_method :: (String,String) -> FilePath+sc3_scdoc_help_instance_method :: (String, String) -> FilePath sc3_scdoc_help_instance_method = sc3_scdoc_help_method '-' {- | Sc3 help path documenting x. -> sc3_scdoc_help_path "Operator.distort" == "Overviews/Operators.html#.distort"-> sc3_scdoc_help_path "Collection.*fill" == "Classes/Collection.html#*fill"-> sc3_scdoc_help_path "Collection.inject" == "Classes/Collection.html#-inject"-> sc3_scdoc_help_path "SinOsc" == "Classes/SinOsc.html"+>>> sc3_scdoc_help_path "Operator.distort"+"Overviews/Operators.html#distort"++>>> sc3_scdoc_help_path "Collection.*fill"+"Classes/Collection.html#*fill"++>>> sc3_scdoc_help_path "Collection.inject"+"Classes/Collection.html#-inject"++>>> sc3_scdoc_help_path "SinOsc"+"Classes/SinOsc.html" -} sc3_scdoc_help_path :: String -> String sc3_scdoc_help_path s = do case Split.splitOn "." s of- ["Operator",m] -> sc3_scdoc_help_operator m- [c,'*':m] -> sc3_scdoc_help_class_method (c,m)- [c,m] -> sc3_scdoc_help_instance_method (c,m)+ ["Operator", m] -> sc3_scdoc_help_operator m+ [c, '*' : m] -> sc3_scdoc_help_class_method (c, m)+ [c, m] -> sc3_scdoc_help_instance_method (c, m) _ -> sc3_scdoc_help_class s -{- | Open SC3 help path, either the local file or the online version.+{- | Open Sc3 help path, either the local file or the online version. Use @BROWSER@ or @x-www-browser@. > Base.System.get_env_default "BROWSER" "x-www-browser"@@ -158,10 +171,10 @@ -} sc3_scdoc_help_server_command_path :: String -> FilePath sc3_scdoc_help_server_command_path c =- let c' = case c of- '/':_ -> c- _ -> '/':c- in "Reference/Server-Command-Reference.html" ++ ('#' : c')+ let c' = case c of+ '/' : _ -> c+ _ -> '/' : c+ in "Reference/Server-Command-Reference.html" ++ ('#' : c') {- | 'sc3_scdoc_help_open' of 'sc3_server_command_path' @@ -170,8 +183,8 @@ -} sc3_scdoc_help_server_command_open :: Bool -> String -> IO () sc3_scdoc_help_server_command_open use_loc =- sc3_scdoc_help_open use_loc .- sc3_scdoc_help_server_command_path+ sc3_scdoc_help_open use_loc+ . sc3_scdoc_help_server_command_path -- * Fragments @@ -184,18 +197,99 @@ Fragments are separated by empty lines. A line containing the special character sequence ---- indicates the end of the fragments. -> on_lines_of split_multiple_fragments ";a\nb\n\n\n;c\nd" == [";a\nb\n",";c\nd\n"]+>>> on_lines_of split_multiple_fragments ";a\nb\n\n\n;c\nd"+[";a\nb\n",";c\nd\n"] -} split_multiple_fragments :: [String] -> [[String]] split_multiple_fragments = filter (not . null) . Split.splitOn [[]] --- | The text ---- indicates the end of graph fragments.+{- | The text '----' appearing anywhere in a line indicates the end of the graph fragments.+The text '# ' appearing at the start of a line also indicates the end of the graph fragments.++>>> drop_post_graph_section ["a","b","c","","----d","e","f"]+["a","b","c",""]++>>> drop_post_graph_section ["a","b","c","","----d","# e","","f"]+["a","b","c",""]+-} drop_post_graph_section :: [String] -> [String]-drop_post_graph_section = takeWhile (not . isInfixOf "----")+drop_post_graph_section =+ let isEnd x = "----" `isInfixOf` x || "# " `isPrefixOf` x+ in takeWhile (not . isEnd) +{- | Some help files are in Markdown format.+These are recognised by examing the first two characters, which must be a '#' and ' '.+-}+is_md_help :: String -> Bool+is_md_help x =+ case x of+ '#' : ' ' : _ -> True+ _ -> False++{- | There are two code block formats in markdown help files.+The first indents the block using a single tab or four spaces.+The second marks the start and end of the block by lines starting with three back ticks (`).++See:+<https://spec.commonmark.org/0.30/#indented-code-blocks>+and+<https://spec.commonmark.org/0.30/#fenced-code-blocks>+-}+data CodeBlockType = IndentedCodeBlock | FencedCodeBlock+ deriving (Bounded, Enum, Eq, Read, Show)++-- | Get code blocks from Markdown help file.+md_help_get_code_blocks :: [String] -> [(CodeBlockType, [String])]+md_help_get_code_blocks x =+ case x of+ [] -> []+ "```" : x' ->+ let (q, x'') = break (== "```") x'+ in (FencedCodeBlock, q) : md_help_get_code_blocks (drop 1 x'')+ ('\t' : _) : _ ->+ let (q, x') = span ((==) ['\t'] . take 1) x+ in (IndentedCodeBlock, (map (drop 1) q)) : md_help_get_code_blocks x'+ _ : x' ->+ md_help_get_code_blocks x'++is_doctest_block :: [String] -> Bool+is_doctest_block =+ let f x p = p `isPrefixOf` x+ in any (\x -> f x ">>> " || f x ">> ")++md_help_get_tab_indented_code_blocks :: [String] -> [[String]]+md_help_get_tab_indented_code_blocks =+ filter (not . is_doctest_block)+ . map snd+ . filter ((== IndentedCodeBlock) . fst)+ . md_help_get_code_blocks++{- | Get indented code blocks from Markdown help file.++>>> s <- readFile "/home/rohan/sw/spl/Help/Reference/AllpassC.help.sl"+>>> is_md_help s+True++>>> let b = md_help_get_fenced_code_blocks (lines s)+>>> length b+3+-}+md_help_get_fenced_code_blocks :: [String] -> [[String]]+md_help_get_fenced_code_blocks =+ filter (not . is_doctest_block)+ . map snd+ . filter ((== FencedCodeBlock) . fst)+ . md_help_get_code_blocks++get_help_file_fragments :: String -> [String]+get_help_file_fragments s =+ if is_md_help s+ then on_lines_of md_help_get_fenced_code_blocks s+ else on_lines_of (split_multiple_fragments . drop_post_graph_section) s+ -- | Read text fragments from file. read_file_fragments :: FilePath -> IO [String]-read_file_fragments = fmap (on_lines_of (split_multiple_fragments . drop_post_graph_section)) . readFile+read_file_fragments = fmap get_help_file_fragments . readFile -- | Read text fragments from set of files. read_file_set_fragments :: [FilePath] -> IO [String]
Sound/Sc3/Common/Help/Sc2.hs view
@@ -8,174 +8,231 @@ -} sc2_ugen_categories :: [(String, [String])] sc2_ugen_categories =- [("Analysis"- ,["Pitch"- ,"RunningSum"- ,"Slope"- ,"ZeroCrossing"])- ,("BinaryOps"- ,[])- ,("Buffers"- ,["TGrains"])- ,("Controls"- ,["DegreeToKey"- ,"GetTempo"- ,"Impulse"- ,"Index"- ,"Integrator"- ,"K2A"- ,"Lag"- ,"Latch"- ,"LFPulse"- ,"LFSaw"- ,"LFTri"- ,"LinExp"- ,"MouseX"- ,"MouseY"- ,"Osc1"- ,"Slew"- ,"WrapIndex"])- ,("Delays"- ,["AllpassC"- ,"CombC"- ,"Delay1"- ,"Delay2"- ,"DelayC"- ,"DelayWrite"- ,"MultiTapDelay"- ,"PingPongDelay"- ,"PitchShift"])- ,("Envelopes"- ,["Cutoff"- ,"Decay2"- ,"Decay"- ,"Ln"- ,"XLn"])- ,("Events"- ,["OverlapTexture"])- ,("Filters"- ,["BPF"- ,"BPZ2"- ,"BRF"- ,"BRZ2"- ,"Formlet"- ,"FOS"- ,"HPF"- ,"HPZ1"- ,"HPZ2"- ,"LeakDC"- ,"Limiter"- ,"LPF"- ,"LPZ1"- ,"LPZ2"- ,"Median"- ,"Normalizer"- ,"OnePole"- ,"OneZero"- ,"Resonz"- ,"RHPF"- ,"RingzBank"- ,"Ringz"- ,"RLPF"- ,"SOS"- ,"TwoPole"- ,"TwoZero"])- ,("Misc"- ,["Mix"])- ,("Noise"- ,["BrownNoise"- ,"ClipNoise"- ,"Crackle"- ,"Dust2"- ,"Dust"- ,"GrayNoise"- ,"LatoocarfianC"- ,"LFClipNoise"- ,"LFNoise0"- ,"LFNoise1"- ,"LFNoise2"- ,"LinCongC"- ,"PinkNoise"- ,"WhiteNoise"])- ,("Oscillators"- ,["Blip"- ,"Formant"- ,"FSinOsc"- ,"Impulse"- ,"LFPulse"- ,"LFSaw"- ,"LFTri"- ,"PMOsc"- ,"Pulse"- ,"Saw"- ,"SinOsc"- ,"SyncSaw"- ,"VarSaw"])- ,("Panners"- ,["LinPan2"- ,"LinXFade2"- ,"Pan2"- ,"PanAz"- ,"PanB"])- ,("Random"- ,["CoinGate"- ,"ExpRand"- ,"IRand"- ,"LinRand"- ,"NRand"- ,"Rand"- ,"TExpRand"- ,"TIRand"- ,"TRand"])- ,("Samples"- ,["AudioIn"- ,"BufRd"- ,"PlayBuf"])- ,("Triggers"- ,["Gate"- ,"InRange"- ,"PeakFollower"- ,"Phasor"- ,"PulseCount"- ,"PulseDivider"- ,"Schmidt"- ,"Stepper"- ,"Sweep"- ,"TDelay"- ,"Timer"- ,"ToggleFF"])- ,("UnaryOperators"- ,["abs"- ,"acos"- ,"ampdb"- ,"asin"- ,"atan"- ,"ceil"- ,"cos"- ,"cosh"- ,"cpsmidi"- ,"cpsoct"- ,"cubed"- ,"dbamp"- ,"distort"- ,"exp"- ,"floor"- ,"frac"- ,"isNegative"- ,"isPositive"- ,"isStrictlyPositive"- ,"log10"- ,"log2"- ,"log"- ,"midicps"- ,"neg"- ,"octcps"- ,"reciprocal"- ,"sign"- ,"sin"- ,"sinh"- ,"softclip"- ,"sqrt"- ,"squared"- ,"tan"- ,"tanh"])]+ [+ ( "Analysis"+ ,+ [ "Pitch"+ , "RunningSum"+ , "Slope"+ , "ZeroCrossing"+ ]+ )+ ,+ ( "BinaryOps"+ , []+ )+ ,+ ( "Buffers"+ , ["TGrains"]+ )+ ,+ ( "Controls"+ ,+ [ "DegreeToKey"+ , "GetTempo"+ , "Impulse"+ , "Index"+ , "Integrator"+ , "K2A"+ , "Lag"+ , "Latch"+ , "LFPulse"+ , "LFSaw"+ , "LFTri"+ , "LinExp"+ , "MouseX"+ , "MouseY"+ , "Osc1"+ , "Slew"+ , "WrapIndex"+ ]+ )+ ,+ ( "Delays"+ ,+ [ "AllpassC"+ , "CombC"+ , "Delay1"+ , "Delay2"+ , "DelayC"+ , "DelayWrite"+ , "MultiTapDelay"+ , "PingPongDelay"+ , "PitchShift"+ ]+ )+ ,+ ( "Envelopes"+ ,+ [ "Cutoff"+ , "Decay2"+ , "Decay"+ , "Ln"+ , "XLn"+ ]+ )+ ,+ ( "Events"+ , ["OverlapTexture"]+ )+ ,+ ( "Filters"+ ,+ [ "BPF"+ , "BPZ2"+ , "BRF"+ , "BRZ2"+ , "Formlet"+ , "FOS"+ , "HPF"+ , "HPZ1"+ , "HPZ2"+ , "LeakDC"+ , "Limiter"+ , "LPF"+ , "LPZ1"+ , "LPZ2"+ , "Median"+ , "Normalizer"+ , "OnePole"+ , "OneZero"+ , "Resonz"+ , "RHPF"+ , "RingzBank"+ , "Ringz"+ , "RLPF"+ , "SOS"+ , "TwoPole"+ , "TwoZero"+ ]+ )+ ,+ ( "Misc"+ , ["Mix"]+ )+ ,+ ( "Noise"+ ,+ [ "BrownNoise"+ , "ClipNoise"+ , "Crackle"+ , "Dust2"+ , "Dust"+ , "GrayNoise"+ , "LatoocarfianC"+ , "LFClipNoise"+ , "LFNoise0"+ , "LFNoise1"+ , "LFNoise2"+ , "LinCongC"+ , "PinkNoise"+ , "WhiteNoise"+ ]+ )+ ,+ ( "Oscillators"+ ,+ [ "Blip"+ , "Formant"+ , "FSinOsc"+ , "Impulse"+ , "LFPulse"+ , "LFSaw"+ , "LFTri"+ , "PMOsc"+ , "Pulse"+ , "Saw"+ , "SinOsc"+ , "SyncSaw"+ , "VarSaw"+ ]+ )+ ,+ ( "Panners"+ ,+ [ "LinPan2"+ , "LinXFade2"+ , "Pan2"+ , "PanAz"+ , "PanB"+ ]+ )+ ,+ ( "Random"+ ,+ [ "CoinGate"+ , "ExpRand"+ , "IRand"+ , "LinRand"+ , "NRand"+ , "Rand"+ , "TExpRand"+ , "TIRand"+ , "TRand"+ ]+ )+ ,+ ( "Samples"+ ,+ [ "AudioIn"+ , "BufRd"+ , "PlayBuf"+ ]+ )+ ,+ ( "Triggers"+ ,+ [ "Gate"+ , "InRange"+ , "PeakFollower"+ , "Phasor"+ , "PulseCount"+ , "PulseDivider"+ , "Schmidt"+ , "Stepper"+ , "Sweep"+ , "TDelay"+ , "Timer"+ , "ToggleFF"+ ]+ )+ ,+ ( "UnaryOperators"+ ,+ [ "abs"+ , "acos"+ , "ampdb"+ , "asin"+ , "atan"+ , "ceil"+ , "cos"+ , "cosh"+ , "cpsmidi"+ , "cpsoct"+ , "cubed"+ , "dbamp"+ , "distort"+ , "exp"+ , "floor"+ , "frac"+ , "isNegative"+ , "isPositive"+ , "isStrictlyPositive"+ , "log10"+ , "log2"+ , "log"+ , "midicps"+ , "neg"+ , "octcps"+ , "reciprocal"+ , "sign"+ , "sin"+ , "sinh"+ , "softclip"+ , "sqrt"+ , "squared"+ , "tan"+ , "tanh"+ ]+ )+ ]
Sound/Sc3/Common/Math.hs view
@@ -8,15 +8,19 @@ import qualified Sound.Sc3.Common.Base as Common.Base {- hsc3 -} --- | Half pi.------ > half_pi == 1.5707963267948966+{- | Half pi.++>>> half_pi+1.5707963267948966+-} half_pi :: Floating a => a half_pi = pi / 2 --- | Two pi.------ > two_pi == 6.283185307179586+{- | Two pi.++>>> two_pi+6.283185307179586+-} two_pi :: Floating n => n two_pi = 2 * pi @@ -24,27 +28,43 @@ absdif :: Num a => a -> a -> a absdif i j = abs (j - i) --- | SC3 MulAdd type signature, arguments in SC3 order of input, multiply, add.-type SC3_MulAdd t = t -> t -> t -> t+-- | Sc3 MulAdd type signature, arguments in Sc3 order of input, multiply, add.+type Sc3_MulAdd t = t -> t -> t -> t --- | Ordinary (un-optimised) multiply-add, see also mulAdd Ugen.------ > sc3_mul_add 2 3 4 == 2 * 3 + 4--- > map (\x -> sc3_mul_add x 2 3) [1,5] == [5,13] && map (\x -> sc3_mul_add x 3 2) [1,5] == [5,17]-sc3_mul_add :: Num t => SC3_MulAdd t+{- | Ordinary (un-optimised) multiply-add, see also mulAdd Ugen.++>>> sc3_mul_add 2 3 4 == 2 * 3 + 4+True++>>> map (\x -> sc3_mul_add x 2 3) [1,5]+[5,13]++>>> map (\x -> sc3_mul_add x 3 2) [1,5]+[5,17]+-}+sc3_mul_add :: Num t => Sc3_MulAdd t sc3_mul_add i m a = i * m + a --- | Ordinary Haskell order (un-optimised) multiply-add.------ > mul_add 3 4 2 == 2 * 3 + 4--- > map (mul_add 2 3) [1,5] == [5,13] && map (mul_add 3 4) [1,5] == [7,19]+{- | Ordinary Haskell order (un-optimised) multiply-add.++>>> mul_add 3 4 2 == 2 * 3 + 4+True++>>> map (mul_add 2 3) [1,5]+[5,13]++>> map (mul_add 3 4) [1,5]+[7,19]+-} mul_add :: Num t => t -> t -> t -> t mul_add m a = (+ a) . (* m) --- | 'uncurry' 'mul_add'------ > mul_add_hs (3,4) 2 == 2 * 3 + 4-mul_add_hs :: Num t => (t,t) -> t -> t+{- | 'uncurry' 'mul_add'++>>> mul_add_hs (3,4) 2 == 2 * 3 + 4+True+-}+mul_add_hs :: Num t => (t, t) -> t -> t mul_add_hs = uncurry mul_add -- | 'fromInteger' of 'truncate'.@@ -63,13 +83,17 @@ sc3_floor :: RealFrac a => a -> a sc3_floor = fromInteger . floor --- | Variant of @SC3@ @roundTo@ function.------ > sc3_round_to (2/3) 0.25 == 0.75------ > let r = [0,0,0.25,0.25,0.5,0.5,0.5,0.75,0.75,1,1]--- > map (`sc3_round_to` 0.25) [0,0.1 .. 1] == r--- > map (`sc3_round_to` 5.0) [100.0 .. 110.0]+{- | Variant of @Sc3@ @roundTo@ function.++>>> sc3_round_to (2/3) 0.25+0.75++>>> map (`sc3_round_to` 0.25) [0,0.1 .. 1]+[0.0,0.0,0.25,0.25,0.5,0.5,0.5,0.75,0.75,1.0,1.0]++>>> map (`sc3_round_to` 5.0) [100.0 .. 110.0]+[100.0,100.0,100.0,105.0,105.0,105.0,105.0,105.0,110.0,110.0,110.0]+-} sc3_round_to :: RealFrac n => n -> n -> n sc3_round_to a b = if b == 0 then a else sc3_floor ((a / b) + 0.5) * b @@ -84,12 +108,23 @@ makes it consistent with the lattice-theoretical interpretation and its idempotency, commutative, associative, absorption laws. -> lcm 4 6 == 12-> lcm 1 1 == 1-> lcm 1624 26 == 21112-> lcm 1624 (-26) /= (-21112)-> lcm (-1624) (-26) /= (-21112)-> lcm 513 (gcd 513 44) == 513+>>> lcm 4 6+12++>>> lcm 1 1+1++>>> lcm 1624 26+21112++>>> lcm 1624 (-26) /= (-21112)+True++>>> lcm (-1624) (-26) /= (-21112)+True++>>> lcm 513 (gcd 513 44)+513 -} sc3_lcm :: t -> t -> t sc3_lcm = error "sc3_lcm: undefined"@@ -102,42 +137,70 @@ interpretation and its idempotency, commutative, associative, absorption laws. <https://www.jsoftware.com/papers/eem/gcd.htm> -> gcd 4 6 == 2-> gcd 0 1 == 1-> gcd 1024 256 == 256-> gcd 1024 (-256) == 256-> gcd (-1024) (-256) /= (-256)-> gcd (-1024) (lcm (-1024) 256) /= (-1024)-> gcd 66 54 * lcm 66 54 == 66 * 54+>>> gcd 4 6+2 +>>> gcd 0 1+1++>>> gcd 1024 256+256++>>> gcd 1024 (-256)+256++>>> gcd (-1024) (-256) /= (-256)+True++>>> gcd (-1024) (lcm (-1024) 256) /= (-1024)+True++>>> gcd 66 54 * lcm 66 54 == 66 * 54+True -} sc3_gcd :: t -> t -> t sc3_gcd = error "sc3_gcd: undefined" -{- | The SC3 @%@ Ugen operator is the 'Data.Fixed.mod'' function.+{- | The Sc3 @%@ Ugen operator is the 'Data.Fixed.mod'' function. -> > 1.5 % 1.2 // ~= 0.3-> > -1.5 % 1.2 // ~= 0.9-> > 1.5 % -1.2 // ~= -0.9-> > -1.5 % -1.2 // ~= -0.3+> 1.5 % 1.2 // ~= 0.3+> -1.5 % 1.2 // ~= 0.9+> 1.5 % -1.2 // ~= -0.9+> -1.5 % -1.2 // ~= -0.3 -> let (%) = sc3_mod-> 1.5 % 1.2 ~= 0.3-> (-1.5) % 1.2 ~= 0.9-> 1.5 % (-1.2) ~= -0.9-> (-1.5) % (-1.2) ~= -0.3+>>> let (~=) p q = abs (p - q) < 0.000001+>>> let (%) = sc3_mod+>>> (1.5 % 1.2) ~= 0.3+True -> > 1.2 % 1.5 // ~= 1.2-> > -1.2 % 1.5 // ~= 0.3-> > 1.2 % -1.5 // ~= -0.3-> > -1.2 % -1.5 // ~= -1.2+>>> ((-1.5) % 1.2) ~= 0.9+True -> 1.2 % 1.5 ~= 1.2-> (-1.2) % 1.5 ~= 0.3-> 1.2 % (-1.5) ~= -0.3-> (-1.2) % (-1.5) ~= -1.2+>>> (1.5 % (-1.2)) ~= (-0.9)+True -> map (\n -> sc3_mod n 12.0) [-1.0,12.25,15.0] == [11.0,0.25,3.0]+>>> ((-1.5) % (-1.2)) ~= (-0.3)+True++> 1.2 % 1.5 // ~= 1.2+> -1.2 % 1.5 // ~= 0.3+> 1.2 % -1.5 // ~= -0.3+> -1.2 % -1.5 // ~= -1.2++>>> (1.2 % 1.5) ~= 1.2+True++>>> ((-1.2) % 1.5) ~= 0.3+True++>>> (1.2 % (-1.5)) ~= (-0.3)+True++>>> ((-1.2) % (-1.5)) ~= (-1.2)+True++>>> map (\n -> sc3_mod n 12.0) [-1.0,12.25,15.0]+[11.0,0.25,3.0] -} sc3_mod :: RealFrac n => n -> n -> n sc3_mod = Data.Fixed.mod'@@ -150,136 +213,183 @@ fmod_f64 :: Double -> Double -> Double fmod_f64 = sc3_mod --- | @SC3@ clip function. Clip /n/ to within range /(i,j)/. 'clip' is a 'Ugen'.------ > map (\n -> sc3_clip n 5 10) [3..12] == [5,5,5,6,7,8,9,10,10,10]+{- | @Sc3@ clip function. Clip /n/ to within range /(i,j)/. 'clip' is a 'Ugen'.++>>> map (\n -> sc3_clip n 5 10) [3..12]+[5,5,5,6,7,8,9,10,10,10]+-} sc3_clip :: Ord a => a -> a -> a -> a sc3_clip n i j = if n < i then i else if n > j then j else n --- | Variant of 'sc3_clip' with haskell argument structure.------ > map (clip_hs (5,10)) [3..12] == [5,5,5,6,7,8,9,10,10,10]-clip_hs :: (Ord a) => (a,a) -> a -> a-clip_hs (i,j) n = sc3_clip n i j+{- | Variant of 'sc3_clip' with haskell argument structure. --- | Fractional modulo, alternate implementation.------ > map (\n -> sc3_mod_alt n 12.0) [-1.0,12.25,15.0] == [11.0,0.25,3.0]+>>> map (clip_hs (5,10)) [3..12]+[5,5,5,6,7,8,9,10,10,10]+-}+clip_hs :: (Ord a) => (a, a) -> a -> a+clip_hs (i, j) n = sc3_clip n i j++{- | Fractional modulo, alternate implementation.++>>> map (\n -> sc3_mod_alt n 12.0) [-1.0,12.25,15.0]+[11.0,0.25,3.0]+-} sc3_mod_alt :: RealFrac a => a -> a -> a sc3_mod_alt n hi =- let lo = 0.0- in if n >= lo && n < hi- then n- else if hi == lo- then lo- else n - hi * sc3_floor (n / hi)+ let lo = 0.0+ in if n >= lo && n < hi+ then n+ else+ if hi == lo+ then lo+ else n - hi * sc3_floor (n / hi) {- | Wrap function that is /non-inclusive/ at right edge, ie. the Wrap Ugen rule. -> map (sc3_wrap_ni 0 5) [4,5,6] == [4,0,1]-> map (sc3_wrap_ni 5 10) [3..12] == [8,9,5,6,7,8,9,5,6,7]-> Sound.Sc3.Plot.plot_fn_r1_ln (sc3_wrap_ni (-1) 1) (-2,2)+>>> map (round . sc3_wrap_ni 0 5) [4,5,6]+[4,0,1] +>>> map (round . sc3_wrap_ni 5 10) [3..12]+[8,9,5,6,7,8,9,5,6,7]++> Sound.Sc3.Plot.plot_fn_r1_ln (sc3_wrap_ni (-1) 1) (-2,2) -} sc3_wrap_ni :: RealFrac a => a -> a -> a -> a sc3_wrap_ni lo hi n = sc3_mod (n - lo) (hi - lo) + lo {- | sc_wrap::int -> > [5,6].wrap(0,5) == [5,0]-> map (wrap_hs_int (0,5)) [5,6] == [5,0]+> [5,6].wrap(0,5) == [5,0] -> > [9,10,5,6,7,8,9,10,5,6].wrap(5,10) == [9,10,5,6,7,8,9,10,5,6]-> map (wrap_hs_int (5,10)) [3..12] == [9,10,5,6,7,8,9,10,5,6]+>>> map (wrap_hs_int (0,5)) [5,6]+[5,0]++> [9,10,5,6,7,8,9,10,5,6].wrap(5,10) == [9,10,5,6,7,8,9,10,5,6]++>>> map (wrap_hs_int (5,10)) [3..12]+[9,10,5,6,7,8,9,10,5,6] -} wrap_hs_int :: Integral a => (a, a) -> a -> a-wrap_hs_int (i,j) n = ((n - i) `mod` (j - i + 1)) + i+wrap_hs_int (i, j) n = ((n - i) `mod` (j - i + 1)) + i {- | Wrap /n/ to within range /(i,j)/, ie. @AbstractFunction.wrap@, ie. /inclusive/ at right edge. 'wrap' is a 'Ugen', hence prime. -> > [5.0,6.0].wrap(0.0,5.0) == [0.0,1.0]-> map (wrap_hs (0,5)) [5,6] == [0,1]-> map (wrap_hs (5,10)) [3..12] == [8,9,5,6,7,8,9,5,6,7]+> [5.0,6.0].wrap(0.0,5.0) == [0.0,1.0] -> Sound.Sc3.Plot.plot_fn_r1_ln (wrap_hs (-1,1)) (-2,2)+>>> map (round . wrap_hs (0,4)) [-1,0 .. 5]+[3,0,1,2,3,0,1] +>>> map (round . wrap_hs (0,5)) [5,6]+[0,1]++>>> map (round . wrap_hs (5,10)) [3..12]+[8,9,5,6,7,8,9,5,6,7]++> Sound.Sc3.Plot.plot_fn_r1_ln (wrap_hs (-1,1)) (-2,2) -}-wrap_hs :: RealFrac n => (n,n) -> n -> n-wrap_hs (i,j) n =- let r = j - i -- + 1- n' = if n >= j then n - r else if n < i then n + r else n- in if n' >= i && n' < j- then n'- else n' - r * sc3_floor ((n' - i) / r)+wrap_hs :: RealFrac n => (n, n) -> n -> n+wrap_hs (i, j) n =+ let r = j - i -- + 1+ n' = if n >= j then n - r else if n < i then n + r else n+ in if n' >= i && n' < j+ then n'+ else n' - r * sc3_floor ((n' - i) / r) --- | Variant of 'wrap_hs' with @SC3@ argument ordering.------ > map (\n -> sc3_wrap n 5 10) [3..12] == map (wrap_hs (5,10)) [3..12]+{- | Variant of 'wrap_hs' with @Sc3@ argument ordering.++>>> map (\n -> sc3_wrap n 5 10) [3..12] == map (wrap_hs (5,10)) [3..12]+True++>>> map (\n -> sc3_wrap n 0 4) [-1, 0 .. 5]+[3.0,0.0,1.0,2.0,3.0,0.0,1.0]+-} sc3_wrap :: RealFrac n => n -> n -> n -> n-sc3_wrap a b c = wrap_hs (b,c) a+sc3_wrap index start end = wrap_hs (start, end) index {- | Generic variant of 'wrap''. -> > [5,6].wrap(0,5) == [5,0]-> map (generic_wrap (0,5)) [5,6] == [5,0]+> [5,6].wrap(0,5) == [5,0] -> > [9,10,5,6,7,8,9,10,5,6].wrap(5,10) == [9,10,5,6,7,8,9,10,5,6]-> map (generic_wrap (5::Integer,10)) [3..12] == [9,10,5,6,7,8,9,10,5,6]+>>> map (generic_wrap (0,5)) [5,6]+[5,0]++> [9,10,5,6,7,8,9,10,5,6].wrap(5,10) == [9,10,5,6,7,8,9,10,5,6]++>>> map (generic_wrap (5::Integer,10)) [3..12]+[9,10,5,6,7,8,9,10,5,6] -}-generic_wrap :: (Ord a, Num a) => (a,a) -> a -> a-generic_wrap (l,r) n =- let d = r - l + 1- f = generic_wrap (l,r)- in if n < l- then f (n + d)- else if n > r then f (n - d) else n+generic_wrap :: (Ord a, Num a) => (a, a) -> a -> a+generic_wrap (l, r) n =+ let d = r - l + 1+ f = generic_wrap (l, r)+ in if n < l+ then f (n + d)+ else if n > r then f (n - d) else n --- | Given sample-rate /sr/ and bin-count /n/ calculate frequency of /i/th bin.------ > bin_to_freq 44100 2048 32 == 689.0625+{- | Given sample-rate /sr/ and bin-count /n/ calculate frequency of /i/th bin.++>>> bin_to_freq 44100 2048 32+689.0625+-} bin_to_freq :: (Fractional n, Integral i) => n -> i -> i -> n bin_to_freq sr n i = fromIntegral i * sr / fromIntegral n --- | Fractional midi note number to cycles per second.------ > map (floor . midi_to_cps) [0,24,69,120,127] == [8,32,440,8372,12543]--- > map (floor . midi_to_cps) [-36,138] == [1,23679]--- > map (floor . midi_to_cps) [69.0,69.25 .. 70.0] == [440,446,452,459,466]+{- | Fractional midi note number to cycles per second.++>>> map (floor . midi_to_cps) [0,24,69,120,127]+[8,32,440,8372,12543]++>>> map (floor . midi_to_cps) [-36,138]+[1,23679]++>>> map (floor . midi_to_cps) [69.0,69.25 .. 70.0]+[440,446,452,459,466]+-} midi_to_cps :: Floating a => a -> a midi_to_cps i = 440.0 * (2.0 ** ((i - 69.0) * (1.0 / 12.0))) --- | Cycles per second to fractional midi note number.------ > map (round . cps_to_midi) [8,32,440,8372,12543] == [0,24,69,120,127]--- > map (round . cps_to_midi) [1,24000] == [-36,138]+{- | Cycles per second to fractional midi note number.++>>> map (round . cps_to_midi) [8,32,440,8372,12543]+[0,24,69,120,127]++>>> map (round . cps_to_midi) [1,24000]+[-36,138]+-} cps_to_midi :: Floating a => a -> a cps_to_midi a = (logBase 2 (a * (1.0 / 440.0)) * 12.0) + 69.0 --- | Cycles per second to linear octave (4.75 = A4 = 440).------ > map (cps_to_oct . midi_to_cps) [60,63,69] == [4.0,4.25,4.75]+{- | Cycles per second to linear octave (4.75 = A4 = 440).++>>> map (cps_to_oct . midi_to_cps) [60,63,69]+[4.0,4.25,4.75]+-} cps_to_oct :: Floating a => a -> a cps_to_oct a = logBase 2 (a * (1.0 / 440.0)) + 4.75 --- | Linear octave to cycles per second.------ > > [4.0,4.25,4.75].octcps.cpsmidi == [60,63,69]--- > map (cps_to_midi . oct_to_cps) [4.0,4.25,4.75] == [60,63,69]+{- | Linear octave to cycles per second.++> [4.0,4.25,4.75].octcps.cpsmidi == [60,63,69]++>>> map (cps_to_midi . oct_to_cps) [4.0,4.25,4.75]+[60.0,63.0,69.0]+-} oct_to_cps :: Floating a => a -> a oct_to_cps a = 440.0 * (2.0 ** (a - 4.75)) -- | Degree, scale and steps per octave to key. degree_to_key :: RealFrac a => [a] -> a -> a -> a degree_to_key s n d =- let l = length s- d' = round d- a = (d - fromIntegral d') * 10.0 * (n / 12.0)- in (n * fromIntegral (d' `div` l)) + Common.Base.at_with_error_message "degree_to_key" s (d' `mod` l) + a+ let l = length s+ d' = round d+ a = (d - fromIntegral d') * 10.0 * (n / 12.0)+ in (n * fromIntegral (d' `div` l)) + Common.Base.at_with_error_message "degree_to_key" s (d' `mod` l) + a {- | One-indexed piano key number (for standard 88 key piano) to midi note number. -> map pianokey_to_midi [1,49,88] == [21,69,108]+>>> map pianokey_to_midi [1,49,88]+[21,69,108] -} pianokey_to_midi :: Num n => n -> n pianokey_to_midi = (+) 20@@ -288,82 +398,104 @@ This is useful as a more musical gamut than midi note numbers. Ie. if x is in (0,1) then pianokey_to_cps of (x * 88) is in (26,4168) -> map (round . pianokey_to_cps) [0,1,40,49,88] == [26,28,262,440,4186]-> map (round . midi_to_cps) [0,60,69,127] == [8,262,440,12544]+>>> map (round . pianokey_to_cps) [0,1,40,49,88]+[26,28,262,440,4186]++>>> map (round . midi_to_cps) [0,60,69,127]+[8,262,440,12544] -} pianokey_to_cps :: Floating n => n -> n pianokey_to_cps = midi_to_cps . pianokey_to_midi --- | Linear amplitude to decibels.------ > map (round . amp_to_db) [0.01,0.05,0.0625,0.125,0.25,0.5] == [-40,-26,-24,-18,-12,-6]+{- | Linear amplitude to decibels.++>>> map (round . amp_to_db) [0.01,0.05,0.0625,0.125,0.25,0.5]+[-40,-26,-24,-18,-12,-6]+-} amp_to_db :: Floating a => a -> a amp_to_db = (* 20) . logBase 10 {- | Decibels to linear amplitude. -map (floor . (* 100). db_to_amp) [-40,-26,-24,-18,-12,-6] == [01,05,06,12,25,50]+>>> map (floor . (* 100). db_to_amp) [-40,-26,-24,-18,-12,-6]+[1,5,6,12,25,50] -let amp = map (2 **) [0 .. 15]-let db = [0,-6 .. -90]-map (round . ampDb . (/) 1) amp == db-map (round . amp_to_db . (/) 1) amp == db- zip amp db+>>> let amp = map (2 **) [0 .. 15]+>>> let db = [0,-6 .. -90]+>>> map (round . amp_to_db . (/) 1) amp == db+True -db_to_amp (-3) == 0.7079457843841379-amp_to_db 0.7079457843841379 == -3+>>> db_to_amp (-3)+0.7079457843841379++>>> amp_to_db 0.7079457843841379+-3.0 -} db_to_amp :: Floating a => a -> a-db_to_amp = (10 **) . (* 0.05)+db_to_amp = (10 **) . (* 0.05) --- | Fractional midi note interval to frequency multiplier.------ > map midi_to_ratio [-12,0,7,12] == [0.5,1,1.4983070768766815,2]+{- | Fractional midi note interval to frequency multiplier.++>>> map midi_to_ratio [-12,0,7,12]+[0.5,1.0,1.4983070768766815,2.0]+-} midi_to_ratio :: Floating a => a -> a midi_to_ratio a = 2.0 ** (a * (1.0 / 12.0)) --- | Inverse of 'midi_to_ratio'.------ > map ratio_to_midi [3/2,2] == [7.019550008653875,12]+{- | Inverse of 'midi_to_ratio'.++>>> map ratio_to_midi [3/2,2]+[7.019550008653875,12.0]+-} ratio_to_midi :: Floating a => a -> a ratio_to_midi a = 12.0 * logBase 2 a --- | /sr/ = sample rate, /r/ = cycle (two-pi), /cps/ = frequency------ > cps_to_incr 48000 128 375 == 1--- > cps_to_incr 48000 two_pi 458.3662361046586 == 6e-2+{- | /sr/ = sample rate, /r/ = cycle (two-pi), /cps/ = frequency++>>> cps_to_incr 48000 128 375+1.0++>>> cps_to_incr 48000 two_pi 458.3662361046586+6.0e-2+-} cps_to_incr :: Fractional a => a -> a -> a -> a cps_to_incr sr r cps = (r / sr) * cps --- | Inverse of 'cps_to_incr'.------ > incr_to_cps 48000 128 1 == 375+{- | Inverse of 'cps_to_incr'.++>>> incr_to_cps 48000 128 1+375.0+-} incr_to_cps :: Fractional a => a -> a -> a -> a incr_to_cps sr r ic = ic / (r / sr) -- | Pan2 function, identity is linear, sqrt is equal power. pan2_f :: Fractional t => (t -> t) -> t -> t -> (t, t) pan2_f f p q =- let q' = (q / 2) + 0.5- in (p * f (1 - q'),p * f q')+ let q' = (q / 2) + 0.5+ in (p * f (1 - q'), p * f q') --- | Linear pan.------ > map (lin_pan2 1) [-1,-0.5,0,0.5,1] == [(1,0),(0.75,0.25),(0.5,0.5),(0.25,0.75),(0,1)]+{- | Linear pan.++>>> map (lin_pan2 1) [-1,-0.5,0,0.5,1]+[(1.0,0.0),(0.75,0.25),(0.5,0.5),(0.25,0.75),(0.0,1.0)]+-} lin_pan2 :: Fractional t => t -> t -> (t, t) lin_pan2 = pan2_f id --- | Equal power pan.------ > map (eq_pan2 1) [-1,-0.5,0,0.5,1]+{- | Equal power pan.++>>> map (eq_pan2 1) [-1,-0.5,0,0.5,1]+[(1.0,0.0),(0.8660254037844386,0.5),(0.7071067811865476,0.7071067811865476),(0.5,0.8660254037844386),(0.0,1.0)]+-} eq_pan2 :: Floating t => t -> t -> (t, t) eq_pan2 = pan2_f sqrt -- | 'fromInteger' of 'properFraction'.-sc3_properFraction :: RealFrac t => t -> (t,t)+sc3_properFraction :: RealFrac t => t -> (t, t) sc3_properFraction a =- let (p,q) = properFraction a- in (fromInteger p,q)+ let (p, q) = properFraction a+ in (fromInteger p, q) -- | a^2 - b^2. sc3_dif_sqr :: Num a => a -> a -> a@@ -377,27 +509,31 @@ sc3_hypotx :: (Ord a, Floating a) => a -> a -> a sc3_hypotx x y = abs x + abs y - ((sqrt 2 - 1) * min (abs x) (abs y)) --- | Fold /k/ to within range /(i,j)/, ie. @AbstractFunction.fold@------ > map (foldToRange 5 10) [3..12] == [7,6,5,6,7,8,9,10,9,8]-foldToRange :: (Ord a,Num a) => a -> a -> a -> a+{- | Fold /k/ to within range /(i,j)/, ie. @AbstractFunction.fold@++>>> map (foldToRange 5 10) [3..12]+[7,6,5,6,7,8,9,10,9,8]+-}+foldToRange :: (Ord a, Num a) => a -> a -> a -> a foldToRange i j =- let f n = if n > j- then f (j - (n - j))- else if n < i- then f (i - (n - i))- else n- in f+ let f n =+ if n > j+ then f (j - (n - j))+ else+ if n < i+ then f (i - (n - i))+ else n+ in f --- | Variant of 'foldToRange' with @SC3@ argument ordering.-sc3_fold :: (Ord a,Num a) => a -> a -> a -> a+-- | Variant of 'foldToRange' with @Sc3@ argument ordering.+sc3_fold :: (Ord a, Num a) => a -> a -> a -> a sc3_fold n i j = foldToRange i j n --- | SC3 distort operator.+-- | Sc3 distort operator. sc3_distort :: Fractional n => n -> n sc3_distort x = x / (1 + abs x) --- | SC3 softclip operator.+-- | Sc3 softclip operator. sc3_softclip :: (Ord n, Fractional n) => n -> n sc3_softclip x = let x' = abs x in if x' <= 0.5 then x else (x' - 0.25) / x @@ -411,11 +547,15 @@ sc3_false :: Num n => n sc3_false = 0 --- | Lifted 'not'.------ > sc3_not sc3_true == sc3_false--- > sc3_not sc3_false == sc3_true-sc3_not :: (Ord n,Num n) => n -> n+{- | Lifted 'not'.++>>> sc3_not sc3_true == sc3_false+True++>>> sc3_not sc3_false == sc3_true+True+-}+sc3_not :: (Ord n, Num n) => n -> n sc3_not = sc3_bool . (<= 0) -- | Translate 'Bool' to 'sc3_true' and 'sc3_false'.@@ -458,139 +598,177 @@ -- | Enumeration of clipping rules. data Clip_Rule = Clip_None | Clip_Left | Clip_Right | Clip_Both- deriving (Enum,Bounded)+ deriving (Enum, Bounded) --- | Clip a value that is expected to be within an input range to an output range,--- according to a rule.------ > let f r = map (\x -> apply_clip_rule r 0 1 (-1) 1 x) [-1,0,0.5,1,2]--- > in map f [minBound .. maxBound]+{- | Clip a value that is expected to be within an input range to an output range, according to a rule.++>>> let f r = map (\x -> apply_clip_rule r 0 1 (-1) 1 x) [-1,0,0.5,1,2]+>>> map f [minBound .. maxBound]+[[Nothing,Nothing,Nothing,Nothing,Nothing],[Just (-1.0),Just (-1.0),Nothing,Nothing,Nothing],[Nothing,Nothing,Nothing,Just 1.0,Just 1.0],[Just (-1.0),Just (-1.0),Nothing,Just 1.0,Just 1.0]]+-} apply_clip_rule :: Ord n => Clip_Rule -> n -> n -> n -> n -> n -> Maybe n apply_clip_rule clip_rule sl sr dl dr x =- case clip_rule of- Clip_None -> Nothing- Clip_Left -> if x <= sl then Just dl else Nothing- Clip_Right -> if x >= sr then Just dr else Nothing- Clip_Both -> if x <= sl then Just dl else if x >= sr then Just dr else Nothing+ case clip_rule of+ Clip_None -> Nothing+ Clip_Left -> if x <= sl then Just dl else Nothing+ Clip_Right -> if x >= sr then Just dr else Nothing+ Clip_Both -> if x <= sl then Just dl else if x >= sr then Just dr else Nothing -- * LinLin -- | Scale uni-polar (0,1) input to linear (l,r) range.-urange_ma :: Fractional a => SC3_MulAdd a -> a -> a -> a -> a+urange_ma :: Fractional a => Sc3_MulAdd a -> a -> a -> a -> a urange_ma mul_add_f l r i = mul_add_f i (r - l) l --- | Scale (0,1) input to linear (l,r) range. u = uni-polar.------ > map (urange 3 4) [0,0.5,1] == [3,3.5,4]+{- | Scale (0,1) input to linear (l,r) range. u = uni-polar.++>>> map (urange 3 4) [0,0.5,1]+[3.0,3.5,4.0]+-} urange :: Fractional a => a -> a -> a -> a urange = urange_ma sc3_mul_add --- | Calculate multiplier and add values for (-1,1) 'range' transform.------ > range_muladd 3 4 == (0.5,3.5)-range_muladd :: Fractional t => t -> t -> (t,t)+{- | Calculate multiplier and add values for (-1,1) 'range' transform.++>>> range_muladd 3 4+(0.5,3.5)+-}+range_muladd :: Fractional t => t -> t -> (t, t) range_muladd = linlin_muladd (-1) 1 --- | Scale bi-polar (-1,1) input to linear (l,r) range. Note that the--- argument order is not the same as 'linLin'.-range_ma :: Fractional a => SC3_MulAdd a -> a -> a -> a -> a+{- | Scale bi-polar (-1,1) input to linear (l,r) range.+Note that the argument order is not the same as 'linLin'.+-}+range_ma :: Fractional a => Sc3_MulAdd a -> a -> a -> a -> a range_ma mul_add_f l r i =- let (m,a) = range_muladd l r+ let (m, a) = range_muladd l r in mul_add_f i m a --- | Scale (-1,1) input to linear (l,r) range. Note that the argument--- order is not the same as 'linlin'. Note also that the various range--- Ugen methods at sclang select mul-add values given the output range--- of the Ugen, ie LFPulse.range selects a (0,1) input range.------ > map (range 3 4) [-1,0,1] == [3,3.5,4]--- > map (\x -> let (m,a) = linlin_muladd (-1) 1 3 4 in x * m + a) [-1,0,1] == [3,3.5,4]+{- | Scale (-1,1) input to linear (l,r) range.+Note that the argument order is not the same as 'linlin'.+Note also that the various range Ugen methods at sclang select mul-add values given the output range of the Ugen, ie LFPulse.range selects a (0,1) input range.++>>> map (range 3 4) [-1,0,1]+[3.0,3.5,4.0]++>>> map (\x -> let (m,a) = linlin_muladd (-1) 1 3 4 in x * m + a) [-1,0,1]+[3.0,3.5,4.0]+-} range :: Fractional a => a -> a -> a -> a range = range_ma sc3_mul_add -- | 'uncurry' 'range'-range_hs :: Fractional a => (a,a) -> a -> a+range_hs :: Fractional a => (a, a) -> a -> a range_hs = uncurry range -- | 'flip' 'range_hs'. This allows cases such as osc `in_range` (0,1)-in_range :: Fractional a => a -> (a,a) -> a+in_range :: Fractional a => a -> (a, a) -> a in_range = flip range_hs --- | Calculate multiplier and add values for 'linlin' transform.--- Inputs are: input-min input-max output-min output-max------ > range_muladd 3 4 == (0.5,3.5)--- > linlin_muladd (-1) 1 3 4 == (0.5,3.5)--- > linlin_muladd 0 1 3 4 == (1,3)--- > linlin_muladd (-1) 1 0 1 == (0.5,0.5)--- > linlin_muladd (-0.3) 1 (-1) 1-linlin_muladd :: Fractional t => t -> t -> t -> t -> (t,t)+{- | Calculate multiplier and add values for 'linlin' transform.+Inputs are: input-min input-max output-min output-max++>>> range_muladd 3 4+(0.5,3.5)++>>> linlin_muladd (-1) 1 3 4+(0.5,3.5)++>>> linlin_muladd 0 1 3 4+(1.0,3.0)++>>> linlin_muladd (-1) 1 0 1+(0.5,0.5)++>>> linlin_muladd (-0.3) 1 (-1) 1+(1.5384615384615383,-0.5384615384615385)+-}+linlin_muladd :: Fractional t => t -> t -> t -> t -> (t, t) linlin_muladd sl sr dl dr =- let m = (dr - dl) / (sr - sl)- a = dl - (m * sl)- in (m,a)+ let m = (dr - dl) / (sr - sl)+ a = dl - (m * sl)+ in (m, a) --- | Map from one linear range to another linear range.------ > linlin_ma hs_muladd 5 0 10 (-1) 1 == 0-linlin_ma :: Fractional a => SC3_MulAdd a -> a -> a -> a -> a -> a -> a+{- | Map from one linear range to another linear range.++>>> linlin_ma sc3_mul_add 5 0 10 (-1) 1+0.0+-}+linlin_ma :: Fractional a => Sc3_MulAdd a -> a -> a -> a -> a -> a -> a linlin_ma mul_add_f i sl sr dl dr =- let (m,a) = linlin_muladd sl sr dl dr+ let (m, a) = linlin_muladd sl sr dl dr in mul_add_f i m a --- | 'linLin' with a more typical haskell argument structure, ranges as pairs and input last.------ > map (linlin_hs (0,127) (-0.5,0.5)) [0,63.5,127] == [-0.5,0.0,0.5]+{- | 'linLin' with a more typical haskell argument structure, ranges as pairs and input last.++>>> map (linlin_hs (0,127) (-0.5,0.5)) [0,63.5,127]+[-0.5,0.0,0.5]+-} linlin_hs :: Fractional a => (a, a) -> (a, a) -> a -> a-linlin_hs (sl,sr) (dl,dr) = let (m,a) = linlin_muladd sl sr dl dr in (+ a) . (* m)+linlin_hs (sl, sr) (dl, dr) = let (m, a) = linlin_muladd sl sr dl dr in (+ a) . (* m) {- | Map from one linear range to another linear range. -> r = [0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1]-> map (\i -> sc3_linlin i (-1) 1 0 1) [-1,-0.75 .. 1] == r-+>>> map (\i -> sc3_linlin i (-1) 1 0 1) [-1,-0.75 .. 1]+[0.0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1.0] -} sc3_linlin :: Fractional a => a -> a -> a -> a -> a -> a-sc3_linlin i sl sr dl dr = linlin_hs (sl,sr) (dl,dr) i+sc3_linlin i sl sr dl dr = linlin_hs (sl, sr) (dl, dr) i --- | Given enumeration from /dst/ that is in the same relation as /n/ is from /src/.------ > linlin _enum_plain 'a' 'A' 'e' == 'E'--- > linlin_enum_plain 0 (-50) 16 == -34--- > linlin_enum_plain 0 (-50) (-1) == -51-linlin_enum_plain :: (Enum t,Enum u) => t -> u -> t -> u+{- | Given enumeration from /dst/ that is in the same relation as /n/ is from /src/.++>>> linlin_enum_plain 'a' 'A' 'e'+'E'++>>> linlin_enum_plain 0 (-50) 16+-34++>>> linlin_enum_plain 0 (-50) (-1)+-51+-}+linlin_enum_plain :: (Enum t, Enum u) => t -> u -> t -> u linlin_enum_plain src dst n = toEnum (fromEnum dst + (fromEnum n - fromEnum src)) --- | Variant of 'linlin_enum_plain' that requires /src/ and /dst/ ranges to be of equal size,+{- | Variant of 'linlin_enum_plain' that requires /src/ and /dst/ ranges to be of equal size, -- and for /n/ to lie in /src/.------ > linlin_enum (0,100) (-50,50) 0x10 == Just (-34)--- > linlin_enum (-50,50) (0,100) (-34) == Just 0x10--- > linlin_enum (0,100) (-50,50) (-1) == Nothing-linlin_enum :: (Enum t,Enum u) => (t,t) -> (u,u) -> t -> Maybe u-linlin_enum (l,r) (l',r') n =- if fromEnum n >= fromEnum l && fromEnum r - fromEnum l == fromEnum r' - fromEnum l'++>>> linlin_enum (0,100) (-50,50) 0x10 -- 16+Just (-34)++>>> linlin_enum (-50,50) (0,100) (-34)+Just 16++>>> linlin_enum (0,100) (-50,50) (-1)+Nothing+-}+linlin_enum :: (Enum t, Enum u) => (t, t) -> (u, u) -> t -> Maybe u+linlin_enum (l, r) (l', r') n =+ if fromEnum n >= fromEnum l && fromEnum r - fromEnum l == fromEnum r' - fromEnum l' then Just (linlin_enum_plain l l' n) else Nothing -- | Erroring variant.-linlin_enum_err :: (Enum t,Enum u) => (t,t) -> (u,u) -> t -> u+linlin_enum_err :: (Enum t, Enum u) => (t, t) -> (u, u) -> t -> u linlin_enum_err src dst = fromMaybe (error "linlin_enum") . linlin_enum src dst --- | Variant of 'linlin' that requires /src/ and /dst/ ranges to be of+{- | Variant of 'linlin' that requires /src/ and /dst/ ranges to be of -- equal size, thus with constraint of 'Num' and 'Eq' instead of -- 'Fractional'.------ > linlin_eq (0,100) (-50,50) 0x10 == Just (-34)--- > linlin_eq (-50,50) (0,100) (-34) == Just 0x10-linlin_eq :: (Eq a, Num a) => (a,a) -> (a,a) -> a -> Maybe a-linlin_eq (l,r) (l',r') n =- let d = r - l- d' = r' - l'- in if d == d' then Just (l' + (n - l)) else Nothing +>>> linlin_eq (0,100) (-50,50) 0x10 -- 16+Just (-34)++>>> linlin_eq (-50,50) (0,100) (-34)+Just 16+-}+linlin_eq :: (Eq a, Num a) => (a, a) -> (a, a) -> a -> Maybe a+linlin_eq (l, r) (l', r') n =+ let d = r - l+ d' = r' - l'+ in if d == d' then Just (l' + (n - l)) else Nothing+ -- | Erroring variant.-linlin_eq_err :: (Eq a,Num a) => (a,a) -> (a,a) -> a -> a+linlin_eq_err :: (Eq a, Num a) => (a, a) -> (a, a) -> a -> a linlin_eq_err src dst = fromMaybe (error "linlin_eq") . linlin_eq src dst -- * LinExp@@ -599,55 +777,69 @@ Rule is as at linExp Ugen, haskell manner argument ordering. Destination values must be nonzero and have the same sign. -> map (floor . linexp_hs (1,2) (10,100)) [0,1,1.5,2,3] == [1,10,31,100,1000]-> map (floor . linexp_hs (-2,2) (1,100)) [-3,-2,-1,0,1,2,3] == [0,1,3,10,31,100,316]+>>> map (floor . linexp_hs (1,2) (10,100)) [0,1,1.5,2,3]+[1,10,31,100,1000] +>>> map (floor . linexp_hs (-2,2) (1,100)) [-3,-2,-1,0,1,2,3]+[0,1,3,10,31,100,316] -}-linexp_hs :: Floating a => (a,a) -> (a,a) -> a -> a-linexp_hs (in_l,in_r) (out_l,out_r) x =- let rt = out_r / out_l- rn = 1.0 / (in_r - in_l)- rr = rn * negate in_l- in out_l * (rt ** (x * rn + rr))+linexp_hs :: Floating a => (a, a) -> (a, a) -> a -> a+linexp_hs (in_l, in_r) (out_l, out_r) x =+ let rt = out_r / out_l+ rn = 1.0 / (in_r - in_l)+ rr = rn * negate in_l+ in out_l * (rt ** (x * rn + rr)) --- | Variant of 'linexp_hs' with argument ordering as at 'linExp' Ugen.------ > map (\i -> lin_exp i 1 2 1 3) [1,1.1 .. 2]--- > map (\i -> floor (lin_exp i 1 2 10 100)) [0,1,1.5,2,3]+{- | Variant of 'linexp_hs' with argument ordering as at 'linExp' Ugen.++>>> map (\i -> lin_exp i 1 2 1 3) [1,1.1,1.9,2]+[1.0,1.1161231740339046,2.6878753795222865,3.0]++>>> map (\i -> floor (lin_exp i 1 2 10 100)) [0,1,1.5,2,3]+[1,10,31,100,1000]+-} lin_exp :: Floating a => a -> a -> a -> a -> a -> a-lin_exp x in_l in_r out_l out_r = linexp_hs (in_l,in_r) (out_l,out_r) x+lin_exp x in_l in_r out_l out_r = linexp_hs (in_l, in_r) (out_l, out_r) x --- | @SimpleNumber.linexp@ shifts from linear to exponential ranges.------ > map (sc3_linexp 1 2 1 3) [1,1.1 .. 2]------ > > [1,1.5,2].collect({|i| i.linexp(1,2,10,100).floor}) == [10,31,100]--- > map (floor . sc3_linexp 1 2 10 100) [0,1,1.5,2,3] == [10,10,31,100,100]+{- | @SimpleNumber.linexp@ shifts from linear to exponential ranges.++>>> map (sc3_linexp 1 2 1 3) [1,1.1,1.9,2]+[1.0,1.1161231740339046,2.6878753795222865,3.0]++> [1,1.5,2].collect({|i| i.linexp(1,2,10,100).floor}) == [10,31,100]++>>> map (floor . sc3_linexp 1 2 10 100) [0,1,1.5,2,3]+[10,10,31,100,100]+-} sc3_linexp :: (Ord a, Floating a) => a -> a -> a -> a -> a -> a sc3_linexp src_l src_r dst_l dst_r x =- case apply_clip_rule Clip_Both src_l src_r dst_l dst_r x of- Just r -> r- Nothing -> ((dst_r / dst_l) ** ((x - src_l) / (src_r - src_l))) * dst_l+ case apply_clip_rule Clip_Both src_l src_r dst_l dst_r x of+ Just r -> r+ Nothing -> ((dst_r / dst_l) ** ((x - src_l) / (src_r - src_l))) * dst_l --- | @SimpleNumber.explin@ is the inverse of linexp.------ > map (sc3_explin 10 100 1 2) [10,10,31,100,100]+{- | @SimpleNumber.explin@ is the inverse of linexp.++>>> map (sc3_explin 10 100 1 2) [10,10,31,100,100]+[1.0,1.0,1.4913616938342726,2.0,2.0]+-} sc3_explin :: (Ord a, Floating a) => a -> a -> a -> a -> a -> a sc3_explin src_l src_r dst_l dst_r x = fromMaybe- (logBase (src_r / src_l) (x / src_l) * (dst_r - dst_l) + dst_l)- (apply_clip_rule Clip_Both src_l src_r dst_l dst_r x)+ (logBase (src_r / src_l) (x / src_l) * (dst_r - dst_l) + dst_l)+ (apply_clip_rule Clip_Both src_l src_r dst_l dst_r x) -- * ExpExp --- | Translate from one exponential range to another.------ > map (sc3_expexp 0.1 10 4.3 100) [1 .. 10]+{- | Translate from one exponential range to another.++>>> map (round . sc3_expexp 0.1 10 4.3 100) [1 .. 10]+[21,33,44,53,62,71,78,86,93,100]+-} sc3_expexp :: (Ord a, Floating a) => a -> a -> a -> a -> a -> a sc3_expexp src_l src_r dst_l dst_r x = fromMaybe- ((dst_r / dst_l) ** logBase (src_r / src_l) (x / src_l) * dst_l)- (apply_clip_rule Clip_Both src_l src_r dst_l dst_r x)+ ((dst_r / dst_l) ** logBase (src_r / src_l) (x / src_l) * dst_l)+ (apply_clip_rule Clip_Both src_l src_r dst_l dst_r x) -- * LinCurve @@ -656,69 +848,77 @@ parameter in Env. Unlike with linexp, the output range may include zero. -> > (0..10).lincurve(0,10,-4.3,100,-3).round == [-4,24,45,61,72,81,87,92,96,98,100]+> (0..10).lincurve(0,10,-4.3,100,-3).round == [-4,24,45,61,72,81,87,92,96,98,100] -> let f = round . sc3_lincurve (-3) 0 10 (-4.3) 100-> in map f [0 .. 10] == [-4,24,45,61,72,81,87,92,96,98,100]+>>> let f = round . sc3_lincurve (-3) 0 10 (-4.3) 100+>>> map f [0 .. 10]+[-4,24,45,61,72,81,87,92,96,98,100] -> import Sound.Sc3.Plot {- hsc3-plot -}+> import Sound.Sc3.Plot {\- hsc3-plot -\} > plotTable (map (\c-> map (sc3_lincurve c 0 1 (-1) 1) [0,0.01 .. 1]) [-6,-4 .. 6])- -} sc3_lincurve :: (Ord a, Floating a) => a -> a -> a -> a -> a -> a -> a sc3_lincurve curve src_l src_r dst_l dst_r x =- case apply_clip_rule Clip_Both src_l src_r dst_l dst_r x of- Just r -> r- Nothing ->- if abs curve < 0.001- then linlin_hs (src_l,src_r) (dst_l,dst_r) x- else let grow = exp curve- a = (dst_r - dst_l) / (1.0 - grow)- b = dst_l + a- scaled = (x - src_l) / (src_r - src_l)- in b - (a * (grow ** scaled))+ case apply_clip_rule Clip_Both src_l src_r dst_l dst_r x of+ Just r -> r+ Nothing ->+ if abs curve < 0.001+ then linlin_hs (src_l, src_r) (dst_l, dst_r) x+ else+ let grow = exp curve+ a = (dst_r - dst_l) / (1.0 - grow)+ b = dst_l + a+ scaled = (x - src_l) / (src_r - src_l)+ in b - (a * (grow ** scaled)) --- | Inverse of 'sc3_lincurve'.------ > let f = round . sc3_curvelin (-3) (-4.3) 100 0 10--- > in map f [-4,24,45,61,72,81,87,92,96,98,100] == [0..10]+{- | Inverse of 'sc3_lincurve'.++>>> let f = round . sc3_curvelin (-3) (-4.3) 100 0 10+>>> map f [-4,24,45,61,72,81,87,92,96,98,100] == [0..10]+True+-} sc3_curvelin :: (Ord a, Floating a) => a -> a -> a -> a -> a -> a -> a sc3_curvelin curve src_l src_r dst_l dst_r x =- case apply_clip_rule Clip_Both src_l src_r dst_l dst_r x of- Just r -> r- Nothing ->- if abs curve < 0.001- then linlin_hs (src_l,src_r) (dst_l,dst_r) x- else let grow = exp curve- a = (src_r - src_l) / (1.0 - grow)- b = src_l + a- in log ((b - x) / a) * (dst_r - dst_l) / curve + dst_l+ case apply_clip_rule Clip_Both src_l src_r dst_l dst_r x of+ Just r -> r+ Nothing ->+ if abs curve < 0.001+ then linlin_hs (src_l, src_r) (dst_l, dst_r) x+ else+ let grow = exp curve+ a = (src_r - src_l) / (1.0 - grow)+ b = src_l + a+ in log ((b - x) / a) * (dst_r - dst_l) / curve + dst_l --- * PP+-- * Pp (pretty print) -- | Removes all but the last trailing zero from floating point string. double_pp_rm0 :: String -> String double_pp_rm0 =- let rev_f f = reverse . f . reverse- remv l = case l of- '0':'.':_ -> l- '0':l' -> remv l'- _ -> l- in rev_f remv+ let rev_f f = reverse . f . reverse+ remv l = case l of+ '0' : '.' : _ -> l+ '0' : l' -> remv l'+ _ -> l+ in rev_f remv --- | The default show is odd, 0.05 shows as 5.0e-2.------ > unwords (map (double_pp 4) [0.0001,0.001,0.01,0.1,1.0]) == "0.0001 0.001 0.01 0.1 1.0"+{- | The default show is odd, 0.05 shows as 5.0e-2.++>>> unwords (map (double_pp 4) [0.0001,0.001,0.01,0.1,1.0])+"0.0001 0.001 0.01 0.1 1.0"+-} double_pp :: Int -> Double -> String double_pp k n = double_pp_rm0 (Numeric.showFFloat (Just k) n "") --- | Print as integer if integral, else as real.------ > unwords (map (real_pp 5) [0.0001,0.001,0.01,0.1,1.0]) == "0.0001 0.001 0.01 0.1 1"+{- | Print as integer if integral, else as real.++>>> unwords (map (real_pp 5) [0.0001,0.001,0.01,0.1,1.0])+"0.0001 0.001 0.01 0.1 1"+-} real_pp :: Int -> Double -> String real_pp k n =- let r = toRational n- in if denominator r == 1 then show (numerator r) else double_pp k n+ let r = toRational n+ in if denominator r == 1 then show (numerator r) else double_pp k n -- * Parser @@ -733,8 +933,8 @@ sum_opt_f f3 f4 = let recur l = case l of- p:q:r:s:l' -> recur (f4 p q r s : l')- p:q:r:l' -> recur (f3 p q r : l')+ p : q : r : s : l' -> recur (f4 p q r s : l')+ p : q : r : l' -> recur (f3 p q r : l') _ -> sum l in recur
Sound/Sc3/Common/Math/Filter.hs view
@@ -1,51 +1,51 @@ -- | Filter coefficient calculations. module Sound.Sc3.Common.Math.Filter where --- | SOS filter coefficients, (a0,a1,a2,b1,b2)-type SosCoef t = (t,t,t,t,t)+-- | Sos filter coefficients, (a0, a1, a2, b1, b2)+type SosCoef t = (t, t, t, t, t) --- | Butterworth low pass or high pass SOS filter coefficients, (a0,a1,a2,b1,b2).+-- | Butterworth low pass or high pass Sos filter coefficients. bw_lpf_or_hpf_coef :: Floating n => Bool -> n -> n -> SosCoef n bw_lpf_or_hpf_coef is_hpf sample_rate f =- let f' = f * pi / sample_rate- c = if is_hpf then tan f' else 1.0 / tan f'- c2 = c * c- s2c = sqrt 2.0 * c- a0 = 1.0 / (1.0 + s2c + c2)- a1 = if is_hpf then -2.0 * a0 else 2.0 * a0- a2 = a0- b1 = if is_hpf then 2.0 * (c2 - 1.0) * a0 else 2.0 * (1.0 - c2) * a0- b2 = (1.0 - s2c + c2) * a0- in (a0,a1,a2,b1,b2)+ let f' = f * pi / sample_rate+ c = if is_hpf then tan f' else 1 / tan f'+ c2 = c * c+ s2c = sqrt 2 * c+ a0 = 1 / (1 + s2c + c2)+ a1 = if is_hpf then -2 * a0 else 2 * a0+ a2 = a0+ b1 = if is_hpf then 2 * (c2 - 1.0) * a0 else 2 * (1 - c2) * a0+ b2 = (1 - s2c + c2) * a0+ in (a0, a1, a2, b1, b2) --- | Two place infinite impulse response filter coefficients, (a0,b1,b2)-type Iir2Coef t = (t,t,t)+-- | Two place infinite impulse response filter coefficients, (a0, b1, b2)+type Iir2Coef t = (t, t, t) -- | rlpf coefficients, (a0,b1,b2).-rlpf_coef :: Floating n => (n -> n -> n) -> (n,n,n) -> Iir2Coef n-rlpf_coef max_f (radians_per_sample,f,rq) =- let qr = max_f 0.001 rq- pf = f * radians_per_sample- d = tan (pf * qr * 0.5)- c = (1.0 - d) / (1.0 + d)- b1 = (1.0 + c) * cos pf- b2 = negate c- a0 = (1.0 + c - b1) * 0.25- in (a0,b1,b2)+rlpf_coef :: Floating n => (n -> n -> n) -> (n, n, n) -> Iir2Coef n+rlpf_coef max_f (radians_per_sample, f, rq) =+ let qr = max_f 0.001 rq+ pf = f * radians_per_sample+ d = tan (pf * qr * 0.5)+ c = (1 - d) / (1 + d)+ b1 = (1 + c) * cos pf+ b2 = negate c+ a0 = (1 + c - b1) * 0.25+ in (a0, b1, b2) -- | resonz coefficients, (a0,b1,b2).-resonz_coef :: Floating n => (n,n,n) -> Iir2Coef n-resonz_coef (radians_per_sample,f,rq) =- let ff = f * radians_per_sample- b = ff * rq- r = 1.0 - b * 0.5- two_r = 2.0 * r- r2 = r * r- ct = (two_r * cos ff) / (1.0 + r2)- b1 = two_r * ct- b2 = negate r2- a0 = (1.0 - r2) * 0.5- in (a0,b1,b2)+resonz_coef :: Floating n => (n, n, n) -> Iir2Coef n+resonz_coef (radians_per_sample, f, rq) =+ let ff = f * radians_per_sample+ b = ff * rq+ r = 1 - b * 0.5+ two_r = 2 * r+ r2 = r * r+ ct = (two_r * cos ff) / (1 + r2)+ b1 = two_r * ct+ b2 = negate r2+ a0 = (1 - r2) * 0.5+ in (a0, b1, b2) -- * Pinking @@ -64,20 +64,26 @@ pinking_filter_freq_192000 :: Fractional t => Pinking_Param t pinking_filter_freq_192000 = (9211.912, 8621.096, 8555.228, 8292.754, 518.334, 163.712, 240.241) --- > pinking_filter_coef 48000 pinking_filter_freq_48000+{- | Pinking filter coefficients++>>> pinking_filter_coef 48000 pinking_filter_freq_48000+(0.5368186045507747,0.5899888969306109,0.6945314610687594,0.8175983529924599,0.9542588306160661,0.9908788735874952,0.9960807097281633)+-} pinking_filter_coef :: Floating t => t -> Pinking_Param t -> Pinking_Param t pinking_filter_coef sr (f0, f1, f2, f3, f4, f5, f6) =- let f n = exp ((- 2) * pi * n / sr)+ let f n = exp ((-2) * pi * n / sr) in (f f0, f f1, f f2, f f3, f f4, f f5, f f6) pinking_filter_next :: Floating t => Pinking_Param t -> Pinking_Param t -> t -> (t, Pinking_Param t) pinking_filter_next (k0, k1, k2, k3, k4, k5, k6) (m0, m1, m2, m3, m4, m5, m6) white =- let (b0, b1, b2, b3, b4, b5, b6) = ((k0 * white) + (k0 * m0)- ,(k1 * white) + (k1 * m1)- ,(k2 * white) + (k2 * m2)- ,(k3 * white) + (k3 * m3)- ,(k4 * white) + (k4 * m4)- ,(k5 * white) + (k5 * m5)- ,(k6 * white) + (k6 * m6))+ let (b0, b1, b2, b3, b4, b5, b6) =+ ( (k0 * white) + (k0 * m0)+ , (k1 * white) + (k1 * m1)+ , (k2 * white) + (k2 * m2)+ , (k3 * white) + (k3 * m3)+ , (k4 * white) + (k4 * m4)+ , (k5 * white) + (k5 * m5)+ , (k6 * white) + (k6 * m6)+ ) pink = b0 + b1 + b2 + b3 + b4 + b5 + white - b6 in (pink, (b0, b1, b2, b3, b4, b5, b6))
Sound/Sc3/Common/Math/Filter/Beq.hs view
@@ -1,22 +1,25 @@--- | BEQ filter coefficient calculations, results are (a0,a1,a2,b0,b1).+-- | Beq filter coefficient calculations. module Sound.Sc3.Common.Math.Filter.Beq where +-- | Beq coefficients, (a0, a1, a2, b1, b2).+type Beq t = (t, t, t, t, t)+ -- | Calculate coefficients for bi-quad low pass filter.-bLowPassCoef :: Floating a => a -> a -> a -> (a,a,a,a,a)+bLowPassCoef :: Floating t => t -> t -> t -> Beq t bLowPassCoef sr freq rq =- let w0 = pi * 2 * freq * (1 / sr)- cos_w0 = cos w0- i = 1 - cos_w0- alpha = sin w0 * 0.5 * rq- b0rz = recip (1 + alpha)- a0 = i * 0.5 * b0rz- a1 = i * b0rz- b1 = cos_w0 * 2 * b0rz- b2 = (1 - alpha) * negate b0rz- in (a0,a1,a0,b1,b2)+ let w0 = pi * 2 * freq * (1 / sr)+ cos_w0 = cos w0+ i = 1 - cos_w0+ alpha = sin w0 * 0.5 * rq+ b0rz = recip (1 + alpha)+ a0 = i * 0.5 * b0rz+ a1 = i * b0rz+ b1 = cos_w0 * 2 * b0rz+ b2 = (1 - alpha) * negate b0rz+ in (a0, a1, a0, b1, b2) -- | Calculate coefficients for bi-quad high pass filter.-bHiPassCoef :: Floating t => t -> t -> t -> (t, t, t, t, t)+bHiPassCoef :: Floating t => t -> t -> t -> Beq t bHiPassCoef sr freq rq = let w0 = pi * 2 * freq * (1 / sr) cos_w0 = cos w0@@ -30,17 +33,17 @@ in (a0, a1, a0, b1, b2) -- | Calculate coefficients for bi-quad all pass filter.-bAllPassCoef :: Floating t => t -> t -> t -> (t, t, t, t, t)+bAllPassCoef :: Floating t => t -> t -> t -> Beq t bAllPassCoef sr freq rq = let w0 = pi * 2 * freq * (1 / sr) alpha = sin w0 * 0.5 * rq b0rz = recip (1 + alpha) a0 = (1 - alpha) * b0rz b1 = 2.0 * cos w0 * b0rz- in (a0,negate b1, 1.0, b1,negate a0)+ in (a0, negate b1, 1.0, b1, negate a0) -- | Calculate coefficients for bi-quad band pass filter.-bBandPassCoef :: Floating t => t -> t -> t -> (t, t, t, t, t)+bBandPassCoef :: Floating t => t -> t -> t -> Beq t bBandPassCoef sr freq bw = let w0 = pi * 2 * freq * (1 / sr) sin_w0 = sin w0@@ -52,7 +55,7 @@ in (a0, 0.0, negate a0, b1, b2) -- | Calculate coefficients for bi-quad stop band filter.-bBandStopCoef :: Floating t => t -> t -> t -> (t, t, t, t, t)+bBandStopCoef :: Floating t => t -> t -> t -> Beq t bBandStopCoef sr freq bw = let w0 = pi * 2 * freq * (1 / sr) sin_w0 = sin w0@@ -62,9 +65,9 @@ b2 = (1 - alpha) * negate b0rz in (b0rz, negate b1, b0rz, b1, b2) --- | Calculate coefficients for bi-quad peaking EQ filter.-bPeakEQCoef :: Floating t => t -> t -> t -> t -> (t, t, t, t, t)-bPeakEQCoef sr freq rq db =+-- | Calculate coefficients for bi-quad peaking Eq filter.+bPeakEqCoef :: Floating t => t -> t -> t -> t -> Beq t+bPeakEqCoef sr freq rq db = let a = 10 ** (db / 40) w0 = pi * 2 * freq * (1 / sr) alpha = sin w0 * 0.5 * rq@@ -76,7 +79,7 @@ in (a0, negate b1, a2, b1, b2) -- | Calculate coefficients for bi-quad low shelf filter.-bLowShelfCoef :: Floating t => t -> t -> t -> t -> (t, t, t, t, t)+bLowShelfCoef :: Floating t => t -> t -> t -> t -> Beq t bLowShelfCoef sr freq rs db = let a = 10 ** (db / 40) w0 = pi * 2 * freq * (1 / sr)@@ -95,15 +98,15 @@ in (a0, a1, a2, b1, b2) -- | Calculate coefficients for bi-quad high shelf filter.-bHiShelfCoef :: Floating t => t -> t -> t -> t -> (t, t, t, t, t)+bHiShelfCoef :: Floating t => t -> t -> t -> t -> Beq t bHiShelfCoef sr freq rs db = let a = 10 ** (db / 40) w0 = pi * 2 * freq * (1 / sr) cos_w0 = cos w0 sin_w0 = sin w0- alpha = sin_w0 * 0.5 * sqrt((a + recip a) * (rs - 1) + 2.0)- i = (a+1) * cos_w0- j = (a-1) * cos_w0+ alpha = sin_w0 * 0.5 * sqrt ((a + recip a) * (rs - 1) + 2.0)+ i = (a + 1) * cos_w0+ j = (a - 1) * cos_w0 k = 2 * sqrt a * alpha b0rz = recip ((a + 1) - j + k) a0 = a * ((a + 1) + j + k) * b0rz
Sound/Sc3/Common/Math/Interpolate.hs view
@@ -1,28 +1,33 @@--- | Interpolation functions, ie. for envelope segments. Present naming is for qualified import.+{- | Interpolation functions, ie. for envelope segments.+Present naming is for qualified import.+-} module Sound.Sc3.Common.Math.Interpolate where -import Sound.Sc3.Common.Math {- hsc3 -}+import qualified Sound.Sc3.Common.Math as Math {- hsc3 -} {- | An interpolation function takes three arguments. x0 is the left or begin value, x1 is the right or end value, t is a (0,1) index. -} type Interpolation_f t = t -> t -> t -> t --- | Clip x to (0,1) and run f.------ > interpolate linear (-1,1) 0.5 == 0-interpolate :: (Num t,Ord t) => Interpolation_f t -> (t,t) -> t -> t-interpolate f (l,r) x = if x < 0 then l else if x > 1 then r else f l r x+{- | Clip x to (0,1) and run f. +>>> interpolate linear (-1,1) 0.5+0.0+-}+interpolate :: (Num t, Ord t) => Interpolation_f t -> (t, t) -> t -> t+interpolate f (l, r) x = if x < 0 then l else if x > 1 then r else f l r x+ -- | Step function, ignores t and returns x1. step :: Interpolation_f t step _ x1 _ = x1 {- | Linear interpolation funtion. -> map (linear 1 10) [0,0.25 .. 1] == [1,3.25,5.5,7.75,10]+>>> map (linear 1 10) [0,0.25 .. 1]+[1.0,3.25,5.5,7.75,10.0] -> import Sound.Sc3.Plot {- hsc3-plot -}+> import Sound.Sc3.Plot {\- hsc3-plot -\} > plot_fn_r1_ln (linear (-1) 1) (0,1) -} linear :: Num t => Interpolation_f t@@ -31,47 +36,51 @@ {- | Exponential interpolation. x0 must not be zero and (x0,x1) must not span zero. -> plot_fn_r1_ln (exponential 0.001 1) (0,1)-> plot_fn_r1_ln (exponential 1 2) (0,1)-> plot_fn_r1_ln (exponential 20 20000) (0,1)+> plot_fn_r1_ln [exponential 0.001 1] (0,1)+> plot_fn_r1_ln [exponential 1 2] (0,1)+> plot_fn_r1_ln [exponential 20 20000] (0,1) -} exponential :: Floating t => Interpolation_f t exponential x0 x1 t = x0 * ((x1 / x0) ** t) {- | Variant that allows x0 to be zero, though (x0,x1) must not span zero. -> plot_fn_r1_ln (exponential_0 0 1) (0,1)-> plot_fn_r1_ln (exponential_0 0 (-1)) (0,1)+> plot_fn_r1_ln [exponential_0 0 1] (0,1)+> plot_fn_r1_ln [exponential_0 0 (-1)] (0,1) -}-exponential_0 :: (Eq t,Floating t) => Interpolation_f t+exponential_0 :: (Eq t, Floating t) => Interpolation_f t exponential_0 x0 x1 =- let epsilon = 1e-6- x0' = if x0 == 0 then epsilon * signum x1 else x0- in exponential x0' x1+ let epsilon = 1e-6+ x0' = if x0 == 0 then epsilon * signum x1 else x0+ in exponential x0' x1 --- | 'linear' of 'exponential_0' of (0,1), ie. allows (x0,x1) to span zero.------ > plot_fn_r1_ln (exponential_lin (-1) 1) (0,1)-exponential_lin :: (Eq t,Floating t) => Interpolation_f t+{- | 'linear' of 'exponential_0' of (0,1), ie. allows (x0,x1) to span zero.++> plot_fn_r1_ln [exponential_lin (-1) 1] (0,1)+-}+exponential_lin :: (Eq t, Floating t) => Interpolation_f t exponential_lin x0 x1 t = linear x0 x1 (exponential_0 0 1 t) --- | 'linear' with t transformed by sine function over (-pi/2,pi/2).------ > plot_fn_r1_ln (sine (-1) 1) (0,1)+{- | 'linear' with t transformed by sine function over (-pi/2,pi/2).++> plot_fn_r1_ln [sine (-1) 1] (0,1)+> plot_fn_r1_ln [sine 1 (-1)] (0,1)+-} sine :: Floating t => Interpolation_f t sine x0 x1 t =- let t' = - cos (pi * t) * 0.5 + 0.5- in linear x0 x1 t'+ let t' = -cos (pi * t) * 0.5 + 0.5+ in linear x0 x1 t' --- | If x0 '<' x1 rising sine segment (0,pi/2), else falling segment (pi/2,pi).------ > plot_fn_r1_ln (welch (-1) 1) (0,1)--- > plot_fn_r1_ln (welch 1 (-1)) (0,1)+{- | If x0 '<' x1 rising sine segment (0,pi/2), else falling segment (pi/2,pi).++> plot_fn_r1_ln [welch (-1) 1] (0,1)+> plot_fn_r1_ln [welch 1 (-1)] (0,1)+-} welch :: (Ord t, Floating t) => Interpolation_f t welch x0 x1 t =- if x0 < x1- then x0 + (x1 - x0) * sin (half_pi * t)- else x1 - (x1 - x0) * sin (half_pi - (half_pi * t))+ if x0 < x1+ then x0 + (x1 - x0) * sin (Math.half_pi * t)+ else x1 - (x1 - x0) * sin (Math.half_pi - (Math.half_pi * t)) {- | Curvature controlled by single parameter c. Zero is 'linear', increasing c approaches 'exponential' and continues past it.@@ -84,40 +93,42 @@ -} curve :: (Ord t, Floating t) => t -> Interpolation_f t curve c x0 x1 t =- if abs c < 0.0001+ if abs c < 0.0001 then linear x0 x1 t- else let d = 1 - exp c- n = 1 - exp (t * c)- in x0 + (x1 - x0) * (n/d)+ else+ let d = 1 - exp c+ n = 1 - exp (t * c)+ in x0 + (x1 - x0) * (n / d) {- | Square of 'linear' of 'sqrt' of x0 and x1, therefore neither may be negative. -> plot_fn_r1_ln (squared 0 1) (0,1)+> plot_fn_r1_ln [squared 0 1] (0,1) > plot_p1_ln (map (\f -> map f [0,0.01 .. 1]) [curve 2.05 0 1,squared 0 1]) -} squared :: Floating t => Interpolation_f t squared x0 x1 t =- let x0' = sqrt x0- x1' = sqrt x1- l = linear x0' x1' t- in l * l+ let x0' = sqrt x0+ x1' = sqrt x1+ l = linear x0' x1' t+ in l * l {- | Cubic variant of 'squared'. -> plot_fn_r1_ln (cubed 0 1) (0,1)+> plot_fn_r1_ln [cubed 0 1] (0,1) > plot_p1_ln (map (\f -> map f [0,0.01 .. 1]) [curve 3.25 0 1,cubed 0 1]) -} cubed :: Floating t => Interpolation_f t cubed x0 x1 t =- let x0' = x0 ** (1/3)- x1' = x1 ** (1/3)- l = linear x0' x1' t- in l * l * l+ let x0' = x0 ** (1 / 3)+ x1' = x1 ** (1 / 3)+ l = linear x0' x1' t+ in l * l * l --- | x0 until end, then immediately x1.------ > plot_fn_r1_ln (hold 0 1) (0,2)-hold :: (Num t,Ord t) => Interpolation_f t+{- | x0 until end, then immediately x1.++> plot_fn_r1_ln [hold 0 1] (0,2)+-}+hold :: (Num t, Ord t) => Interpolation_f t hold x0 x1 t = if t >= 1 then x1 else x0 {- | Fader curve, equal to 'squared' when x1 > x0.@@ -125,7 +136,7 @@ > plot_p1_ln (map (\f -> map f [0,0.01 .. 1]) [squared 0 1,fader 0 1]) > plot_p1_ln (map (\f -> map f [0,0.01 .. 1]) [curve 2 1 0,fader 1 0]) -}-fader :: (Num t,Ord t) => Interpolation_f t+fader :: (Num t, Ord t) => Interpolation_f t fader x0 x1 t = let rng = x1 - x0 sqr i = i * i
Sound/Sc3/Common/Math/Noise.hs view
@@ -7,19 +7,21 @@ cusp_f :: Floating t => t -> t -> t -> t cusp_f a b x = a - (b * sqrt (abs x)) --- | x(n+1) = sin(im * y(n) + fb * x(n))--- y(n+1) = (a * y(n) + c) % 2pi+{- | x(n+1) = sin(im * y(n) + fb * x(n))+ y(n+1) = (a * y(n) + c) % 2pi+-} fbSine_f :: (Floating t, RealFrac t) => t -> t -> t -> t -> (t, t) -> (t, t)-fbSine_f im fb a c (x,y) = (sin ((im * y) + (fb * x)),((a * y) + c) `sc3_mod` (2 * pi))+fbSine_f im fb a c (x, y) = (sin ((im * y) + (fb * x)), ((a * y) + c) `sc3_mod` (2 * pi)) -- | x(n+2) = 1 - a * x(n+1)^2 + b * x(n) henon_f :: Floating t => t -> t -> (t, t) -> (t, t)-henon_f a b (x1,x0) = (1 - (a * (x1 ** 2)) + (b * x0),x1)+henon_f a b (x1, x0) = (1 - (a * (x1 ** 2)) + (b * x0), x1) --- | x(n+1) = sin(b * y(n)) + c * sin(b * x(n))--- y(n+1) = sin(a * x(n)) + d * sin(a * y(n))+{- | x(n+1) = sin(b * y(n)) + c * sin(b * x(n))+ y(n+1) = sin(a * x(n)) + d * sin(a * y(n))+-} latoocarfian_f :: Floating t => t -> t -> t -> t -> (t, t) -> (t, t)-latoocarfian_f a b c d (x,y) = (sin(b * y) + (c * sin (b * x)),sin(a * x) + (d * sin (a * y)))+latoocarfian_f a b c d (x, y) = (sin (b * y) + (c * sin (b * x)), sin (a * x) + (d * sin (a * y))) -- | x(n+1) = (a * x(n) + c) % m linCong_f :: RealFrac t => t -> t -> t -> t -> t@@ -29,19 +31,21 @@ logistic_f :: Num t => t -> t -> t logistic_f a x = a * x * (1 - x) --- | x' = s * (y - x)--- y' = x * (r - z) - y--- z' = x * y - b * z+{- | x' = s * (y - x)+ y' = x * (r - z) - y+ z' = x * y - b * z+-} lorenz_f :: Num t => t -> t -> t -> (t, t, t) -> (t, t, t)-lorenz_f s r b (x,y,z) = (s * (y - x),x * (r - z) - y,x * y - b * z)+lorenz_f s r b (x, y, z) = (s * (y - x), x * (r - z) - y, x * y - b * z) -- | x(n+1) = a * x(n)^2 + b * x(n) + c quad_f :: Floating t => t -> t -> t -> t -> t quad_f a b c x = (a * (x ** 2)) + (b * x) + c --- | x(n+1) = (x(n) + y(n+1)) % 2pi--- y(n+1) = (y(n) + k * sin(x(n))) % 2pi+{- | x(n+1) = (x(n) + y(n+1)) % 2pi+ y(n+1) = (y(n) + k * sin(x(n))) % 2pi+-} standard_f :: (RealFrac t, Floating t) => t -> (t, t) -> (t, t)-standard_f k (x,y) =+standard_f k (x, y) = let y' = (y + (k * sin x)) `sc3_mod` two_pi- in ((x + y') `sc3_mod` two_pi,y')+ in ((x + y') `sc3_mod` two_pi, y')
Sound/Sc3/Common/Math/Operator.hs view
@@ -7,7 +7,6 @@ True is 1.0, False is 0.0 The RealFrac class requires Integral results, hence RealFracE.- -} module Sound.Sc3.Common.Math.Operator where @@ -75,15 +74,15 @@ | OpSoftClip -- 43 | OpCoin | OpDigitValue -- 45- | OpSilence- | OpThru- | OpRectWindow- | OpHanWindow+ | OpSilence -- 46+ | OpThru -- 47+ | OpRectWindow -- 48+ | OpHanWindow -- 49 | OpWelchWindow -- 50 | OpTriWindow | OpRamp_ -- 52 ; Ugen | OpScurve- deriving (Eq,Show,Enum,Bounded,Read)+ deriving (Eq, Show, Enum, Bounded, Read) -- | Enum name without Op prefix. sc3_unary_op_name :: Sc3_Unary_Op -> String@@ -91,19 +90,21 @@ {- | 'Base.parse_enum' with Op prefix. -> Data.Maybe.mapMaybe (parse_unary Cs) (words "Abs Rand")+>>> Data.Maybe.mapMaybe (parse_unary Base.Cs) (words "Abs Rand")+[OpAbs] -} parse_unary :: Base.Case_Rule -> String -> Maybe Sc3_Unary_Op parse_unary cr = Base.parse_enum cr . (++) "Op" --- | Table of operator names (non-symbolic) and indices.------ > map fst sc3_unary_op_tbl-sc3_unary_op_tbl :: [(String,Int)]-sc3_unary_op_tbl = zip (map sc3_unary_op_name [minBound .. maxBound]) [0..]+{- | Table of operator names (non-symbolic) and indices. +> map fst sc3_unary_op_tbl+-}+sc3_unary_op_tbl :: [(String, Int)]+sc3_unary_op_tbl = zip (map sc3_unary_op_name [minBound .. maxBound]) [0 ..]+ -- | Table of symbolic names for standard unary operators.-unary_sym_tbl :: [(Sc3_Unary_Op,String)]+unary_sym_tbl :: [(Sc3_Unary_Op, String)] unary_sym_tbl = [] -- (Neg,"-"),(Not,"!") -- | Lookup possibly symbolic name for standard unary operators.@@ -112,30 +113,41 @@ let e = toEnum n in fromMaybe (sc3_unary_op_name e) (lookup e unary_sym_tbl) --- | Given name of unary operator derive index.------ > Data.Maybe.mapMaybe (unaryIndex Ci) (words "abs Cubed midiCps Neg") == [5,13,17,0]--- > unaryIndex Cs "SinOsc" == Nothing+{- | Given name of unary operator derive index.++>>> Data.Maybe.mapMaybe (unaryIndex Base.Ci) (words "abs Cubed midiCps Neg")+[5,13,17,0]++>>> unaryIndex Base.Cs "SinOsc"+Nothing+-} unaryIndex :: Base.Case_Rule -> String -> Maybe Int unaryIndex cr nm =- let ix = Base.rlookup_str cr nm unary_sym_tbl- ix' = parse_unary cr nm- in fmap fromEnum (mplus ix' ix)+ let ix = Base.rlookup_str cr nm unary_sym_tbl+ ix' = parse_unary cr nm+ in fmap fromEnum (mplus ix' ix) --- | 'isJust' of 'unaryIndex'.------ > map (is_unary Ci) (words "Abs MidiCps Neg")--- > map (is_unary Ci) (words "- rand")--- > map (is_unary Ci) (words "arctan atan")+{- | 'isJust' of 'unaryIndex'.++>>> map (is_unary Base.Ci) (words "Abs MidiCps Neg")+[True,True,True]++>>> map (is_unary Base.Ci) (words "- rand")+[False,False]++>>> map (is_unary Base.Ci) (words "arctan atan")+[True,False]+-} is_unary :: Base.Case_Rule -> String -> Bool is_unary cr = isJust . unaryIndex cr -- * Binary --- | Enumeration of @Sc3@ unary operator Ugens.--- The names here are from the enumeration at "server/plugins/BinaryOpUgens.cpp".------ > zip (map show [minBound :: Sc3_Binary_Op .. maxBound]) [0..]+{- | Enumeration of @Sc3@ unary operator Ugens.+The names here are from the enumeration at "server/plugins/BinaryOpUgens.cpp".++> zip (map show [minBound :: Sc3_Binary_Op .. maxBound]) [0..]+-} data Sc3_Binary_Op = OpAdd -- 0 | OpSub -- 1@@ -159,7 +171,7 @@ | OpRoundTo -- 19 -- i.e. roundTo: (renamed) | OpRoundUp -- 20 | OpTrunc -- 21- | OpAtan2+ | OpAtan2 -- 22 | OpHypot -- 23 | OpHypotx | OpPow -- 25@@ -182,56 +194,61 @@ | OpClip2 -- 42 | OpExcess | OpFold2 -- 44- | OpWrap2- | OpFirstArg- | OpRandRange- | OpExpRandRange- deriving (Eq,Show,Enum,Bounded,Read)+ | OpWrap2 -- 45+ | OpFirstArg -- 46+ | OpRandRange -- 47+ | OpExpRandRange -- 48+ deriving (Eq, Show, Enum, Bounded, Read) -- | Enum name without Op prefix. sc3_binary_op_name :: Sc3_Binary_Op -> String sc3_binary_op_name = drop 2 . show -- | Table of operator names (non-symbolic) and indices.-sc3_binary_op_tbl :: [(String,Int)]-sc3_binary_op_tbl = zip (map sc3_binary_op_name [minBound .. maxBound]) [0..]+sc3_binary_op_tbl :: [(String, Int)]+sc3_binary_op_tbl = zip (map sc3_binary_op_name [minBound .. maxBound]) [0 ..] {- | 'parse_enum' with Op prefix. -> parse_binary Ci "mul" == Just OpMul+>>> parse_binary Base.Ci "mul"+Just OpMul -} parse_binary :: Base.Case_Rule -> String -> Maybe Sc3_Binary_Op parse_binary cr = Base.parse_enum cr . (++) "Op" -- | Table of symbolic names for standard binary operators.-binary_sym_tbl :: [(Sc3_Binary_Op,String)]+binary_sym_tbl :: [(Sc3_Binary_Op, String)] binary_sym_tbl =- [(OpAdd,"+")- ,(OpSub,"-")- ,(OpMul,"*")- ,(OpFdiv,"/")- ,(OpMod,"%")- ,(OpEq,"==")- ,(OpNe,"/=") -- or !=- ,(OpLt,"<")- ,(OpGt,">")- ,(OpLe,"<=")- ,(OpGe,">=")- ,(OpBitAnd,".&.") -- or &- ,(OpBitOr,".|.") -- or |- ,(OpPow,"**")]+ [ (OpAdd, "+")+ , (OpSub, "-")+ , (OpMul, "*")+ , (OpFdiv, "/")+ , (OpMod, "%")+ , (OpEq, "==")+ , (OpNe, "/=") -- or !=+ , (OpLt, "<")+ , (OpGt, ">")+ , (OpLe, "<=")+ , (OpGe, ">=")+ , (OpBitAnd, ".&.") -- or &+ , (OpBitOr, ".|.") -- or |+ , (OpPow, "**")+ ] --- | Table of operator names (non-symbolic) and indices.------ > map fst sc3_binary_op_sym_tbl-sc3_binary_op_sym_tbl :: [(String,Int)]+{- | Table of operator names (non-symbolic) and indices.++> map fst sc3_binary_op_sym_tbl+-}+sc3_binary_op_sym_tbl :: [(String, Int)] sc3_binary_op_sym_tbl = let f x = fromMaybe (sc3_binary_op_name x) (lookup x binary_sym_tbl)- in zip (map f [minBound .. maxBound]) [0..]+ in zip (map f [minBound .. maxBound]) [0 ..] --- | Lookup possibly symbolic name for standard binary operators.------ > map binaryName [1,2,8,12] == ["-","*","<","Min"]+{- | Lookup possibly symbolic name for standard binary operators.++>>> map binaryName [1,2,8,12]+["-","*","<","Min"]+-} binaryName :: Int -> String binaryName n = let e = toEnum n@@ -239,19 +256,26 @@ {- | Given name of binary operator derive index. -> Data.Maybe.mapMaybe (binaryIndex Ci) (words "* mul ring1 +") == [2,2,30,0]-> binaryIndex Ci "sinosc" == Nothing-> map (\x -> (x,binaryIndex Ci x)) (map snd binary_sym_tbl)+>>> Data.Maybe.mapMaybe (binaryIndex Base.Ci) (words "* mul ring1 +")+[2,2,30,0]++>>> binaryIndex Base.Ci "sinosc"+Nothing++>>> map (\x -> (x,binaryIndex Base.Ci x)) (map snd binary_sym_tbl)+[("+",Just 0),("-",Just 1),("*",Just 2),("/",Just 4),("%",Just 5),("==",Just 6),("/=",Just 7),("<",Just 8),(">",Just 9),("<=",Just 10),(">=",Just 11),(".&.",Just 14),(".|.",Just 15),("**",Just 25)] -} binaryIndex :: Base.Case_Rule -> String -> Maybe Int binaryIndex cr nm =- let ix = Base.rlookup_str cr nm binary_sym_tbl- ix' = parse_binary cr nm- in fmap fromEnum (mplus ix' ix)+ let ix = Base.rlookup_str cr nm binary_sym_tbl+ ix' = parse_binary cr nm+ in fmap fromEnum (mplus ix' ix) --- | 'isJust' of 'binaryIndex'.------ > map (is_binary Ci) (words "== > % Trunc max")+{- | 'isJust' of 'binaryIndex'.++>>> map (is_binary Base.Ci) (words "== > % Trunc max")+[True,True,True,True,True]+-} is_binary :: Base.Case_Rule -> String -> Bool is_binary cr = isJust . binaryIndex cr @@ -260,54 +284,57 @@ -- | Lookup operator name for operator Ugens, else Ugen name. ugen_operator_name :: String -> Int -> Maybe String ugen_operator_name nm n =- case nm of- "UnaryOpUGen" -> Just (unaryName n)- "BinaryOpUGen" -> Just (binaryName n)- _ -> Nothing+ case nm of+ "UnaryOpUGen" -> Just (unaryName n)+ "BinaryOpUGen" -> Just (binaryName n)+ _ -> Nothing {- | Order of lookup: binary then unary. -> map (resolve_operator Ci) (words "+ - Add sub Neg abs")-> map (resolve_operator Cs) (words "Abs")+>>> map (resolve_operator Base.Ci) (words "+ - sub abs max")+[("BinaryOpUGen",Just 0),("BinaryOpUGen",Just 1),("BinaryOpUGen",Just 1),("UnaryOpUGen",Just 5),("BinaryOpUGen",Just 13)]++>>> map (resolve_operator Base.Cs) (words "Abs Add Neg")+[("UnaryOpUGen",Just 5),("BinaryOpUGen",Just 0),("UnaryOpUGen",Just 0)] -}-resolve_operator :: Base.Case_Rule -> String -> (String,Maybe Int)+resolve_operator :: Base.Case_Rule -> String -> (String, Maybe Int) resolve_operator cr nm =- case binaryIndex cr nm of- Just sp -> ("BinaryOpUGen",Just sp)- Nothing -> case unaryIndex cr nm of- Just sp -> ("UnaryOpUGen",Just sp)- _ -> (nm,Nothing)+ case binaryIndex cr nm of+ Just sp -> ("BinaryOpUGen", Just sp)+ Nothing -> case unaryIndex cr nm of+ Just sp -> ("UnaryOpUGen", Just sp)+ _ -> (nm, Nothing) -- | Case-insensitive resolve_operator.-resolve_operator_ci :: String -> (String,Maybe Int)+resolve_operator_ci :: String -> (String, Maybe Int) resolve_operator_ci = resolve_operator Base.Ci -- * Classes -- | Variant on 'Eq' class, result is of the same type as the values compared.-class (Eq a,Num a) => EqE a where+class (Eq a, Num a) => EqE a where equal_to :: a -> a -> a equal_to = Math.sc3_eq not_equal_to :: a -> a -> a not_equal_to = Math.sc3_neq -instance EqE Int where-instance EqE Integer where-instance EqE Int32 where-instance EqE Int64 where-instance EqE Float where-instance EqE Double where+instance EqE Int+instance EqE Integer+instance EqE Int32+instance EqE Int64+instance EqE Float+instance EqE Double -- | Variant on Ord class, result is of the same type as the values compared.-class (Ord a,Num a) => OrdE a where- less_than :: a -> a -> a- less_than = Math.sc3_lt- less_than_or_equal_to :: a -> a -> a- less_than_or_equal_to = Math.sc3_lte- greater_than :: a -> a -> a- greater_than = Math.sc3_gt- greater_than_or_equal_to :: a -> a -> a- greater_than_or_equal_to = Math.sc3_gte+class (Ord a, Num a) => OrdE a where+ less_than :: a -> a -> a+ less_than = Math.sc3_lt+ less_than_or_equal_to :: a -> a -> a+ less_than_or_equal_to = Math.sc3_lte+ greater_than :: a -> a -> a+ greater_than = Math.sc3_gt+ greater_than_or_equal_to :: a -> a -> a+ greater_than_or_equal_to = Math.sc3_gte instance OrdE Int instance OrdE Integer@@ -318,7 +345,7 @@ -- | Variant of 'RealFrac' with non 'Integral' results. class RealFrac a => RealFracE a where- properFractionE :: a -> (a,a)+ properFractionE :: a -> (a, a) properFractionE = Math.sc3_properFraction truncateE :: a -> a truncateE = Math.sc3_truncate@@ -332,128 +359,130 @@ instance RealFracE Float instance RealFracE Double --- | Unary operator class.------ > map (floor . (* 1e4) . dbAmp) [-90,-60,-30,0] == [0,10,316,10000]+{- | Unary operator class.++>>> map (floor . (* 1e4) . dbAmp) [-90,-60,-30,0]+[0,10,316,10000]+-} class (Floating a, Ord a) => UnaryOp a where- ampDb :: a -> a- ampDb = Math.amp_to_db- asFloat :: a -> a- asFloat = error "asFloat"- asInt :: a -> a- asInt = error "asInt"- cpsMidi :: a -> a- cpsMidi = Math.cps_to_midi- cpsOct :: a -> a- cpsOct = Math.cps_to_oct- cubed :: a -> a- cubed n = n * n * n- dbAmp :: a -> a- dbAmp = Math.db_to_amp- distort :: a -> a- distort = Math.sc3_distort- frac :: a -> a- frac = error "frac"- isNil :: a -> a- isNil a = if a == 0.0 then 0.0 else 1.0- log10 :: a -> a- log10 = logBase 10- log2 :: a -> a- log2 = logBase 2- midiCps :: a -> a- midiCps = Math.midi_to_cps- midiRatio :: a -> a- midiRatio = Math.midi_to_ratio- notE :: a -> a- notE a = if a > 0.0 then 0.0 else 1.0- notNil :: a -> a- notNil a = if a /= 0.0 then 0.0 else 1.0- octCps :: a -> a- octCps = Math.oct_to_cps- ramp_ :: a -> a- ramp_ _ = error "ramp_"- ratioMidi :: a -> a- ratioMidi = Math.ratio_to_midi- softClip :: a -> a- softClip = Math.sc3_softclip- squared :: a -> a- squared = \z -> z * z+ ampDb :: a -> a+ ampDb = Math.amp_to_db+ asFloat :: a -> a+ asFloat = error "asFloat"+ asInt :: a -> a+ asInt = error "asInt"+ cpsMidi :: a -> a+ cpsMidi = Math.cps_to_midi+ cpsOct :: a -> a+ cpsOct = Math.cps_to_oct+ cubed :: a -> a+ cubed n = n * n * n+ dbAmp :: a -> a+ dbAmp = Math.db_to_amp+ distort :: a -> a+ distort = Math.sc3_distort+ frac :: a -> a+ frac = error "frac"+ isNil :: a -> a+ isNil a = if a == 0.0 then 0.0 else 1.0+ log10 :: a -> a+ log10 = logBase 10+ log2 :: a -> a+ log2 = logBase 2+ midiCps :: a -> a+ midiCps = Math.midi_to_cps+ midiRatio :: a -> a+ midiRatio = Math.midi_to_ratio+ notE :: a -> a+ notE a = if a > 0.0 then 0.0 else 1.0+ notNil :: a -> a+ notNil a = if a /= 0.0 then 0.0 else 1.0+ octCps :: a -> a+ octCps = Math.oct_to_cps+ ramp_ :: a -> a+ ramp_ _ = error "ramp_"+ ratioMidi :: a -> a+ ratioMidi = Math.ratio_to_midi+ softClip :: a -> a+ softClip = Math.sc3_softclip+ squared :: a -> a+ squared = \z -> z * z -instance UnaryOp Float where-instance UnaryOp Double where+instance UnaryOp Float+instance UnaryOp Double -- | Sc3_Binary_Op operator class.-class (Floating a,RealFrac a, Ord a) => BinaryOp a where- absDif :: a -> a -> a- absDif a b = abs (a - b)- amClip :: a -> a -> a- amClip a b = if b <= 0 then 0 else a * b- atan2E :: a -> a -> a- atan2E a b = atan (b/a)- clip2 :: a -> a -> a- clip2 a b = Math.sc3_clip a (-b) b- difSqr :: a -> a -> a- difSqr = Math.sc3_dif_sqr- excess :: a -> a -> a- excess a b = a - Math.sc3_clip a (-b) b- exprandRange :: a -> a -> a- exprandRange = error "exprandRange"- fill :: a -> a -> a- fill = error "fill"- firstArg :: a -> a -> a- firstArg a _ = a- fold2 :: a -> a -> a- fold2 a b = Math.sc3_fold a (-b) b- gcdE :: a -> a -> a- gcdE = Math.sc3_gcd- hypot :: a -> a -> a- hypot = Math.sc3_hypot- hypotx :: a -> a -> a- hypotx = Math.sc3_hypotx- iDiv :: a -> a -> a- iDiv = Math.sc3_idiv- lcmE :: a -> a -> a- lcmE = Math.sc3_lcm- modE :: a -> a -> a- modE = Math.sc3_mod- randRange :: a -> a -> a- randRange = error "randRange"- ring1 :: a -> a -> a- ring1 a b = a * b + a- ring2 :: a -> a -> a- ring2 a b = a * b + a + b- ring3 :: a -> a -> a- ring3 a b = a * a * b- ring4 :: a -> a -> a- ring4 a b = a * a * b - a * b * b- roundUp :: a -> a -> a- roundUp = error "roundUp"- scaleNeg :: a -> a -> a- scaleNeg a b = (abs a - a) * b' + a where b' = 0.5 * b + 0.5- sqrDif :: a -> a -> a- sqrDif a b = (a-b) * (a-b)- sqrSum :: a -> a -> a- sqrSum a b = (a+b) * (a+b)- sumSqr :: a -> a -> a- sumSqr a b = (a*a) + (b*b)- thresh :: a -> a -> a- thresh a b = if a < b then 0 else a- trunc :: a -> a -> a- trunc = error "trunc"- wrap2 :: a -> a -> a- wrap2 = error "wrap2"+class (Floating a, RealFrac a, Ord a) => BinaryOp a where+ absDif :: a -> a -> a+ absDif a b = abs (a - b)+ amClip :: a -> a -> a+ amClip a b = if b <= 0 then 0 else a * b+ atan2E :: a -> a -> a+ atan2E a b = atan (b / a)+ clip2 :: a -> a -> a+ clip2 a b = Math.sc3_clip a (-b) b+ difSqr :: a -> a -> a+ difSqr = Math.sc3_dif_sqr+ excess :: a -> a -> a+ excess a b = a - Math.sc3_clip a (-b) b+ exprandRange :: a -> a -> a+ exprandRange = error "exprandRange"+ fill :: a -> a -> a+ fill = error "fill"+ firstArg :: a -> a -> a+ firstArg a _ = a+ fold2 :: a -> a -> a+ fold2 a b = Math.sc3_fold a (-b) b+ gcdE :: a -> a -> a+ gcdE = Math.sc3_gcd+ hypot :: a -> a -> a+ hypot = Math.sc3_hypot+ hypotx :: a -> a -> a+ hypotx = Math.sc3_hypotx+ iDiv :: a -> a -> a+ iDiv = Math.sc3_idiv+ lcmE :: a -> a -> a+ lcmE = Math.sc3_lcm+ modE :: a -> a -> a+ modE = Math.sc3_mod+ randRange :: a -> a -> a+ randRange = error "randRange"+ ring1 :: a -> a -> a+ ring1 a b = a * b + a+ ring2 :: a -> a -> a+ ring2 a b = a * b + a + b+ ring3 :: a -> a -> a+ ring3 a b = a * a * b+ ring4 :: a -> a -> a+ ring4 a b = a * a * b - a * b * b+ roundUp :: a -> a -> a+ roundUp = error "roundUp"+ scaleNeg :: a -> a -> a+ scaleNeg a b = (abs a - a) * b' + a where b' = 0.5 * b + 0.5+ sqrDif :: a -> a -> a+ sqrDif a b = (a - b) * (a - b)+ sqrSum :: a -> a -> a+ sqrSum a b = (a + b) * (a + b)+ sumSqr :: a -> a -> a+ sumSqr a b = (a * a) + (b * b)+ thresh :: a -> a -> a+ thresh a b = if a < b then 0 else a+ trunc :: a -> a -> a+ trunc = error "trunc"+ wrap2 :: a -> a -> a+ wrap2 = error "wrap2" instance BinaryOp Float where- fold2 a b = Math.sc3_fold a (-b) b- modE = F.mod'- roundUp a b = if b == 0 then a else ceilingE (a/b + 0.5) * b- wrap2 a b = Math.sc3_wrap_ni (-b) b a+ fold2 a b = Math.sc3_fold a (-b) b+ modE = F.mod'+ roundUp a b = if b == 0 then a else ceilingE (a / b + 0.5) * b+ wrap2 a b = Math.sc3_wrap_ni (-b) b a instance BinaryOp Double where- fold2 a b = Math.sc3_fold a (-b) b- modE = F.mod'- roundUp a b = if b == 0 then a else ceilingE (a/b + 0.5) * b- wrap2 a b = Math.sc3_wrap_ni (-b) b a+ fold2 a b = Math.sc3_fold a (-b) b+ modE = F.mod'+ roundUp a b = if b == 0 then a else ceilingE (a / b + 0.5) * b+ wrap2 a b = Math.sc3_wrap_ni (-b) b a -- * Infix @@ -478,49 +507,51 @@ -- * Tables -- | Association table for 'Sc3_Binary_Op' to haskell function implementing operator.-binop_hs_tbl :: (Real n,Floating n,RealFrac n) => [(Sc3_Binary_Op,n -> n -> n)]+binop_hs_tbl :: (Real n, Floating n, RealFrac n) => [(Sc3_Binary_Op, n -> n -> n)] binop_hs_tbl =- [(OpAdd,(+))- ,(OpSub,(-))- ,(OpFdiv,(/))- ,(OpIdiv,Math.sc3_idiv)- ,(OpMod,Math.sc3_mod)- ,(OpEq,Math.sc3_eq)- ,(OpNe,Math.sc3_neq)- ,(OpLt,Math.sc3_lt)- ,(OpLe,Math.sc3_lte)- ,(OpGt,Math.sc3_gt)- ,(OpGe,Math.sc3_gte)- ,(OpMin,min)- ,(OpMax,max)- ,(OpMul,(*))- ,(OpPow,(**))- ,(OpMin,min)- ,(OpMax,max)- ,(OpRoundTo,Math.sc3_round_to)]+ [ (OpAdd, (+))+ , (OpSub, (-))+ , (OpFdiv, (/))+ , (OpIdiv, Math.sc3_idiv)+ , (OpMod, Math.sc3_mod)+ , (OpEq, Math.sc3_eq)+ , (OpNe, Math.sc3_neq)+ , (OpLt, Math.sc3_lt)+ , (OpLe, Math.sc3_lte)+ , (OpGt, Math.sc3_gt)+ , (OpGe, Math.sc3_gte)+ , (OpMin, min)+ , (OpMax, max)+ , (OpMul, (*))+ , (OpPow, (**))+ , (OpMin, min)+ , (OpMax, max)+ , (OpRoundTo, Math.sc3_round_to)+ ] -- | 'lookup' 'binop_hs_tbl' via 'toEnum'.-binop_special_hs :: (RealFrac n,Floating n) => Int -> Maybe (n -> n -> n)+binop_special_hs :: (RealFrac n, Floating n) => Int -> Maybe (n -> n -> n) binop_special_hs z = lookup (toEnum z) binop_hs_tbl -- | Association table for 'Unary' to haskell function implementing operator.-uop_hs_tbl :: (RealFrac n,Floating n) => [(Sc3_Unary_Op,n -> n)]+uop_hs_tbl :: (RealFrac n, Floating n) => [(Sc3_Unary_Op, n -> n)] uop_hs_tbl =- [(OpNeg,negate)- ,(OpNot,\z -> if z > 0 then 0 else 1)- ,(OpAbs,abs)- ,(OpCeil,Math.sc3_ceiling)- ,(OpFloor,Math.sc3_floor)- ,(OpSquared,\z -> z * z)- ,(OpCubed,\z -> z * z * z)- ,(OpSqrt,sqrt)- ,(OpRecip,recip)- ,(OpMidiCps,Math.midi_to_cps)- ,(OpCpsMidi,Math.cps_to_midi)- ,(OpSin,sin)- ,(OpCos,cos)- ,(OpTan,tan)]+ [ (OpNeg, negate)+ , (OpNot, \z -> if z > 0 then 0 else 1)+ , (OpAbs, abs)+ , (OpCeil, Math.sc3_ceiling)+ , (OpFloor, Math.sc3_floor)+ , (OpSquared, \z -> z * z)+ , (OpCubed, \z -> z * z * z)+ , (OpSqrt, sqrt)+ , (OpRecip, recip)+ , (OpMidiCps, Math.midi_to_cps)+ , (OpCpsMidi, Math.cps_to_midi)+ , (OpSin, sin)+ , (OpCos, cos)+ , (OpTan, tan)+ ] -- | 'lookup' 'uop_hs_tbl' via 'toEnum'.-uop_special_hs :: (RealFrac n,Floating n) => Int -> Maybe (n -> n)+uop_special_hs :: (RealFrac n, Floating n) => Int -> Maybe (n -> n) uop_special_hs z = lookup (toEnum z) uop_hs_tbl
Sound/Sc3/Common/Math/Warp.hs view
@@ -10,24 +10,32 @@ {- | Linear real value map. -> map (warp_lin 1 2) [0,1/2,1] == [1,3/2,2]-> map (warp_lin (-1) 1) [0,1/2,1] == [-1,0,1]+>>> map (warp_lin 1 2) [0,1/2,1] == [1,3/2,2]+True++>>> map (warp_lin (-1) 1) [0,1/2,1] == [-1,0,1]+True -} warp_lin :: Fractional t => Warp_f t warp_lin l r n = let z = r - l in n * z + l {- | Inverse of 'warp_lin' -> map (warp_lin_inv 1 2) [1,3/2,2] == [0,1/2,1]-> map (warp_lin_inv (-1) 1) [-1,0,1] == [0,1/2,1]+>>> map (warp_lin_inv 1 2) [1,3/2,2] == [0,1/2,1]+True++>>> map (warp_lin_inv (-1) 1) [-1,0,1] == [0,1/2,1]+True -} warp_lin_inv :: Fractional t => Warp_f t warp_lin_inv l r n = let z = r - l in (n - l) / z {- | The left and right must both be non zero and have the same sign. -> map (warp_exp 1 2) [0,0.5,1] == [1,2 ** 0.5,2]-> import Sound.Sc3.Plot {- hsc3-plot -}+>>> map (warp_exp 1 2) [0,0.5,1] == [1,2 ** 0.5,2]+True++> import Sound.Sc3.Plot {\- hsc3-plot -\} > plot_p1_ln [map (warp_exp 1 2) [0,0.01 .. 1]] -} warp_exp :: Floating a => Warp_f a@@ -99,20 +107,22 @@ warp_curve :: (Ord a, Floating a) => a -> Warp_f a warp_curve k l r n = if abs k < 0.001- then warp_lin l r n- else let e = exp k- a = (r - l) / (1 - e)- b = l + a- in b - ((e ** n) * a)+ then warp_lin l r n+ else+ let e = exp k+ a = (r - l) / (1 - e)+ b = l + a+ in b - ((e ** n) * a) warp_curve_inv :: (Ord a, Floating a) => a -> Warp_f a warp_curve_inv k l r n = if abs k < 0.001- then warp_lin l r n- else let e = exp k- a = (r - l) / (1 - e)- b = l + a- in log ((b - n) / a) / k+ then warp_lin l r n+ else+ let e = exp k+ a = (r - l) / (1 - e)+ b = l + a+ in log ((b - n) / a) / k {- | Select warp functions by name. Numerical names are interpreted as /curve/ values for 'warpCurve'. @@ -123,13 +133,13 @@ -} warp_named :: (Floating t, RealFrac t) => String -> Maybe (Warp_f t, Warp_f t) warp_named nm =- case nm of- "lin" -> Just (warp_lin,warp_lin_inv)- "exp" -> Just (warp_exp,warp_exp_inv)- "sin" -> Just (warp_sin,warp_sin_inv)- "cos" -> Just (warp_cos,warp_cos_inv)- "amp" -> Just (warp_amp,warp_amp_inv)- "db" -> Just (warp_db,warp_db_inv)- _ -> case readSigned readFloat nm of- [(c,"")] -> Just (warp_curve c,warp_curve_inv c)- _ -> Nothing+ case nm of+ "lin" -> Just (warp_lin, warp_lin_inv)+ "exp" -> Just (warp_exp, warp_exp_inv)+ "sin" -> Just (warp_sin, warp_sin_inv)+ "cos" -> Just (warp_cos, warp_cos_inv)+ "amp" -> Just (warp_amp, warp_amp_inv)+ "db" -> Just (warp_db, warp_db_inv)+ _ -> case readSigned readFloat nm of+ [(c, "")] -> Just (warp_curve c, warp_curve_inv c)+ _ -> Nothing
Sound/Sc3/Common/Math/Window.hs view
@@ -21,13 +21,13 @@ The cycle argument decides if the end point should be equal to the start point, or one place short. When using a table with an oscillator we want the latter, since the point following the end point is the start point. -}-window_table :: (Integral n,Fractional a,Enum a) => TableFormat -> n -> Window a -> Table a+window_table :: (Integral n, Fractional a, Enum a) => TableFormat -> n -> Window a -> Table a window_table fmt n f = let k = 1 / (fromIntegral n - (if fmt == TableClosed then 1 else 0)) in take (fromIntegral (if fmt == TableGuarded then n + 1 else n)) (map f [0, k ..]) -- | window_table of TableClosed.-window_table_closed :: (Integral n,Fractional a,Enum a) => n -> Window a -> Table a+window_table_closed :: (Integral n, Fractional a, Enum a) => n -> Window a -> Table a window_table_closed = window_table TableClosed -- * Math@@ -40,7 +40,7 @@ -- | Gaussian window, θ <= 0.5. gaussian :: Floating a => a -> Window a-gaussian theta i = exp (- (0.5 * square ((i - 0.5) / (theta * 0.5))))+gaussian theta i = exp (-(0.5 * square ((i - 0.5) / (theta * 0.5)))) -- | Hann raised cosine window. hann :: Floating a => Window a
Sound/Sc3/Common/Mce.hs view
@@ -7,14 +7,17 @@ The Mce type is a tree, however in hsc3 Mce_Vector will always hold Mce_Scalar elements. -} data Mce t = Mce_Scalar t | Mce_Vector [Mce t]- deriving (Ord, Eq, Read, Show)+ deriving (Ord, Eq, Read, Show) {- | There are two invariants: 1. Mce should not be empty, ie. Mce_Vector should not have a null list. 2. Scalar Mce values should not be written as one-place vectors. -> mce_is_well_formed (Mce_Vector []) == False-> mce_is_well_formed (Mce_Vector [Mce_Scalar 1]) == False+>>> mce_is_well_formed (Mce_Vector [])+False++>>> mce_is_well_formed (Mce_Vector [Mce_Scalar 1])+False -} mce_is_well_formed :: Mce t -> Bool mce_is_well_formed m =@@ -39,24 +42,28 @@ {- | toList for Mce. -> let v = Mce_Vector in mce_to_list (v[v[1, 2], 3, v[4, 5]]) == [1, 2, 3, 4, 5]+>>> let v = Mce_Vector+>>> mce_to_list (v[v[1, 2], 3, v[4, 5]])+[1,2,3,4,5] -} mce_to_list :: Mce t -> [t] mce_to_list m =- case m of- Mce_Scalar e -> [e]- Mce_Vector e -> concatMap mce_to_list e+ case m of+ Mce_Scalar e -> [e]+ Mce_Vector e -> concatMap mce_to_list e {- | Pretty printer for Mce. -> let v = Mce_Vector in mce_show (v[1, 2, v[3, 4]] * 5 + v[6, 7, 8]) == "[11, 17, [23, 28]]"+>>> let v = Mce_Vector+>>> mce_show (v[1, 2, v[3, 4]] * 5 + v[6, 7, 8])+"[11, 17, [23, 28]]" -} mce_show :: Show t => Mce t -> String mce_show m =- let bracketed (l,r) x = l : x ++ [r]+ let bracketed (l, r) x = l : x ++ [r] in case m of- Mce_Scalar e -> show e- Mce_Vector e -> bracketed ('[',']') (Sound.Sc3.Common.Base.concat_intersperse ", " (map mce_show e))+ Mce_Scalar e -> show e+ Mce_Vector e -> bracketed ('[', ']') (Sound.Sc3.Common.Base.concat_intersperse ", " (map mce_show e)) -- | Read value from Mce_Scalar, error if Mce is Mce_Vector mce_scalar_value :: Mce t -> t@@ -76,10 +83,18 @@ {- | The depth of an Mce is the longest sequence of nested Mce_Vector nodes. -> mce_depth 1 == 1-> mce_depth (Mce_Vector [1, 2]) == 1-> let v = Mce_Vector in mce_depth (v[v[1, 2], 3, v[4, 5]]) == 2-> let v = Mce_Vector in mce_depth (v[v[1, 2, 3, v[4, 5], 6], 7]) == 3+>>> mce_depth 1+1++>>> mce_depth (Mce_Vector [1, 2])+1++>>> let v = Mce_Vector+>>> mce_depth (v[v[1, 2], 3, v[4, 5]])+2++>>> mce_depth (v[v[1, 2, 3, v[4, 5], 6], 7])+3 -} mce_depth :: Mce a -> Int mce_depth m =@@ -92,16 +107,16 @@ -} mce_extend :: Int -> Mce t -> Mce t mce_extend n m =- case m of- Mce_Scalar _ -> Mce_Vector (replicate n m)- Mce_Vector e -> if length e > n then error "mce_extend?" else Mce_Vector (take n (cycle e))+ case m of+ Mce_Scalar _ -> Mce_Vector (replicate n m)+ Mce_Vector e -> if length e > n then error "mce_extend?" else Mce_Vector (take n (cycle e)) -- | fmap for Mce, apply /f/ at elements of /m/. mce_map :: (a -> b) -> Mce a -> Mce b mce_map f m =- case m of- Mce_Scalar e -> Mce_Scalar (f e)- Mce_Vector e -> Mce_Vector (map (mce_map f) e)+ case m of+ Mce_Scalar e -> Mce_Scalar (f e)+ Mce_Vector e -> Mce_Vector (map (mce_map f) e) instance Functor Mce where fmap = mce_map @@ -110,27 +125,27 @@ -} mce_binop :: (a -> b -> c) -> Mce a -> Mce b -> Mce c mce_binop f m1 m2 =- case (m1,m2) of- (Mce_Scalar e1,Mce_Scalar e2) -> Mce_Scalar (f e1 e2)- (Mce_Scalar _,Mce_Vector e2) -> Mce_Vector (map (mce_binop f m1) e2)- (Mce_Vector e1,Mce_Scalar _) -> Mce_Vector (map (flip (mce_binop f) m2) e1)- (Mce_Vector e1,Mce_Vector e2) ->- let n = max (length e1) (length e2)- ext = take n . cycle- in Mce_Vector (zipWith (mce_binop f) (ext e1) (ext e2))+ case (m1, m2) of+ (Mce_Scalar e1, Mce_Scalar e2) -> Mce_Scalar (f e1 e2)+ (Mce_Scalar _, Mce_Vector e2) -> Mce_Vector (map (mce_binop f m1) e2)+ (Mce_Vector e1, Mce_Scalar _) -> Mce_Vector (map (flip (mce_binop f) m2) e1)+ (Mce_Vector e1, Mce_Vector e2) ->+ let n = max (length e1) (length e2)+ ext = take n . cycle+ in Mce_Vector (zipWith (mce_binop f) (ext e1) (ext e2)) instance Num n => Num (Mce n) where- (+) = mce_binop (+)- (-) = mce_binop (-)- (*) = mce_binop (*)- abs = mce_map abs- negate = mce_map negate- signum = mce_map signum- fromInteger = Mce_Scalar . fromInteger+ (+) = mce_binop (+)+ (-) = mce_binop (-)+ (*) = mce_binop (*)+ abs = mce_map abs+ negate = mce_map negate+ signum = mce_map signum+ fromInteger = Mce_Scalar . fromInteger instance Fractional n => Fractional (Mce n) where- (/) = mce_binop (/)- fromRational = Mce_Scalar . fromRational+ (/) = mce_binop (/)+ fromRational = Mce_Scalar . fromRational instance Floating n => Floating (Mce n) where pi = Mce_Scalar pi
Sound/Sc3/Common/Monad.hs view
@@ -15,8 +15,11 @@ {- | Right to left compositon of 'Monad' functions. -> fmap (== 7) (composeM [return . (+ 1),return . (* 2)] 3)-> fmap (== 8) (composeM [return . (* 2),return . (+ 1)] 3)+>>> composeM [return . (+ 1),return . (* 2)] 3+7++>>> composeM [return . (* 2),return . (+ 1)] 3+8 -} composeM :: Monad m => [a -> m a] -> a -> m a composeM = foldr (\f g -> \x -> g x >>= f) return -- foldr (<=<) return except hugs doesn't know of <=<
Sound/Sc3/Common/Monad/Operators.hs view
@@ -1,91 +1,133 @@ -- | Functions to make writing 'Applicative' and 'Monad' Ugen graphs less clumsy. module Sound.Sc3.Common.Monad.Operators where -import Control.Applicative {- base -}+infixl 7 .*, *., .*.+infixl 6 .+, +., .+. -infixl 7 .*,*.,.*.-infixl 6 .+,+.,.+.+infixl 7 ./, /., ./.+infixl 6 .-, -., .-. -infixl 7 ./,/.,./.-infixl 6 .-,-.,.-.+{- | '+' variant with 'Functor' at left. --- | '+' variant with 'Functor' at left.------ > fmap (== 5) (return 3 .+ 2)--- > [3,4] .+ 2 == [5,6]+>>> fmap (== 5) (return 3 .+ 2)+True++>>> [3,4] .+ 2+[5,6]+-} (.+) :: (Functor f, Num a) => f a -> a -> f a m .+ n = fmap (+ n) m --- | '+' variant with 'Functor' at right.------ > fmap (== 5) (3 +. return 2)--- > 3 +. [2,3] == [5,6]+{- | '+' variant with 'Functor' at right.++>>> fmap (== 5) (3 +. return 2)+True++>>> 3 +. [2,3]+[5,6]+-} (+.) :: (Functor f, Num a) => a -> f a -> f a m +. n = fmap (+ m) n --- | '+' variant with 'Applicative' at left and right.------ > fmap (== 5) (return 3 .+. return 2)--- > [3,4] .+. [2,3] == [5,6,6,7]--- > getZipList (ZipList [3,4] .+. ZipList [2,3]) == [5,7]+{- | '+' variant with 'Applicative' at left and right.++>>> fmap (== 5) (return 3 .+. return 2)+True++>>> [3,4] .+. [2,3]+[5,6,6,7]++>>> import Control.Applicative+>>> getZipList (ZipList [3,4] .+. ZipList [2,3])+[5,7]+-} (.+.) :: (Applicative m, Num a) => m a -> m a -> m a (.+.) = liftA2 (+) --- | '*' variant with 'Functor' at left.------ > fmap (== 6) (return 3 .* 2)+{- | '*' variant with 'Functor' at left.++>>> fmap (== 6) (return 3 .* 2)+True+-} (.*) :: (Functor f, Num a) => f a -> a -> f a m .* n = fmap (* n) m --- | '*' variant with 'Functor' at right.------ > fmap (== 6) (3 *. return 2)+{- | '*' variant with 'Functor' at right.++>>> fmap (== 6) (3 *. return 2)+True+-} (*.) :: (Functor f, Num a) => a -> f a -> f a m *. n = fmap (* m) n --- | '*' variant with 'Applicative' at left and right.------ > fmap (== 6) (return 3 .*. return 2)+{- | '*' variant with 'Applicative' at left and right.++>>> fmap (== 6) (return 3 .*. return 2)+True+-} (.*.) :: (Applicative m, Num a) => m a -> m a -> m a (.*.) = liftA2 (*) --- | '-' variant with 'Functor' at left.------ > fmap (== 1) (return 3 .- 2)--- > [3,4] .- 2 == [1,2]+{- | '-' variant with 'Functor' at left.++>>> fmap (== 1) (return 3 .- 2)+True++>>> [3,4] .- 2+[1,2]+-} (.-) :: (Functor f, Num a) => f a -> a -> f a m .- n = fmap (subtract n) m --- | '-' variant with 'Functor' at right.------ > fmap (== 1) (3 -. return 2)--- > 3 -. [2,3] == [1,0]+{- | '-' variant with 'Functor' at right.++>>> fmap (== 1) (3 -. return 2)+True++>>> 3 -. [2,3]+[1,0]+-} (-.) :: (Functor f, Num a) => a -> f a -> f a m -. n = fmap (m -) n --- | '-' variant with 'Applicative' at left and right.------ > fmap (== 1) (return 3 .-. return 2)--- > [3,4] .-. [2,3] == [1,0,2,1]--- > getZipList (ZipList [3,4] .-. ZipList [2,3]) == [1,1]+{- | '-' variant with 'Applicative' at left and right.++>>> fmap (== 1) (return 3 .-. return 2)+True++>>> [3,4] .-. [2,3]+[1,0,2,1]++>>> import Control.Applicative+>>> getZipList (ZipList [3,4] .-. ZipList [2,3])+[1,1]+-} (.-.) :: (Applicative m, Num a) => m a -> m a -> m a (.-.) = liftA2 (-) --- | '/' variant with 'Functor' at left.------ > fmap (== 3) (return 6 ./ 2)-(./) :: (Functor f,Fractional a) => f a -> a -> f a+{- | '/' variant with 'Functor' at left.++>>> fmap (== 3) (return 6 ./ 2)+True+-}+(./) :: (Functor f, Fractional a) => f a -> a -> f a m ./ n = fmap (/ n) m --- | '/' variant with 'Functor' at right.------ > fmap (== 3) (6 /. return 2)-(/.) :: (Functor f,Fractional a) => a -> f a -> f a+{- | '/' variant with 'Functor' at right.++>>> fmap (== 3) (6 /. return 2)+True+-}+(/.) :: (Functor f, Fractional a) => a -> f a -> f a m /. n = fmap (m /) n --- | '/' variant with 'Applicative' at left and right.------ > fmap (== 3) (return 6 ./. return 2)--- > [5,6] ./. [2,3] == [5/2,5/3,3,2]-(./.) :: (Applicative m,Fractional a) => m a -> m a -> m a+{- | '/' variant with 'Applicative' at left and right.++>>> fmap (== 3) (return 6 ./. return 2)+True++>>> [5,6] ./. [2,3] == [5/2,5/3,3,2]+True+-}+(./.) :: (Applicative m, Fractional a) => m a -> m a -> m a (./.) = liftA2 (/)
Sound/Sc3/Common/Random.hs view
@@ -6,9 +6,10 @@ import Data.Word {- base -} import System.CPUTime {- base -} --- | Linear congruential generator given modulo function for type.------ See <http://en.wikipedia.org/wiki/Linear_congruential_generator> for possible parameters.+{- | Linear congruential generator given modulo function for type.++See <http://en.wikipedia.org/wiki/Linear_congruential_generator> for possible parameters.+-} lcg :: Num t => (t -> t) -> t -> t -> t -> t lcg modFunc a c x0 = modFunc (a * x0 + c)
Sound/Sc3/Common/Rate.hs view
@@ -6,7 +6,7 @@ -- | Enumeration of operating rates of unit generators. data Rate = InitialisationRate | ControlRate | AudioRate | DemandRate- deriving (Eq,Ord,Enum,Bounded,Show,Read)+ deriving (Eq, Ord, Enum, Bounded, Show, Read) {- | Standard abbreviations of Rate values. ir = initialisation, kr = control, ar = audio, dr = demand.@@ -26,8 +26,9 @@ -} rateAbbrev :: Rate -> String rateAbbrev rt =- fromMaybe (error "rateAbbrev?")- (lookup (fromEnum rt) (zip [0..] (words "ir kr ar dr")))+ fromMaybe+ (error "rateAbbrev?")+ (lookup (fromEnum rt) (zip [0 ..] (words "ir kr ar dr"))) {- | Standard SuperCollider rate abbreviations. @@ -35,8 +36,9 @@ -} rateName :: Rate -> String rateName rt =- fromMaybe (error "rateName?")- (lookup (fromEnum rt) (zip [0..] (words "scalar control audio demand")))+ fromMaybe+ (error "rateName?")+ (lookup (fromEnum rt) (zip [0 ..] (words "scalar control audio demand"))) -- | Integer rate identifier, as required for scsynth bytecode. rateId :: Rate -> Int@@ -45,11 +47,11 @@ -- | Color identifiers for each 'Rate'. rate_color :: Rate -> String rate_color r =- case r of- AudioRate -> "black"- ControlRate -> "blue"- InitialisationRate -> "yellow"- DemandRate -> "red"+ case r of+ AudioRate -> "black"+ ControlRate -> "blue"+ InitialisationRate -> "yellow"+ DemandRate -> "red" -- | Set of all 'Rate' values. all_rates :: [Rate]@@ -61,12 +63,12 @@ -} rate_parse :: String -> Maybe Rate rate_parse r =- case map toUpper r of- "AR" -> Just AudioRate- "KR" -> Just ControlRate- "IR" -> Just InitialisationRate- "DR" -> Just DemandRate- _ -> Nothing+ case map toUpper r of+ "AR" -> Just AudioRate+ "KR" -> Just ControlRate+ "IR" -> Just InitialisationRate+ "DR" -> Just DemandRate+ _ -> Nothing -- * Control rates @@ -74,17 +76,17 @@ I = initialisation, K = control, T = trigger, A = audio. -} data K_Type = K_InitialisationRate | K_ControlRate | K_TriggerRate | K_AudioRate- deriving (Eq,Show,Ord)+ deriving (Eq, Show, Ord) -- | Determine class of control given 'Rate' and /trigger/ status. ktype :: Rate -> Bool -> K_Type ktype r tr =- if tr+ if tr then case r of- ControlRate -> K_TriggerRate- _ -> error "ktype: non ControlRate trigger control"+ ControlRate -> K_TriggerRate+ _ -> error "ktype: non ControlRate trigger control" else case r of- InitialisationRate -> K_InitialisationRate- ControlRate -> K_ControlRate- AudioRate -> K_AudioRate- DemandRate -> error "ktype: DemandRate control"+ InitialisationRate -> K_InitialisationRate+ ControlRate -> K_ControlRate+ AudioRate -> K_AudioRate+ DemandRate -> error "ktype: DemandRate control"
Sound/Sc3/Common/SoundFile.hs view
@@ -24,7 +24,6 @@ [r0] -> return (Just r0) _ -> error "findFileFromDirectory: multiple files?" - {- | Find the file fn starting from dir. If dir/fn names a file return that file, else call findFileFromDirectory. Note this will not find dir/p/q/r given q/r, the query must be either p/q/r or r.@@ -44,7 +43,7 @@ findFileAtOrFromPath path fn = case path of [] -> return Nothing- dir:path' -> do+ dir : path' -> do m <- findFileAtOrFromDirectory dir fn case m of Just r -> return (Just r)@@ -79,7 +78,7 @@ sfResolveFile fn = do m <- sfFindFile fn case m of- Nothing -> error ("sfResolveFile: " ++ fn)+ Nothing -> error ("sfResolveFile: " ++ fn) Just r -> return r {- | Unsafe sfResolveFile.
Sound/Sc3/Common/Uid.hs view
@@ -1,4 +1,4 @@-{-# Language FlexibleInstances #-}+{-# LANGUAGE FlexibleInstances #-} {- | Unique identifier types and classes. Used by non-deterministic (noise) and non-sharable (demand) unit generators.@@ -23,17 +23,17 @@ -- | A class indicating a monad (and functor and applicative) that will generate a sequence of unique integer identifiers. class (Functor m, Applicative m, Monad m) => Uid m where- generateUid :: m Int+ generateUid :: m Int -- | Requires FlexibleInstances. instance Uid (State.StateT Int Identity) where- generateUid = State.get >>= \n -> State.put (n + 1) >> return n+ generateUid = State.get >>= \n -> State.put (n + 1) >> return n instance Uid IO where- generateUid = fmap Unique.hashUnique Unique.newUnique+ generateUid = fmap Unique.hashUnique Unique.newUnique instance Uid m => Uid (Reader.ReaderT t m) where- generateUid = Reader.ReaderT (const generateUid)+ generateUid = Reader.ReaderT (const generateUid) -- * Uid_St @@ -52,11 +52,11 @@ uid_st_eval x = State.evalState x 0 -- | Thread state through sequence of 'State.runState'.-uid_st_seq :: [Uid_St t] -> ([t],Int)+uid_st_seq :: [Uid_St t] -> ([t], Int) uid_st_seq =- let swap (p,q) = (q,p)- step_f n x = swap (State.runState x n)- in swap . mapAccumL step_f 0+ let swap (p, q) = (q, p)+ step_f n x = swap (State.runState x n)+ in swap . mapAccumL step_f 0 {- | 'fst' of 'uid_st_seq'. @@ -127,13 +127,13 @@ > map resolveID [('α', 'α', 'β'),('β', 'α', 'β')] == [0020082907, 2688286317] -} class Murmur32.Hashable32 a => ID a where- resolveID :: a -> Id- resolveID = fromIntegral . Murmur32.asWord32 . Murmur32.hash32+ resolveID :: a -> Id+ resolveID = fromIntegral . Murmur32.asWord32 . Murmur32.hash32 -instance ID Char where+instance ID Char instance ID Int where resolveID = id-instance (ID p,ID q) => ID (p,q) where-instance (ID p,ID q,ID r) => ID (p,q,r) where+instance (ID p, ID q) => ID (p, q)+instance (ID p, ID q, ID r) => ID (p, q, r) {- | /n/ identifiers from /x/.
Sound/Sc3/Fd.hs view
@@ -1,5 +1,6 @@--- | Composite of "Sound.Sc3.Common", "Sound.Sc3.Server.Fd",--- "Sound.Sc3.Ugen" and "Sound.Sc3.Ugen.Bindings".+{- | Composite of "Sound.Sc3.Common", "Sound.Sc3.Server.Fd",+ "Sound.Sc3.Ugen" and "Sound.Sc3.Ugen.Bindings".+-} module Sound.Sc3.Fd (module M) where import Sound.Sc3.Common as M
Sound/Sc3/Server.hs view
@@ -1,15 +1,16 @@--- | Collection of modules for communicating with the SuperCollider--- synthesis server, see also "Sound.Sc3.Server.FD" and--- "Sound.Sc3.Server.Monad".+{- | Collection of modules for communicating with the SuperCollider+synthesis server, see also "Sound.Sc3.Server.FD" and+"Sound.Sc3.Server.Monad".+-} module Sound.Sc3.Server (module S) where import Sound.Sc3.Server.Command as S import Sound.Sc3.Server.Enum as S-import Sound.Sc3.Server.Synthdef as S-import Sound.Sc3.Server.Status as S import Sound.Sc3.Server.Nrt as S import Sound.Sc3.Server.Nrt.Edit as S import Sound.Sc3.Server.Nrt.Render as S import Sound.Sc3.Server.Param as S import Sound.Sc3.Server.Recorder as S import Sound.Sc3.Server.Scsynth as S+import Sound.Sc3.Server.Status as S+import Sound.Sc3.Server.Synthdef as S
Sound/Sc3/Server/Command.hs view
@@ -1,5 +1,6 @@ -- | Collection of standard /command/ modules. module Sound.Sc3.Server.Command (module S) where +import Sound.Sc3.Server.Command.Completion as S import Sound.Sc3.Server.Command.Enum as S import Sound.Sc3.Server.Command.Plain as S
Sound/Sc3/Server/Command/Completion.hs view
@@ -1,68 +1,26 @@--- | This module provides variations of the asynchronous server commands that--- expect a /completion packet/ as the first argument. The completion packet--- is executed by the server when the asynchronous command has finished. Note--- that this mechanism is for synchronizing server side processes only, for--- client side synchronization use @\/done@ message notification or the--- @\/sync@ barrier.+-- | Modify existing message to include completion message module Sound.Sc3.Server.Command.Completion where import Sound.Osc.Core {- hosc -} -import Sound.Sc3.Server.Enum-import Sound.Sc3.Server.Synthdef---- | Encode an Osc packet as an Osc blob.-encode_blob :: Packet -> Datum-encode_blob = Blob . encodePacket---- | Install a bytecode instrument definition. (Asynchronous)-d_recv :: Packet -> Synthdef -> Message-d_recv pkt d = Message "/d_recv" [Blob (synthdefData d),encode_blob pkt]---- | Load an instrument definition from a named file. (Asynchronous)-d_load :: Packet -> String -> Message-d_load pkt p = Message "/d_load" [string p,encode_blob pkt]---- | Load a directory of instrument definitions files. (Asynchronous)-d_loadDir :: Packet -> String -> Message-d_loadDir pkt p = Message "/d_loadDir" [string p,encode_blob pkt]---- | Allocates zero filled buffer to number of channels and samples. (Asynchronous)-b_alloc :: Packet -> Int -> Int -> Int -> Message-b_alloc pkt nid frames channels = Message "/b_alloc" [int32 nid,int32 frames,int32 channels,encode_blob pkt]---- | Allocate buffer space and read a sound file. (Asynchronous)-b_allocRead :: Packet -> Int -> String -> Int -> Int -> Message-b_allocRead pkt nid p f n = Message "/b_allocRead" [int32 nid,string p,int32 f,int32 n,encode_blob pkt]---- | Allocate buffer space and read a sound file, picking specific channels. (Asynchronous)-b_allocReadChannel :: Packet -> Int -> String -> Int -> Int -> [Int] -> Message-b_allocReadChannel pkt nid p f n cs = Message "/b_allocReadChannel" ([int32 nid,string p,int32 f,int32 n] ++ map int32 cs ++ [encode_blob pkt])---- | Free buffer data. (Asynchronous)-b_free :: Packet -> Int -> Message-b_free pkt nid = Message "/b_free" [int32 nid,encode_blob pkt]---- | Close attached soundfile and write header information. (Asynchronous)-b_close :: Packet -> Int -> Message-b_close pkt nid = Message "/b_close" [int32 nid,encode_blob pkt]---- | Read sound file data into an existing buffer. (Asynchronous)-b_read :: Packet -> Int -> String -> Int -> Int -> Int -> Bool -> Message-b_read pkt nid p f n f' z = Message "/b_read" [int32 nid,string p,int32 f,int32 n,int32 f',int32 (fromEnum z),encode_blob pkt]---- | Read sound file data into an existing buffer. (Asynchronous)-b_readChannel :: Packet -> Int -> String -> Int -> Int -> Int -> Bool -> [Int] -> Message-b_readChannel pkt nid p f n f' z cs = Message "/b_readChannel" ([int32 nid,string p,int32 f,int32 n,int32 f',int32 (fromEnum z)] ++ map int32 cs ++ [encode_blob pkt])+import qualified Sound.Sc3.Server.Command.Enum as Server.Command.Enum {- hsc3 -} --- | Write sound file data. (Asynchronous)-b_write :: Packet -> Int -> String -> SoundFileFormat -> SampleFormat -> Int -> Int -> Bool -> Message-b_write pkt nid p h t f s z = Message "/b_write" [int32 nid,string p,string (soundFileFormatString h),string (sampleFormatString t),int32 f,int32 s,int32 (fromEnum z),encode_blob pkt]+-- | Add a completion packet to an existing asynchronous command.+with_completion_packet :: Message -> PacketOf Message -> Message+with_completion_packet (Message c xs) cm =+ if c `elem` Server.Command.Enum.async_cmds+ then+ let xs' = xs ++ [Blob (encodePacket cm)]+ in Message c xs'+ else error ("with_completion_packet: not async: " ++ c) --- | Zero sample data. (Asynchronous)-b_zero :: Packet -> Int -> Message-b_zero pkt nid = Message "/b_zero" [int32 nid,encode_blob pkt]+{- | Add a completion message to an existing asynchronous command. --- Local Variables:--- truncate-lines:t--- End:+>>> import Sound.Sc3.Server.Command.Plain+>>> let m = n_set1 0 "0" 0+>>> let e = encodeMessage m+>>> withCm (b_close 0) m == Message "/b_close" [Int32 0,Blob e]+True+-}+withCm :: Message -> Message -> Message+withCm m cm = with_completion_packet m (Packet_Message cm)
Sound/Sc3/Server/Command/Enum.hs view
@@ -10,94 +10,96 @@ type SC3_Command = String -- | Enumerate server command numbers.-sc3_cmd_enumeration :: [(SC3_Command,Int)]+sc3_cmd_enumeration :: [(SC3_Command, Int)] sc3_cmd_enumeration =- [("/notify",1)- ,("/status",2)- ,("/quit",3)- ,("/cmd",4)- -- /d = synthdef- ,("/d_recv",5)- ,("/d_load",6)- ,("/d_loadDir",7)- ,("/d_freeAll",8)- -- /s = synth- ,("/s_new",9)- -- /n = node- ,("/n_trace",10)- ,("/n_free",11)- ,("/n_run",12)- ,("/n_cmd",13)- ,("/n_map",14)- ,("/n_set",15)- ,("/n_setn",16)- ,("/n_fill",17)- ,("/n_before",18)- ,("/n_after",19)- -- /u = ugen- ,("/u_cmd",20)- -- /g = group- ,("/g_new",21)- ,("/g_head",22)- ,("/g_tail",23)- ,("/g_freeAll",24)- -- /c = control- ,("/c_set",25)- ,("/c_setn",26)- ,("/c_fill",27)- -- /b = buffer- ,("/b_alloc",28)- ,("/b_allocRead",29)- ,("/b_read",30)- ,("/b_write",31)- ,("/b_free",32)- ,("/b_close",33)- ,("/b_zero",34)- ,("/b_set",35)- ,("/b_setn",36)- ,("/b_fill",37)- ,("/b_gen",38)- --- ,("/dumpOSC",39)- -- _get- ,("/c_get",40)- ,("/c_getn",41)- ,("/b_get",42)- ,("/b_getn",43)- ,("/s_get",44)- ,("/s_getn",45)- -- _query- ,("/n_query",46)- ,("/b_query",47)- --- ,("/n_mapn",48)- ,("/s_noid",49)- --- ,("/g_deepFree",50)- ,("/clearSched",51)- --- ,("/sync",52)- --- ,("/d_free",53)- -- _channel- ,("/b_allocReadChannel",54)- ,("/b_readChannel",55)- -- _tree- ,("/g_dumpTree",56)- ,("/g_queryTree",57)- -- error- ,("/error",58)- -- _args- ,("/s_newargs",59)- --- ,("/n_mapa",60)- ,("/n_mapan",61)- ,("/n_order",62)- ]+ [ ("/notify", 1)+ , ("/status", 2)+ , ("/quit", 3)+ , ("/cmd", 4)+ , -- /d = synthdef+ ("/d_recv", 5)+ , ("/d_load", 6)+ , ("/d_loadDir", 7)+ , ("/d_freeAll", 8)+ , -- /s = synth+ ("/s_new", 9)+ , -- /n = node+ ("/n_trace", 10)+ , ("/n_free", 11)+ , ("/n_run", 12)+ , ("/n_cmd", 13)+ , ("/n_map", 14)+ , ("/n_set", 15)+ , ("/n_setn", 16)+ , ("/n_fill", 17)+ , ("/n_before", 18)+ , ("/n_after", 19)+ , -- /u = ugen+ ("/u_cmd", 20)+ , -- /g = group+ ("/g_new", 21)+ , ("/g_head", 22)+ , ("/g_tail", 23)+ , ("/g_freeAll", 24)+ , -- /c = control+ ("/c_set", 25)+ , ("/c_setn", 26)+ , ("/c_fill", 27)+ , -- /b = buffer+ ("/b_alloc", 28)+ , ("/b_allocRead", 29)+ , ("/b_read", 30)+ , ("/b_write", 31)+ , ("/b_free", 32)+ , ("/b_close", 33)+ , ("/b_zero", 34)+ , ("/b_set", 35)+ , ("/b_setn", 36)+ , ("/b_fill", 37)+ , ("/b_gen", 38)+ , --+ ("/dumpOSC", 39)+ , -- _get+ ("/c_get", 40)+ , ("/c_getn", 41)+ , ("/b_get", 42)+ , ("/b_getn", 43)+ , ("/s_get", 44)+ , ("/s_getn", 45)+ , -- _query+ ("/n_query", 46)+ , ("/b_query", 47)+ , --+ ("/n_mapn", 48)+ , ("/s_noid", 49)+ , --+ ("/g_deepFree", 50)+ , ("/clearSched", 51)+ , --+ ("/sync", 52)+ , --+ ("/d_free", 53)+ , -- _channel+ ("/b_allocReadChannel", 54)+ , ("/b_readChannel", 55)+ , -- _tree+ ("/g_dumpTree", 56)+ , ("/g_queryTree", 57)+ , -- error+ ("/error", 58)+ , -- _args+ ("/s_newargs", 59)+ , --+ ("/n_mapa", 60)+ , ("/n_mapan", 61)+ , ("/n_order", 62)+ ] --- | Lookup command number in 'sc3_cmd_enumeration'.------ > map sc3_cmd_number ["/b_alloc","/s_new"] == [Just 28,Just 9]+{- | Lookup command number in 'sc3_cmd_enumeration'.++>>> map sc3_cmd_number ["/b_alloc","/s_new"]+[Just 28,Just 9]+-} sc3_cmd_number :: SC3_Command -> Maybe Int sc3_cmd_number = flip lookup sc3_cmd_enumeration @@ -108,52 +110,56 @@ -- | List of asynchronous server commands, ie. commands that reply with @/done@. async_cmds :: [SC3_Command] async_cmds =- ["/b_alloc"- ,"/b_allocRead"- ,"/b_allocReadChannel"- ,"/b_close"- ,"/b_free"- ,"/b_read"- ,"/b_readChannel"- ,"/b_write"- ,"/b_zero"- ,"/d_load"- ,"/d_loadDir"- ,"/d_recv"- ,"/notify"- ,"/quit"- ,"/sync"]+ [ "/b_alloc"+ , "/b_allocRead"+ , "/b_allocReadChannel"+ , "/b_close"+ , "/b_free"+ , "/b_read"+ , "/b_readChannel"+ , "/b_write"+ , "/b_zero"+ , "/d_load"+ , "/d_loadDir"+ , "/d_recv"+ , "/notify"+ , "/quit"+ , "/sync"+ ] --- | 'True' if 'Message' is an asynchronous 'Message'.------ > import Sound.Sc3--- > map isAsync [b_close 0,n_set1 0 "0" 0,status] == [True,False,False]+{- | 'True' if 'Message' is an asynchronous 'Message'.++> import Sound.Sc3.Server.Command.Plain+> map isAsync [b_close 0,n_set1 0 "0" 0,status] == [True,False,False]+-} isAsync :: Osc.Message -> Bool isAsync (Osc.Message a _) = a `elem` async_cmds --- | Asynchronous commands are at the left. This function should--- preserve the ordering of both branches.------ > partition_async [b_close 0,n_set1 0 "0" 0]-partition_async :: [Osc.Message] -> ([Osc.Message],[Osc.Message])+{- | Asynchronous commands are at the left.+This function should preserve the ordering of both branches.++> partition_async [b_close 0,n_set1 0 "0" 0]+-}+partition_async :: [Osc.Message] -> ([Osc.Message], [Osc.Message]) partition_async = partition isAsync -- | Types & names for @b_info@ message fields.-b_info_fields :: [(String,String)]+b_info_fields :: [(String, String)] b_info_fields =- [("int","buffer-id")- ,("int","frame-count")- ,("int","channels-count")- ,("float","sample-rate")]+ [ ("int", "buffer-id")+ , ("int", "frame-count")+ , ("int", "channels-count")+ , ("float", "sample-rate")+ ] -- | Type, name and value descriptors for fields of @n_info@ message.-n_info_fields :: [(String,String,String)]+n_info_fields :: [(String, String, String)] n_info_fields =- [("int","node-id","")- ,("int","parent group-id","-1 = nil")- ,("int","previous node-id","-1 = nil")- ,("int","next node-id","-1 = nil")- ,("int","node-type","0 = synth,1 = group")- ,("int","head node-id","-1 = nil")- ,("int","tail node-id","-1 = nil")]-+ [ ("int", "node-id", "")+ , ("int", "parent group-id", "-1 = nil")+ , ("int", "previous node-id", "-1 = nil")+ , ("int", "next node-id", "-1 = nil")+ , ("int", "node-type", "0 = synth,1 = group")+ , ("int", "head node-id", "-1 = nil")+ , ("int", "tail node-id", "-1 = nil")+ ]
Sound/Sc3/Server/Command/Generic.hs view
@@ -7,7 +7,7 @@ import Sound.Osc.Core {- hosc -} import qualified Sound.Sc3.Common.Base as Common.Base-import qualified Sound.Sc3.Server.Command.Enum as Server.Command.Enum+import qualified Sound.Sc3.Server.Command.Completion as Server.Command.Completion import qualified Sound.Sc3.Server.Enum as Server.Enum import qualified Sound.Sc3.Server.Graphdef as Server.Graphdef import qualified Sound.Sc3.Server.Graphdef.Binary as Server.Graphdef@@ -18,40 +18,56 @@ -- * Buffer commands (b_) --- | BUF-NUM must be >= 0+-- | Buf-Num must be >= 0 b_bufnum :: Integral t => t -> Datum b_bufnum = int32 . cmd_check_arg "buffer-number < 0?" (>= 0) --- | BUF-FRAME-IX must be >= 0+-- | Buf-Frame-Ix must be >= 0 b_ix :: Integral t => t -> Datum b_ix = int32 . cmd_check_arg "buffer-ix < 0?" (>= 0) --- | BUF-CHANNEL must be >= 0+-- | Buf-Channel must be >= 0 b_ch :: Integral t => t -> Datum b_ch = int32 . cmd_check_arg "buffer-channel < 0?" (>= 0) --- | BUF-FRAME-CNT must be >= 0+-- | Buf-Frame-Cnt must be >= 0 b_size :: Integral t => t -> Datum b_size = int32 . cmd_check_arg "buffer-size < 0?" (>= 0) -- | Allocates zero filled buffer to number of channels and samples. (Asynchronous) b_alloc :: Integral i => i -> i -> i -> Message-b_alloc b frames channels = message "/b_alloc" [b_bufnum b,b_size frames,int32 channels]+b_alloc b frames channels = message "/b_alloc" [b_bufnum b, b_size frames, int32 channels] -- | Allocate buffer space and read a sound file. (Asynchronous) b_allocRead :: Integral i => i -> String -> i -> i -> Message-b_allocRead b p f n = message "/b_allocRead" [b_bufnum b,string p,b_ix f,b_ix n]+b_allocRead bufferNumber fileName startFrame frameCount =+ message+ "/b_allocRead"+ [ b_bufnum bufferNumber+ , string fileName+ , b_ix startFrame+ , b_ix frameCount+ ] -- | Allocate buffer space and read a sound file, picking specific channels. (Asynchronous) b_allocReadChannel :: Integral i => i -> String -> i -> i -> [i] -> Message-b_allocReadChannel b p f n cs = message "/b_allocReadChannel" ([b_bufnum b,string p,b_ix f,b_ix n] ++ map b_ch cs)+b_allocReadChannel bufferNumber fileName startFrame frameCount channels =+ message+ "/b_allocReadChannel"+ ( [ b_bufnum bufferNumber+ , string fileName+ , b_ix startFrame+ , b_ix frameCount+ ]+ ++ map b_ch channels+ ) -- | Close attached soundfile and write header information. (Asynchronous) b_close :: Integral i => i -> Message b_close b = message "/b_close" [b_bufnum b] -- | Fill ranges of sample values.-b_fill :: (Integral i,Real n) => i -> [(i,i,n)] -> Message+b_fill :: (Integral i, Real n) => i -> [(i, i, n)] -> Message b_fill b l = message "/b_fill" (b_bufnum b : Common.Base.mk_triples int32 int32 float l) -- | Free buffer data. (Asynchronous)@@ -63,33 +79,33 @@ b_gen b name arg = message "/b_gen" (b_bufnum b : string name : arg) -- | Call @sine1@ 'b_gen' command.-b_gen_sine1 :: (Integral i,Real n) => i -> [Server.Enum.B_Gen] -> [n] -> Message+b_gen_sine1 :: (Integral i, Real n) => i -> [Server.Enum.B_Gen] -> [n] -> Message b_gen_sine1 z f n = b_gen z "sine1" (int32 (Server.Enum.b_gen_flag f) : map float n) -- | Call @sine2@ 'b_gen' command.-b_gen_sine2 :: (Integral i,Real n) => i -> [Server.Enum.B_Gen] -> [(n,n)] -> Message+b_gen_sine2 :: (Integral i, Real n) => i -> [Server.Enum.B_Gen] -> [(n, n)] -> Message b_gen_sine2 z f n = b_gen z "sine2" (int32 (Server.Enum.b_gen_flag f) : Common.Base.mk_duples float float n) -- | Call @sine3@ 'b_gen' command.-b_gen_sine3 :: (Integral i,Real n) => i -> [Server.Enum.B_Gen] -> [(n,n,n)] -> Message+b_gen_sine3 :: (Integral i, Real n) => i -> [Server.Enum.B_Gen] -> [(n, n, n)] -> Message b_gen_sine3 z f n = b_gen z "sine3" (int32 (Server.Enum.b_gen_flag f) : Common.Base.mk_triples float float float n) -- | Call @cheby@ 'b_gen' command.-b_gen_cheby :: (Integral i,Real n) => i -> [Server.Enum.B_Gen] -> [n] -> Message+b_gen_cheby :: (Integral i, Real n) => i -> [Server.Enum.B_Gen] -> [n] -> Message b_gen_cheby z f n = b_gen z "cheby" (int32 (Server.Enum.b_gen_flag f) : map float n) -- | Call @copy@ 'b_gen' command. b_gen_copy :: Integral i => i -> i -> i -> i -> Maybe i -> Message b_gen_copy dst_b dst_ix src_b src_ix nf =- let nf' = fromMaybe (-1) nf- in b_gen dst_b "copy" (map int32 [dst_ix,src_b,src_ix,nf'])+ let nf' = fromMaybe (-1) nf+ in b_gen dst_b "copy" (map int32 [dst_ix, src_b, src_ix, nf']) -- | Get sample values. b_get :: Integral i => i -> [i] -> Message b_get b i = message "/b_get" (b_bufnum b : map int32 i) -- | Get ranges of sample values.-b_getn :: Integral i => i -> [(i,i)] -> Message+b_getn :: Integral i => i -> [(i, i)] -> Message b_getn b l = message "/b_getn" (b_bufnum b : Common.Base.mk_duples b_ix b_size l) -- | Request \/b_info messages.@@ -101,28 +117,28 @@ -} b_read :: Integral i => i -> String -> i -> i -> i -> Bool -> Message b_read bufId pathName startFrame numFrames bufFrame leaveOpen =- message "/b_read" [b_bufnum bufId,string pathName,int32 startFrame,int32 numFrames,int32 bufFrame,int32 (fromEnum leaveOpen)]+ message "/b_read" [b_bufnum bufId, string pathName, int32 startFrame, int32 numFrames, int32 bufFrame, int32 (fromEnum leaveOpen)] -- | Read sound file data into an existing buffer, picking specific channels. (Asynchronous) b_readChannel :: Integral i => i -> String -> i -> i -> i -> Bool -> [i] -> Message-b_readChannel b p f n f' z cs = message "/b_readChannel" ([b_bufnum b,string p,int32 f,int32 n,int32 f',int32 (fromEnum z)] ++ map int32 cs)+b_readChannel b p f n f' z cs = message "/b_readChannel" ([b_bufnum b, string p, int32 f, int32 n, int32 f', int32 (fromEnum z)] ++ map int32 cs) -- | Set sample values.-b_set :: (Integral i,Real n) => i -> [(i,n)] -> Message+b_set :: (Integral i, Real n) => i -> [(i, n)] -> Message b_set b l = message "/b_set" (b_bufnum b : Common.Base.mk_duples int32 float l) -- | Set ranges of sample values.-b_setn :: (Integral i,Real n) => i -> [(i,[n])] -> Message+b_setn :: (Integral i, Real n) => i -> [(i, [n])] -> Message b_setn b l =- let f (i,d) = int32 i : int32 (length d) : map float d- in message "/b_setn" (b_bufnum b : concatMap f l)+ let f (i, d) = int32 i : int32 (length d) : map float d+ in message "/b_setn" (b_bufnum b : concatMap f l) -- | Write sound file data. (Asynchronous) b_write :: Integral i => i -> String -> Server.Enum.SoundFileFormat -> Server.Enum.SampleFormat -> i -> i -> Bool -> Message b_write b p h t f s z =- let h' = string (Server.Enum.soundFileFormatString h)- t' = string (Server.Enum.sampleFormatString t)- in message "/b_write" [b_bufnum b,string p,h',t',int32 f,int32 s,int32 (fromEnum z)]+ let h' = string (Server.Enum.soundFileFormatString h)+ t' = string (Server.Enum.sampleFormatString t)+ in message "/b_write" [b_bufnum b, string p, h', t', int32 f, int32 s, int32 (fromEnum z)] -- | Zero sample data. (Asynchronous) b_zero :: Integral i => i -> Message@@ -131,7 +147,7 @@ -- * Control bus commands (c_) -- | Fill ranges of bus values.-c_fill :: (Integral i,Real n) => [(i,i,n)] -> Message+c_fill :: (Integral i, Real n) => [(i, i, n)] -> Message c_fill = message "/c_fill" . Common.Base.mk_triples int32 int32 float -- | Get bus values.@@ -139,18 +155,18 @@ c_get = message "/c_get" . map int32 -- | Get ranges of bus values.-c_getn :: Integral i => [(i,i)] -> Message+c_getn :: Integral i => [(i, i)] -> Message c_getn = message "/c_getn" . Common.Base.mk_duples int32 int32 -- | Set bus values.-c_set :: (Integral i,Real n) => [(i,n)] -> Message+c_set :: (Integral i, Real n) => [(i, n)] -> Message c_set = message "/c_set" . Common.Base.mk_duples int32 float -- | Set ranges of bus values.-c_setn :: (Integral i,Real n) => [(i,[n])] -> Message+c_setn :: (Integral i, Real n) => [(i, [n])] -> Message c_setn l =- let f (i,d) = int32 i : int32 (length d) : map float d- in message "/c_setn" (concatMap f l)+ let f (i, d) = int32 i : int32 (length d) : map float d+ in message "/c_setn" (concatMap f l) -- * Instrument definition commands (d_) @@ -189,85 +205,88 @@ g_freeAll = message "/g_freeAll" . map int32 -- | Add node to head of group.-g_head :: Integral i => [(i,i)] -> Message+g_head :: Integral i => [(i, i)] -> Message g_head = message "/g_head" . Common.Base.mk_duples int32 int32 -- | Create a new group.-g_new :: Integral i => [(i,Server.Enum.AddAction,i)] -> Message+g_new :: Integral i => [(i, Server.Enum.AddAction, i)] -> Message g_new = message "/g_new" . Common.Base.mk_triples int32 (int32 . fromEnum) int32 -- | Add node to tail of group.-g_tail :: Integral i => [(i,i)] -> Message+g_tail :: Integral i => [(i, i)] -> Message g_tail = message "/g_tail" . Common.Base.mk_duples int32 int32 -- | Post a representation of a group's node subtree, optionally including the current control values for synths.-g_dumpTree :: Integral i => [(i,Bool)] -> Message+g_dumpTree :: Integral i => [(i, Bool)] -> Message g_dumpTree = message "/g_dumpTree" . Common.Base.mk_duples int32 (int32 . fromEnum) --- | Request a representation of a group's node subtree, optionally including the current control values for synths.------ Replies to the sender with a @/g_queryTree.reply@ message listing all of the nodes contained within the group in the following format:------ > int32 - if synth control values are included 1, else 0--- > int32 - node ID of the requested group--- > int32 - number of child nodes contained within the requested group--- >--- > For each node in the subtree:--- > [--- > int32 - node ID--- > int32 - number of child nodes contained within this node. If -1 this is a synth, if >= 0 it's a group.--- >--- > If this node is a synth:--- > symbol - the SynthDef name for this node.--- >--- > If flag (see above) is true:--- > int32 - numControls for this synth (M)--- > [--- > symbol or int: control name or index--- > float or symbol: value or control bus mapping symbol (e.g. 'c1')--- > ] * M--- > ] * the number of nodes in the subtree------ N.Common.Base. The order of nodes corresponds to their execution order on the server. Thus child nodes (those contained within a group) are listed immediately following their parent.-g_queryTree :: Integral i => [(i,Bool)] -> Message+{- | Request a representation of a group's node subtree, optionally including the current control values for synths.++Replies to the sender with a @/g_queryTree.reply@ message listing all of the nodes contained within the group in the following format:++@+int32 - if synth control values are included 1, else 0+int32 - node ID of the requested group+int32 - number of child nodes contained within the requested group++For each node in the subtree:+[+ int32 - node ID+ int32 - number of child nodes contained within this node. If -1 this is a synth, if >= 0 it's a group.++ If this node is a synth:+ symbol - the SynthDef name for this node.++ If flag (see above) is true:+ int32 - numControls for this synth (M)+ [+ symbol or int: control name or index+ float or symbol: value or control bus mapping symbol (e.g. 'c1')+ ] * M+] * the number of nodes in the subtree+@+N.b. The order of nodes corresponds to their execution order on the server. Thus child nodes (those contained within a group) are listed immediately following their parent.+-}+g_queryTree :: Integral i => [(i, Bool)] -> Message g_queryTree = message "/g_queryTree" . Common.Base.mk_duples int32 (int32 . fromEnum) -- * Node commands (n_) --- | NODE-ID must be >= -1+-- | Node-Id must be >= -1 n_id :: Integral t => t -> Datum n_id = int32 . cmd_check_arg "node-id < -1?" (>= (-1)) -- | Place a node after another.-n_after :: Integral i => [(i,i)] -> Message+n_after :: Integral i => [(i, i)] -> Message n_after = message "/n_after" . Common.Base.mk_duples n_id n_id -- | Place a node before another.-n_before :: Integral i => [(i,i)] -> Message+n_before :: Integral i => [(i, i)] -> Message n_before = message "/n_before" . Common.Base.mk_duples int32 int32 -- | Fill ranges of a node's control values.-n_fill :: (Integral i,Real f) => i -> [(String,i,f)] -> Message+n_fill :: (Integral i, Real f) => i -> [(String, i, f)] -> Message n_fill n l = message "/n_fill" (n_id n : Common.Base.mk_triples string int32 float l) -- | Delete a node. n_free :: Integral i => [i] -> Message n_free = message "/n_free" . map n_id -n_map :: Integral i => i -> [(String,i)] -> Message+n_map :: Integral i => i -> [(String, i)] -> Message n_map n l = message "/n_map" (n_id n : Common.Base.mk_duples string int32 l) --- | Map a node's controls to read from buses.--- n_mapn only works if the control is given as an index and not as a name (3.8.0).-n_mapn :: Integral i => i -> [(i,i,i)] -> Message+{- | Map a node's controls to read from buses.+ n_mapn only works if the control is given as an index and not as a name (3.8.0).+-}+n_mapn :: Integral i => i -> [(i, i, i)] -> Message n_mapn n l = message "/n_mapn" (n_id n : Common.Base.mk_triples int32 int32 int32 l) -- | Map a node's controls to read from an audio bus.-n_mapa :: Integral i => i -> [(String,i)] -> Message+n_mapa :: Integral i => i -> [(String, i)] -> Message n_mapa n l = message "/n_mapa" (n_id n : Common.Base.mk_duples string int32 l) -- | Map a node's controls to read from audio buses.-n_mapan :: Integral i => i -> [(String,i,i)] -> Message+n_mapan :: Integral i => i -> [(String, i, i)] -> Message n_mapan n l = message "/n_mapan" (n_id n : Common.Base.mk_triples string int32 int32 l) -- | Get info about a node.@@ -275,19 +294,20 @@ n_query = message "/n_query" . map n_id -- | Turn node on or off.-n_run :: Integral i => [(i,Bool)] -> Message+n_run :: Integral i => [(i, Bool)] -> Message n_run = message "/n_run" . Common.Base.mk_duples n_id (int32 . fromEnum) -- | Set a node's control values.-n_set :: (Integral i,Real n) => i -> [(String,n)] -> Message+n_set :: (Integral i, Real n) => i -> [(String, n)] -> Message n_set n c = message "/n_set" (n_id n : Common.Base.mk_duples string float c) --- | Set ranges of a node's control values.--- n_mapn and n_setn only work if the control is given as an index and not as a name.-n_setn :: (Integral i,Real n) => i -> [(i,[n])] -> Message+{- | Set ranges of a node's control values.+n_mapn and n_setn only work if the control is given as an index and not as a name.+-}+n_setn :: (Integral i, Real n) => i -> [(i, [n])] -> Message n_setn n l =- let f (s,d) = int32 s : int32 (length d) : map float d- in message "/n_setn" (n_id n : concatMap f l)+ let f (s, d) = int32 s : int32 (length d) : map float d+ in message "/n_setn" (n_id n : concatMap f l) -- | Trace a node. n_trace :: Integral i => [i] -> Message@@ -300,7 +320,7 @@ -- * Par commands (p_) -- | Create a new parallel group (supernova specific).-p_new :: Integral i => [(i,Server.Enum.AddAction,i)] -> Message+p_new :: Integral i => [(i, Server.Enum.AddAction, i)] -> Message p_new = message "/p_new" . Common.Base.mk_triples int32 (int32 . fromEnum) int32 -- * Synthesis node commands (s_)@@ -310,12 +330,20 @@ s_get n i = message "/s_get" (n_id n : map string i) -- | Get ranges of control values.-s_getn :: Integral i => i -> [(String,i)] -> Message+s_getn :: Integral i => i -> [(String, i)] -> Message s_getn n l = message "/s_getn" (n_id n : Common.Base.mk_duples string int32 l) -- | Create a new synth.-s_new :: (Integral i,Real n) => String -> i -> Server.Enum.AddAction -> i -> [(String,n)] -> Message-s_new n i a t c = message "/s_new" (string n : int32 i : int32 (fromEnum a) : int32 t : Common.Base.mk_duples string float c)+s_new :: (Integral i, Real n) => String -> i -> Server.Enum.AddAction -> i -> [(String, n)] -> Message+s_new synthdefName nodeId addAction targetId controlValues =+ message+ "/s_new"+ ( string synthdefName+ : int32 nodeId+ : int32 (fromEnum addAction)+ : int32 targetId+ : Common.Base.mk_duples string float controlValues+ ) -- | Auto-reassign synth's ID to a reserved value. s_noid :: Integral i => [i] -> Message@@ -325,7 +353,7 @@ -- | Send a command to a unit generator. u_cmd :: Integral i => i -> i -> String -> [Datum] -> Message-u_cmd n uid name arg = message "/u_cmd" ([n_id n,int32 uid,string name] ++ arg)+u_cmd n uid name arg = message "/u_cmd" ([n_id n, int32 uid, string name] ++ arg) -- * Server operation commands @@ -344,10 +372,10 @@ -- | Set error posting scope and mode. errorMode :: Server.Enum.ErrorScope -> Server.Enum.ErrorMode -> Message errorMode scope mode =- let e = case scope of- Server.Enum.Globally -> fromEnum mode- Server.Enum.Locally -> -1 - fromEnum mode- in message "/error" [int32 e]+ let e = case scope of+ Server.Enum.Globally -> fromEnum mode+ Server.Enum.Locally -> -1 - fromEnum mode+ in message "/error" [int32 e] -- | Select reception of notification messages. (Asynchronous) notify :: Bool -> Message@@ -369,35 +397,17 @@ sync :: Integral i => i -> Message sync sid = message "/sync" [int32 sid] --- * Modify existing message to include completion message---- | Add a completion packet to an existing asynchronous command.-with_completion_packet :: Message -> Packet -> Message-with_completion_packet (Message c xs) cm =- if c `elem` Server.Command.Enum.async_cmds- then let xs' = xs ++ [Blob (encodePacket cm)]- in Message c xs'- else error ("with_completion_packet: not async: " ++ c)---- | Add a completion message to an existing asynchronous command.------ > let m = n_set1 0 "0" 0--- > let e = encodeMessage m--- > withCM (b_close 0) m == Message "/b_close" [Int32 0,Blob e]-withCM :: Message -> Message -> Message-withCM m cm = with_completion_packet m (Packet_Message cm)- -- * Variants to simplify common cases -- | Pre-allocate for b_setn1, values preceding offset are zeroed.-b_alloc_setn1 :: (Integral i,Real n) => i -> i -> [n] -> Message+b_alloc_setn1 :: (Integral i, Real n) => i -> i -> [n] -> Message b_alloc_setn1 b i xs =- let k = i + genericLength xs- xs' = genericReplicate i 0 ++ xs- in withCM (b_alloc b k 1) (b_setn1 b 0 xs')+ let k = i + genericLength xs+ xs' = genericReplicate i 0 ++ xs+ in Server.Command.Completion.withCm (b_alloc b k 1) (b_setn1 b 0 xs') -- | Get ranges of sample values.-b_getn1 :: Integral i => i -> (i,i) -> Message+b_getn1 :: Integral i => i -> (i, i) -> Message b_getn1 b = b_getn b . return -- | Variant on 'b_query'.@@ -405,66 +415,73 @@ b_query1 = b_query . return -- | Set single sample value.-b_set1 :: (Integral i,Real n) => i -> i -> n -> Message-b_set1 b i x = b_set b [(i,x)]+b_set1 :: (Integral i, Real n) => i -> i -> n -> Message+b_set1 b i x = b_set b [(i, x)] -- | Set a range of sample values.-b_setn1 :: (Integral i,Real n) => i -> i -> [n] -> Message-b_setn1 b i xs = b_setn b [(i,xs)]+b_setn1 :: (Integral i, Real n) => i -> i -> [n] -> Message+b_setn1 b i xs = b_setn b [(i, xs)] -- | Segmented variant of 'b_setn1'.-b_setn1_segmented :: (Integral i,Real n) => i -> i -> i -> [n] -> [Message]+b_setn1_segmented :: (Integral i, Real n) => i -> i -> i -> [n] -> [Message] b_setn1_segmented k b i d =- if genericLength d < k+ if genericLength d < k then [b_setn1 b i d] else b_setn1 b i (genericTake k d) : b_setn1_segmented k b (i + k) (genericDrop k d) -- | Get ranges of sample values.-c_getn1 :: Integral i => (i,i) -> Message+c_getn1 :: Integral i => (i, i) -> Message c_getn1 = c_getn . return -- | Set single bus values.-c_set1 :: (Integral i,Real n) => i -> n -> Message-c_set1 i x = c_set [(i,x)]+c_set1 :: (Integral i, Real n) => i -> n -> Message+c_set1 i x = c_set [(i, x)] -- | Set single range of bus values.-c_setn1 :: (Integral i,Real n) => (i,[n]) -> Message+c_setn1 :: (Integral i, Real n) => (i, [n]) -> Message c_setn1 = c_setn . return -- | Turn a single node on or off. n_run1 :: Integral i => i -> Bool -> Message-n_run1 n k = n_run [(n,k)]+n_run1 n k = n_run [(n, k)] -- | Set a single node control value.-n_set1 :: (Integral i,Real n) => i -> String -> n -> Message-n_set1 n k v = n_set n [(k,v)]+n_set1 :: (Integral i, Real n) => i -> String -> n -> Message+n_set1 n k v = n_set n [(k, v)] -- | @s_new@ with no parameters. s_new0 :: Integral i => String -> i -> Server.Enum.AddAction -> i -> Message-s_new0 n i a t = s_new n i a t ([]::[(String,Double)])+s_new0 n i a t = s_new n i a t ([] :: [(String, Double)]) -- * Buffer segmentation and indices --- | Segment a request for /m/ places into sets of at most /n/.------ > b_segment 1024 2056 == [8,1024,1024]--- > b_segment 1 5 == replicate 5 1+{- | Segment a request for /m/ places into sets of at most /n/.++>>> b_segment 1024 2056+[8,1024,1024]++>>> b_segment 1 5 == replicate 5 1+True+-} b_segment :: Integral i => i -> i -> [i] b_segment n m =- let (q,r) = m `quotRem` n- s = genericReplicate q n- in if r == 0 then s else r : s+ let (q, r) = m `quotRem` n+ s = genericReplicate q n+ in if r == 0 then s else r : s --- | Variant of 'b_segment' that takes a starting index and returns--- /(index,size)/ duples.------ > b_indices 1 5 0 == zip [0..4] (replicate 5 1)--- > b_indices 1024 2056 16 == [(16,8),(24,1024),(1048,1024)]-b_indices :: Integral i => i -> i -> i -> [(i,i)]+{- | Variant of 'b_segment' that takes a starting index and returns /(index,size)/ duples.++>>> b_indices 1 5 0 == zip [0..4] (replicate 5 1)+True++>>> b_indices 1024 2056 16+[(16,8),(24,1024),(1048,1024)]+-}+b_indices :: Integral i => i -> i -> i -> [(i, i)] b_indices n m k =- let s = b_segment n m- i = 0 : Common.Base.dx_d s- in zip (map (+ k) i) s+ let s = b_segment n m+ i = 0 : Common.Base.dx_d s+ in zip (map (+ k) i) s -- * Ugen commands. @@ -477,65 +494,65 @@ -- | Result is null for non-conforming data, or has five or seven elements. unpack_n_info_datum_plain :: Num i => [Datum] -> [i] unpack_n_info_datum_plain m =- let to_i = fromIntegral- in case m of- [Int32 i1,Int32 i2,Int32 i3,Int32 i4,Int32 i5] -> [to_i i1,to_i i2,to_i i3,to_i i4,to_i i5]- [Int32 i1,Int32 i2,Int32 i3,Int32 i4,Int32 i5,Int32 i6,Int32 i7] -> [to_i i1,to_i i2,to_i i3,to_i i4,to_i i5,to_i i6,to_i i7]- _ -> []+ let to_i = fromIntegral+ in case m of+ [Int32 i1, Int32 i2, Int32 i3, Int32 i4, Int32 i5] -> [to_i i1, to_i i2, to_i i3, to_i i4, to_i i5]+ [Int32 i1, Int32 i2, Int32 i3, Int32 i4, Int32 i5, Int32 i6, Int32 i7] -> [to_i i1, to_i i2, to_i i3, to_i i4, to_i i5, to_i i6, to_i i7]+ _ -> [] unpack_n_info_plain :: Num i => Message -> [i] unpack_n_info_plain m =- case m of- Message "/n_info" dat -> unpack_n_info_datum_plain dat- _ -> []+ case m of+ Message "/n_info" dat -> unpack_n_info_datum_plain dat+ _ -> [] -- | Unpack @n_info@ message.-unpack_n_info :: Num i => Message -> Maybe (i,i,i,i,i,Maybe (i,i))+unpack_n_info :: Num i => Message -> Maybe (i, i, i, i, i, Maybe (i, i)) unpack_n_info m =- case unpack_n_info_plain m of- [i1,i2,i3,i4,i5] -> Just (i1,i2,i3,i4,i5,Nothing)- [i1,i2,i3,i4,i5,i6,i7] -> Just (i1,i2,i3,i4,i5,Just (i6,i7))- _ -> Nothing+ case unpack_n_info_plain m of+ [i1, i2, i3, i4, i5] -> Just (i1, i2, i3, i4, i5, Nothing)+ [i1, i2, i3, i4, i5, i6, i7] -> Just (i1, i2, i3, i4, i5, Just (i6, i7))+ _ -> Nothing -unpack_n_info_err :: Num i => Message -> (i,i,i,i,i,Maybe (i,i))+unpack_n_info_err :: Num i => Message -> (i, i, i, i, i, Maybe (i, i)) unpack_n_info_err = fromMaybe (error "unpack_n_info") . unpack_n_info -- | Unpack the '/tr' messages sent by 'sendTrig'.-unpack_tr :: (Num i,Fractional f) => Message -> Maybe (i,i,f)+unpack_tr :: (Num i, Fractional f) => Message -> Maybe (i, i, f) unpack_tr m =- let to_i = fromIntegral- to_f = realToFrac- in case m of- Message "/tr" [Int32 p,Int32 q,Float r] -> Just (to_i p,to_i q,to_f r)- _ -> Nothing+ let to_i = fromIntegral+ to_f = realToFrac+ in case m of+ Message "/tr" [Int32 p, Int32 q, Float r] -> Just (to_i p, to_i q, to_f r)+ _ -> Nothing -unpack_tr_err :: (Num i,Fractional f) => Message -> (i,i,f)+unpack_tr_err :: (Num i, Fractional f) => Message -> (i, i, f) unpack_tr_err = fromMaybe (error "unpack_tr") . unpack_tr -unpack_b_setn :: (Num i,Fractional f) => Message -> Maybe (i,i,i,[f])+unpack_b_setn :: (Num i, Fractional f) => Message -> Maybe (i, i, i, [f]) unpack_b_setn m =- let to_i = fromIntegral- to_f d = case d of- Float n -> realToFrac n- _ -> error "unpack_b_setn: non-float data"- in case m of- Message "/b_setn" (Int32 p:Int32 q:Int32 r:z) -> Just (to_i p,to_i q,to_i r,map to_f z)- _ -> Nothing+ let to_i = fromIntegral+ to_f d = case d of+ Float n -> realToFrac n+ _ -> error "unpack_b_setn: non-float data"+ in case m of+ Message "/b_setn" (Int32 p : Int32 q : Int32 r : z) -> Just (to_i p, to_i q, to_i r, map to_f z)+ _ -> Nothing -unpack_b_setn_err :: (Num i,Fractional f) => Message -> (i,i,i,[f])+unpack_b_setn_err :: (Num i, Fractional f) => Message -> (i, i, i, [f]) unpack_b_setn_err = fromMaybe (error "unpack_b_setn") . unpack_b_setn -- | Unpack b_info message, fields are (id,frames,channels,sample-rate).-unpack_b_info :: (Num i,Fractional f) => Message -> Maybe (i,i,i,f)+unpack_b_info :: (Num i, Fractional f) => Message -> Maybe (i, i, i, f) unpack_b_info m =- let to_i = fromIntegral- to_f = realToFrac- in case m of- Message "/b_info" [Int32 p,Int32 q,Int32 r,Float s] -> Just (to_i p,to_i q,to_i r,to_f s)- _ -> Nothing+ let to_i = fromIntegral+ to_f = realToFrac+ in case m of+ Message "/b_info" [Int32 p, Int32 q, Int32 r, Float s] -> Just (to_i p, to_i q, to_i r, to_f s)+ _ -> Nothing -- | Variant generating 'error'.-unpack_b_info_err :: (Num i,Fractional f) => Message -> (i,i,i,f)+unpack_b_info_err :: (Num i, Fractional f) => Message -> (i, i, i, f) unpack_b_info_err = fromMaybe (error "unpack_b_info") . unpack_b_info -- Local Variables:
Sound/Sc3/Server/Command/Plain.hs view
@@ -1,8 +1,8 @@ -- | Functions from "Sound.Sc3.Server.Command.Generic" specialised to 'Int' and 'Double'. module Sound.Sc3.Server.Command.Plain where -import Sound.Osc.Datum (Blob,Datum) {- hosc3 -}-import Sound.Osc.Packet (Message) {- hosc -}+import Sound.Osc.Datum (Blob, Datum {- hosc3 -})+import Sound.Osc.Packet (Message {- hosc -}) import qualified Sound.Sc3.Server.Command.Generic as G import qualified Sound.Sc3.Server.Enum as E@@ -51,7 +51,7 @@ b_close = G.b_close -- | Fill ranges of sample values.-b_fill :: Buffer_Id -> [(Buffer_Ix,Int,Double)] -> Message+b_fill :: Buffer_Id -> [(Buffer_Ix, Int, Double)] -> Message b_fill = G.b_fill -- | Free buffer data. (Asynchronous)@@ -67,7 +67,7 @@ b_get = G.b_get -- | Get ranges of sample values.-b_getn :: Buffer_Id -> [(Buffer_Ix,Int)] -> Message+b_getn :: Buffer_Id -> [(Buffer_Ix, Int)] -> Message b_getn = G.b_getn -- | Request \/b_info messages.@@ -83,11 +83,11 @@ b_readChannel = G.b_readChannel -- | Set sample values.-b_set :: Buffer_Id -> [(Buffer_Ix,Double)] -> Message+b_set :: Buffer_Id -> [(Buffer_Ix, Double)] -> Message b_set = G.b_set -- | Set ranges of sample values.-b_setn :: Buffer_Id -> [(Buffer_Ix,[Double])] -> Message+b_setn :: Buffer_Id -> [(Buffer_Ix, [Double])] -> Message b_setn = G.b_setn -- | Write sound file data. (Asynchronous)@@ -101,7 +101,7 @@ -- * Control bus commands -- | Fill ranges of bus values.-c_fill :: [(Bus_Id,Int,Double)] -> Message+c_fill :: [(Bus_Id, Int, Double)] -> Message c_fill = G.c_fill -- | Get bus values.@@ -109,15 +109,15 @@ c_get = G.c_get -- | Get ranges of bus values.-c_getn :: [(Bus_Id,Int)] -> Message+c_getn :: [(Bus_Id, Int)] -> Message c_getn = G.c_getn -- | Set bus values.-c_set :: [(Bus_Id,Double)] -> Message+c_set :: [(Bus_Id, Double)] -> Message c_set = G.c_set -- | Set ranges of bus values.-c_setn :: [(Bus_Id,[Double])] -> Message+c_setn :: [(Bus_Id, [Double])] -> Message c_setn = G.c_setn -- * Instrument definition commands (d_)@@ -157,57 +157,58 @@ g_freeAll = G.g_freeAll -- | Add node to head of group.-g_head :: [(Group_Id,Node_Id)] -> Message+g_head :: [(Group_Id, Node_Id)] -> Message g_head = G.g_head -- | Create a new group.-g_new :: [(Group_Id,E.AddAction,Node_Id)] -> Message+g_new :: [(Group_Id, E.AddAction, Node_Id)] -> Message g_new = G.g_new -- | Add node to tail of group.-g_tail :: [(Group_Id,Node_Id)] -> Message+g_tail :: [(Group_Id, Node_Id)] -> Message g_tail = G.g_tail -- | Post a representation of a group's node subtree, optionally including the current control values for synths.-g_dumpTree :: [(Group_Id,Bool)] -> Message+g_dumpTree :: [(Group_Id, Bool)] -> Message g_dumpTree = G.g_dumpTree -- | Request a representation of a group's node subtree, optionally including the current control values for synths.-g_queryTree :: [(Group_Id,Bool)] -> Message+g_queryTree :: [(Group_Id, Bool)] -> Message g_queryTree = G.g_queryTree -- * Node commands (n_) -- | Place a node after another.-n_after :: [(Node_Id,Node_Id)] -> Message+n_after :: [(Node_Id, Node_Id)] -> Message n_after = G.n_after -- | Place a node before another.-n_before :: [(Node_Id,Node_Id)] -> Message+n_before :: [(Node_Id, Node_Id)] -> Message n_before = G.n_before -- | Fill ranges of a node's control values.-n_fill :: Node_Id -> [(String,Int,Double)] -> Message+n_fill :: Node_Id -> [(String, Int, Double)] -> Message n_fill = G.n_fill -- | Delete a node. n_free :: [Node_Id] -> Message n_free = G.n_free -n_map :: Node_Id -> [(String,Bus_Id)] -> Message+n_map :: Node_Id -> [(String, Bus_Id)] -> Message n_map = G.n_map --- | Map a node's controls to read from buses.--- n_mapn only works if the control is given as an index and not as a name (3.8.0).-n_mapn :: Node_Id -> [(Int,Bus_Id,Int)] -> Message+{- | Map a node's controls to read from buses.+ n_mapn only works if the control is given as an index and not as a name (3.8.0).+-}+n_mapn :: Node_Id -> [(Int, Bus_Id, Int)] -> Message n_mapn = G.n_mapn -- | Map a node's controls to read from an audio bus.-n_mapa :: Node_Id -> [(String,Bus_Id)] -> Message+n_mapa :: Node_Id -> [(String, Bus_Id)] -> Message n_mapa = G.n_mapa -- | Map a node's controls to read from audio buses.-n_mapan :: Node_Id -> [(String,Bus_Id,Int)] -> Message+n_mapan :: Node_Id -> [(String, Bus_Id, Int)] -> Message n_mapan = G.n_mapan -- | Get info about a node.@@ -215,15 +216,15 @@ n_query = G.n_query -- | Turn node on or off.-n_run :: [(Node_Id,Bool)] -> Message+n_run :: [(Node_Id, Bool)] -> Message n_run = G.n_run -- | Set a node's control values.-n_set :: Node_Id -> [(String,Double)] -> Message+n_set :: Node_Id -> [(String, Double)] -> Message n_set = G.n_set -- | Set ranges of a node's control values.-n_setn :: Node_Id -> [(Int,[Double])] -> Message+n_setn :: Node_Id -> [(Int, [Double])] -> Message n_setn = G.n_setn -- | Trace a node.@@ -237,7 +238,7 @@ -- * Par commands (p_) -- | Create a new parallel group (supernova specific).-p_new :: [(Group_Id,E.AddAction,Node_Id)] -> Message+p_new :: [(Group_Id, E.AddAction, Node_Id)] -> Message p_new = G.p_new -- * Synthesis node commands (s_)@@ -247,11 +248,11 @@ s_get = G.s_get -- | Get ranges of control values.-s_getn :: Synth_Id -> [(String,Int)] -> Message+s_getn :: Synth_Id -> [(String, Int)] -> Message s_getn = G.s_getn -- | Create a new synth.-s_new :: String -> Synth_Id -> E.AddAction -> Node_Id -> [(String,Double)] -> Message+s_new :: String -> Synth_Id -> E.AddAction -> Node_Id -> [(String, Double)] -> Message s_new = G.s_new -- | Auto-reassign synth's ID to a reserved value.@@ -305,7 +306,7 @@ -- * Variants to simplify common cases -- | Get ranges of sample values.-b_getn1 :: Buffer_Id -> (Buffer_Ix,Int) -> Message+b_getn1 :: Buffer_Id -> (Buffer_Ix, Int) -> Message b_getn1 = G.b_getn1 -- | Variant on 'b_query'.@@ -313,7 +314,7 @@ b_query1 = b_query . return -- | Get ranges of sample values.-c_getn1 :: (Bus_Id,Int) -> Message+c_getn1 :: (Bus_Id, Int) -> Message c_getn1 = G.c_getn1 -- | Set single bus values.@@ -321,7 +322,7 @@ c_set1 = G.c_set1 -- | Set single range of bus values.-c_setn1 :: (Bus_Id,[Double]) -> Message+c_setn1 :: (Bus_Id, [Double]) -> Message c_setn1 = G.c_setn1 -- | Turn a single node on or off.@@ -338,18 +339,26 @@ -- * Buffer segmentation and indices --- | Segment a request for /m/ places into sets of at most /n/.------ > b_segment 1024 2056 == [8,1024,1024]--- > b_segment 1 5 == replicate 5 1+{- | Segment a request for /m/ places into sets of at most /n/.++>>> b_segment 1024 2056+[8,1024,1024]++>>> b_segment 1 5 == replicate 5 1+True+-} b_segment :: Int -> Int -> [Int] b_segment = G.b_segment --- | Variant of 'b_segment' that takes a starting index and returns /(index,size)/ duples.------ > b_indices 1 5 0 == zip [0..4] (replicate 5 1)--- > b_indices 1024 2056 16 == [(16,8),(24,1024),(1048,1024)]-b_indices :: Int -> Int -> Int -> [(Int,Int)]+{- | Variant of 'b_segment' that takes a starting index and returns /(index,size)/ duples.++>>> b_indices 1 5 0 == zip [0..4] (replicate 5 1)+True++>>> b_indices 1024 2056 16+[(16,8),(24,1024),(1048,1024)]+-}+b_indices :: Int -> Int -> Int -> [(Int, Int)] b_indices = G.b_indices -- | Call @copy@ 'b_gen' command.@@ -361,11 +370,11 @@ b_gen_sine1 = G.b_gen_sine1 -- | Call @sine2@ 'b_gen' command.-b_gen_sine2 :: Buffer_Id -> [E.B_Gen] -> [(Double,Double)] -> Message+b_gen_sine2 :: Buffer_Id -> [E.B_Gen] -> [(Double, Double)] -> Message b_gen_sine2 = G.b_gen_sine2 -- | Call @sine3@ 'b_gen' command.-b_gen_sine3 :: Buffer_Id -> [E.B_Gen] -> [(Double,Double,Double)] -> Message+b_gen_sine3 :: Buffer_Id -> [E.B_Gen] -> [(Double, Double, Double)] -> Message b_gen_sine3 = G.b_gen_sine3 -- | Call @cheby@ 'b_gen' command.@@ -399,28 +408,28 @@ unpack_n_info_plain :: Message -> [Int] unpack_n_info_plain = G.unpack_n_info_plain -unpack_n_info :: Message -> Maybe (Int,Int,Int,Int,Int,Maybe (Int,Int))+unpack_n_info :: Message -> Maybe (Int, Int, Int, Int, Int, Maybe (Int, Int)) unpack_n_info = G.unpack_n_info -unpack_n_info_err :: Message -> (Int,Int,Int,Int,Int,Maybe (Int,Int))+unpack_n_info_err :: Message -> (Int, Int, Int, Int, Int, Maybe (Int, Int)) unpack_n_info_err = G.unpack_n_info_err -unpack_tr :: Message -> Maybe (Int,Int,Double)+unpack_tr :: Message -> Maybe (Int, Int, Double) unpack_tr = G.unpack_tr -unpack_tr_err :: Message -> (Int,Int,Double)+unpack_tr_err :: Message -> (Int, Int, Double) unpack_tr_err = G.unpack_tr_err -unpack_b_setn :: Message -> Maybe (Int,Int,Int,[Double])+unpack_b_setn :: Message -> Maybe (Int, Int, Int, [Double]) unpack_b_setn = G.unpack_b_setn -unpack_b_setn_err :: Message -> (Int,Int,Int,[Double])+unpack_b_setn_err :: Message -> (Int, Int, Int, [Double]) unpack_b_setn_err = G.unpack_b_setn_err -unpack_b_info :: Message -> Maybe (Int,Int,Int,Double)+unpack_b_info :: Message -> Maybe (Int, Int, Int, Double) unpack_b_info = G.unpack_b_info -unpack_b_info_err :: Message -> (Int,Int,Int,Double)+unpack_b_info_err :: Message -> (Int, Int, Int, Double) unpack_b_info_err = G.unpack_b_info_err -- Local Variables:
+ Sound/Sc3/Server/Command/Plain/Completion.hs view
@@ -0,0 +1,69 @@+{- | This module provides variations of the asynchronous server commands that+expect a /completion packet/ as the first argument. The completion packet+is executed by the server when the asynchronous command has finished. Note+that this mechanism is for synchronizing server side processes only, for+client side synchronization use @\/done@ message notification or the+@\/sync@ barrier.+-}+module Sound.Sc3.Server.Command.Plain.Completion where++import Sound.Osc.Core {- hosc -}++import Sound.Sc3.Server.Enum+import Sound.Sc3.Server.Synthdef++-- | Encode an Osc packet as an Osc blob.+encode_blob :: PacketOf Message -> Datum+encode_blob = Blob . encodePacket++-- | Install a bytecode instrument definition. (Asynchronous)+d_recv :: PacketOf Message -> Synthdef -> Message+d_recv pkt d = Message "/d_recv" [Blob (synthdefData d), encode_blob pkt]++-- | Load an instrument definition from a named file. (Asynchronous)+d_load :: PacketOf Message -> String -> Message+d_load pkt p = Message "/d_load" [string p, encode_blob pkt]++-- | Load a directory of instrument definitions files. (Asynchronous)+d_loadDir :: PacketOf Message -> String -> Message+d_loadDir pkt p = Message "/d_loadDir" [string p, encode_blob pkt]++-- | Allocates zero filled buffer to number of channels and samples. (Asynchronous)+b_alloc :: PacketOf Message -> Int -> Int -> Int -> Message+b_alloc pkt nid frames channels = Message "/b_alloc" [int32 nid, int32 frames, int32 channels, encode_blob pkt]++-- | Allocate buffer space and read a sound file. (Asynchronous)+b_allocRead :: PacketOf Message -> Int -> String -> Int -> Int -> Message+b_allocRead pkt nid p f n = Message "/b_allocRead" [int32 nid, string p, int32 f, int32 n, encode_blob pkt]++-- | Allocate buffer space and read a sound file, picking specific channels. (Asynchronous)+b_allocReadChannel :: PacketOf Message -> Int -> String -> Int -> Int -> [Int] -> Message+b_allocReadChannel pkt nid p f n cs = Message "/b_allocReadChannel" ([int32 nid, string p, int32 f, int32 n] ++ map int32 cs ++ [encode_blob pkt])++-- | Free buffer data. (Asynchronous)+b_free :: PacketOf Message -> Int -> Message+b_free pkt nid = Message "/b_free" [int32 nid, encode_blob pkt]++-- | Close attached soundfile and write header information. (Asynchronous)+b_close :: PacketOf Message -> Int -> Message+b_close pkt nid = Message "/b_close" [int32 nid, encode_blob pkt]++-- | Read sound file data into an existing buffer. (Asynchronous)+b_read :: PacketOf Message -> Int -> String -> Int -> Int -> Int -> Bool -> Message+b_read pkt nid p f n f' z = Message "/b_read" [int32 nid, string p, int32 f, int32 n, int32 f', int32 (fromEnum z), encode_blob pkt]++-- | Read sound file data into an existing buffer. (Asynchronous)+b_readChannel :: PacketOf Message -> Int -> String -> Int -> Int -> Int -> Bool -> [Int] -> Message+b_readChannel pkt nid p f n f' z cs = Message "/b_readChannel" ([int32 nid, string p, int32 f, int32 n, int32 f', int32 (fromEnum z)] ++ map int32 cs ++ [encode_blob pkt])++-- | Write sound file data. (Asynchronous)+b_write :: PacketOf Message -> Int -> String -> SoundFileFormat -> SampleFormat -> Int -> Int -> Bool -> Message+b_write pkt nid p h t f s z = Message "/b_write" [int32 nid, string p, string (soundFileFormatString h), string (sampleFormatString t), int32 f, int32 s, int32 (fromEnum z), encode_blob pkt]++-- | Zero sample data. (Asynchronous)+b_zero :: PacketOf Message -> Int -> Message+b_zero pkt nid = Message "/b_zero" [int32 nid, encode_blob pkt]++-- Local Variables:+-- truncate-lines:t+-- End:
Sound/Sc3/Server/Enum.hs view
@@ -5,102 +5,117 @@ {- | Enumeration of possible locations to add new nodes (s_new and g_new). -> fromEnum AddToTail == 1+>>> fromEnum AddToTail+1 -}-data AddAction = AddToHead- | AddToTail- | AddBefore- | AddAfter- | AddReplace- deriving (Eq,Show,Enum)+data AddAction+ = AddToHead+ | AddToTail+ | AddBefore+ | AddAfter+ | AddReplace+ deriving (Eq, Show, Enum) -- | Enumeration of flags for '/b_gen' command. data B_Gen = Normalise | Wavetable | Clear- deriving (Eq,Enum,Bounded,Show)+ deriving (Eq, Enum, Bounded, Show) {- | 'B_Gen' to bit number. -> map b_gen_bit [minBound .. maxBound] == [0, 1, 2]+>>> map b_gen_bit [minBound .. maxBound]+[0,1,2] -} b_gen_bit :: B_Gen -> Int b_gen_bit = fromEnum {- | Set of 'B_Gen' to flag. -> b_gen_flag [minBound .. maxBound] == 7+>>> b_gen_flag [minBound .. maxBound]+7 -} b_gen_flag :: [B_Gen] -> Int b_gen_flag = sum . map ((2 ^) . b_gen_bit) -- | Error posting scope.-data ErrorScope =- Globally -- ^ Global scope- | Locally -- ^ Bundle scope- deriving (Eq,Show,Enum)+data ErrorScope+ = -- | Global scope+ Globally+ | -- | Bundle scope+ Locally+ deriving (Eq, Show, Enum) -- | Error posting mode.-data ErrorMode =- ErrorsOff -- ^ Turn error posting off- | ErrorsOn -- ^ Turn error posting on- deriving (Eq,Show,Enum)+data ErrorMode+ = -- | Turn error posting off+ ErrorsOff+ | -- | Turn error posting on+ ErrorsOn+ deriving (Eq, Show, Enum) -- | Enumeration of Message printer types.-data PrintLevel =- NoPrinter+data PrintLevel+ = NoPrinter | TextPrinter | HexPrinter | AllPrinter- deriving (Eq,Show,Enum)+ deriving (Eq, Show, Enum) -- | Sound file format. data SoundFileFormat = Aiff | Flac | Ircam | Next | Raw | Wave deriving (Enum, Eq, Read, Show) -- | Sample format.-data SampleFormat =- PcmInt8 | PcmInt16 | PcmInt24 | PcmInt32- | PcmFloat | PcmDouble- | PcmMulaw | PcmAlaw+data SampleFormat+ = PcmInt8+ | PcmInt16+ | PcmInt24+ | PcmInt32+ | PcmFloat+ | PcmDouble+ | PcmMulaw+ | PcmAlaw deriving (Enum, Eq, Read, Show) -- | Sample format to standard file extension name. soundFileFormatString :: SoundFileFormat -> String soundFileFormatString f =- case f of- Aiff -> "aiff"- Flac -> "flac"- Ircam -> "ircam"- Next -> "next"- Raw -> "raw"- Wave -> "wav"+ case f of+ Aiff -> "aiff"+ Flac -> "flac"+ Ircam -> "ircam"+ Next -> "next"+ Raw -> "raw"+ Wave -> "wav" -- | Infer sample format from file extension name. soundFileFormat_from_extension :: String -> Maybe SoundFileFormat soundFileFormat_from_extension =- let tbl = [("aif",Aiff)- ,("aiff",Aiff)- ,("flac",Flac)- ,("ircam",Ircam)- ,("next",Next)- ,("raw",Raw)- ,("wav",Wave)]- in flip lookup tbl+ let tbl =+ [ ("aif", Aiff)+ , ("aiff", Aiff)+ , ("flac", Flac)+ , ("ircam", Ircam)+ , ("next", Next)+ , ("raw", Raw)+ , ("wav", Wave)+ ]+ in flip lookup tbl -- | Erroring variant. soundFileFormat_from_extension_err :: String -> SoundFileFormat soundFileFormat_from_extension_err =- fromMaybe (error "soundFileFormat_from_extension: unknown sf extension") .- soundFileFormat_from_extension+ fromMaybe (error "soundFileFormat_from_extension: unknown sf extension")+ . soundFileFormat_from_extension -- | 'SampleFormat' string as recognised by scsynth NRT mode. sampleFormatString :: SampleFormat -> String sampleFormatString f =- case f of- PcmInt8 -> "int8"- PcmInt16 -> "int16"- PcmInt24 -> "int24"- PcmInt32 -> "int32"- PcmFloat -> "float"- PcmDouble -> "double"- PcmMulaw -> "mulaw"- PcmAlaw -> "alaw"+ case f of+ PcmInt8 -> "int8"+ PcmInt16 -> "int16"+ PcmInt24 -> "int24"+ PcmInt32 -> "int32"+ PcmFloat -> "float"+ PcmDouble -> "double"+ PcmMulaw -> "mulaw"+ PcmAlaw -> "alaw"
Sound/Sc3/Server/Graphdef.hs view
@@ -21,7 +21,7 @@ type Name = Datum.Ascii -- | Controls are a name and a ugen-index.-type Control = (Name,Int)+type Control = (Name, Int) -- | Constants are floating point. type Sample = Double@@ -32,13 +32,14 @@ -- | Port indices are Int. type Port_Index = Int --- | Index used to indicate constants at Ugen inputs.--- Ie. if the ugen-index is this value (-1) it indicates a constant.+{- | Index used to indicate constants at Ugen inputs.+ Ie. if the ugen-index is this value (-1) it indicates a constant.+-} constant_index :: Ugen_Index constant_index = -1 -- | Inputs are a ugen-index and a port-index.-data Input = Input Ugen_Index Port_Index deriving (Eq,Show)+data Input = Input Ugen_Index Port_Index deriving (Eq, Show) -- | Rates are encoded as integers (IR = 0, KR = 1, AR = 2, DR = 3). type Rate = Int@@ -50,56 +51,58 @@ type Special = Int -- | Unit generator type.-type Ugen = (Name,Rate,[Input],[Output],Special)+type Ugen = (Name, Rate, [Input], [Output], Special) -- | 'Ugen' name. ugen_name_str :: Ugen -> String-ugen_name_str (nm,_,_,_,_) = Datum.ascii_to_string nm+ugen_name_str (nm, _, _, _, _) = Datum.ascii_to_string nm -- | 'Ugen' name, using operator name if appropriate. ugen_name_op :: Ugen -> String-ugen_name_op (nm,_,_,_,k) =+ugen_name_op (nm, _, _, _, k) = let s = Datum.ascii_to_string nm in fromMaybe s (Operator.ugen_operator_name s k) -- | 'Ugen' 'Rate'. ugen_rate :: Ugen -> Rate-ugen_rate (_,r,_,_,_) = r+ugen_rate (_, r, _, _, _) = r ugen_rate_enum :: Ugen -> Rate.Rate ugen_rate_enum = toEnum . ugen_rate -- | 'Ugen' 'Input's. ugen_inputs :: Ugen -> [Input]-ugen_inputs (_,_,i,_,_) = i+ugen_inputs (_, _, i, _, _) = i -- | 'Ugen' 'Output's. ugen_outputs :: Ugen -> [Output]-ugen_outputs (_,_,_,o,_) = o+ugen_outputs (_, _, _, o, _) = o -- | Predicate to examine Ugen name and decide if it is a control. ugen_is_control :: Ugen -> Bool ugen_is_control =- (`elem` ["Control","LagControl","TrigControl"]) .- ugen_name_str+ (`elem` ["Control", "LagControl", "TrigControl"])+ . ugen_name_str -- | Input is a Ugen (ie. not a constant, indicated by a ugen-index of -1) and the Ugen is a control. input_is_control :: Graphdef -> Input -> Bool input_is_control g (Input u _) = (u /= constant_index) && ugen_is_control (graphdef_ugen g u) -- | Graph definition type.-data Graphdef = Graphdef {graphdef_name :: Name- ,graphdef_constants :: [Sample]- ,graphdef_controls :: [(Control,Sample)]- ,graphdef_ugens :: [Ugen]}- deriving (Eq,Show)+data Graphdef = Graphdef+ { graphdef_name :: Name+ , graphdef_constants :: [Sample]+ , graphdef_controls :: [(Control, Sample)]+ , graphdef_ugens :: [Ugen]+ }+ deriving (Eq, Show) -- | Lookup Ugen by index. graphdef_ugen :: Graphdef -> Ugen_Index -> Ugen graphdef_ugen g = Safe.atNote "graphdef_ugen" (graphdef_ugens g) -- | Lookup Control and default value by index.-graphdef_control :: Graphdef -> Int -> (Control,Sample)+graphdef_control :: Graphdef -> Int -> (Control, Sample) graphdef_control g = Safe.atNote "graphdef_controls" (graphdef_controls g) -- | nid of constant.@@ -116,8 +119,12 @@ {- | "SCgf" encoded as 32-bit unsigned integer. -> map fromEnum "SCgf" == [83, 67, 103, 102]-> Byte.decode_i32 (Byte.encode_ascii (Datum.ascii "SCgf"))+>> map fromEnum "SCgf"+[83, 67, 103, 102]++>>> import Sound.Osc.Coding.Byte+>>> decode_i32 (encode_ascii (Datum.ascii "SCgf")) == scgf_i32+True -} scgf_i32 :: Num n => n scgf_i32 = 1396926310@@ -125,22 +132,22 @@ -- * Get -- | Get functions for Graphdef types, (str_f,i8_f,i16_f,i32_f,f32_f)-type Get_Functions m = (m Name,m Int,m Int,m Int,m Double)+type Get_Functions m = (m Name, m Int, m Int, m Int, m Double) -- | Get a 'Control'.-get_control :: Monad m => (Get_Functions m,m Int) -> m Control-get_control ((get_str,_,_,_,_),get_i) = do+get_control :: Monad m => (Get_Functions m, m Int) -> m Control+get_control ((get_str, _, _, _, _), get_i) = do nm <- get_str ix <- get_i- return (nm,ix)+ return (nm, ix) -- | Get an 'Input'. get_input :: Monad m => m Int -> m Input get_input get_i = liftM2 Input get_i get_i -- | Get a 'Ugen'-get_ugen :: Monad m => (Get_Functions m,m Int) -> m Ugen-get_ugen ((get_str,get_i8,get_i16,_,_),get_i) = do+get_ugen :: Monad m => (Get_Functions m, m Int) -> m Ugen+get_ugen ((get_str, get_i8, get_i16, _, _), get_i) = do name <- get_str rate <- get_i8 number_of_inputs <- get_i@@ -148,98 +155,129 @@ special <- get_i16 inputs <- replicateM number_of_inputs (get_input get_i) outputs <- replicateM number_of_outputs get_i8- return (name- ,rate- ,inputs- ,outputs- ,special)+ return+ ( name+ , rate+ , inputs+ , outputs+ , special+ ) -- | Get a 'Graphdef'. Supports version 0|1 and version 2 files. Ignores variants. get_graphdef :: Monad m => Get_Functions m -> m Graphdef-get_graphdef c@(get_str,_,get_i16,get_i32,get_f32) = do+get_graphdef c@(get_str, _, get_i16, get_i32, get_f32) = do magic <- get_i32 version <- get_i32 let get_i =- case version of- 0 -> get_i16- 1 -> get_i16 -- version one allows variants, which are not allowed by hsc3- 2 -> get_i32- _ -> error ("get_graphdef: version not at {zero | one | two}: " ++ show version)+ case version of+ 0 -> get_i16+ 1 -> get_i16 -- version one allows variants, which are not allowed by hsc3+ 2 -> get_i32+ _ -> error ("get_graphdef: version not at {zero | one | two}: " ++ show version) number_of_definitions <- get_i16- when (magic /= scgf_i32)- (error "get_graphdef: illegal magic string")- when (number_of_definitions /= 1)- (error "get_graphdef: non unary graphdef file")+ when+ (magic /= scgf_i32)+ (error "get_graphdef: illegal magic string")+ when+ (number_of_definitions /= 1)+ (error "get_graphdef: non unary graphdef file") name <- get_str number_of_constants <- get_i constants <- replicateM number_of_constants get_f32 number_of_control_defaults <- get_i control_defaults <- replicateM number_of_control_defaults get_f32 number_of_controls <- get_i- controls <- replicateM number_of_controls (get_control (c,get_i))+ controls <- replicateM number_of_controls (get_control (c, get_i)) number_of_ugens <- get_i- ugens <- replicateM number_of_ugens (get_ugen (c,get_i))- return (Graphdef name- constants- (zip controls control_defaults)- ugens)+ ugens <- replicateM number_of_ugens (get_ugen (c, get_i))+ return+ ( Graphdef+ name+ constants+ (zip controls control_defaults)+ ugens+ ) -- * Encode (version zero) -- | Encode functions for Graphdef types (join_f,str_f,i8_f,i16_f,i32_f,f32_f,com_f)-type Encode_Functions t = ([t] -> t,Name -> t,Int -> t,Int -> t,Int -> t,Double -> t,String -> t)+type Encode_Functions t = ([t] -> t, Name -> t, Int -> t, Int -> t, Int -> t, Double -> t, String -> t) encode_input_f :: Encode_Functions t -> Input -> t-encode_input_f (join_f,_,_,i16_f,_,_,_) (Input u p) = join_f (map i16_f [u,p])+encode_input_f (join_f, _, _, i16_f, _, _, _) (Input u p) = join_f (map i16_f [u, p]) encode_control_f :: Encode_Functions t -> Control -> t-encode_control_f (join_f,str_f,_,i16_f,_,_,_) (nm,k) = join_f [str_f nm,i16_f k]+encode_control_f (join_f, str_f, _, i16_f, _, _, _) (nm, k) = join_f [str_f nm, i16_f k] encode_ugen_f :: Encode_Functions t -> Ugen -> t-encode_ugen_f enc (nm,r,i,o,s) =- let (join_f,str_f,i8_f,i16_f,_,_,com_f) = enc- in join_f [com_f "ugen-name",str_f nm- ,com_f "ugen-rate",i8_f r- ,com_f "ugen-number-of-inputs",i16_f (length i)- ,com_f "ugen-number-of-outputs",i16_f (length o)- ,com_f "ugen-special",i16_f s- ,com_f "ugen-inputs (ugen-index,port-index)",join_f (map (encode_input_f enc) i)- ,com_f "ugen-output-rates",join_f (map i8_f o)- ]+encode_ugen_f enc (nm, r, i, o, s) =+ let (join_f, str_f, i8_f, i16_f, _, _, com_f) = enc+ in join_f+ [ com_f "ugen-name"+ , str_f nm+ , com_f "ugen-rate"+ , i8_f r+ , com_f "ugen-number-of-inputs"+ , i16_f (length i)+ , com_f "ugen-number-of-outputs"+ , i16_f (length o)+ , com_f "ugen-special"+ , i16_f s+ , com_f "ugen-inputs (ugen-index,port-index)"+ , join_f (map (encode_input_f enc) i)+ , com_f "ugen-output-rates"+ , join_f (map i8_f o)+ ] encode_graphdef_f :: Encode_Functions t -> Graphdef -> t encode_graphdef_f enc (Graphdef nm cs ks us) =- let (join_f,str_f,_,i16_f,i32_f,f32_f,com_f) = enc- (ks_ctl,ks_def) = unzip ks- in join_f [com_f "SCgf",i32_f scgf_i32- ,com_f "version",i32_f 0- ,com_f "number of graphs",i16_f 1- ,com_f "name",str_f nm- ,com_f "number-of-constants",i16_f (length cs)- ,com_f "constant-values",join_f (map f32_f cs)- ,com_f "number-of-controls",i16_f (length ks_def)- ,com_f "control-default-values",join_f (map f32_f ks_def)- ,com_f "number-of-controls",i16_f (length ks_ctl)- ,com_f "controls",join_f (map (encode_control_f enc) ks_ctl)- ,com_f "number-of-ugens",i16_f (length us)- ,join_f (map (encode_ugen_f enc) us)]+ let (join_f, str_f, _, i16_f, i32_f, f32_f, com_f) = enc+ (ks_ctl, ks_def) = unzip ks+ in join_f+ [ com_f "SCgf"+ , i32_f scgf_i32+ , com_f "version"+ , i32_f 0+ , com_f "number of graphs"+ , i16_f 1+ , com_f "name"+ , str_f nm+ , com_f "number-of-constants"+ , i16_f (length cs)+ , com_f "constant-values"+ , join_f (map f32_f cs)+ , com_f "number-of-controls"+ , i16_f (length ks_def)+ , com_f "control-default-values"+ , join_f (map f32_f ks_def)+ , com_f "number-of-controls"+ , i16_f (length ks_ctl)+ , com_f "controls"+ , join_f (map (encode_control_f enc) ks_ctl)+ , com_f "number-of-ugens"+ , i16_f (length us)+ , join_f (map (encode_ugen_f enc) us)+ ] -- * Stat -- | Simple statistics printer for 'Graphdef'. graphdef_stat :: Graphdef -> String graphdef_stat (Graphdef nm cs ks us) =- let f g = let h (x:xs) = (x,length (x:xs))- h [] = error "graphdef_stat"- in show . map h . group . sort . map g- sq pp_f = intercalate "," (pp_f (map ugen_name_op us))- in unlines ["name : " ++ show nm- ,"number of constants : " ++ show (length cs)- ,"number of controls : " ++ show (length ks)- ,"number of unit generators : " ++ show (length us)- ,"unit generator rates : " ++ f ugen_rate us- ,"unit generator set : " ++ sq (nub . sort)- ,"unit generator sequence : " ++ sq id]+ let f g =+ let h (x : xs) = (x, length (x : xs))+ h [] = error "graphdef_stat"+ in show . map h . group . sort . map g+ sq pp_f = intercalate "," (pp_f (map ugen_name_op us))+ in unlines+ [ "name : " ++ show nm+ , "number of constants : " ++ show (length cs)+ , "number of controls : " ++ show (length ks)+ , "number of unit generators : " ++ show (length us)+ , "unit generator rates : " ++ f ugen_rate us+ , "unit generator set : " ++ sq (nub . sort)+ , "unit generator sequence : " ++ sq id+ ] -- * Dump Ugens @@ -251,20 +289,22 @@ input_pp (Input i j) = let ui = u_sq !! i in if i >= 0- then if length (ugen_outputs ui) > 1+ then+ if length (ugen_outputs ui) > 1 then printf "%d_%s:%d" i (ugen_name_op ui) j else printf "%d_%s" i (ugen_name_op ui)- else printf "%f" (c_sq !! j)+ else printf "%f" (c_sq !! j) inputs_pp = in_brackets . intercalate "," . map input_pp in printf "%d_%s, %s, %s" ix (ugen_name_op u) (show (ugen_rate_enum u)) (inputs_pp (ugen_inputs u)) -- | Print graphdef in format equivalent to SynthDef>>dumpUgens in SuperCollider graphdef_dump_ugens_str :: Graphdef -> [String]-graphdef_dump_ugens_str (Graphdef _nm cs _ks us) = zipWith (ugen_dump_ugen_str cs us) [0..] us+graphdef_dump_ugens_str (Graphdef _nm cs _ks us) = zipWith (ugen_dump_ugen_str cs us) [0 ..] us {- | 'putStrLn' of 'unlines' of 'graphdef_dump_ugens_str' > import Sound.Sc3.Server.Graphdef+> import Sound.Sc3.Server.Graphdef.Io > dir = "/home/rohan/sw/rsc3-disassembler/scsyndef/" > pp nm = read_graphdef_file (dir ++ nm) >>= graphdef_dump_ugens > pp "simple.scsyndef"
Sound/Sc3/Server/Graphdef/Binary.hs view
@@ -5,7 +5,7 @@ import qualified Data.Binary.Get as Get {- binary -} import qualified Data.Binary.IEEE754 as IEEE754 {- data-binary-ieee754 -}-import qualified Data.ByteString.Lazy as L {- bytestring -}+import qualified Data.ByteString.Lazy as ByteString {- bytestring -} import qualified Sound.Osc.Coding.Byte as Byte {- hosc -} import qualified Sound.Osc.Coding.Cast as Cast {- hosc -}@@ -24,11 +24,12 @@ -- | Get_Functions for binary .scsyndef files. binary_get_f :: Get_Functions Get.Get binary_get_f =- (get_pstr- ,fmap fromIntegral Get.getInt8- ,fmap fromIntegral Get.getInt16be- ,fmap fromIntegral Get.getInt32be- ,fmap realToFrac IEEE754.getFloat32be)+ ( get_pstr+ , fmap fromIntegral Get.getInt8+ , fmap fromIntegral Get.getInt16be+ , fmap fromIntegral Get.getInt32be+ , fmap realToFrac IEEE754.getFloat32be+ ) -- * Read @@ -43,7 +44,7 @@ -} read_graphdef_file :: FilePath -> IO Graphdef read_graphdef_file nm = do- b <- L.readFile nm+ b <- ByteString.readFile nm return (Get.runGet (get_graphdef binary_get_f) b) -- * Stat@@ -56,51 +57,55 @@ -- * Encode (version zero) --- | 'Encode_Functions' for 'L.ByteString'-enc_bytestring :: Encode_Functions L.ByteString+-- | 'Encode_Functions' for 'ByteString.ByteString'+enc_bytestring :: Encode_Functions ByteString.ByteString enc_bytestring =- (L.concat,encode_pstr,Byte.encode_i8,Byte.encode_i16,Byte.encode_i32,encode_sample- ,const L.empty)-+ ( ByteString.concat+ , encode_pstr+ , Byte.encode_i8+ , Byte.encode_i16+ , Byte.encode_i32+ , encode_sample+ , const ByteString.empty+ ) {- | Pascal (length prefixed) encoding of 'Name'. -> L.unpack (encode_pstr (ascii "string")) == [6, 115, 116, 114, 105, 110, 103]+> ByteString.unpack (encode_pstr (ascii "string")) == [6, 115, 116, 114, 105, 110, 103] -}-encode_pstr :: Name -> L.ByteString-encode_pstr = L.pack . Cast.str_pstr . Datum.ascii_to_string-+encode_pstr :: Name -> ByteString.ByteString+encode_pstr = ByteString.pack . Cast.str_pstr . Datum.ascii_to_string -- | Byte-encode 'Input'.-encode_input :: Input -> L.ByteString+encode_input :: Input -> ByteString.ByteString encode_input = encode_input_f enc_bytestring -- | Byte-encode 'Control'.-encode_control :: Control -> L.ByteString+encode_control :: Control -> ByteString.ByteString encode_control = encode_control_f enc_bytestring -- | Byte-encode 'Ugen'.-encode_ugen :: Ugen -> L.ByteString+encode_ugen :: Ugen -> ByteString.ByteString encode_ugen = encode_ugen_f enc_bytestring -- | Encode 'Sample' as 32-bit IEEE float.-encode_sample :: Sample -> L.ByteString+encode_sample :: Sample -> ByteString.ByteString encode_sample = Byte.encode_f32 . realToFrac -- | Encode 'Graphdef'.-encode_graphdef :: Graphdef -> L.ByteString+encode_graphdef :: Graphdef -> ByteString.ByteString encode_graphdef = encode_graphdef_f enc_bytestring - -- * IO -- | Write 'Graphdef' to indicated file. graphdefWrite :: FilePath -> Graphdef -> IO ()-graphdefWrite fn = L.writeFile fn . encode_graphdef+graphdefWrite fn = ByteString.writeFile fn . encode_graphdef --- | Write 'Graphdef' to indicated directory. The filename is the--- 'graphdef_name' with the appropriate extension (@scsyndef@).+{- | Write 'Graphdef' to indicated directory. The filename is the+'graphdef_name' with the appropriate extension (@scsyndef@).+-} graphdefWrite_dir :: FilePath -> Graphdef -> IO () graphdefWrite_dir dir s =- let fn = dir </> Datum.ascii_to_string (graphdef_name s) <.> "scsyndef"- in graphdefWrite fn s+ let fn = dir </> Datum.ascii_to_string (graphdef_name s) <.> "scsyndef"+ in graphdefWrite fn s
Sound/Sc3/Server/Graphdef/Graph.hs view
@@ -9,9 +9,9 @@ import qualified Sound.Sc3.Common.Rate as Rate {- hsc3 -} import qualified Sound.Sc3.Common.Uid as Uid {- hsc3 -}+import qualified Sound.Sc3.Server.Graphdef as Graphdef {- hsc3 -} import qualified Sound.Sc3.Ugen.Graph as Graph {- hsc3 -} import qualified Sound.Sc3.Ugen.Types as Types {- hsc3 -}-import qualified Sound.Sc3.Server.Graphdef as Graphdef {- hsc3 -} -- * Maps @@ -19,62 +19,63 @@ type Int_Map = M.IntMap Int -- | (constants-map,controls,controls-map,ugen-map,ktype-map)-type Encoding_Maps = (Int_Map,[Graph.U_Node],Int_Map,Int_Map,[(Rate.K_Type,Int)])+type Encoding_Maps = (Int_Map, [Graph.U_Node], Int_Map, Int_Map, [(Rate.K_Type, Int)]) -- | Generate 'Encoding_Maps' translating node identifiers to synthdef indexes. mk_encoding_maps :: Graph.U_Graph -> Encoding_Maps mk_encoding_maps (Graph.U_Graph _ cs ks us) =- (M.fromList (zip (map Graph.u_node_id cs) [0..])- ,ks- ,M.fromList (zip (map Graph.u_node_id ks) [0..])- ,M.fromList (zip (map Graph.u_node_id us) [0..])- ,Graph.u_node_mk_ktype_map us)+ ( M.fromList (zip (map Graph.u_node_id cs) [0 ..])+ , ks+ , M.fromList (zip (map Graph.u_node_id ks) [0 ..])+ , M.fromList (zip (map Graph.u_node_id us) [0 ..])+ , Graph.u_node_mk_ktype_map us+ ) -- | Locate index in map given node identifer 'UID_t'. uid_lookup :: Uid.Id -> Int_Map -> Int uid_lookup = M.findWithDefault (error "uid_lookup") -- | Lookup 'K_Type' index from map (erroring variant of 'lookup').-ktype_map_lookup :: Rate.K_Type -> [(Rate.K_Type,Int)] -> Int+ktype_map_lookup :: Rate.K_Type -> [(Rate.K_Type, Int)] -> Int ktype_map_lookup k m =- let e = error (show ("ktype_map_lookup",k,m))- in fromMaybe e (lookup k m)+ let e = error (show ("ktype_map_lookup", k, m))+ in fromMaybe e (lookup k m) -- * Encoding -- | Byte-encode 'Graph.From_Port' primitive node. make_input :: Encoding_Maps -> Graph.From_Port -> Graphdef.Input-make_input (cs,ks,_,us,kt) fp =- case fp of- Graph.From_Port_C n -> Graphdef.Input (-1) (uid_lookup n cs)- Graph.From_Port_K n t ->- let i = ktype_map_lookup t kt- in Graphdef.Input i (Graph.u_node_fetch_k n t ks)- Graph.From_Port_U n p -> Graphdef.Input (uid_lookup n us) (fromMaybe 0 p)+make_input (cs, ks, _, us, kt) fp =+ case fp of+ Graph.From_Port_C n -> Graphdef.Input (-1) (uid_lookup n cs)+ Graph.From_Port_K n t ->+ let i = ktype_map_lookup t kt+ in Graphdef.Input i (Graph.u_node_fetch_k n t ks)+ Graph.From_Port_U n p -> Graphdef.Input (uid_lookup n us) (fromMaybe 0 p) -- | Byte-encode 'Graph.U_Node_K' primitive node. make_control :: Encoding_Maps -> Graph.U_Node -> Graphdef.Control-make_control (_,_,ks,_,_) nd =- case nd of- Graph.U_Node_K n _ _ nm _ _ _ -> (Datum.ascii nm,uid_lookup n ks)- _ -> error "make_control"+make_control (_, _, ks, _, _) nd =+ case nd of+ Graph.U_Node_K n _ _ nm _ _ _ -> (Datum.ascii nm, uid_lookup n ks)+ _ -> error "make_control" -- | Byte-encode 'Graph.U_Node_U' primitive node. make_ugen :: Encoding_Maps -> Graph.U_Node -> Graphdef.Ugen make_ugen m n =- case n of- Graph.U_Node_U _ r nm i o (Types.Special s) _ ->- let i' = map (make_input m) i- in (Datum.ascii nm,Rate.rateId r,i',map Rate.rateId o,s)- _ -> error "encode_node_u: illegal input"+ case n of+ Graph.U_Node_U _ r nm i o (Types.Special s) _ ->+ let i' = map (make_input m) i+ in (Datum.ascii nm, Rate.rateId r, i', map Rate.rateId o, s)+ _ -> error "encode_node_u: illegal input" -- | Construct instrument definition bytecode. graph_to_graphdef :: String -> Graph.U_Graph -> Graphdef.Graphdef graph_to_graphdef nm g =- let Graph.U_Graph _ cs ks us = g- cs' = map Graph.u_node_c_value cs- mm = mk_encoding_maps g- ks_def = map Graph.u_node_k_default ks- ks_ctl = map (make_control mm) ks- us' = map (make_ugen mm) us- in Graphdef.Graphdef (Datum.ascii nm) cs' (zip ks_ctl ks_def) us'+ let Graph.U_Graph _ cs ks us = g+ cs' = map Graph.u_node_c_value cs+ mm = mk_encoding_maps g+ ks_def = map Graph.u_node_k_default ks+ ks_ctl = map (make_control mm) ks+ us' = map (make_ugen mm) us+ in Graphdef.Graphdef (Datum.ascii nm) cs' (zip ks_ctl ks_def) us'
Sound/Sc3/Server/Graphdef/Io.hs view
@@ -15,5 +15,5 @@ read_graphdef_file :: FilePath -> IO Graphdef read_graphdef_file fn = if ".scsyndef.text" `isSuffixOf` fn- then Text.read_graphdef_file fn- else Binary.read_graphdef_file fn+ then Text.read_graphdef_file fn+ else Binary.read_graphdef_file fn
Sound/Sc3/Server/Graphdef/Read.hs view
@@ -10,50 +10,53 @@ import qualified Sound.Sc3.Ugen.Graph as Graph {- hsc3 -} import qualified Sound.Sc3.Ugen.Types as Types {- hsc3 -} -control_to_node :: Graphdef.Graphdef -> Uid.Id -> (Graphdef.Control,Types.Sample) -> Graph.U_Node-control_to_node g z ((nm,ix),v) =- let z' = Graphdef.graphdef_control_nid g z- nm' = Datum.ascii_to_string nm- in Graph.U_Node_K z' Rate.ControlRate (Just ix) nm' v Rate.K_ControlRate Nothing+control_to_node :: Graphdef.Graphdef -> Uid.Id -> (Graphdef.Control, Types.Sample) -> Graph.U_Node+control_to_node g z ((nm, ix), v) =+ let z' = Graphdef.graphdef_control_nid g z+ nm' = Datum.ascii_to_string nm+ in Graph.U_Node_K z' Rate.ControlRate (Just ix) nm' v Rate.K_ControlRate Nothing -- | Note: Graphs with multiple Control Ugens are not accounted for. input_to_from_port :: Graphdef.Graphdef -> Graphdef.Input -> Graph.From_Port input_to_from_port g (Graphdef.Input u p) =- if u == -1+ if u == -1 then Graph.From_Port_C (Graphdef.graphdef_constant_nid g p)- else if Graphdef.input_is_control g (Graphdef.Input u p)- then Graph.From_Port_K (Graphdef.graphdef_control_nid g p) Rate.K_ControlRate- else let ugen = Graphdef.graphdef_ugens g !! u- port = if length (Graphdef.ugen_outputs ugen) > 1- then Just p- else Nothing- in Graph.From_Port_U (Graphdef.graphdef_ugen_nid g u) port+ else+ if Graphdef.input_is_control g (Graphdef.Input u p)+ then Graph.From_Port_K (Graphdef.graphdef_control_nid g p) Rate.K_ControlRate+ else+ let ugen = Graphdef.graphdef_ugens g !! u+ port =+ if length (Graphdef.ugen_outputs ugen) > 1+ then Just p+ else Nothing+ in Graph.From_Port_U (Graphdef.graphdef_ugen_nid g u) port ugen_to_node :: Graphdef.Graphdef -> Uid.Id -> Graphdef.Ugen -> Graph.U_Node ugen_to_node g z u =- let (name,rate,inputs,outputs,special) = u- z' = Graphdef.graphdef_ugen_nid g z- rate' = toEnum rate- name' = Datum.ascii_to_string name- inputs' = map (input_to_from_port g) inputs- outputs' = map toEnum outputs- special' = Types.Special special- in Graph.U_Node_U z' rate' name' inputs' outputs' special' (Types.Uid z')+ let (name, rate, inputs, outputs, special) = u+ z' = Graphdef.graphdef_ugen_nid g z+ rate' = toEnum rate+ name' = Datum.ascii_to_string name+ inputs' = map (input_to_from_port g) inputs+ outputs' = map toEnum outputs+ special' = Types.Special special+ in Graph.U_Node_U z' rate' name' inputs' outputs' special' (Types.Uid z') -graphdef_to_graph :: Graphdef.Graphdef -> (String,Graph.U_Graph)+graphdef_to_graph :: Graphdef.Graphdef -> (String, Graph.U_Graph) graphdef_to_graph g =- let constants_nd = zipWith Graph.U_Node_C [0..] (Graphdef.graphdef_constants g)- controls_nd = zipWith (control_to_node g) [0 ..] (Graphdef.graphdef_controls g)- ugens_nd = zipWith (ugen_to_node g) [0 ..] (Graphdef.graphdef_ugens g)- nm = Datum.ascii_to_string (Graphdef.graphdef_name g)- gr = Graph.U_Graph (-1) constants_nd controls_nd ugens_nd- in (nm,gr) -- S.Synthdef nm gr+ let constants_nd = zipWith Graph.U_Node_C [0 ..] (Graphdef.graphdef_constants g)+ controls_nd = zipWith (control_to_node g) [0 ..] (Graphdef.graphdef_controls g)+ ugens_nd = zipWith (ugen_to_node g) [0 ..] (Graphdef.graphdef_ugens g)+ nm = Datum.ascii_to_string (Graphdef.graphdef_name g)+ gr = Graph.U_Graph (-1) constants_nd controls_nd ugens_nd+ in (nm, gr) -- S.Synthdef nm gr -- | Read graphdef file and translate to graph. read_graph :: FilePath -> IO Graph.U_Graph read_graph sy_nm = do d <- Graphdef.read_graphdef_file sy_nm- let (_,g) = graphdef_to_graph d+ let (_, g) = graphdef_to_graph d return g -- | Read graphdef file, translate to graph, and run 'ug_stat_ln'.
Sound/Sc3/Server/Graphdef/Text.hs view
@@ -3,9 +3,9 @@ -} module Sound.Sc3.Server.Graphdef.Text where -import Control.Monad {- base -} import Data.Char {- base -} import Data.Functor.Identity {- base -}+import Data.List {- base -} import qualified Numeric {- base -} @@ -26,14 +26,19 @@ -- | 'Encode_Functions' for plain text output. enc_text :: (String -> String) -> Encode_Functions String enc_text com_f =- (unwords . filter (not . null),print_string,show,show,show,\n -> Numeric.showFFloat Nothing n ""- ,com_f)+ ( unwords . filter (not . null)+ , print_string+ , show+ , show+ , show+ , \n -> Numeric.showFFloat Nothing n ""+ , com_f+ ) {- | 'encode_graphdef_f' of 'enc_text' with optional semi-colon delimited comments. -> import Sound.Sc3.Server.Graphdef.Binary > dir = "/home/rohan/sw/rsc3-disassembler/scsyndef/"-> pp nm = read_graphdef_file (dir ++ nm) >>= putStrLn . print_graphdef True+> pp nm = Sound.Sc3.Server.Graphdef.Io.read_graphdef_file (dir ++ nm) >>= putStrLn . print_graphdef True > pp "simple.scsyndef" > pp "with-ctl.scsyndef" > pp "mce.scsyndef"@@ -41,8 +46,8 @@ -} print_graphdef :: Bool -> Graphdef -> String print_graphdef with_com =- let com_f = if with_com then \c -> concat ["\n; ",c,"\n"] else const ""- in encode_graphdef_f (enc_text com_f)+ let com_f = if with_com then \c -> concat ["\n; ", c, "\n"] else const ""+ in encode_graphdef_f (enc_text com_f) -- * List Input @@ -50,9 +55,9 @@ list_read_f :: (t -> u) -> S.State [t] u list_read_f f = do l <- S.get- when (null l) (error "list_read_f")- S.put (tail l)- return (f (head l))+ case uncons l of+ Nothing -> error "list_read_f"+ Just (h, t) -> S.put t >> return (f h) -- | Read function for floating point that admits inf and infinity. read_float :: (Fractional p, Read p) => String -> p@@ -64,16 +69,23 @@ -- | Get_Functions for text representation of Graphdef. text_get_f :: Get_Functions (S.StateT [String] Identity)-text_get_f = (list_read_f Datum.ascii,list_read_f read,list_read_f read,list_read_f read,list_read_f read_float)+text_get_f = (list_read_f Datum.ascii, list_read_f read, list_read_f read, list_read_f read, list_read_f read_float) --- | Read text representation of Graphdef, as written by 'print_graphdef'.------ > read_graphdef "1396926310 0 1 simple 2 0.0 440.0 0 0 2 SinOsc 2 2 1 0 -1 1 -1 0 2 Out 2 2 0 0 -1 0 0 0"+-- | Is line empty or starts with ';'+is_nil_or_comment :: String -> Bool+is_nil_or_comment txt =+ case uncons txt of+ Nothing -> True+ Just (h, _) -> h == ';'++{- | Read text representation of Graphdef, as written by 'print_graphdef'.++> read_graphdef "1396926310 0 1 simple 2 0.0 440.0 0 0 2 SinOsc 2 2 1 0 -1 1 -1 0 2 Out 2 2 0 0 -1 0 0 0"+-} read_graphdef :: String -> Graphdef read_graphdef txt =- let delete_comments = filter (\x -> not (null x) && (head x /= ';'))+ let delete_comments = filter (not . is_nil_or_comment) in S.evalState (get_graphdef text_get_f) (concatMap words (delete_comments (lines txt))) read_graphdef_file :: FilePath -> IO Graphdef read_graphdef_file = fmap read_graphdef . readFile-
Sound/Sc3/Server/Nrt.hs view
@@ -1,6 +1,7 @@ -- | Non-realtime score generation. module Sound.Sc3.Server.Nrt where +import Data.List {- base -} import Data.Maybe {- base -} import System.IO {- base -} @@ -13,19 +14,19 @@ import Sound.Osc.Packet {- hosc -} -- | Encode Bundle and prefix with encoded length.-oscWithSize :: Bundle -> B.ByteString+oscWithSize :: BundleOf Message -> B.ByteString oscWithSize o =- let b = Encode.encodeBundle o- l = Byte.encode_i32 (fromIntegral (B.length b))- in B.append l b+ let b = Encode.encodeBundle o+ l = Byte.encode_i32 (fromIntegral (B.length b))+ in B.append l b -- | An 'Nrt' score is a sequence of 'Bundle's.-newtype Nrt = Nrt {nrt_bundles :: [Bundle]} deriving (Show)+newtype Nrt = Nrt {nrt_bundles :: [BundleOf Message]} deriving (Show) {- | 'span' of 'f' of 'bundleTime'. Can be used to separate the /initialisation/ and /remainder/ parts of a score. -}-nrt_span :: (Time -> Bool) -> Nrt -> ([Bundle],[Bundle])+nrt_span :: (Time -> Bool) -> Nrt -> ([BundleOf Message], [BundleOf Message]) nrt_span f = span (f . bundleTime) . nrt_bundles -- | Encode an 'Nrt' score.@@ -34,8 +35,8 @@ {- | Write an 'Nrt' score. -> import Sound.Osc {- hosc -}-> import Sound.Sc3 {- hsc3 -}+> import Sound.Osc {\- hosc -\}+> import Sound.Sc3 {\- hsc3 -\} > m1 = g_new [(1, AddToTail, 0)] > m2 = d_recv (synthdef "sin" (out 0 (sinOsc ar 660 0 * 0.15))) > m3 = s_new "sin" 100 AddToTail 1 []@@ -52,15 +53,15 @@ putNrt h = B.hPut h . encodeNrt -- | Decode an 'Nrt' 'B.ByteString' to a list of 'Bundle's.-decode_nrt_bundles :: B.ByteString -> [Bundle]+decode_nrt_bundles :: B.ByteString -> [BundleOf Message] decode_nrt_bundles s =- let (p,q) = B.splitAt 4 s- n = fromIntegral (Byte.decode_i32 p)- (r,s') = B.splitAt n q- r' = Decode.decodeBundle r- in if B.null s'- then [r']- else r' : decode_nrt_bundles s'+ let (p, q) = B.splitAt 4 s+ n = fromIntegral (Byte.decode_i32 p)+ (r, s') = B.splitAt n q+ r' = Decode.decodeBundle r+ in if B.null s'+ then [r']+ else r' : decode_nrt_bundles s' -- | Decode an 'Nrt' 'B.ByteString'. decodeNrt :: B.ByteString -> Nrt@@ -76,8 +77,11 @@ -- * Query -- | Find any non-ascending sequences.-nrt_non_ascending :: Nrt -> [(Bundle, Bundle)]+nrt_non_ascending :: Nrt -> [(BundleOf Message, BundleOf Message)] nrt_non_ascending (Nrt b) =- let p = zip b (tail b)- f (i,j) = if bundleTime i > bundleTime j then Just (i,j) else Nothing- in mapMaybe f p+ case uncons b of+ Nothing -> error "nrt_non_ascending: empty nrt"+ Just (_, t) ->+ let p = zip b t+ f (i, j) = if bundleTime i > bundleTime j then Just (i, j) else Nothing+ in mapMaybe f p
Sound/Sc3/Server/Nrt/Edit.hs view
@@ -25,11 +25,11 @@ nrt_empty = Nrt [] -- | Add bundle at first permissable location of Nrt.-nrt_insert_pre :: Osc.Bundle -> Nrt -> Nrt+nrt_insert_pre :: Osc.BundleOf Osc.Message -> Nrt -> Nrt nrt_insert_pre p (Nrt q) = Nrt (insert p q) -- | Add bundle at last permissable location of Nrt.-nrt_insert_post :: Osc.Bundle -> Nrt -> Nrt+nrt_insert_post :: Osc.BundleOf Osc.Message -> Nrt -> Nrt nrt_insert_post p (Nrt q) = Nrt (Sound.Sc3.Common.Base.insert_post p q) -- | bundleTime of last of nrt_bundles.@@ -39,14 +39,16 @@ -- | Delete any internal nrt_end messages, and require one at the final bundle. nrt_close :: Nrt -> Nrt nrt_close (Nrt l) =- let is_nrt_end_msg = (== "/nrt_end") . Osc.messageAddress- bundle_map t_f m_f (Osc.Bundle t m) = Osc.Bundle (t_f t) (m_f m) -- apply temporal and message functions to bundle- rem_end_msg = bundle_map id (filter (not . is_nrt_end_msg))- req_end_msg = let f m = if any is_nrt_end_msg m- then m- else m ++ [Sound.Sc3.Server.Command.nrt_end]- in bundle_map id f- in Nrt (Sound.Sc3.Common.Base.at_last rem_end_msg req_end_msg l)+ let is_nrt_end_msg = (== "/nrt_end") . Osc.messageAddress+ bundle_map t_f m_f (Osc.Bundle t m) = Osc.Bundle (t_f t) (m_f m) -- apply temporal and message functions to bundle+ rem_end_msg = bundle_map id (filter (not . is_nrt_end_msg))+ req_end_msg =+ let f m =+ if any is_nrt_end_msg m+ then m+ else m ++ [Sound.Sc3.Server.Command.nrt_end]+ in bundle_map id f+ in Nrt (Sound.Sc3.Common.Base.at_last rem_end_msg req_end_msg l) -- | Append /q/ to /p/, assumes last timestamp at /p/ precedes first at /q/. nrt_append :: Nrt -> Nrt -> Nrt
Sound/Sc3/Server/Nrt/Render.hs view
@@ -18,25 +18,37 @@ sample format, further parameters (ie. ["-m","32768"]) to be inserted before the Nrt -N option. -}-type Nrt_Param_Plain = (FilePath,(FilePath,Int),(FilePath,Int),Int,SampleFormat,[String])+type Nrt_Param_Plain = (FilePath, (FilePath, Int), (FilePath, Int), Int, SampleFormat, [String]) {- | Compile argument list from Nrt_Param_Plain. -> let opt = ("/tmp/t.osc",("_",0),("/tmp/t.wav",1),48000,PcmInt16,[])-> let r = ["-i","0","-o","1","-N","/tmp/t.osc","_","/tmp/t.wav","48000","wav","int16"]-> nrt_param_plain_to_arg opt == r+>>> let opt = ("/tmp/t.osc",("_",0),("/tmp/t.wav",1),48000,PcmInt16,[])+>>> nrt_param_plain_to_arg opt+["-i","0","-o","1","-N","/tmp/t.osc","_","/tmp/t.wav","48000","wav","int16"] -} nrt_param_plain_to_arg :: Nrt_Param_Plain -> [String]-nrt_param_plain_to_arg (osc_nm,(in_sf,in_nc),(out_sf,out_nc),sr,sf,param) =+nrt_param_plain_to_arg (osc_nm, (in_sf, in_nc), (out_sf, out_nc), sr, sf, param) = let sf_ty = case takeExtension out_sf of- '.':ext -> soundFileFormat_from_extension_err ext- _ -> error "nrt_exec_plain: invalid sf extension"- in concat [["-i",show in_nc- ,"-o",show out_nc]- ,param- ,["-N"- ,osc_nm,in_sf,out_sf- ,show sr,soundFileFormatString sf_ty,sampleFormatString sf]]+ '.' : ext -> soundFileFormat_from_extension_err ext+ _ -> error "nrt_exec_plain: invalid sf extension"+ in concat+ [+ [ "-i"+ , show in_nc+ , "-o"+ , show out_nc+ ]+ , param+ ,+ [ "-N"+ , osc_nm+ , in_sf+ , out_sf+ , show sr+ , soundFileFormatString sf_ty+ , sampleFormatString sf+ ]+ ] {- | Compile argument list from Nrt_Param_Plain and run scynth. @@ -45,12 +57,13 @@ nrt_exec_plain :: Nrt_Param_Plain -> IO () nrt_exec_plain opt = callProcess "scsynth" (nrt_param_plain_to_arg opt) --- | Minimal Nrt rendering, for more control see Stefan Kersten's--- /hsc3-process/ package at:--- <https://github.com/kaoskorobase/hsc3-process>.+{- | Minimal Nrt rendering, for more control see Stefan Kersten's+/hsc3-process/ package at:+<https://github.com/kaoskorobase/hsc3-process>.+-} nrt_proc_plain :: Nrt_Param_Plain -> Nrt -> IO () nrt_proc_plain opt sc = do- let (osc_nm,_,_,_,_,_) = opt+ let (osc_nm, _, _, _, _, _) = opt writeNrt osc_nm sc nrt_exec_plain opt @@ -58,13 +71,13 @@ (osc-file-name, audio-file-name, number-of-channels, sample-rate, sample-format, param) -}-type Nrt_Render_Plain = (FilePath,FilePath,Int,Int,SampleFormat,[String])+type Nrt_Render_Plain = (FilePath, FilePath, Int, Int, SampleFormat, [String]) {- | Add ("-",0) as input parameters and run 'nrt_proc_plain'. > nrt_render_plain opt sc -} nrt_render_plain :: Nrt_Render_Plain -> Nrt -> IO ()-nrt_render_plain (osc_nm,sf_nm,nc,sr,sf,param) sc =- let opt = (osc_nm,("_",0),(sf_nm,nc),sr,sf,param)+nrt_render_plain (osc_nm, sf_nm, nc, sr, sf, param) sc =+ let opt = (osc_nm, ("_", 0), (sf_nm, nc), sr, sf, param) in nrt_proc_plain opt sc
Sound/Sc3/Server/Nrt/Stat.hs view
@@ -9,22 +9,24 @@ -- | Nrt statistics, see nrt_stat_param for meanings. type Nrt_Stat =- ((String, Time)- ,(String, Int)- ,(String, Int)- ,(String, [(String,Int)]))+ ( (String, Time)+ , (String, Int)+ , (String, Int)+ , (String, [(String, Int)])+ ) -- | Nrt_Stat names. nrt_stat_param :: (String, String, String, String)-nrt_stat_param = ("duration","# bundles","# messages","command set")+nrt_stat_param = ("duration", "# bundles", "# messages", "command set") -- | Trivial Nrt statistics. nrt_stat :: Nrt -> Nrt_Stat nrt_stat (Nrt b_seq) =- let b_msg = map bundleMessages b_seq- in p4_zip- nrt_stat_param- (bundleTime (last b_seq)- ,length b_seq- ,sum (map length b_msg)- ,histogram (concatMap (map messageAddress) b_msg))+ let b_msg = map bundleMessages b_seq+ in p4_zip+ nrt_stat_param+ ( bundleTime (last b_seq)+ , length b_seq+ , sum (map length b_msg)+ , histogram (concatMap (map messageAddress) b_msg)+ )
Sound/Sc3/Server/Nrt/Ugen.hs view
@@ -4,37 +4,59 @@ import qualified Sound.Osc.Datum as Osc {- hosc -} import qualified Sound.Osc.Packet as Osc {- hosc -} -import Sound.Sc3.Common.Rate-import Sound.Sc3.Server.Command.Plain-import Sound.Sc3.Server.Enum-import Sound.Sc3.Server.Nrt-import Sound.Sc3.Server.Nrt.Render-import Sound.Sc3.Server.Synthdef-import Sound.Sc3.Ugen.Bindings.Db-import Sound.Sc3.Ugen.Ugen+import qualified Sound.Sc3.Common.Rate as Rate+import qualified Sound.Sc3.Server.Command.Plain as Server.Command+import qualified Sound.Sc3.Server.Enum as Server.Enum+import qualified Sound.Sc3.Server.Graphdef as Graphdef+import qualified Sound.Sc3.Server.Graphdef.Binary as Graphdef.Binary+import qualified Sound.Sc3.Server.Nrt as Nrt+import qualified Sound.Sc3.Server.Nrt.Render as Nrt.Render+import qualified Sound.Sc3.Server.Synthdef as Synthdef+import qualified Sound.Sc3.Ugen.Bindings.Db as Ugen.Binding+import qualified Sound.Sc3.Ugen.Ugen as Ugen +nrt_encoded_graphdef_rec :: Osc.Time -> Osc.Blob -> Nrt.Nrt+nrt_encoded_graphdef_rec dur graphdef =+ let m0 = Server.Command.d_recv_bytes graphdef+ m1 = Server.Command.s_new0 "Anonymous" 1 Server.Enum.AddToHead 0+ in Nrt.Nrt [Osc.bundle 0 [m0, m1], Osc.bundle dur [Server.Command.nrt_end]]++nrt_graphdef_rec :: Osc.Time -> Graphdef.Graphdef -> Nrt.Nrt+nrt_graphdef_rec dur graphdef = nrt_encoded_graphdef_rec dur (Graphdef.Binary.encode_graphdef graphdef)++nrt_syndef_rec :: Osc.Time -> Synthdef.Synthdef -> Nrt.Nrt+nrt_syndef_rec dur syndef = nrt_graphdef_rec dur (Synthdef.synthdef_to_graphdef syndef)+ {- | Make Nrt score that runs Ugen for Time seconds to output bus zero. If Ugen is at ControlRate insert 'k2a' Ugen. -}-nrt_ugen_rec :: Osc.Time -> Ugen -> Nrt-nrt_ugen_rec dur u =- let sg = case rateOf u of- AudioRate -> u- ControlRate -> k2a u- _ -> error "nrt_ugen_rec: rate?"- sy = synthdef "anonymous" (out 0 sg)- m0 = d_recv sy- m1 = s_new0 "anonymous" 1 AddToHead 0- in Nrt [Osc.bundle 0 [m0, m1], Osc.bundle dur [nrt_end]]+nrt_ugen_rec :: Osc.Time -> Ugen.Ugen -> Nrt.Nrt+nrt_ugen_rec dur ugen =+ let ugen' =+ case Ugen.rateOf ugen of+ Rate.AudioRate -> ugen+ Rate.ControlRate -> Ugen.Binding.k2a ugen+ _ -> error "nrt_ugen_rec: rate?"+ in nrt_syndef_rec dur (Synthdef.synthdef "Anonymous" (Ugen.Binding.out 0 ugen')) -- | (osc-file, sound-file, sample-rate, sample-format, scsynth-options)-type Nrt_Ugen_Opt = (FilePath, FilePath, Int, SampleFormat, [String])+type Nrt_Opt = (FilePath, FilePath, Int, Server.Enum.SampleFormat, [String]) +nrt_encoded_graphdef_render :: Nrt_Opt -> Osc.Time -> Int -> Osc.Blob -> IO ()+nrt_encoded_graphdef_render (osc_fn, sf_fn, sample_rate, fmt, opt) dur nc syndef = do+ let sc = nrt_encoded_graphdef_rec dur syndef+ Nrt.Render.nrt_render_plain (osc_fn, sf_fn, nc, sample_rate, fmt, opt) sc++nrt_syndef_render :: Nrt_Opt -> Osc.Time -> Int -> Synthdef.Synthdef -> IO ()+nrt_syndef_render (osc_fn, sf_fn, sample_rate, fmt, opt) dur nc syndef = do+ let sc = nrt_syndef_rec dur syndef+ Nrt.Render.nrt_render_plain (osc_fn, sf_fn, nc, sample_rate, fmt, opt) sc+ {- | 'nrt_render_plain' of 'ugen_rec_nrt'. The number of channels is equal to the degree of the Ugen. -}-nrt_ugen_render :: Nrt_Ugen_Opt -> Osc.Time -> Ugen -> IO ()-nrt_ugen_render (osc_fn,sf_fn,sample_rate,fmt,opt) dur u = do+nrt_ugen_render :: Nrt_Opt -> Osc.Time -> Ugen.Ugen -> IO ()+nrt_ugen_render (osc_fn, sf_fn, sample_rate, fmt, opt) dur u = do let sc = nrt_ugen_rec dur u- nc = length (mceChannels u)- nrt_render_plain (osc_fn,sf_fn,nc,sample_rate,fmt,opt) sc+ nc = length (Ugen.mceChannels u)+ Nrt.Render.nrt_render_plain (osc_fn, sf_fn, nc, sample_rate, fmt, opt) sc
Sound/Sc3/Server/Options.hs view
@@ -4,15 +4,15 @@ import Data.List {- base -} -- | (short-option, long-option, default-value)-type Sc3_Opt i = (Char,String,i)+type Sc3_Opt i = (Char, String, i) -- | Get value from option. sc3_opt_value :: Sc3_Opt i -> i-sc3_opt_value (_,_,v) = v+sc3_opt_value (_, _, v) = v --- | Default address string.-sc3_addr_def :: String-sc3_addr_def = "127.0.0.1"+-- | Default host name string.+sc3_host_name_def :: String+sc3_host_name_def = "127.0.0.1" -- | Default port number, either a 'u' or a 't' option is required. sc3_port_def :: Num i => i@@ -21,79 +21,93 @@ -- | Protocol is either Udp or Tcp. data Sc3_Protocol = Sc3_Udp | Sc3_Tcp +sc3_protocol_def :: Sc3_Protocol+sc3_protocol_def = Sc3_Tcp+ -- | Default port option. sc3_opt_port_def :: Num i => Sc3_Protocol -> Sc3_Opt i sc3_opt_port_def p = case p of- Sc3_Udp -> ('u',"udp-port-number",sc3_port_def)- Sc3_Tcp -> ('t',"tcp-port-number",sc3_port_def)+ Sc3_Udp -> ('u', "udp-port-number", sc3_port_def)+ Sc3_Tcp -> ('t', "tcp-port-number", sc3_port_def) --- | SC3 default options.+-- | Sc3 default options. sc3_opt_def :: Num i => Sc3_Protocol -> [Sc3_Opt i] sc3_opt_def p =- sc3_opt_port_def p :- [('a',"number-of-audio-bus-channels",1024)- ,('b',"number-of-sample-buffers",1024)- --,('B',"bind-to-address","127.0.0.1")- ,('c',"number-of-control-bus-channels",16384)- ,('D',"load-synthdefs?",1)- ,('d',"max-number-of-synth-defs",1024)- ,('i',"number-of-input-bus-channels",8)- ,('l',"max-logins",64)- ,('m',"real-time-memory-size",8192)- ,('n',"max-number-of-nodes",1024)- ,('o',"number-of-output-bus-channels",8)- ,('r',"number-of-random-seeds",64)- ,('R',"publish-to-rendezvous?",1)- ,('S',"hardware-sample-rate",0)- ,('V',"verbosity",0)- ,('w',"number-of-wire-buffers",64)- ,('z',"block-size",64)- ,('Z',"hardware-buffer-size",0)]+ sc3_opt_port_def p+ : [ ('a', "number-of-audio-bus-channels", 1024)+ , ('b', "number-of-sample-buffers", 1024)+ , -- ,('B',"bind-to-address","127.0.0.1")+ ('c', "number-of-control-bus-channels", 16384)+ , ('D', "load-synthdefs?", 1)+ , ('d', "max-number-of-synth-defs", 1024)+ , ('i', "number-of-input-bus-channels", 8)+ , ('l', "max-logins", 64)+ , ('m', "real-time-memory-size", 8192)+ , ('n', "max-number-of-nodes", 1024)+ , ('o', "number-of-output-bus-channels", 8)+ , ('r', "number-of-random-seeds", 64)+ , ('R', "publish-to-rendezvous?", 1)+ , ('S', "hardware-sample-rate", 0)+ , ('V', "verbosity", 0)+ , ('w', "number-of-wire-buffers", 64)+ , ('z', "block-size", 64)+ , ('Z', "hardware-buffer-size", 0)+ ] -- | SC3 default options for Udp. sc3_opt_def_udp :: Num i => [Sc3_Opt i] sc3_opt_def_udp = sc3_opt_def Sc3_Udp --- | Is option boolean, ie. 0=FALSE and 1=TRUE.------ > filter sc3_opt_bool sc3_opt_def_udp+{- | Is option boolean, ie. 0=False and 1=True.++>>> filter sc3_opt_bool sc3_opt_def_udp+[('D',"load-synthdefs?",1),('R',"publish-to-rendezvous?",1)]+-} sc3_opt_bool :: Sc3_Opt i -> Bool-sc3_opt_bool (_,s,_) = last s == '?'+sc3_opt_bool (_, s, _) = last s == '?' -- | Lookup option given either short or long name. sc3_opt_get :: [Sc3_Opt i] -> Either Char String -> Maybe i sc3_opt_get opt k = case k of- Left c -> fmap sc3_opt_value (find (\(o,_,_) -> o == c) opt)- Right s -> fmap sc3_opt_value (find (\(_,o,_) -> o == s) opt)+ Left c -> fmap sc3_opt_value (find (\(o, _, _) -> o == c) opt)+ Right s -> fmap sc3_opt_value (find (\(_, o, _) -> o == s) opt) --- | Set option given either short or long name.------ > sc3_opt_set sc3_opt_def_udp (Left 'w',256)-sc3_opt_set :: [Sc3_Opt i] -> (Either Char String,i) -> [Sc3_Opt i]-sc3_opt_set opt (k,v) =+{- | Set option given either short or long name.++>>> sc3_opt_get (sc3_opt_set sc3_opt_def_udp (Left 'w',256)) (Right "number-of-wire-buffers")+Just 256+-}+sc3_opt_set :: [Sc3_Opt i] -> (Either Char String, i) -> [Sc3_Opt i]+sc3_opt_set opt (k, v) = case k of- Left x -> map (\(c,s,y) -> if c == x then (c,s,v) else (c,s,y)) opt- Right x -> map (\(c,s,y) -> if s == x then (c,s,v) else (c,s,y)) opt+ Left x -> map (\(c, s, y) -> if c == x then (c, s, v) else (c, s, y)) opt+ Right x -> map (\(c, s, y) -> if s == x then (c, s, v) else (c, s, y)) opt --- | Apply set of edits to options.------ > sc3_opt_edit sc3_opt_def_udp [(Left 'w',256),(Left 'm',2 ^ 16)]-sc3_opt_edit :: [Sc3_Opt i] -> [(Either Char String,i)] -> [Sc3_Opt i]+{- | Apply set of edits to options.++>>> unwords (sc3_opt_arg (sc3_opt_edit sc3_opt_def_udp [(Left 'w',256),(Left 'm',2 ^ 16)]))+"-u 57110 -a 1024 -b 1024 -c 16384 -D 1 -d 1024 -i 8 -l 64 -m 65536 -n 1024 -o 8 -r 64 -R 1 -S 0 -V 0 -w 256 -z 64 -Z 0"+-}+sc3_opt_edit :: [Sc3_Opt i] -> [(Either Char String, i)] -> [Sc3_Opt i] sc3_opt_edit opt edt = case edt of [] -> opt- x:rst -> sc3_opt_edit (sc3_opt_set opt x) rst+ x : rst -> sc3_opt_edit (sc3_opt_set opt x) rst --- | Generate scsynth argument list.------ > unwords (sc3_opt_arg sc3_opt_def_udp)+{- | Generate scsynth argument list.++>>> unwords (sc3_opt_arg sc3_opt_def_udp)+"-u 57110 -a 1024 -b 1024 -c 16384 -D 1 -d 1024 -i 8 -l 64 -m 8192 -n 1024 -o 8 -r 64 -R 1 -S 0 -V 0 -w 64 -z 64 -Z 0"+-} sc3_opt_arg :: Show i => [Sc3_Opt i] -> [String]-sc3_opt_arg = concatMap (\(c,_,v) -> [['-',c],show v])+sc3_opt_arg = concatMap (\(c, _, v) -> [['-', c], show v]) --- | Generate arguments for 'System.Process.callProcess' or related functions.------ > sc3_opt_cmd sc3_opt_def_udp-sc3_opt_cmd :: Show i => [Sc3_Opt i] -> (FilePath,[String])-sc3_opt_cmd opt = ("scsynth",sc3_opt_arg opt)+{- | Generate arguments for 'System.Process.callProcess' or related functions.++>>> let o = sc3_opt_def_udp in sc3_opt_cmd o == ("scsynth", sc3_opt_arg o)+True+-}+sc3_opt_cmd :: Show i => [Sc3_Opt i] -> (FilePath, [String])+sc3_opt_cmd opt = ("scsynth", sc3_opt_arg opt)
Sound/Sc3/Server/Param.hs view
@@ -21,7 +21,9 @@ {- | Merge, require keys be unique. -> param_merge_uniq [("a",1),("b",2)] [("c",3),("d",4)] == [("a",1),("b",2),("c",3),("d",4)]+>>> param_merge_uniq [("a",1),("b",2)] [("c",3),("d",4)]+[("a",1.0),("b",2.0),("c",3.0),("d",4.0)]+ > param_merge_uniq [("a",1)] [("a",2)] -- error -} param_merge_uniq :: Param -> Param -> Param@@ -32,16 +34,18 @@ {- | Merge, right biased. -> param_merge_r [("a",1),("b",2)] [("c",3),("a",4)] == [("b",2),("c",3),("a",4)]+>>> param_merge_r [("a",1),("b",2)] [("c",3),("a",4)]+[("b",2.0),("c",3.0),("a",4.0)] -} param_merge_r :: Param -> Param -> Param param_merge_r p1 p2 =- let p3 = let k2 = map fst p2 in filter (\(x,_) -> x `notElem` k2) p1- in p3 ++ p2+ let p3 = let k2 = map fst p2 in filter (\(x, _) -> x `notElem` k2) p1+ in p3 ++ p2 {- | Right-fold (right-biased) of 'param_merge' -> param_merge_r_seq [[("a",1),("b",2)],[("c",3),("a",4)],[("b",5)]] == [("c",3),("a",4),("b",5)]+>>> param_merge_r_seq [[("a",1),("b",2)],[("c",3),("a",4)],[("b",5)]]+[("c",3.0),("a",4.0),("b",5.0)] -} param_merge_r_seq :: [Param] -> Param param_merge_r_seq = foldr1 param_merge_r@@ -52,21 +56,22 @@ {- | Given (param-separator,key-value-separator) parse paramter string. -> param_parse (';','=') "a=1;b=2" == [("a",1),("b",2)]+>>> param_parse (';','=') "a=1;b=2"+[("a",1.0),("b",2.0)] -}-param_parse :: (Char,Char) -> String -> Param-param_parse (c1,c2) str =- let f x = case splitOn [c2] x of- [lhs,rhs] -> (lhs,read rhs)- _ -> error ("param_parse: " ++ x)- in if null str then [] else map f (splitOn [c1] str)+param_parse :: (Char, Char) -> String -> Param+param_parse (c1, c2) str =+ let f x = case splitOn [c2] x of+ [lhs, rhs] -> (lhs, read rhs)+ _ -> error ("param_parse: " ++ x)+ in if null str then [] else map f (splitOn [c1] str) {- | Inverse of 'param_parse', /k/ is the precision to print values to. -> param_pp (';','=') 4 [("a",1),("b",2)] == "a=1.0;b=2.0"+>>> param_pp (';','=') 4 [("a",1),("b",2)]+"a=1.0;b=2.0" -}-param_pp :: (Char,Char) -> Int -> Param -> String-param_pp (c1,c2) k =- let f (lhs,rhs) = concat [lhs,[c2],double_pp k rhs]- in concat . intersperse [c1] . map f-+param_pp :: (Char, Char) -> Int -> Param -> String+param_pp (c1, c2) k =+ let f (lhs, rhs) = concat [lhs, [c2], double_pp k rhs]+ in concat . intersperse [c1] . map f
Sound/Sc3/Server/Recorder.hs view
@@ -15,76 +15,96 @@ import Sound.Sc3.Server.Synthdef -- | Parameters for recording scsynth.-data SC3_Recorder =- SC3_Recorder {rec_sftype :: SoundFileFormat -- ^ Sound file format.- ,rec_coding :: SampleFormat -- ^ Sample format.- ,rec_fname :: FilePath -- ^ File name.- ,rec_nc :: Int -- ^ Number of channels.- ,rec_bus :: Int -- ^ Bus number.- ,rec_buf_id :: Int -- ^ ID of buffer to allocate.- ,rec_buf_frames :: Int -- ^ Number of frames at buffer.- ,rec_node_id :: Int -- ^ ID to allocate for node.- ,rec_group_id :: Int -- ^ Group to allocate node within.- ,rec_dur :: Maybe Time -- ^ Recoring duration if fixed.- }+data SC3_Recorder = SC3_Recorder+ { rec_sftype :: SoundFileFormat+ -- ^ Sound file format.+ , rec_coding :: SampleFormat+ -- ^ Sample format.+ , rec_fname :: FilePath+ -- ^ File name.+ , rec_nc :: Int+ -- ^ Number of channels.+ , rec_bus :: Int+ -- ^ Bus number.+ , rec_buf_id :: Int+ -- ^ ID of buffer to allocate.+ , rec_buf_frames :: Int+ -- ^ Number of frames at buffer.+ , rec_node_id :: Int+ -- ^ ID to allocate for node.+ , rec_group_id :: Int+ -- ^ Group to allocate node within.+ , rec_dur :: Maybe Time+ -- ^ Recoring duration if fixed.+ } -- | Default recording structure. default_SC3_Recorder :: SC3_Recorder default_SC3_Recorder =- SC3_Recorder {rec_sftype = Wave- ,rec_coding = PcmFloat- ,rec_fname = "/tmp/sc3-recorder.wav"- ,rec_nc = 2- ,rec_bus = 0- ,rec_buf_id = 10- ,rec_buf_frames = 65536- ,rec_node_id = 2001- ,rec_group_id = 0- ,rec_dur = Just 60}+ SC3_Recorder+ { rec_sftype = Wave+ , rec_coding = PcmFloat+ , rec_fname = "/tmp/sc3-recorder.wav"+ , rec_nc = 2+ , rec_bus = 0+ , rec_buf_id = 10+ , rec_buf_frames = 65536+ , rec_node_id = 2001+ , rec_group_id = 0+ , rec_dur = Just 60+ } -- | The name indicates the number of channels. rec_synthdef_nm :: Int -> String rec_synthdef_nm nc = "sc3-recorder-" ++ show nc --- | Generate 'Synthdef' with required number of channels.------ > Sound.Sc3.Ugen.Dot.draw (rec_synthdef 2)+{- | Generate 'Synthdef' with required number of channels.++> Sound.Sc3.Ugen.Dot.draw (rec_synthdef 2)+-} rec_synthdef :: Int -> Synthdef rec_synthdef nc =- let bufnum = control kr "bufnum" 0- bus = control kr "bus" 0- in synthdef (rec_synthdef_nm nc) (diskOut bufnum (in' nc ar bus))+ let bufnum = control kr "bufnum" 0+ bus = control kr "bus" 0+ in synthdef (rec_synthdef_nm nc) (diskOut bufnum (in' nc ar bus)) --- | Asyncronous initialisation 'Message's ('d_recv', 'b_alloc' and 'b_write').------ > withSc3 (sendBundle (bundle immediately (rec_init_m def)))+{- | Asyncronous initialisation 'Message's ('d_recv', 'b_alloc' and 'b_write').++> withSc3 (sendBundle (bundle immediately (rec_init_m def)))+-} rec_init_m :: SC3_Recorder -> [Message] rec_init_m r =- let buf = rec_buf_id r- in [d_recv (rec_synthdef (rec_nc r))- ,b_alloc buf (rec_buf_frames r) (rec_nc r)- ,b_write buf (rec_fname r) (rec_sftype r) (rec_coding r) (-1) 0 True]+ let buf = rec_buf_id r+ in [ d_recv (rec_synthdef (rec_nc r))+ , b_alloc buf (rec_buf_frames r) (rec_nc r)+ , b_write buf (rec_fname r) (rec_sftype r) (rec_coding r) (-1) 0 True+ ] --- | Begin recording 'Message' ('s_new').------ > withSc3 (sendMessage (rec_begin_m def))+{- | Begin recording 'Message' ('s_new').++> withSc3 (sendMessage (rec_begin_m def))+-} rec_begin_m :: SC3_Recorder -> Message rec_begin_m r =- s_new (rec_synthdef_nm (rec_nc r))- (rec_node_id r)- AddToTail- (rec_group_id r)- [("bus",fromIntegral (rec_bus r))- ,("bufnum",fromIntegral (rec_buf_id r))]+ s_new+ (rec_synthdef_nm (rec_nc r))+ (rec_node_id r)+ AddToTail+ (rec_group_id r)+ [ ("bus", fromIntegral (rec_bus r))+ , ("bufnum", fromIntegral (rec_buf_id r))+ ] --- | End recording 'Message's ('n_free', 'b_close' and 'b_free').------ > withSc3 (sendBundle (bundle immediately (rec_end_m def)))+{- | End recording 'Message's ('n_free', 'b_close' and 'b_free').++> withSc3 (sendBundle (bundle immediately (rec_end_m def)))+-} rec_end_m :: SC3_Recorder -> [Message] rec_end_m r =- [n_free [rec_node_id r]- ,b_close (rec_buf_id r)- ,b_free (rec_buf_id r)]+ [ n_free [rec_node_id r]+ , b_close (rec_buf_id r)+ , b_free (rec_buf_id r)+ ] {- | 'Nrt' score for recorder, if 'rec_dur' is given schedule 'rec_end_m'. @@ -93,11 +113,10 @@ > audition (out 0 (sinOsc ar (mce2 440 441) 0 * 0.1)) > let rc = default_SC3_Recorder {rec_dur = Just 5.0} > nrt_audition (sc3_recorder rc)- -} sc3_recorder :: SC3_Recorder -> Nrt sc3_recorder r =- let b0 = bundle 0 (rec_init_m r ++ [rec_begin_m r])- in case rec_dur r of- Nothing -> Nrt [b0]- Just d -> Nrt [b0,bundle d (rec_end_m r)]+ let b0 = bundle 0 (rec_init_m r ++ [rec_begin_m r])+ in case rec_dur r of+ Nothing -> Nrt [b0]+ Just d -> Nrt [b0, bundle d (rec_end_m r)]
Sound/Sc3/Server/Scsynth.hs view
@@ -6,7 +6,6 @@ - allow for Scsynth to be at a non-standard address - allow for multiple Scsynth instances- -} module Sound.Sc3.Server.Scsynth where @@ -41,8 +40,8 @@ scsynthOnReset :: Scsynth -> [Osc.Message] -> IO () scsynthOnReset (Scsynth mRef) messages = if not (null messages)- then modifyIORef' mRef (++ messages)- else return ()+ then modifyIORef' mRef (++ messages)+ else return () -- | reset scsynth, send all stored onReset messages, clear the onReset message store. scsynthReset :: Scsynth -> IO ()
Sound/Sc3/Server/Status.hs view
@@ -3,7 +3,6 @@ \/status messages receive \/status.reply messages. \/g_queryTree messages recieve \/g_queryTree.reply messages.- -} module Sound.Sc3.Server.Status where @@ -25,146 +24,157 @@ -- | Get /n/th field of /status.reply message as 'Floating'. extractStatusField :: Floating n => Int -> [Datum] -> n extractStatusField n =- fromMaybe (error "extractStatusField")+ fromMaybe (error "extractStatusField") . datum_floating . flip (Safe.atNote "extractStatusField") n -- | Names of /status.reply fields sent in reply to /status request. statusFields :: [String] statusFields =- ["Unused "- ,"# Ugens "- ,"# Synths "- ,"# Groups "- ,"# Synthdefs "- ,"% CPU (Average) "- ,"% CPU (Peak) "- ,"Sample Rate (Nominal) "- ,"Sample Rate (Actual) "]+ [ "Unused "+ , "# Ugens "+ , "# Synths "+ , "# Groups "+ , "# Synthdefs "+ , "% CPU (Average) "+ , "% CPU (Peak) "+ , "Sample Rate (Nominal) "+ , "Sample Rate (Actual) "+ ] -- | Status pretty printer. statusFormat :: [Datum] -> [String] statusFormat d =- let s = "***** SuperCollider Server Status *****"- in s : zipWith (++) (tail statusFields) (map (showDatum (Just 5)) (tail d))+ let s = "***** SuperCollider Server Status *****"+ t = Safe.tailNote "statusFormat"+ in s : zipWith (++) (t statusFields) (map (showDatum (Just 5)) (t d)) --- | Concise pretty printer, one line, omits PEAK-CPU and NOMINAL-SR.+-- | Concise pretty printer, one line, omits Peak-Cpu and Nominal-Sr. status_format_concise :: [Datum] -> String status_format_concise d = case d of- [Int32 _,Int32 ugn,Int32 grp,Int32 syn,Int32 ins,Float cpu1,Float _cpu2,Double _sr1,Double sr2] ->+ [Int32 _, Int32 ugn, Int32 grp, Int32 syn, Int32 ins, Float cpu1, Float _cpu2, Double _sr1, Double sr2] -> printf- "UGN=%-5d GRP=%-5d SYN=%-5d INS=%-5d CPU=%-5.1f SR=%-7.1f"- ugn grp syn ins cpu1 sr2+ "UGN=%-5d GRP=%-5d SYN=%-5d INS=%-5d CPU=%-5.1f SR=%-7.1f"+ ugn+ grp+ syn+ ins+ cpu1+ sr2 _ -> error "status_format_concise?" -- * Query Group -- | Name or index and value or bus mapping.-type Query_Ctl = (Either String Int,Either Double Int)+type Query_Ctl = (Either String Int, Either Double Int) -- | Nodes are either groups of synths.-data Query_Node = Query_Group Group_Id [Query_Node]- | Query_Synth Synth_Id String (Maybe [Query_Ctl])- deriving (Eq,Show)+data Query_Node+ = Query_Group Group_Id [Query_Node]+ | Query_Synth Synth_Id String (Maybe [Query_Ctl])+ deriving (Eq, Show) -- | Pretty-print 'Query_Ctl' query_ctl_pp :: Query_Ctl -> String-query_ctl_pp (p,q) = either id show p ++ ":" ++ either show show q+query_ctl_pp (p, q) = either id show p ++ ":" ++ either show show q -- | Pretty-print 'Query_Node' query_node_pp :: Query_Node -> String query_node_pp n =- case n of- Query_Group k _ -> show k- Query_Synth k nm c ->- let c' = unwords (maybe [] (map query_ctl_pp) c)- in show (k,nm,c')+ case n of+ Query_Group k _ -> show k+ Query_Synth k nm c ->+ let c' = unwords (maybe [] (map query_ctl_pp) c)+ in show (k, nm, c') --- | Control (parameter) data may be given as names or indices and as--- values or bus mappings.------ > queryTree_ctl (string "freq",float 440) == (Left "freq",Left 440.0)--- > queryTree_ctl (int32 1,string "c0") == (Right 1,Right 0)-queryTree_ctl :: (Datum,Datum) -> Query_Ctl-queryTree_ctl (p,q) =- let err msg val = error (show ("queryTree_ctl",msg,val))- f d = case d of- AsciiString nm -> Left (C.unpack nm)- Int32 ix -> Right (fromIntegral ix)- _ -> err "string/int32" d- g d = case d of- Float k -> Left (realToFrac k)- AsciiString b -> case C.unpack b of- 'c' : n -> Right (read n)- _ -> err "c:_" d- _ -> err "float/string" d- in (f p,g q)+{- | Control (parameter) data may be given as names or indices and as+values or bus mappings. +> queryTree_ctl (string "freq",float 440) == (Left "freq",Left 440.0)+> queryTree_ctl (int32 1,string "c0") == (Right 1,Right 0)+-}+queryTree_ctl :: (Datum, Datum) -> Query_Ctl+queryTree_ctl (p, q) =+ let err msg val = error (show ("queryTree_ctl", msg, val))+ f d = case d of+ AsciiString nm -> Left (C.unpack nm)+ Int32 ix -> Right (fromIntegral ix)+ _ -> err "string/int32" d+ g d = case d of+ Float k -> Left (realToFrac k)+ AsciiString b -> case C.unpack b of+ 'c' : n -> Right (read n)+ _ -> err "c:_" d+ _ -> err "float/string" d+ in (f p, g q)+ {- | If /rc/ is 'True' then 'Query_Ctl' data is expected (ie. flag was set at @\/g_queryTree@). /k/ is the synth-id, and /nm/ the name. > let d = [int32 1,string "freq",float 440] > in queryTree_synth True 1000 "saw" d- -}-queryTree_synth :: Bool -> Synth_Id -> String -> [Datum] -> (Query_Node,[Datum])+queryTree_synth :: Bool -> Synth_Id -> String -> [Datum] -> (Query_Node, [Datum]) queryTree_synth rc k nm d =- let pairs l = case l of- e0:e1:l' -> (e0,e1) : pairs l'- _ -> []- f r = case r of- Int32 n : r' -> let (p,r'') = genericSplitAt (n * 2) r'- in (map queryTree_ctl (pairs p),r'')- _ -> error "queryTree_synth"- in if rc- then let (p,d') = f d- in (Query_Synth k nm (Just p),d')- else (Query_Synth k nm Nothing,d)+ let pairs l = case l of+ e0 : e1 : l' -> (e0, e1) : pairs l'+ _ -> []+ f r = case r of+ Int32 n : r' ->+ let (p, r'') = genericSplitAt (n * 2) r'+ in (map queryTree_ctl (pairs p), r'')+ _ -> error "queryTree_synth"+ in if rc+ then+ let (p, d') = f d+ in (Query_Synth k nm (Just p), d')+ else (Query_Synth k nm Nothing, d) -- | Generate 'Query_Node' for indicated 'Group_Id'.-queryTree_group :: Bool -> Group_Id -> Int -> [Datum] -> (Query_Node,[Datum])+queryTree_group :: Bool -> Group_Id -> Int -> [Datum] -> (Query_Node, [Datum]) queryTree_group rc gid nc =- let recur n r d =- if n == 0- then (Query_Group gid (reverse r),d)- else let (c,d') = queryTree_child rc d- in recur (n - 1) (c : r) d'- in recur nc []+ let recur n r d =+ if n == 0+ then (Query_Group gid (reverse r), d)+ else+ let (c, d') = queryTree_child rc d+ in recur (n - 1) (c : r) d'+ in recur nc [] -- | Either 'queryTree_synth' or 'queryTree_group'.-queryTree_child :: Bool -> [Datum] -> (Query_Node,[Datum])+queryTree_child :: Bool -> [Datum] -> (Query_Node, [Datum]) queryTree_child rc d =- case d of- Int32 nid : Int32 (-1) : AsciiString nm : d' ->- queryTree_synth rc (fromIntegral nid) (C.unpack nm) d'- Int32 gid : Int32 nc : d' ->- queryTree_group rc (fromIntegral gid) (fromIntegral nc) d'- _ -> error "queryTree_child"+ case d of+ Int32 nid : Int32 (-1) : AsciiString nm : d' ->+ queryTree_synth rc (fromIntegral nid) (C.unpack nm) d'+ Int32 gid : Int32 nc : d' ->+ queryTree_group rc (fromIntegral gid) (fromIntegral nc) d'+ _ -> error "queryTree_child" -- | Parse result of ' g_queryTree '. queryTree :: [Datum] -> Query_Node queryTree d =- case d of- Int32 rc : Int32 gid : Int32 nc : d' ->- let rc' = rc /= 0- gid' = fromIntegral gid- nc' = fromIntegral nc- in case queryTree_group rc' gid' nc' d' of- (r,[]) -> r- _ -> error "queryTree"- _ -> error "queryTree"+ case d of+ Int32 rc : Int32 gid : Int32 nc : d' ->+ let rc' = rc /= 0+ gid' = fromIntegral gid+ nc' = fromIntegral nc+ in case queryTree_group rc' gid' nc' d' of+ (r, []) -> r+ _ -> error "queryTree"+ _ -> error "queryTree" -- | Extact sequence of 'Group_Id's from 'Query_Node'. queryNode_to_group_seq :: Query_Node -> [Group_Id] queryNode_to_group_seq nd =- case nd of- Query_Group k ch -> k : concatMap queryNode_to_group_seq ch- Query_Synth _ _ _ -> []+ case nd of+ Query_Group k ch -> k : concatMap queryNode_to_group_seq ch+ Query_Synth _ _ _ -> [] -- | Transform 'Query_Node' to 'T.Tree'. queryTree_rt :: Query_Node -> T.Tree Query_Node queryTree_rt n =- case n of- Query_Synth _ _ _ -> T.Node n []- Query_Group _ c -> T.Node n (map queryTree_rt c)+ case n of+ Query_Synth _ _ _ -> T.Node n []+ Query_Group _ c -> T.Node n (map queryTree_rt c)
Sound/Sc3/Server/Synthdef.hs view
@@ -13,27 +13,27 @@ import qualified Sound.Sc3.Server.Param as Param {- hsc3 -} -- | A named unit generator graph.-data Synthdef =- Synthdef- {synthdefName :: String- ,synthdefUgen :: Ugen.Ugen}- deriving (Eq,Show)+data Synthdef = Synthdef+ { synthdefName :: String+ , synthdefUgen :: Ugen.Ugen+ }+ deriving (Eq, Show) -- | Alias for 'Synthdef'. synthdef :: String -> Ugen.Ugen -> Synthdef synthdef = Synthdef -{- | The SC3 /default/ instrument 'Synthdef', see 'default_ugen_graph'.+{- | The Sc3 /default/ instrument 'Synthdef', see 'default_ugen_graph'. -> import Sound.Osc {- hosc -}-> import Sound.Sc3 {- hsc3 -}+> import Sound.Osc {\- hosc -\}+> import Sound.Sc3 {\- hsc3 -\} > withSc3 (sendMessage (d_recv defaultSynthdef)) > audition defaultSynthdef -} defaultSynthdef :: Synthdef defaultSynthdef = synthdef "default" Help.Graph.default_ugen_graph -{- | The SC3 /default/ sample (buffer) playback instrument 'Synthdef',+{- | The Sc3 /default/ sample (buffer) playback instrument 'Synthdef', see 'default_sampler_ugen_graph'. > withSc3 (sendMessage (d_recv (defaultSampler False)))@@ -41,8 +41,8 @@ -} defaultSampler :: Bool -> Synthdef defaultSampler use_gate =- let nm = "default-sampler-" ++ if use_gate then "gate" else "fixed"- in synthdef nm (Help.Graph.default_sampler_ugen_graph use_gate)+ let nm = "default-sampler-" ++ if use_gate then "gate" else "fixed"+ in synthdef nm (Help.Graph.default_sampler_ugen_graph use_gate) -- | 'ugen_to_graph' of 'synthdefUgen'. synthdefGraph :: Synthdef -> Graph.U_Graph@@ -50,13 +50,14 @@ {- | Parameter names at 'Synthdef'. -> synthdefParam defaultSynthdef == [("amp",0.1),("pan",0),("gate",1),("freq",440),("out",0)]+>>> synthdefParam defaultSynthdef+[("amp",0.1),("pan",0.0),("gate",1.0),("freq",440.0),("out",0.0)] -} synthdefParam :: Synthdef -> Param.Param synthdefParam =- map (\n -> (Graph.u_node_k_name n, Graph.u_node_k_default n)) .- Graph.ug_controls .- synthdefGraph+ map (\n -> (Graph.u_node_k_name n, Graph.u_node_k_default n))+ . Graph.ug_controls+ . synthdefGraph -- | 'graph_to_graphdef' at 'Synthdef'. synthdef_to_graphdef :: Synthdef -> Graphdef.Graphdef@@ -74,8 +75,9 @@ synthdefWrite :: FilePath -> Synthdef -> IO () synthdefWrite fn = Graphdef.Binary.graphdefWrite fn . synthdef_to_graphdef --- | Write 'Synthdef' to indicated directory. The filename is the--- 'synthdefName' with the appropriate extension (@scsyndef@).+{- | Write 'Synthdef' to indicated directory. The filename is the+'synthdefName' with the appropriate extension (@scsyndef@).+-} synthdefWrite_dir :: FilePath -> Synthdef -> IO () synthdefWrite_dir dir = Graphdef.Binary.graphdefWrite_dir dir . synthdef_to_graphdef
Sound/Sc3/Server/Transport/Fd.hs view
@@ -1,24 +1,28 @@--- | /Fd/ variant of interaction with the scsynth server.------ This duplicates functions at 'Sound.Sc3.Server.Transport.Monad' and--- at some point at least part of the duplication will be removed.+{- | /Fd/ variant of interaction with the scsynth server.++This duplicates functions at 'Sound.Sc3.Server.Transport.Monad' and+at some point at least part of the duplication will be removed.+-} module Sound.Sc3.Server.Transport.Fd where import Control.Monad {- base -}-import qualified Data.ByteString.Lazy as L {- bytestring -} import Data.List {- base -}-import qualified Data.List.Split as Split {- split -}+import Data.Maybe {- base -}+import System.Environment {- base -} import System.FilePath {- filepath -} +import qualified Data.ByteString.Lazy as L {- bytestring -}+import qualified Data.List.Split as Split {- split -}+import qualified Safe {- safe -}+ import Sound.Osc.Fd {- hosc -} import Sound.Sc3.Server.Command import Sound.Sc3.Server.Enum import qualified Sound.Sc3.Server.Graphdef as Graphdef import qualified Sound.Sc3.Server.Graphdef.Binary as Graphdef-import Sound.Sc3.Server.Nrt-import Sound.Sc3.Server.Options-import Sound.Sc3.Server.Status+import qualified Sound.Sc3.Server.Nrt as Nrt+import qualified Sound.Sc3.Server.Status as Status import Sound.Sc3.Server.Synthdef import Sound.Sc3.Ugen.Ugen @@ -35,13 +39,26 @@ -- | Variant that timestamps synchronous messages. maybe_async_at :: (Transport t) => t -> Time -> Message -> IO () maybe_async_at fd t m =- if isAsync m+ if isAsync m then void (async fd m) else sendBundle fd (bundle t [m]) +{- | Read ScTransport, ScHostname and ScPort environment variables.+Default values are: Tcp, 127.0.0.1 and 57110.+-}+defaultSc3OscSocketAddress :: IO OscSocketAddress+defaultSc3OscSocketAddress = do+ let f key defaultValue = fmap (fromMaybe defaultValue) (lookupEnv key)+ protocol <- f "ScTransport" "Tcp"+ hostname <- f "ScHostname" "127.0.0.1"+ port <- f "ScPort" "57110"+ return (read protocol, hostname, read port)+ -- | Bracket @Sc3@ communication.-withSc3 :: (Udp -> IO a) -> IO a-withSc3 = withTransport (openUdp "127.0.0.1" sc3_port_def)+withSc3 :: (OscSocket -> IO a) -> IO a+withSc3 process = do+ address <- defaultSc3OscSocketAddress+ withTransport (openOscSocket address) process -- * Server control @@ -52,8 +69,8 @@ -- | Free all nodes ('g_freeAll') at and re-create groups @1@ and @2@. reset :: Transport t => t -> IO () reset fd = do- sendMessage fd (g_freeAll [1,2])- sendMessage fd (g_new [(1,AddToTail,0),(2,AddToTail,0)])+ sendMessage fd (g_freeAll [1, 2])+ sendMessage fd (g_new [(1, AddToTail, 0), (2, AddToTail, 0)]) -- | Send 'd_recv' and 's_new' messages to scsynth. playGraphdef :: Transport t => Int -> t -> Graphdef.Graphdef -> IO ()@@ -76,41 +93,43 @@ -- * Non-real time --- | Wait ('pauseThreadUntil') until bundle is due to be sent relative--- to initial 'Time', then send each message, asynchronously if--- required.-run_bundle :: Transport t => t -> Time -> Bundle -> IO ()+{- | Wait ('pauseThreadUntil') until bundle is due to be sent relative+to initial 'Time', then send each message, asynchronously if+required.+-}+run_bundle :: Transport t => t -> Time -> BundleOf Message -> IO () run_bundle fd t0 b = do let t = t0 + bundleTime b latency = 0.1 pauseThreadUntil (t - latency) mapM_ (maybe_async_at fd t) (bundleMessages b) --- | Perform an 'Nrt' score (as would be rendered by 'writeNrt'). In--- particular note that all timestamps /must/ be in 'NTPr' form.-nrt_play :: Transport t => t -> Nrt -> IO ()-nrt_play fd sc = time >>= \t0 -> mapM_ (run_bundle fd t0) (nrt_bundles sc)+{- | Perform an 'Nrt' score (as would be rendered by 'writeNrt'). In+particular note that all timestamps /must/ be in 'NTPr' form.+-}+nrt_play :: Transport t => t -> Nrt.Nrt -> IO ()+nrt_play fd sc = time >>= \t0 -> mapM_ (run_bundle fd t0) (Nrt.nrt_bundles sc) -- | 'withSc3' of 'nrt_play'-nrt_audition :: Nrt -> IO ()+nrt_audition :: Nrt.Nrt -> IO () nrt_audition sc = withSc3 (`nrt_play` sc) -- * Audible -- | Class for values that can be encoded and sent to @scsynth@ for audition. class Audible e where- play_id :: Transport t => Int -> t -> e -> IO ()- play :: Transport t => t -> e -> IO ()- play = play_id (-1)+ play_id :: Transport t => Int -> t -> e -> IO ()+ play :: Transport t => t -> e -> IO ()+ play = play_id (-1) instance Audible Graphdef.Graphdef where- play_id = playGraphdef+ play_id = playGraphdef instance Audible Synthdef where- play_id = playSynthdef+ play_id = playSynthdef instance Audible Ugen where- play_id = playUgen+ play_id = playUgen -- | 'withSc3' of 'play_id' audition_id :: Audible e => Int -> e -> IO ()@@ -122,8 +141,9 @@ -- * Notifications --- | Turn on notifications, run /f/, turn off notifications, return--- result.+{- | Turn on notifications, run /f/, turn off notifications, return+result.+-} withNotifications :: Transport t => t -> (t -> IO a) -> IO a withNotifications fd f = do _ <- async fd (notify True)@@ -133,21 +153,23 @@ -- * Buffer --- | Variant of 'b_getn1' that waits for return message and unpacks it.------ > withSc3 (\fd -> b_getn1_data fd 0 (0,5))-b_getn1_data :: Transport t => t -> Int -> (Int,Int) -> IO [Double]+{- | Variant of 'b_getn1' that waits for return message and unpacks it.++> withSc3 (\fd -> b_getn1_data fd 0 (0,5))+-}+b_getn1_data :: Transport t => t -> Int -> (Int, Int) -> IO [Double] b_getn1_data fd b s = do- let f m = let (_,_,_,r) = unpack_b_setn_err m in r+ let f m = let (_, _, _, r) = unpack_b_setn_err m in r sendMessage fd (b_getn1 b s) fmap f (waitReply fd "/b_setn") --- | Variant of 'b_getn1_data' that segments individual 'b_getn'--- messages to /n/ elements.------ > withSc3 (\fd -> b_getn1_data_segment fd 1 0 (0,5))-b_getn1_data_segment :: Transport t => t -> Int -> Int -> (Int,Int) -> IO [Double]-b_getn1_data_segment fd n b (i,j) = do+{- | Variant of 'b_getn1_data' that segments individual 'b_getn'+messages to /n/ elements.++> withSc3 (\fd -> b_getn1_data_segment fd 1 0 (0,5))+-}+b_getn1_data_segment :: Transport t => t -> Int -> Int -> (Int, Int) -> IO [Double]+b_getn1_data_segment fd n b (i, j) = do let ix = b_indices n j i d <- mapM (b_getn1_data fd b) ix return (concat d)@@ -155,30 +177,31 @@ -- | Variant of 'b_getn1_data_segment' that gets the entire buffer. b_fetch :: Transport t => t -> Int -> Int -> IO [[Double]] b_fetch fd n b = do- let f m = let (_,nf,nc,_) = unpack_b_info_err m- ix = (0,nf * nc)- deinterleave = transpose . Split.chunksOf nc- in fmap deinterleave (b_getn1_data_segment fd n b ix)+ let f m =+ let (_, nf, nc, _) = unpack_b_info_err m+ ix = (0, nf * nc)+ deinterleave = transpose . Split.chunksOf nc+ in fmap deinterleave (b_getn1_data_segment fd n b ix) sendMessage fd (b_query1 b) waitReply fd "/b_info" >>= f -- | 'head' of 'b_fetch'. b_fetch1 :: Transport t => t -> Int -> Int -> IO [Double]-b_fetch1 fd n b = fmap head (b_fetch fd n b)+b_fetch1 fd n b = fmap (Safe.headNote "b_fetch1") (b_fetch fd n b) -- * Status -- | Collect server status information. serverStatus :: Transport t => t -> IO [String]-serverStatus = fmap statusFormat . serverStatusData+serverStatus = fmap Status.statusFormat . serverStatusData -- | Read nominal sample rate of server. serverSampleRateNominal :: Transport t => t -> IO Double-serverSampleRateNominal = fmap (extractStatusField 7) . serverStatusData+serverSampleRateNominal = fmap (Status.extractStatusField 7) . serverStatusData -- | Read actual sample rate of server. serverSampleRateActual :: Transport t => t -> IO Double-serverSampleRateActual = fmap (extractStatusField 8) . serverStatusData+serverSampleRateActual = fmap (Status.extractStatusField 8) . serverStatusData -- | Retrieve status data from server. serverStatusData :: Transport t => t -> IO [Datum]
Sound/Sc3/Server/Transport/Monad.hs view
@@ -4,6 +4,7 @@ import Control.Monad {- base -} import Data.List {- base -} import Data.Maybe {- base -}+ import System.Directory {- directory -} import System.FilePath {- filepath -} @@ -15,13 +16,13 @@ import Sound.Osc {- hosc -} import qualified Sound.Osc.Time.Timeout {- hosc -} +import qualified Sound.Sc3.Common.Base.System as System import qualified Sound.Sc3.Server.Command as Command import qualified Sound.Sc3.Server.Command.Generic as Generic import qualified Sound.Sc3.Server.Enum as Enum import qualified Sound.Sc3.Server.Graphdef as Graphdef import qualified Sound.Sc3.Server.Graphdef.Binary as Graphdef import qualified Sound.Sc3.Server.Nrt as Nrt-import qualified Sound.Sc3.Server.Options as Options import qualified Sound.Sc3.Server.Status as Status import qualified Sound.Sc3.Server.Synthdef as Synthdef import qualified Sound.Sc3.Ugen.Bindings.Composite as Composite@@ -50,52 +51,79 @@ -- | Variant that timestamps synchronous messages. maybe_async_at :: DuplexOsc m => Time -> Message -> m () maybe_async_at t m =- if Command.isAsync m+ if Command.isAsync m then async_ m else sendBundle (bundle t [m]) --- | Hostname and port number.-type Sc3_Address = (String, Int)+{- | Hostname and port number.+By default Tcp, 127.0.0.1 and 57110.+-}+type Sc3_Address = OscSocketAddress --- | Local host (ie. @127.0.0.1@) at port 'sc3_port_def'-sc3_default_udp :: Sc3_Address-sc3_default_udp = (Options.sc3_addr_def,Options.sc3_port_def)+{- | Sc3 default address. --- | Maximum packet size, in bytes, that can be sent over Udp.--- However, see also <https://tools.ietf.org/html/rfc2675>+>>> sc3_default_address+(Tcp,"127.0.0.1",57110)+-}+sc3_default_address :: Sc3_Address+sc3_default_address = (Tcp, "127.0.0.1", 57110)++{- | Lookup ScSynth address at ScHostname and ScPort.+If either is no set default values are used.++>>> import System.Environment+>>> setEnv "ScHostname" "192.168.1.53"+>>> sc3_env_or_default_address+(Udp,"192.168.1.53",57110)+-}+sc3_env_or_default_address :: IO Sc3_Address+sc3_env_or_default_address = do+ protocol <- System.lookup_env_default "ScProtocol" "Tcp"+ hostname <- System.lookup_env_default "ScHostname" "127.0.0.1"+ port <- System.lookup_env_default "ScPort" "57110"+ return (read protocol, hostname, read port)++{- | Maximum packet size, in bytes, that can be sent over Udp.+However, see also <https://tools.ietf.org/html/rfc2675>.+Tcp is now the default transport mechanism for Hsc3.+-} sc3_udp_limit :: Num n => n sc3_udp_limit = 65507 -- | Bracket @Sc3@ communication at indicated host and port.-withSc3At :: Sc3_Address -> Connection Udp a -> IO a-withSc3At (h,p) = withTransport (openUdp h p)+withSc3At :: Sc3_Address -> Connection OscSocket a -> IO a+withSc3At address = withTransport (openOscSocket address) --- | Bracket @Sc3@ communication, ie. 'withSc3At' 'sc3_default_udp'.------ > import Sound.Sc3.Server.Command------ > withSc3 (sendMessage status >> waitReply "/status.reply")-withSc3 :: Connection Udp a -> IO a-withSc3 = withSc3At sc3_default_udp+{- | Bracket @Sc3@ communication, ie. 'withSc3At' 'sc3_env_or_default_address'. +> import Sound.Sc3.Server.Command++> withSc3 (sendMessage status >> waitReply "/status.reply")+-}+withSc3 :: Connection OscSocket a -> IO a+withSc3 f = do+ addr <- sc3_env_or_default_address+ withSc3At addr f+ -- | 'void' of 'withSc3'.-withSc3_ :: Connection Udp a -> IO ()+withSc3_ :: Connection OscSocket a -> IO () withSc3_ = void . withSc3 -- | 'timeout_r' of 'withSc3'-withSc3_tm :: Double -> Connection Udp a -> IO (Maybe a)+withSc3_tm :: Double -> Connection OscSocket a -> IO (Maybe a) withSc3_tm tm = Sound.Osc.Time.Timeout.timeout_r tm . withSc3 --- | Run /f/ at /k/ scsynth servers with sequential port numbers starting at 'Options.sc3_port_def'.------ > withSc3AtSeq sc3_default_udp 2 (sendMessage status >> waitReply "/status.reply")-withSc3AtSeq :: Sc3_Address -> Int -> Connection Udp a -> IO [a]-withSc3AtSeq (h,p) k f = do- let mk_udp i = openUdp h (p + i)- mapM (\i -> withTransport (mk_udp i) f) [0 .. k - 1]+{- | Run /f/ at /k/ scsynth servers with sequential port numbers starting at 'Options.sc3_port_def'. +> withSc3AtSeq sc3_default_address 2 (sendMessage status >> waitReply "/status.reply")+-}+withSc3AtSeq :: Sc3_Address -> Int -> Connection OscSocket a -> IO [a]+withSc3AtSeq (protocol, hostname, port) k f = do+ let mk_socket i = openOscSocket (protocol, hostname, port + i)+ mapM (\i -> withTransport (mk_socket i) f) [0 .. k - 1]+ -- | 'void' of 'withSc3AtSeq'.-withSc3AtSeq_ :: Sc3_Address -> Int -> Connection Udp a -> IO ()+withSc3AtSeq_ :: Sc3_Address -> Int -> Connection OscSocket a -> IO () withSc3AtSeq_ loc k = void . withSc3AtSeq loc k -- * Server control@@ -109,23 +137,26 @@ -- | Runs 'clearSched' and then frees and re-creates groups @1@ and @2@. reset :: SendOsc m => m () reset =- let m = [Command.clearSched- ,Command.n_free [1,2]- ,Command.g_new [(1,Enum.AddToHead,0),(2,Enum.AddToTail,0)]]- in sendBundle (bundle immediately m)+ let m =+ [ Command.clearSched+ , Command.n_free [1, 2]+ , Command.g_new [(1, Enum.AddToHead, 0), (2, Enum.AddToTail, 0)]+ ]+ in sendBundle (bundle immediately m) -- | (node-id,add-action,group-id,parameters)-type Play_Opt = (Command.Node_Id,Enum.AddAction,Command.Group_Id,[(String,Double)])+type Play_Opt = (Command.Node_Id, Enum.AddAction, Command.Group_Id, [(String, Double)]) -- | Make 's_new' message to play 'Graphdef.Graphdef'. play_graphdef_msg :: Play_Opt -> Graphdef.Graphdef -> Message-play_graphdef_msg (nid,act,gid,param) g =- let nm = ascii_to_string (Graphdef.graphdef_name g)- in Command.s_new nm nid act gid param+play_graphdef_msg (nid, act, gid, param) g =+ let nm = ascii_to_string (Graphdef.graphdef_name g)+ in Command.s_new nm nid act gid param --- | If the graph size is less than 'sc3_udp_limit' encode and send--- using 'd_recv_bytes', else write to temporary directory and read--- using 'd_load'.+{- | If the graph size is less than 'sc3_udp_limit' encode and send+using 'd_recv_bytes', else write to temporary directory and read+using 'd_load'.+-} recv_or_load_graphdef :: Transport m => Graphdef.Graphdef -> m Message recv_or_load_graphdef g = do tmp <- liftIO getTemporaryDirectory@@ -148,19 +179,23 @@ -- | Send an /anonymous/ instrument definition using 'playSynthdef'. playUgen :: Transport m => Play_Opt -> Ugen.Ugen -> m () playUgen loc =- playSynthdef loc .- Synthdef.synthdef "Anonymous" .- Composite.wrapOut Nothing+ playSynthdef loc+ . Synthdef.synthdef "Anonymous"+ . Composite.wrapOut Nothing -- * Nrt --- | Wait ('pauseThreadUntil') until bundle is due to be sent relative--- to the initial 'Time', then send each message, asynchronously if--- required.-run_bundle :: Transport m => Time -> Bundle -> m ()-run_bundle t0 b = do+-- | Read latency from environment, defaulting to 0.1 seconds.+sc_latency :: IO Double+sc_latency = fmap read (System.lookup_env_default "ScLatency" "0.1")++{- | Wait ('pauseThreadUntil') until bundle is due to be sent relative+to the initial 'Time', then send each message, asynchronously if+required.+-}+run_bundle :: Transport m => Double -> Time -> BundleOf Message -> m ()+run_bundle latency t0 b = do let t = t0 + bundleTime b- latency = 0.1 liftIO (pauseThreadUntil (t - latency)) mapM_ (maybe_async_at t) (bundleMessages b) @@ -169,24 +204,26 @@ > let sc = Nrt [bundle 1 [s_new0 "default" (-1) AddToHead 1] > ,bundle 2 [n_set1 (-1) "gate" 0]] > in withSc3 (nrt_play sc)- -} nrt_play :: Transport m => Nrt.Nrt -> m () nrt_play sc = do t0 <- liftIO time- mapM_ (run_bundle t0) (Nrt.nrt_bundles sc)+ latency <- liftIO sc_latency+ mapM_ (run_bundle latency t0) (Nrt.nrt_bundles sc) --- | Variant where asynchronous commands at time @0@ are separated out and run before--- the initial time-stamp is taken. This re-orders synchronous--- commands in relation to asynchronous at time @0@.+{- | Variant where asynchronous commands at time @0@ are separated out and run before+the initial time-stamp is taken. This re-orders synchronous+commands in relation to asynchronous at time @0@.+-} nrt_play_reorder :: Transport m => Nrt.Nrt -> m () nrt_play_reorder s = do- let (i,r) = Nrt.nrt_span (<= 0) s+ let (i, r) = Nrt.nrt_span (<= 0) s i' = concatMap bundleMessages i- (a,b) = Command.partition_async i'+ (a, b) = Command.partition_async i' mapM_ async a- t <- liftIO time- mapM_ (run_bundle t) (Bundle 0 b : r)+ t0 <- liftIO time+ latency <- liftIO sc_latency+ mapM_ (run_bundle latency t0) (Bundle 0 b : r) -- | 'withSc3' of 'nrt_play'. nrt_audition :: Nrt.Nrt -> IO ()@@ -196,19 +233,20 @@ -- | Class for values that can be encoded and send to @scsynth@ for audition. class Audible e where- playAt :: Transport m => Play_Opt -> e -> m ()- -- | Variant where /id/ is @-1@.- play :: Transport m => e -> m ()- play = playAt (-1,Enum.AddToHead,1,[])+ playAt :: Transport m => Play_Opt -> e -> m () + -- | Variant where /id/ is @-1@.+ play :: Transport m => e -> m ()+ play = playAt (-1, Enum.AddToHead, 1, [])+ instance Audible Graphdef.Graphdef where- playAt = playGraphdef+ playAt = playGraphdef instance Audible Synthdef.Synthdef where- playAt = playSynthdef+ playAt = playSynthdef instance Audible Ugen.Ugen where- playAt = playUgen+ playAt = playUgen -- | 'withSc3At' of 'playAt'. auditionAt :: Audible e => Sc3_Address -> Play_Opt -> e -> IO ()@@ -220,15 +258,23 @@ -- | Default 'Play_Opt', ie. (-1,addToHead,1,[]) def_play_opt :: Play_Opt-def_play_opt = (-1,Enum.AddToHead,1,[])+def_play_opt = (-1, Enum.AddToHead, 1, []) --- | 'auditionAt' 'def_play_opt'+-- | 'auditionAt' 'sc3_env_or_default_address'+auditionOpt :: Audible e => Play_Opt -> e -> IO ()+auditionOpt o e = do+ addr <- sc3_env_or_default_address+ auditionAt addr o e++-- | 'auditionOpt' 'def_play_opt' audition :: Audible e => e -> IO ()-audition = auditionAt sc3_default_udp def_play_opt+audition = auditionOpt def_play_opt -- | 'auditionAtSeq' 'def_play_opt' auditionSeq :: Audible e => Int -> e -> IO ()-auditionSeq = auditionAtSeq sc3_default_udp def_play_opt+auditionSeq k x = do+ addr <- sc3_env_or_default_address+ auditionAtSeq addr def_play_opt k x -- * Notifications @@ -242,22 +288,28 @@ -- * Buffer & control & node variants. --- | Variant of 'b_getn1' that waits for return message and unpacks it.------ > withSc3_tm 1.0 (b_getn1_data 0 (0,5))-b_getn1_data :: DuplexOsc m => Int -> (Int,Int) -> m [Double]+{- | Variant of 'b_getn1' that waits for return message and unpacks it.++> withSc3_tm 1.0 (b_getn1_data 0 (0,5))+-}+b_getn1_data :: DuplexOsc m => Int -> (Int, Int) -> m [Double] b_getn1_data b s = do- let f m = let (_,_,_,r) = Command.unpack_b_setn_err m in r+ let f m = let (_, _, _, r) = Command.unpack_b_setn_err m in r sendMessage (Command.b_getn1 b s) fmap f (waitReply "/b_setn") --- | Variant of 'b_getn1_data' that segments individual 'b_getn'--- messages to /n/ elements.------ > withSc3_tm 1.0 (b_getn1_data_segment 1 0 (0,5))-b_getn1_data_segment :: DuplexOsc m =>- Int -> Int -> (Int,Int) -> m [Double]-b_getn1_data_segment n b (i,j) = do+{- | Variant of 'b_getn1_data' that segments individual 'b_getn'+messages to /n/ elements.++> withSc3_tm 1.0 (b_getn1_data_segment 1 0 (0,5))+-}+b_getn1_data_segment ::+ DuplexOsc m =>+ Int ->+ Int ->+ (Int, Int) ->+ m [Double]+b_getn1_data_segment n b (i, j) = do let ix = Command.b_indices n j i d <- mapM (b_getn1_data b) ix return (concat d)@@ -265,45 +317,48 @@ -- | Variant of 'b_getn1_data_segment' that gets the entire buffer. b_fetch :: DuplexOsc m => Int -> Int -> m [[Double]] b_fetch n b = do- let f m = let (_,nf,nc,_) = Command.unpack_b_info_err m- ix = (0,nf * nc)- deinterleave = transpose . Split.chunksOf nc- in fmap deinterleave (b_getn1_data_segment n b ix)+ let f m =+ let (_, nf, nc, _) = Command.unpack_b_info_err m+ ix = (0, nf * nc)+ deinterleave = transpose . Split.chunksOf nc+ in fmap deinterleave (b_getn1_data_segment n b ix) sendMessage (Command.b_query1 b) waitReply "/b_info" >>= f --- | First channel of 'b_fetch', errors if there is no data.------ > withSc3 (b_fetch1 512 123456789)+{- | First channel of 'b_fetch', errors if there is no data.++> withSc3 (b_fetch1 512 123456789)+-} b_fetch1 :: DuplexOsc m => Int -> Int -> m [Double] b_fetch1 n b = fmap (Safe.headNote "b_fetch1: no data") (b_fetch n b) -- | Combination of 'b_query1_unpack' and 'b_fetch'.-b_fetch_hdr :: Transport m => Int -> Int -> m ((Int,Int,Int,Double),[[Double]])+b_fetch_hdr :: Transport m => Int -> Int -> m ((Int, Int, Int, Double), [[Double]]) b_fetch_hdr k b = do q <- b_query1_unpack b d <- b_fetch k b- return (q,d)+ return (q, d) -- | 'b_info_unpack_err' of 'b_query1'.-b_query1_unpack_generic :: (DuplexOsc m,Num n,Fractional r) => Int -> m (n,n,n,r)+b_query1_unpack_generic :: (DuplexOsc m, Num n, Fractional r) => Int -> m (n, n, n, r) b_query1_unpack_generic n = do sendMessage (Command.b_query1 n) q <- waitReply "/b_info" return (Generic.unpack_b_info_err q) --- | Type specialised 'b_query1_unpack_generic'.------ > withSc3 (b_query1_unpack 0)-b_query1_unpack :: DuplexOsc m => Command.Buffer_Id -> m (Int,Int,Int,Double)+{- | Type specialised 'b_query1_unpack_generic'.++> withSc3 (b_query1_unpack 0)+-}+b_query1_unpack :: DuplexOsc m => Command.Buffer_Id -> m (Int, Int, Int, Double) b_query1_unpack = b_query1_unpack_generic -- | Variant of 'c_getn1' that waits for the reply and unpacks the data.-c_getn1_data :: (DuplexOsc m,Floating t) => (Int,Int) -> m [t]+c_getn1_data :: (DuplexOsc m, Floating t) => (Int, Int) -> m [t] c_getn1_data s = do let f d = case d of- Int32 _:Int32 _:x -> mapMaybe datum_floating x- _ -> error "c_getn1_data"+ Int32 _ : Int32 _ : x -> mapMaybe datum_floating x+ _ -> error "c_getn1_data" sendMessage (Command.c_getn1 s) fmap f (waitDatum "/c_setn") @@ -315,7 +370,7 @@ return (f r) -- | Variant of 'n_query' that waits for and unpacks the reply.-n_query1_unpack :: DuplexOsc m => Command.Node_Id -> m (Maybe (Int,Int,Int,Int,Int,Maybe (Int,Int)))+n_query1_unpack :: DuplexOsc m => Command.Node_Id -> m (Maybe (Int, Int, Int, Int, Int, Maybe (Int, Int))) n_query1_unpack = n_query1_unpack_f Command.unpack_n_info -- | Variant of 'n_query1_unpack' that returns plain (un-lifted) result.@@ -325,33 +380,37 @@ -- | Variant of 'g_queryTree' that waits for and unpacks the reply. g_queryTree1_unpack :: DuplexOsc m => Command.Group_Id -> m Status.Query_Node g_queryTree1_unpack n = do- sendMessage (Command.g_queryTree [(n,True)])+ sendMessage (Command.g_queryTree [(n, True)]) r <- waitReply "/g_queryTree.reply" return (Status.queryTree (messageDatum r)) -- * Status --- | Collect server status information.------ > withSc3 serverStatus >>= mapM putStrLn+{- | Collect server status information.++> withSc3 serverStatus >>= mapM putStrLn+-} serverStatus :: DuplexOsc m => m [String] serverStatus = fmap Status.statusFormat serverStatusData --- | Collect server status information.------ > withSc3 server_status_concise >>= putStrLn+{- | Collect server status information.++> withSc3 server_status_concise >>= putStrLn+-} server_status_concise :: DuplexOsc m => m String server_status_concise = fmap Status.status_format_concise serverStatusData --- | Read nominal sample rate of server.------ > withSc3 serverSampleRateNominal+{- | Read nominal sample rate of server.++> withSc3 serverSampleRateNominal+-} serverSampleRateNominal :: DuplexOsc m => m Double serverSampleRateNominal = fmap (Status.extractStatusField 7) serverStatusData --- | Read actual sample rate of server.------ > withSc3 serverSampleRateActual+{- | Read actual sample rate of server.++> withSc3 serverSampleRateActual+-} serverSampleRateActual :: DuplexOsc m => m Double serverSampleRateActual = fmap (Status.extractStatusField 8) serverStatusData @@ -363,11 +422,12 @@ -- * Tree --- | Collect server node tree information.------ > withSc3 serverTree >>= mapM_ putStrLn+{- | Collect server node tree information.++> withSc3 serverTree >>= mapM_ putStrLn+-} serverTree :: DuplexOsc m => m [String] serverTree = do qt <- g_queryTree1_unpack 0 let tr = Status.queryTree_rt qt- return ["***** SuperCollider Server Tree *****",Tree.drawTree (fmap Status.query_node_pp tr)]+ return ["***** SuperCollider Server Tree *****", Tree.drawTree (fmap Status.query_node_pp tr)]
Sound/Sc3/Ugen/Analysis.hs view
@@ -3,9 +3,9 @@ import Data.List {- base -} +import qualified Sound.Sc3.Common.Mce as Mce {- hsc3 -} import qualified Sound.Sc3.Common.Rate as Rate {- hsc3 -} import qualified Sound.Sc3.Ugen.Bindings.Db as Db {- hsc3 -}-import qualified Sound.Sc3.Common.Mce as Mce {- hsc3 -} import Sound.Sc3.Ugen.Types @@ -14,14 +14,14 @@ -} ugen_primitive_set :: Ugen -> [Primitive Ugen] ugen_primitive_set u =- case u of- Constant_U _ -> []- Control_U _ -> []- Label_U _ -> []- Primitive_U p -> [p]- Proxy_U p -> [proxySource p]- Mce_U m -> concatMap ugen_primitive_set (Mce.mce_to_list m)- Mrg_U m -> ugen_primitive_set (mrgLeft m)+ case u of+ Constant_U _ -> []+ Control_U _ -> []+ Label_U _ -> []+ Primitive_U p -> [p]+ Proxy_U p -> [proxySource p]+ Mce_U m -> concatMap ugen_primitive_set (Mce.mce_to_list m)+ Mrg_U m -> ugen_primitive_set (mrgLeft m) {- | Heuristic based on primitive name (FFT, PV_...). Note that IFFT is at /control/ rate, not PV_... rate.@@ -45,12 +45,12 @@ -} pv_track_buffer :: Ugen -> Either String Ugen pv_track_buffer u =- case ugen_primitive_set u of- [] -> Left "pv_track_buffer: not located"- p:_ -> case ugenName p of- "FFT" -> Right (ugenInputs p !! 0)- "PV_Split" -> Right (ugenInputs p !! 1)- _ -> pv_track_buffer (ugenInputs p !! 0)+ case ugen_primitive_set u of+ [] -> Left "pv_track_buffer: not located"+ p : _ -> case ugenName p of+ "FFT" -> Right (ugenInputs p !! 0)+ "PV_Split" -> Right (ugenInputs p !! 1)+ _ -> pv_track_buffer (ugenInputs p !! 0) {- | Buffer node number of frames. Biases left at Mce nodes. Sees through LocalBuf, otherwise uses 'bufFrames'.@@ -61,11 +61,11 @@ -} buffer_nframes :: Ugen -> Ugen buffer_nframes u =- case ugen_primitive_set u of- [] -> Db.bufFrames (rateOf u) u- p:_ -> case ugenName p of- "LocalBuf" -> ugenInputs p !! 1- _ -> Db.bufFrames (rateOf u) u+ case ugen_primitive_set u of+ [] -> Db.bufFrames (rateOf u) u+ p : _ -> case ugenName p of+ "LocalBuf" -> ugenInputs p !! 1+ _ -> Db.bufFrames (rateOf u) u -- | 'pv_track_buffer' then 'buffer_nframes'. pv_track_nframes :: Ugen -> Either String Ugen@@ -76,11 +76,11 @@ It allows multiple-root graphs. It is in some sense the inverse of 'wrapOut'. -}-ugen_remove_out_node :: Ugen -> (String,Ugen)+ugen_remove_out_node :: Ugen -> (String, Ugen) ugen_remove_out_node u = let err = error "ugen_remove_out_node?" assert_is_output x = if x `elem` ["Out", "ReplaceOut", "OffsetOut"] then x else err in case u of- Primitive_U (Primitive Rate.AudioRate nm (_bus:inputs) [] _special _uid _brk) -> (assert_is_output nm, mce inputs)- Mrg_U (Mrg lhs rhs) -> let (nm,res) = ugen_remove_out_node lhs in (nm,Mrg_U (Mrg res rhs))- _ -> err+ Primitive_U (Primitive Rate.AudioRate nm (_bus : inputs) [] _special _uid _brk) -> (assert_is_output nm, mce inputs)+ Mrg_U (Mrg lhs rhs) -> let (nm, res) = ugen_remove_out_node lhs in (nm, Mrg_U (Mrg res rhs))+ _ -> err
Sound/Sc3/Ugen/Bindings.hs view
@@ -4,5 +4,6 @@ import Sound.Sc3.Ugen.Bindings.Composite as B import Sound.Sc3.Ugen.Bindings.Db as B import Sound.Sc3.Ugen.Bindings.Hw as B---import Sound.Sc3.Ugen.Bindings.Hw.External as B---import Sound.Sc3.Ugen.Bindings.Monad as B++-- import Sound.Sc3.Ugen.Bindings.Hw.External as B+-- import Sound.Sc3.Ugen.Bindings.Monad as B
Sound/Sc3/Ugen/Bindings/Composite.hs view
@@ -23,9 +23,9 @@ -- | Generate a localBuf and use setBuf to initialise it. asLocalBufId :: ID i => i -> [Ugen] -> Ugen asLocalBufId z xs =- let b = localBufId z 1 (fromIntegral (length xs))- s = setBuf' b xs 0- in mrg2 b s+ let b = localBufId z 1 (fromIntegral (length xs))+ s = setBuf' b xs 0+ in mrg2 b s asLocalBufM :: Uid m => [Ugen] -> m Ugen asLocalBufM = liftUid1 asLocalBufId@@ -35,7 +35,7 @@ -- | balance2 with Mce input. balanceStereo :: Ugen -> Ugen -> Ugen -> Ugen-balanceStereo sig pos level = let (x,y) = unmce2 sig in balance2 x y pos level+balanceStereo sig pos level = let (x, y) = unmce2 sig in balance2 x y pos level -- | 24db/oct rolloff - 4th order resonant Low Pass Filter bLowPass4 :: Ugen -> Ugen -> Ugen -> Ugen@@ -89,11 +89,11 @@ clearLocalBuf = liftUnsafe2 clearLocalBufM -- | Demand rate (:) function.-dconsId :: ID m => (m,m,m) -> Ugen -> Ugen -> Ugen-dconsId (z0,z1,z2) x xs =- let i = dseqId z0 1 (mce2 0 1)- a = dseqId z1 1 (mce2 x xs)- in dswitchId z2 i a+dconsId :: ID m => (m, m, m) -> Ugen -> Ugen -> Ugen+dconsId (z0, z1, z2) x xs =+ let i = dseqId z0 1 (mce2 0 1)+ a = dseqId z1 1 (mce2 x xs)+ in dswitchId z2 i a -- | Demand rate (:) function. dconsM :: (Uid m) => Ugen -> Ugen -> m Ugen@@ -108,38 +108,44 @@ -- | Dynamic klang, dynamic sine oscillator bank dynKlang :: Rate -> Ugen -> Ugen -> Ugen -> Ugen dynKlang r fs fo s =- let gen (f:a:ph:xs) = sinOsc r (f * fs + fo) ph * a + gen xs- gen _ = 0- in gen (mceChannels s)+ let gen (f : a : ph : xs) = sinOsc r (f * fs + fo) ph * a + gen xs+ gen _ = 0+ in gen (mceChannels s) -- | Dynamic klank, set of non-fixed resonating filters. dynKlank :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen dynKlank i fs fo ds s =- let gen (f:a:d:xs) = ringz i (f * fs + fo) (d * ds) * a + gen xs- gen _ = 0- in gen (mceChannels s)+ let gen (f : a : d : xs) = ringz i (f * fs + fo) (d * ds) * a + gen xs+ gen _ = 0+ in gen (mceChannels s) +-- | Pan2 without (k-rate only) level input+eqPan2 :: Ugen -> Ugen -> Ugen+eqPan2 input pos = pan2 input pos 1+ -- | 'linExp' with input range of (-1,1). exprange :: Ugen -> Ugen -> Ugen -> Ugen exprange l r s = linExp s (-1) 1 l r -- | Variant of `exprange` with arguments to make writing post-fix nicer. in_exprange :: Ugen -> (Ugen, Ugen) -> Ugen-in_exprange s (l,r) = exprange l r s+in_exprange s (l, r) = exprange l r s --- | Variant FFT constructor with default values for hop size (0.5),--- window type (0), active status (1) and window size (0).+{- | Variant FFT constructor with default values for hop size (0.5),+window type (0), active status (1) and window size (0).+-} fft' :: Ugen -> Ugen -> Ugen fft' buf i = fft buf i 0.5 0 1 0 --- | 'fft' variant that allocates 'localBuf'.------ > let c = ffta 'α' 2048 (soundIn 0) 0.5 0 1 0--- > in audition (out 0 (ifft c 0 0))+{- | 'fft' variant that allocates 'localBuf'.++> let c = ffta 'α' 2048 (soundIn 0) 0.5 0 1 0+> in audition (out 0 (ifft c 0 0))+-} fftAllocId :: ID i => i -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen fftAllocId z nf i h wt a ws =- let b = localBufId z 1 nf- in fft b i h wt a ws+ let b = localBufId z 1 nf+ in fft b i h wt a ws fftAllocM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen fftAllocM = liftUid6 fftAllocId@@ -154,9 +160,9 @@ -- | Frequency shifter, in terms of 'hilbert' (see also 'freqShift'). freqShift_hilbert :: Ugen -> Ugen -> Ugen -> Ugen freqShift_hilbert i f p =- let o = sinOsc ar f (mce [p + 0.5 * pi, p])- h = hilbert i- in mix (h * o)+ let o = sinOsc ar f (mce [p + 0.5 * pi, p])+ h = hilbert i+ in mix (h * o) {- | Ugen function to re-trigger an EnvGen envelope. Inputs are /gate/ (as set at EnvGen) and /reset/.@@ -164,15 +170,17 @@ If the gate input to EnvGen.kr is -1 the envelope ramps to zero in one control period. The reset input sequence 0,1,0 when the gate is open produces (1,-1,1), which resets the envelope. -> map (uncurry gateReset) [(1,0),(1,1),(0,1),(0,0)] == [1,-1,0,0]+>>> map (uncurry gateReset) [(1,0),(1,1),(0,1),(0,0)]+[1,-1,0,0] -} gateReset :: Num a => a -> a -> a gateReset gt tr = gt - (gt * tr * 2) --- | Variant of 'hilbert' using FFT (with a delay) for better results.--- Buffer should be 2048 or 1024.--- 2048 = better results, more delay.--- 1024 = less delay, little choppier results.+{- | Variant of 'hilbert' using FFT (with a delay) for better results.+Buffer should be 2048 or 1024.+2048 = better results, more delay.+1024 = less delay, little choppier results.+-} hilbertFIR :: Ugen -> Ugen -> Ugen hilbertFIR s b = let c0 = fft' b s@@ -193,12 +201,13 @@ in linLin (frac i) 0 1 x y -} --- | Generalised Klan(k/g) specification rule. /f/ unwraps inputs, /g/ wraps output.------ > let r = [220,0.2,0,219,0.1,1,221,0.1,2]--- > in klanx_spec_f id id [220,219,221] [0.2,0.1,0.1] [0,1,2] == r+{- | Generalised Klan(k/g) specification rule. /f/ unwraps inputs, /g/ wraps output.++> let r = [220,0.2,0,219,0.1,1,221,0.1,2]+> in klanx_spec_f id id [220,219,221] [0.2,0.1,0.1] [0,1,2] == r+-} klanx_spec_f :: (a -> [b]) -> ([b] -> c) -> a -> a -> a -> c-klanx_spec_f f g fr am z = g ((concat . transpose) [f fr,f am,f z])+klanx_spec_f f g fr am z = g ((concat . transpose) [f fr, f am, f z]) -- | Format frequency, amplitude and decay time data as required for klank. klangSpec :: [Ugen] -> [Ugen] -> [Ugen] -> Ugen@@ -259,32 +268,33 @@ localIn' :: Int -> Rate -> Ugen localIn' nc r = localIn nc r (mce (replicate nc 0)) --- | Generate an 'envGen' Ugen with @fadeTime@ and @gate@ controls.------ > import Sound.Sc3--- > audition (out 0 (makeFadeEnv 1 * sinOsc ar 440 0 * 0.1))--- > withSc3 (send (n_set1 (-1) "gate" 0))+{- | Generate an 'envGen' Ugen with @fadeTime@ and @gate@ controls.++> import Sound.Sc3+> audition (out 0 (makeFadeEnv 1 * sinOsc ar 440 0 * 0.1))+> withSc3 (send (n_set1 (-1) "gate" 0))+-} makeFadeEnv :: Double -> Ugen makeFadeEnv fadeTime =- let dt = control kr "fadeTime" (realToFrac fadeTime)- gate_ = control kr "gate" 1- startVal = dt `less_than_or_equal_to` 0- env = Envelope [startVal,1,0] [1,1] [EnvLin,EnvLin] (Just 1) Nothing 0- in envGen kr gate_ 1 0 dt RemoveSynth env+ let dt = control kr "fadeTime" (realToFrac fadeTime)+ gate_ = control kr "gate" 1+ startVal = dt `less_than_or_equal_to` 0+ env = Envelope [startVal, 1, 0] [1, 1] [EnvLin, EnvLin] (Just 1) Nothing 0+ in envGen kr gate_ 1 0 dt RemoveSynth env -- | Variant that is randomly pressed. mouseButtonRand :: Rate -> Ugen -> Ugen -> Ugen -> Ugen mouseButtonRand rt l r tm =- let o = lfClipNoiseId 'z' rt 1- in lag (linLin o (-1) 1 l r) tm+ let o = lfClipNoiseId 'z' rt 1+ in lag (linLin o (-1) 1 l r) tm -- | Randomised mouse Ugen (see also 'mouseX'' and 'mouseY''). mouseRandId :: ID a => a -> Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> Ugen mouseRandId z rt l r ty tm = let f = case ty of- Linear -> linLin- Exponential -> linExp- _ -> undefined+ Linear -> linLin+ Exponential -> linExp+ _ -> undefined in lag (f (lfNoise1Id z rt 1) (-1) 1 l r) tm mouseRandM :: Uid m => Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> m Ugen@@ -304,8 +314,8 @@ -- | Translate onset type string to constant Ugen value. onsetType :: Num a => String -> a onsetType s =- let t = ["power", "magsum", "complex", "rcomplex", "phase", "wphase", "mkl"]- in fromIntegral (fromMaybe 3 (elemIndex s t))+ let t = ["power", "magsum", "complex", "rcomplex", "phase", "wphase", "mkl"]+ in fromIntegral (fromMaybe 3 (elemIndex s t)) -- | Onset detector with default values for minor parameters. onsetsDefault :: Ugen -> Ugen -> Ugen -> Ugen@@ -314,28 +324,30 @@ -- | Format magnitude and phase data data as required for packFFT. packFFTSpec :: [Ugen] -> [Ugen] -> Ugen packFFTSpec m p =- let interleave x = concat . zipWith (\a b -> [a,b]) x- in mce (interleave m p)+ let interleave x = concat . zipWith (\a b -> [a, b]) x+ in mce (interleave m p) -- | Calculate size of accumulation buffer given FFT and IR sizes. partConv_calcAccumSize :: Int -> Int -> Int partConv_calcAccumSize fft_size ir_length =- let partition_size = fft_size `div` 2- num_partitions = (ir_length `div` partition_size) + 1- in fft_size * num_partitions+ let partition_size = fft_size `div` 2+ num_partitions = (ir_length `div` partition_size) + 1+ in fft_size * num_partitions --- | PM oscillator.--- cf = carrier frequency, mf = modulation frequency, pm = pm-index = 0.0, mp = mod-phase = 0.0+{- | PM oscillator.+cf = carrier frequency, mf = modulation frequency, pm = pm-index = 0.0, mp = mod-phase = 0.0+-} pmOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen pmOsc r cf mf pm mp = sinOsc r cf (sinOsc r mf mp * pm) --- | Variant of 'poll' that generates an 'mrg' value with the input--- signal at left, and that allows a constant /frequency/ input in--- place of a trigger.+{- | Variant of 'poll' that generates an 'mrg' value with the input+signal at left, and that allows a constant /frequency/ input in+place of a trigger.+-} pollExt :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen pollExt optTrig in_ label_ trigId =- let tr = if isConstant optTrig then impulse kr optTrig 0 else optTrig- in mrg [in_,poll tr in_ label_ trigId]+ let tr = if isConstant optTrig then impulse kr optTrig 0 else optTrig+ in mrg [in_, poll tr in_ label_ trigId] -- | Variant of 'in'' offset so zero if the first private bus. privateIn :: Int -> Rate -> Ugen -> Ugen@@ -345,26 +357,28 @@ privateOut :: Ugen -> Ugen -> Ugen privateOut k = out (k + firstPrivateBus) --- | Apply function /f/ to each bin of an @FFT@ chain, /f/ receives--- magnitude, phase and index and returns a (magnitude,phase).+{- | Apply function /f/ to each bin of an @FFT@ chain, /f/ receives+magnitude, phase and index and returns a (magnitude,phase).+-} pvcollect :: Ugen -> Int -> (Ugen -> Ugen -> Int -> (Ugen, Ugen)) -> Int -> Int -> Ugen -> Ugen pvcollect c nf f from to z =- let m = unpackFFT c nf from to 0- p = unpackFFT c nf from to 1- i = [from .. to]- e = zipWith3 f m p i- mp = uncurry packFFTSpec (unzip e)- in packFFT c nf from to z mp+ let m = unpackFFT c nf from to 0+ p = unpackFFT c nf from to 1+ i = [from .. to]+ e = zipWith3 f m p i+ mp = uncurry packFFTSpec (unzip e)+ in packFFT c nf from to z mp --- | /dur/ and /hop/ are in seconds, /frameSize/ and /sampleRate/ in--- frames, though the latter maybe fractional.------ > pv_calcPVRecSize 4.2832879818594 1024 0.25 48000.0 == 823299+{- | /dur/ and /hop/ are in seconds, /frameSize/ and /sampleRate/ in+frames, though the latter maybe fractional.++> pv_calcPVRecSize 4.2832879818594 1024 0.25 48000.0 == 823299+-} pv_calcPVRecSize :: Double -> Int -> Double -> Double -> Int pv_calcPVRecSize dur frame_size hop sample_rate =- let frame_size' = fromIntegral frame_size- raw_size = ceiling ((dur * sample_rate) / frame_size') * frame_size- in ceiling (fromIntegral raw_size * recip hop + 3)+ let frame_size' = fromIntegral frame_size+ raw_size = ceiling ((dur * sample_rate) / frame_size') * frame_size+ in ceiling (fromIntegral raw_size * recip hop + 3) -- | 'rand' with left edge set to zero. rand0Id :: ID a => a -> Ugen -> Ugen@@ -392,7 +406,7 @@ -- | rotate2 with Mce input. rotateStereo :: Ugen -> Ugen -> Ugen-rotateStereo sig pos = let (x,y) = unmce2 sig in rotate2 x y pos+rotateStereo sig pos = let (x, y) = unmce2 sig in rotate2 x y pos -- | RMS variant of 'runningSum'. runningSumRMS :: Ugen -> Ugen -> Ugen@@ -401,9 +415,9 @@ -- | Mix one output from many sources selectX :: Ugen -> Ugen -> Ugen selectX ix xs =- let s0 = select (roundTo ix 2) xs- s1 = select (trunc ix 2 + 1) xs- in xFade2 s0 s1 (fold2 (ix * 2 - 1) 1) 1+ let s0 = select (roundTo ix 2) xs+ s1 = select (trunc ix 2 + 1) xs+ in xFade2 s0 s1 (fold2 (ix * 2 - 1) 1) 1 -- | Set local buffer values. setBuf' :: Ugen -> [Ugen] -> Ugen -> Ugen@@ -416,37 +430,43 @@ {- | Zero indexed audio input buses. Optimises case of consecutive Ugens. -> soundIn (mce2 0 1) == in' 2 ar numOutputBuses-> soundIn (mce2 0 2) == in' 1 ar (numOutputBuses + mce2 0 2)+>>> soundIn (mce2 0 1) == in' 2 ar numOutputBuses+True +>>> soundIn (mce2 0 2) == in' 1 ar (numOutputBuses + mce2 0 2)+True -} soundIn :: Ugen -> Ugen soundIn u =- let r = in' 1 ar (numOutputBuses + u)- in case u of- Mce_U m ->- let n = mceProxies m- in if all (==1) (zipWith (-) (tail n) n)- then in' (length n) ar (numOutputBuses + head n)+ let r = in' 1 ar (numOutputBuses + u)+ in case u of+ Mce_U m ->+ let n = mceProxies m+ in case uncons n of+ Nothing -> error "soundIn"+ Just (h, t) ->+ if all (== 1) (zipWith (-) t n)+ then in' (length n) ar (numOutputBuses + h) else r- _ -> r+ _ -> r --- | Pan a set of channels across the stereo field.------ > input, spread:1, level:1, center:0, levelComp:true+{- | Pan a set of channels across the stereo field.++input, spread:1, level:1, center:0, levelComp:true+-} splay :: Ugen -> Ugen -> Ugen -> Ugen -> Bool -> Ugen splay i s l c lc =- let n = max 2 (fromIntegral (fromMaybe 1 (mceDegree i)))- m = n - 1- p = map ((+ (-1.0)) . (* (2 / m))) [0 .. m]- a = if lc then sqrt (1 / n) else 1- in mix (pan2 i (s * mce p + c) 1) * l * a+ let n = max 2 (fromIntegral (fromMaybe 1 (mceDegree i)))+ m = n - 1+ p = map ((+ (-1.0)) . (* (2 / m))) [0 .. m]+ a = if lc then sqrt (1 / n) else 1+ in mix (pan2 i (s * mce p + c) 1) * l * a -- | Single tap into a delayline. ar only. tap :: Int -> Rate -> Ugen -> Ugen -> Ugen tap numChannels rt bufnum delaytime =- let n = delaytime * negate sampleRate- in playBuf numChannels rt bufnum 1 0 n Loop DoNothing+ let n = delaytime * negate sampleRate+ in playBuf numChannels rt bufnum 1 0 n Loop DoNothing -- | Randomly select one of several inputs on trigger. tChooseId :: ID m => m -> Ugen -> Ugen -> Ugen@@ -464,31 +484,32 @@ -- | Triggered Line, implemented in terms of EnvGen. tLine :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen tLine rt start end dur trig_ =- let p = envCoord [(0,0),(0,start),(dur,end)] 1 1 EnvLin+ let p = envCoord [(0, 0), (0, start), (dur, end)] 1 1 EnvLin in envGen rt trig_ 1 0 1 DoNothing p -- | Triggered xLine, implemented in terms of EnvGen. tXLine :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen tXLine rt start end dur trig_ =- let p = envCoord [(0,0),(0,start),(dur,end)] 1 1 EnvExp+ let p = envCoord [(0, 0), (0, start), (dur, end)] 1 1 EnvExp in envGen rt trig_ 1 0 1 DoNothing p --- | Triangle wave as sum of /n/ sines.--- For partial n, amplitude is (1 / square n) and phase is pi at every other odd partial.+{- | Triangle wave as sum of /n/ sines.+For partial n, amplitude is (1 / square n) and phase is pi at every other odd partial.+-} triAS :: Int -> Ugen -> Ugen triAS n f0 =- let mk_freq i = f0 * fromIntegral i- mk_amp i = if even i then 0 else 1 / fromIntegral (i * i)- mk_ph i = if i + 1 `mod` 4 == 0 then pi else 0- m = [1,3 .. n]- param = zip3 (map mk_freq m) (map mk_ph m) (map mk_amp m)- in sum_opt (map (\(fr,ph,am) -> sinOsc ar fr ph * am) param)+ let mk_freq i = f0 * fromIntegral i+ mk_amp i = if even i then 0 else 1 / fromIntegral (i * i)+ mk_ph i = if i + 1 `mod` 4 == 0 then pi else 0+ m = [1, 3 .. n]+ param = zip3 (map mk_freq m) (map mk_ph m) (map mk_amp m)+ in sum_opt (map (\(fr, ph, am) -> sinOsc ar fr ph * am) param) -- | Randomly select one of several inputs on trigger (weighted). tWChooseId :: ID m => m -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen tWChooseId z t a w n =- let i = tWindexId z t n w- in select i a+ let i = tWindexId z t n w+ in select i a -- | Randomly select one of several inputs (weighted). tWChooseM :: (Uid m) => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen@@ -508,7 +529,7 @@ varLag_env in_ time warp start = let rt = rateOf in_ start_ = fromMaybe in_ start- e = Envelope [start_,in_] [time] [warp] Nothing Nothing 0+ e = Envelope [start_, in_] [time] [warp] Nothing Nothing 0 -- e[6] = curve; e[7] = curvature; time_ch = if rateOf time == InitialisationRate then 0 else changed time 0 tr = changed in_ 0 + time_ch + impulse rt 0 0@@ -527,48 +548,56 @@ {- | If @z@ isn't a sink node route to an @out@ node writing to @bus@. If @fadeTime@ is given multiply by 'makeFadeEnv'. -> import Sound.Sc3 {- hsc3 -}+> import Sound.Sc3 {\- hsc3 -\} > audition (wrapOut (Just 1) (sinOsc ar 440 0 * 0.1))-> import Sound.Osc {- hosc -}++> import Sound.Osc {\- hosc -\} > withSc3 (sendMessage (n_set1 (-1) "gate" 0)) -} wrapOut :: Maybe Double -> Ugen -> Ugen wrapOut fadeTime z = if isSink z- then z- else out (control kr "out" 0) (maybe z ((* z) . makeFadeEnv) fadeTime)+ then z+ else out (control kr "out" 0) (maybe z ((* z) . makeFadeEnv) fadeTime) -- * wslib -- | Cross-fading version of 'playBuf'. playBufCF :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Loop Ugen -> Ugen -> Int -> Ugen playBufCF nc bufnum rate trigger startPos loop lag' n =- let trigger' = if rateOf trigger == DemandRate- then tDuty ar trigger 0 DoNothing 1 0- else trigger- index' = stepper trigger' 0 0 (constant n - 1) 1 0- on = map- (\i -> inRange index' (i - 0.5) (i + 0.5))- [0 .. constant n - 1]- rate' = case rateOf rate of- DemandRate -> map (\on' -> demand on' 0 rate) on- ControlRate -> map (gate rate) on- AudioRate -> map (gate rate) on- InitialisationRate -> map (const rate) on- startPos' = if rateOf startPos == DemandRate- then demand trigger' 0 startPos- else startPos- lag'' = 1 / lag'- s = zipWith- (\on' r -> let p = playBuf nc ar bufnum r on' startPos' loop DoNothing- in p * sqrt (slew on' lag'' lag''))- on rate'- in sum_opt s+ let trigger' =+ if rateOf trigger == DemandRate+ then tDuty ar trigger 0 DoNothing 1 0+ else trigger+ index' = stepper trigger' 0 0 (constant n - 1) 1 0+ on =+ map+ (\i -> inRange index' (i - 0.5) (i + 0.5))+ [0 .. constant n - 1]+ rate' = case rateOf rate of+ DemandRate -> map (\on' -> demand on' 0 rate) on+ ControlRate -> map (gate rate) on+ AudioRate -> map (gate rate) on+ InitialisationRate -> map (const rate) on+ startPos' =+ if rateOf startPos == DemandRate+ then demand trigger' 0 startPos+ else startPos+ lag'' = 1 / lag'+ s =+ zipWith+ ( \on' r ->+ let p = playBuf nc ar bufnum r on' startPos' loop DoNothing+ in p * sqrt (slew on' lag'' lag'')+ )+ on+ rate'+ in sum_opt s -- * adc -- | An oscillator that reads through a table once. osc1 :: Rate -> Ugen -> Ugen -> DoneAction Ugen -> Ugen osc1 rt buf dur doneAction =- let ph = line rt 0 (bufFrames ir buf - 1) dur doneAction- in bufRd 1 rt buf ph NoLoop LinearInterpolation+ let ph = line rt 0 (bufFrames ir buf - 1) dur doneAction+ in bufRd 1 rt buf ph NoLoop LinearInterpolation
Sound/Sc3/Ugen/Bindings/Composite/External.hs view
@@ -9,14 +9,14 @@ import Sound.Sc3.Common.Uid {- hsc3 -} import Sound.Sc3.Common.Unsafe {- hsc3 -} -import Sound.Sc3.Ugen.Analysis {- hsc3 -}+import Sound.Sc3.Ugen.Analysis {- hsc3 -} import Sound.Sc3.Ugen.Ugen {- hsc3 -} import Sound.Sc3.Ugen.Util {- hsc3 -} import qualified Sound.Sc3.Ugen.Bindings.Db as Db {- hsc3 -} import qualified Sound.Sc3.Ugen.Bindings.Db.External as External {- hsc3 -} --- | FM7 variant where input matrices are not in MCE form.+-- | FM7 variant where input matrices are not in Mce form. fm7_mx :: [[Ugen]] -> [[Ugen]] -> Ugen fm7_mx ctlMatrix modMatrix = External.fm7 ar (mce (concat ctlMatrix)) (mce (concat modMatrix)) @@ -27,60 +27,61 @@ -} greyhole :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen greyhole i delayTime damping size diffusion feedback modDepth modFreq =- let (i1,i2) = unmce2 i+ let (i1, i2) = unmce2 i in External.greyholeRaw i1 i2 damping delayTime diffusion feedback modDepth modFreq size -- | Association list giving names for MiBraids modes.-miBraids_mode_dict :: Num n => [(n,String)]+miBraids_mode_dict :: Num n => [(n, String)] miBraids_mode_dict =- [(0,"CSAW")- ,(1,"MORPH")- ,(2,"SAW_SQUARE")- ,(3,"SINE_TRIANGLE")- ,(4,"BUZZ")- ,(5,"SQUARE_SUB")- ,(6,"SAW_SUB")- ,(7,"SQUARE_SYNC")- ,(8,"SAW_SYNC")- ,(9,"TRIPLE_SAW")- ,(10,"TRIPLE_SQUARE")- ,(11,"TRIPLE_TRIANGLE")- ,(12,"TRIPLE_SINE")- ,(13,"TRIPLE_RING_MOD")- ,(14,"SAW_SWARM")- ,(15,"SAW_COMB")- ,(16,"TOY")- ,(17,"DIGITAL_FILTER_LP")- ,(18,"DIGITAL_FILTER_PK")- ,(19,"DIGITAL_FILTER_BP")- ,(20,"DIGITAL_FILTER_HP")- ,(21,"VOSIM")- ,(22,"VOWEL")- ,(23,"VOWEL_FOF")- ,(24,"HARMONICS")- ,(25,"FM")- ,(26,"FEEDbACK_FM")- ,(27,"CHAOTIC_FEEDbACK_FM")- ,(28,"PLUCKED")- ,(29,"BOWED")- ,(30,"BLOWN")- ,(31,"FLUTED")- ,(32,"STRUCK_BELL")- ,(33,"STRUCK_DRUM")- ,(34,"KICK")- ,(35,"CYMBAL")- ,(36,"SNARE")- ,(37,"WAVETABLES")- ,(38,"WAVE_MAP")- ,(39,"WAVE_LINE")- ,(40,"WAVE_PARAPHONIC")- ,(41,"FILTERED_NOISE")- ,(42,"TWIN_PEAKS_NOISE")- ,(43,"CLOCKED_NOISE")- ,(44,"GRANULAR_CLOUD")- ,(45,"PARTICLE_NOISE")- ,(46,"DIGITAL_MODULATION")- ,(47,"QUESTION_MARK")]+ [ (0, "CSAW")+ , (1, "MORPH")+ , (2, "SAW_SQUARE")+ , (3, "SINE_TRIANGLE")+ , (4, "BUZZ")+ , (5, "SQUARE_SUB")+ , (6, "SAW_SUB")+ , (7, "SQUARE_SYNC")+ , (8, "SAW_SYNC")+ , (9, "TRIPLE_SAW")+ , (10, "TRIPLE_SQUARE")+ , (11, "TRIPLE_TRIANGLE")+ , (12, "TRIPLE_SINE")+ , (13, "TRIPLE_RING_MOD")+ , (14, "SAW_SWARM")+ , (15, "SAW_COMB")+ , (16, "TOY")+ , (17, "DIGITAL_FILTER_LP")+ , (18, "DIGITAL_FILTER_PK")+ , (19, "DIGITAL_FILTER_BP")+ , (20, "DIGITAL_FILTER_HP")+ , (21, "VOSIM")+ , (22, "VOWEL")+ , (23, "VOWEL_FOF")+ , (24, "HARMONICS")+ , (25, "FM")+ , (26, "FEEDbACK_FM")+ , (27, "CHAOTIC_FEEDbACK_FM")+ , (28, "PLUCKED")+ , (29, "BOWED")+ , (30, "BLOWN")+ , (31, "FLUTED")+ , (32, "STRUCK_BELL")+ , (33, "STRUCK_DRUM")+ , (34, "KICK")+ , (35, "CYMBAL")+ , (36, "SNARE")+ , (37, "WAVETABLES")+ , (38, "WAVE_MAP")+ , (39, "WAVE_LINE")+ , (40, "WAVE_PARAPHONIC")+ , (41, "FILTERED_NOISE")+ , (42, "TWIN_PEAKS_NOISE")+ , (43, "CLOCKED_NOISE")+ , (44, "GRANULAR_CLOUD")+ , (45, "PARTICLE_NOISE")+ , (46, "DIGITAL_MODULATION")+ , (47, "QUESTION_MARK")+ ] -- | Reverse lookup of 'miBraids_mode_dict'. miBraids_mode_maybe :: Num n => String -> Maybe n@@ -91,12 +92,13 @@ miBraids_mode = fromMaybe (error "miBraids_mode?") . miBraids_mode_maybe -- | Association list giving names for MiClouds modes.-miClouds_mode_dict :: Num n => [(n,String)]+miClouds_mode_dict :: Num n => [(n, String)] miClouds_mode_dict =- [(0,"GRANULAR")- ,(1,"STRETCH")- ,(2,"LOOPING_DELAY")- ,(3,"SPECTRAL")]+ [ (0, "GRANULAR")+ , (1, "STRETCH")+ , (2, "LOOPING_DELAY")+ , (3, "SPECTRAL")+ ] -- | Reverse lookup of 'miClouds_mode_dict'. miClouds_mode_maybe :: Num n => String -> Maybe n@@ -107,24 +109,25 @@ miClouds_mode = fromMaybe (error "miClouds_mode?") . miClouds_mode_maybe -- | Association list giving names for MiPlaits modes.-miPlaits_mode_dict :: Num n => [(n,String)]+miPlaits_mode_dict :: Num n => [(n, String)] miPlaits_mode_dict =- [(0,"virtual_analog")- ,(1,"waveshaping")- ,(2,"fm")- ,(3,"grain")- ,(4,"additive")- ,(5,"wavetable")- ,(6,"chord")- ,(7,"speech")- ,(8,"swarm")- ,(9,"noise")- ,(10,"particle")- ,(11,"string")- ,(12,"modal")- ,(13,"bass_drum")- ,(14,"snare_drum")- ,(15,"hi_hat")]+ [ (0, "virtual_analog")+ , (1, "waveshaping")+ , (2, "fm")+ , (3, "grain")+ , (4, "additive")+ , (5, "wavetable")+ , (6, "chord")+ , (7, "speech")+ , (8, "swarm")+ , (9, "noise")+ , (10, "particle")+ , (11, "string")+ , (12, "modal")+ , (13, "bass_drum")+ , (14, "snare_drum")+ , (15, "hi_hat")+ ] -- | Reverse lookup of 'miPlaits_mode_dict'. miPlaits_mode_maybe :: Num n => String -> Maybe n@@ -135,14 +138,15 @@ miPlaits_mode = fromMaybe (error "miPlaits_mode?") . miPlaits_mode_maybe -- | Association list giving names for MiPlaits modes.-miRings_mode_dict :: Num n => [(n,String)]+miRings_mode_dict :: Num n => [(n, String)] miRings_mode_dict =- [(0,"MODAL_RESONATOR")- ,(1,"SYMPATHETIC_STRING")- ,(2,"MODULATED/INHARMONIC_STRING")- ,(3,"2-OP_FM_VOICE")- ,(4,"SYMPATHETIC_STRING_QUANTIZED")- ,(5,"STRING_AND_REVERB")]+ [ (0, "MODAL_RESONATOR")+ , (1, "SYMPATHETIC_STRING")+ , (2, "MODULATED/INHARMONIC_STRING")+ , (3, "2-OP_FM_VOICE")+ , (4, "SYMPATHETIC_STRING_QUANTIZED")+ , (5, "STRING_AND_REVERB")+ ] -- | Reverse lookup of 'miRings_mode_dict'. miRings_mode_maybe :: Num n => String -> Maybe n@@ -156,26 +160,27 @@ pulseDPW :: Rate -> Ugen -> Ugen -> Ugen pulseDPW rt freq width = let o1 = External.sawDPW rt freq 0- o2 = External.sawDPW rt freq (wrap_hs (-1,1) (width+width))+ o2 = External.sawDPW rt freq (wrap_hs (-1, 1) (width + width)) in o1 - o2 -- * rdu -- | Variant that unpacks the output /mce/ node.-pv_SplitUnpack :: Ugen -> Ugen -> (Ugen,Ugen)+pv_SplitUnpack :: Ugen -> Ugen -> (Ugen, Ugen) pv_SplitUnpack a b =- case mceChannels (External.pv_Split a b) of- [p,q] -> (p,q)- _ -> error "pv_SplitUnpack"+ case mceChannels (External.pv_Split a b) of+ [p, q] -> (p, q)+ _ -> error "pv_SplitUnpack" --- | A 'pv_Split' variant, like 'ffta', that allocates a 'localBuf' by--- tracing the input graph to locate the parent @FFT@ or @PV_Split@--- node.+{- | A 'pv_Split' variant, like 'ffta', that allocates a 'localBuf' by+tracing the input graph to locate the parent @FFT@ or @PV_Split@+node.+-} pv_SplitAllocId :: ID i => i -> Ugen -> Ugen pv_SplitAllocId z u =- case pv_track_nframes u of- Left err -> error err- Right nf -> let b = Db.localBufId z nf 1 in External.pv_Split u b+ case pv_track_nframes u of+ Left err -> error err+ Right nf -> let b = Db.localBufId z nf 1 in External.pv_Split u b pv_SplitAllocM :: Uid m => Ugen -> m Ugen pv_SplitAllocM = liftUid1 pv_SplitAllocId@@ -184,8 +189,8 @@ pv_SplitAlloc = liftUnsafe1 pv_SplitAllocM -- | Variant that unpacks the output /mce/ node.-pv_SplitAllocUnpackId :: ID i => i -> Ugen -> (Ugen,Ugen)+pv_SplitAllocUnpackId :: ID i => i -> Ugen -> (Ugen, Ugen) pv_SplitAllocUnpackId z u =- case mceChannels (pv_SplitAllocId z u) of- [p,q] -> (p,q)- _ -> error "pv_SplitAllocUnpackId"+ case mceChannels (pv_SplitAllocId z u) of+ [p, q] -> (p, q)+ _ -> error "pv_SplitAllocUnpackId"
Sound/Sc3/Ugen/Bindings/Db.hs view
@@ -11,2673 +11,3042 @@ import Sound.Sc3.Ugen.Ugen import Sound.Sc3.Ugen.Util --- | Apply a binary operation to the values of an input Ugen------ BinaryOpUgen [InitialisationRate,ControlRate,AudioRate,DemandRate] a=0 b=0; FILTER: TRUE-binaryOpUgen :: Ugen -> Ugen -> Ugen-binaryOpUgen a b = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Right [0,1]) "BinaryOpUGen" [a,b] Nothing 1 (Special 0) NoId---- | Apply a unary operation to the values of an input ugen------ UnaryOpUgen [InitialisationRate,ControlRate,AudioRate,DemandRate] a=0; FILTER: TRUE-unaryOpUgen :: Ugen -> Ugen-unaryOpUgen a = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Right [0]) "UnaryOpUGen" [a] Nothing 1 (Special 0) NoId---- | Audio to control rate converter.------ A2K [ControlRate] in=0-a2k :: Ugen -> Ugen-a2k in_ = mkUgen Nothing [ControlRate] (Left ControlRate) "A2K" [in_] Nothing 1 (Special 0) NoId---- | FIXME: APF purpose.------ APF [ControlRate,AudioRate] in=0 freq=440 radius=0.8; FILTER: TRUE-apf :: Ugen -> Ugen -> Ugen -> Ugen-apf in_ freq radius = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "APF" [in_,freq,radius] Nothing 1 (Special 0) NoId---- | Schroeder allpass delay line with cubic interpolation.------ AllpassC [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE-allpassC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-allpassC in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "AllpassC" [in_,maxdelaytime,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Schroeder allpass delay line with linear interpolation.------ AllpassL [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE-allpassL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-allpassL in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "AllpassL" [in_,maxdelaytime,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Schroeder allpass delay line with no interpolation.------ AllpassN [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE-allpassN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-allpassN in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "AllpassN" [in_,maxdelaytime,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Basic psychoacoustic amplitude compensation.------ AmpComp [InitialisationRate,ControlRate,AudioRate] freq=0 root=0 exp=0.3333-ampComp :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-ampComp rate freq root exp_ = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Left rate) "AmpComp" [freq,root,exp_] Nothing 1 (Special 0) NoId---- | Basic psychoacoustic amplitude compensation (ANSI A-weighting curve).------ AmpCompA [InitialisationRate,ControlRate,AudioRate] freq=1000 root=0 minAmp=0.32 rootAmp=1-ampCompA :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-ampCompA rate freq root minAmp rootAmp = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Left rate) "AmpCompA" [freq,root,minAmp,rootAmp] Nothing 1 (Special 0) NoId---- | Amplitude follower------ Amplitude [ControlRate,AudioRate] in=0 attackTime=0.01 releaseTime=0.01-amplitude :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-amplitude rate in_ attackTime releaseTime = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Amplitude" [in_,attackTime,releaseTime] Nothing 1 (Special 0) NoId---- | All Pass Filter------ BAllPass [AudioRate] in=0 freq=1200 rq=1; FILTER: TRUE-bAllPass :: Ugen -> Ugen -> Ugen -> Ugen-bAllPass in_ freq rq = mkUgen Nothing [AudioRate] (Right [0]) "BAllPass" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | Band Pass Filter------ BBandPass [AudioRate] in=0 freq=1200 bw=1; FILTER: TRUE-bBandPass :: Ugen -> Ugen -> Ugen -> Ugen-bBandPass in_ freq bw = mkUgen Nothing [AudioRate] (Right [0]) "BBandPass" [in_,freq,bw] Nothing 1 (Special 0) NoId---- | Band reject filter------ BBandStop [AudioRate] in=0 freq=1200 bw=1; FILTER: TRUE-bBandStop :: Ugen -> Ugen -> Ugen -> Ugen-bBandStop in_ freq bw = mkUgen Nothing [AudioRate] (Right [0]) "BBandStop" [in_,freq,bw] Nothing 1 (Special 0) NoId---- | 12db/oct rolloff - 2nd order resonant Hi Pass Filter------ BHiPass [AudioRate] in=0 freq=1200 rq=1; FILTER: TRUE-bHiPass :: Ugen -> Ugen -> Ugen -> Ugen-bHiPass in_ freq rq = mkUgen Nothing [AudioRate] (Right [0]) "BHiPass" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | Hi Shelf------ BHiShelf [AudioRate] in=0 freq=1200 rs=1 db=0; FILTER: TRUE-bHiShelf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bHiShelf in_ freq rs db = mkUgen Nothing [AudioRate] (Right [0]) "BHiShelf" [in_,freq,rs,db] Nothing 1 (Special 0) NoId---- | 12db/oct rolloff - 2nd order resonant Low Pass Filter------ BLowPass [AudioRate] in=0 freq=1200 rq=1; FILTER: TRUE-bLowPass :: Ugen -> Ugen -> Ugen -> Ugen-bLowPass in_ freq rq = mkUgen Nothing [AudioRate] (Right [0]) "BLowPass" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | Low Shelf------ BLowShelf [AudioRate] in=0 freq=1200 rs=1 db=0; FILTER: TRUE-bLowShelf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bLowShelf in_ freq rs db = mkUgen Nothing [AudioRate] (Right [0]) "BLowShelf" [in_,freq,rs,db] Nothing 1 (Special 0) NoId---- | 2nd order Butterworth bandpass filter.------ BPF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE-bpf :: Ugen -> Ugen -> Ugen -> Ugen-bpf in_ freq rq = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "BPF" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | Two zero fixed midpass.------ BPZ2 [ControlRate,AudioRate] in=0; FILTER: TRUE-bpz2 :: Ugen -> Ugen-bpz2 in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "BPZ2" [in_] Nothing 1 (Special 0) NoId---- | Parametric equalizer------ BPeakEQ [AudioRate] in=0 freq=1200 rq=1 db=0; FILTER: TRUE-bPeakEQ :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bPeakEQ in_ freq rq db = mkUgen Nothing [AudioRate] (Right [0]) "BPeakEQ" [in_,freq,rq,db] Nothing 1 (Special 0) NoId---- | 2nd order Butterworth band reject filter.------ BRF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE-brf :: Ugen -> Ugen -> Ugen -> Ugen-brf in_ freq rq = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "BRF" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | Two zero fixed midcut.------ BRZ2 [ControlRate,AudioRate] in=0; FILTER: TRUE-brz2 :: Ugen -> Ugen-brz2 in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "BRZ2" [in_] Nothing 1 (Special 0) NoId---- | Stereo signal balancer------ Balance2 [ControlRate,AudioRate] left=0 right=0 pos=0 level=1; FILTER: TRUE-balance2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-balance2 left right pos level = mkUgen Nothing [ControlRate,AudioRate] (Right [0,1]) "Balance2" [left,right,pos,level] Nothing 2 (Special 0) NoId---- | physical model of bouncing object------ Ball [ControlRate,AudioRate] in=0 g=1 damp=0 friction=0.01-ball :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-ball rate in_ g damp friction_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Ball" [in_,g,damp,friction_] Nothing 1 (Special 0) NoId---- | Autocorrelation beat tracker------ BeatTrack [ControlRate] chain=0 lock=0-beatTrack :: Rate -> Ugen -> Ugen -> Ugen-beatTrack rate chain lock = mkUgen Nothing [ControlRate] (Left rate) "BeatTrack" [chain,lock] Nothing 4 (Special 0) NoId---- | Template matching beat tracker------ BeatTrack2 [ControlRate] busindex=0 numfeatures=0 windowsize=2 phaseaccuracy=0.02 lock=0 weightingscheme=0-beatTrack2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-beatTrack2 rate busindex numfeatures windowsize phaseaccuracy lock weightingscheme = mkUgen Nothing [ControlRate] (Left rate) "BeatTrack2" [busindex,numfeatures,windowsize,phaseaccuracy,lock,weightingscheme] Nothing 6 (Special 0) NoId---- | 2D Ambisonic B-format panner.------ BiPanB2 [ControlRate,AudioRate] inA=0 inB=0 azimuth=0 gain=1-biPanB2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-biPanB2 rate inA inB azimuth gain = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "BiPanB2" [inA,inB,azimuth,gain] Nothing 3 (Special 0) NoId---- | Band limited impulse oscillator.------ Blip [ControlRate,AudioRate] freq=440 numharm=200-blip :: Rate -> Ugen -> Ugen -> Ugen-blip rate freq numharm = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Blip" [freq,numharm] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BlockSize [InitialisationRate]-blockSize :: Ugen-blockSize = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "BlockSize" [] Nothing 1 (Special 0) NoId---- | Brown Noise.------ BrownNoise [ControlRate,AudioRate] ; NONDET-brownNoiseId :: ID a => a -> Rate -> Ugen-brownNoiseId z rate = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "BrownNoise" [] Nothing 1 (Special 0) (toUid z)---- | Monad variant of BrownNoise.-brownNoiseM :: Uid m => Rate -> m Ugen-brownNoiseM = liftUid1 brownNoiseId---- | Unsafe variant of BrownNoise.-brownNoise :: Rate -> Ugen-brownNoise = liftUnsafe1 brownNoiseM---- | Buffer based all pass delay line with cubic interpolation.------ BufAllpassC [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE-bufAllpassC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufAllpassC buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufAllpassC" [buf,in_,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Buffer based all pass delay line with linear interpolation.------ BufAllpassL [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE-bufAllpassL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufAllpassL buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufAllpassL" [buf,in_,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Buffer based all pass delay line with no interpolation.------ BufAllpassN [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE-bufAllpassN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufAllpassN buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufAllpassN" [buf,in_,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Current number of channels of soundfile in buffer.------ BufChannels [InitialisationRate,ControlRate] bufnum=0-bufChannels :: Rate -> Ugen -> Ugen-bufChannels rate bufnum = mkUgen Nothing [InitialisationRate,ControlRate] (Left rate) "BufChannels" [bufnum] Nothing 1 (Special 0) NoId---- | Buffer based comb delay line with cubic interpolation.------ BufCombC [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE-bufCombC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufCombC buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufCombC" [buf,in_,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Buffer based comb delay line with linear interpolation.------ BufCombL [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE-bufCombL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufCombL buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufCombL" [buf,in_,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Buffer based comb delay line with no interpolation.------ BufCombN [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE-bufCombN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufCombN buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufCombN" [buf,in_,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Buffer based simple delay line with cubic interpolation.------ BufDelayC [ControlRate,AudioRate] buf=0 in=0 delaytime=0.2; FILTER: TRUE-bufDelayC :: Ugen -> Ugen -> Ugen -> Ugen-bufDelayC buf in_ delaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "BufDelayC" [buf,in_,delaytime] Nothing 1 (Special 0) NoId---- | Buffer based simple delay line with linear interpolation.------ BufDelayL [ControlRate,AudioRate] buf=0 in=0 delaytime=0.2; FILTER: TRUE-bufDelayL :: Ugen -> Ugen -> Ugen -> Ugen-bufDelayL buf in_ delaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "BufDelayL" [buf,in_,delaytime] Nothing 1 (Special 0) NoId---- | Buffer based simple delay line with no interpolation.------ BufDelayN [ControlRate,AudioRate] buf=0 in=0 delaytime=0.2; FILTER: TRUE-bufDelayN :: Ugen -> Ugen -> Ugen -> Ugen-bufDelayN buf in_ delaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "BufDelayN" [buf,in_,delaytime] Nothing 1 (Special 0) NoId---- | Current duration of soundfile in buffer.------ BufDur [InitialisationRate,ControlRate] bufnum=0-bufDur :: Rate -> Ugen -> Ugen-bufDur rate bufnum = mkUgen Nothing [InitialisationRate,ControlRate] (Left rate) "BufDur" [bufnum] Nothing 1 (Special 0) NoId---- | Current number of frames allocated in the buffer.------ BufFrames [InitialisationRate,ControlRate] bufnum=0-bufFrames :: Rate -> Ugen -> Ugen-bufFrames rate bufnum = mkUgen Nothing [InitialisationRate,ControlRate] (Left rate) "BufFrames" [bufnum] Nothing 1 (Special 0) NoId---- | Buffer rate scaling in respect to server samplerate.------ BufRateScale [InitialisationRate,ControlRate] bufnum=0-bufRateScale :: Rate -> Ugen -> Ugen-bufRateScale rate bufnum = mkUgen Nothing [InitialisationRate,ControlRate] (Left rate) "BufRateScale" [bufnum] Nothing 1 (Special 0) NoId---- | Buffer reading oscillator.------ BufRd [ControlRate,AudioRate] bufnum=0 phase=0 loop=1 interpolation=2; NC INPUT: True, ENUMERATION INPUTS: 2=Loop, 3=Interpolation-bufRd :: Int -> Rate -> Ugen -> Ugen -> Loop Ugen -> Interpolation Ugen -> Ugen-bufRd numChannels rate bufnum phase loop interpolation = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "BufRd" [bufnum,phase,(from_loop loop),(from_interpolation interpolation)] Nothing numChannels (Special 0) NoId---- | Buffer sample rate.------ BufSampleRate [InitialisationRate,ControlRate] bufnum=0-bufSampleRate :: Rate -> Ugen -> Ugen-bufSampleRate rate bufnum = mkUgen Nothing [InitialisationRate,ControlRate] (Left rate) "BufSampleRate" [bufnum] Nothing 1 (Special 0) NoId---- | Current number of samples in buffer.------ BufSamples [InitialisationRate,ControlRate] bufnum=0-bufSamples :: Rate -> Ugen -> Ugen-bufSamples rate bufnum = mkUgen Nothing [InitialisationRate,ControlRate] (Left rate) "BufSamples" [bufnum] Nothing 1 (Special 0) NoId---- | Buffer writing oscillator.------ BufWr [ControlRate,AudioRate] bufnum=0 phase=0 loop=1 *inputArray=0; MCE=1, FILTER: TRUE, REORDERS INPUTS: [3,0,1,2], ENUMERATION INPUTS: 2=Loop-bufWr :: Ugen -> Ugen -> Loop Ugen -> Ugen -> Ugen-bufWr bufnum phase loop inputArray = mkUgen Nothing [ControlRate,AudioRate] (Right [3]) "BufWr" [bufnum,phase,(from_loop loop)] (Just [inputArray]) 1 (Special 0) NoId---- | Chorusing wavetable oscillator.------ COsc [ControlRate,AudioRate] bufnum=0 freq=440 beats=0.5-cOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-cOsc rate bufnum freq beats = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "COsc" [bufnum,freq,beats] Nothing 1 (Special 0) NoId---- | Test for infinity, not-a-number, and denormals------ CheckBadValues [ControlRate,AudioRate] in=0 id=0 post=2; FILTER: TRUE-checkBadValues :: Ugen -> Ugen -> Ugen -> Ugen-checkBadValues in_ id_ post = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "CheckBadValues" [in_,id_,post] Nothing 1 (Special 0) NoId---- | Clip a signal outside given thresholds.------ Clip [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE-clip :: Ugen -> Ugen -> Ugen -> Ugen-clip in_ lo hi = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0]) "Clip" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | Clip Noise.------ ClipNoise [ControlRate,AudioRate] ; NONDET-clipNoiseId :: ID a => a -> Rate -> Ugen-clipNoiseId z rate = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "ClipNoise" [] Nothing 1 (Special 0) (toUid z)---- | Monad variant of ClipNoise.-clipNoiseM :: Uid m => Rate -> m Ugen-clipNoiseM = liftUid1 clipNoiseId---- | Unsafe variant of ClipNoise.-clipNoise :: Rate -> Ugen-clipNoise = liftUnsafe1 clipNoiseM---- | Statistical gate.------ CoinGate [ControlRate,AudioRate] prob=0 in=0; FILTER: TRUE, NONDET-coinGateId :: ID a => a -> Ugen -> Ugen -> Ugen-coinGateId z prob in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "CoinGate" [prob,in_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of CoinGate.-coinGateM :: Uid m => Ugen -> Ugen -> m Ugen-coinGateM = liftUid2 coinGateId---- | Unsafe variant of CoinGate.-coinGate :: Ugen -> Ugen -> Ugen-coinGate = liftUnsafe2 coinGateM---- | Comb delay line with cubic interpolation.------ CombC [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE-combC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-combC in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "CombC" [in_,maxdelaytime,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Comb delay line with linear interpolation.------ CombL [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE-combL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-combL in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "CombL" [in_,maxdelaytime,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Comb delay line with no interpolation.------ CombN [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE-combN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-combN in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "CombN" [in_,maxdelaytime,delaytime,decaytime] Nothing 1 (Special 0) NoId---- | Compressor, expander, limiter, gate, ducker------ Compander [AudioRate] in=0 control=0 thresh=0.5 slopeBelow=1 slopeAbove=1 clampTime=0.01 relaxTime=0.1; FILTER: TRUE-compander :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-compander in_ control_ thresh slopeBelow slopeAbove clampTime relaxTime = mkUgen Nothing [AudioRate] (Right [0]) "Compander" [in_,control_,thresh,slopeBelow,slopeAbove,clampTime,relaxTime] Nothing 1 (Special 0) NoId---- | Compressor, expander, limiter, gate, ducker.------ CompanderD [AudioRate] in=0 thresh=0.5 slopeBelow=1 slopeAbove=1 clampTime=0.01 relaxTime=0.01-companderD :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-companderD rate in_ thresh slopeBelow slopeAbove clampTime relaxTime = mkUgen Nothing [AudioRate] (Left rate) "CompanderD" [in_,thresh,slopeBelow,slopeAbove,clampTime,relaxTime] Nothing 1 (Special 0) NoId---- | Duration of one block------ ControlDur [InitialisationRate]-controlDur :: Ugen-controlDur = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "ControlDur" [] Nothing 1 (Special 0) NoId---- | Server control rate.------ ControlRate [InitialisationRate]-controlRate :: Ugen-controlRate = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "ControlRate" [] Nothing 1 (Special 0) NoId---- | Real-time convolver.------ Convolution [AudioRate] in=0 kernel=0 framesize=512-convolution :: Ugen -> Ugen -> Ugen -> Ugen-convolution in_ kernel framesize = mkUgen Nothing [AudioRate] (Left AudioRate) "Convolution" [in_,kernel,framesize] Nothing 1 (Special 0) NoId---- | Real-time fixed kernel convolver.------ Convolution2 [AudioRate] in=0 kernel=0 trigger=0 framesize=2048-convolution2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-convolution2 in_ kernel trigger framesize = mkUgen Nothing [AudioRate] (Left AudioRate) "Convolution2" [in_,kernel,trigger,framesize] Nothing 1 (Special 0) NoId---- | Real-time convolver with linear interpolation------ Convolution2L [AudioRate] in=0 kernel=0 trigger=0 framesize=2048 crossfade=1-convolution2L :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-convolution2L rate in_ kernel trigger framesize crossfade = mkUgen Nothing [AudioRate] (Left rate) "Convolution2L" [in_,kernel,trigger,framesize,crossfade] Nothing 1 (Special 0) NoId---- | Time based convolver.------ Convolution3 [ControlRate,AudioRate] in=0 kernel=0 trigger=0 framesize=2048-convolution3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-convolution3 rate in_ kernel trigger framesize = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Convolution3" [in_,kernel,trigger,framesize] Nothing 1 (Special 0) NoId---- | Chaotic noise function.------ Crackle [ControlRate,AudioRate] chaosParam=1.5-crackle :: Rate -> Ugen -> Ugen-crackle rate chaosParam = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Crackle" [chaosParam] Nothing 1 (Special 0) NoId---- | Cusp map chaotic generator------ CuspL [AudioRate] freq=22050 a=1 b=1.9 xi=0-cuspL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-cuspL rate freq a b xi = mkUgen Nothing [AudioRate] (Left rate) "CuspL" [freq,a,b,xi] Nothing 1 (Special 0) NoId---- | Cusp map chaotic generator------ CuspN [AudioRate] freq=22050 a=1 b=1.9 xi=0-cuspN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-cuspN rate freq a b xi = mkUgen Nothing [AudioRate] (Left rate) "CuspN" [freq,a,b,xi] Nothing 1 (Special 0) NoId---- | Create a constant amplitude signal------ DC [ControlRate,AudioRate] in=0-dc :: Rate -> Ugen -> Ugen-dc rate in_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "DC" [in_] Nothing 1 (Special 0) NoId---- | Demand rate brownian movement generator.------ Dbrown [DemandRate] length=100000000 lo=0 hi=1 step=0.01; REORDERS INPUTS: [1,2,3,0], DEMAND/NONDET-dbrownId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dbrownId z length_ lo hi step = mkUgen Nothing [DemandRate] (Left DemandRate) "Dbrown" [length_,lo,hi,step] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dbrown.-dbrownM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-dbrownM = liftUid4 dbrownId---- | Unsafe variant of Dbrown.-dbrown :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dbrown = liftUnsafe4 dbrownM---- | Buffer read demand ugen------ Dbufrd [DemandRate] bufnum=0 phase=0 loop=1; ENUMERATION INPUTS: 2=Loop, DEMAND/NONDET-dbufrdId :: ID a => a -> Ugen -> Ugen -> Loop Ugen -> Ugen-dbufrdId z bufnum phase loop = mkUgen Nothing [DemandRate] (Left DemandRate) "Dbufrd" [bufnum,phase,(from_loop loop)] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dbufrd.-dbufrdM :: Uid m => Ugen -> Ugen -> Loop Ugen -> m Ugen-dbufrdM = liftUid3 dbufrdId---- | Unsafe variant of Dbufrd.-dbufrd :: Ugen -> Ugen -> Loop Ugen -> Ugen-dbufrd = liftUnsafe3 dbufrdM---- | Buffer write demand ugen------ Dbufwr [DemandRate] bufnum=0 phase=0 input=0 loop=1; REORDERS INPUTS: [2,0,1,3], ENUMERATION INPUTS: 3=Loop, DEMAND/NONDET-dbufwrId :: ID a => a -> Ugen -> Ugen -> Ugen -> Loop Ugen -> Ugen-dbufwrId z bufnum phase input loop = mkUgen Nothing [DemandRate] (Left DemandRate) "Dbufwr" [bufnum,phase,input,(from_loop loop)] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dbufwr.-dbufwrM :: Uid m => Ugen -> Ugen -> Ugen -> Loop Ugen -> m Ugen-dbufwrM = liftUid4 dbufwrId---- | Unsafe variant of Dbufwr.-dbufwr :: Ugen -> Ugen -> Ugen -> Loop Ugen -> Ugen-dbufwr = liftUnsafe4 dbufwrM---- | Constrain a demand-rate stream to a given sum------ Dconst [DemandRate] sum=0 in=0 tolerance=0.001; DEMAND/NONDET-dconstId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-dconstId z sum_ in_ tolerance = mkUgen Nothing [DemandRate] (Left DemandRate) "Dconst" [sum_,in_,tolerance] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dconst.-dconstM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-dconstM = liftUid3 dconstId---- | Unsafe variant of Dconst.-dconst :: Ugen -> Ugen -> Ugen -> Ugen-dconst = liftUnsafe3 dconstM---- | Exponential decay------ Decay [ControlRate,AudioRate] in=0 decayTime=1; FILTER: TRUE-decay :: Ugen -> Ugen -> Ugen-decay in_ decayTime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Decay" [in_,decayTime] Nothing 1 (Special 0) NoId---- | Exponential decay------ Decay2 [ControlRate,AudioRate] in=0 attackTime=0.01 decayTime=1; FILTER: TRUE-decay2 :: Ugen -> Ugen -> Ugen -> Ugen-decay2 in_ attackTime decayTime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Decay2" [in_,attackTime,decayTime] Nothing 1 (Special 0) NoId---- | 2D Ambisonic B-format decoder.------ DecodeB2 [ControlRate,AudioRate] w=0 x=0 y=0 orientation=0.5; NC INPUT: True, FILTER: TRUE-decodeB2 :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-decodeB2 numChannels w x y orientation = mkUgen Nothing [ControlRate,AudioRate] (Right [0,1,2]) "DecodeB2" [w,x,y,orientation] Nothing numChannels (Special 0) NoId---- | Convert signal to modal pitch.------ DegreeToKey [ControlRate,AudioRate] bufnum=0 in=0 octave=12; FILTER: TRUE-degreeToKey :: Ugen -> Ugen -> Ugen -> Ugen-degreeToKey bufnum in_ octave = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "DegreeToKey" [bufnum,in_,octave] Nothing 1 (Special 0) NoId---- | Tap a delay line from a DelTapWr Ugen------ DelTapRd [ControlRate,AudioRate] buffer=0 phase=0 delTime=0 interp=1; FILTER: TRUE-delTapRd :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-delTapRd buffer phase delTime interp = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "DelTapRd" [buffer,phase,delTime,interp] Nothing 1 (Special 0) NoId---- | Write to a buffer for a DelTapRd Ugen------ DelTapWr [ControlRate,AudioRate] buffer=0 in=0; FILTER: TRUE-delTapWr :: Ugen -> Ugen -> Ugen-delTapWr buffer in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "DelTapWr" [buffer,in_] Nothing 1 (Special 0) NoId---- | Single sample delay.------ Delay1 [ControlRate,AudioRate] in=0; FILTER: TRUE-delay1 :: Ugen -> Ugen-delay1 in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Delay1" [in_] Nothing 1 (Special 0) NoId---- | Two sample delay.------ Delay2 [ControlRate,AudioRate] in=0; FILTER: TRUE-delay2 :: Ugen -> Ugen-delay2 in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Delay2" [in_] Nothing 1 (Special 0) NoId---- | Simple delay line with cubic interpolation.------ DelayC [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2; FILTER: TRUE-delayC :: Ugen -> Ugen -> Ugen -> Ugen-delayC in_ maxdelaytime delaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "DelayC" [in_,maxdelaytime,delaytime] Nothing 1 (Special 0) NoId---- | Simple delay line with linear interpolation.------ DelayL [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2; FILTER: TRUE-delayL :: Ugen -> Ugen -> Ugen -> Ugen-delayL in_ maxdelaytime delaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "DelayL" [in_,maxdelaytime,delaytime] Nothing 1 (Special 0) NoId---- | Simple delay line with no interpolation.------ DelayN [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2; FILTER: TRUE-delayN :: Ugen -> Ugen -> Ugen -> Ugen-delayN in_ maxdelaytime delaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "DelayN" [in_,maxdelaytime,delaytime] Nothing 1 (Special 0) NoId---- | Demand results from demand rate Ugens.------ Demand [ControlRate,AudioRate] trig=0 reset=0 *demandUgens=0; MCE=1, FILTER: TRUE-demand :: Ugen -> Ugen -> Ugen -> Ugen-demand trig_ reset demandUgens = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Demand" [trig_,reset] (Just [demandUgens]) (length (mceChannels demandUgens) + 0) (Special 0) NoId---- | Demand rate envelope generator------ DemandEnvGen [ControlRate,AudioRate] level=0 dur=0 shape=1 curve=0 gate=1 reset=1 levelScale=1 levelBias=0 timeScale=1 doneAction=0; ENUMERATION INPUTS: 9=DoneAction-demandEnvGen :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen-demandEnvGen rate level dur shape curve gate_ reset levelScale levelBias timeScale doneAction = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "DemandEnvGen" [level,dur,shape,curve,gate_,reset,levelScale,levelBias,timeScale,(from_done_action doneAction)] Nothing 1 (Special 0) NoId---- | Search a buffer for a value------ DetectIndex [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE-detectIndex :: Ugen -> Ugen -> Ugen-detectIndex bufnum in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "DetectIndex" [bufnum,in_] Nothing 1 (Special 0) NoId---- | Detect when input falls below an amplitude threshold------ DetectSilence [ControlRate,AudioRate] in=0 amp=0.0001 time=0.1 doneAction=0; FILTER: TRUE, ENUMERATION INPUTS: 3=DoneAction-detectSilence :: Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen-detectSilence in_ amp time doneAction = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "DetectSilence" [in_,amp,time,(from_done_action doneAction)] Nothing 1 (Special 0) NoId---- | Demand rate geometric series Ugen.------ Dgeom [DemandRate] length=100000000 start=1 grow=2; REORDERS INPUTS: [1,2,0], DEMAND/NONDET-dgeomId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-dgeomId z length_ start grow = mkUgen Nothing [DemandRate] (Left DemandRate) "Dgeom" [length_,start,grow] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dgeom.-dgeomM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-dgeomM = liftUid3 dgeomId---- | Unsafe variant of Dgeom.-dgeom :: Ugen -> Ugen -> Ugen -> Ugen-dgeom = liftUnsafe3 dgeomM---- | Demand rate brownian movement generator.------ Dibrown [DemandRate] length=100000000 lo=0 hi=1 step=0.01; REORDERS INPUTS: [1,2,3,0], DEMAND/NONDET-dibrownId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dibrownId z length_ lo hi step = mkUgen Nothing [DemandRate] (Left DemandRate) "Dibrown" [length_,lo,hi,step] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dibrown.-dibrownM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-dibrownM = liftUid4 dibrownId---- | Unsafe variant of Dibrown.-dibrown :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dibrown = liftUnsafe4 dibrownM---- | Stream in audio from a file.------ DiskIn [AudioRate] bufnum=0 loop=0; NC INPUT: True, ENUMERATION INPUTS: 1=Loop-diskIn :: Int -> Ugen -> Loop Ugen -> Ugen-diskIn numChannels bufnum loop = mkUgen Nothing [AudioRate] (Left AudioRate) "DiskIn" [bufnum,(from_loop loop)] Nothing numChannels (Special 0) NoId---- | Record to a soundfile to disk.------ DiskOut [AudioRate] bufnum=0 *channelsArray=0; MCE=1-diskOut :: Ugen -> Ugen -> Ugen-diskOut bufnum input = mkUgen Nothing [AudioRate] (Left AudioRate) "DiskOut" [bufnum] (Just [input]) 1 (Special 0) NoId---- | Demand rate white noise random generator.------ Diwhite [DemandRate] length=100000000 lo=0 hi=1; REORDERS INPUTS: [1,2,0], DEMAND/NONDET-diwhiteId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-diwhiteId z length_ lo hi = mkUgen Nothing [DemandRate] (Left DemandRate) "Diwhite" [length_,lo,hi] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Diwhite.-diwhiteM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-diwhiteM = liftUid3 diwhiteId---- | Unsafe variant of Diwhite.-diwhite :: Ugen -> Ugen -> Ugen -> Ugen-diwhite = liftUnsafe3 diwhiteM---- | Monitors another Ugen to see when it is finished------ Done [ControlRate] src=0-done :: Ugen -> Ugen-done src = mkUgen Nothing [ControlRate] (Left ControlRate) "Done" [src] Nothing 1 (Special 0) NoId---- | Print the current output value of a demand rate Ugen------ Dpoll [DemandRate] in=0 label=0 run=1 trigid=-1; DEMAND/NONDET-dpollId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dpollId z in_ label_ run trigid = mkUgen Nothing [DemandRate] (Left DemandRate) "Dpoll" [in_,label_,run,trigid] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dpoll.-dpollM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-dpollM = liftUid4 dpollId---- | Unsafe variant of Dpoll.-dpoll :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dpoll = liftUnsafe4 dpollM---- | Demand rate random sequence generator.------ Drand [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET-drandId :: ID a => a -> Ugen -> Ugen -> Ugen-drandId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Drand" [repeats] (Just [list_]) 1 (Special 0) (toUid z)---- | Monad variant of Drand.-drandM :: Uid m => Ugen -> Ugen -> m Ugen-drandM = liftUid2 drandId---- | Unsafe variant of Drand.-drand :: Ugen -> Ugen -> Ugen-drand = liftUnsafe2 drandM---- | demand rate reset------ Dreset [DemandRate] in=0 reset=0; DEMAND/NONDET-dresetId :: ID a => a -> Ugen -> Ugen -> Ugen-dresetId z in_ reset = mkUgen Nothing [DemandRate] (Left DemandRate) "Dreset" [in_,reset] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dreset.-dresetM :: Uid m => Ugen -> Ugen -> m Ugen-dresetM = liftUid2 dresetId---- | Unsafe variant of Dreset.-dreset :: Ugen -> Ugen -> Ugen-dreset = liftUnsafe2 dresetM---- | Demand rate sequence generator.------ Dseq [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET-dseqId :: ID a => a -> Ugen -> Ugen -> Ugen-dseqId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dseq" [repeats] (Just [list_]) 1 (Special 0) (toUid z)---- | Monad variant of Dseq.-dseqM :: Uid m => Ugen -> Ugen -> m Ugen-dseqM = liftUid2 dseqId---- | Unsafe variant of Dseq.-dseq :: Ugen -> Ugen -> Ugen-dseq = liftUnsafe2 dseqM---- | Demand rate sequence generator.------ Dser [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET-dserId :: ID a => a -> Ugen -> Ugen -> Ugen-dserId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dser" [repeats] (Just [list_]) 1 (Special 0) (toUid z)---- | Monad variant of Dser.-dserM :: Uid m => Ugen -> Ugen -> m Ugen-dserM = liftUid2 dserId---- | Unsafe variant of Dser.-dser :: Ugen -> Ugen -> Ugen-dser = liftUnsafe2 dserM---- | Demand rate arithmetic series Ugen.------ Dseries [DemandRate] length=100000000 start=1 step=1; REORDERS INPUTS: [1,2,0], DEMAND/NONDET-dseriesId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-dseriesId z length_ start step = mkUgen Nothing [DemandRate] (Left DemandRate) "Dseries" [length_,start,step] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dseries.-dseriesM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-dseriesM = liftUid3 dseriesId---- | Unsafe variant of Dseries.-dseries :: Ugen -> Ugen -> Ugen -> Ugen-dseries = liftUnsafe3 dseriesM---- | Demand rate random sequence generator------ Dshuf [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET-dshufId :: ID a => a -> Ugen -> Ugen -> Ugen-dshufId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dshuf" [repeats] (Just [list_]) 1 (Special 0) (toUid z)---- | Monad variant of Dshuf.-dshufM :: Uid m => Ugen -> Ugen -> m Ugen-dshufM = liftUid2 dshufId---- | Unsafe variant of Dshuf.-dshuf :: Ugen -> Ugen -> Ugen-dshuf = liftUnsafe2 dshufM---- | Demand rate input replicator------ Dstutter [DemandRate] n=0 in=0; DEMAND/NONDET-dstutterId :: ID a => a -> Ugen -> Ugen -> Ugen-dstutterId z n in_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dstutter" [n,in_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dstutter.-dstutterM :: Uid m => Ugen -> Ugen -> m Ugen-dstutterM = liftUid2 dstutterId---- | Unsafe variant of Dstutter.-dstutter :: Ugen -> Ugen -> Ugen-dstutter = liftUnsafe2 dstutterM---- | Demand rate generator for embedding different inputs------ Dswitch [DemandRate] index=0 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET-dswitchId :: ID a => a -> Ugen -> Ugen -> Ugen-dswitchId z index_ list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dswitch" [index_] (Just [list_]) 1 (Special 0) (toUid z)---- | Monad variant of Dswitch.-dswitchM :: Uid m => Ugen -> Ugen -> m Ugen-dswitchM = liftUid2 dswitchId---- | Unsafe variant of Dswitch.-dswitch :: Ugen -> Ugen -> Ugen-dswitch = liftUnsafe2 dswitchM---- | Demand rate generator for switching between inputs.------ Dswitch1 [DemandRate] index=0 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET-dswitch1Id :: ID a => a -> Ugen -> Ugen -> Ugen-dswitch1Id z index_ list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dswitch1" [index_] (Just [list_]) 1 (Special 0) (toUid z)---- | Monad variant of Dswitch1.-dswitch1M :: Uid m => Ugen -> Ugen -> m Ugen-dswitch1M = liftUid2 dswitch1Id---- | Unsafe variant of Dswitch1.-dswitch1 :: Ugen -> Ugen -> Ugen-dswitch1 = liftUnsafe2 dswitch1M---- | Return the same unique series of values for several demand streams------ Dunique [DemandRate] source=0 maxBufferSize=1024 protected=1; DEMAND/NONDET-duniqueId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-duniqueId z source maxBufferSize protected = mkUgen Nothing [DemandRate] (Left DemandRate) "Dunique" [source,maxBufferSize,protected] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dunique.-duniqueM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-duniqueM = liftUid3 duniqueId---- | Unsafe variant of Dunique.-dunique :: Ugen -> Ugen -> Ugen -> Ugen-dunique = liftUnsafe3 duniqueM---- | Random impulses.------ Dust [ControlRate,AudioRate] density=0; NONDET-dustId :: ID a => a -> Rate -> Ugen -> Ugen-dustId z rate density = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Dust" [density] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dust.-dustM :: Uid m => Rate -> Ugen -> m Ugen-dustM = liftUid2 dustId---- | Unsafe variant of Dust.-dust :: Rate -> Ugen -> Ugen-dust = liftUnsafe2 dustM---- | Random impulses.------ Dust2 [ControlRate,AudioRate] density=0; NONDET-dust2Id :: ID a => a -> Rate -> Ugen -> Ugen-dust2Id z rate density = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Dust2" [density] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dust2.-dust2M :: Uid m => Rate -> Ugen -> m Ugen-dust2M = liftUid2 dust2Id---- | Unsafe variant of Dust2.-dust2 :: Rate -> Ugen -> Ugen-dust2 = liftUnsafe2 dust2M---- | Demand results from demand rate Ugens.------ Duty [ControlRate,AudioRate] dur=1 reset=0 doneAction=0 level=1; REORDERS INPUTS: [0,1,3,2], ENUMERATION INPUTS: 2=DoneAction-duty :: Rate -> Ugen -> Ugen -> DoneAction Ugen -> Ugen -> Ugen-duty rate dur reset doneAction level = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Duty" [dur,reset,(from_done_action doneAction),level] Nothing 1 (Special 0) NoId---- | Demand rate white noise random generator.------ Dwhite [DemandRate] length=100000000 lo=0 hi=1; REORDERS INPUTS: [1,2,0], DEMAND/NONDET-dwhiteId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-dwhiteId z length_ lo hi = mkUgen Nothing [DemandRate] (Left DemandRate) "Dwhite" [length_,lo,hi] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dwhite.-dwhiteM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-dwhiteM = liftUid3 dwhiteId---- | Unsafe variant of Dwhite.-dwhite :: Ugen -> Ugen -> Ugen -> Ugen-dwhite = liftUnsafe3 dwhiteM--{---- | Demand rate weighted random sequence generator------ Dwrand [DemandRate] repeats=1 weights=0 *list=0; MCE=1, REORDERS INPUTS: [2,1,0], DEMAND/NONDET-dwrandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-dwrandId z repeats weights list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dwrand" [repeats,weights] (Just [list_]) 1 (Special 0) (toUid z)---- | Monad variant of Dwrand.-dwrandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-dwrandM = liftUid3 dwrandId---- | Unsafe variant of Dwrand.-dwrand :: Ugen -> Ugen -> Ugen -> Ugen-dwrand = liftUnsafe3 dwrandM--}---- | Demand rate random sequence generator.------ Dxrand [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET-dxrandId :: ID a => a -> Ugen -> Ugen -> Ugen-dxrandId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dxrand" [repeats] (Just [list_]) 1 (Special 0) (toUid z)---- | Monad variant of Dxrand.-dxrandM :: Uid m => Ugen -> Ugen -> m Ugen-dxrandM = liftUid2 dxrandId---- | Unsafe variant of Dxrand.-dxrand :: Ugen -> Ugen -> Ugen-dxrand = liftUnsafe2 dxrandM---- | Envelope generator------ EnvGen [ControlRate,AudioRate] gate=1 levelScale=1 levelBias=0 timeScale=1 doneAction=0 *envelope=0; MCE=1, REORDERS INPUTS: [5,0,1,2,3,4], ENUMERATION INPUTS: 4=DoneAction, 5=Envelope-envGen :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Envelope Ugen -> Ugen-envGen rate gate_ levelScale levelBias timeScale doneAction envelope_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "EnvGen" [gate_,levelScale,levelBias,timeScale,(from_done_action doneAction)] (Just [(envelope_to_ugen envelope_)]) 1 (Special 0) NoId---- | Exponential single random number generator.------ ExpRand [InitialisationRate] lo=0.01 hi=1; NONDET-expRandId :: ID a => a -> Ugen -> Ugen -> Ugen-expRandId z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "ExpRand" [lo,hi] Nothing 1 (Special 0) (toUid z)---- | Monad variant of ExpRand.-expRandM :: Uid m => Ugen -> Ugen -> m Ugen-expRandM = liftUid2 expRandId---- | Unsafe variant of ExpRand.-expRand :: Ugen -> Ugen -> Ugen-expRand = liftUnsafe2 expRandM---- | Feedback sine with chaotic phase indexing------ FBSineC [AudioRate] freq=22050 im=1 fb=0.1 a=1.1 c=0.5 xi=0.1 yi=0.1-fbSineC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fbSineC rate freq im fb a c xi yi = mkUgen Nothing [AudioRate] (Left rate) "FBSineC" [freq,im,fb,a,c,xi,yi] Nothing 1 (Special 0) NoId---- | Feedback sine with chaotic phase indexing------ FBSineL [AudioRate] freq=22050 im=1 fb=0.1 a=1.1 c=0.5 xi=0.1 yi=0.1-fbSineL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fbSineL rate freq im fb a c xi yi = mkUgen Nothing [AudioRate] (Left rate) "FBSineL" [freq,im,fb,a,c,xi,yi] Nothing 1 (Special 0) NoId---- | Feedback sine with chaotic phase indexing------ FBSineN [AudioRate] freq=22050 im=1 fb=0.1 a=1.1 c=0.5 xi=0.1 yi=0.1-fbSineN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fbSineN rate freq im fb a c xi yi = mkUgen Nothing [AudioRate] (Left rate) "FBSineN" [freq,im,fb,a,c,xi,yi] Nothing 1 (Special 0) NoId---- | Fast Fourier Transform------ FFT [ControlRate] buffer=0 in=0 hop=0.5 wintype=0 active=1 winsize=0-fft :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fft buffer in_ hop wintype active winsize = mkUgen Nothing [ControlRate] (Left ControlRate) "FFT" [buffer,in_,hop,wintype,active,winsize] Nothing 1 (Special 0) NoId---- | First order filter section.------ FOS [ControlRate,AudioRate] in=0 a0=0 a1=0 b1=0; FILTER: TRUE-fos :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fos in_ a0 a1 b1 = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "FOS" [in_,a0,a1,b1] Nothing 1 (Special 0) NoId---- | Fast sine oscillator.------ FSinOsc [ControlRate,AudioRate] freq=440 iphase=0-fSinOsc :: Rate -> Ugen -> Ugen -> Ugen-fSinOsc rate freq iphase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "FSinOsc" [freq,iphase] Nothing 1 (Special 0) NoId---- | Fold a signal outside given thresholds.------ Fold [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE-fold :: Ugen -> Ugen -> Ugen -> Ugen-fold in_ lo hi = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0]) "Fold" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | Formant oscillator------ Formant [AudioRate] fundfreq=440 formfreq=1760 bwfreq=880-formant :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-formant rate fundfreq formfreq bwfreq = mkUgen Nothing [AudioRate] (Left rate) "Formant" [fundfreq,formfreq,bwfreq] Nothing 1 (Special 0) NoId---- | FOF-like filter.------ Formlet [ControlRate,AudioRate] in=0 freq=440 attacktime=1 decaytime=1; FILTER: TRUE-formlet :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-formlet in_ freq attacktime decaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Formlet" [in_,freq,attacktime,decaytime] Nothing 1 (Special 0) NoId---- | When triggered, frees a node.------ Free [ControlRate] trig=0 id=0; FILTER: TRUE-free :: Ugen -> Ugen -> Ugen-free trig_ id_ = mkUgen Nothing [ControlRate] (Right [0]) "Free" [trig_,id_] Nothing 1 (Special 0) NoId---- | When triggered, free enclosing synth.------ FreeSelf [ControlRate] in=0-freeSelf :: Ugen -> Ugen-freeSelf in_ = mkUgen Nothing [ControlRate] (Left ControlRate) "FreeSelf" [in_] Nothing 1 (Special 0) NoId---- | Free the enclosing synth when a Ugen is finished------ FreeSelfWhenDone [ControlRate] src=0-freeSelfWhenDone :: Ugen -> Ugen-freeSelfWhenDone src = mkUgen Nothing [ControlRate] (Left ControlRate) "FreeSelfWhenDone" [src] Nothing 1 (Special 0) NoId---- | A reverb------ FreeVerb [AudioRate] in=0 mix=0.33 room=0.5 damp=0.5; FILTER: TRUE-freeVerb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-freeVerb in_ mix room damp = mkUgen Nothing [AudioRate] (Right [0]) "FreeVerb" [in_,mix,room,damp] Nothing 1 (Special 0) NoId---- | A two-channel reverb------ FreeVerb2 [AudioRate] in=0 in2=0 mix=0.33 room=0.5 damp=0.5; FILTER: TRUE-freeVerb2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-freeVerb2 in_ in2 mix room damp = mkUgen Nothing [AudioRate] (Right [0]) "FreeVerb2" [in_,in2,mix,room,damp] Nothing 2 (Special 0) NoId---- | Frequency Shifter.------ FreqShift [AudioRate] in=0 freq=0 phase=0-freqShift :: Ugen -> Ugen -> Ugen -> Ugen-freqShift in_ freq phase = mkUgen Nothing [AudioRate] (Left AudioRate) "FreqShift" [in_,freq,phase] Nothing 1 (Special 0) NoId---- | A two-channel reverb------ GVerb [AudioRate] in=0 roomsize=10 revtime=3 damping=0.5 inputbw=0.5 spread=15 drylevel=1 earlyreflevel=0.7 taillevel=0.5 maxroomsize=300; FILTER: TRUE-gVerb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gVerb in_ roomsize revtime damping inputbw spread drylevel earlyreflevel taillevel maxroomsize = mkUgen Nothing [AudioRate] (Right [0]) "GVerb" [in_,roomsize,revtime,damping,inputbw,spread,drylevel,earlyreflevel,taillevel,maxroomsize] Nothing 2 (Special 0) NoId---- | Gate or hold.------ Gate [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE-gate :: Ugen -> Ugen -> Ugen-gate in_ trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Gate" [in_,trig_] Nothing 1 (Special 0) NoId---- | Gingerbreadman map chaotic generator------ GbmanL [AudioRate] freq=22050 xi=1.2 yi=2.1-gbmanL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-gbmanL rate freq xi yi = mkUgen Nothing [AudioRate] (Left rate) "GbmanL" [freq,xi,yi] Nothing 1 (Special 0) NoId---- | Gingerbreadman map chaotic generator------ GbmanN [AudioRate] freq=22050 xi=1.2 yi=2.1-gbmanN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-gbmanN rate freq xi yi = mkUgen Nothing [AudioRate] (Left rate) "GbmanN" [freq,xi,yi] Nothing 1 (Special 0) NoId---- | Dynamic stochastic synthesis generator.------ Gendy1 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 minfreq=440 maxfreq=660 ampscale=0.5 durscale=0.5 initCPs=12 knum=0; NONDET-gendy1Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gendy1Id z rate ampdist durdist adparam ddparam minfreq maxfreq ampscale durscale initCPs knum = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Gendy1" [ampdist,durdist,adparam,ddparam,minfreq,maxfreq,ampscale,durscale,initCPs,knum] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Gendy1.-gendy1M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-gendy1M = liftUid11 gendy1Id---- | Unsafe variant of Gendy1.-gendy1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gendy1 = liftUnsafe11 gendy1M---- | Dynamic stochastic synthesis generator.------ Gendy2 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 minfreq=440 maxfreq=660 ampscale=0.5 durscale=0.5 initCPs=12 knum=0 a=1.17 c=0.31; NONDET-gendy2Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gendy2Id z rate ampdist durdist adparam ddparam minfreq maxfreq ampscale durscale initCPs knum a c = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Gendy2" [ampdist,durdist,adparam,ddparam,minfreq,maxfreq,ampscale,durscale,initCPs,knum,a,c] Nothing 1 (Special 0) (toUid z)--{---- | Monad variant of Gendy2.-gendy2M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-gendy2M = liftUid13 gendy2Id---- | Unsafe variant of Gendy2.-gendy2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gendy2 = liftUnsafe13 gendy2M--}--- | Dynamic stochastic synthesis generator.------ Gendy3 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 freq=440 ampscale=0.5 durscale=0.5 initCPs=12 knum=0; NONDET-gendy3Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gendy3Id z rate ampdist durdist adparam ddparam freq ampscale durscale initCPs knum = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Gendy3" [ampdist,durdist,adparam,ddparam,freq,ampscale,durscale,initCPs,knum] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Gendy3.-gendy3M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-gendy3M = liftUid10 gendy3Id---- | Unsafe variant of Gendy3.-gendy3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gendy3 = liftUnsafe10 gendy3M---- | Granular synthesis with sound stored in a buffer------ GrainBuf [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 interp=2 pan=0 envbufnum=-1 maxGrains=512; NC INPUT: True-grainBuf :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-grainBuf numChannels trigger dur sndbuf rate_ pos interp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left AudioRate) "GrainBuf" [trigger,dur,sndbuf,rate_,pos,interp,pan,envbufnum,maxGrains] Nothing numChannels (Special 0) NoId---- | Granular synthesis with frequency modulated sine tones------ GrainFM [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 pan=0 envbufnum=-1 maxGrains=512; NC INPUT: True-grainFM :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-grainFM numChannels trigger dur carfreq modfreq index_ pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left AudioRate) "GrainFM" [trigger,dur,carfreq,modfreq,index_,pan,envbufnum,maxGrains] Nothing numChannels (Special 0) NoId---- | Granulate an input signal------ GrainIn [AudioRate] trigger=0 dur=1 in=0 pan=0 envbufnum=-1 maxGrains=512; NC INPUT: True-grainIn :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-grainIn numChannels trigger dur in_ pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left AudioRate) "GrainIn" [trigger,dur,in_,pan,envbufnum,maxGrains] Nothing numChannels (Special 0) NoId---- | Granular synthesis with sine tones------ GrainSin [AudioRate] trigger=0 dur=1 freq=440 pan=0 envbufnum=-1 maxGrains=512; NC INPUT: True-grainSin :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-grainSin numChannels trigger dur freq pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left AudioRate) "GrainSin" [trigger,dur,freq,pan,envbufnum,maxGrains] Nothing numChannels (Special 0) NoId---- | Gray Noise.------ GrayNoise [ControlRate,AudioRate] ; NONDET-grayNoiseId :: ID a => a -> Rate -> Ugen-grayNoiseId z rate = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "GrayNoise" [] Nothing 1 (Special 0) (toUid z)---- | Monad variant of GrayNoise.-grayNoiseM :: Uid m => Rate -> m Ugen-grayNoiseM = liftUid1 grayNoiseId---- | Unsafe variant of GrayNoise.-grayNoise :: Rate -> Ugen-grayNoise = liftUnsafe1 grayNoiseM---- | 2nd order Butterworth highpass filter.------ HPF [ControlRate,AudioRate] in=0 freq=440; FILTER: TRUE-hpf :: Ugen -> Ugen -> Ugen-hpf in_ freq = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "HPF" [in_,freq] Nothing 1 (Special 0) NoId---- | Two point difference filter------ HPZ1 [ControlRate,AudioRate] in=0; FILTER: TRUE-hpz1 :: Ugen -> Ugen-hpz1 in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "HPZ1" [in_] Nothing 1 (Special 0) NoId---- | Two zero fixed midcut.------ HPZ2 [ControlRate,AudioRate] in=0; FILTER: TRUE-hpz2 :: Ugen -> Ugen-hpz2 in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "HPZ2" [in_] Nothing 1 (Special 0) NoId---- | Scrambled value with a hash function.------ Hasher [ControlRate,AudioRate] in=0; FILTER: TRUE-hasher :: Ugen -> Ugen-hasher in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Hasher" [in_] Nothing 1 (Special 0) NoId---- | Henon map chaotic generator------ HenonC [AudioRate] freq=22050 a=1.4 b=0.3 x0=0 x1=0-henonC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-henonC rate freq a b x0 x1 = mkUgen Nothing [AudioRate] (Left rate) "HenonC" [freq,a,b,x0,x1] Nothing 1 (Special 0) NoId---- | Henon map chaotic generator------ HenonL [AudioRate] freq=22050 a=1.4 b=0.3 x0=0 x1=0-henonL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-henonL rate freq a b x0 x1 = mkUgen Nothing [AudioRate] (Left rate) "HenonL" [freq,a,b,x0,x1] Nothing 1 (Special 0) NoId---- | Henon map chaotic generator------ HenonN [AudioRate] freq=22050 a=1.4 b=0.3 x0=0 x1=0-henonN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-henonN rate freq a b x0 x1 = mkUgen Nothing [AudioRate] (Left rate) "HenonN" [freq,a,b,x0,x1] Nothing 1 (Special 0) NoId---- | Applies the Hilbert transform to an input signal.------ Hilbert [AudioRate] in=0; FILTER: TRUE-hilbert :: Ugen -> Ugen-hilbert in_ = mkUgen Nothing [AudioRate] (Right [0]) "Hilbert" [in_] Nothing 2 (Special 0) NoId---- | Envelope generator for polling values from an Env------ IEnvGen [ControlRate,AudioRate] index=0 *envelope=0; MCE=1, REORDERS INPUTS: [1,0], ENUMERATION INPUTS: 1=IEnvelope-iEnvGen :: Rate -> Ugen -> Envelope Ugen -> Ugen-iEnvGen rate index_ envelope_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "IEnvGen" [index_] (Just [(envelope_to_ienvgen_ugen envelope_)]) 1 (Special 0) NoId---- | Inverse Fast Fourier Transform------ IFFT [ControlRate,AudioRate] buffer=0 wintype=0 winsize=0-ifft :: Ugen -> Ugen -> Ugen -> Ugen-ifft buffer wintype winsize = mkUgen Nothing [ControlRate,AudioRate] (Left AudioRate) "IFFT" [buffer,wintype,winsize] Nothing 1 (Special 0) NoId---- | Single integer random number generator.------ iRand [InitialisationRate] lo=0 hi=127; NONDET-iRandId :: ID a => a -> Ugen -> Ugen -> Ugen-iRandId z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "IRand" [lo,hi] Nothing 1 (Special 0) (toUid z)---- | Monad variant of irand.-iRandM :: Uid m => Ugen -> Ugen -> m Ugen-iRandM = liftUid2 iRandId---- | Unsafe variant of irand.-iRand :: Ugen -> Ugen -> Ugen-iRand = liftUnsafe2 iRandM---- | Impulse oscillator.------ Impulse [ControlRate,AudioRate] freq=440 phase=0-impulse :: Rate -> Ugen -> Ugen -> Ugen-impulse rate freq phase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Impulse" [freq,phase] Nothing 1 (Special 0) NoId---- | Read a signal from a bus.------ In [ControlRate,AudioRate] bus=0; NC INPUT: True-in' :: Int -> Rate -> Ugen -> Ugen-in' numChannels rate bus = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "In" [bus] Nothing numChannels (Special 0) NoId---- | Read signal from a bus with a current or one cycle old timestamp.------ InFeedback [AudioRate] bus=0; NC INPUT: True-inFeedback :: Int -> Ugen -> Ugen-inFeedback numChannels bus = mkUgen Nothing [AudioRate] (Left AudioRate) "InFeedback" [bus] Nothing numChannels (Special 0) NoId---- | Tests if a signal is within a given range.------ InRange [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE-inRange :: Ugen -> Ugen -> Ugen -> Ugen-inRange in_ lo hi = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0]) "InRange" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | Test if a point is within a given rectangle.------ InRect [ControlRate,AudioRate] x=0 y=0 rect=0-inRect :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-inRect rate x y rect = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "InRect" [x,y,rect] Nothing 1 (Special 0) NoId---- | Generate a trigger anytime a bus is set.------ InTrig [ControlRate] bus=0; NC INPUT: True-inTrig :: Int -> Ugen -> Ugen-inTrig numChannels bus = mkUgen Nothing [ControlRate] (Left ControlRate) "InTrig" [bus] Nothing numChannels (Special 0) NoId---- | Index into a table with a signal------ Index [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE-index :: Ugen -> Ugen -> Ugen-index bufnum in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "Index" [bufnum,in_] Nothing 1 (Special 0) NoId---- | Finds the (lowest) point in the Buffer at which the input signal lies in-between the two values------ IndexInBetween [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE-indexInBetween :: Ugen -> Ugen -> Ugen-indexInBetween bufnum in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "IndexInBetween" [bufnum,in_] Nothing 1 (Special 0) NoId---- | Index into a table with a signal, linear interpolated------ IndexL [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE-indexL :: Ugen -> Ugen -> Ugen-indexL bufnum in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "IndexL" [bufnum,in_] Nothing 1 (Special 0) NoId---- | Base class for info ugens------ InfoUgenBase [InitialisationRate]-infoUgenBase :: Rate -> Ugen-infoUgenBase rate = mkUgen Nothing [InitialisationRate] (Left rate) "InfoUgenBase" [] Nothing 1 (Special 0) NoId---- | A leaky integrator.------ Integrator [ControlRate,AudioRate] in=0 coef=1; FILTER: TRUE-integrator :: Ugen -> Ugen -> Ugen-integrator in_ coef = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Integrator" [in_,coef] Nothing 1 (Special 0) NoId---- | Control to audio rate converter.------ K2A [AudioRate] in=0-k2a :: Ugen -> Ugen-k2a in_ = mkUgen Nothing [AudioRate] (Left AudioRate) "K2A" [in_] Nothing 1 (Special 0) NoId---- | Respond to the state of a key------ KeyState [ControlRate] keycode=0 minval=0 maxval=1 lag=0.2-keyState :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-keyState rate keycode minval maxval lag_ = mkUgen Nothing [ControlRate] (Left rate) "KeyState" [keycode,minval,maxval,lag_] Nothing 1 (Special 0) NoId---- | Key tracker------ KeyTrack [ControlRate] chain=0 keydecay=2 chromaleak=0.5-keyTrack :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-keyTrack rate chain keydecay chromaleak = mkUgen Nothing [ControlRate] (Left rate) "KeyTrack" [chain,keydecay,chromaleak] Nothing 1 (Special 0) NoId---- | Sine oscillator bank------ Klang [AudioRate] freqscale=1 freqoffset=0 *specificationsArrayRef=0; MCE=1, REORDERS INPUTS: [2,0,1]-klang :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-klang rate freqscale freqoffset specificationsArrayRef = mkUgen Nothing [AudioRate] (Left rate) "Klang" [freqscale,freqoffset] (Just [specificationsArrayRef]) 1 (Special 0) NoId---- | Bank of resonators------ Klank [AudioRate] input=0 freqscale=1 freqoffset=0 decayscale=1 *specificationsArrayRef=0; MCE=1, FILTER: TRUE, REORDERS INPUTS: [4,0,1,2,3]-klank :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-klank input freqscale freqoffset decayscale specificationsArrayRef = mkUgen Nothing [AudioRate] (Right [0]) "Klank" [input,freqscale,freqoffset,decayscale] (Just [specificationsArrayRef]) 1 (Special 0) NoId---- | Clipped noise------ LFClipNoise [ControlRate,AudioRate] freq=500; NONDET-lfClipNoiseId :: ID a => a -> Rate -> Ugen -> Ugen-lfClipNoiseId z rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFClipNoise" [freq] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFClipNoise.-lfClipNoiseM :: Uid m => Rate -> Ugen -> m Ugen-lfClipNoiseM = liftUid2 lfClipNoiseId---- | Unsafe variant of LFClipNoise.-lfClipNoise :: Rate -> Ugen -> Ugen-lfClipNoise = liftUnsafe2 lfClipNoiseM---- | A sine like shape made of two cubic pieces------ LFCub [ControlRate,AudioRate] freq=440 iphase=0-lfCub :: Rate -> Ugen -> Ugen -> Ugen-lfCub rate freq iphase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFCub" [freq,iphase] Nothing 1 (Special 0) NoId---- | Dynamic clipped noise------ LFDClipNoise [ControlRate,AudioRate] freq=500; NONDET-lfdClipNoiseId :: ID a => a -> Rate -> Ugen -> Ugen-lfdClipNoiseId z rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFDClipNoise" [freq] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFDClipNoise.-lfdClipNoiseM :: Uid m => Rate -> Ugen -> m Ugen-lfdClipNoiseM = liftUid2 lfdClipNoiseId---- | Unsafe variant of LFDClipNoise.-lfdClipNoise :: Rate -> Ugen -> Ugen-lfdClipNoise = liftUnsafe2 lfdClipNoiseM---- | Dynamic step noise------ LFDNoise0 [ControlRate,AudioRate] freq=500; NONDET-lfdNoise0Id :: ID a => a -> Rate -> Ugen -> Ugen-lfdNoise0Id z rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFDNoise0" [freq] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFDNoise0.-lfdNoise0M :: Uid m => Rate -> Ugen -> m Ugen-lfdNoise0M = liftUid2 lfdNoise0Id---- | Unsafe variant of LFDNoise0.-lfdNoise0 :: Rate -> Ugen -> Ugen-lfdNoise0 = liftUnsafe2 lfdNoise0M---- | Dynamic ramp noise------ LFDNoise1 [ControlRate,AudioRate] freq=500; NONDET-lfdNoise1Id :: ID a => a -> Rate -> Ugen -> Ugen-lfdNoise1Id z rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFDNoise1" [freq] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFDNoise1.-lfdNoise1M :: Uid m => Rate -> Ugen -> m Ugen-lfdNoise1M = liftUid2 lfdNoise1Id---- | Unsafe variant of LFDNoise1.-lfdNoise1 :: Rate -> Ugen -> Ugen-lfdNoise1 = liftUnsafe2 lfdNoise1M---- | Dynamic cubic noise------ LFDNoise3 [ControlRate,AudioRate] freq=500; NONDET-lfdNoise3Id :: ID a => a -> Rate -> Ugen -> Ugen-lfdNoise3Id z rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFDNoise3" [freq] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFDNoise3.-lfdNoise3M :: Uid m => Rate -> Ugen -> m Ugen-lfdNoise3M = liftUid2 lfdNoise3Id---- | Unsafe variant of LFDNoise3.-lfdNoise3 :: Rate -> Ugen -> Ugen-lfdNoise3 = liftUnsafe2 lfdNoise3M---- | Gaussian function oscillator------ LFGauss [ControlRate,AudioRate] duration=1 width=0.1 iphase=0 loop=1 doneAction=0; ENUMERATION INPUTS: 3=Loop, 4=DoneAction-lfGauss :: Rate -> Ugen -> Ugen -> Ugen -> Loop Ugen -> DoneAction Ugen -> Ugen-lfGauss rate duration width iphase loop doneAction = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFGauss" [duration,width,iphase,(from_loop loop),(from_done_action doneAction)] Nothing 1 (Special 0) NoId---- | Step noise------ LFNoise0 [ControlRate,AudioRate] freq=500; NONDET-lfNoise0Id :: ID a => a -> Rate -> Ugen -> Ugen-lfNoise0Id z rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFNoise0" [freq] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFNoise0.-lfNoise0M :: Uid m => Rate -> Ugen -> m Ugen-lfNoise0M = liftUid2 lfNoise0Id---- | Unsafe variant of LFNoise0.-lfNoise0 :: Rate -> Ugen -> Ugen-lfNoise0 = liftUnsafe2 lfNoise0M---- | Ramp noise------ LFNoise1 [ControlRate,AudioRate] freq=500; NONDET-lfNoise1Id :: ID a => a -> Rate -> Ugen -> Ugen-lfNoise1Id z rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFNoise1" [freq] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFNoise1.-lfNoise1M :: Uid m => Rate -> Ugen -> m Ugen-lfNoise1M = liftUid2 lfNoise1Id---- | Unsafe variant of LFNoise1.-lfNoise1 :: Rate -> Ugen -> Ugen-lfNoise1 = liftUnsafe2 lfNoise1M---- | Quadratic noise.------ LFNoise2 [ControlRate,AudioRate] freq=500; NONDET-lfNoise2Id :: ID a => a -> Rate -> Ugen -> Ugen-lfNoise2Id z rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFNoise2" [freq] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFNoise2.-lfNoise2M :: Uid m => Rate -> Ugen -> m Ugen-lfNoise2M = liftUid2 lfNoise2Id---- | Unsafe variant of LFNoise2.-lfNoise2 :: Rate -> Ugen -> Ugen-lfNoise2 = liftUnsafe2 lfNoise2M---- | Parabolic oscillator------ LFPar [ControlRate,AudioRate] freq=440 iphase=0-lfPar :: Rate -> Ugen -> Ugen -> Ugen-lfPar rate freq iphase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFPar" [freq,iphase] Nothing 1 (Special 0) NoId---- | pulse oscillator------ LFPulse [ControlRate,AudioRate] freq=440 iphase=0 width=0.5-lfPulse :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-lfPulse rate freq iphase width = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFPulse" [freq,iphase,width] Nothing 1 (Special 0) NoId---- | Sawtooth oscillator------ LFSaw [ControlRate,AudioRate] freq=440 iphase=0-lfSaw :: Rate -> Ugen -> Ugen -> Ugen-lfSaw rate freq iphase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFSaw" [freq,iphase] Nothing 1 (Special 0) NoId---- | Triangle oscillator------ LFTri [ControlRate,AudioRate] freq=440 iphase=0-lfTri :: Rate -> Ugen -> Ugen -> Ugen-lfTri rate freq iphase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFTri" [freq,iphase] Nothing 1 (Special 0) NoId---- | 2nd order Butterworth lowpass filter------ LPF [ControlRate,AudioRate] in=0 freq=440; FILTER: TRUE-lpf :: Ugen -> Ugen -> Ugen-lpf in_ freq = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "LPF" [in_,freq] Nothing 1 (Special 0) NoId---- | Two point average filter------ LPZ1 [ControlRate,AudioRate] in=0; FILTER: TRUE-lpz1 :: Ugen -> Ugen-lpz1 in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "LPZ1" [in_] Nothing 1 (Special 0) NoId---- | Two zero fixed lowpass------ LPZ2 [ControlRate,AudioRate] in=0; FILTER: TRUE-lpz2 :: Ugen -> Ugen-lpz2 in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "LPZ2" [in_] Nothing 1 (Special 0) NoId---- | Exponential lag------ Lag [ControlRate,AudioRate] in=0 lagTime=0.1; FILTER: TRUE-lag :: Ugen -> Ugen -> Ugen-lag in_ lagTime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Lag" [in_,lagTime] Nothing 1 (Special 0) NoId---- | Exponential lag------ Lag2 [ControlRate,AudioRate] in=0 lagTime=0.1; FILTER: TRUE-lag2 :: Ugen -> Ugen -> Ugen-lag2 in_ lagTime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Lag2" [in_,lagTime] Nothing 1 (Special 0) NoId---- | Exponential lag------ Lag2UD [ControlRate,AudioRate] in=0 lagTimeU=0.1 lagTimeD=0.1; FILTER: TRUE-lag2UD :: Ugen -> Ugen -> Ugen -> Ugen-lag2UD in_ lagTimeU lagTimeD = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Lag2UD" [in_,lagTimeU,lagTimeD] Nothing 1 (Special 0) NoId---- | Exponential lag------ Lag3 [ControlRate,AudioRate] in=0 lagTime=0.1; FILTER: TRUE-lag3 :: Ugen -> Ugen -> Ugen-lag3 in_ lagTime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Lag3" [in_,lagTime] Nothing 1 (Special 0) NoId---- | Exponential lag------ Lag3UD [ControlRate,AudioRate] in=0 lagTimeU=0.1 lagTimeD=0.1; FILTER: TRUE-lag3UD :: Ugen -> Ugen -> Ugen -> Ugen-lag3UD in_ lagTimeU lagTimeD = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Lag3UD" [in_,lagTimeU,lagTimeD] Nothing 1 (Special 0) NoId---- | Read a control signal from a bus with a lag------ LagIn [ControlRate] bus=0 lag=0.1; NC INPUT: True-lagIn :: Int -> Ugen -> Ugen -> Ugen-lagIn numChannels bus lag_ = mkUgen Nothing [ControlRate] (Left ControlRate) "LagIn" [bus,lag_] Nothing numChannels (Special 0) NoId---- | Exponential lag------ LagUD [ControlRate,AudioRate] in=0 lagTimeU=0.1 lagTimeD=0.1; FILTER: TRUE-lagUD :: Ugen -> Ugen -> Ugen -> Ugen-lagUD in_ lagTimeU lagTimeD = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "LagUD" [in_,lagTimeU,lagTimeD] Nothing 1 (Special 0) NoId---- | Output the last value before the input changed------ LastValue [ControlRate,AudioRate] in=0 diff=0.01; FILTER: TRUE-lastValue :: Ugen -> Ugen -> Ugen-lastValue in_ diff = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "LastValue" [in_,diff] Nothing 1 (Special 0) NoId---- | Sample and hold------ Latch [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE-latch :: Ugen -> Ugen -> Ugen-latch in_ trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0,1]) "Latch" [in_,trig_] Nothing 1 (Special 0) NoId---- | Latoocarfian chaotic generator------ LatoocarfianC [AudioRate] freq=22050 a=1 b=3 c=0.5 d=0.5 xi=0.5 yi=0.5-latoocarfianC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-latoocarfianC rate freq a b c d xi yi = mkUgen Nothing [AudioRate] (Left rate) "LatoocarfianC" [freq,a,b,c,d,xi,yi] Nothing 1 (Special 0) NoId---- | Latoocarfian chaotic generator------ LatoocarfianL [AudioRate] freq=22050 a=1 b=3 c=0.5 d=0.5 xi=0.5 yi=0.5-latoocarfianL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-latoocarfianL rate freq a b c d xi yi = mkUgen Nothing [AudioRate] (Left rate) "LatoocarfianL" [freq,a,b,c,d,xi,yi] Nothing 1 (Special 0) NoId---- | Latoocarfian chaotic generator------ LatoocarfianN [AudioRate] freq=22050 a=1 b=3 c=0.5 d=0.5 xi=0.5 yi=0.5-latoocarfianN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-latoocarfianN rate freq a b c d xi yi = mkUgen Nothing [AudioRate] (Left rate) "LatoocarfianN" [freq,a,b,c,d,xi,yi] Nothing 1 (Special 0) NoId---- | Remove DC------ LeakDC [ControlRate,AudioRate] in=0 coef=0.995; FILTER: TRUE-leakDC :: Ugen -> Ugen -> Ugen-leakDC in_ coef = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "LeakDC" [in_,coef] Nothing 1 (Special 0) NoId---- | Output least changed------ LeastChange [ControlRate,AudioRate] a=0 b=0-leastChange :: Rate -> Ugen -> Ugen -> Ugen-leastChange rate a b = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LeastChange" [a,b] Nothing 1 (Special 0) NoId---- | Peak limiter------ Limiter [AudioRate] in=0 level=1 dur=0.01; FILTER: TRUE-limiter :: Ugen -> Ugen -> Ugen -> Ugen-limiter in_ level dur = mkUgen Nothing [AudioRate] (Right [0]) "Limiter" [in_,level,dur] Nothing 1 (Special 0) NoId---- | Linear congruential chaotic generator------ LinCongC [AudioRate] freq=22050 a=1.1 c=0.13 m=1 xi=0-linCongC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-linCongC rate freq a c m xi = mkUgen Nothing [AudioRate] (Left rate) "LinCongC" [freq,a,c,m,xi] Nothing 1 (Special 0) NoId---- | Linear congruential chaotic generator------ LinCongL [AudioRate] freq=22050 a=1.1 c=0.13 m=1 xi=0-linCongL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-linCongL rate freq a c m xi = mkUgen Nothing [AudioRate] (Left rate) "LinCongL" [freq,a,c,m,xi] Nothing 1 (Special 0) NoId---- | Linear congruential chaotic generator------ LinCongN [AudioRate] freq=22050 a=1.1 c=0.13 m=1 xi=0-linCongN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-linCongN rate freq a c m xi = mkUgen Nothing [AudioRate] (Left rate) "LinCongN" [freq,a,c,m,xi] Nothing 1 (Special 0) NoId---- | Map a linear range to an exponential range------ LinExp [InitialisationRate,ControlRate,AudioRate] in=0 srclo=0 srchi=1 dstlo=1 dsthi=2; FILTER: TRUE-linExp :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-linExp in_ srclo srchi dstlo dsthi = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0]) "LinExp" [in_,srclo,srchi,dstlo,dsthi] Nothing 1 (Special 0) NoId---- | Two channel linear pan.------ LinPan2 [ControlRate,AudioRate] in=0 pos=0 level=1; FILTER: TRUE-linPan2 :: Ugen -> Ugen -> Ugen -> Ugen-linPan2 in_ pos level = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "LinPan2" [in_,pos,level] Nothing 2 (Special 0) NoId---- | Skewed random number generator.------ LinRand [InitialisationRate] lo=0 hi=1 minmax=0; NONDET-linRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-linRandId z lo hi minmax = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "LinRand" [lo,hi,minmax] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LinRand.-linRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-linRandM = liftUid3 linRandId---- | Unsafe variant of LinRand.-linRand :: Ugen -> Ugen -> Ugen -> Ugen-linRand = liftUnsafe3 linRandM---- | Two channel linear crossfade.------ LinXFade2 [ControlRate,AudioRate] inA=0 inB=0 pan=0 level=1; FILTER: TRUE, PSUEDO INPUTS: [3]-linXFade2 :: Ugen -> Ugen -> Ugen -> Ugen-linXFade2 inA inB pan = mkUgen Nothing [ControlRate,AudioRate] (Right [0,1]) "LinXFade2" [inA,inB,pan] Nothing 1 (Special 0) NoId---- | Line generator.------ Line [ControlRate,AudioRate] start=0 end=1 dur=1 doneAction=0; ENUMERATION INPUTS: 3=DoneAction-line :: Rate -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen-line rate start end dur doneAction = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Line" [start,end,dur,(from_done_action doneAction)] Nothing 1 (Special 0) NoId---- | Simple linear envelope generator.------ Linen [ControlRate] gate=1 attackTime=0.01 susLevel=1 releaseTime=1 doneAction=0; ENUMERATION INPUTS: 4=DoneAction-linen :: Ugen -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen-linen gate_ attackTime susLevel releaseTime doneAction = mkUgen Nothing [ControlRate] (Left ControlRate) "Linen" [gate_,attackTime,susLevel,releaseTime,(from_done_action doneAction)] Nothing 1 (Special 0) NoId---- | Allocate a buffer local to the synth------ LocalBuf [InitialisationRate] numChannels=1 numFrames=1; REORDERS INPUTS: [1,0], NONDET-localBufId :: ID a => a -> Ugen -> Ugen -> Ugen-localBufId z numChannels numFrames = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "LocalBuf" [numChannels,numFrames] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LocalBuf.-localBufM :: Uid m => Ugen -> Ugen -> m Ugen-localBufM = liftUid2 localBufId---- | Unsafe variant of LocalBuf.-localBuf :: Ugen -> Ugen -> Ugen-localBuf = liftUnsafe2 localBufM---- | Define and read from buses local to a synth.------ LocalIn [ControlRate,AudioRate] *default=0; MCE=1, NC INPUT: True-localIn :: Int -> Rate -> Ugen -> Ugen-localIn numChannels rate default_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LocalIn" [] (Just [default_]) numChannels (Special 0) NoId---- | Write to buses local to a synth.------ LocalOut [ControlRate,AudioRate] *channelsArray=0; MCE=1, FILTER: TRUE-localOut :: Ugen -> Ugen-localOut input = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "LocalOut" [] (Just [input]) 0 (Special 0) NoId---- | Chaotic noise function------ Logistic [ControlRate,AudioRate] chaosParam=3 freq=1000 init=0.5-logistic :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-logistic rate chaosParam freq init_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Logistic" [chaosParam,freq,init_] Nothing 1 (Special 0) NoId---- | Lorenz chaotic generator------ LorenzL [AudioRate] freq=22050 s=10 r=28 b=2.667 h=0.05 xi=0.1 yi=0 zi=0-lorenzL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lorenzL rate freq s r b h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "LorenzL" [freq,s,r,b,h,xi,yi,zi] Nothing 1 (Special 0) NoId---- | Extraction of instantaneous loudness in sones------ Loudness [ControlRate] chain=0 smask=0.25 tmask=1-loudness :: Ugen -> Ugen -> Ugen -> Ugen-loudness chain smask tmask = mkUgen Nothing [ControlRate] (Left ControlRate) "Loudness" [chain,smask,tmask] Nothing 1 (Special 0) NoId---- | Mel frequency cepstral coefficients------ MFCC [ControlRate] chain=0 numcoeff=13-mfcc :: Rate -> Ugen -> Ugen -> Ugen-mfcc rate chain numcoeff = mkUgen Nothing [ControlRate] (Left rate) "MFCC" [chain,numcoeff] Nothing 13 (Special 0) NoId---- | Reduce precision.------ MantissaMask [ControlRate,AudioRate] in=0 bits=3; FILTER: TRUE-mantissaMask :: Ugen -> Ugen -> Ugen-mantissaMask in_ bits = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "MantissaMask" [in_,bits] Nothing 1 (Special 0) NoId---- | Median filter.------ Median [ControlRate,AudioRate] length=3 in=0; FILTER: TRUE-median :: Ugen -> Ugen -> Ugen-median length_ in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "Median" [length_,in_] Nothing 1 (Special 0) NoId---- | Parametric filter.------ MidEQ [ControlRate,AudioRate] in=0 freq=440 rq=1 db=0; FILTER: TRUE-midEQ :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-midEQ in_ freq rq db = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "MidEQ" [in_,freq,rq,db] Nothing 1 (Special 0) NoId---- | Minimum difference of two values in modulo arithmetics------ ModDif [InitialisationRate,ControlRate,AudioRate] x=0 y=0 mod=1; FILTER: TRUE-modDif :: Ugen -> Ugen -> Ugen -> Ugen-modDif x y mod_ = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0]) "ModDif" [x,y,mod_] Nothing 1 (Special 0) NoId---- | Moog VCF implementation, designed by Federico Fontana------ MoogFF [ControlRate,AudioRate] in=0 freq=100 gain=2 reset=0; FILTER: TRUE-moogFF :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-moogFF in_ freq gain reset = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "MoogFF" [in_,freq,gain,reset] Nothing 1 (Special 0) NoId---- | Output most changed.------ MostChange [ControlRate,AudioRate] a=0 b=0; FILTER: TRUE-mostChange :: Ugen -> Ugen -> Ugen-mostChange a b = mkUgen Nothing [ControlRate,AudioRate] (Right [0,1]) "MostChange" [a,b] Nothing 1 (Special 0) NoId---- | Mouse button Ugen.------ MouseButton [ControlRate] minval=0 maxval=1 lag=0.2-mouseButton :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-mouseButton rate minval maxval lag_ = mkUgen Nothing [ControlRate] (Left rate) "MouseButton" [minval,maxval,lag_] Nothing 1 (Special 0) NoId---- | Cursor tracking Ugen.------ MouseX [ControlRate] minval=0 maxval=1 warp=0 lag=0.2; ENUMERATION INPUTS: 2=Warp-mouseX :: Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> Ugen-mouseX rate minval maxval warp lag_ = mkUgen Nothing [ControlRate] (Left rate) "MouseX" [minval,maxval,(from_warp warp),lag_] Nothing 1 (Special 0) NoId---- | Cursor tracking Ugen.------ MouseY [ControlRate] minval=0 maxval=1 warp=0 lag=0.2; ENUMERATION INPUTS: 2=Warp-mouseY :: Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> Ugen-mouseY rate minval maxval warp lag_ = mkUgen Nothing [ControlRate] (Left rate) "MouseY" [minval,maxval,(from_warp warp),lag_] Nothing 1 (Special 0) NoId---- | Sum of uniform distributions.------ NRand [InitialisationRate] lo=0 hi=1 n=0; NONDET-nRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-nRandId z lo hi n = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NRand" [lo,hi,n] Nothing 1 (Special 0) (toUid z)---- | Monad variant of NRand.-nRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-nRandM = liftUid3 nRandId---- | Unsafe variant of NRand.-nRand :: Ugen -> Ugen -> Ugen -> Ugen-nRand = liftUnsafe3 nRandM---- | (Undocumented class)------ NodeID [InitialisationRate]-nodeID :: Rate -> Ugen-nodeID rate = mkUgen Nothing [InitialisationRate] (Left rate) "NodeID" [] Nothing 1 (Special 0) NoId---- | Flattens dynamics.------ Normalizer [AudioRate] in=0 level=1 dur=0.01; FILTER: TRUE-normalizer :: Ugen -> Ugen -> Ugen -> Ugen-normalizer in_ level dur = mkUgen Nothing [AudioRate] (Right [0]) "Normalizer" [in_,level,dur] Nothing 1 (Special 0) NoId---- | Number of audio busses.------ NumAudioBuses [InitialisationRate]-numAudioBuses :: Ugen-numAudioBuses = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumAudioBuses" [] Nothing 1 (Special 0) NoId---- | Number of open buffers.------ NumBuffers [InitialisationRate]-numBuffers :: Ugen-numBuffers = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumBuffers" [] Nothing 1 (Special 0) NoId---- | Number of control busses.------ NumControlBuses [InitialisationRate]-numControlBuses :: Ugen-numControlBuses = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumControlBuses" [] Nothing 1 (Special 0) NoId---- | Number of input busses.------ NumInputBuses [InitialisationRate]-numInputBuses :: Ugen-numInputBuses = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumInputBuses" [] Nothing 1 (Special 0) NoId---- | Number of output busses.------ NumOutputBuses [InitialisationRate]-numOutputBuses :: Ugen-numOutputBuses = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumOutputBuses" [] Nothing 1 (Special 0) NoId---- | Number of currently running synths.------ NumRunningSynths [InitialisationRate,ControlRate]-numRunningSynths :: Ugen-numRunningSynths = mkUgen Nothing [InitialisationRate,ControlRate] (Left InitialisationRate) "NumRunningSynths" [] Nothing 1 (Special 0) NoId---- | Write a signal to a bus with sample accurate timing.------ OffsetOut [ControlRate,AudioRate] bus=0 *channelsArray=0; MCE=1, FILTER: TRUE-offsetOut :: Ugen -> Ugen -> Ugen-offsetOut bus input = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "OffsetOut" [bus] (Just [input]) 0 (Special 0) NoId---- | One pole filter.------ OnePole [ControlRate,AudioRate] in=0 coef=0.5; FILTER: TRUE-onePole :: Ugen -> Ugen -> Ugen-onePole in_ coef = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "OnePole" [in_,coef] Nothing 1 (Special 0) NoId---- | One zero filter.------ OneZero [ControlRate,AudioRate] in=0 coef=0.5; FILTER: TRUE-oneZero :: Ugen -> Ugen -> Ugen-oneZero in_ coef = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "OneZero" [in_,coef] Nothing 1 (Special 0) NoId---- | Onset detector------ Onsets [ControlRate] chain=0 threshold=0.5 odftype=3 relaxtime=1 floor=0.1 mingap=10 medianspan=11 whtype=1 rawodf=0-onsets :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-onsets chain threshold odftype relaxtime floor_ mingap medianspan whtype rawodf = mkUgen Nothing [ControlRate] (Left ControlRate) "Onsets" [chain,threshold,odftype,relaxtime,floor_,mingap,medianspan,whtype,rawodf] Nothing 1 (Special 0) NoId---- | Interpolating wavetable oscillator.------ Osc [ControlRate,AudioRate] bufnum=0 freq=440 phase=0-osc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-osc rate bufnum freq phase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Osc" [bufnum,freq,phase] Nothing 1 (Special 0) NoId---- | Noninterpolating wavetable oscillator.------ OscN [ControlRate,AudioRate] bufnum=0 freq=440 phase=0-oscN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-oscN rate bufnum freq phase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "OscN" [bufnum,freq,phase] Nothing 1 (Special 0) NoId---- | Write a signal to a bus.------ Out [ControlRate,AudioRate] bus=0 *channelsArray=0; MCE=1, FILTER: TRUE-out :: Ugen -> Ugen -> Ugen-out bus input = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "Out" [bus] (Just [input]) 0 (Special 0) NoId---- | Very fast sine grain with a parabolic envelope------ PSinGrain [AudioRate] freq=440 dur=0.2 amp=0.1-pSinGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-pSinGrain rate freq dur amp = mkUgen Nothing [AudioRate] (Left rate) "PSinGrain" [freq,dur,amp] Nothing 1 (Special 0) NoId---- | Complex addition.------ PV_Add [ControlRate] bufferA=0 bufferB=0-pv_Add :: Ugen -> Ugen -> Ugen-pv_Add bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Add" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | Scramble bins.------ PV_BinScramble [ControlRate] buffer=0 wipe=0 width=0.2 trig=0; NONDET-pv_BinScrambleId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_BinScrambleId z buffer wipe width trig_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinScramble" [buffer,wipe,width,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of PV_BinScramble.-pv_BinScrambleM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-pv_BinScrambleM = liftUid4 pv_BinScrambleId---- | Unsafe variant of PV_BinScramble.-pv_BinScramble :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_BinScramble = liftUnsafe4 pv_BinScrambleM---- | Shift and stretch bin position.------ PV_BinShift [ControlRate] buffer=0 stretch=1 shift=0 interp=0-pv_BinShift :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_BinShift buffer stretch shift interp = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinShift" [buffer,stretch,shift,interp] Nothing 1 (Special 0) NoId---- | Combine low and high bins from two inputs.------ PV_BinWipe [ControlRate] bufferA=0 bufferB=0 wipe=0-pv_BinWipe :: Ugen -> Ugen -> Ugen -> Ugen-pv_BinWipe bufferA bufferB wipe = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinWipe" [bufferA,bufferB,wipe] Nothing 1 (Special 0) NoId---- | Zero bins.------ PV_BrickWall [ControlRate] buffer=0 wipe=0-pv_BrickWall :: Ugen -> Ugen -> Ugen-pv_BrickWall buffer wipe = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BrickWall" [buffer,wipe] Nothing 1 (Special 0) NoId---- | Complex plane attack.------ PV_ConformalMap [ControlRate] buffer=0 areal=0 aimag=0-pv_ConformalMap :: Ugen -> Ugen -> Ugen -> Ugen-pv_ConformalMap buffer areal aimag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_ConformalMap" [buffer,areal,aimag] Nothing 1 (Special 0) NoId---- | Complex conjugate------ PV_Conj [ControlRate] buffer=0-pv_Conj :: Ugen -> Ugen-pv_Conj buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Conj" [buffer] Nothing 1 (Special 0) NoId---- | Copy an FFT buffer------ PV_Copy [ControlRate] bufferA=0 bufferB=0-pv_Copy :: Ugen -> Ugen -> Ugen-pv_Copy bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Copy" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | Copy magnitudes and phases.------ PV_CopyPhase [ControlRate] bufferA=0 bufferB=0-pv_CopyPhase :: Ugen -> Ugen -> Ugen-pv_CopyPhase bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_CopyPhase" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | Random phase shifting.------ PV_Diffuser [ControlRate] buffer=0 trig=0-pv_Diffuser :: Ugen -> Ugen -> Ugen-pv_Diffuser buffer trig_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Diffuser" [buffer,trig_] Nothing 1 (Special 0) NoId---- | Complex division------ PV_Div [ControlRate] bufferA=0 bufferB=0-pv_Div :: Ugen -> Ugen -> Ugen-pv_Div bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Div" [bufferA,bufferB] Nothing 1 (Special 0) NoId--{---- | FFT onset detector.------ PV_HainsworthFoote [ControlRate,AudioRate] maxSize=0-pv_HainsworthFoote :: Ugen -> Ugen-pv_HainsworthFoote maxSize = mkUgen Nothing [ControlRate,AudioRate] (Left ControlRate) "PV_HainsworthFoote" [maxSize] Nothing 1 (Special 0) NoId---- | FFT feature detector for onset detection.------ PV_JensenAndersen [ControlRate,AudioRate] maxSize=0-pv_JensenAndersen :: Ugen -> Ugen-pv_JensenAndersen maxSize = mkUgen Nothing [ControlRate,AudioRate] (Left ControlRate) "PV_JensenAndersen" [maxSize] Nothing 1 (Special 0) NoId--}---- | Pass bins which are a local maximum.------ PV_LocalMax [ControlRate] buffer=0 threshold=0-pv_LocalMax :: Ugen -> Ugen -> Ugen-pv_LocalMax buffer threshold = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_LocalMax" [buffer,threshold] Nothing 1 (Special 0) NoId---- | Pass bins above a threshold.------ PV_MagAbove [ControlRate] buffer=0 threshold=0-pv_MagAbove :: Ugen -> Ugen -> Ugen-pv_MagAbove buffer threshold = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagAbove" [buffer,threshold] Nothing 1 (Special 0) NoId---- | Pass bins below a threshold.------ PV_MagBelow [ControlRate] buffer=0 threshold=0-pv_MagBelow :: Ugen -> Ugen -> Ugen-pv_MagBelow buffer threshold = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagBelow" [buffer,threshold] Nothing 1 (Special 0) NoId---- | Clip bins to a threshold.------ PV_MagClip [ControlRate] buffer=0 threshold=0-pv_MagClip :: Ugen -> Ugen -> Ugen-pv_MagClip buffer threshold = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagClip" [buffer,threshold] Nothing 1 (Special 0) NoId---- | Division of magnitudes------ PV_MagDiv [ControlRate] bufferA=0 bufferB=0 zeroed=0.0001-pv_MagDiv :: Ugen -> Ugen -> Ugen -> Ugen-pv_MagDiv bufferA bufferB zeroed = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagDiv" [bufferA,bufferB,zeroed] Nothing 1 (Special 0) NoId---- | Freeze magnitudes.------ PV_MagFreeze [ControlRate] buffer=0 freeze=0-pv_MagFreeze :: Ugen -> Ugen -> Ugen-pv_MagFreeze buffer freeze = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagFreeze" [buffer,freeze] Nothing 1 (Special 0) NoId---- | Multiply magnitudes.------ PV_MagMul [ControlRate] bufferA=0 bufferB=0-pv_MagMul :: Ugen -> Ugen -> Ugen-pv_MagMul bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagMul" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | Multiply magnitudes by noise.------ PV_MagNoise [ControlRate] buffer=0-pv_MagNoise :: Ugen -> Ugen-pv_MagNoise buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagNoise" [buffer] Nothing 1 (Special 0) NoId---- | shift and stretch magnitude bin position.------ PV_MagShift [ControlRate] buffer=0 stretch=1 shift=0-pv_MagShift :: Ugen -> Ugen -> Ugen -> Ugen-pv_MagShift buffer stretch shift = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagShift" [buffer,stretch,shift] Nothing 1 (Special 0) NoId---- | Average magnitudes across bins.------ PV_MagSmear [ControlRate] buffer=0 bins=0-pv_MagSmear :: Ugen -> Ugen -> Ugen-pv_MagSmear buffer bins = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagSmear" [buffer,bins] Nothing 1 (Special 0) NoId---- | Square magnitudes.------ PV_MagSquared [ControlRate] buffer=0-pv_MagSquared :: Ugen -> Ugen-pv_MagSquared buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagSquared" [buffer] Nothing 1 (Special 0) NoId---- | Maximum magnitude.------ PV_Max [ControlRate] bufferA=0 bufferB=0-pv_Max :: Ugen -> Ugen -> Ugen-pv_Max bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Max" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | Minimum magnitude.------ PV_Min [ControlRate] bufferA=0 bufferB=0-pv_Min :: Ugen -> Ugen -> Ugen-pv_Min bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Min" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | Complex multiply.------ PV_Mul [ControlRate] bufferA=0 bufferB=0-pv_Mul :: Ugen -> Ugen -> Ugen-pv_Mul bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Mul" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | Shift phase.------ PV_PhaseShift [ControlRate] buffer=0 shift=0 integrate=0-pv_PhaseShift :: Ugen -> Ugen -> Ugen -> Ugen-pv_PhaseShift buffer shift integrate = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PhaseShift" [buffer,shift,integrate] Nothing 1 (Special 0) NoId---- | Shift phase by 270 degrees.------ PV_PhaseShift270 [ControlRate] buffer=0-pv_PhaseShift270 :: Ugen -> Ugen-pv_PhaseShift270 buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PhaseShift270" [buffer] Nothing 1 (Special 0) NoId---- | Shift phase by 90 degrees.------ PV_PhaseShift90 [ControlRate] buffer=0-pv_PhaseShift90 :: Ugen -> Ugen-pv_PhaseShift90 buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PhaseShift90" [buffer] Nothing 1 (Special 0) NoId---- | Pass random bins.------ PV_RandComb [ControlRate] buffer=0 wipe=0 trig=0; NONDET-pv_RandCombId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-pv_RandCombId z buffer wipe trig_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RandComb" [buffer,wipe,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of PV_RandComb.-pv_RandCombM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-pv_RandCombM = liftUid3 pv_RandCombId---- | Unsafe variant of PV_RandComb.-pv_RandComb :: Ugen -> Ugen -> Ugen -> Ugen-pv_RandComb = liftUnsafe3 pv_RandCombM---- | Crossfade in random bin order.------ PV_RandWipe [ControlRate] bufferA=0 bufferB=0 wipe=0 trig=0; NONDET-pv_RandWipeId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_RandWipeId z bufferA bufferB wipe trig_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RandWipe" [bufferA,bufferB,wipe,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of PV_RandWipe.-pv_RandWipeM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-pv_RandWipeM = liftUid4 pv_RandWipeId---- | Unsafe variant of PV_RandWipe.-pv_RandWipe :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_RandWipe = liftUnsafe4 pv_RandWipeM---- | Make gaps in spectrum.------ PV_RectComb [ControlRate] buffer=0 numTeeth=0 phase=0 width=0.5-pv_RectComb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_RectComb buffer numTeeth phase width = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RectComb" [buffer,numTeeth,phase,width] Nothing 1 (Special 0) NoId---- | Make gaps in spectrum.------ PV_RectComb2 [ControlRate] bufferA=0 bufferB=0 numTeeth=0 phase=0 width=0.5-pv_RectComb2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_RectComb2 bufferA bufferB numTeeth phase width = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RectComb2" [bufferA,bufferB,numTeeth,phase,width] Nothing 1 (Special 0) NoId---- | Two channel equal power pan.------ Pan2 [ControlRate,AudioRate] in=0 pos=0 level=1; FILTER: TRUE-pan2 :: Ugen -> Ugen -> Ugen -> Ugen-pan2 in_ pos level = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Pan2" [in_,pos,level] Nothing 2 (Special 0) NoId---- | Four channel equal power pan.------ Pan4 [ControlRate,AudioRate] in=0 xpos=0 ypos=0 level=1-pan4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pan4 rate in_ xpos ypos level = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Pan4" [in_,xpos,ypos,level] Nothing 4 (Special 0) NoId---- | Azimuth panner------ PanAz [ControlRate,AudioRate] in=0 pos=0 level=1 width=2 orientation=0.5; NC INPUT: True, FILTER: TRUE-panAz :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-panAz numChannels in_ pos level width orientation = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "PanAz" [in_,pos,level,width,orientation] Nothing numChannels (Special 0) NoId---- | Ambisonic B-format panner.------ PanB [ControlRate,AudioRate] in=0 azimuth=0 elevation=0 gain=1-panB :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-panB rate in_ azimuth elevation gain = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "PanB" [in_,azimuth,elevation,gain] Nothing 4 (Special 0) NoId---- | 2D Ambisonic B-format panner.------ PanB2 [ControlRate,AudioRate] in=0 azimuth=0 gain=1; FILTER: TRUE-panB2 :: Ugen -> Ugen -> Ugen -> Ugen-panB2 in_ azimuth gain = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "PanB2" [in_,azimuth,gain] Nothing 3 (Special 0) NoId---- | Real-time partitioned convolution------ PartConv [AudioRate] in=0 fftsize=0 irbufnum=0-partConv :: Ugen -> Ugen -> Ugen -> Ugen-partConv in_ fftsize irbufnum = mkUgen Nothing [AudioRate] (Left AudioRate) "PartConv" [in_,fftsize,irbufnum] Nothing 1 (Special 0) NoId---- | When triggered, pauses a node.------ Pause [ControlRate] gate=0 id=0-pause :: Ugen -> Ugen -> Ugen-pause gate_ id_ = mkUgen Nothing [ControlRate] (Left ControlRate) "Pause" [gate_,id_] Nothing 1 (Special 0) NoId---- | When triggered, pause enclosing synth.------ PauseSelf [ControlRate] in=0-pauseSelf :: Ugen -> Ugen-pauseSelf in_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PauseSelf" [in_] Nothing 1 (Special 0) NoId---- | FIXME: PauseSelfWhenDone purpose.------ PauseSelfWhenDone [ControlRate] src=0-pauseSelfWhenDone :: Ugen -> Ugen-pauseSelfWhenDone src = mkUgen Nothing [ControlRate] (Left ControlRate) "PauseSelfWhenDone" [src] Nothing 1 (Special 0) NoId---- | Track peak signal amplitude.------ Peak [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE-peak :: Ugen -> Ugen -> Ugen-peak in_ trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Peak" [in_,trig_] Nothing 1 (Special 0) NoId---- | Track peak signal amplitude.------ PeakFollower [ControlRate,AudioRate] in=0 decay=0.999; FILTER: TRUE-peakFollower :: Ugen -> Ugen -> Ugen-peakFollower in_ decay_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "PeakFollower" [in_,decay_] Nothing 1 (Special 0) NoId---- | A resettable linear ramp between two levels.------ Phasor [ControlRate,AudioRate] trig=0 rate=1 start=0 end=1 resetPos=0-phasor :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-phasor rate trig_ rate_ start end resetPos = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Phasor" [trig_,rate_,start,end,resetPos] Nothing 1 (Special 0) NoId---- | Pink Noise.------ PinkNoise [ControlRate,AudioRate] ; NONDET-pinkNoiseId :: ID a => a -> Rate -> Ugen-pinkNoiseId z rate = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "PinkNoise" [] Nothing 1 (Special 0) (toUid z)---- | Monad variant of PinkNoise.-pinkNoiseM :: Uid m => Rate -> m Ugen-pinkNoiseM = liftUid1 pinkNoiseId---- | Unsafe variant of PinkNoise.-pinkNoise :: Rate -> Ugen-pinkNoise = liftUnsafe1 pinkNoiseM---- | Autocorrelation pitch follower------ Pitch [ControlRate] in=0 initFreq=440 minFreq=60 maxFreq=4000 execFreq=100 maxBinsPerOctave=16 median=1 ampThreshold=0.01 peakThreshold=0.5 downSample=1 clar=0-pitch :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pitch in_ initFreq minFreq maxFreq execFreq maxBinsPerOctave median_ ampThreshold peakThreshold downSample clar = mkUgen Nothing [ControlRate] (Left ControlRate) "Pitch" [in_,initFreq,minFreq,maxFreq,execFreq,maxBinsPerOctave,median_,ampThreshold,peakThreshold,downSample,clar] Nothing 2 (Special 0) NoId---- | Time domain pitch shifter.------ PitchShift [AudioRate] in=0 windowSize=0.2 pitchRatio=1 pitchDispersion=0 timeDispersion=0; FILTER: TRUE-pitchShift :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pitchShift in_ windowSize pitchRatio pitchDispersion timeDispersion = mkUgen Nothing [AudioRate] (Right [0]) "PitchShift" [in_,windowSize,pitchRatio,pitchDispersion,timeDispersion] Nothing 1 (Special 0) NoId---- | Sample playback oscillator.------ PlayBuf [ControlRate,AudioRate] bufnum=0 rate=1 trigger=1 startPos=0 loop=0 doneAction=0; NC INPUT: True, ENUMERATION INPUTS: 4=Loop, 5=DoneAction-playBuf :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Loop Ugen -> DoneAction Ugen -> Ugen-playBuf numChannels rate bufnum rate_ trigger startPos loop doneAction = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "PlayBuf" [bufnum,rate_,trigger,startPos,(from_loop loop),(from_done_action doneAction)] Nothing numChannels (Special 0) NoId---- | A Karplus-Strong Ugen------ Pluck [AudioRate] in=0 trig=1 maxdelaytime=0.2 delaytime=0.2 decaytime=1 coef=0.5; FILTER: TRUE-pluck :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pluck in_ trig_ maxdelaytime delaytime decaytime coef = mkUgen Nothing [AudioRate] (Right [0]) "Pluck" [in_,trig_,maxdelaytime,delaytime,decaytime,coef] Nothing 1 (Special 0) NoId--{---- | Print the current output value of a Ugen------ Poll [ControlRate,AudioRate] trig=0 in=0 trigid=-1 label=0; FILTER: TRUE, REORDERS INPUTS: [0,1,3,2]-poll :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-poll trig_ in_ trigid label_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "Poll" [trig_,in_,trigid,label_] Nothing 1 (Special 0) NoId--}---- | Band limited pulse wave.------ Pulse [ControlRate,AudioRate] freq=440 width=0.5-pulse :: Rate -> Ugen -> Ugen -> Ugen-pulse rate freq width = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Pulse" [freq,width] Nothing 1 (Special 0) NoId---- | Pulse counter.------ PulseCount [ControlRate,AudioRate] trig=0 reset=0; FILTER: TRUE-pulseCount :: Ugen -> Ugen -> Ugen-pulseCount trig_ reset = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "PulseCount" [trig_,reset] Nothing 1 (Special 0) NoId---- | Pulse divider.------ PulseDivider [ControlRate,AudioRate] trig=0 div=2 start=0; FILTER: TRUE-pulseDivider :: Ugen -> Ugen -> Ugen -> Ugen-pulseDivider trig_ div_ start = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "PulseDivider" [trig_,div_,start] Nothing 1 (Special 0) NoId---- | General quadratic map chaotic generator------ QuadC [AudioRate] freq=22050 a=1 b=-1 c=-0.75 xi=0-quadC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-quadC rate freq a b c xi = mkUgen Nothing [AudioRate] (Left rate) "QuadC" [freq,a,b,c,xi] Nothing 1 (Special 0) NoId---- | General quadratic map chaotic generator------ QuadL [AudioRate] freq=22050 a=1 b=-1 c=-0.75 xi=0-quadL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-quadL rate freq a b c xi = mkUgen Nothing [AudioRate] (Left rate) "QuadL" [freq,a,b,c,xi] Nothing 1 (Special 0) NoId---- | General quadratic map chaotic generator------ QuadN [AudioRate] freq=22050 a=1 b=-1 c=-0.75 xi=0-quadN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-quadN rate freq a b c xi = mkUgen Nothing [AudioRate] (Left rate) "QuadN" [freq,a,b,c,xi] Nothing 1 (Special 0) NoId---- | A resonant high pass filter.------ RHPF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE-rhpf :: Ugen -> Ugen -> Ugen -> Ugen-rhpf in_ freq rq = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "RHPF" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | A resonant low pass filter.------ RLPF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE-rlpf :: Ugen -> Ugen -> Ugen -> Ugen-rlpf in_ freq rq = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "RLPF" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | Number of radians per sample.------ RadiansPerSample [InitialisationRate]-radiansPerSample :: Ugen-radiansPerSample = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "RadiansPerSample" [] Nothing 1 (Special 0) NoId---- | Break a continuous signal into line segments------ Ramp [ControlRate,AudioRate] in=0 lagTime=0.1; FILTER: TRUE-ramp :: Ugen -> Ugen -> Ugen-ramp in_ lagTime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Ramp" [in_,lagTime] Nothing 1 (Special 0) NoId---- | Single random number generator.------ Rand [InitialisationRate] lo=0 hi=1; NONDET-randId :: ID a => a -> Ugen -> Ugen -> Ugen-randId z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "Rand" [lo,hi] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Rand.-randM :: Uid m => Ugen -> Ugen -> m Ugen-randM = liftUid2 randId---- | Unsafe variant of Rand.-rand :: Ugen -> Ugen -> Ugen-rand = liftUnsafe2 randM---- | Set the synth's random generator ID.------ RandID [InitialisationRate,ControlRate] id=0-randID :: Rate -> Ugen -> Ugen-randID rate id_ = mkUgen Nothing [InitialisationRate,ControlRate] (Left rate) "RandID" [id_] Nothing 0 (Special 0) NoId---- | Sets the synth's random generator seed.------ RandSeed [InitialisationRate,ControlRate,AudioRate] trig=0 seed=56789-randSeed :: Rate -> Ugen -> Ugen -> Ugen-randSeed rate trig_ seed = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Left rate) "RandSeed" [trig_,seed] Nothing 0 (Special 0) NoId---- | Record or overdub into a Buffer.------ RecordBuf [ControlRate,AudioRate] bufnum=0 offset=0 recLevel=1 preLevel=0 run=1 loop=1 trigger=1 doneAction=0 *inputArray=0; MCE=1, REORDERS INPUTS: [8,0,1,2,3,4,5,6,7], ENUMERATION INPUTS: 5=Loop, 7=DoneAction-recordBuf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Loop Ugen -> Ugen -> DoneAction Ugen -> Ugen -> Ugen-recordBuf rate bufnum offset recLevel preLevel run loop trigger doneAction inputArray = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RecordBuf" [bufnum,offset,recLevel,preLevel,run,(from_loop loop),trigger,(from_done_action doneAction)] (Just [inputArray]) 1 (Special 0) NoId---- | Send signal to a bus, overwriting previous contents.------ ReplaceOut [ControlRate,AudioRate] bus=0 *channelsArray=0; MCE=1, FILTER: TRUE-replaceOut :: Ugen -> Ugen -> Ugen-replaceOut bus input = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "ReplaceOut" [bus] (Just [input]) 0 (Special 0) NoId---- | Resonant filter.------ Resonz [ControlRate,AudioRate] in=0 freq=440 bwr=1; FILTER: TRUE-resonz :: Ugen -> Ugen -> Ugen -> Ugen-resonz in_ freq bwr = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Resonz" [in_,freq,bwr] Nothing 1 (Special 0) NoId---- | Ringing filter.------ Ringz [ControlRate,AudioRate] in=0 freq=440 decaytime=1; FILTER: TRUE-ringz :: Ugen -> Ugen -> Ugen -> Ugen-ringz in_ freq decaytime = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Ringz" [in_,freq,decaytime] Nothing 1 (Special 0) NoId---- | Rotate a sound field.------ Rotate2 [ControlRate,AudioRate] x=0 y=0 pos=0; FILTER: TRUE-rotate2 :: Ugen -> Ugen -> Ugen -> Ugen-rotate2 x y pos = mkUgen Nothing [ControlRate,AudioRate] (Right [0,1]) "Rotate2" [x,y,pos] Nothing 2 (Special 0) NoId---- | Track maximum level.------ RunningMax [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE-runningMax :: Ugen -> Ugen -> Ugen-runningMax in_ trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "RunningMax" [in_,trig_] Nothing 1 (Special 0) NoId---- | Track minimum level.------ RunningMin [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE-runningMin :: Ugen -> Ugen -> Ugen-runningMin in_ trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "RunningMin" [in_,trig_] Nothing 1 (Special 0) NoId---- | Running sum over n frames------ RunningSum [ControlRate,AudioRate] in=0 numsamp=40; FILTER: TRUE-runningSum :: Ugen -> Ugen -> Ugen-runningSum in_ numsamp = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "RunningSum" [in_,numsamp] Nothing 1 (Special 0) NoId---- | Second order filter section (biquad).------ SOS [ControlRate,AudioRate] in=0 a0=0 a1=0 a2=0 b1=0 b2=0; FILTER: TRUE-sos :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sos in_ a0 a1 a2 b1 b2 = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "SOS" [in_,a0,a1,a2,b1,b2] Nothing 1 (Special 0) NoId---- | Duration of one sample.------ SampleDur [InitialisationRate]-sampleDur :: Ugen-sampleDur = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "SampleDur" [] Nothing 1 (Special 0) NoId---- | Server sample rate.------ SampleRate [InitialisationRate]-sampleRate :: Ugen-sampleRate = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "SampleRate" [] Nothing 1 (Special 0) NoId---- | Remove infinity, NaN, and denormals------ Sanitize [ControlRate,AudioRate] in=0 replace=0; FILTER: TRUE-sanitize :: Ugen -> Ugen -> Ugen-sanitize in_ replace = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Sanitize" [in_,replace] Nothing 1 (Special 0) NoId---- | Band limited sawtooth.------ Saw [ControlRate,AudioRate] freq=440-saw :: Rate -> Ugen -> Ugen-saw rate freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Saw" [freq] Nothing 1 (Special 0) NoId---- | Schmidt trigger.------ Schmidt [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE-schmidt :: Ugen -> Ugen -> Ugen -> Ugen-schmidt in_ lo hi = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0]) "Schmidt" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | Select output from an array of inputs.------ Select [InitialisationRate,ControlRate,AudioRate] which=0 *array=0; MCE=1, FILTER: TRUE-select :: Ugen -> Ugen -> Ugen-select which array = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0,1]) "Select" [which] (Just [array]) 1 (Special 0) NoId---- | Send a trigger message from the server back to the client.------ SendTrig [ControlRate,AudioRate] in=0 id=0 value=0; FILTER: TRUE-sendTrig :: Ugen -> Ugen -> Ugen -> Ugen-sendTrig in_ id_ value = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "SendTrig" [in_,id_,value] Nothing 0 (Special 0) NoId---- | Set-reset flip flop.------ SetResetFF [ControlRate,AudioRate] trig=0 reset=0; FILTER: TRUE-setResetFF :: Ugen -> Ugen -> Ugen-setResetFF trig_ reset = mkUgen Nothing [ControlRate,AudioRate] (Right [0,1]) "SetResetFF" [trig_,reset] Nothing 1 (Special 0) NoId---- | Wave shaper.------ Shaper [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE-shaper :: Ugen -> Ugen -> Ugen-shaper bufnum in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "Shaper" [bufnum,in_] Nothing 1 (Special 0) NoId---- | Interpolating sine wavetable oscillator.------ SinOsc [ControlRate,AudioRate] freq=440 phase=0-sinOsc :: Rate -> Ugen -> Ugen -> Ugen-sinOsc rate freq phase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "SinOsc" [freq,phase] Nothing 1 (Special 0) NoId---- | Feedback FM oscillator------ SinOscFB [ControlRate,AudioRate] freq=440 feedback=0-sinOscFB :: Rate -> Ugen -> Ugen -> Ugen-sinOscFB rate freq feedback = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "SinOscFB" [freq,feedback] Nothing 1 (Special 0) NoId---- | Slew rate limiter.------ Slew [ControlRate,AudioRate] in=0 up=1 dn=1; FILTER: TRUE-slew :: Ugen -> Ugen -> Ugen -> Ugen-slew in_ up dn = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Slew" [in_,up,dn] Nothing 1 (Special 0) NoId---- | Slope of signal------ Slope [ControlRate,AudioRate] in=0; FILTER: TRUE-slope :: Ugen -> Ugen-slope in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Slope" [in_] Nothing 1 (Special 0) NoId---- | Spectral centroid------ SpecCentroid [ControlRate] buffer=0-specCentroid :: Rate -> Ugen -> Ugen-specCentroid rate buffer = mkUgen Nothing [ControlRate] (Left rate) "SpecCentroid" [buffer] Nothing 1 (Special 0) NoId---- | Spectral Flatness measure------ SpecFlatness [ControlRate] buffer=0-specFlatness :: Rate -> Ugen -> Ugen-specFlatness rate buffer = mkUgen Nothing [ControlRate] (Left rate) "SpecFlatness" [buffer] Nothing 1 (Special 0) NoId---- | Find a percentile of FFT magnitude spectrum------ SpecPcile [ControlRate] buffer=0 fraction=0.5 interpolate=0-specPcile :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-specPcile rate buffer fraction interpolate = mkUgen Nothing [ControlRate] (Left rate) "SpecPcile" [buffer,fraction,interpolate] Nothing 1 (Special 0) NoId---- | physical model of resonating spring------ Spring [ControlRate,AudioRate] in=0 spring=1 damp=0-spring :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-spring rate in_ spring_ damp = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Spring" [in_,spring_,damp] Nothing 1 (Special 0) NoId---- | Standard map chaotic generator------ StandardL [AudioRate] freq=22050 k=1 xi=0.5 yi=0-standardL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-standardL rate freq k xi yi = mkUgen Nothing [AudioRate] (Left rate) "StandardL" [freq,k,xi,yi] Nothing 1 (Special 0) NoId---- | Standard map chaotic generator------ StandardN [AudioRate] freq=22050 k=1 xi=0.5 yi=0-standardN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-standardN rate freq k xi yi = mkUgen Nothing [AudioRate] (Left rate) "StandardN" [freq,k,xi,yi] Nothing 1 (Special 0) NoId---- | Pulse counter.------ Stepper [ControlRate,AudioRate] trig=0 reset=0 min=0 max=7 step=1 resetval=0; FILTER: TRUE-stepper :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stepper trig_ reset min_ max_ step resetval = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Stepper" [trig_,reset,min_,max_,step,resetval] Nothing 1 (Special 0) NoId---- | Stereo real-time convolver with linear interpolation------ StereoConvolution2L [AudioRate] in=0 kernelL=0 kernelR=0 trigger=0 framesize=2048 crossfade=1-stereoConvolution2L :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stereoConvolution2L rate in_ kernelL kernelR trigger framesize crossfade = mkUgen Nothing [AudioRate] (Left rate) "StereoConvolution2L" [in_,kernelL,kernelR,trigger,framesize,crossfade] Nothing 2 (Special 0) NoId---- | Offset from synth start within one sample.------ SubsampleOffset [InitialisationRate]-subsampleOffset :: Ugen-subsampleOffset = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "SubsampleOffset" [] Nothing 1 (Special 0) NoId---- | Sum three signals------ Sum3 [] in0=0 in1=0 in2=0; FILTER: TRUE-sum3 :: Ugen -> Ugen -> Ugen -> Ugen-sum3 in0 in1 in2 = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Right [0,1,2]) "Sum3" [in0,in1,in2] Nothing 1 (Special 0) NoId---- | Sum four signals------ Sum4 [] in0=0 in1=0 in2=0 in3=0; FILTER: TRUE-sum4 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sum4 in0 in1 in2 in3 = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Right [0,1,2,3]) "Sum4" [in0,in1,in2,in3] Nothing 1 (Special 0) NoId---- | Triggered linear ramp------ Sweep [ControlRate,AudioRate] trig=0 rate=1; FILTER: TRUE-sweep :: Rate -> Ugen -> Ugen -> Ugen-sweep rate trig_ rate_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Sweep" [trig_,rate_] Nothing 1 (Special 0) NoId---- | Hard sync sawtooth wave.------ SyncSaw [ControlRate,AudioRate] syncFreq=440 sawFreq=440-syncSaw :: Rate -> Ugen -> Ugen -> Ugen-syncSaw rate syncFreq sawFreq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "SyncSaw" [syncFreq,sawFreq] Nothing 1 (Special 0) NoId---- | Control rate trigger to audio rate trigger converter------ T2A [AudioRate] in=0 offset=0-t2a :: Ugen -> Ugen -> Ugen-t2a in_ offset = mkUgen Nothing [AudioRate] (Left AudioRate) "T2A" [in_,offset] Nothing 1 (Special 0) NoId---- | Audio rate trigger to control rate trigger converter------ T2K [ControlRate] in=0-t2k :: Ugen -> Ugen-t2k in_ = mkUgen Nothing [ControlRate] (Left ControlRate) "T2K" [in_] Nothing 1 (Special 0) NoId---- | physical model of bouncing object------ TBall [ControlRate,AudioRate] in=0 g=10 damp=0 friction=0.01-tBall :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tBall rate in_ g damp friction_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "TBall" [in_,g,damp,friction_] Nothing 1 (Special 0) NoId---- | Trigger delay.------ TDelay [ControlRate,AudioRate] in=0 dur=0.1; FILTER: TRUE-tDelay :: Ugen -> Ugen -> Ugen-tDelay in_ dur = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "TDelay" [in_,dur] Nothing 1 (Special 0) NoId---- | Demand results as trigger from demand rate Ugens.------ TDuty [ControlRate,AudioRate] dur=1 reset=0 doneAction=0 level=1 gapFirst=0; REORDERS INPUTS: [0,1,3,2,4], ENUMERATION INPUTS: 2=DoneAction-tDuty :: Rate -> Ugen -> Ugen -> DoneAction Ugen -> Ugen -> Ugen -> Ugen-tDuty rate dur reset doneAction level gapFirst = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "TDuty" [dur,reset,(from_done_action doneAction),level,gapFirst] Nothing 1 (Special 0) NoId---- | Triggered exponential random number generator.------ TExpRand [ControlRate,AudioRate] lo=0.01 hi=1 trig=0; FILTER: TRUE, NONDET-tExpRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-tExpRandId z lo hi trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [2]) "TExpRand" [lo,hi,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of TExpRand.-tExpRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-tExpRandM = liftUid3 tExpRandId---- | Unsafe variant of TExpRand.-tExpRand :: Ugen -> Ugen -> Ugen -> Ugen-tExpRand = liftUnsafe3 tExpRandM---- | Buffer granulator.------ TGrains [AudioRate] trigger=0 bufnum=0 rate=1 centerPos=0 dur=0.1 pan=0 amp=0.1 interp=4; NC INPUT: True-tGrains :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tGrains numChannels trigger bufnum rate_ centerPos dur pan amp interp = mkUgen Nothing [AudioRate] (Left AudioRate) "TGrains" [trigger,bufnum,rate_,centerPos,dur,pan,amp,interp] Nothing numChannels (Special 0) NoId---- | Triggered integer random number generator.------ TIRand [ControlRate,AudioRate] lo=0 hi=127 trig=0; FILTER: TRUE, NONDET-tiRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-tiRandId z lo hi trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [2]) "TIRand" [lo,hi,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Tirand.-tiRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-tiRandM = liftUid3 tiRandId---- | Unsafe variant of Tirand.-tiRand :: Ugen -> Ugen -> Ugen -> Ugen-tiRand = liftUnsafe3 tiRandM---- | Triggered random number generator.------ TRand [ControlRate,AudioRate] lo=0 hi=1 trig=0; FILTER: TRUE, NONDET-tRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-tRandId z lo hi trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [2]) "TRand" [lo,hi,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of TRand.-tRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-tRandM = liftUid3 tRandId---- | Unsafe variant of TRand.-tRand :: Ugen -> Ugen -> Ugen -> Ugen-tRand = liftUnsafe3 tRandM---- | Triggered windex.------ TWindex [ControlRate,AudioRate] in=0 normalize=0 *array=0; MCE=1, FILTER: TRUE, REORDERS INPUTS: [0,2,1], NONDET-tWindexId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-tWindexId z in_ normalize array = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "TWindex" [in_,normalize] (Just [array]) 1 (Special 0) (toUid z)---- | Monad variant of TWindex.-tWindexM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-tWindexM = liftUid3 tWindexId---- | Unsafe variant of TWindex.-tWindex :: Ugen -> Ugen -> Ugen -> Ugen-tWindex = liftUnsafe3 tWindexM---- | Returns time since last triggered.------ Timer [ControlRate,AudioRate] trig=0; FILTER: TRUE-timer :: Ugen -> Ugen-timer trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Timer" [trig_] Nothing 1 (Special 0) NoId---- | Toggle flip flop.------ ToggleFF [ControlRate,AudioRate] trig=0; FILTER: TRUE-toggleFF :: Ugen -> Ugen-toggleFF trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "ToggleFF" [trig_] Nothing 1 (Special 0) NoId---- | Timed trigger.------ Trig [ControlRate,AudioRate] in=0 dur=0.1; FILTER: TRUE-trig :: Ugen -> Ugen -> Ugen-trig in_ dur = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Trig" [in_,dur] Nothing 1 (Special 0) NoId---- | Timed trigger.------ Trig1 [ControlRate,AudioRate] in=0 dur=0.1; FILTER: TRUE-trig1 :: Ugen -> Ugen -> Ugen-trig1 in_ dur = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Trig1" [in_,dur] Nothing 1 (Special 0) NoId---- | Two pole filter.------ TwoPole [ControlRate,AudioRate] in=0 freq=440 radius=0.8; FILTER: TRUE-twoPole :: Ugen -> Ugen -> Ugen -> Ugen-twoPole in_ freq radius = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "TwoPole" [in_,freq,radius] Nothing 1 (Special 0) NoId---- | Two zero filter.------ TwoZero [ControlRate,AudioRate] in=0 freq=440 radius=0.8; FILTER: TRUE-twoZero :: Ugen -> Ugen -> Ugen -> Ugen-twoZero in_ freq radius = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "TwoZero" [in_,freq,radius] Nothing 1 (Special 0) NoId---- | Stream in audio from a file, with variable rate------ VDiskIn [AudioRate] bufnum=0 rate=1 loop=0 sendID=0; NC INPUT: True, ENUMERATION INPUTS: 2=Loop-vDiskIn :: Int -> Ugen -> Ugen -> Loop Ugen -> Ugen -> Ugen-vDiskIn numChannels bufnum rate_ loop sendID = mkUgen Nothing [AudioRate] (Left AudioRate) "VDiskIn" [bufnum,rate_,(from_loop loop),sendID] Nothing numChannels (Special 0) NoId---- | Variable wavetable oscillator.------ VOsc [ControlRate,AudioRate] bufpos=0 freq=440 phase=0-vOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-vOsc rate bufpos freq phase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "VOsc" [bufpos,freq,phase] Nothing 1 (Special 0) NoId---- | Three variable wavetable oscillators.------ VOsc3 [ControlRate,AudioRate] bufpos=0 freq1=110 freq2=220 freq3=440-vOsc3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vOsc3 rate bufpos freq1 freq2 freq3 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "VOsc3" [bufpos,freq1,freq2,freq3] Nothing 1 (Special 0) NoId---- | Variable shaped lag------ VarLag [ControlRate,AudioRate] in=0 time=0.1 curvature=0 warp=5 start=0; FILTER: TRUE-varLag :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-varLag in_ time curvature warp start = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "VarLag" [in_,time,curvature,warp,start] Nothing 1 (Special 0) NoId---- | Variable duty saw------ VarSaw [ControlRate,AudioRate] freq=440 iphase=0 width=0.5-varSaw :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-varSaw rate freq iphase width = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "VarSaw" [freq,iphase,width] Nothing 1 (Special 0) NoId---- | The Vibrato oscillator models a slow frequency modulation.------ Vibrato [ControlRate,AudioRate] freq=440 rate=6 depth=0.02 delay=0 onset=0 rateVariation=0.04 depthVariation=0.1 iphase=0 trig=0; NONDET-vibratoId :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vibratoId z rate freq rate_ depth delay onset rateVariation depthVariation iphase trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Vibrato" [freq,rate_,depth,delay,onset,rateVariation,depthVariation,iphase,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Vibrato.-vibratoM :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-vibratoM = liftUid10 vibratoId---- | Unsafe variant of Vibrato.-vibrato :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vibrato = liftUnsafe10 vibratoM---- | Warp a buffer with a time pointer------ Warp1 [AudioRate] bufnum=0 pointer=0 freqScale=1 windowSize=0.2 envbufnum=-1 overlaps=8 windowRandRatio=0 interp=1; NC INPUT: True-warp1 :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-warp1 numChannels bufnum pointer freqScale windowSize envbufnum overlaps windowRandRatio interp = mkUgen Nothing [AudioRate] (Left AudioRate) "Warp1" [bufnum,pointer,freqScale,windowSize,envbufnum,overlaps,windowRandRatio,interp] Nothing numChannels (Special 0) NoId---- | White noise.------ WhiteNoise [ControlRate,AudioRate] ; NONDET-whiteNoiseId :: ID a => a -> Rate -> Ugen-whiteNoiseId z rate = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "WhiteNoise" [] Nothing 1 (Special 0) (toUid z)---- | Monad variant of WhiteNoise.-whiteNoiseM :: Uid m => Rate -> m Ugen-whiteNoiseM = liftUid1 whiteNoiseId---- | Unsafe variant of WhiteNoise.-whiteNoise :: Rate -> Ugen-whiteNoise = liftUnsafe1 whiteNoiseM---- | Wrap a signal outside given thresholds.------ Wrap [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE-wrap :: Ugen -> Ugen -> Ugen -> Ugen-wrap in_ lo hi = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0]) "Wrap" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | Index into a table with a signal.------ WrapIndex [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE-wrapIndex :: Ugen -> Ugen -> Ugen-wrapIndex bufnum in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "WrapIndex" [bufnum,in_] Nothing 1 (Special 0) NoId---- | Equal power two channel cross fade.------ XFade2 [ControlRate,AudioRate] inA=0 inB=0 pan=0 level=1; FILTER: TRUE-xFade2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-xFade2 inA inB pan level = mkUgen Nothing [ControlRate,AudioRate] (Right [0,1]) "XFade2" [inA,inB,pan,level] Nothing 1 (Special 0) NoId---- | Exponential line generator.------ XLine [ControlRate,AudioRate] start=1 end=2 dur=1 doneAction=0; ENUMERATION INPUTS: 3=DoneAction-xLine :: Rate -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen-xLine rate start end dur doneAction = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "XLine" [start,end,dur,(from_done_action doneAction)] Nothing 1 (Special 0) NoId---- | Send signal to a bus, crossfading with previous contents.------ XOut [ControlRate,AudioRate] bus=0 xfade=0 *channelsArray=0; MCE=1, FILTER: TRUE-xOut :: Ugen -> Ugen -> Ugen -> Ugen-xOut bus xfade input = mkUgen Nothing [ControlRate,AudioRate] (Right [2]) "XOut" [bus,xfade] (Just [input]) 0 (Special 0) NoId---- | Zero crossing frequency follower------ ZeroCrossing [ControlRate,AudioRate] in=0; FILTER: TRUE-zeroCrossing :: Ugen -> Ugen-zeroCrossing in_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "ZeroCrossing" [in_] Nothing 1 (Special 0) NoId---- | LocalBuf count------ MaxLocalBufs [InitialisationRate,ControlRate] count=0-maxLocalBufs :: Ugen -> Ugen-maxLocalBufs count = mkUgen Nothing [InitialisationRate,ControlRate] (Left ControlRate) "MaxLocalBufs" [count] Nothing 1 (Special 0) NoId---- | Multiply add------ MulAdd [InitialisationRate,ControlRate,AudioRate] in=0 mul=0 add=0; FILTER: TRUE-mulAdd :: Ugen -> Ugen -> Ugen -> Ugen-mulAdd in_ mul add = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate] (Right [0,1,2]) "MulAdd" [in_,mul,add] Nothing 1 (Special 0) NoId---- | Set local buffer------ SetBuf [InitialisationRate] buf=0 offset=0 length=0 *array=0; MCE=1, REORDERS INPUTS: [0,1,2,3]-setBuf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-setBuf buf offset length_ array = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "SetBuf" [buf,offset,length_] (Just [array]) 1 (Special 0) NoId+{- | Apply a binary operation to the values of an input Ugen++ BinaryOpUgen [InitialisationRate,ControlRate,AudioRate,DemandRate] a=0 b=0; FILTER: TRUE+-}+binaryOpUgen :: Ugen -> Ugen -> Ugen+binaryOpUgen a b = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Right [0, 1]) "BinaryOpUGen" [a, b] Nothing 1 (Special 0) NoId++{- | Apply a unary operation to the values of an input ugen++ UnaryOpUgen [InitialisationRate,ControlRate,AudioRate,DemandRate] a=0; FILTER: TRUE+-}+unaryOpUgen :: Ugen -> Ugen+unaryOpUgen a = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Right [0]) "UnaryOpUGen" [a] Nothing 1 (Special 0) NoId++{- | Audio to control rate converter.++ A2K [ControlRate] in=0+-}+a2k :: Ugen -> Ugen+a2k in_ = mkUgen Nothing [ControlRate] (Left ControlRate) "A2K" [in_] Nothing 1 (Special 0) NoId++{- | FIXME: APF purpose.++ APF [ControlRate,AudioRate] in=0 freq=440 radius=0.8; FILTER: TRUE+-}+apf :: Ugen -> Ugen -> Ugen -> Ugen+apf in_ freq radius = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "APF" [in_, freq, radius] Nothing 1 (Special 0) NoId++{- | Schroeder allpass delay line with cubic interpolation.++ AllpassC [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+allpassC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+allpassC in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "AllpassC" [in_, maxdelaytime, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Schroeder allpass delay line with linear interpolation.++ AllpassL [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+allpassL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+allpassL in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "AllpassL" [in_, maxdelaytime, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Schroeder allpass delay line with no interpolation.++ AllpassN [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+allpassN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+allpassN in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "AllpassN" [in_, maxdelaytime, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Basic psychoacoustic amplitude compensation.++ AmpComp [InitialisationRate,ControlRate,AudioRate] freq=0 root=0 exp=0.3333+-}+ampComp :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+ampComp rate freq root exp_ = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Left rate) "AmpComp" [freq, root, exp_] Nothing 1 (Special 0) NoId++{- | Basic psychoacoustic amplitude compensation (ANSI A-weighting curve).++ AmpCompA [InitialisationRate,ControlRate,AudioRate] freq=1000 root=0 minAmp=0.32 rootAmp=1+-}+ampCompA :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+ampCompA rate freq root minAmp rootAmp = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Left rate) "AmpCompA" [freq, root, minAmp, rootAmp] Nothing 1 (Special 0) NoId++{- | Amplitude follower++ Amplitude [ControlRate,AudioRate] in=0 attackTime=0.01 releaseTime=0.01+-}+amplitude :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+amplitude rate in_ attackTime releaseTime = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Amplitude" [in_, attackTime, releaseTime] Nothing 1 (Special 0) NoId++{- | All Pass Filter++ BAllPass [AudioRate] in=0 freq=1200 rq=1; FILTER: TRUE+-}+bAllPass :: Ugen -> Ugen -> Ugen -> Ugen+bAllPass in_ freq rq = mkUgen Nothing [AudioRate] (Right [0]) "BAllPass" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | Band Pass Filter++ BBandPass [AudioRate] in=0 freq=1200 bw=1; FILTER: TRUE+-}+bBandPass :: Ugen -> Ugen -> Ugen -> Ugen+bBandPass in_ freq bw = mkUgen Nothing [AudioRate] (Right [0]) "BBandPass" [in_, freq, bw] Nothing 1 (Special 0) NoId++{- | Band reject filter++ BBandStop [AudioRate] in=0 freq=1200 bw=1; FILTER: TRUE+-}+bBandStop :: Ugen -> Ugen -> Ugen -> Ugen+bBandStop in_ freq bw = mkUgen Nothing [AudioRate] (Right [0]) "BBandStop" [in_, freq, bw] Nothing 1 (Special 0) NoId++{- | 12db/oct rolloff - 2nd order resonant Hi Pass Filter++ BHiPass [AudioRate] in=0 freq=1200 rq=1; FILTER: TRUE+-}+bHiPass :: Ugen -> Ugen -> Ugen -> Ugen+bHiPass in_ freq rq = mkUgen Nothing [AudioRate] (Right [0]) "BHiPass" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | Hi Shelf++ BHiShelf [AudioRate] in=0 freq=1200 rs=1 db=0; FILTER: TRUE+-}+bHiShelf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bHiShelf in_ freq rs db = mkUgen Nothing [AudioRate] (Right [0]) "BHiShelf" [in_, freq, rs, db] Nothing 1 (Special 0) NoId++{- | 12db/oct rolloff - 2nd order resonant Low Pass Filter++ BLowPass [AudioRate] in=0 freq=1200 rq=1; FILTER: TRUE+-}+bLowPass :: Ugen -> Ugen -> Ugen -> Ugen+bLowPass in_ freq rq = mkUgen Nothing [AudioRate] (Right [0]) "BLowPass" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | Low Shelf++ BLowShelf [AudioRate] in=0 freq=1200 rs=1 db=0; FILTER: TRUE+-}+bLowShelf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bLowShelf in_ freq rs db = mkUgen Nothing [AudioRate] (Right [0]) "BLowShelf" [in_, freq, rs, db] Nothing 1 (Special 0) NoId++{- | 2nd order Butterworth bandpass filter.++ BPF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE+-}+bpf :: Ugen -> Ugen -> Ugen -> Ugen+bpf in_ freq rq = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "BPF" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | Two zero fixed midpass.++ BPZ2 [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+bpz2 :: Ugen -> Ugen+bpz2 in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "BPZ2" [in_] Nothing 1 (Special 0) NoId++{- | Parametric equalizer++ BPeakEQ [AudioRate] in=0 freq=1200 rq=1 db=0; FILTER: TRUE+-}+bPeakEQ :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bPeakEQ in_ freq rq db = mkUgen Nothing [AudioRate] (Right [0]) "BPeakEQ" [in_, freq, rq, db] Nothing 1 (Special 0) NoId++{- | 2nd order Butterworth band reject filter.++ BRF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE+-}+brf :: Ugen -> Ugen -> Ugen -> Ugen+brf in_ freq rq = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "BRF" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | Two zero fixed midcut.++ BRZ2 [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+brz2 :: Ugen -> Ugen+brz2 in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "BRZ2" [in_] Nothing 1 (Special 0) NoId++{- | Stereo signal balancer++ Balance2 [ControlRate,AudioRate] left=0 right=0 pos=0 level=1; FILTER: TRUE+-}+balance2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+balance2 left right pos level = mkUgen Nothing [ControlRate, AudioRate] (Right [0, 1]) "Balance2" [left, right, pos, level] Nothing 2 (Special 0) NoId++{- | physical model of bouncing object++ Ball [ControlRate,AudioRate] in=0 g=1 damp=0 friction=0.01+-}+ball :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+ball rate in_ g damp friction_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Ball" [in_, g, damp, friction_] Nothing 1 (Special 0) NoId++{- | Autocorrelation beat tracker++ BeatTrack [ControlRate] chain=0 lock=0+-}+beatTrack :: Rate -> Ugen -> Ugen -> Ugen+beatTrack rate chain lock = mkUgen Nothing [ControlRate] (Left rate) "BeatTrack" [chain, lock] Nothing 4 (Special 0) NoId++{- | Template matching beat tracker++ BeatTrack2 [ControlRate] busindex=0 numfeatures=0 windowsize=2 phaseaccuracy=0.02 lock=0 weightingscheme=0+-}+beatTrack2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+beatTrack2 rate busindex numfeatures windowsize phaseaccuracy lock weightingscheme = mkUgen Nothing [ControlRate] (Left rate) "BeatTrack2" [busindex, numfeatures, windowsize, phaseaccuracy, lock, weightingscheme] Nothing 6 (Special 0) NoId++{- | 2D Ambisonic B-format panner.++ BiPanB2 [ControlRate,AudioRate] inA=0 inB=0 azimuth=0 gain=1+-}+biPanB2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+biPanB2 rate inA inB azimuth gain = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "BiPanB2" [inA, inB, azimuth, gain] Nothing 3 (Special 0) NoId++{- | Band limited impulse oscillator.++ Blip [ControlRate,AudioRate] freq=440 numharm=200+-}+blip :: Rate -> Ugen -> Ugen -> Ugen+blip rate freq numharm = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Blip" [freq, numharm] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BlockSize [InitialisationRate]+-}+blockSize :: Ugen+blockSize = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "BlockSize" [] Nothing 1 (Special 0) NoId++{- | Brown Noise.++ BrownNoise [ControlRate,AudioRate] ; NONDET+-}+brownNoiseId :: ID a => a -> Rate -> Ugen+brownNoiseId z rate = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "BrownNoise" [] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of BrownNoise.+brownNoiseM :: Uid m => Rate -> m Ugen+brownNoiseM = liftUid1 brownNoiseId++-- | Unsafe variant of BrownNoise.+brownNoise :: Rate -> Ugen+brownNoise = liftUnsafe1 brownNoiseM++{- | Buffer based all pass delay line with cubic interpolation.++ BufAllpassC [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+bufAllpassC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufAllpassC buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufAllpassC" [buf, in_, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Buffer based all pass delay line with linear interpolation.++ BufAllpassL [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+bufAllpassL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufAllpassL buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufAllpassL" [buf, in_, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Buffer based all pass delay line with no interpolation.++ BufAllpassN [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+bufAllpassN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufAllpassN buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufAllpassN" [buf, in_, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Current number of channels of soundfile in buffer.++ BufChannels [InitialisationRate,ControlRate] bufnum=0+-}+bufChannels :: Rate -> Ugen -> Ugen+bufChannels rate bufnum = mkUgen Nothing [InitialisationRate, ControlRate] (Left rate) "BufChannels" [bufnum] Nothing 1 (Special 0) NoId++{- | Buffer based comb delay line with cubic interpolation.++ BufCombC [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+bufCombC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufCombC buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufCombC" [buf, in_, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Buffer based comb delay line with linear interpolation.++ BufCombL [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+bufCombL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufCombL buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufCombL" [buf, in_, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Buffer based comb delay line with no interpolation.++ BufCombN [AudioRate] buf=0 in=0 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+bufCombN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufCombN buf in_ delaytime decaytime = mkUgen Nothing [AudioRate] (Right [1]) "BufCombN" [buf, in_, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Buffer based simple delay line with cubic interpolation.++ BufDelayC [ControlRate,AudioRate] buf=0 in=0 delaytime=0.2; FILTER: TRUE+-}+bufDelayC :: Ugen -> Ugen -> Ugen -> Ugen+bufDelayC buf in_ delaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "BufDelayC" [buf, in_, delaytime] Nothing 1 (Special 0) NoId++{- | Buffer based simple delay line with linear interpolation.++ BufDelayL [ControlRate,AudioRate] buf=0 in=0 delaytime=0.2; FILTER: TRUE+-}+bufDelayL :: Ugen -> Ugen -> Ugen -> Ugen+bufDelayL buf in_ delaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "BufDelayL" [buf, in_, delaytime] Nothing 1 (Special 0) NoId++{- | Buffer based simple delay line with no interpolation.++ BufDelayN [ControlRate,AudioRate] buf=0 in=0 delaytime=0.2; FILTER: TRUE+-}+bufDelayN :: Ugen -> Ugen -> Ugen -> Ugen+bufDelayN buf in_ delaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "BufDelayN" [buf, in_, delaytime] Nothing 1 (Special 0) NoId++{- | Current duration of soundfile in buffer.++ BufDur [InitialisationRate,ControlRate] bufnum=0+-}+bufDur :: Rate -> Ugen -> Ugen+bufDur rate bufnum = mkUgen Nothing [InitialisationRate, ControlRate] (Left rate) "BufDur" [bufnum] Nothing 1 (Special 0) NoId++{- | Current number of frames allocated in the buffer.++ BufFrames [InitialisationRate,ControlRate] bufnum=0+-}+bufFrames :: Rate -> Ugen -> Ugen+bufFrames rate bufnum = mkUgen Nothing [InitialisationRate, ControlRate] (Left rate) "BufFrames" [bufnum] Nothing 1 (Special 0) NoId++{- | Buffer rate scaling in respect to server samplerate.++ BufRateScale [InitialisationRate,ControlRate] bufnum=0+-}+bufRateScale :: Rate -> Ugen -> Ugen+bufRateScale rate bufnum = mkUgen Nothing [InitialisationRate, ControlRate] (Left rate) "BufRateScale" [bufnum] Nothing 1 (Special 0) NoId++{- | Buffer reading oscillator.++ BufRd [ControlRate,AudioRate] bufnum=0 phase=0 loop=1 interpolation=2; NC INPUT: True, ENUMERATION INPUTS: 2=Loop, 3=Interpolation+-}+bufRd :: Int -> Rate -> Ugen -> Ugen -> Loop Ugen -> Interpolation Ugen -> Ugen+bufRd numChannels rate bufnum phase loop interpolation = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "BufRd" [bufnum, phase, (from_loop loop), (from_interpolation interpolation)] Nothing numChannels (Special 0) NoId++{- | Buffer sample rate.++ BufSampleRate [InitialisationRate,ControlRate] bufnum=0+-}+bufSampleRate :: Rate -> Ugen -> Ugen+bufSampleRate rate bufnum = mkUgen Nothing [InitialisationRate, ControlRate] (Left rate) "BufSampleRate" [bufnum] Nothing 1 (Special 0) NoId++{- | Current number of samples in buffer.++ BufSamples [InitialisationRate,ControlRate] bufnum=0+-}+bufSamples :: Rate -> Ugen -> Ugen+bufSamples rate bufnum = mkUgen Nothing [InitialisationRate, ControlRate] (Left rate) "BufSamples" [bufnum] Nothing 1 (Special 0) NoId++{- | Buffer writing oscillator.++ BufWr [ControlRate,AudioRate] bufnum=0 phase=0 loop=1 *inputArray=0; MCE=1, FILTER: TRUE, REORDERS INPUTS: [3,0,1,2], ENUMERATION INPUTS: 2=Loop+-}+bufWr :: Ugen -> Ugen -> Loop Ugen -> Ugen -> Ugen+bufWr bufnum phase loop inputArray = mkUgen Nothing [ControlRate, AudioRate] (Right [3]) "BufWr" [bufnum, phase, (from_loop loop)] (Just [inputArray]) 1 (Special 0) NoId++{- | Chorusing wavetable oscillator.++ COsc [ControlRate,AudioRate] bufnum=0 freq=440 beats=0.5+-}+cOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+cOsc rate bufnum freq beats = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "COsc" [bufnum, freq, beats] Nothing 1 (Special 0) NoId++{- | Test for infinity, not-a-number, and denormals++ CheckBadValues [ControlRate,AudioRate] in=0 id=0 post=2; FILTER: TRUE+-}+checkBadValues :: Ugen -> Ugen -> Ugen -> Ugen+checkBadValues in_ id_ post = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "CheckBadValues" [in_, id_, post] Nothing 1 (Special 0) NoId++{- | Clip a signal outside given thresholds.++ Clip [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE+-}+clip :: Ugen -> Ugen -> Ugen -> Ugen+clip in_ lo hi = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0]) "Clip" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | Clip Noise.++ ClipNoise [ControlRate,AudioRate] ; NONDET+-}+clipNoiseId :: ID a => a -> Rate -> Ugen+clipNoiseId z rate = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "ClipNoise" [] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of ClipNoise.+clipNoiseM :: Uid m => Rate -> m Ugen+clipNoiseM = liftUid1 clipNoiseId++-- | Unsafe variant of ClipNoise.+clipNoise :: Rate -> Ugen+clipNoise = liftUnsafe1 clipNoiseM++{- | Statistical gate.++ CoinGate [ControlRate,AudioRate] prob=0 in=0; FILTER: TRUE, NONDET+-}+coinGateId :: ID a => a -> Ugen -> Ugen -> Ugen+coinGateId z prob in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "CoinGate" [prob, in_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of CoinGate.+coinGateM :: Uid m => Ugen -> Ugen -> m Ugen+coinGateM = liftUid2 coinGateId++-- | Unsafe variant of CoinGate.+coinGate :: Ugen -> Ugen -> Ugen+coinGate = liftUnsafe2 coinGateM++{- | Comb delay line with cubic interpolation.++ CombC [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+combC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+combC in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "CombC" [in_, maxdelaytime, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Comb delay line with linear interpolation.++ CombL [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+combL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+combL in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "CombL" [in_, maxdelaytime, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Comb delay line with no interpolation.++ CombN [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2 decaytime=1; FILTER: TRUE+-}+combN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+combN in_ maxdelaytime delaytime decaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "CombN" [in_, maxdelaytime, delaytime, decaytime] Nothing 1 (Special 0) NoId++{- | Compressor, expander, limiter, gate, ducker++ Compander [AudioRate] in=0 control=0 thresh=0.5 slopeBelow=1 slopeAbove=1 clampTime=0.01 relaxTime=0.1; FILTER: TRUE+-}+compander :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+compander in_ control_ thresh slopeBelow slopeAbove clampTime relaxTime = mkUgen Nothing [AudioRate] (Right [0]) "Compander" [in_, control_, thresh, slopeBelow, slopeAbove, clampTime, relaxTime] Nothing 1 (Special 0) NoId++{- | Compressor, expander, limiter, gate, ducker.++ CompanderD [AudioRate] in=0 thresh=0.5 slopeBelow=1 slopeAbove=1 clampTime=0.01 relaxTime=0.01+-}+companderD :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+companderD rate in_ thresh slopeBelow slopeAbove clampTime relaxTime = mkUgen Nothing [AudioRate] (Left rate) "CompanderD" [in_, thresh, slopeBelow, slopeAbove, clampTime, relaxTime] Nothing 1 (Special 0) NoId++{- | Duration of one block++ ControlDur [InitialisationRate]+-}+controlDur :: Ugen+controlDur = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "ControlDur" [] Nothing 1 (Special 0) NoId++{- | Server control rate.++ ControlRate [InitialisationRate]+-}+controlRate :: Ugen+controlRate = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "ControlRate" [] Nothing 1 (Special 0) NoId++{- | Real-time convolver.++ Convolution [AudioRate] in=0 kernel=0 framesize=512+-}+convolution :: Ugen -> Ugen -> Ugen -> Ugen+convolution in_ kernel framesize = mkUgen Nothing [AudioRate] (Left AudioRate) "Convolution" [in_, kernel, framesize] Nothing 1 (Special 0) NoId++{- | Real-time fixed kernel convolver.++ Convolution2 [AudioRate] in=0 kernel=0 trigger=0 framesize=2048+-}+convolution2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+convolution2 in_ kernel trigger framesize = mkUgen Nothing [AudioRate] (Left AudioRate) "Convolution2" [in_, kernel, trigger, framesize] Nothing 1 (Special 0) NoId++{- | Real-time convolver with linear interpolation++ Convolution2L [AudioRate] in=0 kernel=0 trigger=0 framesize=2048 crossfade=1+-}+convolution2L :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+convolution2L rate in_ kernel trigger framesize crossfade = mkUgen Nothing [AudioRate] (Left rate) "Convolution2L" [in_, kernel, trigger, framesize, crossfade] Nothing 1 (Special 0) NoId++{- | Time based convolver.++ Convolution3 [ControlRate,AudioRate] in=0 kernel=0 trigger=0 framesize=2048+-}+convolution3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+convolution3 rate in_ kernel trigger framesize = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Convolution3" [in_, kernel, trigger, framesize] Nothing 1 (Special 0) NoId++{- | Chaotic noise function.++ Crackle [ControlRate,AudioRate] chaosParam=1.5+-}+crackle :: Rate -> Ugen -> Ugen+crackle rate chaosParam = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Crackle" [chaosParam] Nothing 1 (Special 0) NoId++{- | Cusp map chaotic generator++ CuspL [AudioRate] freq=22050 a=1 b=1.9 xi=0+-}+cuspL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+cuspL rate freq a b xi = mkUgen Nothing [AudioRate] (Left rate) "CuspL" [freq, a, b, xi] Nothing 1 (Special 0) NoId++{- | Cusp map chaotic generator++ CuspN [AudioRate] freq=22050 a=1 b=1.9 xi=0+-}+cuspN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+cuspN rate freq a b xi = mkUgen Nothing [AudioRate] (Left rate) "CuspN" [freq, a, b, xi] Nothing 1 (Special 0) NoId++{- | Create a constant amplitude signal++ DC [ControlRate,AudioRate] in=0+-}+dc :: Rate -> Ugen -> Ugen+dc rate in_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "DC" [in_] Nothing 1 (Special 0) NoId++{- | Demand rate brownian movement generator.++ Dbrown [DemandRate] length=100000000 lo=0 hi=1 step=0.01; REORDERS INPUTS: [1,2,3,0], DEMAND/NONDET+-}+dbrownId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dbrownId z length_ lo hi step = mkUgen Nothing [DemandRate] (Left DemandRate) "Dbrown" [length_, lo, hi, step] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dbrown.+dbrownM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+dbrownM = liftUid4 dbrownId++-- | Unsafe variant of Dbrown.+dbrown :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dbrown = liftUnsafe4 dbrownM++{- | Buffer read demand ugen++ Dbufrd [DemandRate] bufnum=0 phase=0 loop=1; ENUMERATION INPUTS: 2=Loop, DEMAND/NONDET+-}+dbufrdId :: ID a => a -> Ugen -> Ugen -> Loop Ugen -> Ugen+dbufrdId z bufnum phase loop = mkUgen Nothing [DemandRate] (Left DemandRate) "Dbufrd" [bufnum, phase, (from_loop loop)] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dbufrd.+dbufrdM :: Uid m => Ugen -> Ugen -> Loop Ugen -> m Ugen+dbufrdM = liftUid3 dbufrdId++-- | Unsafe variant of Dbufrd.+dbufrd :: Ugen -> Ugen -> Loop Ugen -> Ugen+dbufrd = liftUnsafe3 dbufrdM++{- | Buffer write demand ugen++ Dbufwr [DemandRate] bufnum=0 phase=0 input=0 loop=1; REORDERS INPUTS: [2,0,1,3], ENUMERATION INPUTS: 3=Loop, DEMAND/NONDET+-}+dbufwrId :: ID a => a -> Ugen -> Ugen -> Ugen -> Loop Ugen -> Ugen+dbufwrId z bufnum phase input loop = mkUgen Nothing [DemandRate] (Left DemandRate) "Dbufwr" [bufnum, phase, input, (from_loop loop)] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dbufwr.+dbufwrM :: Uid m => Ugen -> Ugen -> Ugen -> Loop Ugen -> m Ugen+dbufwrM = liftUid4 dbufwrId++-- | Unsafe variant of Dbufwr.+dbufwr :: Ugen -> Ugen -> Ugen -> Loop Ugen -> Ugen+dbufwr = liftUnsafe4 dbufwrM++{- | Constrain a demand-rate stream to a given sum++ Dconst [DemandRate] sum=0 in=0 tolerance=0.001; DEMAND/NONDET+-}+dconstId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+dconstId z sum_ in_ tolerance = mkUgen Nothing [DemandRate] (Left DemandRate) "Dconst" [sum_, in_, tolerance] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dconst.+dconstM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+dconstM = liftUid3 dconstId++-- | Unsafe variant of Dconst.+dconst :: Ugen -> Ugen -> Ugen -> Ugen+dconst = liftUnsafe3 dconstM++{- | Exponential decay++ Decay [ControlRate,AudioRate] in=0 decayTime=1; FILTER: TRUE+-}+decay :: Ugen -> Ugen -> Ugen+decay in_ decayTime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Decay" [in_, decayTime] Nothing 1 (Special 0) NoId++{- | Exponential decay++ Decay2 [ControlRate,AudioRate] in=0 attackTime=0.01 decayTime=1; FILTER: TRUE+-}+decay2 :: Ugen -> Ugen -> Ugen -> Ugen+decay2 in_ attackTime decayTime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Decay2" [in_, attackTime, decayTime] Nothing 1 (Special 0) NoId++{- | 2D Ambisonic B-format decoder.++ DecodeB2 [ControlRate,AudioRate] w=0 x=0 y=0 orientation=0.5; NC INPUT: True, FILTER: TRUE+-}+decodeB2 :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+decodeB2 numChannels w x y orientation = mkUgen Nothing [ControlRate, AudioRate] (Right [0, 1, 2]) "DecodeB2" [w, x, y, orientation] Nothing numChannels (Special 0) NoId++{- | Convert signal to modal pitch.++ DegreeToKey [ControlRate,AudioRate] bufnum=0 in=0 octave=12; FILTER: TRUE+-}+degreeToKey :: Ugen -> Ugen -> Ugen -> Ugen+degreeToKey bufnum in_ octave = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "DegreeToKey" [bufnum, in_, octave] Nothing 1 (Special 0) NoId++{- | Tap a delay line from a DelTapWr Ugen++ DelTapRd [ControlRate,AudioRate] buffer=0 phase=0 delTime=0 interp=1; FILTER: TRUE+-}+delTapRd :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+delTapRd buffer phase delTime interp = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "DelTapRd" [buffer, phase, delTime, interp] Nothing 1 (Special 0) NoId++{- | Write to a buffer for a DelTapRd Ugen++ DelTapWr [ControlRate,AudioRate] buffer=0 in=0; FILTER: TRUE+-}+delTapWr :: Ugen -> Ugen -> Ugen+delTapWr buffer in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "DelTapWr" [buffer, in_] Nothing 1 (Special 0) NoId++{- | Single sample delay.++ Delay1 [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+delay1 :: Ugen -> Ugen+delay1 in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Delay1" [in_] Nothing 1 (Special 0) NoId++{- | Two sample delay.++ Delay2 [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+delay2 :: Ugen -> Ugen+delay2 in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Delay2" [in_] Nothing 1 (Special 0) NoId++{- | Simple delay line with cubic interpolation.++ DelayC [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2; FILTER: TRUE+-}+delayC :: Ugen -> Ugen -> Ugen -> Ugen+delayC in_ maxdelaytime delaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "DelayC" [in_, maxdelaytime, delaytime] Nothing 1 (Special 0) NoId++{- | Simple delay line with linear interpolation.++ DelayL [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2; FILTER: TRUE+-}+delayL :: Ugen -> Ugen -> Ugen -> Ugen+delayL in_ maxdelaytime delaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "DelayL" [in_, maxdelaytime, delaytime] Nothing 1 (Special 0) NoId++{- | Simple delay line with no interpolation.++ DelayN [ControlRate,AudioRate] in=0 maxdelaytime=0.2 delaytime=0.2; FILTER: TRUE+-}+delayN :: Ugen -> Ugen -> Ugen -> Ugen+delayN in_ maxdelaytime delaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "DelayN" [in_, maxdelaytime, delaytime] Nothing 1 (Special 0) NoId++{- | Demand results from demand rate Ugens.++ Demand [ControlRate,AudioRate] trig=0 reset=0 *demandUgens=0; MCE=1, FILTER: TRUE+-}+demand :: Ugen -> Ugen -> Ugen -> Ugen+demand trig_ reset demandUgens = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Demand" [trig_, reset] (Just [demandUgens]) (length (mceChannels demandUgens) + 0) (Special 0) NoId++{- | Demand rate envelope generator++ DemandEnvGen [ControlRate,AudioRate] level=0 dur=0 shape=1 curve=0 gate=1 reset=1 levelScale=1 levelBias=0 timeScale=1 doneAction=0; ENUMERATION INPUTS: 9=DoneAction+-}+demandEnvGen :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen+demandEnvGen rate level dur shape curve gate_ reset levelScale levelBias timeScale doneAction = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "DemandEnvGen" [level, dur, shape, curve, gate_, reset, levelScale, levelBias, timeScale, (from_done_action doneAction)] Nothing 1 (Special 0) NoId++{- | Search a buffer for a value++ DetectIndex [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE+-}+detectIndex :: Ugen -> Ugen -> Ugen+detectIndex bufnum in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "DetectIndex" [bufnum, in_] Nothing 1 (Special 0) NoId++{- | Detect when input falls below an amplitude threshold++ DetectSilence [ControlRate,AudioRate] in=0 amp=0.0001 time=0.1 doneAction=0; FILTER: TRUE, ENUMERATION INPUTS: 3=DoneAction+-}+detectSilence :: Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen+detectSilence in_ amp time doneAction = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "DetectSilence" [in_, amp, time, (from_done_action doneAction)] Nothing 1 (Special 0) NoId++{- | Demand rate geometric series Ugen.++ Dgeom [DemandRate] length=100000000 start=1 grow=2; REORDERS INPUTS: [1,2,0], DEMAND/NONDET+-}+dgeomId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+dgeomId z length_ start grow = mkUgen Nothing [DemandRate] (Left DemandRate) "Dgeom" [length_, start, grow] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dgeom.+dgeomM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+dgeomM = liftUid3 dgeomId++-- | Unsafe variant of Dgeom.+dgeom :: Ugen -> Ugen -> Ugen -> Ugen+dgeom = liftUnsafe3 dgeomM++{- | Demand rate brownian movement generator.++ Dibrown [DemandRate] length=100000000 lo=0 hi=1 step=0.01; REORDERS INPUTS: [1,2,3,0], DEMAND/NONDET+-}+dibrownId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dibrownId z length_ lo hi step = mkUgen Nothing [DemandRate] (Left DemandRate) "Dibrown" [length_, lo, hi, step] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dibrown.+dibrownM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+dibrownM = liftUid4 dibrownId++-- | Unsafe variant of Dibrown.+dibrown :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dibrown = liftUnsafe4 dibrownM++{- | Stream in audio from a file.++ DiskIn [AudioRate] bufnum=0 loop=0; NC INPUT: True, ENUMERATION INPUTS: 1=Loop+-}+diskIn :: Int -> Ugen -> Loop Ugen -> Ugen+diskIn numChannels bufnum loop = mkUgen Nothing [AudioRate] (Left AudioRate) "DiskIn" [bufnum, (from_loop loop)] Nothing numChannels (Special 0) NoId++{- | Record to a soundfile to disk.++ DiskOut [AudioRate] bufnum=0 *channelsArray=0; MCE=1+-}+diskOut :: Ugen -> Ugen -> Ugen+diskOut bufnum input = mkUgen Nothing [AudioRate] (Left AudioRate) "DiskOut" [bufnum] (Just [input]) 1 (Special 0) NoId++{- | Demand rate white noise random generator.++ Diwhite [DemandRate] length=100000000 lo=0 hi=1; REORDERS INPUTS: [1,2,0], DEMAND/NONDET+-}+diwhiteId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+diwhiteId z length_ lo hi = mkUgen Nothing [DemandRate] (Left DemandRate) "Diwhite" [length_, lo, hi] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Diwhite.+diwhiteM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+diwhiteM = liftUid3 diwhiteId++-- | Unsafe variant of Diwhite.+diwhite :: Ugen -> Ugen -> Ugen -> Ugen+diwhite = liftUnsafe3 diwhiteM++{- | Monitors another Ugen to see when it is finished++ Done [ControlRate] src=0+-}+done :: Ugen -> Ugen+done src = mkUgen Nothing [ControlRate] (Left ControlRate) "Done" [src] Nothing 1 (Special 0) NoId++{- | Print the current output value of a demand rate Ugen++ Dpoll [DemandRate] in=0 label=0 run=1 trigid=-1; DEMAND/NONDET+-}+dpollId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dpollId z in_ label_ run trigid = mkUgen Nothing [DemandRate] (Left DemandRate) "Dpoll" [in_, label_, run, trigid] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dpoll.+dpollM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+dpollM = liftUid4 dpollId++-- | Unsafe variant of Dpoll.+dpoll :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dpoll = liftUnsafe4 dpollM++{- | Demand rate random sequence generator.++ Drand [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET+-}+drandId :: ID a => a -> Ugen -> Ugen -> Ugen+drandId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Drand" [repeats] (Just [list_]) 1 (Special 0) (toUid z)++-- | Monad variant of Drand.+drandM :: Uid m => Ugen -> Ugen -> m Ugen+drandM = liftUid2 drandId++-- | Unsafe variant of Drand.+drand :: Ugen -> Ugen -> Ugen+drand = liftUnsafe2 drandM++{- | demand rate reset++ Dreset [DemandRate] in=0 reset=0; DEMAND/NONDET+-}+dresetId :: ID a => a -> Ugen -> Ugen -> Ugen+dresetId z in_ reset = mkUgen Nothing [DemandRate] (Left DemandRate) "Dreset" [in_, reset] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dreset.+dresetM :: Uid m => Ugen -> Ugen -> m Ugen+dresetM = liftUid2 dresetId++-- | Unsafe variant of Dreset.+dreset :: Ugen -> Ugen -> Ugen+dreset = liftUnsafe2 dresetM++{- | Demand rate sequence generator.++ Dseq [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET+-}+dseqId :: ID a => a -> Ugen -> Ugen -> Ugen+dseqId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dseq" [repeats] (Just [list_]) 1 (Special 0) (toUid z)++-- | Monad variant of Dseq.+dseqM :: Uid m => Ugen -> Ugen -> m Ugen+dseqM = liftUid2 dseqId++-- | Unsafe variant of Dseq.+dseq :: Ugen -> Ugen -> Ugen+dseq = liftUnsafe2 dseqM++{- | Demand rate sequence generator.++ Dser [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET+-}+dserId :: ID a => a -> Ugen -> Ugen -> Ugen+dserId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dser" [repeats] (Just [list_]) 1 (Special 0) (toUid z)++-- | Monad variant of Dser.+dserM :: Uid m => Ugen -> Ugen -> m Ugen+dserM = liftUid2 dserId++-- | Unsafe variant of Dser.+dser :: Ugen -> Ugen -> Ugen+dser = liftUnsafe2 dserM++{- | Demand rate arithmetic series Ugen.++ Dseries [DemandRate] length=100000000 start=1 step=1; REORDERS INPUTS: [1,2,0], DEMAND/NONDET+-}+dseriesId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+dseriesId z length_ start step = mkUgen Nothing [DemandRate] (Left DemandRate) "Dseries" [length_, start, step] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dseries.+dseriesM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+dseriesM = liftUid3 dseriesId++-- | Unsafe variant of Dseries.+dseries :: Ugen -> Ugen -> Ugen -> Ugen+dseries = liftUnsafe3 dseriesM++{- | Demand rate random sequence generator++ Dshuf [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET+-}+dshufId :: ID a => a -> Ugen -> Ugen -> Ugen+dshufId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dshuf" [repeats] (Just [list_]) 1 (Special 0) (toUid z)++-- | Monad variant of Dshuf.+dshufM :: Uid m => Ugen -> Ugen -> m Ugen+dshufM = liftUid2 dshufId++-- | Unsafe variant of Dshuf.+dshuf :: Ugen -> Ugen -> Ugen+dshuf = liftUnsafe2 dshufM++{- | Demand rate input replicator++ Dstutter [DemandRate] n=0 in=0; DEMAND/NONDET+-}+dstutterId :: ID a => a -> Ugen -> Ugen -> Ugen+dstutterId z n in_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dstutter" [n, in_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dstutter.+dstutterM :: Uid m => Ugen -> Ugen -> m Ugen+dstutterM = liftUid2 dstutterId++-- | Unsafe variant of Dstutter.+dstutter :: Ugen -> Ugen -> Ugen+dstutter = liftUnsafe2 dstutterM++{- | Demand rate generator for embedding different inputs++ Dswitch [DemandRate] index=0 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET+-}+dswitchId :: ID a => a -> Ugen -> Ugen -> Ugen+dswitchId z index_ list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dswitch" [index_] (Just [list_]) 1 (Special 0) (toUid z)++-- | Monad variant of Dswitch.+dswitchM :: Uid m => Ugen -> Ugen -> m Ugen+dswitchM = liftUid2 dswitchId++-- | Unsafe variant of Dswitch.+dswitch :: Ugen -> Ugen -> Ugen+dswitch = liftUnsafe2 dswitchM++{- | Demand rate generator for switching between inputs.++ Dswitch1 [DemandRate] index=0 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET+-}+dswitch1Id :: ID a => a -> Ugen -> Ugen -> Ugen+dswitch1Id z index_ list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dswitch1" [index_] (Just [list_]) 1 (Special 0) (toUid z)++-- | Monad variant of Dswitch1.+dswitch1M :: Uid m => Ugen -> Ugen -> m Ugen+dswitch1M = liftUid2 dswitch1Id++-- | Unsafe variant of Dswitch1.+dswitch1 :: Ugen -> Ugen -> Ugen+dswitch1 = liftUnsafe2 dswitch1M++{- | Return the same unique series of values for several demand streams++ Dunique [DemandRate] source=0 maxBufferSize=1024 protected=1; DEMAND/NONDET+-}+duniqueId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+duniqueId z source maxBufferSize protected = mkUgen Nothing [DemandRate] (Left DemandRate) "Dunique" [source, maxBufferSize, protected] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dunique.+duniqueM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+duniqueM = liftUid3 duniqueId++-- | Unsafe variant of Dunique.+dunique :: Ugen -> Ugen -> Ugen -> Ugen+dunique = liftUnsafe3 duniqueM++{- | Random impulses.++ Dust [ControlRate,AudioRate] density=0; NONDET+-}+dustId :: ID a => a -> Rate -> Ugen -> Ugen+dustId z rate density = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Dust" [density] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dust.+dustM :: Uid m => Rate -> Ugen -> m Ugen+dustM = liftUid2 dustId++-- | Unsafe variant of Dust.+dust :: Rate -> Ugen -> Ugen+dust = liftUnsafe2 dustM++{- | Random impulses.++ Dust2 [ControlRate,AudioRate] density=0; NONDET+-}+dust2Id :: ID a => a -> Rate -> Ugen -> Ugen+dust2Id z rate density = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Dust2" [density] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dust2.+dust2M :: Uid m => Rate -> Ugen -> m Ugen+dust2M = liftUid2 dust2Id++-- | Unsafe variant of Dust2.+dust2 :: Rate -> Ugen -> Ugen+dust2 = liftUnsafe2 dust2M++{- | Demand results from demand rate Ugens.++ Duty [ControlRate,AudioRate] dur=1 reset=0 doneAction=0 level=1; REORDERS INPUTS: [0,1,3,2], ENUMERATION INPUTS: 2=DoneAction+-}+duty :: Rate -> Ugen -> Ugen -> DoneAction Ugen -> Ugen -> Ugen+duty rate dur reset doneAction level = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Duty" [dur, reset, (from_done_action doneAction), level] Nothing 1 (Special 0) NoId++{- | Demand rate white noise random generator.++ Dwhite [DemandRate] length=100000000 lo=0 hi=1; REORDERS INPUTS: [1,2,0], DEMAND/NONDET+-}+dwhiteId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+dwhiteId z length_ lo hi = mkUgen Nothing [DemandRate] (Left DemandRate) "Dwhite" [length_, lo, hi] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dwhite.+dwhiteM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+dwhiteM = liftUid3 dwhiteId++-- | Unsafe variant of Dwhite.+dwhite :: Ugen -> Ugen -> Ugen -> Ugen+dwhite = liftUnsafe3 dwhiteM++{-+-- | Demand rate weighted random sequence generator+--+-- Dwrand [DemandRate] repeats=1 weights=0 *list=0; MCE=1, REORDERS INPUTS: [2,1,0], DEMAND/NONDET+dwrandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+dwrandId z repeats weights list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dwrand" [repeats,weights] (Just [list_]) 1 (Special 0) (toUid z)++-- | Monad variant of Dwrand.+dwrandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+dwrandM = liftUid3 dwrandId++-- | Unsafe variant of Dwrand.+dwrand :: Ugen -> Ugen -> Ugen -> Ugen+dwrand = liftUnsafe3 dwrandM+-}++{- | Demand rate random sequence generator.++ Dxrand [DemandRate] repeats=1 *list=0; MCE=1, REORDERS INPUTS: [1,0], DEMAND/NONDET+-}+dxrandId :: ID a => a -> Ugen -> Ugen -> Ugen+dxrandId z repeats list_ = mkUgen Nothing [DemandRate] (Left DemandRate) "Dxrand" [repeats] (Just [list_]) 1 (Special 0) (toUid z)++-- | Monad variant of Dxrand.+dxrandM :: Uid m => Ugen -> Ugen -> m Ugen+dxrandM = liftUid2 dxrandId++-- | Unsafe variant of Dxrand.+dxrand :: Ugen -> Ugen -> Ugen+dxrand = liftUnsafe2 dxrandM++{- | Envelope generator++ EnvGen [ControlRate,AudioRate] gate=1 levelScale=1 levelBias=0 timeScale=1 doneAction=0 *envelope=0; MCE=1, REORDERS INPUTS: [5,0,1,2,3,4], ENUMERATION INPUTS: 4=DoneAction, 5=Envelope+-}+envGen :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Envelope Ugen -> Ugen+envGen rate gate_ levelScale levelBias timeScale doneAction envelope_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "EnvGen" [gate_, levelScale, levelBias, timeScale, (from_done_action doneAction)] (Just [(envelope_to_ugen envelope_)]) 1 (Special 0) NoId++{- | Exponential single random number generator.++ ExpRand [InitialisationRate] lo=0.01 hi=1; NONDET+-}+expRandId :: ID a => a -> Ugen -> Ugen -> Ugen+expRandId z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "ExpRand" [lo, hi] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of ExpRand.+expRandM :: Uid m => Ugen -> Ugen -> m Ugen+expRandM = liftUid2 expRandId++-- | Unsafe variant of ExpRand.+expRand :: Ugen -> Ugen -> Ugen+expRand = liftUnsafe2 expRandM++{- | Feedback sine with chaotic phase indexing++ FBSineC [AudioRate] freq=22050 im=1 fb=0.1 a=1.1 c=0.5 xi=0.1 yi=0.1+-}+fbSineC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fbSineC rate freq im fb a c xi yi = mkUgen Nothing [AudioRate] (Left rate) "FBSineC" [freq, im, fb, a, c, xi, yi] Nothing 1 (Special 0) NoId++{- | Feedback sine with chaotic phase indexing++ FBSineL [AudioRate] freq=22050 im=1 fb=0.1 a=1.1 c=0.5 xi=0.1 yi=0.1+-}+fbSineL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fbSineL rate freq im fb a c xi yi = mkUgen Nothing [AudioRate] (Left rate) "FBSineL" [freq, im, fb, a, c, xi, yi] Nothing 1 (Special 0) NoId++{- | Feedback sine with chaotic phase indexing++ FBSineN [AudioRate] freq=22050 im=1 fb=0.1 a=1.1 c=0.5 xi=0.1 yi=0.1+-}+fbSineN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fbSineN rate freq im fb a c xi yi = mkUgen Nothing [AudioRate] (Left rate) "FBSineN" [freq, im, fb, a, c, xi, yi] Nothing 1 (Special 0) NoId++{- | Fast Fourier Transform++ FFT [ControlRate] buffer=0 in=0 hop=0.5 wintype=0 active=1 winsize=0+-}+fft :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fft buffer in_ hop wintype active winsize = mkUgen Nothing [ControlRate] (Left ControlRate) "FFT" [buffer, in_, hop, wintype, active, winsize] Nothing 1 (Special 0) NoId++{- | First order filter section.++ FOS [ControlRate,AudioRate] in=0 a0=0 a1=0 b1=0; FILTER: TRUE+-}+fos :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fos in_ a0 a1 b1 = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "FOS" [in_, a0, a1, b1] Nothing 1 (Special 0) NoId++{- | Fast sine oscillator.++ FSinOsc [ControlRate,AudioRate] freq=440 iphase=0+-}+fSinOsc :: Rate -> Ugen -> Ugen -> Ugen+fSinOsc rate freq iphase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "FSinOsc" [freq, iphase] Nothing 1 (Special 0) NoId++{- | Fold a signal outside given thresholds.++ Fold [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE+-}+fold :: Ugen -> Ugen -> Ugen -> Ugen+fold in_ lo hi = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0]) "Fold" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | Formant oscillator++ Formant [AudioRate] fundfreq=440 formfreq=1760 bwfreq=880+-}+formant :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+formant rate fundfreq formfreq bwfreq = mkUgen Nothing [AudioRate] (Left rate) "Formant" [fundfreq, formfreq, bwfreq] Nothing 1 (Special 0) NoId++{- | FOF-like filter.++ Formlet [ControlRate,AudioRate] in=0 freq=440 attacktime=1 decaytime=1; FILTER: TRUE+-}+formlet :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+formlet in_ freq attacktime decaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Formlet" [in_, freq, attacktime, decaytime] Nothing 1 (Special 0) NoId++{- | When triggered, frees a node.++ Free [ControlRate] trig=0 id=0; FILTER: TRUE+-}+free :: Ugen -> Ugen -> Ugen+free trig_ id_ = mkUgen Nothing [ControlRate] (Right [0]) "Free" [trig_, id_] Nothing 1 (Special 0) NoId++{- | When triggered, free enclosing synth.++ FreeSelf [ControlRate] in=0+-}+freeSelf :: Ugen -> Ugen+freeSelf in_ = mkUgen Nothing [ControlRate] (Left ControlRate) "FreeSelf" [in_] Nothing 1 (Special 0) NoId++{- | Free the enclosing synth when a Ugen is finished++ FreeSelfWhenDone [ControlRate] src=0+-}+freeSelfWhenDone :: Ugen -> Ugen+freeSelfWhenDone src = mkUgen Nothing [ControlRate] (Left ControlRate) "FreeSelfWhenDone" [src] Nothing 1 (Special 0) NoId++{- | A reverb++ FreeVerb [AudioRate] in=0 mix=0.33 room=0.5 damp=0.5; FILTER: TRUE+-}+freeVerb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+freeVerb in_ mix room damp = mkUgen Nothing [AudioRate] (Right [0]) "FreeVerb" [in_, mix, room, damp] Nothing 1 (Special 0) NoId++{- | A two-channel reverb++ FreeVerb2 [AudioRate] in=0 in2=0 mix=0.33 room=0.5 damp=0.5; FILTER: TRUE+-}+freeVerb2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+freeVerb2 in_ in2 mix room damp = mkUgen Nothing [AudioRate] (Right [0]) "FreeVerb2" [in_, in2, mix, room, damp] Nothing 2 (Special 0) NoId++{- | Frequency Shifter.++ FreqShift [AudioRate] in=0 freq=0 phase=0+-}+freqShift :: Ugen -> Ugen -> Ugen -> Ugen+freqShift in_ freq phase = mkUgen Nothing [AudioRate] (Left AudioRate) "FreqShift" [in_, freq, phase] Nothing 1 (Special 0) NoId++{- | A two-channel reverb++ GVerb [AudioRate] in=0 roomsize=10 revtime=3 damping=0.5 inputbw=0.5 spread=15 drylevel=1 earlyreflevel=0.7 taillevel=0.5 maxroomsize=300; FILTER: TRUE+-}+gVerb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gVerb in_ roomsize revtime damping inputbw spread drylevel earlyreflevel taillevel maxroomsize = mkUgen Nothing [AudioRate] (Right [0]) "GVerb" [in_, roomsize, revtime, damping, inputbw, spread, drylevel, earlyreflevel, taillevel, maxroomsize] Nothing 2 (Special 0) NoId++{- | Gate or hold.++ Gate [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE+-}+gate :: Ugen -> Ugen -> Ugen+gate in_ trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Gate" [in_, trig_] Nothing 1 (Special 0) NoId++{- | Gingerbreadman map chaotic generator++ GbmanL [AudioRate] freq=22050 xi=1.2 yi=2.1+-}+gbmanL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+gbmanL rate freq xi yi = mkUgen Nothing [AudioRate] (Left rate) "GbmanL" [freq, xi, yi] Nothing 1 (Special 0) NoId++{- | Gingerbreadman map chaotic generator++ GbmanN [AudioRate] freq=22050 xi=1.2 yi=2.1+-}+gbmanN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+gbmanN rate freq xi yi = mkUgen Nothing [AudioRate] (Left rate) "GbmanN" [freq, xi, yi] Nothing 1 (Special 0) NoId++{- | Dynamic stochastic synthesis generator.++ Gendy1 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 minfreq=440 maxfreq=660 ampscale=0.5 durscale=0.5 initCPs=12 knum=0; NONDET+-}+gendy1Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gendy1Id z rate ampdist durdist adparam ddparam minfreq maxfreq ampscale durscale initCPs knum = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Gendy1" [ampdist, durdist, adparam, ddparam, minfreq, maxfreq, ampscale, durscale, initCPs, knum] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Gendy1.+gendy1M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+gendy1M = liftUid11 gendy1Id++-- | Unsafe variant of Gendy1.+gendy1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gendy1 = liftUnsafe11 gendy1M++{- | Dynamic stochastic synthesis generator.++ Gendy2 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 minfreq=440 maxfreq=660 ampscale=0.5 durscale=0.5 initCPs=12 knum=0 a=1.17 c=0.31; NONDET+-}+gendy2Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gendy2Id z rate ampdist durdist adparam ddparam minfreq maxfreq ampscale durscale initCPs knum a c = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Gendy2" [ampdist, durdist, adparam, ddparam, minfreq, maxfreq, ampscale, durscale, initCPs, knum, a, c] Nothing 1 (Special 0) (toUid z)++{-+-- | Monad variant of Gendy2.+gendy2M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+gendy2M = liftUid13 gendy2Id++-- | Unsafe variant of Gendy2.+gendy2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gendy2 = liftUnsafe13 gendy2M+-}++{- | Dynamic stochastic synthesis generator.++ Gendy3 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 freq=440 ampscale=0.5 durscale=0.5 initCPs=12 knum=0; NONDET+-}+gendy3Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gendy3Id z rate ampdist durdist adparam ddparam freq ampscale durscale initCPs knum = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Gendy3" [ampdist, durdist, adparam, ddparam, freq, ampscale, durscale, initCPs, knum] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Gendy3.+gendy3M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+gendy3M = liftUid10 gendy3Id++-- | Unsafe variant of Gendy3.+gendy3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gendy3 = liftUnsafe10 gendy3M++{- | Granular synthesis with sound stored in a buffer++ GrainBuf [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 interp=2 pan=0 envbufnum=-1 maxGrains=512; NC INPUT: True+-}+grainBuf :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+grainBuf numChannels trigger dur sndbuf rate_ pos interp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left AudioRate) "GrainBuf" [trigger, dur, sndbuf, rate_, pos, interp, pan, envbufnum, maxGrains] Nothing numChannels (Special 0) NoId++{- | Granular synthesis with frequency modulated sine tones++ GrainFM [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 pan=0 envbufnum=-1 maxGrains=512; NC INPUT: True+-}+grainFM :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+grainFM numChannels trigger dur carfreq modfreq index_ pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left AudioRate) "GrainFM" [trigger, dur, carfreq, modfreq, index_, pan, envbufnum, maxGrains] Nothing numChannels (Special 0) NoId++{- | Granulate an input signal++ GrainIn [AudioRate] trigger=0 dur=1 in=0 pan=0 envbufnum=-1 maxGrains=512; NC INPUT: True+-}+grainIn :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+grainIn numChannels trigger dur in_ pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left AudioRate) "GrainIn" [trigger, dur, in_, pan, envbufnum, maxGrains] Nothing numChannels (Special 0) NoId++{- | Granular synthesis with sine tones++ GrainSin [AudioRate] trigger=0 dur=1 freq=440 pan=0 envbufnum=-1 maxGrains=512; NC INPUT: True+-}+grainSin :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+grainSin numChannels trigger dur freq pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left AudioRate) "GrainSin" [trigger, dur, freq, pan, envbufnum, maxGrains] Nothing numChannels (Special 0) NoId++{- | Gray Noise.++ GrayNoise [ControlRate,AudioRate] ; NONDET+-}+grayNoiseId :: ID a => a -> Rate -> Ugen+grayNoiseId z rate = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "GrayNoise" [] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of GrayNoise.+grayNoiseM :: Uid m => Rate -> m Ugen+grayNoiseM = liftUid1 grayNoiseId++-- | Unsafe variant of GrayNoise.+grayNoise :: Rate -> Ugen+grayNoise = liftUnsafe1 grayNoiseM++{- | 2nd order Butterworth highpass filter.++ HPF [ControlRate,AudioRate] in=0 freq=440; FILTER: TRUE+-}+hpf :: Ugen -> Ugen -> Ugen+hpf in_ freq = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "HPF" [in_, freq] Nothing 1 (Special 0) NoId++{- | Two point difference filter++ HPZ1 [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+hpz1 :: Ugen -> Ugen+hpz1 in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "HPZ1" [in_] Nothing 1 (Special 0) NoId++{- | Two zero fixed midcut.++ HPZ2 [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+hpz2 :: Ugen -> Ugen+hpz2 in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "HPZ2" [in_] Nothing 1 (Special 0) NoId++{- | Scrambled value with a hash function.++ Hasher [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+hasher :: Ugen -> Ugen+hasher in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Hasher" [in_] Nothing 1 (Special 0) NoId++{- | Henon map chaotic generator++ HenonC [AudioRate] freq=22050 a=1.4 b=0.3 x0=0 x1=0+-}+henonC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+henonC rate freq a b x0 x1 = mkUgen Nothing [AudioRate] (Left rate) "HenonC" [freq, a, b, x0, x1] Nothing 1 (Special 0) NoId++{- | Henon map chaotic generator++ HenonL [AudioRate] freq=22050 a=1.4 b=0.3 x0=0 x1=0+-}+henonL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+henonL rate freq a b x0 x1 = mkUgen Nothing [AudioRate] (Left rate) "HenonL" [freq, a, b, x0, x1] Nothing 1 (Special 0) NoId++{- | Henon map chaotic generator++ HenonN [AudioRate] freq=22050 a=1.4 b=0.3 x0=0 x1=0+-}+henonN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+henonN rate freq a b x0 x1 = mkUgen Nothing [AudioRate] (Left rate) "HenonN" [freq, a, b, x0, x1] Nothing 1 (Special 0) NoId++{- | Applies the Hilbert transform to an input signal.++ Hilbert [AudioRate] in=0; FILTER: TRUE+-}+hilbert :: Ugen -> Ugen+hilbert in_ = mkUgen Nothing [AudioRate] (Right [0]) "Hilbert" [in_] Nothing 2 (Special 0) NoId++{- | Envelope generator for polling values from an Env++ IEnvGen [ControlRate,AudioRate] index=0 *envelope=0; MCE=1, REORDERS INPUTS: [1,0], ENUMERATION INPUTS: 1=IEnvelope+-}+iEnvGen :: Rate -> Ugen -> Envelope Ugen -> Ugen+iEnvGen rate index_ envelope_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "IEnvGen" [index_] (Just [(envelope_to_ienvgen_ugen envelope_)]) 1 (Special 0) NoId++{- | Inverse Fast Fourier Transform++ IFFT [ControlRate,AudioRate] buffer=0 wintype=0 winsize=0+-}+ifft :: Ugen -> Ugen -> Ugen -> Ugen+ifft buffer wintype winsize = mkUgen Nothing [ControlRate, AudioRate] (Left AudioRate) "IFFT" [buffer, wintype, winsize] Nothing 1 (Special 0) NoId++{- | Single integer random number generator.++ iRand [InitialisationRate] lo=0 hi=127; NONDET+-}+iRandId :: ID a => a -> Ugen -> Ugen -> Ugen+iRandId z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "IRand" [lo, hi] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of irand.+iRandM :: Uid m => Ugen -> Ugen -> m Ugen+iRandM = liftUid2 iRandId++-- | Unsafe variant of irand.+iRand :: Ugen -> Ugen -> Ugen+iRand = liftUnsafe2 iRandM++{- | Impulse oscillator.++ Impulse [ControlRate,AudioRate] freq=440 phase=0+-}+impulse :: Rate -> Ugen -> Ugen -> Ugen+impulse rate freq phase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Impulse" [freq, phase] Nothing 1 (Special 0) NoId++{- | Read a signal from a bus.++ In [ControlRate,AudioRate] bus=0; NC INPUT: True+-}+in' :: Int -> Rate -> Ugen -> Ugen+in' numChannels rate bus = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "In" [bus] Nothing numChannels (Special 0) NoId++{- | Read signal from a bus with a current or one cycle old timestamp.++ InFeedback [AudioRate] bus=0; NC INPUT: True+-}+inFeedback :: Int -> Ugen -> Ugen+inFeedback numChannels bus = mkUgen Nothing [AudioRate] (Left AudioRate) "InFeedback" [bus] Nothing numChannels (Special 0) NoId++{- | Tests if a signal is within a given range.++ InRange [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE+-}+inRange :: Ugen -> Ugen -> Ugen -> Ugen+inRange in_ lo hi = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0]) "InRange" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | Test if a point is within a given rectangle.++ InRect [ControlRate,AudioRate] x=0 y=0 rect=0+-}+inRect :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+inRect rate x y rect = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "InRect" [x, y, rect] Nothing 1 (Special 0) NoId++{- | Generate a trigger anytime a bus is set.++ InTrig [ControlRate] bus=0; NC INPUT: True+-}+inTrig :: Int -> Ugen -> Ugen+inTrig numChannels bus = mkUgen Nothing [ControlRate] (Left ControlRate) "InTrig" [bus] Nothing numChannels (Special 0) NoId++{- | Index into a table with a signal++ Index [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE+-}+index :: Ugen -> Ugen -> Ugen+index bufnum in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "Index" [bufnum, in_] Nothing 1 (Special 0) NoId++{- | Finds the (lowest) point in the Buffer at which the input signal lies in-between the two values++ IndexInBetween [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE+-}+indexInBetween :: Ugen -> Ugen -> Ugen+indexInBetween bufnum in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "IndexInBetween" [bufnum, in_] Nothing 1 (Special 0) NoId++{- | Index into a table with a signal, linear interpolated++ IndexL [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE+-}+indexL :: Ugen -> Ugen -> Ugen+indexL bufnum in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "IndexL" [bufnum, in_] Nothing 1 (Special 0) NoId++{- | Base class for info ugens++ InfoUgenBase [InitialisationRate]+-}+infoUgenBase :: Rate -> Ugen+infoUgenBase rate = mkUgen Nothing [InitialisationRate] (Left rate) "InfoUgenBase" [] Nothing 1 (Special 0) NoId++{- | A leaky integrator.++ Integrator [ControlRate,AudioRate] in=0 coef=1; FILTER: TRUE+-}+integrator :: Ugen -> Ugen -> Ugen+integrator in_ coef = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Integrator" [in_, coef] Nothing 1 (Special 0) NoId++{- | Control to audio rate converter.++ K2A [AudioRate] in=0+-}+k2a :: Ugen -> Ugen+k2a in_ = mkUgen Nothing [AudioRate] (Left AudioRate) "K2A" [in_] Nothing 1 (Special 0) NoId++{- | Respond to the state of a key++ KeyState [ControlRate] keycode=0 minval=0 maxval=1 lag=0.2+-}+keyState :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+keyState rate keycode minval maxval lag_ = mkUgen Nothing [ControlRate] (Left rate) "KeyState" [keycode, minval, maxval, lag_] Nothing 1 (Special 0) NoId++{- | Key tracker++ KeyTrack [ControlRate] chain=0 keydecay=2 chromaleak=0.5+-}+keyTrack :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+keyTrack rate chain keydecay chromaleak = mkUgen Nothing [ControlRate] (Left rate) "KeyTrack" [chain, keydecay, chromaleak] Nothing 1 (Special 0) NoId++{- | Sine oscillator bank++ Klang [AudioRate] freqscale=1 freqoffset=0 *specificationsArrayRef=0; MCE=1, REORDERS INPUTS: [2,0,1]+-}+klang :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+klang rate freqscale freqoffset specificationsArrayRef = mkUgen Nothing [AudioRate] (Left rate) "Klang" [freqscale, freqoffset] (Just [specificationsArrayRef]) 1 (Special 0) NoId++{- | Bank of resonators++ Klank [AudioRate] input=0 freqscale=1 freqoffset=0 decayscale=1 *specificationsArrayRef=0; MCE=1, FILTER: TRUE, REORDERS INPUTS: [4,0,1,2,3]+-}+klank :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+klank input freqscale freqoffset decayscale specificationsArrayRef = mkUgen Nothing [AudioRate] (Right [0]) "Klank" [input, freqscale, freqoffset, decayscale] (Just [specificationsArrayRef]) 1 (Special 0) NoId++{- | Clipped noise++ LFClipNoise [ControlRate,AudioRate] freq=500; NONDET+-}+lfClipNoiseId :: ID a => a -> Rate -> Ugen -> Ugen+lfClipNoiseId z rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFClipNoise" [freq] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFClipNoise.+lfClipNoiseM :: Uid m => Rate -> Ugen -> m Ugen+lfClipNoiseM = liftUid2 lfClipNoiseId++-- | Unsafe variant of LFClipNoise.+lfClipNoise :: Rate -> Ugen -> Ugen+lfClipNoise = liftUnsafe2 lfClipNoiseM++{- | A sine like shape made of two cubic pieces++ LFCub [ControlRate,AudioRate] freq=440 iphase=0+-}+lfCub :: Rate -> Ugen -> Ugen -> Ugen+lfCub rate freq iphase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFCub" [freq, iphase] Nothing 1 (Special 0) NoId++{- | Dynamic clipped noise++ LFDClipNoise [ControlRate,AudioRate] freq=500; NONDET+-}+lfdClipNoiseId :: ID a => a -> Rate -> Ugen -> Ugen+lfdClipNoiseId z rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFDClipNoise" [freq] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFDClipNoise.+lfdClipNoiseM :: Uid m => Rate -> Ugen -> m Ugen+lfdClipNoiseM = liftUid2 lfdClipNoiseId++-- | Unsafe variant of LFDClipNoise.+lfdClipNoise :: Rate -> Ugen -> Ugen+lfdClipNoise = liftUnsafe2 lfdClipNoiseM++{- | Dynamic step noise++ LFDNoise0 [ControlRate,AudioRate] freq=500; NONDET+-}+lfdNoise0Id :: ID a => a -> Rate -> Ugen -> Ugen+lfdNoise0Id z rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFDNoise0" [freq] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFDNoise0.+lfdNoise0M :: Uid m => Rate -> Ugen -> m Ugen+lfdNoise0M = liftUid2 lfdNoise0Id++-- | Unsafe variant of LFDNoise0.+lfdNoise0 :: Rate -> Ugen -> Ugen+lfdNoise0 = liftUnsafe2 lfdNoise0M++{- | Dynamic ramp noise++ LFDNoise1 [ControlRate,AudioRate] freq=500; NONDET+-}+lfdNoise1Id :: ID a => a -> Rate -> Ugen -> Ugen+lfdNoise1Id z rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFDNoise1" [freq] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFDNoise1.+lfdNoise1M :: Uid m => Rate -> Ugen -> m Ugen+lfdNoise1M = liftUid2 lfdNoise1Id++-- | Unsafe variant of LFDNoise1.+lfdNoise1 :: Rate -> Ugen -> Ugen+lfdNoise1 = liftUnsafe2 lfdNoise1M++{- | Dynamic cubic noise++ LFDNoise3 [ControlRate,AudioRate] freq=500; NONDET+-}+lfdNoise3Id :: ID a => a -> Rate -> Ugen -> Ugen+lfdNoise3Id z rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFDNoise3" [freq] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFDNoise3.+lfdNoise3M :: Uid m => Rate -> Ugen -> m Ugen+lfdNoise3M = liftUid2 lfdNoise3Id++-- | Unsafe variant of LFDNoise3.+lfdNoise3 :: Rate -> Ugen -> Ugen+lfdNoise3 = liftUnsafe2 lfdNoise3M++{- | Gaussian function oscillator++ LFGauss [ControlRate,AudioRate] duration=1 width=0.1 iphase=0 loop=1 doneAction=0; ENUMERATION INPUTS: 3=Loop, 4=DoneAction+-}+lfGauss :: Rate -> Ugen -> Ugen -> Ugen -> Loop Ugen -> DoneAction Ugen -> Ugen+lfGauss rate duration width iphase loop doneAction = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFGauss" [duration, width, iphase, (from_loop loop), (from_done_action doneAction)] Nothing 1 (Special 0) NoId++{- | Step noise++ LFNoise0 [ControlRate,AudioRate] freq=500; NONDET+-}+lfNoise0Id :: ID a => a -> Rate -> Ugen -> Ugen+lfNoise0Id z rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFNoise0" [freq] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFNoise0.+lfNoise0M :: Uid m => Rate -> Ugen -> m Ugen+lfNoise0M = liftUid2 lfNoise0Id++-- | Unsafe variant of LFNoise0.+lfNoise0 :: Rate -> Ugen -> Ugen+lfNoise0 = liftUnsafe2 lfNoise0M++{- | Ramp noise++ LFNoise1 [ControlRate,AudioRate] freq=500; NONDET+-}+lfNoise1Id :: ID a => a -> Rate -> Ugen -> Ugen+lfNoise1Id z rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFNoise1" [freq] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFNoise1.+lfNoise1M :: Uid m => Rate -> Ugen -> m Ugen+lfNoise1M = liftUid2 lfNoise1Id++-- | Unsafe variant of LFNoise1.+lfNoise1 :: Rate -> Ugen -> Ugen+lfNoise1 = liftUnsafe2 lfNoise1M++{- | Quadratic noise.++ LFNoise2 [ControlRate,AudioRate] freq=500; NONDET+-}+lfNoise2Id :: ID a => a -> Rate -> Ugen -> Ugen+lfNoise2Id z rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFNoise2" [freq] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFNoise2.+lfNoise2M :: Uid m => Rate -> Ugen -> m Ugen+lfNoise2M = liftUid2 lfNoise2Id++-- | Unsafe variant of LFNoise2.+lfNoise2 :: Rate -> Ugen -> Ugen+lfNoise2 = liftUnsafe2 lfNoise2M++{- | Parabolic oscillator++ LFPar [ControlRate,AudioRate] freq=440 iphase=0+-}+lfPar :: Rate -> Ugen -> Ugen -> Ugen+lfPar rate freq iphase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFPar" [freq, iphase] Nothing 1 (Special 0) NoId++{- | pulse oscillator++ LFPulse [ControlRate,AudioRate] freq=440 iphase=0 width=0.5+-}+lfPulse :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+lfPulse rate freq iphase width = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFPulse" [freq, iphase, width] Nothing 1 (Special 0) NoId++{- | Sawtooth oscillator++ LFSaw [ControlRate,AudioRate] freq=440 iphase=0+-}+lfSaw :: Rate -> Ugen -> Ugen -> Ugen+lfSaw rate freq iphase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFSaw" [freq, iphase] Nothing 1 (Special 0) NoId++{- | Triangle oscillator++ LFTri [ControlRate,AudioRate] freq=440 iphase=0+-}+lfTri :: Rate -> Ugen -> Ugen -> Ugen+lfTri rate freq iphase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFTri" [freq, iphase] Nothing 1 (Special 0) NoId++{- | 2nd order Butterworth lowpass filter++ LPF [ControlRate,AudioRate] in=0 freq=440; FILTER: TRUE+-}+lpf :: Ugen -> Ugen -> Ugen+lpf in_ freq = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "LPF" [in_, freq] Nothing 1 (Special 0) NoId++{- | Two point average filter++ LPZ1 [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+lpz1 :: Ugen -> Ugen+lpz1 in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "LPZ1" [in_] Nothing 1 (Special 0) NoId++{- | Two zero fixed lowpass++ LPZ2 [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+lpz2 :: Ugen -> Ugen+lpz2 in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "LPZ2" [in_] Nothing 1 (Special 0) NoId++{- | Exponential lag++ Lag [ControlRate,AudioRate] in=0 lagTime=0.1; FILTER: TRUE+-}+lag :: Ugen -> Ugen -> Ugen+lag in_ lagTime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Lag" [in_, lagTime] Nothing 1 (Special 0) NoId++{- | Exponential lag++ Lag2 [ControlRate,AudioRate] in=0 lagTime=0.1; FILTER: TRUE+-}+lag2 :: Ugen -> Ugen -> Ugen+lag2 in_ lagTime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Lag2" [in_, lagTime] Nothing 1 (Special 0) NoId++{- | Exponential lag++ Lag2UD [ControlRate,AudioRate] in=0 lagTimeU=0.1 lagTimeD=0.1; FILTER: TRUE+-}+lag2UD :: Ugen -> Ugen -> Ugen -> Ugen+lag2UD in_ lagTimeU lagTimeD = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Lag2UD" [in_, lagTimeU, lagTimeD] Nothing 1 (Special 0) NoId++{- | Exponential lag++ Lag3 [ControlRate,AudioRate] in=0 lagTime=0.1; FILTER: TRUE+-}+lag3 :: Ugen -> Ugen -> Ugen+lag3 in_ lagTime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Lag3" [in_, lagTime] Nothing 1 (Special 0) NoId++{- | Exponential lag++ Lag3UD [ControlRate,AudioRate] in=0 lagTimeU=0.1 lagTimeD=0.1; FILTER: TRUE+-}+lag3UD :: Ugen -> Ugen -> Ugen -> Ugen+lag3UD in_ lagTimeU lagTimeD = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Lag3UD" [in_, lagTimeU, lagTimeD] Nothing 1 (Special 0) NoId++{- | Read a control signal from a bus with a lag++ LagIn [ControlRate] bus=0 lag=0.1; NC INPUT: True+-}+lagIn :: Int -> Ugen -> Ugen -> Ugen+lagIn numChannels bus lag_ = mkUgen Nothing [ControlRate] (Left ControlRate) "LagIn" [bus, lag_] Nothing numChannels (Special 0) NoId++{- | Exponential lag++ LagUD [ControlRate,AudioRate] in=0 lagTimeU=0.1 lagTimeD=0.1; FILTER: TRUE+-}+lagUD :: Ugen -> Ugen -> Ugen -> Ugen+lagUD in_ lagTimeU lagTimeD = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "LagUD" [in_, lagTimeU, lagTimeD] Nothing 1 (Special 0) NoId++{- | Output the last value before the input changed++ LastValue [ControlRate,AudioRate] in=0 diff=0.01; FILTER: TRUE+-}+lastValue :: Ugen -> Ugen -> Ugen+lastValue in_ diff = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "LastValue" [in_, diff] Nothing 1 (Special 0) NoId++{- | Sample and hold++ Latch [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE+-}+latch :: Ugen -> Ugen -> Ugen+latch in_ trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0, 1]) "Latch" [in_, trig_] Nothing 1 (Special 0) NoId++{- | Latoocarfian chaotic generator++ LatoocarfianC [AudioRate] freq=22050 a=1 b=3 c=0.5 d=0.5 xi=0.5 yi=0.5+-}+latoocarfianC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+latoocarfianC rate freq a b c d xi yi = mkUgen Nothing [AudioRate] (Left rate) "LatoocarfianC" [freq, a, b, c, d, xi, yi] Nothing 1 (Special 0) NoId++{- | Latoocarfian chaotic generator++ LatoocarfianL [AudioRate] freq=22050 a=1 b=3 c=0.5 d=0.5 xi=0.5 yi=0.5+-}+latoocarfianL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+latoocarfianL rate freq a b c d xi yi = mkUgen Nothing [AudioRate] (Left rate) "LatoocarfianL" [freq, a, b, c, d, xi, yi] Nothing 1 (Special 0) NoId++{- | Latoocarfian chaotic generator++ LatoocarfianN [AudioRate] freq=22050 a=1 b=3 c=0.5 d=0.5 xi=0.5 yi=0.5+-}+latoocarfianN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+latoocarfianN rate freq a b c d xi yi = mkUgen Nothing [AudioRate] (Left rate) "LatoocarfianN" [freq, a, b, c, d, xi, yi] Nothing 1 (Special 0) NoId++{- | Remove DC++ LeakDC [ControlRate,AudioRate] in=0 coef=0.995; FILTER: TRUE+-}+leakDC :: Ugen -> Ugen -> Ugen+leakDC in_ coef = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "LeakDC" [in_, coef] Nothing 1 (Special 0) NoId++{- | Output least changed++ LeastChange [ControlRate,AudioRate] a=0 b=0+-}+leastChange :: Rate -> Ugen -> Ugen -> Ugen+leastChange rate a b = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LeastChange" [a, b] Nothing 1 (Special 0) NoId++{- | Peak limiter++ Limiter [AudioRate] in=0 level=1 dur=0.01; FILTER: TRUE+-}+limiter :: Ugen -> Ugen -> Ugen -> Ugen+limiter in_ level dur = mkUgen Nothing [AudioRate] (Right [0]) "Limiter" [in_, level, dur] Nothing 1 (Special 0) NoId++{- | Linear congruential chaotic generator++ LinCongC [AudioRate] freq=22050 a=1.1 c=0.13 m=1 xi=0+-}+linCongC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+linCongC rate freq a c m xi = mkUgen Nothing [AudioRate] (Left rate) "LinCongC" [freq, a, c, m, xi] Nothing 1 (Special 0) NoId++{- | Linear congruential chaotic generator++ LinCongL [AudioRate] freq=22050 a=1.1 c=0.13 m=1 xi=0+-}+linCongL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+linCongL rate freq a c m xi = mkUgen Nothing [AudioRate] (Left rate) "LinCongL" [freq, a, c, m, xi] Nothing 1 (Special 0) NoId++{- | Linear congruential chaotic generator++ LinCongN [AudioRate] freq=22050 a=1.1 c=0.13 m=1 xi=0+-}+linCongN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+linCongN rate freq a c m xi = mkUgen Nothing [AudioRate] (Left rate) "LinCongN" [freq, a, c, m, xi] Nothing 1 (Special 0) NoId++{- | Map a linear range to an exponential range++ LinExp [InitialisationRate,ControlRate,AudioRate] in=0 srclo=0 srchi=1 dstlo=1 dsthi=2; FILTER: TRUE+-}+linExp :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+linExp in_ srclo srchi dstlo dsthi = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0]) "LinExp" [in_, srclo, srchi, dstlo, dsthi] Nothing 1 (Special 0) NoId++{- | Two channel linear pan.++ LinPan2 [ControlRate,AudioRate] in=0 pos=0 level=1; FILTER: TRUE+-}+linPan2 :: Ugen -> Ugen -> Ugen -> Ugen+linPan2 in_ pos level = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "LinPan2" [in_, pos, level] Nothing 2 (Special 0) NoId++{- | Skewed random number generator.++ LinRand [InitialisationRate] lo=0 hi=1 minmax=0; NONDET+-}+linRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+linRandId z lo hi minmax = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "LinRand" [lo, hi, minmax] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LinRand.+linRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+linRandM = liftUid3 linRandId++-- | Unsafe variant of LinRand.+linRand :: Ugen -> Ugen -> Ugen -> Ugen+linRand = liftUnsafe3 linRandM++{- | Two channel linear crossfade.++ LinXFade2 [ControlRate,AudioRate] inA=0 inB=0 pan=0 level=1; FILTER: TRUE, PSUEDO INPUTS: [3]+-}+linXFade2 :: Ugen -> Ugen -> Ugen -> Ugen+linXFade2 inA inB pan = mkUgen Nothing [ControlRate, AudioRate] (Right [0, 1]) "LinXFade2" [inA, inB, pan] Nothing 1 (Special 0) NoId++{- | Line generator.++ Line [ControlRate,AudioRate] start=0 end=1 dur=1 doneAction=0; ENUMERATION INPUTS: 3=DoneAction+-}+line :: Rate -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen+line rate start end dur doneAction = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Line" [start, end, dur, (from_done_action doneAction)] Nothing 1 (Special 0) NoId++{- | Simple linear envelope generator.++ Linen [ControlRate] gate=1 attackTime=0.01 susLevel=1 releaseTime=1 doneAction=0; ENUMERATION INPUTS: 4=DoneAction+-}+linen :: Ugen -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen+linen gate_ attackTime susLevel releaseTime doneAction = mkUgen Nothing [ControlRate] (Left ControlRate) "Linen" [gate_, attackTime, susLevel, releaseTime, (from_done_action doneAction)] Nothing 1 (Special 0) NoId++{- | Allocate a buffer local to the synth++ LocalBuf [InitialisationRate] numChannels=1 numFrames=1; REORDERS INPUTS: [1,0], NONDET+-}+localBufId :: ID a => a -> Ugen -> Ugen -> Ugen+localBufId z numChannels numFrames = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "LocalBuf" [numChannels, numFrames] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LocalBuf.+localBufM :: Uid m => Ugen -> Ugen -> m Ugen+localBufM = liftUid2 localBufId++-- | Unsafe variant of LocalBuf.+localBuf :: Ugen -> Ugen -> Ugen+localBuf = liftUnsafe2 localBufM++{- | Define and read from buses local to a synth.++ LocalIn [ControlRate,AudioRate] *default=0; MCE=1, NC INPUT: True+-}+localIn :: Int -> Rate -> Ugen -> Ugen+localIn numChannels rate default_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LocalIn" [] (Just [default_]) numChannels (Special 0) NoId++{- | Write to buses local to a synth.++ LocalOut [ControlRate,AudioRate] *channelsArray=0; MCE=1, FILTER: TRUE+-}+localOut :: Ugen -> Ugen+localOut input = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "LocalOut" [] (Just [input]) 0 (Special 0) NoId++{- | Chaotic noise function++ Logistic [ControlRate,AudioRate] chaosParam=3 freq=1000 init=0.5+-}+logistic :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+logistic rate chaosParam freq init_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Logistic" [chaosParam, freq, init_] Nothing 1 (Special 0) NoId++{- | Lorenz chaotic generator++ LorenzL [AudioRate] freq=22050 s=10 r=28 b=2.667 h=0.05 xi=0.1 yi=0 zi=0+-}+lorenzL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lorenzL rate freq s r b h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "LorenzL" [freq, s, r, b, h, xi, yi, zi] Nothing 1 (Special 0) NoId++{- | Extraction of instantaneous loudness in sones++ Loudness [ControlRate] chain=0 smask=0.25 tmask=1+-}+loudness :: Ugen -> Ugen -> Ugen -> Ugen+loudness chain smask tmask = mkUgen Nothing [ControlRate] (Left ControlRate) "Loudness" [chain, smask, tmask] Nothing 1 (Special 0) NoId++{- | Mel frequency cepstral coefficients++ MFCC [ControlRate] chain=0 numcoeff=13+-}+mfcc :: Rate -> Ugen -> Ugen -> Ugen+mfcc rate chain numcoeff = mkUgen Nothing [ControlRate] (Left rate) "MFCC" [chain, numcoeff] Nothing 13 (Special 0) NoId++{- | Reduce precision.++ MantissaMask [ControlRate,AudioRate] in=0 bits=3; FILTER: TRUE+-}+mantissaMask :: Ugen -> Ugen -> Ugen+mantissaMask in_ bits = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "MantissaMask" [in_, bits] Nothing 1 (Special 0) NoId++{- | Median filter.++ Median [ControlRate,AudioRate] length=3 in=0; FILTER: TRUE+-}+median :: Ugen -> Ugen -> Ugen+median length_ in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "Median" [length_, in_] Nothing 1 (Special 0) NoId++{- | Parametric filter.++ MidEQ [ControlRate,AudioRate] in=0 freq=440 rq=1 db=0; FILTER: TRUE+-}+midEQ :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+midEQ in_ freq rq db = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "MidEQ" [in_, freq, rq, db] Nothing 1 (Special 0) NoId++{- | Minimum difference of two values in modulo arithmetics++ ModDif [InitialisationRate,ControlRate,AudioRate] x=0 y=0 mod=1; FILTER: TRUE+-}+modDif :: Ugen -> Ugen -> Ugen -> Ugen+modDif x y mod_ = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0]) "ModDif" [x, y, mod_] Nothing 1 (Special 0) NoId++{- | Moog VCF implementation, designed by Federico Fontana++ MoogFF [ControlRate,AudioRate] in=0 freq=100 gain=2 reset=0; FILTER: TRUE+-}+moogFF :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+moogFF in_ freq gain reset = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "MoogFF" [in_, freq, gain, reset] Nothing 1 (Special 0) NoId++{- | Output most changed.++ MostChange [ControlRate,AudioRate] a=0 b=0; FILTER: TRUE+-}+mostChange :: Ugen -> Ugen -> Ugen+mostChange a b = mkUgen Nothing [ControlRate, AudioRate] (Right [0, 1]) "MostChange" [a, b] Nothing 1 (Special 0) NoId++{- | Mouse button Ugen.++ MouseButton [ControlRate] minval=0 maxval=1 lag=0.2+-}+mouseButton :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+mouseButton rate minval maxval lag_ = mkUgen Nothing [ControlRate] (Left rate) "MouseButton" [minval, maxval, lag_] Nothing 1 (Special 0) NoId++{- | Cursor tracking Ugen.++ MouseX [ControlRate] minval=0 maxval=1 warp=0 lag=0.2; ENUMERATION INPUTS: 2=Warp+-}+mouseX :: Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> Ugen+mouseX rate minval maxval warp lag_ = mkUgen Nothing [ControlRate] (Left rate) "MouseX" [minval, maxval, (from_warp warp), lag_] Nothing 1 (Special 0) NoId++{- | Cursor tracking Ugen.++ MouseY [ControlRate] minval=0 maxval=1 warp=0 lag=0.2; ENUMERATION INPUTS: 2=Warp+-}+mouseY :: Rate -> Ugen -> Ugen -> Warp Ugen -> Ugen -> Ugen+mouseY rate minval maxval warp lag_ = mkUgen Nothing [ControlRate] (Left rate) "MouseY" [minval, maxval, (from_warp warp), lag_] Nothing 1 (Special 0) NoId++{- | Sum of uniform distributions.++ NRand [InitialisationRate] lo=0 hi=1 n=0; NONDET+-}+nRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+nRandId z lo hi n = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NRand" [lo, hi, n] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of NRand.+nRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+nRandM = liftUid3 nRandId++-- | Unsafe variant of NRand.+nRand :: Ugen -> Ugen -> Ugen -> Ugen+nRand = liftUnsafe3 nRandM++{- | (Undocumented class)++ NodeID [InitialisationRate]+-}+nodeID :: Rate -> Ugen+nodeID rate = mkUgen Nothing [InitialisationRate] (Left rate) "NodeID" [] Nothing 1 (Special 0) NoId++{- | Flattens dynamics.++ Normalizer [AudioRate] in=0 level=1 dur=0.01; FILTER: TRUE+-}+normalizer :: Ugen -> Ugen -> Ugen -> Ugen+normalizer in_ level dur = mkUgen Nothing [AudioRate] (Right [0]) "Normalizer" [in_, level, dur] Nothing 1 (Special 0) NoId++{- | Number of audio busses.++ NumAudioBuses [InitialisationRate]+-}+numAudioBuses :: Ugen+numAudioBuses = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumAudioBuses" [] Nothing 1 (Special 0) NoId++{- | Number of open buffers.++ NumBuffers [InitialisationRate]+-}+numBuffers :: Ugen+numBuffers = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumBuffers" [] Nothing 1 (Special 0) NoId++{- | Number of control busses.++ NumControlBuses [InitialisationRate]+-}+numControlBuses :: Ugen+numControlBuses = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumControlBuses" [] Nothing 1 (Special 0) NoId++{- | Number of input busses.++ NumInputBuses [InitialisationRate]+-}+numInputBuses :: Ugen+numInputBuses = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumInputBuses" [] Nothing 1 (Special 0) NoId++{- | Number of output busses.++ NumOutputBuses [InitialisationRate]+-}+numOutputBuses :: Ugen+numOutputBuses = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "NumOutputBuses" [] Nothing 1 (Special 0) NoId++{- | Number of currently running synths.++ NumRunningSynths [InitialisationRate,ControlRate]+-}+numRunningSynths :: Ugen+numRunningSynths = mkUgen Nothing [InitialisationRate, ControlRate] (Left InitialisationRate) "NumRunningSynths" [] Nothing 1 (Special 0) NoId++{- | Write a signal to a bus with sample accurate timing.++ OffsetOut [ControlRate,AudioRate] bus=0 *channelsArray=0; MCE=1, FILTER: TRUE+-}+offsetOut :: Ugen -> Ugen -> Ugen+offsetOut bus input = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "OffsetOut" [bus] (Just [input]) 0 (Special 0) NoId++{- | One pole filter.++ OnePole [ControlRate,AudioRate] in=0 coef=0.5; FILTER: TRUE+-}+onePole :: Ugen -> Ugen -> Ugen+onePole in_ coef = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "OnePole" [in_, coef] Nothing 1 (Special 0) NoId++{- | One zero filter.++ OneZero [ControlRate,AudioRate] in=0 coef=0.5; FILTER: TRUE+-}+oneZero :: Ugen -> Ugen -> Ugen+oneZero in_ coef = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "OneZero" [in_, coef] Nothing 1 (Special 0) NoId++{- | Onset detector++ Onsets [ControlRate] chain=0 threshold=0.5 odftype=3 relaxtime=1 floor=0.1 mingap=10 medianspan=11 whtype=1 rawodf=0+-}+onsets :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+onsets chain threshold odftype relaxtime floor_ mingap medianspan whtype rawodf = mkUgen Nothing [ControlRate] (Left ControlRate) "Onsets" [chain, threshold, odftype, relaxtime, floor_, mingap, medianspan, whtype, rawodf] Nothing 1 (Special 0) NoId++{- | Interpolating wavetable oscillator.++ Osc [ControlRate,AudioRate] bufnum=0 freq=440 phase=0+-}+osc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+osc rate bufnum freq phase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Osc" [bufnum, freq, phase] Nothing 1 (Special 0) NoId++{- | Noninterpolating wavetable oscillator.++ OscN [ControlRate,AudioRate] bufnum=0 freq=440 phase=0+-}+oscN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+oscN rate bufnum freq phase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "OscN" [bufnum, freq, phase] Nothing 1 (Special 0) NoId++{- | Write a signal to a bus.++ Out [ControlRate,AudioRate] bus=0 *channelsArray=0; MCE=1, FILTER: TRUE+-}+out :: Ugen -> Ugen -> Ugen+out bus input = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "Out" [bus] (Just [input]) 0 (Special 0) NoId++{- | Very fast sine grain with a parabolic envelope++ PSinGrain [AudioRate] freq=440 dur=0.2 amp=0.1+-}+pSinGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+pSinGrain rate freq dur amp = mkUgen Nothing [AudioRate] (Left rate) "PSinGrain" [freq, dur, amp] Nothing 1 (Special 0) NoId++{- | Complex addition.++ PV_Add [ControlRate] bufferA=0 bufferB=0+-}+pv_Add :: Ugen -> Ugen -> Ugen+pv_Add bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Add" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | Scramble bins.++ PV_BinScramble [ControlRate] buffer=0 wipe=0 width=0.2 trig=0; NONDET+-}+pv_BinScrambleId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_BinScrambleId z buffer wipe width trig_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinScramble" [buffer, wipe, width, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of PV_BinScramble.+pv_BinScrambleM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+pv_BinScrambleM = liftUid4 pv_BinScrambleId++-- | Unsafe variant of PV_BinScramble.+pv_BinScramble :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_BinScramble = liftUnsafe4 pv_BinScrambleM++{- | Shift and stretch bin position.++ PV_BinShift [ControlRate] buffer=0 stretch=1 shift=0 interp=0+-}+pv_BinShift :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_BinShift buffer stretch shift interp = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinShift" [buffer, stretch, shift, interp] Nothing 1 (Special 0) NoId++{- | Combine low and high bins from two inputs.++ PV_BinWipe [ControlRate] bufferA=0 bufferB=0 wipe=0+-}+pv_BinWipe :: Ugen -> Ugen -> Ugen -> Ugen+pv_BinWipe bufferA bufferB wipe = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinWipe" [bufferA, bufferB, wipe] Nothing 1 (Special 0) NoId++{- | Zero bins.++ PV_BrickWall [ControlRate] buffer=0 wipe=0+-}+pv_BrickWall :: Ugen -> Ugen -> Ugen+pv_BrickWall buffer wipe = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BrickWall" [buffer, wipe] Nothing 1 (Special 0) NoId++{- | Complex plane attack.++ PV_ConformalMap [ControlRate] buffer=0 areal=0 aimag=0+-}+pv_ConformalMap :: Ugen -> Ugen -> Ugen -> Ugen+pv_ConformalMap buffer areal aimag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_ConformalMap" [buffer, areal, aimag] Nothing 1 (Special 0) NoId++{- | Complex conjugate++ PV_Conj [ControlRate] buffer=0+-}+pv_Conj :: Ugen -> Ugen+pv_Conj buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Conj" [buffer] Nothing 1 (Special 0) NoId++{- | Copy an FFT buffer++ PV_Copy [ControlRate] bufferA=0 bufferB=0+-}+pv_Copy :: Ugen -> Ugen -> Ugen+pv_Copy bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Copy" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | Copy magnitudes and phases.++ PV_CopyPhase [ControlRate] bufferA=0 bufferB=0+-}+pv_CopyPhase :: Ugen -> Ugen -> Ugen+pv_CopyPhase bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_CopyPhase" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | Random phase shifting.++ PV_Diffuser [ControlRate] buffer=0 trig=0+-}+pv_Diffuser :: Ugen -> Ugen -> Ugen+pv_Diffuser buffer trig_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Diffuser" [buffer, trig_] Nothing 1 (Special 0) NoId++{- | Complex division++ PV_Div [ControlRate] bufferA=0 bufferB=0+-}+pv_Div :: Ugen -> Ugen -> Ugen+pv_Div bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Div" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{-+-- | FFT onset detector.+--+-- PV_HainsworthFoote [ControlRate,AudioRate] maxSize=0+pv_HainsworthFoote :: Ugen -> Ugen+pv_HainsworthFoote maxSize = mkUgen Nothing [ControlRate,AudioRate] (Left ControlRate) "PV_HainsworthFoote" [maxSize] Nothing 1 (Special 0) NoId++-- | FFT feature detector for onset detection.+--+-- PV_JensenAndersen [ControlRate,AudioRate] maxSize=0+pv_JensenAndersen :: Ugen -> Ugen+pv_JensenAndersen maxSize = mkUgen Nothing [ControlRate,AudioRate] (Left ControlRate) "PV_JensenAndersen" [maxSize] Nothing 1 (Special 0) NoId+-}++{- | Pass bins which are a local maximum.++ PV_LocalMax [ControlRate] buffer=0 threshold=0+-}+pv_LocalMax :: Ugen -> Ugen -> Ugen+pv_LocalMax buffer threshold = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_LocalMax" [buffer, threshold] Nothing 1 (Special 0) NoId++{- | Pass bins above a threshold.++ PV_MagAbove [ControlRate] buffer=0 threshold=0+-}+pv_MagAbove :: Ugen -> Ugen -> Ugen+pv_MagAbove buffer threshold = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagAbove" [buffer, threshold] Nothing 1 (Special 0) NoId++{- | Pass bins below a threshold.++ PV_MagBelow [ControlRate] buffer=0 threshold=0+-}+pv_MagBelow :: Ugen -> Ugen -> Ugen+pv_MagBelow buffer threshold = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagBelow" [buffer, threshold] Nothing 1 (Special 0) NoId++{- | Clip bins to a threshold.++ PV_MagClip [ControlRate] buffer=0 threshold=0+-}+pv_MagClip :: Ugen -> Ugen -> Ugen+pv_MagClip buffer threshold = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagClip" [buffer, threshold] Nothing 1 (Special 0) NoId++{- | Division of magnitudes++ PV_MagDiv [ControlRate] bufferA=0 bufferB=0 zeroed=0.0001+-}+pv_MagDiv :: Ugen -> Ugen -> Ugen -> Ugen+pv_MagDiv bufferA bufferB zeroed = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagDiv" [bufferA, bufferB, zeroed] Nothing 1 (Special 0) NoId++{- | Freeze magnitudes.++ PV_MagFreeze [ControlRate] buffer=0 freeze=0+-}+pv_MagFreeze :: Ugen -> Ugen -> Ugen+pv_MagFreeze buffer freeze = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagFreeze" [buffer, freeze] Nothing 1 (Special 0) NoId++{- | Multiply magnitudes.++ PV_MagMul [ControlRate] bufferA=0 bufferB=0+-}+pv_MagMul :: Ugen -> Ugen -> Ugen+pv_MagMul bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagMul" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | Multiply magnitudes by noise.++ PV_MagNoise [ControlRate] buffer=0+-}+pv_MagNoise :: Ugen -> Ugen+pv_MagNoise buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagNoise" [buffer] Nothing 1 (Special 0) NoId++{- | shift and stretch magnitude bin position.++ PV_MagShift [ControlRate] buffer=0 stretch=1 shift=0+-}+pv_MagShift :: Ugen -> Ugen -> Ugen -> Ugen+pv_MagShift buffer stretch shift = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagShift" [buffer, stretch, shift] Nothing 1 (Special 0) NoId++{- | Average magnitudes across bins.++ PV_MagSmear [ControlRate] buffer=0 bins=0+-}+pv_MagSmear :: Ugen -> Ugen -> Ugen+pv_MagSmear buffer bins = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagSmear" [buffer, bins] Nothing 1 (Special 0) NoId++{- | Square magnitudes.++ PV_MagSquared [ControlRate] buffer=0+-}+pv_MagSquared :: Ugen -> Ugen+pv_MagSquared buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagSquared" [buffer] Nothing 1 (Special 0) NoId++{- | Maximum magnitude.++ PV_Max [ControlRate] bufferA=0 bufferB=0+-}+pv_Max :: Ugen -> Ugen -> Ugen+pv_Max bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Max" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | Minimum magnitude.++ PV_Min [ControlRate] bufferA=0 bufferB=0+-}+pv_Min :: Ugen -> Ugen -> Ugen+pv_Min bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Min" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | Complex multiply.++ PV_Mul [ControlRate] bufferA=0 bufferB=0+-}+pv_Mul :: Ugen -> Ugen -> Ugen+pv_Mul bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Mul" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | Shift phase.++ PV_PhaseShift [ControlRate] buffer=0 shift=0 integrate=0+-}+pv_PhaseShift :: Ugen -> Ugen -> Ugen -> Ugen+pv_PhaseShift buffer shift integrate = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PhaseShift" [buffer, shift, integrate] Nothing 1 (Special 0) NoId++{- | Shift phase by 270 degrees.++ PV_PhaseShift270 [ControlRate] buffer=0+-}+pv_PhaseShift270 :: Ugen -> Ugen+pv_PhaseShift270 buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PhaseShift270" [buffer] Nothing 1 (Special 0) NoId++{- | Shift phase by 90 degrees.++ PV_PhaseShift90 [ControlRate] buffer=0+-}+pv_PhaseShift90 :: Ugen -> Ugen+pv_PhaseShift90 buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PhaseShift90" [buffer] Nothing 1 (Special 0) NoId++{- | Pass random bins.++ PV_RandComb [ControlRate] buffer=0 wipe=0 trig=0; NONDET+-}+pv_RandCombId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+pv_RandCombId z buffer wipe trig_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RandComb" [buffer, wipe, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of PV_RandComb.+pv_RandCombM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+pv_RandCombM = liftUid3 pv_RandCombId++-- | Unsafe variant of PV_RandComb.+pv_RandComb :: Ugen -> Ugen -> Ugen -> Ugen+pv_RandComb = liftUnsafe3 pv_RandCombM++{- | Crossfade in random bin order.++ PV_RandWipe [ControlRate] bufferA=0 bufferB=0 wipe=0 trig=0; NONDET+-}+pv_RandWipeId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_RandWipeId z bufferA bufferB wipe trig_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RandWipe" [bufferA, bufferB, wipe, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of PV_RandWipe.+pv_RandWipeM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+pv_RandWipeM = liftUid4 pv_RandWipeId++-- | Unsafe variant of PV_RandWipe.+pv_RandWipe :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_RandWipe = liftUnsafe4 pv_RandWipeM++{- | Make gaps in spectrum.++ PV_RectComb [ControlRate] buffer=0 numTeeth=0 phase=0 width=0.5+-}+pv_RectComb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_RectComb buffer numTeeth phase width = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RectComb" [buffer, numTeeth, phase, width] Nothing 1 (Special 0) NoId++{- | Make gaps in spectrum.++ PV_RectComb2 [ControlRate] bufferA=0 bufferB=0 numTeeth=0 phase=0 width=0.5+-}+pv_RectComb2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_RectComb2 bufferA bufferB numTeeth phase width = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RectComb2" [bufferA, bufferB, numTeeth, phase, width] Nothing 1 (Special 0) NoId++{- | Two channel equal power pan.++ Pan2 [ControlRate,AudioRate] in=0 pos=0 level=1; FILTER: TRUE+-}+pan2 :: Ugen -> Ugen -> Ugen -> Ugen+pan2 in_ pos level = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Pan2" [in_, pos, level] Nothing 2 (Special 0) NoId++{- | Four channel equal power pan.++ Pan4 [ControlRate,AudioRate] in=0 xpos=0 ypos=0 level=1+-}+pan4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pan4 rate in_ xpos ypos level = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Pan4" [in_, xpos, ypos, level] Nothing 4 (Special 0) NoId++{- | Azimuth panner++ PanAz [ControlRate,AudioRate] in=0 pos=0 level=1 width=2 orientation=0.5; NC INPUT: True, FILTER: TRUE+-}+panAz :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+panAz numChannels in_ pos level width orientation = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "PanAz" [in_, pos, level, width, orientation] Nothing numChannels (Special 0) NoId++{- | Ambisonic B-format panner.++ PanB [ControlRate,AudioRate] in=0 azimuth=0 elevation=0 gain=1+-}+panB :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+panB rate in_ azimuth elevation gain = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "PanB" [in_, azimuth, elevation, gain] Nothing 4 (Special 0) NoId++{- | 2D Ambisonic B-format panner.++ PanB2 [ControlRate,AudioRate] in=0 azimuth=0 gain=1; FILTER: TRUE+-}+panB2 :: Ugen -> Ugen -> Ugen -> Ugen+panB2 in_ azimuth gain = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "PanB2" [in_, azimuth, gain] Nothing 3 (Special 0) NoId++{- | Real-time partitioned convolution++ PartConv [AudioRate] in=0 fftsize=0 irbufnum=0+-}+partConv :: Ugen -> Ugen -> Ugen -> Ugen+partConv in_ fftsize irbufnum = mkUgen Nothing [AudioRate] (Left AudioRate) "PartConv" [in_, fftsize, irbufnum] Nothing 1 (Special 0) NoId++{- | When triggered, pauses a node.++ Pause [ControlRate] gate=0 id=0+-}+pause :: Ugen -> Ugen -> Ugen+pause gate_ id_ = mkUgen Nothing [ControlRate] (Left ControlRate) "Pause" [gate_, id_] Nothing 1 (Special 0) NoId++{- | When triggered, pause enclosing synth.++ PauseSelf [ControlRate] in=0+-}+pauseSelf :: Ugen -> Ugen+pauseSelf in_ = mkUgen Nothing [ControlRate] (Left ControlRate) "PauseSelf" [in_] Nothing 1 (Special 0) NoId++{- | FIXME: PauseSelfWhenDone purpose.++ PauseSelfWhenDone [ControlRate] src=0+-}+pauseSelfWhenDone :: Ugen -> Ugen+pauseSelfWhenDone src = mkUgen Nothing [ControlRate] (Left ControlRate) "PauseSelfWhenDone" [src] Nothing 1 (Special 0) NoId++{- | Track peak signal amplitude.++ Peak [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE+-}+peak :: Ugen -> Ugen -> Ugen+peak in_ trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Peak" [in_, trig_] Nothing 1 (Special 0) NoId++{- | Track peak signal amplitude.++ PeakFollower [ControlRate,AudioRate] in=0 decay=0.999; FILTER: TRUE+-}+peakFollower :: Ugen -> Ugen -> Ugen+peakFollower in_ decay_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "PeakFollower" [in_, decay_] Nothing 1 (Special 0) NoId++{- | A resettable linear ramp between two levels.++ Phasor [ControlRate,AudioRate] trig=0 rate=1 start=0 end=1 resetPos=0+-}+phasor :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+phasor rate trig_ rate_ start end resetPos = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Phasor" [trig_, rate_, start, end, resetPos] Nothing 1 (Special 0) NoId++{- | Pink Noise.++ PinkNoise [ControlRate,AudioRate] ; NONDET+-}+pinkNoiseId :: ID a => a -> Rate -> Ugen+pinkNoiseId z rate = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "PinkNoise" [] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of PinkNoise.+pinkNoiseM :: Uid m => Rate -> m Ugen+pinkNoiseM = liftUid1 pinkNoiseId++-- | Unsafe variant of PinkNoise.+pinkNoise :: Rate -> Ugen+pinkNoise = liftUnsafe1 pinkNoiseM++{- | Autocorrelation pitch follower++ Pitch [ControlRate] in=0 initFreq=440 minFreq=60 maxFreq=4000 execFreq=100 maxBinsPerOctave=16 median=1 ampThreshold=0.01 peakThreshold=0.5 downSample=1 clar=0+-}+pitch :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pitch in_ initFreq minFreq maxFreq execFreq maxBinsPerOctave median_ ampThreshold peakThreshold downSample clar = mkUgen Nothing [ControlRate] (Left ControlRate) "Pitch" [in_, initFreq, minFreq, maxFreq, execFreq, maxBinsPerOctave, median_, ampThreshold, peakThreshold, downSample, clar] Nothing 2 (Special 0) NoId++{- | Time domain pitch shifter.++ PitchShift [AudioRate] in=0 windowSize=0.2 pitchRatio=1 pitchDispersion=0 timeDispersion=0; FILTER: TRUE+-}+pitchShift :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pitchShift in_ windowSize pitchRatio pitchDispersion timeDispersion = mkUgen Nothing [AudioRate] (Right [0]) "PitchShift" [in_, windowSize, pitchRatio, pitchDispersion, timeDispersion] Nothing 1 (Special 0) NoId++{- | Sample playback oscillator.++ PlayBuf [ControlRate,AudioRate] bufnum=0 rate=1 trigger=1 startPos=0 loop=0 doneAction=0; NC INPUT: True, ENUMERATION INPUTS: 4=Loop, 5=DoneAction+-}+playBuf :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Loop Ugen -> DoneAction Ugen -> Ugen+playBuf numChannels rate bufnum rate_ trigger startPos loop doneAction = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "PlayBuf" [bufnum, rate_, trigger, startPos, (from_loop loop), (from_done_action doneAction)] Nothing numChannels (Special 0) NoId++{- | A Karplus-Strong Ugen++ Pluck [AudioRate] in=0 trig=1 maxdelaytime=0.2 delaytime=0.2 decaytime=1 coef=0.5; FILTER: TRUE+-}+pluck :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pluck in_ trig_ maxdelaytime delaytime decaytime coef = mkUgen Nothing [AudioRate] (Right [0]) "Pluck" [in_, trig_, maxdelaytime, delaytime, decaytime, coef] Nothing 1 (Special 0) NoId++{-+-- | Print the current output value of a Ugen+--+-- Poll [ControlRate,AudioRate] trig=0 in=0 trigid=-1 label=0; FILTER: TRUE, REORDERS INPUTS: [0,1,3,2]+poll :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+poll trig_ in_ trigid label_ = mkUgen Nothing [ControlRate,AudioRate] (Right [1]) "Poll" [trig_,in_,trigid,label_] Nothing 1 (Special 0) NoId+-}++{- | Band limited pulse wave.++ Pulse [ControlRate,AudioRate] freq=440 width=0.5+-}+pulse :: Rate -> Ugen -> Ugen -> Ugen+pulse rate freq width = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Pulse" [freq, width] Nothing 1 (Special 0) NoId++{- | Pulse counter.++ PulseCount [ControlRate,AudioRate] trig=0 reset=0; FILTER: TRUE+-}+pulseCount :: Ugen -> Ugen -> Ugen+pulseCount trig_ reset = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "PulseCount" [trig_, reset] Nothing 1 (Special 0) NoId++{- | Pulse divider.++ PulseDivider [ControlRate,AudioRate] trig=0 div=2 start=0; FILTER: TRUE+-}+pulseDivider :: Ugen -> Ugen -> Ugen -> Ugen+pulseDivider trig_ div_ start = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "PulseDivider" [trig_, div_, start] Nothing 1 (Special 0) NoId++{- | General quadratic map chaotic generator++ QuadC [AudioRate] freq=22050 a=1 b=-1 c=-0.75 xi=0+-}+quadC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+quadC rate freq a b c xi = mkUgen Nothing [AudioRate] (Left rate) "QuadC" [freq, a, b, c, xi] Nothing 1 (Special 0) NoId++{- | General quadratic map chaotic generator++ QuadL [AudioRate] freq=22050 a=1 b=-1 c=-0.75 xi=0+-}+quadL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+quadL rate freq a b c xi = mkUgen Nothing [AudioRate] (Left rate) "QuadL" [freq, a, b, c, xi] Nothing 1 (Special 0) NoId++{- | General quadratic map chaotic generator++ QuadN [AudioRate] freq=22050 a=1 b=-1 c=-0.75 xi=0+-}+quadN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+quadN rate freq a b c xi = mkUgen Nothing [AudioRate] (Left rate) "QuadN" [freq, a, b, c, xi] Nothing 1 (Special 0) NoId++{- | A resonant high pass filter.++ RHPF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE+-}+rhpf :: Ugen -> Ugen -> Ugen -> Ugen+rhpf in_ freq rq = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "RHPF" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | A resonant low pass filter.++ RLPF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE+-}+rlpf :: Ugen -> Ugen -> Ugen -> Ugen+rlpf in_ freq rq = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "RLPF" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | Number of radians per sample.++ RadiansPerSample [InitialisationRate]+-}+radiansPerSample :: Ugen+radiansPerSample = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "RadiansPerSample" [] Nothing 1 (Special 0) NoId++{- | Break a continuous signal into line segments++ Ramp [ControlRate,AudioRate] in=0 lagTime=0.1; FILTER: TRUE+-}+ramp :: Ugen -> Ugen -> Ugen+ramp in_ lagTime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Ramp" [in_, lagTime] Nothing 1 (Special 0) NoId++{- | Single random number generator.++ Rand [InitialisationRate] lo=0 hi=1; NONDET+-}+randId :: ID a => a -> Ugen -> Ugen -> Ugen+randId z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "Rand" [lo, hi] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Rand.+randM :: Uid m => Ugen -> Ugen -> m Ugen+randM = liftUid2 randId++-- | Unsafe variant of Rand.+rand :: Ugen -> Ugen -> Ugen+rand = liftUnsafe2 randM++{- | Set the synth's random generator ID.++ RandID [InitialisationRate,ControlRate] id=0+-}+randID :: Rate -> Ugen -> Ugen+randID rate id_ = mkUgen Nothing [InitialisationRate, ControlRate] (Left rate) "RandID" [id_] Nothing 0 (Special 0) NoId++{- | Sets the synth's random generator seed.++ RandSeed [InitialisationRate,ControlRate,AudioRate] trig=0 seed=56789+-}+randSeed :: Rate -> Ugen -> Ugen -> Ugen+randSeed rate trig_ seed = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Left rate) "RandSeed" [trig_, seed] Nothing 0 (Special 0) NoId++{- | Record or overdub into a Buffer.++ RecordBuf [ControlRate,AudioRate] bufnum=0 offset=0 recLevel=1 preLevel=0 run=1 loop=1 trigger=1 doneAction=0 *inputArray=0; MCE=1, REORDERS INPUTS: [8,0,1,2,3,4,5,6,7], ENUMERATION INPUTS: 5=Loop, 7=DoneAction+-}+recordBuf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Loop Ugen -> Ugen -> DoneAction Ugen -> Ugen -> Ugen+recordBuf rate bufnum offset recLevel preLevel run loop trigger doneAction inputArray = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RecordBuf" [bufnum, offset, recLevel, preLevel, run, (from_loop loop), trigger, (from_done_action doneAction)] (Just [inputArray]) 1 (Special 0) NoId++{- | Send signal to a bus, overwriting previous contents.++ ReplaceOut [ControlRate,AudioRate] bus=0 *channelsArray=0; MCE=1, FILTER: TRUE+-}+replaceOut :: Ugen -> Ugen -> Ugen+replaceOut bus input = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "ReplaceOut" [bus] (Just [input]) 0 (Special 0) NoId++{- | Resonant filter.++ Resonz [ControlRate,AudioRate] in=0 freq=440 bwr=1; FILTER: TRUE+-}+resonz :: Ugen -> Ugen -> Ugen -> Ugen+resonz in_ freq bwr = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Resonz" [in_, freq, bwr] Nothing 1 (Special 0) NoId++{- | Ringing filter.++ Ringz [ControlRate,AudioRate] in=0 freq=440 decaytime=1; FILTER: TRUE+-}+ringz :: Ugen -> Ugen -> Ugen -> Ugen+ringz in_ freq decaytime = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Ringz" [in_, freq, decaytime] Nothing 1 (Special 0) NoId++{- | Rotate a sound field.++ Rotate2 [ControlRate,AudioRate] x=0 y=0 pos=0; FILTER: TRUE+-}+rotate2 :: Ugen -> Ugen -> Ugen -> Ugen+rotate2 x y pos = mkUgen Nothing [ControlRate, AudioRate] (Right [0, 1]) "Rotate2" [x, y, pos] Nothing 2 (Special 0) NoId++{- | Track maximum level.++ RunningMax [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE+-}+runningMax :: Ugen -> Ugen -> Ugen+runningMax in_ trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "RunningMax" [in_, trig_] Nothing 1 (Special 0) NoId++{- | Track minimum level.++ RunningMin [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE+-}+runningMin :: Ugen -> Ugen -> Ugen+runningMin in_ trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "RunningMin" [in_, trig_] Nothing 1 (Special 0) NoId++{- | Running sum over n frames++ RunningSum [ControlRate,AudioRate] in=0 numsamp=40; FILTER: TRUE+-}+runningSum :: Ugen -> Ugen -> Ugen+runningSum in_ numsamp = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "RunningSum" [in_, numsamp] Nothing 1 (Special 0) NoId++{- | Second order filter section (biquad).++ SOS [ControlRate,AudioRate] in=0 a0=0 a1=0 a2=0 b1=0 b2=0; FILTER: TRUE+-}+sos :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sos in_ a0 a1 a2 b1 b2 = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "SOS" [in_, a0, a1, a2, b1, b2] Nothing 1 (Special 0) NoId++{- | Duration of one sample.++ SampleDur [InitialisationRate]+-}+sampleDur :: Ugen+sampleDur = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "SampleDur" [] Nothing 1 (Special 0) NoId++{- | Server sample rate.++ SampleRate [InitialisationRate]+-}+sampleRate :: Ugen+sampleRate = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "SampleRate" [] Nothing 1 (Special 0) NoId++{- | Remove infinity, NaN, and denormals++ Sanitize [ControlRate,AudioRate] in=0 replace=0; FILTER: TRUE+-}+sanitize :: Ugen -> Ugen -> Ugen+sanitize in_ replace = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Sanitize" [in_, replace] Nothing 1 (Special 0) NoId++{- | Band limited sawtooth.++ Saw [ControlRate,AudioRate] freq=440+-}+saw :: Rate -> Ugen -> Ugen+saw rate freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Saw" [freq] Nothing 1 (Special 0) NoId++{- | Schmidt trigger.++ Schmidt [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE+-}+schmidt :: Ugen -> Ugen -> Ugen -> Ugen+schmidt in_ lo hi = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0]) "Schmidt" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | Select output from an array of inputs.++ Select [InitialisationRate,ControlRate,AudioRate] which=0 *array=0; MCE=1, FILTER: TRUE+-}+select :: Ugen -> Ugen -> Ugen+select which array = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0, 1]) "Select" [which] (Just [array]) 1 (Special 0) NoId++{- | Send a trigger message from the server back to the client.++ SendTrig [ControlRate,AudioRate] in=0 id=0 value=0; FILTER: TRUE+-}+sendTrig :: Ugen -> Ugen -> Ugen -> Ugen+sendTrig in_ id_ value = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "SendTrig" [in_, id_, value] Nothing 0 (Special 0) NoId++{- | Set-reset flip flop.++ SetResetFF [ControlRate,AudioRate] trig=0 reset=0; FILTER: TRUE+-}+setResetFF :: Ugen -> Ugen -> Ugen+setResetFF trig_ reset = mkUgen Nothing [ControlRate, AudioRate] (Right [0, 1]) "SetResetFF" [trig_, reset] Nothing 1 (Special 0) NoId++{- | Wave shaper.++ Shaper [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE+-}+shaper :: Ugen -> Ugen -> Ugen+shaper bufnum in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "Shaper" [bufnum, in_] Nothing 1 (Special 0) NoId++{- | Interpolating sine wavetable oscillator.++ SinOsc [ControlRate,AudioRate] freq=440 phase=0+-}+sinOsc :: Rate -> Ugen -> Ugen -> Ugen+sinOsc rate freq phase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "SinOsc" [freq, phase] Nothing 1 (Special 0) NoId++{- | Feedback FM oscillator++ SinOscFB [ControlRate,AudioRate] freq=440 feedback=0+-}+sinOscFB :: Rate -> Ugen -> Ugen -> Ugen+sinOscFB rate freq feedback = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "SinOscFB" [freq, feedback] Nothing 1 (Special 0) NoId++{- | Slew rate limiter.++ Slew [ControlRate,AudioRate] in=0 up=1 dn=1; FILTER: TRUE+-}+slew :: Ugen -> Ugen -> Ugen -> Ugen+slew in_ up dn = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Slew" [in_, up, dn] Nothing 1 (Special 0) NoId++{- | Slope of signal++ Slope [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+slope :: Ugen -> Ugen+slope in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Slope" [in_] Nothing 1 (Special 0) NoId++{- | Spectral centroid++ SpecCentroid [ControlRate] buffer=0+-}+specCentroid :: Rate -> Ugen -> Ugen+specCentroid rate buffer = mkUgen Nothing [ControlRate] (Left rate) "SpecCentroid" [buffer] Nothing 1 (Special 0) NoId++{- | Spectral Flatness measure++ SpecFlatness [ControlRate] buffer=0+-}+specFlatness :: Rate -> Ugen -> Ugen+specFlatness rate buffer = mkUgen Nothing [ControlRate] (Left rate) "SpecFlatness" [buffer] Nothing 1 (Special 0) NoId++{- | Find a percentile of FFT magnitude spectrum++ SpecPcile [ControlRate] buffer=0 fraction=0.5 interpolate=0+-}+specPcile :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+specPcile rate buffer fraction interpolate = mkUgen Nothing [ControlRate] (Left rate) "SpecPcile" [buffer, fraction, interpolate] Nothing 1 (Special 0) NoId++{- | physical model of resonating spring++ Spring [ControlRate,AudioRate] in=0 spring=1 damp=0+-}+spring :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+spring rate in_ spring_ damp = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Spring" [in_, spring_, damp] Nothing 1 (Special 0) NoId++{- | Standard map chaotic generator++ StandardL [AudioRate] freq=22050 k=1 xi=0.5 yi=0+-}+standardL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+standardL rate freq k xi yi = mkUgen Nothing [AudioRate] (Left rate) "StandardL" [freq, k, xi, yi] Nothing 1 (Special 0) NoId++{- | Standard map chaotic generator++ StandardN [AudioRate] freq=22050 k=1 xi=0.5 yi=0+-}+standardN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+standardN rate freq k xi yi = mkUgen Nothing [AudioRate] (Left rate) "StandardN" [freq, k, xi, yi] Nothing 1 (Special 0) NoId++{- | Pulse counter.++ Stepper [ControlRate,AudioRate] trig=0 reset=0 min=0 max=7 step=1 resetval=0; FILTER: TRUE+-}+stepper :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stepper trig_ reset min_ max_ step resetval = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Stepper" [trig_, reset, min_, max_, step, resetval] Nothing 1 (Special 0) NoId++{- | Stereo real-time convolver with linear interpolation++ StereoConvolution2L [AudioRate] in=0 kernelL=0 kernelR=0 trigger=0 framesize=2048 crossfade=1+-}+stereoConvolution2L :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stereoConvolution2L rate in_ kernelL kernelR trigger framesize crossfade = mkUgen Nothing [AudioRate] (Left rate) "StereoConvolution2L" [in_, kernelL, kernelR, trigger, framesize, crossfade] Nothing 2 (Special 0) NoId++{- | Offset from synth start within one sample.++ SubsampleOffset [InitialisationRate]+-}+subsampleOffset :: Ugen+subsampleOffset = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "SubsampleOffset" [] Nothing 1 (Special 0) NoId++{- | Sum three signals++ Sum3 [] in0=0 in1=0 in2=0; FILTER: TRUE+-}+sum3 :: Ugen -> Ugen -> Ugen -> Ugen+sum3 in0 in1 in2 = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Right [0, 1, 2]) "Sum3" [in0, in1, in2] Nothing 1 (Special 0) NoId++{- | Sum four signals++ Sum4 [] in0=0 in1=0 in2=0 in3=0; FILTER: TRUE+-}+sum4 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sum4 in0 in1 in2 in3 = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Right [0, 1, 2, 3]) "Sum4" [in0, in1, in2, in3] Nothing 1 (Special 0) NoId++{- | Triggered linear ramp++ Sweep [ControlRate,AudioRate] trig=0 rate=1; FILTER: TRUE+-}+sweep :: Rate -> Ugen -> Ugen -> Ugen+sweep rate trig_ rate_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Sweep" [trig_, rate_] Nothing 1 (Special 0) NoId++{- | Hard sync sawtooth wave.++ SyncSaw [ControlRate,AudioRate] syncFreq=440 sawFreq=440+-}+syncSaw :: Rate -> Ugen -> Ugen -> Ugen+syncSaw rate syncFreq sawFreq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "SyncSaw" [syncFreq, sawFreq] Nothing 1 (Special 0) NoId++{- | Control rate trigger to audio rate trigger converter++ T2A [AudioRate] in=0 offset=0+-}+t2a :: Ugen -> Ugen -> Ugen+t2a in_ offset = mkUgen Nothing [AudioRate] (Left AudioRate) "T2A" [in_, offset] Nothing 1 (Special 0) NoId++{- | Audio rate trigger to control rate trigger converter++ T2K [ControlRate] in=0+-}+t2k :: Ugen -> Ugen+t2k in_ = mkUgen Nothing [ControlRate] (Left ControlRate) "T2K" [in_] Nothing 1 (Special 0) NoId++{- | physical model of bouncing object++ TBall [ControlRate,AudioRate] in=0 g=10 damp=0 friction=0.01+-}+tBall :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tBall rate in_ g damp friction_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "TBall" [in_, g, damp, friction_] Nothing 1 (Special 0) NoId++{- | Trigger delay.++ TDelay [ControlRate,AudioRate] in=0 dur=0.1; FILTER: TRUE+-}+tDelay :: Ugen -> Ugen -> Ugen+tDelay in_ dur = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "TDelay" [in_, dur] Nothing 1 (Special 0) NoId++{- | Demand results as trigger from demand rate Ugens.++ TDuty [ControlRate,AudioRate] dur=1 reset=0 doneAction=0 level=1 gapFirst=0; REORDERS INPUTS: [0,1,3,2,4], ENUMERATION INPUTS: 2=DoneAction+-}+tDuty :: Rate -> Ugen -> Ugen -> DoneAction Ugen -> Ugen -> Ugen -> Ugen+tDuty rate dur reset doneAction level gapFirst = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "TDuty" [dur, reset, (from_done_action doneAction), level, gapFirst] Nothing 1 (Special 0) NoId++{- | Triggered exponential random number generator.++ TExpRand [ControlRate,AudioRate] lo=0.01 hi=1 trig=0; FILTER: TRUE, NONDET+-}+tExpRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+tExpRandId z lo hi trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [2]) "TExpRand" [lo, hi, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of TExpRand.+tExpRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+tExpRandM = liftUid3 tExpRandId++-- | Unsafe variant of TExpRand.+tExpRand :: Ugen -> Ugen -> Ugen -> Ugen+tExpRand = liftUnsafe3 tExpRandM++{- | Buffer granulator.++ TGrains [AudioRate] trigger=0 bufnum=0 rate=1 centerPos=0 dur=0.1 pan=0 amp=0.1 interp=4; NC INPUT: True+-}+tGrains :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tGrains numChannels trigger bufnum rate_ centerPos dur pan amp interp = mkUgen Nothing [AudioRate] (Left AudioRate) "TGrains" [trigger, bufnum, rate_, centerPos, dur, pan, amp, interp] Nothing numChannels (Special 0) NoId++{- | Triggered integer random number generator.++ TIRand [ControlRate,AudioRate] lo=0 hi=127 trig=0; FILTER: TRUE, NONDET+-}+tiRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+tiRandId z lo hi trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [2]) "TIRand" [lo, hi, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Tirand.+tiRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+tiRandM = liftUid3 tiRandId++-- | Unsafe variant of Tirand.+tiRand :: Ugen -> Ugen -> Ugen -> Ugen+tiRand = liftUnsafe3 tiRandM++{- | Triggered random number generator.++ TRand [ControlRate,AudioRate] lo=0 hi=1 trig=0; FILTER: TRUE, NONDET+-}+tRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+tRandId z lo hi trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [2]) "TRand" [lo, hi, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of TRand.+tRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+tRandM = liftUid3 tRandId++-- | Unsafe variant of TRand.+tRand :: Ugen -> Ugen -> Ugen -> Ugen+tRand = liftUnsafe3 tRandM++{- | Triggered windex.++ TWindex [ControlRate,AudioRate] in=0 normalize=0 *array=0; MCE=1, FILTER: TRUE, REORDERS INPUTS: [0,2,1], NONDET+-}+tWindexId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+tWindexId z in_ normalize array = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "TWindex" [in_, normalize] (Just [array]) 1 (Special 0) (toUid z)++-- | Monad variant of TWindex.+tWindexM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+tWindexM = liftUid3 tWindexId++-- | Unsafe variant of TWindex.+tWindex :: Ugen -> Ugen -> Ugen -> Ugen+tWindex = liftUnsafe3 tWindexM++{- | Returns time since last triggered.++ Timer [ControlRate,AudioRate] trig=0; FILTER: TRUE+-}+timer :: Ugen -> Ugen+timer trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Timer" [trig_] Nothing 1 (Special 0) NoId++{- | Toggle flip flop.++ ToggleFF [ControlRate,AudioRate] trig=0; FILTER: TRUE+-}+toggleFF :: Ugen -> Ugen+toggleFF trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "ToggleFF" [trig_] Nothing 1 (Special 0) NoId++{- | Timed trigger.++ Trig [ControlRate,AudioRate] in=0 dur=0.1; FILTER: TRUE+-}+trig :: Ugen -> Ugen -> Ugen+trig in_ dur = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Trig" [in_, dur] Nothing 1 (Special 0) NoId++{- | Timed trigger.++ Trig1 [ControlRate,AudioRate] in=0 dur=0.1; FILTER: TRUE+-}+trig1 :: Ugen -> Ugen -> Ugen+trig1 in_ dur = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Trig1" [in_, dur] Nothing 1 (Special 0) NoId++{- | Two pole filter.++ TwoPole [ControlRate,AudioRate] in=0 freq=440 radius=0.8; FILTER: TRUE+-}+twoPole :: Ugen -> Ugen -> Ugen -> Ugen+twoPole in_ freq radius = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "TwoPole" [in_, freq, radius] Nothing 1 (Special 0) NoId++{- | Two zero filter.++ TwoZero [ControlRate,AudioRate] in=0 freq=440 radius=0.8; FILTER: TRUE+-}+twoZero :: Ugen -> Ugen -> Ugen -> Ugen+twoZero in_ freq radius = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "TwoZero" [in_, freq, radius] Nothing 1 (Special 0) NoId++{- | Stream in audio from a file, with variable rate++ VDiskIn [AudioRate] bufnum=0 rate=1 loop=0 sendID=0; NC INPUT: True, ENUMERATION INPUTS: 2=Loop+-}+vDiskIn :: Int -> Ugen -> Ugen -> Loop Ugen -> Ugen -> Ugen+vDiskIn numChannels bufnum rate_ loop sendID = mkUgen Nothing [AudioRate] (Left AudioRate) "VDiskIn" [bufnum, rate_, (from_loop loop), sendID] Nothing numChannels (Special 0) NoId++{- | Variable wavetable oscillator.++ VOsc [ControlRate,AudioRate] bufpos=0 freq=440 phase=0+-}+vOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+vOsc rate bufpos freq phase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "VOsc" [bufpos, freq, phase] Nothing 1 (Special 0) NoId++{- | Three variable wavetable oscillators.++ VOsc3 [ControlRate,AudioRate] bufpos=0 freq1=110 freq2=220 freq3=440+-}+vOsc3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vOsc3 rate bufpos freq1 freq2 freq3 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "VOsc3" [bufpos, freq1, freq2, freq3] Nothing 1 (Special 0) NoId++{- | Variable shaped lag++ VarLag [ControlRate,AudioRate] in=0 time=0.1 curvature=0 warp=5 start=0; FILTER: TRUE+-}+varLag :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+varLag in_ time curvature warp start = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "VarLag" [in_, time, curvature, warp, start] Nothing 1 (Special 0) NoId++{- | Variable duty saw++ VarSaw [ControlRate,AudioRate] freq=440 iphase=0 width=0.5+-}+varSaw :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+varSaw rate freq iphase width = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "VarSaw" [freq, iphase, width] Nothing 1 (Special 0) NoId++{- | The Vibrato oscillator models a slow frequency modulation.++ Vibrato [ControlRate,AudioRate] freq=440 rate=6 depth=0.02 delay=0 onset=0 rateVariation=0.04 depthVariation=0.1 iphase=0 trig=0; NONDET+-}+vibratoId :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vibratoId z rate freq rate_ depth delay onset rateVariation depthVariation iphase trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Vibrato" [freq, rate_, depth, delay, onset, rateVariation, depthVariation, iphase, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Vibrato.+vibratoM :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+vibratoM = liftUid10 vibratoId++-- | Unsafe variant of Vibrato.+vibrato :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vibrato = liftUnsafe10 vibratoM++{- | Warp a buffer with a time pointer++ Warp1 [AudioRate] bufnum=0 pointer=0 freqScale=1 windowSize=0.2 envbufnum=-1 overlaps=8 windowRandRatio=0 interp=1; NC INPUT: True+-}+warp1 :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+warp1 numChannels bufnum pointer freqScale windowSize envbufnum overlaps windowRandRatio interp = mkUgen Nothing [AudioRate] (Left AudioRate) "Warp1" [bufnum, pointer, freqScale, windowSize, envbufnum, overlaps, windowRandRatio, interp] Nothing numChannels (Special 0) NoId++{- | White noise.++ WhiteNoise [ControlRate,AudioRate] ; NONDET+-}+whiteNoiseId :: ID a => a -> Rate -> Ugen+whiteNoiseId z rate = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "WhiteNoise" [] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of WhiteNoise.+whiteNoiseM :: Uid m => Rate -> m Ugen+whiteNoiseM = liftUid1 whiteNoiseId++-- | Unsafe variant of WhiteNoise.+whiteNoise :: Rate -> Ugen+whiteNoise = liftUnsafe1 whiteNoiseM++{- | Wrap a signal outside given thresholds.++ Wrap [InitialisationRate,ControlRate,AudioRate] in=0 lo=0 hi=1; FILTER: TRUE+-}+wrap :: Ugen -> Ugen -> Ugen -> Ugen+wrap in_ lo hi = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0]) "Wrap" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | Index into a table with a signal.++ WrapIndex [ControlRate,AudioRate] bufnum=0 in=0; FILTER: TRUE+-}+wrapIndex :: Ugen -> Ugen -> Ugen+wrapIndex bufnum in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [1]) "WrapIndex" [bufnum, in_] Nothing 1 (Special 0) NoId++{- | Equal power two channel cross fade.++ XFade2 [ControlRate,AudioRate] inA=0 inB=0 pan=0 level=1; FILTER: TRUE+-}+xFade2 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+xFade2 inA inB pan level = mkUgen Nothing [ControlRate, AudioRate] (Right [0, 1]) "XFade2" [inA, inB, pan, level] Nothing 1 (Special 0) NoId++{- | Exponential line generator.++ XLine [ControlRate,AudioRate] start=1 end=2 dur=1 doneAction=0; ENUMERATION INPUTS: 3=DoneAction+-}+xLine :: Rate -> Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Ugen+xLine rate start end dur doneAction = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "XLine" [start, end, dur, (from_done_action doneAction)] Nothing 1 (Special 0) NoId++{- | Send signal to a bus, crossfading with previous contents.++ XOut [ControlRate,AudioRate] bus=0 xfade=0 *channelsArray=0; MCE=1, FILTER: TRUE+-}+xOut :: Ugen -> Ugen -> Ugen -> Ugen+xOut bus xfade input = mkUgen Nothing [ControlRate, AudioRate] (Right [2]) "XOut" [bus, xfade] (Just [input]) 0 (Special 0) NoId++{- | Zero crossing frequency follower++ ZeroCrossing [ControlRate,AudioRate] in=0; FILTER: TRUE+-}+zeroCrossing :: Ugen -> Ugen+zeroCrossing in_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "ZeroCrossing" [in_] Nothing 1 (Special 0) NoId++{- | LocalBuf count++ MaxLocalBufs [InitialisationRate,ControlRate] count=0+-}+maxLocalBufs :: Ugen -> Ugen+maxLocalBufs count = mkUgen Nothing [InitialisationRate, ControlRate] (Left ControlRate) "MaxLocalBufs" [count] Nothing 1 (Special 0) NoId++{- | Multiply add++ MulAdd [InitialisationRate,ControlRate,AudioRate] in=0 mul=0 add=0; FILTER: TRUE+-}+mulAdd :: Ugen -> Ugen -> Ugen -> Ugen+mulAdd in_ mul add = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate] (Right [0, 1, 2]) "MulAdd" [in_, mul, add] Nothing 1 (Special 0) NoId++{- | Set local buffer++ SetBuf [InitialisationRate] buf=0 offset=0 length=0 *array=0; MCE=1, REORDERS INPUTS: [0,1,2,3]+-}+setBuf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+setBuf buf offset length_ array = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "SetBuf" [buf, offset, length_] (Just [array]) 1 (Special 0) NoId
Sound/Sc3/Ugen/Bindings/Db/External.hs view
@@ -1,3060 +1,3541 @@ -- | SC3 Ugen bindings (auto-generated). module Sound.Sc3.Ugen.Bindings.Db.External where ---import Sound.Sc3.Common.Enum---import Sound.Sc3.Common.Envelope-import Sound.Sc3.Common.Rate-import Sound.Sc3.Common.Uid-import Sound.Sc3.Common.Unsafe--import Sound.Sc3.Ugen.Primitive-import Sound.Sc3.Ugen.Ugen-import Sound.Sc3.Ugen.Util---- | (Undocumented class)------ A2B [AudioRate] a=0 b=0 c=0 d=0-a2b :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-a2b rate a b c d = mkUgen Nothing [AudioRate] (Left rate) "A2B" [a,b,c,d] Nothing 4 (Special 0) NoId---- | Emulator of the AY (aka YM) soundchip, used in Spectrum/Atari------ AY [AudioRate] tonea=1777 toneb=1666 tonec=1555 noise=1 control=7 vola=15 volb=15 volc=15 envfreq=4 envstyle=1 chiptype=0-ay :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-ay rate tonea toneb tonec noise control_ vola volb volc envfreq envstyle chiptype = mkUgen Nothing [AudioRate] (Left rate) "AY" [tonea,toneb,tonec,noise,control_,vola,volb,volc,envfreq,envstyle,chiptype] Nothing 1 (Special 0) NoId---- | AY-3-891X Chip Sound Simulator------ AY8910 [AudioRate] r0=0 r1=0 r2=0 r3=0 r4=0 r5=0 r6=0 r7=0 r8=0 r9=0 rA=0 rB=0 rC=0 rD=0 rate=1-ay8910 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-ay8910 rate r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 rA rB rC rD rate_ = mkUgen Nothing [AudioRate] (Left rate) "AY8910" [r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,rA,rB,rC,rD,rate_] Nothing 3 (Special 0) NoId---- | (Undocumented class)------ Allpass1 [AudioRate] in=0 freq=1200-allpass1 :: Rate -> Ugen -> Ugen -> Ugen-allpass1 rate in_ freq = mkUgen Nothing [AudioRate] (Left rate) "Allpass1" [in_,freq] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Allpass2 [AudioRate] in=0 freq=1200 rq=1-allpass2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-allpass2 rate in_ freq rq = mkUgen Nothing [AudioRate] (Left rate) "Allpass2" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | amplitude follower (deprecated)------ AmplitudeMod [ControlRate,AudioRate] in=0 attackTime=0.01 releaseTime=0.01-amplitudeMod :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-amplitudeMod rate in_ attackTime releaseTime = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "AmplitudeMod" [in_,attackTime,releaseTime] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AnalogBassDrum [AudioRate] trig=0 infsustain=0 accent=0.5 freq=50 tone=0.5 decay=0.5 attackfm=0.5 selffm=0.25-analogBassDrum :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-analogBassDrum rate trig_ infsustain accent freq tone decay_ attackfm selffm = mkUgen Nothing [AudioRate] (Left rate) "AnalogBassDrum" [trig_,infsustain,accent,freq,tone,decay_,attackfm,selffm] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AnalogFoldOsc [AudioRate] freq=100 amp=1-analogFoldOsc :: Rate -> Ugen -> Ugen -> Ugen-analogFoldOsc rate freq amp = mkUgen Nothing [AudioRate] (Left rate) "AnalogFoldOsc" [freq,amp] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AnalogPhaser [AudioRate] input=0 lfoinput=0 skew=0 feedback=0.25 modulation=0.5 stages=8; FILTER: TRUE-analogPhaser :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-analogPhaser input lfoinput skew feedback modulation stages = mkUgen Nothing [AudioRate] (Right [0]) "AnalogPhaser" [input,lfoinput,skew,feedback,modulation,stages] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AnalogPhaserMod [ControlRate,AudioRate] input=0 skew=0 modulation=0.5 stages=8; FILTER: TRUE-analogPhaserMod :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-analogPhaserMod input skew modulation stages = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "AnalogPhaserMod" [input,skew,modulation,stages] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AnalogPulseShaper [AudioRate] pulseinput=0 width=0.5 decay=0.5 double=0.5-analogPulseShaper :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-analogPulseShaper rate pulseinput width decay_ double = mkUgen Nothing [AudioRate] (Left rate) "AnalogPulseShaper" [pulseinput,width,decay_,double] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AnalogSnareDrum [AudioRate] trig=0 infsustain=0 accent=0.1 freq=200 tone=0.5 decay=0.5 snappy=0.5-analogSnareDrum :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-analogSnareDrum rate trig_ infsustain accent freq tone decay_ snappy = mkUgen Nothing [AudioRate] (Left rate) "AnalogSnareDrum" [trig_,infsustain,accent,freq,tone,decay_,snappy] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AnalogTape [AudioRate] input=0 bias=0.5 saturation=0.5 drive=0.5 oversample=1 mode=0; FILTER: TRUE-analogTape :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-analogTape input bias saturation drive oversample mode = mkUgen Nothing [AudioRate] (Right [0]) "AnalogTape" [input,bias,saturation,drive,oversample,mode] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AnalogVintageDistortion [AudioRate] input=0 drivegain=0.5 bias=0 lowgain=0.1 highgain=0.1 shelvingfreq=600 oversample=0; FILTER: TRUE-analogVintageDistortion :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-analogVintageDistortion input drivegain bias lowgain highgain shelvingfreq oversample = mkUgen Nothing [AudioRate] (Right [0]) "AnalogVintageDistortion" [input,drivegain,bias,lowgain,highgain,shelvingfreq,oversample] Nothing 1 (Special 0) NoId---- | event analyser (BBCut)------ AnalyseEvents2 [AudioRate] in=0 bufnum=0 threshold=0.34 triggerid=101 circular=0 pitch=0-analyseEvents2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-analyseEvents2 rate in_ bufnum threshold triggerid circular pitch_ = mkUgen Nothing [AudioRate] (Left rate) "AnalyseEvents2" [in_,bufnum,threshold,triggerid,circular,pitch_] Nothing 1 (Special 0) NoId---- | 2-species Predator-Prey model------ ArneodoCoulletTresser [AudioRate] freq=22050 alpha=1.5 h=0.05 xi=0.5 yi=0.5 zi=0.5-arneodoCoulletTresser :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-arneodoCoulletTresser rate freq alpha h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "ArneodoCoulletTresser" [freq,alpha,h,xi,yi,zi] Nothing 3 (Special 0) NoId---- | detect the largest value (and its position) in an array of Ugens------ ArrayMax [ControlRate,AudioRate] *array=0; MCE=1, FILTER: TRUE-arrayMax :: Ugen -> Ugen-arrayMax array = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "ArrayMax" [] (Just [array]) 2 (Special 0) NoId---- | detect the smallest value (and its position) in an array of Ugens------ ArrayMin [ControlRate,AudioRate] *array=0; MCE=1, FILTER: TRUE-arrayMin :: Ugen -> Ugen-arrayMin array = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "ArrayMin" [] (Just [array]) 2 (Special 0) NoId---- | Sound Chip Simulator------ Astrocade [AudioRate] reg0=0 reg1=127 reg2=0 reg3=0 reg4=0 reg5=0 reg6=15 reg7=0-astrocade :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-astrocade rate reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 = mkUgen Nothing [AudioRate] (Left rate) "Astrocade" [reg0,reg1,reg2,reg3,reg4,reg5,reg6,reg7] Nothing 1 (Special 0) NoId---- | TIA Chip Sound Simulator------ Atari2600 [AudioRate] audc0=1 audc1=2 audf0=3 audf1=4 audv0=5 audv1=5 rate=1-atari2600 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-atari2600 rate audc0 audc1 audf0 audf1 audv0 audv1 rate_ = mkUgen Nothing [AudioRate] (Left rate) "Atari2600" [audc0,audc1,audf0,audf1,audv0,audv1,rate_] Nothing 1 (Special 0) NoId---- | Use Amp data from a given partial------ AtsAmp [ControlRate,AudioRate] atsbuffer=0 partialNum=0 filePointer=0-atsAmp :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-atsAmp rate atsbuffer partialNum filePointer = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "AtsAmp" [atsbuffer,partialNum,filePointer] Nothing 1 (Special 0) NoId---- | (put short description here)------ AtsBand [AudioRate] atsbuffer=0 band=0 filePointer=0-atsBand :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-atsBand rate atsbuffer band filePointer = mkUgen Nothing [AudioRate] (Left rate) "AtsBand" [atsbuffer,band,filePointer] Nothing 1 (Special 0) NoId---- | Use Freq data from a given partial------ AtsFreq [ControlRate,AudioRate] atsbuffer=0 partialNum=0 filePointer=0-atsFreq :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-atsFreq rate atsbuffer partialNum filePointer = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "AtsFreq" [atsbuffer,partialNum,filePointer] Nothing 1 (Special 0) NoId---- | Resynthesize sine and noise data from an ATS analysis file------ AtsNoiSynth [AudioRate] atsbuffer=0 numPartials=0 partialStart=0 partialSkip=1 filePointer=0 sinePct=1 noisePct=1 freqMul=1 freqAdd=0 numBands=25 bandStart=0 bandSkip=1-atsNoiSynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-atsNoiSynth rate atsbuffer numPartials partialStart partialSkip filePointer sinePct noisePct freqMul freqAdd numBands bandStart bandSkip = mkUgen Nothing [AudioRate] (Left rate) "AtsNoiSynth" [atsbuffer,numPartials,partialStart,partialSkip,filePointer,sinePct,noisePct,freqMul,freqAdd,numBands,bandStart,bandSkip] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ AtsNoise [ControlRate,AudioRate] atsbuffer=0 bandNum=0 filePointer=0-atsNoise :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-atsNoise rate atsbuffer bandNum filePointer = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "AtsNoise" [atsbuffer,bandNum,filePointer] Nothing 1 (Special 0) NoId---- | One Ugen to return both Amp and Freq info------ AtsParInfo [ControlRate,AudioRate] atsbuffer=0 partialNum=0 filePointer=0-atsParInfo :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-atsParInfo rate atsbuffer partialNum filePointer = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "AtsParInfo" [atsbuffer,partialNum,filePointer] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ AtsPartial [AudioRate] atsbuffer=0 partial=0 filePointer=0 freqMul=1 freqAdd=0-atsPartial :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-atsPartial rate atsbuffer partial filePointer freqMul freqAdd = mkUgen Nothing [AudioRate] (Left rate) "AtsPartial" [atsbuffer,partial,filePointer,freqMul,freqAdd] Nothing 1 (Special 0) NoId---- | Resynthesize sine data from an ATS analysis file------ AtsSynth [AudioRate] atsbuffer=0 numPartials=0 partialStart=0 partialSkip=1 filePointer=0 freqMul=1 freqAdd=0-atsSynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-atsSynth rate atsbuffer numPartials partialStart partialSkip filePointer freqMul freqAdd = mkUgen Nothing [AudioRate] (Left rate) "AtsSynth" [atsbuffer,numPartials,partialStart,partialSkip,filePointer,freqMul,freqAdd] Nothing 1 (Special 0) NoId---- | Detect onsets and assess the nature of the attack slope------ AttackSlope [ControlRate] input=0 windowsize=1024 peakpicksize=20 leak=0.999 energythreshold=0.01 sumthreshold=20 mingap=30 numslopesaveraged=10-attackSlope :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-attackSlope rate input windowsize peakpicksize leak energythreshold sumthreshold mingap numslopesaveraged = mkUgen Nothing [ControlRate] (Left rate) "AttackSlope" [input,windowsize,peakpicksize,leak,energythreshold,sumthreshold,mingap,numslopesaveraged] Nothing 6 (Special 0) NoId---- | (Undocumented class)------ AudioMSG [AudioRate] in=0 index=0; FILTER: TRUE-audioMSG :: Ugen -> Ugen -> Ugen-audioMSG in_ index_ = mkUgen Nothing [AudioRate] (Right [0]) "AudioMSG" [in_,index_] Nothing 1 (Special 0) NoId---- | calculates mean average of audio or control rate signal------ AverageOutput [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE-averageOutput :: Ugen -> Ugen -> Ugen-averageOutput in_ trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "AverageOutput" [in_,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ B2A [AudioRate] w=0 x=0 y=0 z=0-b2a :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-b2a rate w x y z = mkUgen Nothing [AudioRate] (Left rate) "B2A" [w,x,y,z] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ B2Ster [AudioRate] w=0 x=0 y=0-b2Ster :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-b2Ster rate w x y = mkUgen Nothing [AudioRate] (Left rate) "B2Ster" [w,x,y] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ B2UHJ [AudioRate] w=0 x=0 y=0-b2uhj :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-b2uhj rate w x y = mkUgen Nothing [AudioRate] (Left rate) "B2UHJ" [w,x,y] Nothing 2 (Special 0) NoId---- | MultiOut BetaBlocker VChip------ BBlockerBuf [AudioRate] freq=0 bufnum=0 startpoint=0-bBlockerBuf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-bBlockerBuf rate freq bufnum startpoint = mkUgen Nothing [AudioRate] (Left rate) "BBlockerBuf" [freq,bufnum,startpoint] Nothing 9 (Special 0) NoId---- | 3D Ambisonic decoder------ BFDecode1 [AudioRate] w=0 x=0 y=0 z=0 azimuth=0 elevation=0 wComp=0-bfDecode1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bfDecode1 rate w x y z azimuth elevation wComp = mkUgen Nothing [AudioRate] (Left rate) "BFDecode1" [w,x,y,z,azimuth,elevation,wComp] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BFDecoder [] maxSize=0-bfDecoder :: Rate -> Ugen -> Ugen-bfDecoder rate maxSize = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "BFDecoder" [maxSize] Nothing 1 (Special 0) NoId---- | Ambisonic B format encoder------ BFEncode1 [AudioRate] in=0 azimuth=0 elevation=0 rho=1 gain=1 wComp=0-bfEncode1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bfEncode1 rate in_ azimuth elevation rho gain wComp = mkUgen Nothing [AudioRate] (Left rate) "BFEncode1" [in_,azimuth,elevation,rho,gain,wComp] Nothing 4 (Special 0) NoId---- | Ambisonic B format encoder------ BFEncode2 [AudioRate] in=0 point_x=1 point_y=1 elevation=0 gain=1 wComp=0-bfEncode2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bfEncode2 rate in_ point_x point_y elevation gain wComp = mkUgen Nothing [AudioRate] (Left rate) "BFEncode2" [in_,point_x,point_y,elevation,gain,wComp] Nothing 4 (Special 0) NoId---- | Ambisonic B format encoder for stereo signals------ BFEncodeSter [AudioRate] l=0 r=0 azimuth=0 width=1.5708 elevation=0 rho=1 gain=1 wComp=0-bfEncodeSter :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bfEncodeSter rate l r azimuth width elevation rho gain wComp = mkUgen Nothing [AudioRate] (Left rate) "BFEncodeSter" [l,r,azimuth,width,elevation,rho,gain,wComp] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ BFGrainPanner [] maxSize=0-bfGrainPanner :: Rate -> Ugen -> Ugen-bfGrainPanner rate maxSize = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "BFGrainPanner" [maxSize] Nothing 1 (Special 0) NoId---- | BFormat sound manipulation------ BFManipulate [AudioRate] w=0 x=0 y=0 z=0 rotate=0 tilt=0 tumble=0-bfManipulate :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bfManipulate rate w x y z rotate_ tilt_ tumble_ = mkUgen Nothing [AudioRate] (Left rate) "BFManipulate" [w,x,y,z,rotate_,tilt_,tumble_] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ BFPanner [] maxSize=0-bfPanner :: Rate -> Ugen -> Ugen-bfPanner rate maxSize = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "BFPanner" [maxSize] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BLBufRd [ControlRate,AudioRate] bufnum=0 phase=0 ratio=1-blBufRd :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-blBufRd rate bufnum phase ratio = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "BLBufRd" [bufnum,phase,ratio] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BLOsc [ControlRate,AudioRate] freq=100 pulsewidth=0.5 waveform=0-blOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-blOsc rate freq pulsewidth waveform = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "BLOsc" [freq,pulsewidth,waveform] Nothing 1 (Special 0) NoId---- | 24db/oct rolloff - 4nd order resonant Low/High/Band Pass Filter------ BMoog [AudioRate] in=0 freq=440 q=0.2 mode=0 saturation=0.95; FILTER: TRUE-bMoog :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bMoog in_ freq q mode saturation = mkUgen Nothing [AudioRate] (Right [0]) "BMoog" [in_,freq,q,mode,saturation] Nothing 1 (Special 0) NoId---- | Balances two signals with each other------ Balance [AudioRate] in=0 test=0 hp=10 stor=0-balance :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-balance rate in_ test hp stor = mkUgen Nothing [AudioRate] (Left rate) "Balance" [in_,test,hp,stor] Nothing 1 (Special 0) NoId---- | Extracts statistics on a beat histogram------ BeatStatistics [ControlRate] fft=0 leak=0.995 numpreviousbeats=4-beatStatistics :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-beatStatistics rate fft_ leak numpreviousbeats = mkUgen Nothing [ControlRate] (Left rate) "BeatStatistics" [fft_,leak,numpreviousbeats] Nothing 4 (Special 0) NoId---- | Sound Chip Simulator (well...)------ Beep [AudioRate] freq=3250 vol=1-beep :: Rate -> Ugen -> Ugen -> Ugen-beep rate freq vol = mkUgen Nothing [AudioRate] (Left rate) "Beep" [freq,vol] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BeepU [] maxSize=0-beepU :: Rate -> Ugen -> Ugen-beepU rate maxSize = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "BeepU" [maxSize] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BinData [ControlRate,AudioRate] buffer=0 bin=0 overlaps=0.5-binData :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-binData rate buffer bin overlaps = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "BinData" [buffer,bin,overlaps] Nothing 2 (Special 0) NoId---- | Band limited impulse generation------ BlitB3 [AudioRate] freq=440-blitB3 :: Rate -> Ugen -> Ugen-blitB3 rate freq = mkUgen Nothing [AudioRate] (Left rate) "BlitB3" [freq] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BlitB3D [AudioRate] freq=440-blitB3D :: Rate -> Ugen -> Ugen-blitB3D rate freq = mkUgen Nothing [AudioRate] (Left rate) "BlitB3D" [freq] Nothing 1 (Special 0) NoId---- | BLIT derived sawtooth------ BlitB3Saw [AudioRate] freq=440 leak=0.99-blitB3Saw :: Rate -> Ugen -> Ugen -> Ugen-blitB3Saw rate freq leak = mkUgen Nothing [AudioRate] (Left rate) "BlitB3Saw" [freq,leak] Nothing 1 (Special 0) NoId---- | Bipolar BLIT derived square waveform------ BlitB3Square [AudioRate] freq=440 leak=0.99-blitB3Square :: Rate -> Ugen -> Ugen -> Ugen-blitB3Square rate freq leak = mkUgen Nothing [AudioRate] (Left rate) "BlitB3Square" [freq,leak] Nothing 1 (Special 0) NoId---- | Bipolar BLIT derived triangle------ BlitB3Tri [AudioRate] freq=440 leak=0.99 leak2=0.99-blitB3Tri :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-blitB3Tri rate freq leak leak2 = mkUgen Nothing [AudioRate] (Left rate) "BlitB3Tri" [freq,leak,leak2] Nothing 1 (Special 0) NoId---- | breakcore simulator------ Breakcore [AudioRate] bufnum=0 capturein=0 capturetrigger=0 duration=0.1 ampdropout=0-breakcore :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-breakcore rate bufnum capturein capturetrigger duration ampdropout = mkUgen Nothing [AudioRate] (Left rate) "Breakcore" [bufnum,capturein,capturetrigger,duration,ampdropout] Nothing 1 (Special 0) NoId---- | Prigogine oscillator------ Brusselator [AudioRate] reset=0 rate=0.01 mu=1 gamma=1 initx=0.5 inity=0.5-brusselator :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-brusselator rate reset rate_ mu gamma initx inity = mkUgen Nothing [AudioRate] (Left rate) "Brusselator" [reset,rate_,mu,gamma,initx,inity] Nothing 2 (Special 0) NoId---- | Granular synthesis with sound sampled in a buffer------ BufGrain [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 interp=2-bufGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufGrain rate trigger dur sndbuf rate_ pos interp = mkUgen Nothing [AudioRate] (Left rate) "BufGrain" [trigger,dur,sndbuf,rate_,pos,interp] Nothing 1 (Special 0) NoId---- | Granular synthesis with sound sampled in a buffer and user supplied envelope------ BufGrainB [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 envbuf=0 interp=2-bufGrainB :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufGrainB rate trigger dur sndbuf rate_ pos envbuf interp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainB" [trigger,dur,sndbuf,rate_,pos,envbuf,interp] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BufGrainBBF [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 envbuf=0 azimuth=0 elevation=0 rho=1 interp=2 wComp=0-bufGrainBBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufGrainBBF rate trigger dur sndbuf rate_ pos envbuf azimuth elevation rho interp wComp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainBBF" [trigger,dur,sndbuf,rate_,pos,envbuf,azimuth,elevation,rho,interp,wComp] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ BufGrainBF [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 azimuth=0 elevation=0 rho=1 interp=2 wComp=0-bufGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufGrainBF rate trigger dur sndbuf rate_ pos azimuth elevation rho interp wComp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainBF" [trigger,dur,sndbuf,rate_,pos,azimuth,elevation,rho,interp,wComp] Nothing 4 (Special 0) NoId---- | Granular synthesis with sound sampled in a buffer and user supplied envelopes------ BufGrainI [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 envbuf1=0 envbuf2=0 ifac=0.5 interp=2-bufGrainI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufGrainI rate trigger dur sndbuf rate_ pos envbuf1 envbuf2 ifac interp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainI" [trigger,dur,sndbuf,rate_,pos,envbuf1,envbuf2,ifac,interp] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ BufGrainIBF [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 envbuf1=0 envbuf2=0 ifac=0.5 azimuth=0 elevation=0 rho=1 interp=2 wComp=0-bufGrainIBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bufGrainIBF rate trigger dur sndbuf rate_ pos envbuf1 envbuf2 ifac azimuth elevation rho interp wComp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainIBF" [trigger,dur,sndbuf,rate_,pos,envbuf1,envbuf2,ifac,azimuth,elevation,rho,interp,wComp] Nothing 4 (Special 0) NoId---- | detect the largest value (and its position) in an array of Ugens------ BufMax [ControlRate] bufnum=0 gate=1-bufMax :: Rate -> Ugen -> Ugen -> Ugen-bufMax rate bufnum gate_ = mkUgen Nothing [ControlRate] (Left rate) "BufMax" [bufnum,gate_] Nothing 2 (Special 0) NoId---- | detect the largest value (and its position) in an array of Ugens------ BufMin [ControlRate] bufnum=0 gate=1-bufMin :: Rate -> Ugen -> Ugen -> Ugen-bufMin rate bufnum gate_ = mkUgen Nothing [ControlRate] (Left rate) "BufMin" [bufnum,gate_] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ CQ_Diff [ControlRate] in1=0 in2=0 databufnum=0-cq_Diff :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-cq_Diff rate in1 in2 databufnum = mkUgen Nothing [ControlRate] (Left rate) "CQ_Diff" [in1,in2,databufnum] Nothing 1 (Special 0) NoId---- | Quefrency analysis and liftering------ Cepstrum [] cepbuf=0 fftchain=0-cepstrum :: Rate -> Ugen -> Ugen -> Ugen-cepstrum rate cepbuf fftchain = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "Cepstrum" [cepbuf,fftchain] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Chen [ControlRate,AudioRate] speed=0.5 a=0.5 b=0.3 c=0.28-chen :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-chen rate speed a b c = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Chen" [speed,a,b,c] Nothing 3 (Special 0) NoId---- | Octave chroma band based representation of energy in a signal; Chromagram for nTET tuning systems with any base reference------ Chromagram [ControlRate] fft=0 fftsize=2048 n=12 tuningbase=32.7032 octaves=8 integrationflag=0 coeff=0.9 octaveratio=2 perframenormalize=0-chromagram :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-chromagram rate fft_ fftsize n tuningbase octaves integrationflag coeff octaveratio perframenormalize = mkUgen Nothing [ControlRate] (Left rate) "Chromagram" [fft_,fftsize,n,tuningbase,octaves,integrationflag,coeff,octaveratio,perframenormalize] Nothing 12 (Special 0) NoId---- | circular linear lag------ CircleRamp [ControlRate,AudioRate] in=0 lagTime=0.1 circmin=-180 circmax=180-circleRamp :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-circleRamp rate in_ lagTime circmin circmax = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "CircleRamp" [in_,lagTime,circmin,circmax] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Clipper32 [AudioRate] in=0 lo=-0.8 hi=0.8-clipper32 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-clipper32 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "Clipper32" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Clipper4 [AudioRate] in=0 lo=-0.8 hi=0.8-clipper4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-clipper4 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "Clipper4" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Clipper8 [AudioRate] in=0 lo=-0.8 hi=0.8-clipper8 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-clipper8 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "Clipper8" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Clockmus [ControlRate]-clockmus :: Rate -> Ugen-clockmus rate = mkUgen Nothing [ControlRate] (Left rate) "Clockmus" [] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ CombLP [AudioRate] in=0 gate=1 maxdelaytime=0.2 delaytime=0.2 decaytime=1 coef=0.5-combLP :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-combLP rate in_ gate_ maxdelaytime delaytime decaytime coef = mkUgen Nothing [AudioRate] (Left rate) "CombLP" [in_,gate_,maxdelaytime,delaytime,decaytime,coef] Nothing 1 (Special 0) NoId---- | FM-modulable resonating filter------ ComplexRes [AudioRate] in=0 freq=100 decay=0.2; FILTER: TRUE-complexRes :: Ugen -> Ugen -> Ugen -> Ugen-complexRes in_ freq decay_ = mkUgen Nothing [AudioRate] (Right [0]) "ComplexRes" [in_,freq,decay_] Nothing 1 (Special 0) NoId---- | Concatenative Cross-Synthesis on Live Streams------ Concat [AudioRate] control=0 source=0 storesize=1 seektime=1 seekdur=1 matchlength=0.05 freezestore=0 zcr=1 lms=1 sc=1 st=0 randscore=0-concat :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-concat rate control_ source storesize seektime seekdur matchlength freezestore zcr lms sc st randscore = mkUgen Nothing [AudioRate] (Left rate) "Concat" [control_,source,storesize,seektime,seekdur,matchlength,freezestore,zcr,lms,sc,st,randscore] Nothing 1 (Special 0) NoId---- | Concatenative Cross-Synthesis on Live Streams------ Concat2 [AudioRate] control=0 source=0 storesize=1 seektime=1 seekdur=1 matchlength=0.05 freezestore=0 zcr=1 lms=1 sc=1 st=0 randscore=0 threshold=0.01-concat2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-concat2 rate control_ source storesize seektime seekdur matchlength freezestore zcr lms sc st randscore threshold = mkUgen Nothing [AudioRate] (Left rate) "Concat2" [control_,source,storesize,seektime,seekdur,matchlength,freezestore,zcr,lms,sc,st,randscore,threshold] Nothing 1 (Special 0) NoId---- | an amplitude tracking based onset detector------ Coyote [ControlRate] in=0 trackFall=0.2 slowLag=0.2 fastLag=0.01 fastMul=0.5 thresh=0.05 minDur=0.1-coyote :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-coyote rate in_ trackFall slowLag fastLag fastMul thresh minDur = mkUgen Nothing [ControlRate] (Left rate) "Coyote" [in_,trackFall,slowLag,fastLag,fastMul,thresh,minDur] Nothing 1 (Special 0) NoId---- | Measure the temporal crest factor of a signal------ Crest [ControlRate] in=0 numsamps=400 gate=1-crest :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-crest rate in_ numsamps gate_ = mkUgen Nothing [ControlRate] (Left rate) "Crest" [in_,numsamps,gate_] Nothing 1 (Special 0) NoId---- | class B/AB power amp distortion simulation------ CrossoverDistortion [AudioRate] in=0 amp=0.5 smooth=0.5; FILTER: TRUE-crossoverDistortion :: Ugen -> Ugen -> Ugen -> Ugen-crossoverDistortion in_ amp smooth = mkUgen Nothing [AudioRate] (Right [0]) "CrossoverDistortion" [in_,amp,smooth] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ DCompressor [AudioRate] input=0 sidechainIn=0 sidechain=0 ratio=4 threshold=-40 attack=0.1 release=100.1 makeup=0.5 automakeup=1; FILTER: TRUE-dCompressor :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dCompressor input sidechainIn sidechain ratio threshold attack release makeup automakeup = mkUgen Nothing [AudioRate] (Right [0]) "DCompressor" [input,sidechainIn,sidechain,ratio,threshold,attack,release,makeup,automakeup] Nothing 1 (Special 0) NoId---- | Digitally modelled analog filter------ DFM1 [AudioRate] in=0 freq=1000 res=0.1 inputgain=1 type=0 noiselevel=0.0003; FILTER: TRUE-dfm1 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dfm1 in_ freq res inputgain type_ noiselevel = mkUgen Nothing [AudioRate] (Right [0]) "DFM1" [in_,freq,res,inputgain,type_,noiselevel] Nothing 1 (Special 0) NoId---- | Demand rate implementation of a Wiard noise ring------ DNoiseRing [DemandRate] change=0.5 chance=0.5 shift=1 numBits=8 resetval=0; DEMAND/NONDET-dNoiseRingId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dNoiseRingId z change chance shift numBits resetval = mkUgen Nothing [DemandRate] (Left DemandRate) "DNoiseRing" [change,chance,shift,numBits,resetval] Nothing 1 (Special 0) (toUid z)---- | Monad variant of DNoiseRing.-dNoiseRingM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-dNoiseRingM = liftUid5 dNoiseRingId---- | Unsafe variant of DNoiseRing.-dNoiseRing :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dNoiseRing = liftUnsafe5 dNoiseRingM---- | Triangle via 3rd order differerentiated polynomial waveform------ DPW3Tri [AudioRate] freq=440-dpw3Tri :: Rate -> Ugen -> Ugen-dpw3Tri rate freq = mkUgen Nothing [AudioRate] (Left rate) "DPW3Tri" [freq] Nothing 1 (Special 0) NoId---- | Sawtooth via 4th order differerentiated polynomial waveform------ DPW4Saw [AudioRate] freq=440-dpw4Saw :: Rate -> Ugen -> Ugen-dpw4Saw rate freq = mkUgen Nothing [AudioRate] (Left rate) "DPW4Saw" [freq] Nothing 1 (Special 0) NoId---- | Plucked physical model.------ DWGBowed [AudioRate] freq=440 velb=0.5 force=1 gate=1 pos=0.14 release=0.1 c1=1 c3=3 impZ=0.55 fB=2-dwgBowed :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgBowed rate freq velb force gate_ pos release c1 c3 impZ fB = mkUgen Nothing [AudioRate] (Left rate) "DWGBowed" [freq,velb,force,gate_,pos,release,c1,c3,impZ,fB] Nothing 1 (Special 0) NoId---- | Plucked physical model.------ DWGBowedSimple [AudioRate] freq=440 velb=0.5 force=1 gate=1 pos=0.14 release=0.1 c1=1 c3=30-dwgBowedSimple :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgBowedSimple rate freq velb force gate_ pos release c1 c3 = mkUgen Nothing [AudioRate] (Left rate) "DWGBowedSimple" [freq,velb,force,gate_,pos,release,c1,c3] Nothing 1 (Special 0) NoId---- | Plucked physical model.------ DWGBowedTor [AudioRate] freq=440 velb=0.5 force=1 gate=1 pos=0.14 release=0.1 c1=1 c3=3 impZ=0.55 fB=2 mistune=5.2 c1tor=1 c3tor=3000 iZtor=1.8-dwgBowedTor :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgBowedTor rate freq velb force gate_ pos release c1 c3 impZ fB mistune c1tor c3tor iZtor = mkUgen Nothing [AudioRate] (Left rate) "DWGBowedTor" [freq,velb,force,gate_,pos,release,c1,c3,impZ,fB,mistune,c1tor,c3tor,iZtor] Nothing 1 (Special 0) NoId---- | Clarinet physical model.------ DWGClarinet3 [AudioRate] freq=440.0 pm=1.0 pc=1.0 m=0.8 gate=1.0 release=1.0e-2 c1=0.25 c3=7.0-dwgClarinet3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgClarinet3 rate freq pm pc m gate_ release c1 c3 = mkUgen Nothing [AudioRate] (Left rate) "DWGClarinet3" [freq,pm,pc,m,gate_,release,c1,c3] Nothing 1 (Special 0) NoId---- | Reimplementation of STK flute model.------ DWGFlute [AudioRate] freq=400.0 pm=1.0 endr=0.5 jetr=0.25 jetRa=0.33 gate=1.0 release=0.1-dwgFlute :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgFlute rate freq pm endr jetr jetRa gate_ release = mkUgen Nothing [AudioRate] (Left rate) "DWGFlute" [freq,pm,endr,jetr,jetRa,gate_,release] Nothing 1 (Special 0) NoId---- | Plucked physical model.------ DWGPlucked [AudioRate] freq=440 amp=0.5 gate=1 pos=0.14 c1=1 c3=30 inp=0 release=0.1-dwgPlucked :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgPlucked rate freq amp gate_ pos c1 c3 inp release = mkUgen Nothing [AudioRate] (Left rate) "DWGPlucked" [freq,amp,gate_,pos,c1,c3,inp,release] Nothing 1 (Special 0) NoId---- | Plucked physical model.------ DWGPlucked2 [AudioRate] freq=440 amp=0.5 gate=1 pos=0.14 c1=1 c3=30 inp=0 release=0.1 mistune=1.008 mp=0.55 gc=0.01-dwgPlucked2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgPlucked2 rate freq amp gate_ pos c1 c3 inp release mistune mp gc = mkUgen Nothing [AudioRate] (Left rate) "DWGPlucked2" [freq,amp,gate_,pos,c1,c3,inp,release,mistune,mp,gc] Nothing 1 (Special 0) NoId---- | Plucked physical model.------ DWGPluckedStiff [AudioRate] freq=440 amp=0.5 gate=1 pos=0.14 c1=1 c3=30 inp=0 release=0.1 fB=2-dwgPluckedStiff :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgPluckedStiff rate freq amp gate_ pos c1 c3 inp release fB = mkUgen Nothing [AudioRate] (Left rate) "DWGPluckedStiff" [freq,amp,gate_,pos,c1,c3,inp,release,fB] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ DWGSoundBoard [AudioRate] inp=0 c1=20 c3=20 mix=0.8 d1=199 d2=211 d3=223 d4=227 d5=229 d6=233 d7=239 d8=241; FILTER: TRUE-dwgSoundBoard :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwgSoundBoard inp c1 c3 mix d1 d2 d3 d4 d5 d6 d7 d8 = mkUgen Nothing [AudioRate] (Right [0]) "DWGSoundBoard" [inp,c1,c3,mix,d1,d2,d3,d4,d5,d6,d7,d8] Nothing 1 (Special 0) NoId---- | demand rate brownian movement with Gendyn distributions------ Dbrown2 [] lo=0 hi=0 step=0 dist=0 length=100000000-dbrown2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dbrown2 rate lo hi step dist length_ = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "Dbrown2" [lo,hi,step,dist,length_] Nothing 1 (Special 0) NoId---- | demand rate tag system on a buffer------ DbufTag [DemandRate] bufnum=0 v=0 axiom=0 rules=0 recycle=0 mode=0; DEMAND/NONDET-dbufTagId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dbufTagId z bufnum v axiom rules recycle mode = mkUgen Nothing [DemandRate] (Left DemandRate) "DbufTag" [bufnum,v,axiom,rules,recycle,mode] Nothing 1 (Special 0) (toUid z)---- | Monad variant of DbufTag.-dbufTagM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-dbufTagM = liftUid6 dbufTagId---- | Unsafe variant of DbufTag.-dbufTag :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dbufTag = liftUnsafe6 dbufTagM---- | Samplerate and bitrate reduction------ Decimator [AudioRate] in=0 rate=44100 bits=24-decimator :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-decimator rate in_ rate_ bits = mkUgen Nothing [AudioRate] (Left rate) "Decimator" [in_,rate_,bits] Nothing 1 (Special 0) NoId---- | Demand version of the BetaBlocker VChip------ DetaBlockerBuf [DemandRate] bufnum=0 startpoint=0; DEMAND/NONDET-detaBlockerBufId :: ID a => a -> Ugen -> Ugen -> Ugen-detaBlockerBufId z bufnum startpoint = mkUgen Nothing [DemandRate] (Left DemandRate) "DetaBlockerBuf" [bufnum,startpoint] Nothing 1 (Special 0) (toUid z)---- | Monad variant of DetaBlockerBuf.-detaBlockerBufM :: Uid m => Ugen -> Ugen -> m Ugen-detaBlockerBufM = liftUid2 detaBlockerBufId---- | Unsafe variant of DetaBlockerBuf.-detaBlockerBuf :: Ugen -> Ugen -> Ugen-detaBlockerBuf = liftUnsafe2 detaBlockerBufM---- | demand rate finite state machine------ Dfsm [DemandRate] rules=0 n=1 rgen=0; DEMAND/NONDET-dfsmId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-dfsmId z rules n rgen = mkUgen Nothing [DemandRate] (Left DemandRate) "Dfsm" [rules,n,rgen] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Dfsm.-dfsmM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-dfsmM = liftUid3 dfsmId---- | Unsafe variant of Dfsm.-dfsm :: Ugen -> Ugen -> Ugen -> Ugen-dfsm = liftUnsafe3 dfsmM---- | (Undocumented class)------ Dgauss [] lo=0 hi=0 length=100000000-dgauss :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-dgauss rate lo hi length_ = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "Dgauss" [lo,hi,length_] Nothing 1 (Special 0) NoId---- | Ring modulation based on the physical model of a diode.------ DiodeRingMod [AudioRate] car=0 mod=0; FILTER: TRUE-diodeRingMod :: Ugen -> Ugen -> Ugen-diodeRingMod car mod_ = mkUgen Nothing [AudioRate] (Right [0]) "DiodeRingMod" [car,mod_] Nothing 1 (Special 0) NoId---- | port of some ladspa plugins------ Disintegrator [AudioRate] in=0 probability=0.5 multiplier=0; FILTER: TRUE, NONDET-disintegratorId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-disintegratorId z in_ probability multiplier = mkUgen Nothing [AudioRate] (Right [0]) "Disintegrator" [in_,probability,multiplier] Nothing 1 (Special 0) (toUid z)---- | Monad variant of Disintegrator.-disintegratorM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-disintegratorM = liftUid3 disintegratorId---- | Unsafe variant of Disintegrator.-disintegrator :: Ugen -> Ugen -> Ugen -> Ugen-disintegrator = liftUnsafe3 disintegratorM---- | discrete time neurodynamics------ Dneuromodule [ControlRate,AudioRate,DemandRate] dt=0 *theta=0 *x=0 *weights=0; MCE=3, NC INPUT: True, NONDET-dneuromoduleId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dneuromoduleId numChannels z dt theta x weights = mkUgen Nothing [ControlRate,AudioRate,DemandRate] (Left DemandRate) "Dneuromodule" [dt] (Just [theta,x,weights]) numChannels (Special 0) (toUid z)---- | Monad variant of Dneuromodule.-dneuromoduleM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-dneuromoduleM = liftUid5 dneuromoduleId---- | Unsafe variant of Dneuromodule.-dneuromodule :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dneuromodule = liftUnsafe5 dneuromoduleM---- | Nested Allpass filters as proposed by Vercoe and Pluckett------ DoubleNestedAllpassC [AudioRate] in=0 maxdelay1=0.0047 delay1=0.0047 gain1=0.15 maxdelay2=0.022 delay2=0.022 gain2=0.25 maxdelay3=0.0083 delay3=0.0083 gain3=0.3; FILTER: TRUE-doubleNestedAllpassC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-doubleNestedAllpassC in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 maxdelay3 delay3 gain3 = mkUgen Nothing [AudioRate] (Right [0]) "DoubleNestedAllpassC" [in_,maxdelay1,delay1_,gain1,maxdelay2,delay2_,gain2,maxdelay3,delay3,gain3] Nothing 1 (Special 0) NoId---- | Nested Allpass filters as proposed by Vercoe and Pluckett------ DoubleNestedAllpassL [AudioRate] in=0 maxdelay1=0.0047 delay1=0.0047 gain1=0.15 maxdelay2=0.022 delay2=0.022 gain2=0.25 maxdelay3=0.0083 delay3=0.0083 gain3=0.3; FILTER: TRUE-doubleNestedAllpassL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-doubleNestedAllpassL in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 maxdelay3 delay3 gain3 = mkUgen Nothing [AudioRate] (Right [0]) "DoubleNestedAllpassL" [in_,maxdelay1,delay1_,gain1,maxdelay2,delay2_,gain2,maxdelay3,delay3,gain3] Nothing 1 (Special 0) NoId---- | Nested Allpass filters as proposed by Vercoe and Pluckett------ DoubleNestedAllpassN [AudioRate] in=0 maxdelay1=0.0047 delay1=0.0047 gain1=0.15 maxdelay2=0.022 delay2=0.022 gain2=0.25 maxdelay3=0.0083 delay3=0.0083 gain3=0.3; FILTER: TRUE-doubleNestedAllpassN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-doubleNestedAllpassN in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 maxdelay3 delay3 gain3 = mkUgen Nothing [AudioRate] (Right [0]) "DoubleNestedAllpassN" [in_,maxdelay1,delay1_,gain1,maxdelay2,delay2_,gain2,maxdelay3,delay3,gain3] Nothing 1 (Special 0) NoId---- | Forced DoubleWell Oscillator------ DoubleWell [AudioRate] reset=0 ratex=0.01 ratey=0.01 f=1 w=0.001 delta=1 initx=0 inity=0-doubleWell :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-doubleWell rate reset ratex ratey f w delta initx inity = mkUgen Nothing [AudioRate] (Left rate) "DoubleWell" [reset,ratex,ratey,f,w,delta,initx,inity] Nothing 1 (Special 0) NoId---- | Forced DoubleWell Oscillator------ DoubleWell2 [AudioRate] reset=0 ratex=0.01 ratey=0.01 f=1 w=0.001 delta=1 initx=0 inity=0-doubleWell2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-doubleWell2 rate reset ratex ratey f w delta initx inity = mkUgen Nothing [AudioRate] (Left rate) "DoubleWell2" [reset,ratex,ratey,f,w,delta,initx,inity] Nothing 1 (Special 0) NoId---- | Forced DoubleWell Oscillator------ DoubleWell3 [AudioRate] reset=0 rate=0.01 f=0 delta=0.25 initx=0 inity=0-doubleWell3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-doubleWell3 rate reset rate_ f delta initx inity = mkUgen Nothing [AudioRate] (Left rate) "DoubleWell3" [reset,rate_,f,delta,initx,inity] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ DriveNoise [AudioRate] in=0 amount=1 multi=5-driveNoise :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-driveNoise rate in_ amount multi = mkUgen Nothing [AudioRate] (Left rate) "DriveNoise" [in_,amount,multi] Nothing 1 (Special 0) NoId---- | Crosscorrelation search and drum pattern matching beat tracker------ DrumTrack [ControlRate] in=0 lock=0 dynleak=0 tempowt=0 phasewt=0 basswt=0 patternwt=1 prior=0 kicksensitivity=1 snaresensitivity=1 debugmode=0-drumTrack :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-drumTrack rate in_ lock dynleak tempowt phasewt basswt patternwt prior kicksensitivity snaresensitivity debugmode = mkUgen Nothing [ControlRate] (Left rate) "DrumTrack" [in_,lock,dynleak,tempowt,phasewt,basswt,patternwt,prior,kicksensitivity,snaresensitivity,debugmode] Nothing 4 (Special 0) NoId---- | demand rate tag system------ Dtag [] bufsize=0 v=0 axiom=0 rules=0 recycle=0 mode=0-dtag :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dtag rate bufsize v axiom rules recycle mode = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "Dtag" [bufsize,v,axiom,rules,recycle,mode] Nothing 1 (Special 0) NoId---- | Envelope Follower Filter------ EnvDetect [AudioRate] in=0 attack=100 release=0-envDetect :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-envDetect rate in_ attack release = mkUgen Nothing [AudioRate] (Left rate) "EnvDetect" [in_,attack,release] Nothing 1 (Special 0) NoId---- | Envelope Follower------ EnvFollow [ControlRate,AudioRate] input=0 decaycoeff=0.99-envFollow :: Rate -> Ugen -> Ugen -> Ugen-envFollow rate input decaycoeff = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "EnvFollow" [input,decaycoeff] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FFTComplexDev [ControlRate] buffer=0 rectify=0 powthresh=0.1-fftComplexDev :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-fftComplexDev rate buffer rectify powthresh = mkUgen Nothing [ControlRate] (Left rate) "FFTComplexDev" [buffer,rectify,powthresh] Nothing 1 (Special 0) NoId---- | Spectral crest measure------ FFTCrest [ControlRate] buffer=0 freqlo=0 freqhi=50000-fftCrest :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-fftCrest rate buffer freqlo freqhi = mkUgen Nothing [ControlRate] (Left rate) "FFTCrest" [buffer,freqlo,freqhi] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FFTDiffMags [ControlRate] bufferA=0 bufferB=0-fftDiffMags :: Rate -> Ugen -> Ugen -> Ugen-fftDiffMags rate bufferA bufferB = mkUgen Nothing [ControlRate] (Left rate) "FFTDiffMags" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FFTFlux [ControlRate] buffer=0 normalise=1-fftFlux :: Rate -> Ugen -> Ugen -> Ugen-fftFlux rate buffer normalise = mkUgen Nothing [ControlRate] (Left rate) "FFTFlux" [buffer,normalise] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FFTFluxPos [ControlRate] buffer=0 normalise=1-fftFluxPos :: Rate -> Ugen -> Ugen -> Ugen-fftFluxPos rate buffer normalise = mkUgen Nothing [ControlRate] (Left rate) "FFTFluxPos" [buffer,normalise] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FFTMKL [ControlRate] buffer=0 epsilon=0.0-fftmkl :: Rate -> Ugen -> Ugen -> Ugen-fftmkl rate buffer epsilon = mkUgen Nothing [ControlRate] (Left rate) "FFTMKL" [buffer,epsilon] Nothing 1 (Special 0) NoId---- | Find peak value in an FFT frame------ FFTPeak [ControlRate] buffer=0 freqlo=0 freqhi=50000-fftPeak :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-fftPeak rate buffer freqlo freqhi = mkUgen Nothing [ControlRate] (Left rate) "FFTPeak" [buffer,freqlo,freqhi] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ FFTPhaseDev [ControlRate] buffer=0 weight=0 powthresh=0.1-fftPhaseDev :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-fftPhaseDev rate buffer weight powthresh = mkUgen Nothing [ControlRate] (Left rate) "FFTPhaseDev" [buffer,weight,powthresh] Nothing 1 (Special 0) NoId---- | Instantaneous spectral power------ FFTPower [ControlRate] buffer=0 square=1-fftPower :: Rate -> Ugen -> Ugen -> Ugen-fftPower rate buffer square = mkUgen Nothing [ControlRate] (Left rate) "FFTPower" [buffer,square] Nothing 1 (Special 0) NoId---- | Spectral slope------ FFTSlope [ControlRate] buffer=0-fftSlope :: Rate -> Ugen -> Ugen-fftSlope rate buffer = mkUgen Nothing [ControlRate] (Left rate) "FFTSlope" [buffer] Nothing 1 (Special 0) NoId---- | Spectral spread------ FFTSpread [ControlRate] buffer=0 centroid=0-fftSpread :: Rate -> Ugen -> Ugen -> Ugen-fftSpread rate buffer centroid = mkUgen Nothing [ControlRate] (Left rate) "FFTSpread" [buffer,centroid] Nothing 1 (Special 0) NoId---- | Spectral flatness, divided into subbands------ FFTSubbandFlatness [ControlRate] chain=0 cutfreqs=0-fftSubbandFlatness :: Rate -> Ugen -> Ugen -> Ugen-fftSubbandFlatness rate chain cutfreqs = mkUgen Nothing [ControlRate] (Left rate) "FFTSubbandFlatness" [chain,cutfreqs] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FFTSubbandFlux [ControlRate] chain=0 cutfreqs=0 posonly=0-fftSubbandFlux :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-fftSubbandFlux rate chain cutfreqs posonly = mkUgen Nothing [ControlRate] (Left rate) "FFTSubbandFlux" [chain,cutfreqs,posonly] Nothing 1 (Special 0) NoId---- | Spectral power, divided into subbands------ FFTSubbandPower [ControlRate] chain=0 cutfreqs=0 square=1 scalemode=1-fftSubbandPower :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fftSubbandPower rate chain cutfreqs square scalemode = mkUgen Nothing [ControlRate] (Left rate) "FFTSubbandPower" [chain,cutfreqs,square,scalemode] Nothing 1 (Special 0) NoId---- | Phase modulation oscillator matrix.------ FM7 [AudioRate] *ctlMatrix=0 *modMatrix=0; MCE=2-fm7 :: Rate -> Ugen -> Ugen -> Ugen-fm7 rate ctlMatrix modMatrix = mkUgen Nothing [AudioRate] (Left rate) "FM7" [] (Just [ctlMatrix,modMatrix]) 6 (Special 0) NoId---- | Granular synthesis with FM grains------ FMGrain [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1; FILTER: TRUE-fmGrain :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmGrain trigger dur carfreq modfreq index_ = mkUgen Nothing [AudioRate] (Right [0]) "FMGrain" [trigger,dur,carfreq,modfreq,index_] Nothing 1 (Special 0) NoId---- | Granular synthesis with FM grains and user supplied envelope------ FMGrainB [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 envbuf=0; FILTER: TRUE-fmGrainB :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmGrainB trigger dur carfreq modfreq index_ envbuf = mkUgen Nothing [AudioRate] (Right [0]) "FMGrainB" [trigger,dur,carfreq,modfreq,index_,envbuf] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FMGrainBBF [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 envbuf=0 azimuth=0 elevation=0 rho=1 wComp=0-fmGrainBBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmGrainBBF rate trigger dur carfreq modfreq index_ envbuf azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "FMGrainBBF" [trigger,dur,carfreq,modfreq,index_,envbuf,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ FMGrainBF [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 azimuth=0 elevation=0 rho=1 wComp=0-fmGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmGrainBF rate trigger dur carfreq modfreq index_ azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "FMGrainBF" [trigger,dur,carfreq,modfreq,index_,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | Granular synthesis with FM grains and user supplied envelopes------ FMGrainI [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 envbuf1=0 envbuf2=0 ifac=0.5-fmGrainI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmGrainI rate trigger dur carfreq modfreq index_ envbuf1 envbuf2 ifac = mkUgen Nothing [AudioRate] (Left rate) "FMGrainI" [trigger,dur,carfreq,modfreq,index_,envbuf1,envbuf2,ifac] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FMGrainIBF [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 envbuf1=0 envbuf2=0 ifac=0.5 azimuth=0 elevation=0 rho=1 wComp=0-fmGrainIBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmGrainIBF rate trigger dur carfreq modfreq index_ envbuf1 envbuf2 ifac azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "FMGrainIBF" [trigger,dur,carfreq,modfreq,index_,envbuf1,envbuf2,ifac,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | Decode an FMH signal for a specific speaker------ FMHDecode1 [AudioRate] w=0 x=0 y=0 z=0 r=0 s=0 t=0 u=0 v=0 azimuth=0 elevation=0-fmhDecode1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmhDecode1 rate w x y z r s t u v azimuth elevation = mkUgen Nothing [AudioRate] (Left rate) "FMHDecode1" [w,x,y,z,r,s,t,u,v,azimuth,elevation] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FMHEncode0 [AudioRate] in=0 azimuth=0 elevation=0 gain=1-fmhEncode0 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmhEncode0 rate in_ azimuth elevation gain = mkUgen Nothing [AudioRate] (Left rate) "FMHEncode0" [in_,azimuth,elevation,gain] Nothing 9 (Special 0) NoId---- | Second Order Ambisonic encoder------ FMHEncode1 [AudioRate] in=0 azimuth=0 elevation=0 rho=1 gain=1 wComp=0-fmhEncode1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmhEncode1 rate in_ azimuth elevation rho gain wComp = mkUgen Nothing [AudioRate] (Left rate) "FMHEncode1" [in_,azimuth,elevation,rho,gain,wComp] Nothing 9 (Special 0) NoId---- | Second Order Ambisonic encoder------ FMHEncode2 [AudioRate] in=0 point_x=0 point_y=0 elevation=0 gain=1 wComp=0-fmhEncode2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fmhEncode2 rate in_ point_x point_y elevation gain wComp = mkUgen Nothing [AudioRate] (Left rate) "FMHEncode2" [in_,point_x,point_y,elevation,gain,wComp] Nothing 9 (Special 0) NoId---- | Storing feature data from Ugens in NRT mode------ FeatureSave [ControlRate] features=0 trig=0-featureSave :: Rate -> Ugen -> Ugen -> Ugen-featureSave rate features trig_ = mkUgen Nothing [ControlRate] (Left rate) "FeatureSave" [features,trig_] Nothing 1 (Special 0) NoId---- | FitzHughNagumo Neuron Firing Oscillator------ Fhn2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 urate=0.1 wrate=0.1 b0=0.6 b1=0.8 i=0 u0=0 w0=0-fhn2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fhn2DC rate minfreq maxfreq urate wrate b0 b1 i u0 w0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Fhn2DC" [minfreq,maxfreq,urate,wrate,b0,b1,i,u0,w0] Nothing 1 (Special 0) NoId---- | FitzHughNagumo Neuron Firing Oscillator------ Fhn2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 urate=0.1 wrate=0.1 b0=0.6 b1=0.8 i=0 u0=0 w0=0-fhn2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fhn2DL rate minfreq maxfreq urate wrate b0 b1 i u0 w0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Fhn2DL" [minfreq,maxfreq,urate,wrate,b0,b1,i,u0,w0] Nothing 1 (Special 0) NoId---- | FitzHughNagumo Neuron Firing Oscillator------ Fhn2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 urate=0.1 wrate=0.1 b0=0.6 b1=0.8 i=0 u0=0 w0=0-fhn2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fhn2DN rate minfreq maxfreq urate wrate b0 b1 i u0 w0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Fhn2DN" [minfreq,maxfreq,urate,wrate,b0,b1,i,u0,w0] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FhnTrig [ControlRate,AudioRate] minfreq=4 maxfreq=10 urate=0.1 wrate=0.1 b0=0.6 b1=0.8 i=0 u0=0 w0=0-fhnTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fhnTrig rate minfreq maxfreq urate wrate b0 b1 i u0 w0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "FhnTrig" [minfreq,maxfreq,urate,wrate,b0,b1,i,u0,w0] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ FincoSprottL [AudioRate] freq=22050 a=2.45 h=0.05 xi=0 yi=0 zi=0-fincoSprottL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fincoSprottL rate freq a h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "FincoSprottL" [freq,a,h,xi,yi,zi] Nothing 3 (Special 0) NoId---- | (Undocumented class)------ FincoSprottM [AudioRate] freq=22050 a=-7 b=4 h=0.05 xi=0 yi=0 zi=0-fincoSprottM :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fincoSprottM rate freq a b h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "FincoSprottM" [freq,a,b,h,xi,yi,zi] Nothing 3 (Special 0) NoId---- | (Undocumented class)------ FincoSprottS [AudioRate] freq=22050 a=8 b=2 h=0.05 xi=0 yi=0 zi=0-fincoSprottS :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fincoSprottS rate freq a b h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "FincoSprottS" [freq,a,b,h,xi,yi,zi] Nothing 3 (Special 0) NoId---- | Neuron Firing Model Oscillator------ FitzHughNagumo [AudioRate] reset=0 rateu=0.01 ratew=0.01 b0=1 b1=1 initu=0 initw=0-fitzHughNagumo :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-fitzHughNagumo rate reset rateu ratew b0 b1 initu initw = mkUgen Nothing [AudioRate] (Left rate) "FitzHughNagumo" [reset,rateu,ratew,b0,b1,initu,initw] Nothing 1 (Special 0) NoId---- | calculates spectral MSE distance of two fft chains------ FrameCompare [ControlRate] buffer1=0 buffer2=0 wAmount=0.5-frameCompare :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-frameCompare rate buffer1 buffer2 wAmount = mkUgen Nothing [ControlRate] (Left rate) "FrameCompare" [buffer1,buffer2,wAmount] Nothing 1 (Special 0) NoId---- | A physical model of a system with dry-friction. A chaotic filter.------ Friction [ControlRate,AudioRate] in=0 friction=0.5 spring=0.414 damp=0.313 mass=0.1 beltmass=1-friction :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-friction rate in_ friction_ spring_ damp mass beltmass = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Friction" [in_,friction_,spring_,damp,mass,beltmass] Nothing 1 (Special 0) NoId---- | Single gammatone filter------ Gammatone [AudioRate] input=0 centrefrequency=440 bandwidth=200; FILTER: TRUE-gammatone :: Ugen -> Ugen -> Ugen -> Ugen-gammatone input centrefrequency bandwidth = mkUgen Nothing [AudioRate] (Right [0]) "Gammatone" [input,centrefrequency,bandwidth] Nothing 1 (Special 0) NoId---- | Gaussian classifier------ GaussClass [ControlRate] in=0 bufnum=0 gate=0-gaussClass :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-gaussClass rate in_ bufnum gate_ = mkUgen Nothing [ControlRate] (Left rate) "GaussClass" [in_,bufnum,gate_] Nothing 1 (Special 0) NoId---- | impulses around a certain frequency------ GaussTrig [ControlRate,AudioRate] freq=440 dev=0.3-gaussTrig :: Rate -> Ugen -> Ugen -> Ugen-gaussTrig rate freq dev = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "GaussTrig" [freq,dev] Nothing 1 (Special 0) NoId---- | gingerbreadman map 2D chaotic generator------ Gbman2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 x0=1.2 y0=2.1-gbman2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gbman2DC rate minfreq maxfreq x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Gbman2DC" [minfreq,maxfreq,x0,y0] Nothing 1 (Special 0) NoId---- | gingerbreadman map 2D chaotic generator------ Gbman2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 x0=1.2 y0=2.1-gbman2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gbman2DL rate minfreq maxfreq x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Gbman2DL" [minfreq,maxfreq,x0,y0] Nothing 1 (Special 0) NoId---- | gingerbreadman map 2D chaotic generator------ Gbman2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 x0=1.2 y0=2.1-gbman2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gbman2DN rate minfreq maxfreq x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Gbman2DN" [minfreq,maxfreq,x0,y0] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ GbmanTrig [ControlRate,AudioRate] minfreq=5 maxfreq=10 x0=1.2 y0=2.1-gbmanTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gbmanTrig rate minfreq maxfreq x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "GbmanTrig" [minfreq,maxfreq,x0,y0] Nothing 1 (Special 0) NoId---- | Dynamic stochastic synthesis generator------ Gendy4 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 minfreq=440 maxfreq=660 ampscale=0.5 durscale=0.5 initCPs=12 knum=0-gendy4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gendy4 rate ampdist durdist adparam ddparam minfreq maxfreq ampscale durscale initCPs knum = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Gendy4" [ampdist,durdist,adparam,ddparam,minfreq,maxfreq,ampscale,durscale,initCPs,knum] Nothing 1 (Special 0) NoId---- | Dynamic stochastic synthesis generator------ Gendy5 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 minfreq=440 maxfreq=660 ampscale=0.5 durscale=0.5 initCPs=12 knum=0-gendy5 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gendy5 rate ampdist durdist adparam ddparam minfreq maxfreq ampscale durscale initCPs knum = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Gendy5" [ampdist,durdist,adparam,ddparam,minfreq,maxfreq,ampscale,durscale,initCPs,knum] Nothing 1 (Special 0) NoId---- | Read (numeric) shell environment variables into a synth------ Getenv [] key=0 defaultval=0-getenv :: Rate -> Ugen -> Ugen -> Ugen-getenv rate key defaultval = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "Getenv" [key,defaultval] Nothing 1 (Special 0) NoId---- | backward compatibility------ GlitchBPF [ControlRate,AudioRate] in=0 freq=440 rq=1-glitchBPF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-glitchBPF rate in_ freq rq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "GlitchBPF" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | backward compatibility------ GlitchBRF [ControlRate,AudioRate] in=0 freq=440 rq=1-glitchBRF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-glitchBRF rate in_ freq rq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "GlitchBRF" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | backward compatibility------ GlitchHPF [ControlRate,AudioRate] in=0 freq=440-glitchHPF :: Rate -> Ugen -> Ugen -> Ugen-glitchHPF rate in_ freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "GlitchHPF" [in_,freq] Nothing 1 (Special 0) NoId---- | backward compatibility------ GlitchRHPF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE-glitchRHPF :: Ugen -> Ugen -> Ugen -> Ugen-glitchRHPF in_ freq rq = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "GlitchRHPF" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | Calculate a single DFT bin, to detect presence of a frequency------ Goertzel [ControlRate] in=0 bufsize=1024 freq=0 hop=1-goertzel :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-goertzel rate in_ bufsize freq hop = mkUgen Nothing [ControlRate] (Left rate) "Goertzel" [in_,bufsize,freq,hop] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ GrainBufJ [AudioRate] numChannels=1 trigger=0 dur=1 sndbuf=0 rate=1 pos=0 loop=0 interp=2 grainAmp=1 pan=0 envbufnum=-1 maxGrains=512-grainBufJ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-grainBufJ rate numChannels trigger dur sndbuf rate_ pos loop interp grainAmp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left rate) "GrainBufJ" [numChannels,trigger,dur,sndbuf,rate_,pos,loop,interp,grainAmp,pan,envbufnum,maxGrains] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ GrainFMJ [AudioRate] numChannels=1 trigger=0 dur=1 carfreq=440 modfreq=200 index=1 grainAmp=1 pan=0 envbufnum=-1 maxGrains=512-grainFMJ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-grainFMJ rate numChannels trigger dur carfreq modfreq index_ grainAmp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left rate) "GrainFMJ" [numChannels,trigger,dur,carfreq,modfreq,index_,grainAmp,pan,envbufnum,maxGrains] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ GrainInJ [AudioRate] numChannels=1 trigger=0 dur=1 in=0 grainAmp=1 pan=0 envbufnum=-1 maxGrains=512-grainInJ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-grainInJ rate numChannels trigger dur in_ grainAmp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left rate) "GrainInJ" [numChannels,trigger,dur,in_,grainAmp,pan,envbufnum,maxGrains] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ GrainSinJ [AudioRate] numChannels=1 trigger=0 dur=1 freq=440 grainAmp=1 pan=0 envbufnum=-1 maxGrains=512-grainSinJ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-grainSinJ rate numChannels trigger dur freq grainAmp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left rate) "GrainSinJ" [numChannels,trigger,dur,freq,grainAmp,pan,envbufnum,maxGrains] Nothing 1 (Special 0) NoId---- | dynamical system simulation (Newtonian gravitational force)------ GravityGrid [AudioRate] reset=0 rate=0.1 newx=0 newy=0 bufnum=0-gravityGrid :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gravityGrid rate reset rate_ newx newy bufnum = mkUgen Nothing [AudioRate] (Left rate) "GravityGrid" [reset,rate_,newx,newy,bufnum] Nothing 1 (Special 0) NoId---- | dynamical system simulation (Newtonian gravitational force)------ GravityGrid2 [AudioRate] reset=0 rate=0.1 newx=0 newy=0 bufnum=0-gravityGrid2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-gravityGrid2 rate reset rate_ newx newy bufnum = mkUgen Nothing [AudioRate] (Left rate) "GravityGrid2" [reset,rate_,newx,newy,bufnum] Nothing 1 (Special 0) NoId---- | algorithmic delay------ GreyholeRaw [AudioRate] in1=0 in2=0 damping=0 delaytime=2 diffusion=0.5 feedback=0.9 moddepth=0.1 modfreq=2 size=1; FILTER: TRUE-greyholeRaw :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-greyholeRaw in1 in2 damping delaytime diffusion feedback moddepth modfreq size = mkUgen Nothing [AudioRate] (Right [0,1]) "GreyholeRaw" [in1,in2,damping,delaytime,diffusion,feedback,moddepth,modfreq,size] Nothing 2 (Special 0) NoId---- | Simple cochlear hair cell model------ HairCell [ControlRate,AudioRate] input=0 spontaneousrate=0 boostrate=200 restorerate=1000 loss=0.99; FILTER: TRUE-hairCell :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-hairCell input spontaneousrate boostrate restorerate loss = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "HairCell" [input,spontaneousrate,boostrate,restorerate,loss] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ HarmonicOsc [ControlRate,AudioRate] freq=100 firstharmonic=1 *amplitudes=0; MCE=1-harmonicOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-harmonicOsc rate freq firstharmonic amplitudes = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "HarmonicOsc" [freq,firstharmonic] (Just [amplitudes]) 1 (Special 0) NoId---- | henon map 2D chaotic generator------ Henon2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1.4 b=0.3 x0=0.30502 y0=0.20939-henon2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-henon2DC rate minfreq maxfreq a b x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Henon2DC" [minfreq,maxfreq,a,b,x0,y0] Nothing 1 (Special 0) NoId---- | henon map 2D chaotic generator------ Henon2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1.4 b=0.3 x0=0.30502 y0=0.20939-henon2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-henon2DL rate minfreq maxfreq a b x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Henon2DL" [minfreq,maxfreq,a,b,x0,y0] Nothing 1 (Special 0) NoId---- | henon map 2D chaotic generator------ Henon2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1.4 b=0.3 x0=0.30502 y0=0.20939-henon2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-henon2DN rate minfreq maxfreq a b x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Henon2DN" [minfreq,maxfreq,a,b,x0,y0] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ HenonTrig [ControlRate,AudioRate] minfreq=5 maxfreq=10 a=1.4 b=0.3 x0=0.30502 y0=0.20939-henonTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-henonTrig rate minfreq maxfreq a b x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "HenonTrig" [minfreq,maxfreq,a,b,x0,y0] Nothing 1 (Special 0) NoId---- | Transform a cepstrum back to a spectrum------ ICepstrum [] cepchain=0 fftbuf=0-iCepstrum :: Rate -> Ugen -> Ugen -> Ugen-iCepstrum rate cepchain fftbuf = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "ICepstrum" [cepchain,fftbuf] Nothing 1 (Special 0) NoId---- | 24db/oct rolloff, 4nd order resonant Low Pass Filter------ IirFilter [AudioRate] in=0 freq=440 rq=1; FILTER: TRUE-iirFilter :: Ugen -> Ugen -> Ugen -> Ugen-iirFilter in_ freq rq = mkUgen Nothing [AudioRate] (Right [0]) "IirFilter" [in_,freq,rq] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ InGrain [AudioRate] trigger=0 dur=1 in=0-inGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-inGrain rate trigger dur in_ = mkUgen Nothing [AudioRate] (Left rate) "InGrain" [trigger,dur,in_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ InGrainB [AudioRate] trigger=0 dur=1 in=0 envbuf=0-inGrainB :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-inGrainB rate trigger dur in_ envbuf = mkUgen Nothing [AudioRate] (Left rate) "InGrainB" [trigger,dur,in_,envbuf] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ InGrainBBF [AudioRate] trigger=0 dur=1 in=0 envbuf=0 azimuth=0 elevation=0 rho=1 wComp=0-inGrainBBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-inGrainBBF rate trigger dur in_ envbuf azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "InGrainBBF" [trigger,dur,in_,envbuf,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ InGrainBF [AudioRate] trigger=0 dur=1 in=0 azimuth=0 elevation=0 rho=1 wComp=0-inGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-inGrainBF rate trigger dur in_ azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "InGrainBF" [trigger,dur,in_,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ InGrainI [AudioRate] trigger=0 dur=1 in=0 envbuf1=0 envbuf2=0 ifac=0.5-inGrainI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-inGrainI rate trigger dur in_ envbuf1 envbuf2 ifac = mkUgen Nothing [AudioRate] (Left rate) "InGrainI" [trigger,dur,in_,envbuf1,envbuf2,ifac] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ InGrainIBF [AudioRate] trigger=0 dur=1 in=0 envbuf1=0 envbuf2=0 ifac=0.5 azimuth=0 elevation=0 rho=1 wComp=0-inGrainIBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-inGrainIBF rate trigger dur in_ envbuf1 envbuf2 ifac azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "InGrainIBF" [trigger,dur,in_,envbuf1,envbuf2,ifac,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | Distortion by subtracting magnitude from 1------ InsideOut [ControlRate,AudioRate] in=0-insideOut :: Rate -> Ugen -> Ugen-insideOut rate in_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "InsideOut" [in_] Nothing 1 (Special 0) NoId---- | instruction synthesis (breakpoint set interpreter)------ Instruction [AudioRate] bufnum=0-instruction :: Rate -> Ugen -> Ugen-instruction rate bufnum = mkUgen Nothing [AudioRate] (Left rate) "Instruction" [bufnum] Nothing 1 (Special 0) NoId---- | Raw version of the JPverb algorithmic reverberator, designed to produce long tails with chorusing------ JPverbRaw [ControlRate,AudioRate] in1=0 in2=0 damp=0 earlydiff=0.707 highband=2000 highx=1 lowband=500 lowx=1 mdepth=0.1 mfreq=2 midx=1 size=1 t60=1; FILTER: TRUE-jPverbRaw :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-jPverbRaw in1 in2 damp earlydiff highband highx lowband lowx mdepth mfreq midx size t60 = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "JPverbRaw" [in1,in2,damp,earlydiff,highband,highx,lowband,lowx,mdepth,mfreq,midx,size,t60] Nothing 2 (Special 0) NoId---- | k-means classification in real time------ KMeansRT [ControlRate] bufnum=0 inputdata=0 k=5 gate=1 reset=0 learn=1-kMeansRT :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-kMeansRT rate bufnum inputdata k gate_ reset learn = mkUgen Nothing [ControlRate] (Left rate) "KMeansRT" [bufnum,inputdata,k,gate_,reset,learn] Nothing 1 (Special 0) NoId---- | Running score of maximum correlation of chromagram with key profiles------ KeyClarity [ControlRate] chain=0 keydecay=2 chromaleak=0.5-keyClarity :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-keyClarity rate chain keydecay chromaleak = mkUgen Nothing [ControlRate] (Left rate) "KeyClarity" [chain,keydecay,chromaleak] Nothing 1 (Special 0) NoId---- | Find best correlated key mode with chromagram between major, minor and chromatic cluster------ KeyMode [ControlRate] chain=0 keydecay=2 chromaleak=0.5-keyMode :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-keyMode rate chain keydecay chromaleak = mkUgen Nothing [ControlRate] (Left rate) "KeyMode" [chain,keydecay,chromaleak] Nothing 1 (Special 0) NoId---- | K-means Oscillator------ KmeansToBPSet1 [AudioRate] freq=440 numdatapoints=20 maxnummeans=4 nummeans=4 tnewdata=1 tnewmeans=1 soft=1 bufnum=0-kmeansToBPSet1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-kmeansToBPSet1 rate freq numdatapoints maxnummeans nummeans tnewdata tnewmeans soft bufnum = mkUgen Nothing [AudioRate] (Left rate) "KmeansToBPSet1" [freq,numdatapoints,maxnummeans,nummeans,tnewdata,tnewmeans,soft,bufnum] Nothing 1 (Special 0) NoId--{---- | Run any LADSPA plugin inside SuperCollider------ LADSPA [AudioRate] nChans=0 id=0 args=0-ladspa :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-ladspa rate nChans id_ args = mkUgen Nothing [AudioRate] (Left rate) "LADSPA" [nChans,id_,args] Nothing 0 (Special 0) NoId--}---- | random walk step------ LFBrownNoise0 [ControlRate,AudioRate] freq=20 dev=1 dist=0; NONDET-lfBrownNoise0Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen-lfBrownNoise0Id z rate freq dev dist = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFBrownNoise0" [freq,dev,dist] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFBrownNoise0.-lfBrownNoise0M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> m Ugen-lfBrownNoise0M = liftUid4 lfBrownNoise0Id---- | Unsafe variant of LFBrownNoise0.-lfBrownNoise0 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-lfBrownNoise0 = liftUnsafe4 lfBrownNoise0M---- | random walk linear interp------ LFBrownNoise1 [ControlRate,AudioRate] freq=20 dev=1 dist=0; NONDET-lfBrownNoise1Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen-lfBrownNoise1Id z rate freq dev dist = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFBrownNoise1" [freq,dev,dist] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFBrownNoise1.-lfBrownNoise1M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> m Ugen-lfBrownNoise1M = liftUid4 lfBrownNoise1Id---- | Unsafe variant of LFBrownNoise1.-lfBrownNoise1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-lfBrownNoise1 = liftUnsafe4 lfBrownNoise1M---- | random walk cubic interp------ LFBrownNoise2 [ControlRate,AudioRate] freq=20 dev=1 dist=0; NONDET-lfBrownNoise2Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen-lfBrownNoise2Id z rate freq dev dist = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LFBrownNoise2" [freq,dev,dist] Nothing 1 (Special 0) (toUid z)---- | Monad variant of LFBrownNoise2.-lfBrownNoise2M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> m Ugen-lfBrownNoise2M = liftUid4 lfBrownNoise2Id---- | Unsafe variant of LFBrownNoise2.-lfBrownNoise2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-lfBrownNoise2 = liftUnsafe4 lfBrownNoise2M---- | Live Linear Predictive Coding Analysis and Resynthesis------ LPCAnalyzer [AudioRate] input=0 source=0.01 n=256 p=10 testE=0 delta=0.999 windowtype=0; FILTER: TRUE-lpcAnalyzer :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lpcAnalyzer input source n p testE delta windowtype = mkUgen Nothing [AudioRate] (Right [0,1]) "LPCAnalyzer" [input,source,n,p,testE,delta,windowtype] Nothing 1 (Special 0) NoId---- | Linear Predictive Coding Gone Wrong------ LPCError [AudioRate] input=0 p=10-lpcError :: Rate -> Ugen -> Ugen -> Ugen-lpcError rate input p = mkUgen Nothing [AudioRate] (Left rate) "LPCError" [input,p] Nothing 1 (Special 0) NoId---- | Utilize LPC data------ LPCSynth [AudioRate] buffer=0 signal=0 pointer=0-lpcSynth :: Ugen -> Ugen -> Ugen -> Ugen-lpcSynth buffer signal pointer = mkUgen Nothing [AudioRate] (Left AudioRate) "LPCSynth" [buffer,signal,pointer] Nothing 1 (Special 0) NoId---- | Utilize LPC data------ LPCVals [ControlRate,AudioRate] buffer=0 pointer=0-lpcVals :: Ugen -> Ugen -> Ugen-lpcVals buffer pointer = mkUgen Nothing [ControlRate,AudioRate] (Left AudioRate) "LPCVals" [buffer,pointer] Nothing 3 (Special 0) NoId---- | (Undocumented class)------ LPF1 [ControlRate,AudioRate] in=0 freq=1000-lpf1 :: Rate -> Ugen -> Ugen -> Ugen-lpf1 rate in_ freq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LPF1" [in_,freq] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ LPF18 [AudioRate] in=0 freq=100 res=1 dist=0.4-lpf18 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lpf18 rate in_ freq res dist = mkUgen Nothing [AudioRate] (Left rate) "LPF18" [in_,freq,res,dist] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ LPFVS6 [ControlRate,AudioRate] in=0 freq=1000 slope=0.5-lpfvs6 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-lpfvs6 rate in_ freq slope_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LPFVS6" [in_,freq,slope_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ LPG [AudioRate] input=0 controlinput=0 controloffset=0 controlscale=1 vca=1 resonance=1.5 lowpassmode=1 linearity=1; FILTER: TRUE-lpg :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lpg input controlinput controloffset controlscale vca resonance lowpassmode linearity = mkUgen Nothing [AudioRate] (Right [0]) "LPG" [input,controlinput,controloffset,controlscale,vca,resonance,lowpassmode,linearity] Nothing 1 (Special 0) NoId---- | Linear Time Invariant General Filter Equation------ LTI [AudioRate] input=0 bufnuma=0 bufnumb=1-lti :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-lti rate input bufnuma bufnumb = mkUgen Nothing [AudioRate] (Left rate) "LTI" [input,bufnuma,bufnumb] Nothing 1 (Special 0) NoId---- | latoocarfian 2D chaotic generator------ Latoocarfian2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1 b=3 c=0.5 d=0.5 x0=0.34082 y0=-0.3827-latoocarfian2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-latoocarfian2DC rate minfreq maxfreq a b c d x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Latoocarfian2DC" [minfreq,maxfreq,a,b,c,d,x0,y0] Nothing 1 (Special 0) NoId---- | latoocarfian 2D chaotic generator------ Latoocarfian2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1 b=3 c=0.5 d=0.5 x0=0.34082 y0=-0.3827-latoocarfian2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-latoocarfian2DL rate minfreq maxfreq a b c d x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Latoocarfian2DL" [minfreq,maxfreq,a,b,c,d,x0,y0] Nothing 1 (Special 0) NoId---- | latoocarfian 2D chaotic generator------ Latoocarfian2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1 b=3 c=0.5 d=0.5 x0=0.34082 y0=-0.3827-latoocarfian2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-latoocarfian2DN rate minfreq maxfreq a b c d x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Latoocarfian2DN" [minfreq,maxfreq,a,b,c,d,x0,y0] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ LatoocarfianTrig [ControlRate,AudioRate] minfreq=5 maxfreq=10 a=1 b=3 c=0.5 d=0.5 x0=0.34082 y0=-0.3827-latoocarfianTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-latoocarfianTrig rate minfreq maxfreq a b c d x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LatoocarfianTrig" [minfreq,maxfreq,a,b,c,d,x0,y0] Nothing 1 (Special 0) NoId---- | Emit a sequence of triggers at specified time offsets------ ListTrig [ControlRate] bufnum=0 reset=0 offset=0 numframes=0-listTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-listTrig rate bufnum reset offset numframes = mkUgen Nothing [ControlRate] (Left rate) "ListTrig" [bufnum,reset,offset,numframes] Nothing 1 (Special 0) NoId---- | Emit a sequence of triggers at specified time offsets------ ListTrig2 [ControlRate] bufnum=0 reset=0 numframes=0-listTrig2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-listTrig2 rate bufnum reset numframes = mkUgen Nothing [ControlRate] (Left rate) "ListTrig2" [bufnum,reset,numframes] Nothing 1 (Special 0) NoId---- | Store values to a buffer, whenever triggered------ Logger [ControlRate] inputArray=0 trig=0 bufnum=0 reset=0-logger :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-logger rate inputArray trig_ bufnum reset = mkUgen Nothing [ControlRate] (Left rate) "Logger" [inputArray,trig_,bufnum,reset] Nothing 1 (Special 0) NoId---- | sample looping oscillator------ LoopBuf [AudioRate] bufnum=0 rate=1 gate=1 startPos=0 startLoop=0 endLoop=0 interpolation=2; NC INPUT: True-loopBuf :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-loopBuf numChannels rate bufnum rate_ gate_ startPos startLoop endLoop interpolation = mkUgen Nothing [AudioRate] (Left rate) "LoopBuf" [bufnum,rate_,gate_,startPos,startLoop,endLoop,interpolation] Nothing numChannels (Special 0) NoId---- | lorenz 2D chaotic generator------ Lorenz2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 s=10 r=28 b=2.66667 h=0.02 x0=0.09088 y0=2.97077 z0=24.28204-lorenz2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lorenz2DC rate minfreq maxfreq s r b h x0 y0 z0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Lorenz2DC" [minfreq,maxfreq,s,r,b,h,x0,y0,z0] Nothing 1 (Special 0) NoId---- | lorenz 2D chaotic generator------ Lorenz2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 s=10 r=28 b=2.66667 h=0.02 x0=0.09088 y0=2.97077 z0=24.28204-lorenz2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lorenz2DL rate minfreq maxfreq s r b h x0 y0 z0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Lorenz2DL" [minfreq,maxfreq,s,r,b,h,x0,y0,z0] Nothing 1 (Special 0) NoId---- | lorenz 2D chaotic generator------ Lorenz2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 s=10 r=28 b=2.66667 h=0.02 x0=0.09088 y0=2.97077 z0=24.28204-lorenz2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lorenz2DN rate minfreq maxfreq s r b h x0 y0 z0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Lorenz2DN" [minfreq,maxfreq,s,r,b,h,x0,y0,z0] Nothing 1 (Special 0) NoId---- | lorenz chaotic trigger generator------ LorenzTrig [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 s=10 r=28 b=2.66667 h=0.02 x0=0.09088 y0=2.97077 z0=24.28204-lorenzTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lorenzTrig rate minfreq maxfreq s r b h x0 y0 z0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "LorenzTrig" [minfreq,maxfreq,s,r,b,h,x0,y0,z0] Nothing 1 (Special 0) NoId---- | simple resonating lowpass filter------ Lores [AudioRate] in=0 freq=880 res=0.5; FILTER: TRUE-lores :: Ugen -> Ugen -> Ugen -> Ugen-lores in_ freq res = mkUgen Nothing [AudioRate] (Right [0]) "Lores" [in_,freq,res] Nothing 1 (Special 0) NoId---- | 2-species Predator-Prey model------ LotkaVolterra [AudioRate] freq=22050 a=1.5 b=1.5 c=0.5 d=1.5 h=0.05 xi=1 yi=0.2-lotkaVolterra :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-lotkaVolterra rate freq a b c d h xi yi = mkUgen Nothing [AudioRate] (Left rate) "LotkaVolterra" [freq,a,b,c,d,h,xi,yi] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ MCLDChaosGen [] maxSize=0-mcldChaosGen :: Rate -> Ugen -> Ugen-mcldChaosGen rate maxSize = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "MCLDChaosGen" [maxSize] Nothing 1 (Special 0) NoId---- | POKEY Chip Sound Simulator------ MZPokey [AudioRate] audf1=0 audc1=0 audf2=0 audc2=0 audf3=0 audc3=0 audf4=0 audc4=0 audctl=0-mzPokey :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-mzPokey rate audf1 audc1 audf2 audc2 audf3 audc3 audf4 audc4 audctl = mkUgen Nothing [AudioRate] (Left rate) "MZPokey" [audf1,audc1,audf2,audc2,audf3,audc3,audf4,audc4,audctl] Nothing 1 (Special 0) NoId---- | First order Markov Chain implementation for audio signals------ MarkovSynth [AudioRate] in=0 isRecording=1 waitTime=2 tableSize=10-markovSynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-markovSynth rate in_ isRecording waitTime tableSize = mkUgen Nothing [AudioRate] (Left rate) "MarkovSynth" [in_,isRecording,waitTime,tableSize] Nothing 1 (Special 0) NoId---- | Real time sparse representation------ MatchingP [ControlRate,AudioRate] dict=0 in=0 dictsize=1 ntofind=1 hop=1 method=0-matchingP :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-matchingP rate dict in_ dictsize ntofind hop method = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "MatchingP" [dict,in_,dictsize,ntofind,hop,method] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ MatchingPResynth [ControlRate,AudioRate] dict=0 method=0 trigger=0 residual=0 activs=0-matchingPResynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-matchingPResynth rate dict method trigger residual activs = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "MatchingPResynth" [dict,method,trigger,residual,activs] Nothing 1 (Special 0) NoId---- | maximum within last x samples------ Max [ControlRate] in=0 numsamp=64-max :: Rate -> Ugen -> Ugen -> Ugen-max rate in_ numsamp = mkUgen Nothing [ControlRate] (Left rate) "Max" [in_,numsamp] Nothing 1 (Special 0) NoId---- | Tracks and prints amplitudes------ Maxamp [AudioRate] in=0 numSamps=1000-maxamp :: Rate -> Ugen -> Ugen -> Ugen-maxamp rate in_ numSamps = mkUgen Nothing [AudioRate] (Left rate) "Maxamp" [in_,numSamps] Nothing 1 (Special 0) NoId---- | Piano synthesiser------ MdaPiano [AudioRate] freq=440 gate=1 vel=100 decay=0.8 release=0.8 hard=0.8 velhard=0.8 muffle=0.8 velmuff=0.8 velcurve=0.8 stereo=0.2 tune=0.5 random=0.1 stretch=0.1 sustain=0-mdaPiano :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-mdaPiano rate freq gate_ vel decay_ release hard velhard muffle velmuff velcurve stereo tune random stretch sustain = mkUgen Nothing [AudioRate] (Left rate) "MdaPiano" [freq,gate_,vel,decay_,release,hard,velhard,muffle,velmuff,velcurve,stereo,tune,random,stretch,sustain] Nothing 2 (Special 0) NoId---- | Mean of recent values, triggered------ MeanTriggered [ControlRate,AudioRate] in=0 trig=0 length=10-meanTriggered :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-meanTriggered rate in_ trig_ length_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "MeanTriggered" [in_,trig_,length_] Nothing 1 (Special 0) NoId---- | Meddis cochlear hair cell model------ Meddis [ControlRate,AudioRate] input=0; FILTER: TRUE-meddis :: Ugen -> Ugen-meddis input = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Meddis" [input] Nothing 1 (Special 0) NoId---- | Separate harmonic and percussive parts of a signal------ MedianSeparation [] fft=0 fftharmonic=0 fftpercussive=0 fftsize=1024 mediansize=17 hardorsoft=0 p=2 medianormax=0-medianSeparation :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-medianSeparation rate fft_ fftharmonic fftpercussive fftsize mediansize hardorsoft p medianormax = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "MedianSeparation" [fft_,fftharmonic,fftpercussive,fftsize,mediansize,hardorsoft,p,medianormax] Nothing 2 (Special 0) NoId---- | Median of recent values, triggered------ MedianTriggered [ControlRate,AudioRate] in=0 trig=0 length=10-medianTriggered :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-medianTriggered rate in_ trig_ length_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "MedianTriggered" [in_,trig_,length_] Nothing 1 (Special 0) NoId---- | Waveguide mesh physical models of drum membranes------ MembraneCircle [AudioRate] excitation=0 tension=0.05 loss=0.99999-membraneCircle :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-membraneCircle rate excitation tension loss = mkUgen Nothing [AudioRate] (Left rate) "MembraneCircle" [excitation,tension,loss] Nothing 1 (Special 0) NoId---- | Waveguide mesh physical models of drum membranes------ MembraneHexagon [AudioRate] excitation=0 tension=0.05 loss=0.99999-membraneHexagon :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-membraneHexagon rate excitation tension loss = mkUgen Nothing [AudioRate] (Left rate) "MembraneHexagon" [excitation,tension,loss] Nothing 1 (Special 0) NoId---- | Metronome------ Metro [ControlRate,AudioRate] bpm=0 numBeats=0-metro :: Rate -> Ugen -> Ugen -> Ugen-metro rate bpm numBeats = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Metro" [bpm,numBeats] Nothing 1 (Special 0) NoId---- | a macro oscillator------ MiBraids [AudioRate] pitch=60 timbre=0.5 color=0.5 model=0 trig=0 resamp=0 decim=0 bits=0 ws=0-miBraids :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miBraids rate pitch_ timbre color model trig_ resamp decim bits ws = mkUgen Nothing [AudioRate] (Left rate) "MiBraids" [pitch_,timbre,color,model,trig_,resamp,decim,bits,ws] Nothing 1 (Special 0) NoId---- | granular audio processor and texture synthesizer------ MiClouds [AudioRate] pit=0 pos=0.5 size=0.25 dens=0.4 tex=0.5 drywet=0.5 in_gain=1 spread=0.5 rvb=0 fb=0 freeze=0 mode=0 lofi=0 trig=0 *inputArray=0; MCE=1, REORDERS INPUTS: [14,0,1,2,3,4,5,6,7,8,9,10,11,12,13]-miClouds :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miClouds rate pit pos size dens tex drywet in_gain spread rvb fb freeze mode lofi trig_ inputArray = mkUgen Nothing [AudioRate] (Left rate) "MiClouds" [pit,pos,size,dens,tex,drywet,in_gain,spread,rvb,fb,freeze,mode,lofi,trig_] (Just [inputArray]) 2 (Special 0) NoId---- | Physical modelling based on Modal Synthesis.------ MiElements [AudioRate] blow_in=0 strike_in=0 gate=0 pit=48 strength=0.5 contour=0.2 bow_level=0 blow_level=0 strike_level=0 flow=0.5 mallet=0.5 bow_timb=0.5 blow_timb=0.5 strike_timb=0.5 geom=0.25 bright=0.5 damp=0.7 pos=0.2 space=0.3 model=0 easteregg=0-miElements :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miElements rate blow_in strike_in gate_ pit strength contour bow_level blow_level strike_level flow mallet bow_timb blow_timb strike_timb geom bright damp pos space model easteregg = mkUgen Nothing [AudioRate] (Left rate) "MiElements" [blow_in,strike_in,gate_,pit,strength,contour,bow_level,blow_level,strike_level,flow,mallet,bow_timb,blow_timb,strike_timb,geom,bright,damp,pos,space,model,easteregg] Nothing 2 (Special 0) NoId---- | topographic drum sequencer------ MiGrids [AudioRate] bpm=120 map_x=0.5 map_y=0.5 chaos=0 bd_density=0.25 sd_density=0.25 hh_density=0.25 mode=1 swing=0 config=0-miGrids :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miGrids rate bpm map_x map_y chaos bd_density sd_density hh_density mode swing config = mkUgen Nothing [AudioRate] (Left rate) "MiGrids" [bpm,map_x,map_y,chaos,bd_density,sd_density,hh_density,mode,swing,config] Nothing 6 (Special 0) NoId---- | µ-law audio companding------ MiMu [AudioRate] in=0 gain=1 bypass=0-miMu :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-miMu rate in_ gain bypass = mkUgen Nothing [AudioRate] (Left rate) "MiMu" [in_,gain,bypass] Nothing 1 (Special 0) NoId---- | FM Synth-Voice based on 'ominous'------ MiOmi [AudioRate] audio_in=0 gate=0 pit=48 contour=0.2 detune=0.25 level1=0.5 level2=0.5 ratio1=0.5 ratio2=0.5 fm1=0 fm2=0 fb=0 xfb=0 filter_mode=0 cutoff=0.5 reson=0 strength=0.5 env=0.5 rotate=0.2 space=0.5-miOmi :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miOmi rate audio_in gate_ pit contour detune level1 level2 ratio1 ratio2 fm1 fm2 fb xfb filter_mode cutoff reson strength env rotate_ space = mkUgen Nothing [AudioRate] (Left rate) "MiOmi" [audio_in,gate_,pit,contour,detune,level1,level2,ratio1,ratio2,fm1,fm2,fb,xfb,filter_mode,cutoff,reson,strength,env,rotate_,space] Nothing 2 (Special 0) NoId---- | a macro oscillator------ MiPlaits [AudioRate] pitch=60 engine=0 harm=0.1 timbre=0.5 morph=0.5 trigger=0 level=0 fm_mod=0 timb_mod=0 morph_mod=0 decay=0.5 lpg_colour=0.5-miPlaits :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miPlaits rate pitch_ engine harm timbre morph trigger level fm_mod timb_mod morph_mod decay_ lpg_colour = mkUgen Nothing [AudioRate] (Left rate) "MiPlaits" [pitch_,engine,harm,timbre,morph,trigger,level,fm_mod,timb_mod,morph_mod,decay_,lpg_colour] Nothing 2 (Special 0) NoId---- | a resonator------ MiRings [AudioRate] in=0 trig=0 pit=60 struct=0.25 bright=0.5 damp=0.7 pos=0.25 model=0 poly=1 intern_exciter=0 easteregg=0 bypass=0-miRings :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miRings rate in_ trig_ pit struct bright damp pos model poly intern_exciter easteregg bypass = mkUgen Nothing [AudioRate] (Left rate) "MiRings" [in_,trig_,pit,struct,bright,damp,pos,model,poly,intern_exciter,easteregg,bypass] Nothing 2 (Special 0) NoId---- | Classic resonant LP filter------ MiRipples [AudioRate] in=0 cf=0.3 reson=0.2 drive=1; FILTER: TRUE-miRipples :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miRipples in_ cf reson drive = mkUgen Nothing [AudioRate] (Right [0]) "MiRipples" [in_,cf,reson,drive] Nothing 1 (Special 0) NoId---- | a quad LFO------ MiTides [AudioRate] freq=1 shape=0.5 slope=0.5 smooth=0.5 shift=0.2 trig=0 clock=0 output_mode=3 ramp_mode=1 ratio=9 rate=1-miTides :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miTides rate freq shape slope_ smooth shift trig_ clock output_mode ramp_mode ratio rate_ = mkUgen Nothing [AudioRate] (Left rate) "MiTides" [freq,shape,slope_,smooth,shift,trig_,clock,output_mode,ramp_mode,ratio,rate_] Nothing 4 (Special 0) NoId---- | stereo reverb------ MiVerb [AudioRate] time=0.7 drywet=0.5 damp=0.5 hp=0.05 freeze=0 diff=0.625 *inputArray=0; MCE=1, FILTER: TRUE, REORDERS INPUTS: [6,0,1,2,3,4,5]-miVerb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miVerb time drywet damp hp freeze diff inputArray = mkUgen Nothing [AudioRate] (Right [6]) "MiVerb" [time,drywet,damp,hp,freeze,diff] (Just [inputArray]) 2 (Special 0) NoId---- | a meta modulator------ MiWarps [AudioRate] carrier=0 modulator=0 lev1=0.5 lev2=0.5 algo=0 timb=0 osc=0 freq=110 vgain=1 easteregg=0-miWarps :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-miWarps rate carrier modulator lev1 lev2 algo timb osc_ freq vgain easteregg = mkUgen Nothing [AudioRate] (Left rate) "MiWarps" [carrier,modulator,lev1,lev2,algo,timb,osc_,freq,vgain,easteregg] Nothing 2 (Special 0) NoId---- | Granulates real-time input------ MonoGrain [AudioRate] in=0 winsize=0.1 grainrate=10 winrandpct=0-monoGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-monoGrain rate in_ winsize grainrate winrandpct = mkUgen Nothing [AudioRate] (Left rate) "MonoGrain" [in_,winsize,grainrate,winrandpct] Nothing 1 (Special 0) NoId---- | Granulates real-time input with Ambisonic panning------ MonoGrainBF [AudioRate] in=0 winsize=0.1 grainrate=10 winrandpct=0 azimuth=0 azrand=0 elevation=0 elrand=0 rho=1-monoGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-monoGrainBF rate in_ winsize grainrate winrandpct azimuth azrand elevation elrand rho = mkUgen Nothing [AudioRate] (Left rate) "MonoGrainBF" [in_,winsize,grainrate,winrandpct,azimuth,azrand,elevation,elrand,rho] Nothing 4 (Special 0) NoId---- | Moog Filter Emulation------ MoogLadder [ControlRate,AudioRate] in=0 ffreq=440 res=0; FILTER: TRUE-moogLadder :: Ugen -> Ugen -> Ugen -> Ugen-moogLadder in_ ffreq res = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "MoogLadder" [in_,ffreq,res] Nothing 1 (Special 0) NoId---- | Moog filter emulation------ MoogVCF [AudioRate] in=0 fco=0 res=0; FILTER: TRUE-moogVCF :: Ugen -> Ugen -> Ugen -> Ugen-moogVCF in_ fco res = mkUgen Nothing [AudioRate] (Right [0]) "MoogVCF" [in_,fco,res] Nothing 1 (Special 0) NoId---- | Stereo reverb------ NHHall [AudioRate] in1=0.0 in2=0.0 rt60=1.0 stereo=0.5 lowFreq=200.0 lowRatio=0.5 hiFreq=4000.0 hiRatio=0.5 earlyDiffusion=0.5 lateDiffusion=0.5 modRate=0.2 modDepth=0.3-nhHall :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nhHall in1 in2 rt60 stereo lowFreq lowRatio hiFreq hiRatio earlyDiffusion lateDiffusion modRate modDepth = mkUgen Nothing [AudioRate] (Right [0,1]) "NHHall" [in1,in2,rt60,stereo,lowFreq,lowRatio,hiFreq,hiRatio,earlyDiffusion,lateDiffusion,modRate,modDepth] Nothing 2 (Special 0) NoId---- | Non Linear Filter Equation------ NL [AudioRate] input=0 bufnuma=0 bufnumb=1 guard1=1000 guard2=100-nl :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nl rate input bufnuma bufnumb guard1 guard2 = mkUgen Nothing [AudioRate] (Left rate) "NL" [input,bufnuma,bufnumb,guard1,guard2] Nothing 1 (Special 0) NoId---- | Arbitrary Non Linear Filter Equation------ NL2 [AudioRate] input=0 bufnum=0 maxsizea=10 maxsizeb=10 guard1=1000 guard2=100-nl2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nl2 rate input bufnum maxsizea maxsizeb guard1 guard2 = mkUgen Nothing [AudioRate] (Left rate) "NL2" [input,bufnum,maxsizea,maxsizeb,guard1,guard2] Nothing 1 (Special 0) NoId---- | Non-linear Filter------ NLFiltC [ControlRate,AudioRate] input=0 a=0 b=0 d=0 c=0 l=0-nlFiltC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nlFiltC rate input a b d c l = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "NLFiltC" [input,a,b,d,c,l] Nothing 1 (Special 0) NoId---- | Non-linear Filter------ NLFiltL [ControlRate,AudioRate] input=0 a=0 b=0 d=0 c=0 l=0-nlFiltL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nlFiltL rate input a b d c l = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "NLFiltL" [input,a,b,d,c,l] Nothing 1 (Special 0) NoId---- | Non-linear Filter------ NLFiltN [ControlRate,AudioRate] input=0 a=0 b=0 d=0 c=0 l=0-nlFiltN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nlFiltN rate input a b d c l = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "NLFiltN" [input,a,b,d,c,l] Nothing 1 (Special 0) NoId---- | physical modeling simulation; N tubes------ NTube [AudioRate] input=0 lossarray=1 karray=0 delaylengtharray=0-nTube :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nTube rate input lossarray karray delaylengtharray = mkUgen Nothing [AudioRate] (Left rate) "NTube" [input,lossarray,karray,delaylengtharray] Nothing 1 (Special 0) NoId---- | Find the nearest-neighbours in a set of points------ NearestN [ControlRate] treebuf=0 in=0 gate=1 num=1-nearestN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nearestN rate treebuf in_ gate_ num = mkUgen Nothing [ControlRate] (Left rate) "NearestN" [treebuf,in_,gate_,num] Nothing 3 (Special 0) NoId---- | (Undocumented class)------ NeedleRect [AudioRate] rate=1 imgWidth=100 imgHeight=100 rectX=0 rectY=0 rectW=100 rectH=100-needleRect :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-needleRect rate rate_ imgWidth imgHeight rectX rectY rectW rectH = mkUgen Nothing [AudioRate] (Left rate) "NeedleRect" [rate_,imgWidth,imgHeight,rectX,rectY,rectW,rectH] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ NeoFormant [ControlRate,AudioRate] formantfreq=100 carrierfreq=200 phaseshift=0.5-neoFormant :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-neoFormant rate formantfreq carrierfreq phaseshift = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "NeoFormant" [formantfreq,carrierfreq,phaseshift] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ NeoVarSawOsc [ControlRate,AudioRate] freq=100 pw=0.5 waveshape=0.5-neoVarSawOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-neoVarSawOsc rate freq pw waveshape = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "NeoVarSawOsc" [freq,pw,waveshape] Nothing 1 (Special 0) NoId---- | APU Chip Sound Simulator------ Nes2 [AudioRate] trig=0 a0=0 a1=0 a2=0 a3=0 b0=0 b1=0 b2=0 b3=0 c0=0 c2=0 c3=0 d0=0 d2=0 d3=0 e0=0 e1=0 e2=0 e3=0 smask=0-nes2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nes2 rate trig_ a0 a1 a2 a3 b0 b1 b2 b3 c0 c2 c3 d0 d2 d3 e0 e1 e2 e3 smask = mkUgen Nothing [AudioRate] (Left rate) "Nes2" [trig_,a0,a1,a2,a3,b0,b1,b2,b3,c0,c2,c3,d0,d2,d3,e0,e1,e2,e3,smask] Nothing 1 (Special 0) NoId---- | Nested Allpass filters as proposed by Vercoe and Pluckett------ NestedAllpassC [AudioRate] in=0 maxdelay1=0.036 delay1=0.036 gain1=0.08 maxdelay2=0.03 delay2=0.03 gain2=0.3; FILTER: TRUE-nestedAllpassC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nestedAllpassC in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 = mkUgen Nothing [AudioRate] (Right [0]) "NestedAllpassC" [in_,maxdelay1,delay1_,gain1,maxdelay2,delay2_,gain2] Nothing 1 (Special 0) NoId---- | Nested Allpass filters as proposed by Vercoe and Pluckett------ NestedAllpassL [AudioRate] in=0 maxdelay1=0.036 delay1=0.036 gain1=0.08 maxdelay2=0.03 delay2=0.03 gain2=0.3; FILTER: TRUE-nestedAllpassL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nestedAllpassL in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 = mkUgen Nothing [AudioRate] (Right [0]) "NestedAllpassL" [in_,maxdelay1,delay1_,gain1,maxdelay2,delay2_,gain2] Nothing 1 (Special 0) NoId---- | Nested Allpass filters as proposed by Vercoe and Pluckett------ NestedAllpassN [AudioRate] in=0 maxdelay1=0.036 delay1=0.036 gain1=0.08 maxdelay2=0.03 delay2=0.03 gain2=0.3; FILTER: TRUE-nestedAllpassN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-nestedAllpassN in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 = mkUgen Nothing [AudioRate] (Right [0]) "NestedAllpassN" [in_,maxdelay1,delay1_,gain1,maxdelay2,delay2_,gain2] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ OSFold4 [AudioRate] in=0 lo=0 hi=0-osFold4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-osFold4 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "OSFold4" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ OSFold8 [AudioRate] in=0 lo=0 hi=0-osFold8 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-osFold8 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "OSFold8" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ OSTrunc4 [AudioRate] in=0 quant=0.5-osTrunc4 :: Rate -> Ugen -> Ugen -> Ugen-osTrunc4 rate in_ quant = mkUgen Nothing [AudioRate] (Left rate) "OSTrunc4" [in_,quant] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ OSTrunc8 [AudioRate] in=0 quant=0.5-osTrunc8 :: Rate -> Ugen -> Ugen -> Ugen-osTrunc8 rate in_ quant = mkUgen Nothing [AudioRate] (Left rate) "OSTrunc8" [in_,quant] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ OSWrap4 [AudioRate] in=0 lo=0 hi=0-osWrap4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-osWrap4 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "OSWrap4" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ OSWrap8 [AudioRate] in=0 lo=0 hi=0-osWrap8 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-osWrap8 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "OSWrap8" [in_,lo,hi] Nothing 1 (Special 0) NoId---- | Extract basic statistics from a series of onset triggers------ OnsetStatistics [ControlRate] input=0 windowsize=1 hopsize=0.1-onsetStatistics :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-onsetStatistics rate input windowsize hopsize = mkUgen Nothing [ControlRate] (Left rate) "OnsetStatistics" [input,windowsize,hopsize] Nothing 3 (Special 0) NoId---- | Chemical reaction modelling Oscillator------ Oregonator [AudioRate] reset=0 rate=0.01 epsilon=1 mu=1 q=1 initx=0.5 inity=0.5 initz=0.5-oregonator :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-oregonator rate reset rate_ epsilon mu q initx inity initz = mkUgen Nothing [AudioRate] (Left rate) "Oregonator" [reset,rate_,epsilon,mu,q,initx,inity,initz] Nothing 3 (Special 0) NoId---- | (Undocumented class)------ OscBank [ControlRate,AudioRate] freq=100 gain=1 saw8=0.5 square8=0.5 saw4=0.5 square4=0.5 saw2=0.5 square2=0.5 saw1=0.5-oscBank :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-oscBank rate freq gain saw8 square8 saw4 square4 saw2 square2 saw1 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "OscBank" [freq,gain,saw8,square8,saw4,square4,saw2,square2,saw1] Nothing 1 (Special 0) NoId---- | Piano physical model.------ OteyPiano [AudioRate] freq=440 vel=1 t_gate=0 rmin=0.35 rmax=2 rampl=4 rampr=8 rcore=1 lmin=0.07 lmax=1.4 lampl=-4 lampr=4 rho=1 e=1 zb=1 zh=0 mh=1 k=0.2 alpha=1 p=1 hpos=0.142 loss=1 detune=0.0003 hammer_type=1-oteyPiano :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-oteyPiano rate freq vel t_gate rmin rmax rampl rampr rcore lmin lmax lampl lampr rho e zb zh mh k alpha p hpos loss detune hammer_type = mkUgen Nothing [AudioRate] (Left rate) "OteyPiano" [freq,vel,t_gate,rmin,rmax,rampl,rampr,rcore,lmin,lmax,lampl,lampr,rho,e,zb,zh,mh,k,alpha,p,hpos,loss,detune,hammer_type] Nothing 1 (Special 0) NoId---- | Piano physical model.------ OteyPianoStrings [AudioRate] freq=440 vel=1 t_gate=0 rmin=0.35 rmax=2 rampl=4 rampr=8 rcore=1 lmin=0.07 lmax=1.4 lampl=-4 lampr=4 rho=1 e=1 zb=1 zh=0 mh=1 k=0.2 alpha=1 p=1 hpos=0.142 loss=1 detune=0.0003 hammer_type=1-oteyPianoStrings :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-oteyPianoStrings rate freq vel t_gate rmin rmax rampl rampr rcore lmin lmax lampl lampr rho e zb zh mh k alpha p hpos loss detune hammer_type = mkUgen Nothing [AudioRate] (Left rate) "OteyPianoStrings" [freq,vel,t_gate,rmin,rmax,rampl,rampr,rcore,lmin,lmax,lampl,lampr,rho,e,zb,zh,mh,k,alpha,p,hpos,loss,detune,hammer_type] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ OteySoundBoard [AudioRate] inp=0 c1=20 c3=20 mix=0.8; FILTER: TRUE-oteySoundBoard :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-oteySoundBoard inp c1 c3 mix = mkUgen Nothing [AudioRate] (Right [0]) "OteySoundBoard" [inp,c1,c3,mix] Nothing 1 (Special 0) NoId---- | Return mag and freq data from a CSound pv------ PVInfo [ControlRate,AudioRate] pvbuffer=0 binNum=0 filePointer=0-pvInfo :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-pvInfo rate pvbuffer binNum filePointer = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "PVInfo" [pvbuffer,binNum,filePointer] Nothing 2 (Special 0) NoId---- | Resynthesize Csound PV data------ PVSynth [AudioRate] pvbuffer=0 numBins=0 binStart=0 binSkip=1 filePointer=0 freqMul=1 freqAdd=0-pvSynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pvSynth rate pvbuffer numBins binStart binSkip filePointer freqMul freqAdd = mkUgen Nothing [AudioRate] (Left rate) "PVSynth" [pvbuffer,numBins,binStart,binSkip,filePointer,freqMul,freqAdd] Nothing 1 (Special 0) NoId---- | Plays FFT data to a memory buffer------ PV_BinBufRd [ControlRate] buffer=0 playbuf=0 point=1 binStart=0 binSkip=1 numBins=1 clear=0-pv_BinBufRd :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_BinBufRd buffer playbuf_ point binStart binSkip numBins clear = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinBufRd" [buffer,playbuf_,point,binStart,binSkip,numBins,clear] Nothing 1 (Special 0) NoId---- | Delay and Feedback on a bin by bin basis.------ PV_BinDelay [ControlRate] buffer=0 maxdelay=0 delaybuf=0 fbbuf=0 hop=0.5-pv_BinDelay :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_BinDelay buffer maxdelay delaybuf fbbuf hop = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinDelay" [buffer,maxdelay,delaybuf,fbbuf,hop] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PV_BinFilter [ControlRate] buffer=0 start=0 end=0-pv_BinFilter :: Ugen -> Ugen -> Ugen -> Ugen-pv_BinFilter buffer start end = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinFilter" [buffer,start,end] Nothing 1 (Special 0) NoId---- | Plays FFT data to a memory buffer------ PV_BinPlayBuf [ControlRate] buffer=0 playbuf=0 rate=1 offset=0 binStart=0 binSkip=1 numBins=1 loop=0 clear=0-pv_BinPlayBuf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_BinPlayBuf buffer playbuf_ rate_ offset binStart binSkip numBins loop clear = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinPlayBuf" [buffer,playbuf_,rate_,offset,binStart,binSkip,numBins,loop,clear] Nothing 1 (Special 0) NoId---- | Plays FFT data from a memory buffer------ PV_BufRd [ControlRate] buffer=0 playbuf=0 point=1-pv_BufRd :: Ugen -> Ugen -> Ugen -> Ugen-pv_BufRd buffer playbuf_ point = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BufRd" [buffer,playbuf_,point] Nothing 1 (Special 0) NoId---- | returns common magnitudes------ PV_CommonMag [ControlRate] bufferA=0 bufferB=0 tolerance=0 remove=0-pv_CommonMag :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_CommonMag bufferA bufferB tolerance remove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_CommonMag" [bufferA,bufferB,tolerance,remove] Nothing 1 (Special 0) NoId---- | multiplies common magnitudes------ PV_CommonMul [ControlRate] bufferA=0 bufferB=0 tolerance=0 remove=0-pv_CommonMul :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_CommonMul bufferA bufferB tolerance remove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_CommonMul" [bufferA,bufferB,tolerance,remove] Nothing 1 (Special 0) NoId---- | simple spectral compression/expansion------ PV_Compander [ControlRate] buffer=0 thresh=50 slopeBelow=1 slopeAbove=1-pv_Compander :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_Compander buffer thresh slopeBelow slopeAbove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Compander" [buffer,thresh,slopeBelow,slopeAbove] Nothing 1 (Special 0) NoId---- | zero bins with interpolation------ PV_Cutoff [ControlRate] bufferA=0 bufferB=0 wipe=0-pv_Cutoff :: Ugen -> Ugen -> Ugen -> Ugen-pv_Cutoff bufferA bufferB wipe = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Cutoff" [bufferA,bufferB,wipe] Nothing 1 (Special 0) NoId---- | Return the even numbered bins in an FFT buffer------ PV_EvenBin [ControlRate] buffer=0-pv_EvenBin :: Ugen -> Ugen-pv_EvenBin buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_EvenBin" [buffer] Nothing 1 (Special 0) NoId---- | extract a repeating loop out from audio------ PV_ExtractRepeat [ControlRate] buffer=0 loopbuf=0 loopdur=0 memorytime=30 which=0 ffthop=0.5 thresh=1-pv_ExtractRepeat :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_ExtractRepeat buffer loopbuf_ loopdur memorytime which ffthop thresh = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_ExtractRepeat" [buffer,loopbuf_,loopdur,memorytime,which,ffthop,thresh] Nothing 1 (Special 0) NoId---- | Freeze FFT frames------ PV_Freeze [ControlRate] buffer=0 freeze=0-pv_Freeze :: Ugen -> Ugen -> Ugen-pv_Freeze buffer freeze = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Freeze" [buffer,freeze] Nothing 1 (Special 0) NoId---- | Store FFT data in another buffer for other use------ PV_FreqBuffer [ControlRate] buffer=0 databuffer=0-pv_FreqBuffer :: Ugen -> Ugen -> Ugen-pv_FreqBuffer buffer databuffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_FreqBuffer" [buffer,databuffer] Nothing 1 (Special 0) NoId---- | Invert FFT frames------ PV_Invert [ControlRate] buffer=0-pv_Invert :: Ugen -> Ugen-pv_Invert buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Invert" [buffer] Nothing 1 (Special 0) NoId---- | Store FFT data in another buffer for other use------ PV_MagBuffer [ControlRate] buffer=0 databuffer=0-pv_MagBuffer :: Ugen -> Ugen -> Ugen-pv_MagBuffer buffer databuffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagBuffer" [buffer,databuffer] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PV_MagExp [ControlRate] buffer=0-pv_MagExp :: Ugen -> Ugen-pv_MagExp buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagExp" [buffer] Nothing 1 (Special 0) NoId---- | reduces magnitudes above or below thresh------ PV_MagGate [ControlRate] buffer=0 thresh=1 remove=0-pv_MagGate :: Ugen -> Ugen -> Ugen -> Ugen-pv_MagGate buffer thresh remove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagGate" [buffer,thresh,remove] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PV_MagLog [ControlRate] buffer=0-pv_MagLog :: Ugen -> Ugen-pv_MagLog buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagLog" [buffer] Nothing 1 (Special 0) NoId---- | Remap magnitudes to a new mag curve------ PV_MagMap [ControlRate] buffer=0 mapbuf=0-pv_MagMap :: Ugen -> Ugen -> Ugen-pv_MagMap buffer mapbuf = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagMap" [buffer,mapbuf] Nothing 1 (Special 0) NoId---- | subtract spectral energy------ PV_MagMinus [ControlRate] bufferA=0 bufferB=0 remove=1-pv_MagMinus :: Ugen -> Ugen -> Ugen -> Ugen-pv_MagMinus bufferA bufferB remove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagMinus" [bufferA,bufferB,remove] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PV_MagMulAdd [ControlRate] buffer=0-pv_MagMulAdd :: Ugen -> Ugen-pv_MagMulAdd buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagMulAdd" [buffer] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PV_MagScale [ControlRate] bufferA=0 bufferB=0-pv_MagScale :: Ugen -> Ugen -> Ugen-pv_MagScale bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagScale" [bufferA,bufferB] Nothing 1 (Special 0) NoId---- | Smooth spectral magnitudes over time------ PV_MagSmooth [ControlRate] buffer=0 factor=0.1-pv_MagSmooth :: Ugen -> Ugen -> Ugen-pv_MagSmooth buffer factor = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagSmooth" [buffer,factor] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PV_MagSubtract [ControlRate] bufferA=0 bufferB=0 zerolimit=0-pv_MagSubtract :: Ugen -> Ugen -> Ugen -> Ugen-pv_MagSubtract bufferA bufferB zerolimit = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagSubtract" [bufferA,bufferB,zerolimit] Nothing 1 (Special 0) NoId---- | Return the N strongest bins------ PV_MaxMagN [ControlRate] buffer=0 numbins=0-pv_MaxMagN :: Ugen -> Ugen -> Ugen-pv_MaxMagN buffer numbins = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MaxMagN" [buffer,numbins] Nothing 1 (Special 0) NoId---- | Return the N weakest bins------ PV_MinMagN [ControlRate] buffer=0 numbins=0-pv_MinMagN :: Ugen -> Ugen -> Ugen-pv_MinMagN buffer numbins = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MinMagN" [buffer,numbins] Nothing 1 (Special 0) NoId---- | one kind of spectral morphing------ PV_Morph [ControlRate] bufferA=0 bufferB=0 morph=0-pv_Morph :: Ugen -> Ugen -> Ugen -> Ugen-pv_Morph bufferA bufferB morph = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Morph" [bufferA,bufferB,morph] Nothing 1 (Special 0) NoId---- | Return only bins that are unstable------ PV_NoiseSynthF [ControlRate] buffer=0 threshold=0.1 numFrames=2 initflag=0-pv_NoiseSynthF :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_NoiseSynthF buffer threshold numFrames initflag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_NoiseSynthF" [buffer,threshold,numFrames,initflag] Nothing 1 (Special 0) NoId---- | Return only bins that are unstable------ PV_NoiseSynthP [ControlRate] buffer=0 threshold=0.1 numFrames=2 initflag=0-pv_NoiseSynthP :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_NoiseSynthP buffer threshold numFrames initflag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_NoiseSynthP" [buffer,threshold,numFrames,initflag] Nothing 1 (Special 0) NoId---- | Return the odd numbered bins in an FFT buffer------ PV_OddBin [ControlRate] buffer=0-pv_OddBin :: Ugen -> Ugen-pv_OddBin buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_OddBin" [buffer] Nothing 1 (Special 0) NoId---- | Return only bins that are stable------ PV_PartialSynthF [ControlRate] buffer=0 threshold=0.1 numFrames=2 initflag=0-pv_PartialSynthF :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_PartialSynthF buffer threshold numFrames initflag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PartialSynthF" [buffer,threshold,numFrames,initflag] Nothing 1 (Special 0) NoId---- | Return only bins that are stable------ PV_PartialSynthP [ControlRate] buffer=0 threshold=0.1 numFrames=2 initflag=0-pv_PartialSynthP :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_PartialSynthP buffer threshold numFrames initflag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PartialSynthP" [buffer,threshold,numFrames,initflag] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PV_PitchShift [ControlRate] buffer=0 ratio=0-pv_PitchShift :: Ugen -> Ugen -> Ugen-pv_PitchShift buffer ratio = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PitchShift" [buffer,ratio] Nothing 1 (Special 0) NoId---- | Plays FFT data to a memory buffer------ PV_PlayBuf [ControlRate] buffer=0 playbuf=0 rate=1 offset=0 loop=0-pv_PlayBuf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_PlayBuf buffer playbuf_ rate_ offset loop = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PlayBuf" [buffer,playbuf_,rate_,offset,loop] Nothing 1 (Special 0) NoId---- | Records FFT data to a memory buffer------ PV_RecordBuf [ControlRate] buffer=0 recbuf=0 offset=0 run=0 loop=0 hop=0.5 wintype=0-pv_RecordBuf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_RecordBuf buffer recbuf offset run loop hop wintype = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RecordBuf" [buffer,recbuf,offset,run,loop,hop,wintype] Nothing 1 (Special 0) NoId---- | combine low and high bins from two inputs with interpolation------ PV_SoftWipe [ControlRate] bufferA=0 bufferB=0 wipe=0-pv_SoftWipe :: Ugen -> Ugen -> Ugen -> Ugen-pv_SoftWipe bufferA bufferB wipe = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_SoftWipe" [bufferA,bufferB,wipe] Nothing 1 (Special 0) NoId---- | A harmonic enhancer------ PV_SpectralEnhance [ControlRate] buffer=0 numPartials=8 ratio=2 strength=0.1-pv_SpectralEnhance :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_SpectralEnhance buffer numPartials ratio strength = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_SpectralEnhance" [buffer,numPartials,ratio,strength] Nothing 1 (Special 0) NoId---- | Maps the spectral envelope of one FFT process onto another------ PV_SpectralMap [ControlRate] buffer=0 specBuffer=0 floor=0 freeze=0 mode=0 norm=0 window=0-pv_SpectralMap :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_SpectralMap buffer specBuffer floor_ freeze mode norm window = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_SpectralMap" [buffer,specBuffer,floor_,freeze,mode,norm,window] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PV_Split [ControlRate] bufferA=0 bufferB=0-pv_Split :: Ugen -> Ugen -> Ugen-pv_Split bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Split" [bufferA,bufferB] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ PV_Whiten [ControlRate] chain=0 trackbufnum=0 relaxtime=2 floor=0.1 smear=0 bindownsample=0-pv_Whiten :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_Whiten chain trackbufnum relaxtime floor_ smear bindownsample = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Whiten" [chain,trackbufnum,relaxtime,floor_,smear,bindownsample] Nothing 1 (Special 0) NoId---- | one kind of spectral morphing------ PV_XFade [ControlRate] bufferA=0 bufferB=0 fade=0-pv_xFade :: Ugen -> Ugen -> Ugen -> Ugen-pv_xFade bufferA bufferB fade = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_XFade" [bufferA,bufferB,fade] Nothing 1 (Special 0) NoId---- | Equal power pan across an array of speakers------ PanX [ControlRate,AudioRate] numChans=0 in=0 pos=0 level=1 width=2-panX :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-panX rate numChans in_ pos level width = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "PanX" [numChans,in_,pos,level,width] Nothing 0 (Special 0) NoId---- | (Undocumented class)------ PanX2D [ControlRate,AudioRate] numChansX=0 numChansY=0 in=0 posX=0 posY=0 level=1 widthX=2 widthY=2-panX2D :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-panX2D rate numChansX numChansY in_ posX posY level widthX widthY = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "PanX2D" [numChansX,numChansY,in_,posX,posY,level,widthX,widthY] Nothing 0 (Special 0) NoId---- | (Undocumented class)------ PeakEQ2 [AudioRate] in=0 freq=1200 rs=1 db=0-peakEQ2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-peakEQ2 rate in_ freq rs db = mkUgen Nothing [AudioRate] (Left rate) "PeakEQ2" [in_,freq,rs,db] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PeakEQ4 [AudioRate] in=0 freq=1200 rs=1 db=0-peakEQ4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-peakEQ4 rate in_ freq rs db = mkUgen Nothing [AudioRate] (Left rate) "PeakEQ4" [in_,freq,rs,db] Nothing 1 (Special 0) NoId---- | 3D Perlin Noise------ Perlin3 [ControlRate,AudioRate] x=0 y=0 z=0-perlin3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-perlin3 rate x y z = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Perlin3" [x,y,z] Nothing 1 (Special 0) NoId---- | Sample permutation Ugen.------ PermMod [AudioRate] in=0 freq=100-permMod :: Rate -> Ugen -> Ugen -> Ugen-permMod rate in_ freq = mkUgen Nothing [AudioRate] (Left rate) "PermMod" [in_,freq] Nothing 1 (Special 0) NoId---- | Sample permutation Ugen with programmable pattern.------ PermModArray [AudioRate] in=0 freq=50 pattern=0-permModArray :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-permModArray rate in_ freq pattern_ = mkUgen Nothing [AudioRate] (Left rate) "PermModArray" [in_,freq,pattern_] Nothing 1 (Special 0) NoId---- | Sample permutation Ugen with tail.------ PermModT [AudioRate] in=0 outfreq=440 infreq=5000-permModT :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-permModT rate in_ outfreq infreq = mkUgen Nothing [AudioRate] (Left rate) "PermModT" [in_,outfreq,infreq] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PhasorModal [AudioRate] input=0 freq=100 decay=0.25 damp=1 amp=0.5 phase=0; FILTER: TRUE-phasorModal :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-phasorModal input freq decay_ damp amp phase = mkUgen Nothing [AudioRate] (Right [0]) "PhasorModal" [input,freq,decay_,damp,amp,phase] Nothing 1 (Special 0) NoId---- | Tree classifier using (hyper)planes – Ugen or language-side------ PlaneTree [ControlRate] treebuf=0 in=0 gate=1-planeTree :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-planeTree rate treebuf in_ gate_ = mkUgen Nothing [ControlRate] (Left rate) "PlaneTree" [treebuf,in_,gate_] Nothing 1 (Special 0) NoId---- | POKEY Chip Sound Simulator------ Pokey [AudioRate] audf1=0 audc1=0 audf2=0 audc2=0 audf3=0 audc3=0 audf4=0 audc4=0 audctl=0-pokey :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pokey rate audf1 audc1 audf2 audc2 audf3 audc3 audf4 audc4 audctl = mkUgen Nothing [AudioRate] (Left rate) "Pokey" [audf1,audc1,audf2,audc2,audf3,audc3,audf4,audc4,audctl] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ PosRatio [AudioRate] in=0 period=100 thresh=0.1-posRatio :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-posRatio rate in_ period thresh = mkUgen Nothing [AudioRate] (Left rate) "PosRatio" [in_,period,thresh] Nothing 1 (Special 0) NoId---- | debug assistance------ PrintVal [ControlRate] in=0 numblocks=100 id=0-printVal :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-printVal rate in_ numblocks id_ = mkUgen Nothing [ControlRate] (Left rate) "PrintVal" [in_,numblocks,id_] Nothing 1 (Special 0) NoId---- | constant Q transform pitch follower------ Qitch [ControlRate] in=0 databufnum=0 ampThreshold=0.01 algoflag=1 ampbufnum=0 minfreq=0 maxfreq=2500-qitch :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-qitch rate in_ databufnum ampThreshold algoflag ampbufnum minfreq maxfreq = mkUgen Nothing [ControlRate] (Left rate) "Qitch" [in_,databufnum,ampThreshold,algoflag,ampbufnum,minfreq,maxfreq] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ Bezier [ControlRate,AudioRate] haltAfter=100 dx=0.0001 freq=440 phase=0 *param=0; MCE=1-bezier :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-bezier rate haltAfter dx freq phase param = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Bezier" [haltAfter,dx,freq,phase] (Just [param]) 1 (Special 0) NoId---- | rotating clock divider------ RCD [AudioRate] clock=0 rotate=0 reset=0 div=0 spread=0 auto=0 len=0 down=0 gates=0; FILTER: TRUE-rcd :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rcd clock rotate_ reset div_ spread auto len down gates = mkUgen Nothing [AudioRate] (Right [0]) "RCD" [clock,rotate_,reset,div_,spread,auto,len,down,gates] Nothing 8 (Special 0) NoId---- | (Undocumented class)------ RDL [AudioRate] numChannels=1 inputArray=0-rdl :: Rate -> Ugen -> Ugen -> Ugen-rdl rate numChannels inputArray = mkUgen Nothing [AudioRate] (Left rate) "RDL" [numChannels,inputArray] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ DX7 [AudioRate] bufnum=0 on=0 off=0 data=0 vc=0 mnn=60 vel=99 pw=0 mw=0 bc=0 fc=0-dx7 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dx7 rate bufnum on off data_ vc mnn vel pw mw bc fc = mkUgen Nothing [AudioRate] (Left rate) "DX7" [bufnum,on,off,data_,vc,mnn,vel,pw,mw,bc,fc] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RDX7Env [AudioRate] gate=0 data=0 r1=0 r2=0 r3=0 r4=0 l1=0 l2=0 l3=0 l4=0 ol=0-rdx7Env :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rdx7Env rate gate_ data_ r1 r2 r3 r4 l1 l2 l3 l4 ol = mkUgen Nothing [AudioRate] (Left rate) "RDX7Env" [gate_,data_,r1,r2,r3,r4,l1,l2,l3,l4,ol] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RDelayMap [AudioRate] bufnum=0 in=0 dynamic=0 *spec=0; MCE=1, FILTER: TRUE-rDelayMap :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rDelayMap bufnum in_ dynamic spec = mkUgen Nothing [AudioRate] (Right [1]) "RDelayMap" [bufnum,in_,dynamic] (Just [spec]) 1 (Special 0) NoId---- | (Undocumented class)------ RDelaySet [AudioRate] input=0 *setArray=0; MCE=1, FILTER: TRUE-rDelaySet :: Ugen -> Ugen -> Ugen-rDelaySet input setArray = mkUgen Nothing [AudioRate] (Right [0]) "RDelaySet" [input] (Just [setArray]) 1 (Special 0) NoId---- | (Undocumented class)------ RDelaySetBuf [AudioRate] bufnum=0 in=0 spec=0-rDelaySetBuf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-rDelaySetBuf rate bufnum in_ spec = mkUgen Nothing [AudioRate] (Left rate) "RDelaySetBuf" [bufnum,in_,spec] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ dustRange [AudioRate] iot_min=0.1 iot_max=1-dustRangeId :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen-dustRangeId z rate iot_min iot_max = mkUgen Nothing [AudioRate] (Left rate) "DustRange" [iot_min,iot_max] Nothing 1 (Special 0) (toUid z)---- | (Undocumented class)------ ExpRandN [InitialisationRate] lo=0 hi=1; NC INPUT: True, NONDET-expRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen-expRandNId numChannels z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "ExpRandN" [lo,hi] Nothing numChannels (Special 0) (toUid z)---- | Monad variant of ExpRandN.-expRandNM :: Uid m => Int -> Ugen -> Ugen -> m Ugen-expRandNM nc = liftUid2 (expRandNId nc)---- | Unsafe variant of ExpRandN.-expRandN :: Int -> Ugen -> Ugen -> Ugen-expRandN nc = liftUnsafe2 (expRandNM nc)---- | (Undocumented class)------ Freezer [AudioRate] bufnum=0 left=0 right=1 gain=1 increment=1 incrementOffset=0 incrementRandom=0 rightRandom=0 syncPhaseTrigger=0 randomizePhaseTrigger=0 numberOfLoops=4-freezer :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-freezer bufnum left right gain increment incrementOffset incrementRandom rightRandom syncPhaseTrigger randomizePhaseTrigger numberOfLoops = mkUgen Nothing [AudioRate] (Left AudioRate) "Freezer" [bufnum,left,right,gain,increment,incrementOffset,incrementRandom,rightRandom,syncPhaseTrigger,randomizePhaseTrigger,numberOfLoops] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ IRandN [] numChannels=2 lo=0 hi=127-iRandNId :: ID a => a -> Int -> Ugen -> Ugen -> Ugen-iRandNId z numChannels lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "IRandN" [lo,hi] Nothing numChannels (Special 0) (toUid z)---- | Monad variant of IRandN.-iRandNM :: Uid m => Int -> Ugen -> Ugen -> m Ugen-iRandNM nc = liftUid2 (iRandNId nc)---- | Unsafe variant of IRandN.-iRandN :: Int -> Ugen -> Ugen -> Ugen-iRandN nc = liftUnsafe2 (iRandNM nc)---- | TB303 Filter Emulation------ RLPFD [ControlRate,AudioRate] in=0 ffreq=440 res=0 dist=0; FILTER: TRUE-rlpfd :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rlpfd in_ ffreq res dist = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "RLPFD" [in_,ffreq,res,dist] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RLagC [ControlRate] in=0 timeUp=0.1 curveUp=0 timeDown=0.1 curveDown=0; FILTER: TRUE-rLagC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rLagC in_ timeUp curveUp timeDown curveDown = mkUgen Nothing [ControlRate] (Right [0]) "RLagC" [in_,timeUp,curveUp,timeDown,curveDown] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ LinRandN [InitialisationRate] lo=0 hi=1 minmax=0; NC INPUT: True, NONDET-linRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen-linRandNId numChannels z lo hi minmax = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "LinRandN" [lo,hi,minmax] Nothing numChannels (Special 0) (toUid z)---- | Monad variant of LinRandN.-linRandNM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> m Ugen-linRandNM nc = liftUid3 (linRandNId nc)---- | Unsafe variant of LinRandN.-linRandN :: Int -> Ugen -> Ugen -> Ugen -> Ugen-linRandN nc = liftUnsafe3 (linRandNM nc)---- | (Undocumented class)------ RLoopSet [AudioRate] bufnum=0 left=0 right=1 gain=1 increment=1 spec=0-rLoopSet :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rLoopSet rate bufnum left right gain increment spec = mkUgen Nothing [AudioRate] (Left rate) "RLoopSet" [bufnum,left,right,gain,increment,spec] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RMAFoodChainL [AudioRate] freq=22050 a1=5 b1=3 d1=0.4 a2=0.1 b2=2 d2=0.01 k=1.0943 r=0.8904 h=0.05 xi=0.1 yi=0 zi=0-rmaFoodChainL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rmaFoodChainL rate freq a1 b1 d1 a2 b2 d2 k r h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "RMAFoodChainL" [freq,a1,b1,d1,a2,b2,d2,k,r,h,xi,yi,zi] Nothing 3 (Special 0) NoId---- | (Undocumented class)------ RMEQ [AudioRate] in=0 freq=440 rq=0.1 k=0; FILTER: TRUE-rmeq :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rmeq in_ freq rq k = mkUgen Nothing [AudioRate] (Right [0]) "RMEQ" [in_,freq,rq,k] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RMEQSuite [] maxSize=0-rmeqSuite :: Rate -> Ugen -> Ugen-rmeqSuite rate maxSize = mkUgen Nothing [InitialisationRate,ControlRate,AudioRate,DemandRate] (Left rate) "RMEQSuite" [maxSize] Nothing 1 (Special 0) NoId---- | root mean square------ RMS [ControlRate,AudioRate] in=0 lpFreq=10-rms :: Rate -> Ugen -> Ugen -> Ugen-rms rate in_ lpFreq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RMS" [in_,lpFreq] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RMShelf [AudioRate] in=0 freq=440 k=0-rmShelf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-rmShelf rate in_ freq k = mkUgen Nothing [AudioRate] (Left rate) "RMShelf" [in_,freq,k] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RMShelf2 [AudioRate] in=0 freq=440 k=0-rmShelf2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-rmShelf2 rate in_ freq k = mkUgen Nothing [AudioRate] (Left rate) "RMShelf2" [in_,freq,k] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ ObxdFilter [AudioRate] in=0 cutoff=440 resonance=0 multimode=0.5 bandpass=0 fourpole=0-obxdFilter :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-obxdFilter in_ cutoff resonance multimode bandpass fourpole = mkUgen Nothing [AudioRate] (Right [0]) "ObxdFilter" [in_,cutoff,resonance,multimode,bandpass,fourpole] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RPVDecayTbl [] fft_buf=0 decay_rate_buf=0 history_buf=0-rpvDecayTbl :: Ugen -> Ugen -> Ugen -> Ugen-rpvDecayTbl fft_buf decay_rate_buf history_buf = mkUgen Nothing [ControlRate] (Left ControlRate) "RPVDecayTbl" [fft_buf,decay_rate_buf,history_buf] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RandN [InitialisationRate] lo=0 hi=1; NC INPUT: True, NONDET-randNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen-randNId numChannels z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "RandN" [lo,hi] Nothing numChannels (Special 0) (toUid z)---- | Monad variant of RandN.-randNM :: Uid m => Int -> Ugen -> Ugen -> m Ugen-randNM nc = liftUid2 (randNId nc)---- | Unsafe variant of RandN.-randN :: Int -> Ugen -> Ugen -> Ugen-randN nc = liftUnsafe2 (randNM nc)---- | (Undocumented class)------ RSVFBP [AudioRate] in=0 freq=440 q=0-svfBp :: Ugen -> Ugen -> Ugen -> Ugen-svfBp in_ freq q = mkUgen Nothing [AudioRate] (Right [0]) "SvfBp" [in_,freq,q] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SvfHp [AudioRate] in=0 freq=440 q=0-svfHp :: Ugen -> Ugen -> Ugen -> Ugen-svfHp in_ freq q = mkUgen Nothing [AudioRate] (Right [0]) "SvfHp" [in_,freq,q] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SvflP [AudioRate] in=0 freq=440 q=0-svfLp :: Ugen -> Ugen -> Ugen -> Ugen-svfLp in_ freq q = mkUgen Nothing [AudioRate] (Right [0]) "SvfLp" [in_,freq,q] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ ShufflerB [AudioRate] bufnum=0 readLocationMinima=0.01 readLocationMaxima=0.02 readIncrementMinima=1 readIncrementMaxima=1 durationMinima=0.2 durationMaxima=0.2 envelopeAmplitudeMinima=0.5 envelopeAmplitudeMaxima=0.5 envelopeShapeMinima=0.5 envelopeShapeMaxima=0.5 envelopeSkewMinima=0.5 envelopeSkewMaxima=0.5 stereoLocationMinima=0.5 stereoLocationMaxima=0.5 interOffsetTimeMinima=0.05 interOffsetTimeMaxima=0.01 ftableReadLocationIncrement=1 readIncrementQuanta=0 interOffsetTimeQuanta=0-shufflerB :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-shufflerB bufnum readLocationMinima readLocationMaxima readIncrementMinima readIncrementMaxima durationMinima durationMaxima envelopeAmplitudeMinima envelopeAmplitudeMaxima envelopeShapeMinima envelopeShapeMaxima envelopeSkewMinima envelopeSkewMaxima stereoLocationMinima stereoLocationMaxima interOffsetTimeMinima interOffsetTimeMaxima ftableReadLocationIncrement readIncrementQuanta interOffsetTimeQuanta = mkUgen Nothing [AudioRate] (Left AudioRate) "ShufflerB" [bufnum,readLocationMinima,readLocationMaxima,readIncrementMinima,readIncrementMaxima,durationMinima,durationMaxima,envelopeAmplitudeMinima,envelopeAmplitudeMaxima,envelopeShapeMinima,envelopeShapeMaxima,envelopeSkewMinima,envelopeSkewMaxima,stereoLocationMinima,stereoLocationMaxima,interOffsetTimeMinima,interOffsetTimeMaxima,ftableReadLocationIncrement,readIncrementQuanta,interOffsetTimeQuanta] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ RShufflerL [AudioRate] in=0 fragmentSize=0.01 maxDelay=0.01-rShufflerL :: Ugen -> Ugen -> Ugen -> Ugen-rShufflerL in_ fragmentSize maxDelay = mkUgen Nothing [AudioRate] (Right [0]) "RShufflerL" [in_,fragmentSize,maxDelay] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RSmplrIndex [ControlRate] buf=0 size=0 mnn=60-rSmplrIndex :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-rSmplrIndex rate buf size mnn = mkUgen Nothing [ControlRate] (Left rate) "RSmplrIndex" [buf,size,mnn] Nothing 2 (Special 0) NoId---- | (Undocumented class)------ TExpRandN [ControlRate] lo=0 hi=1 trigger=0; NC INPUT: True, FILTER: TRUE, NONDET-tExpRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen-tExpRandNId numChannels z lo hi trigger = mkUgen Nothing [ControlRate] (Right [2]) "TExpRandN" [lo,hi,trigger] Nothing numChannels (Special 0) (toUid z)---- | Monad variant of TExpRandN.-tExpRandNM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> m Ugen-tExpRandNM nc = liftUid3 (tExpRandNId nc)---- | Unsafe variant of TExpRandN.-tExpRandN :: Int -> Ugen -> Ugen -> Ugen -> Ugen-tExpRandN nc = liftUnsafe3 (tExpRandNM nc)---- | (Undocumented class)------ TLinRandN [ControlRate] lo=0 hi=1 minmax=0 trigger=0; NC INPUT: True, FILTER: TRUE, NONDET-tLinRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tLinRandNId numChannels z lo hi minmax trigger = mkUgen Nothing [ControlRate] (Right [3]) "TLinRandN" [lo,hi,minmax,trigger] Nothing numChannels (Special 0) (toUid z)---- | Monad variant of TLinRandN.-tLinRandNM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-tLinRandNM nc = liftUid4 (tLinRandNId nc)---- | Unsafe variant of TLinRandN.-tLinRandN :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tLinRandN nc = liftUnsafe4 (tLinRandNM nc)---- | (Undocumented class)------ TRandN [ControlRate] lo=0 hi=1 trigger=0; NC INPUT: True, FILTER: TRUE, NONDET-tRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen-tRandNId numChannels z lo hi trigger = mkUgen Nothing [ControlRate] (Right [2]) "TRandN" [lo,hi,trigger] Nothing numChannels (Special 0) (toUid z)---- | Monad variant of TRandN.-tRandNM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> m Ugen-tRandNM nc = liftUid3 (tRandNId nc)---- | Unsafe variant of TRandN.-tRandN :: Int -> Ugen -> Ugen -> Ugen -> Ugen-tRandN nc = liftUnsafe3 (tRandNM nc)---- | (Undocumented class)------ TScramble [InitialisationRate,ControlRate] trigger=0 *inputs=0; MCE=1, FILTER: TRUE, NONDET-tScrambleId :: ID a => a -> Ugen -> Ugen -> Ugen-tScrambleId z trigger inputs = mkUgen Nothing [InitialisationRate,ControlRate] (Right [0]) "TScramble" [trigger] (Just [inputs]) (length (mceChannels inputs) + 0) (Special 0) (toUid z)---- | Monad variant of TScramble.-tScrambleM :: Uid m => Ugen -> Ugen -> m Ugen-tScrambleM = liftUid2 tScrambleId---- | Unsafe variant of TScramble.-tScramble :: Ugen -> Ugen -> Ugen-tScramble = liftUnsafe2 tScrambleM---- | (Undocumented class)------ RTracePlay [ControlRate,AudioRate] bufnum=0 degree=4 rate=0 axis=1-rTracePlay :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rTracePlay rate bufnum degree rate_ axis = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RTracePlay" [bufnum,degree,rate_,axis] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RTraceRd [ControlRate,AudioRate] bufnum=0 degree=4 index=0 axis=1-rTraceRd :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rTraceRd rate bufnum degree index_ axis = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RTraceRd" [bufnum,degree,index_,axis] Nothing 1 (Special 0) NoId---- | differential pulse-code modulation------ RedDPCMdecode [ControlRate,AudioRate] in=0-redDPCMdecode :: Rate -> Ugen -> Ugen-redDPCMdecode rate in_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RedDPCMdecode" [in_] Nothing 1 (Special 0) NoId---- | differential pulse-code modulation------ RedDPCMencode [ControlRate,AudioRate] in=0 round=0-redDPCMencode :: Rate -> Ugen -> Ugen -> Ugen-redDPCMencode rate in_ round_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RedDPCMencode" [in_,round_] Nothing 1 (Special 0) NoId---- | look before you leap------ RedLbyl [ControlRate,AudioRate] in=0 thresh=0.5 samples=2-redLbyl :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-redLbyl rate in_ thresh samples = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RedLbyl" [in_,thresh,samples] Nothing 1 (Special 0) NoId---- | a really bad pseudo-random noise generator------ RedNoise [ControlRate,AudioRate] clock=0-redNoise :: Rate -> Ugen -> Ugen-redNoise rate clock = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RedNoise" [clock] Nothing 1 (Special 0) NoId---- | a phasor that can loop------ RedPhasor [ControlRate,AudioRate] trig=0 rate=1 start=0 end=1 loop=0 loopstart=0 loopend=1-redPhasor :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-redPhasor rate trig_ rate_ start end loop loopstart loopend = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RedPhasor" [trig_,rate_,start,end,loop,loopstart,loopend] Nothing 1 (Special 0) NoId---- | a phasor that can loop - version2------ RedPhasor2 [ControlRate,AudioRate] trig=0 rate=1 start=0 end=1 loop=0 loopstart=0 loopend=1-redPhasor2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-redPhasor2 rate trig_ rate_ start end loop loopstart loopend = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "RedPhasor2" [trig_,rate_,start,end,loop,loopstart,loopend] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ RegaliaMitraEQ [AudioRate] in=0 freq=440 rq=0.1 k=0-regaliaMitraEQ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-regaliaMitraEQ rate in_ freq rq k = mkUgen Nothing [AudioRate] (Left rate) "RegaliaMitraEQ" [in_,freq,rq,k] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Resonator [AudioRate] input=0 freq=100 position=0.001 resolution=24 structure=0.5 brightness=0.5 damping=0.5; FILTER: TRUE-resonator :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-resonator input freq position resolution structure brightness damping = mkUgen Nothing [AudioRate] (Right [0]) "Resonator" [input,freq,position,resolution,structure,brightness,damping] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Rongs [AudioRate] trigger=0 sustain=1 f0=0.01 structure=0.5 brightness=0.5 damping=0.75 accent=0.9 stretch=0.5 position=0.15 loss=0.15 modeNum=2 cosFreq=0.25-rongs :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rongs rate trigger sustain f0 structure brightness damping accent stretch position loss modeNum cosFreq = mkUgen Nothing [AudioRate] (Left rate) "Rongs" [trigger,sustain,f0,structure,brightness,damping,accent,stretch,position,loss,modeNum,cosFreq] Nothing 1 (Special 0) NoId---- | Rossler chaotic generator------ RosslerL [AudioRate] freq=22050 a=0.2 b=0.2 c=5.7 h=0.05 xi=0.1 yi=0 zi=0-rosslerL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rosslerL rate freq a b c h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "RosslerL" [freq,a,b,c,h,xi,yi,zi] Nothing 3 (Special 0) NoId---- | (Undocumented class)------ RosslerResL [AudioRate] in=0 stiff=1 freq=22050 a=0.2 b=0.2 c=5.7 h=0.05 xi=0.1 yi=0 zi=0-rosslerResL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rosslerResL rate in_ stiff freq a b c h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "RosslerResL" [in_,stiff,freq,a,b,c,h,xi,yi,zi] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Rotate [AudioRate] w=0 x=0 y=0 z=0 rotate=0-rotate :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-rotate rate w x y z rotate_ = mkUgen Nothing [AudioRate] (Left rate) "Rotate" [w,x,y,z,rotate_] Nothing 1 (Special 0) NoId---- | (faulty) SID Sound Chip Simulator------ SID6581f [AudioRate] freqLo0=0 freqHi0=0 pwLo0=0 pwHi0=0 ctrl0=0 atkDcy0=0 susRel0=0 freqLo1=0 freqHi1=0 pwLo1=0 pwHi1=0 ctrl1=0 atkDcy1=0 susRel1=0 freqLo2=0 freqHi2=0 pwLo2=0 pwHi2=0 ctrl2=0 atkDcy2=0 susRel2=0 fcLo=0 fcHi=0 resFilt=0 modeVol=0 rate=1-sid6581f :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sid6581f rate freqLo0 freqHi0 pwLo0 pwHi0 ctrl0 atkDcy0 susRel0 freqLo1 freqHi1 pwLo1 pwHi1 ctrl1 atkDcy1 susRel1 freqLo2 freqHi2 pwLo2 pwHi2 ctrl2 atkDcy2 susRel2 fcLo fcHi resFilt modeVol rate_ = mkUgen Nothing [AudioRate] (Left rate) "SID6581f" [freqLo0,freqHi0,pwLo0,pwHi0,ctrl0,atkDcy0,susRel0,freqLo1,freqHi1,pwLo1,pwHi1,ctrl1,atkDcy1,susRel1,freqLo2,freqHi2,pwLo2,pwHi2,ctrl2,atkDcy2,susRel2,fcLo,fcHi,resFilt,modeVol,rate_] Nothing 1 (Special 0) NoId---- | experimental time domain onset detector------ SLOnset [ControlRate] input=0 memorysize1=20 before=5 after=5 threshold=10 hysteresis=10-slOnset :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-slOnset rate input memorysize1 before after threshold hysteresis = mkUgen Nothing [ControlRate] (Left rate) "SLOnset" [input,memorysize1,before,after,threshold,hysteresis] Nothing 1 (Special 0) NoId---- | Spectral Modeling Synthesis------ SMS [AudioRate] input=0 maxpeaks=80 currentpeaks=80 tolerance=4 noisefloor=0.2 freqmult=1 freqadd=0 formantpreserve=0 useifft=0 ampmult=1 graphicsbufnum=0; FILTER: TRUE-sms :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sms input maxpeaks currentpeaks tolerance noisefloor freqmult freqadd formantpreserve useifft ampmult graphicsbufnum = mkUgen Nothing [AudioRate] (Right [0]) "SMS" [input,maxpeaks,currentpeaks,tolerance,noisefloor,freqmult,freqadd,formantpreserve,useifft,ampmult,graphicsbufnum] Nothing 2 (Special 0) NoId---- | Sound Chip Simulator------ SN76489 [AudioRate] tone0=512 tone1=0 tone2=0 noise=0 vol0=15 vol1=0 vol2=0 vol3=0 rate=1-sn76489 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sn76489 rate tone0 tone1 tone2 noise vol0 vol1 vol2 vol3 rate_ = mkUgen Nothing [AudioRate] (Left rate) "SN76489" [tone0,tone1,tone2,noise,vol0,vol1,vol2,vol3,rate_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SOMAreaWr [ControlRate] bufnum=0 inputdata=0 coords=0 netsize=10 numdims=2 nhood=0.5 gate=1-somAreaWr :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-somAreaWr rate bufnum inputdata coords netsize numdims nhood gate_ = mkUgen Nothing [ControlRate] (Left rate) "SOMAreaWr" [bufnum,inputdata,coords,netsize,numdims,nhood,gate_] Nothing 1 (Special 0) NoId---- | Map an input using a Self-Organising Map------ SOMRd [ControlRate,AudioRate] bufnum=0 inputdata=0 netsize=10 numdims=2 gate=1-somRd :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-somRd rate bufnum inputdata netsize numdims gate_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "SOMRd" [bufnum,inputdata,netsize,numdims,gate_] Nothing 2 (Special 0) NoId---- | Create (train) a Self-Organising Map------ SOMTrain [ControlRate] bufnum=0 inputdata=0 netsize=10 numdims=2 traindur=5000 nhood=0.5 gate=1 initweight=1-somTrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-somTrain rate bufnum inputdata netsize numdims traindur nhood gate_ initweight = mkUgen Nothing [ControlRate] (Left rate) "SOMTrain" [bufnum,inputdata,netsize,numdims,traindur,nhood,gate_,initweight] Nothing 3 (Special 0) NoId---- | 12db/Oct State Variable Filter------ SVF [ControlRate,AudioRate] signal=0 cutoff=2200 res=0.1 lowpass=1 bandpass=0 highpass=0 notch=0 peak=0; FILTER: TRUE-svf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-svf signal cutoff res lowpass bandpass highpass notch peak_ = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "SVF" [signal,cutoff,res,lowpass,bandpass,highpass,notch,peak_] Nothing 1 (Special 0) NoId---- | super-efficient sawtooth oscillator with low aliasing------ SawDPW [ControlRate,AudioRate] freq=440 iphase=0-sawDPW :: Rate -> Ugen -> Ugen -> Ugen-sawDPW rate freq iphase = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "SawDPW" [freq,iphase] Nothing 1 (Special 0) NoId---- | Perceptual feature modeling sensory dissonance------ SensoryDissonance [ControlRate] fft=0 maxpeaks=100 peakthreshold=0.1 norm=0 clamp=1-sensoryDissonance :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sensoryDissonance rate fft_ maxpeaks peakthreshold norm clamp = mkUgen Nothing [ControlRate] (Left rate) "SensoryDissonance" [fft_,maxpeaks,peakthreshold,norm,clamp] Nothing 1 (Special 0) NoId---- | Fuzzy sieve based synthesis------ Sieve1 [ControlRate,AudioRate] bufnum=0 gap=2 alternate=1-sieve1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-sieve1 rate bufnum gap alternate = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Sieve1" [bufnum,gap,alternate] Nothing 1 (Special 0) NoId---- | Granular synthesis with sinusoidal grains------ SinGrain [AudioRate] trigger=0 dur=1 freq=440-sinGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-sinGrain rate trigger dur freq = mkUgen Nothing [AudioRate] (Left rate) "SinGrain" [trigger,dur,freq] Nothing 1 (Special 0) NoId---- | Granular synthesis with sinusoidal grains and user supplied envelope------ SinGrainB [AudioRate] trigger=0 dur=1 freq=440 envbuf=0-sinGrainB :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sinGrainB rate trigger dur freq envbuf = mkUgen Nothing [AudioRate] (Left rate) "SinGrainB" [trigger,dur,freq,envbuf] Nothing 1 (Special 0) NoId---- | Granular synthesis with sinusoidal grains with Ambisonic panning and user supplied envelope------ SinGrainBBF [AudioRate] trigger=0 dur=1 freq=440 envbuf=0 azimuth=0 elevation=0 rho=1 wComp=0-sinGrainBBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sinGrainBBF rate trigger dur freq envbuf azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "SinGrainBBF" [trigger,dur,freq,envbuf,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | Granular synthesis with sinusoidal grains with Ambisonic panning------ SinGrainBF [AudioRate] trigger=0 dur=1 freq=440 azimuth=0 elevation=0 rho=1 wComp=0-sinGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sinGrainBF rate trigger dur freq azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "SinGrainBF" [trigger,dur,freq,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | Granular synthesis with sinusoidal grains and user supplied envelopes------ SinGrainI [AudioRate] trigger=0 dur=1 freq=440 envbuf1=0 envbuf2=0 ifac=0.5-sinGrainI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sinGrainI rate trigger dur freq envbuf1 envbuf2 ifac = mkUgen Nothing [AudioRate] (Left rate) "SinGrainI" [trigger,dur,freq,envbuf1,envbuf2,ifac] Nothing 1 (Special 0) NoId---- | Granular synthesis with sinusoidal grains with Ambisonic panning and user supplied envelopes------ SinGrainIBF [AudioRate] trigger=0 dur=1 freq=440 envbuf1=0 envbuf2=0 ifac=0.5 azimuth=0 elevation=0 rho=1 wComp=0-sinGrainIBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sinGrainIBF rate trigger dur freq envbuf1 envbuf2 ifac azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "SinGrainIBF" [trigger,dur,freq,envbuf1,envbuf2,ifac,azimuth,elevation,rho,wComp] Nothing 4 (Special 0) NoId---- | (Undocumented class)------ SinTone [AudioRate] freq=440 phase=0-sinTone :: Rate -> Ugen -> Ugen -> Ugen-sinTone rate freq phase = mkUgen Nothing [AudioRate] (Left rate) "SinTone" [freq,phase] Nothing 1 (Special 0) NoId---- | port of some ladspa plugins------ SineShaper [AudioRate] in=0 limit=1; FILTER: TRUE-sineShaper :: Ugen -> Ugen -> Ugen-sineShaper in_ limit = mkUgen Nothing [AudioRate] (Right [0]) "SineShaper" [in_,limit] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SkipNeedle [AudioRate] range=44100 rate=10 offset=0-skipNeedle :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-skipNeedle rate range rate_ offset = mkUgen Nothing [AudioRate] (Left rate) "SkipNeedle" [range,rate_,offset] Nothing 1 (Special 0) NoId---- | lowpass filter for envelope following------ Slide [ControlRate,AudioRate] in=0 slideup=50 slidedown=3000-slide :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-slide rate in_ slideup slidedown = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Slide" [in_,slideup,slidedown] Nothing 1 (Special 0) NoId---- | generate cpu spikes------ Slub [ControlRate,AudioRate] trig=0 spike=4.04-slub :: Rate -> Ugen -> Ugen -> Ugen-slub rate trig_ spike = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Slub" [trig_,spike] Nothing 1 (Special 0) NoId---- | Smooth samplerate and bitrate reduction------ SmoothDecimator [AudioRate] in=0 rate=44100 smoothing=0.5-smoothDecimator :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-smoothDecimator rate in_ rate_ smoothing = mkUgen Nothing [AudioRate] (Left rate) "SmoothDecimator" [in_,rate_,smoothing] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SoftClipAmp [AudioRate] in=0 pregain=1; FILTER: TRUE-softClipAmp :: Ugen -> Ugen -> Ugen-softClipAmp in_ pregain = mkUgen Nothing [AudioRate] (Right [0]) "SoftClipAmp" [in_,pregain] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SoftClipAmp4 [AudioRate] in=0 pregain=1; FILTER: TRUE-softClipAmp4 :: Ugen -> Ugen -> Ugen-softClipAmp4 in_ pregain = mkUgen Nothing [AudioRate] (Right [0]) "SoftClipAmp4" [in_,pregain] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SoftClipAmp8 [AudioRate] in=0 pregain=1; FILTER: TRUE-softClipAmp8 :: Ugen -> Ugen -> Ugen-softClipAmp8 in_ pregain = mkUgen Nothing [AudioRate] (Right [0]) "SoftClipAmp8" [in_,pregain] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SoftClipper4 [AudioRate] in=0-softClipper4 :: Rate -> Ugen -> Ugen-softClipper4 rate in_ = mkUgen Nothing [AudioRate] (Left rate) "SoftClipper4" [in_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SoftClipper8 [AudioRate] in=0-softClipper8 :: Rate -> Ugen -> Ugen-softClipper8 rate in_ = mkUgen Nothing [AudioRate] (Left rate) "SoftClipper8" [in_] Nothing 1 (Special 0) NoId---- | LPC analizer.------ SonLPC [AudioRate] buff=-1.0 in=0.0 hop=0.5 poles=10.0-sonLPC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-sonLPC rate buff in_ hop poles = mkUgen Nothing [AudioRate] (Left rate) "SonLPC" [buff,in_,hop,poles] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SonLPCSynth [AudioRate] chain=-1.0-sonLPCSynth :: Rate -> Ugen -> Ugen-sonLPCSynth rate chain = mkUgen Nothing [AudioRate] (Left rate) "SonLPCSynth" [chain] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ SonLPCSynthIn [AudioRate] chain=-1.0 in=0.0-sonLPCSynthIn :: Rate -> Ugen -> Ugen -> Ugen-sonLPCSynthIn rate chain in_ = mkUgen Nothing [AudioRate] (Left rate) "SonLPCSynthIn" [chain,in_] Nothing 1 (Special 0) NoId---- | Karplus-Strong via a sorting algorithm------ SortBuf [AudioRate] bufnum=0 sortrate=10 reset=0-sortBuf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-sortBuf rate bufnum sortrate reset = mkUgen Nothing [AudioRate] (Left rate) "SortBuf" [bufnum,sortrate,reset] Nothing 1 (Special 0) NoId---- | Spectral feature extraction------ SpectralEntropy [ControlRate] fft=0 fftsize=2048 numbands=1; NC INPUT: True-spectralEntropy :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen-spectralEntropy numChannels rate fft_ fftsize numbands = mkUgen Nothing [ControlRate] (Left rate) "SpectralEntropy" [fft_,fftsize,numbands] Nothing numChannels (Special 0) NoId---- | (Undocumented class)------ Spreader [AudioRate] in=0 theta=1.5708 filtsPerOctave=8-spreader :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-spreader rate in_ theta filtsPerOctave = mkUgen Nothing [AudioRate] (Left rate) "Spreader" [in_,theta,filtsPerOctave] Nothing 2 (Special 0) NoId---- | Spruce bud worm model equations------ SpruceBudworm [AudioRate] reset=0 rate=0.1 k1=27.9 k2=1.5 alpha=0.1 beta=10.1 mu=0.3 rho=10.1 initx=0.9 inity=0.1-spruceBudworm :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-spruceBudworm rate reset rate_ k1 k2 alpha beta mu rho initx inity = mkUgen Nothing [AudioRate] (Left rate) "SpruceBudworm" [reset,rate_,k1,k2,alpha,beta,mu,rho,initx,inity] Nothing 2 (Special 0) NoId---- | Wave squeezer. Maybe a kind of pitch shifter.------ Squiz [ControlRate,AudioRate] in=0 pitchratio=2 zcperchunk=1 memlen=0.1; FILTER: TRUE-squiz :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-squiz in_ pitchratio zcperchunk memlen = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Squiz" [in_,pitchratio,zcperchunk,memlen] Nothing 1 (Special 0) NoId---- | standard map 2D chaotic generator------ Standard2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 k=1.4 x0=4.97898 y0=5.74734-standard2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-standard2DC rate minfreq maxfreq k x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Standard2DC" [minfreq,maxfreq,k,x0,y0] Nothing 1 (Special 0) NoId---- | standard map 2D chaotic generator------ Standard2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 k=1.4 x0=4.97898 y0=5.74734-standard2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-standard2DL rate minfreq maxfreq k x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Standard2DL" [minfreq,maxfreq,k,x0,y0] Nothing 1 (Special 0) NoId---- | standard map 2D chaotic generator------ Standard2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 k=1.4 x0=4.97898 y0=5.74734-standard2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-standard2DN rate minfreq maxfreq k x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "Standard2DN" [minfreq,maxfreq,k,x0,y0] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StandardTrig [ControlRate,AudioRate] minfreq=5 maxfreq=10 k=1.4 x0=4.97898 y0=5.74734-standardTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-standardTrig rate minfreq maxfreq k x0 y0 = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StandardTrig" [minfreq,maxfreq,k,x0,y0] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkBandedWG [ControlRate,AudioRate] freq=440 instr=0 bowpressure=0 bowmotion=0 integration=0 modalresonance=64 bowvelocity=0 setstriking=0 trig=1-stkBandedWG :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkBandedWG rate freq instr bowpressure bowmotion integration modalresonance bowvelocity setstriking trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkBandedWG" [freq,instr,bowpressure,bowmotion,integration,modalresonance,bowvelocity,setstriking,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkBeeThree [ControlRate,AudioRate] freq=440 op4gain=10 op3gain=20 lfospeed=64 lfodepth=0 adsrtarget=64 trig=1-stkBeeThree :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkBeeThree rate freq op4gain op3gain lfospeed lfodepth adsrtarget trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkBeeThree" [freq,op4gain,op3gain,lfospeed,lfodepth,adsrtarget,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkBlowHole [ControlRate,AudioRate] freq=440 reedstiffness=64 noisegain=20 tonehole=64 register=11 breathpressure=64-stkBlowHole :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkBlowHole rate freq reedstiffness noisegain tonehole register breathpressure = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkBlowHole" [freq,reedstiffness,noisegain,tonehole,register,breathpressure] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkBowed [ControlRate,AudioRate] freq=220 bowpressure=64 bowposition=64 vibfreq=64 vibgain=64 loudness=64 gate=1 attackrate=1 decayrate=1-stkBowed :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkBowed rate freq bowpressure bowposition vibfreq vibgain loudness_ gate_ attackrate decayrate = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkBowed" [freq,bowpressure,bowposition,vibfreq,vibgain,loudness_,gate_,attackrate,decayrate] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkClarinet [ControlRate,AudioRate] freq=440 reedstiffness=64 noisegain=4 vibfreq=64 vibgain=11 breathpressure=64 trig=1-stkClarinet :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkClarinet rate freq reedstiffness noisegain vibfreq vibgain breathpressure trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkClarinet" [freq,reedstiffness,noisegain,vibfreq,vibgain,breathpressure,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkFlute [ControlRate,AudioRate] freq=440 jetDelay=49 noisegain=0.15 jetRatio=0.32-stkFlute :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkFlute rate freq jetDelay noisegain jetRatio = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkFlute" [freq,jetDelay,noisegain,jetRatio] Nothing 1 (Special 0) NoId---- | Wrapping Synthesis toolkit.------ StkGlobals [AudioRate] showWarnings=0 printErrors=0 rawfilepath=0-stkGlobals :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-stkGlobals rate showWarnings printErrors rawfilepath = mkUgen Nothing [AudioRate] (Left rate) "StkGlobals" [showWarnings,printErrors,rawfilepath] Nothing 1 (Special 0) NoId---- | Wrapping Synthesis toolkit.------ StkInst [AudioRate] freq=220 gate=1 onamp=1 offamp=0.5 instNumber=6 *args=0; MCE=1, REORDERS INPUTS: [4,0,1,2,3,5]-stkInst :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkInst rate freq gate_ onamp offamp instNumber args = mkUgen Nothing [AudioRate] (Left rate) "StkInst" [freq,gate_,onamp,offamp,instNumber] (Just [args]) 1 (Special 0) NoId---- | (Undocumented class)------ StkMandolin [ControlRate,AudioRate] freq=520 bodysize=64 pickposition=64 stringdamping=69 stringdetune=10 aftertouch=64 trig=1-stkMandolin :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkMandolin rate freq bodysize pickposition stringdamping stringdetune aftertouch trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkMandolin" [freq,bodysize,pickposition,stringdamping,stringdetune,aftertouch,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkModalBar [ControlRate,AudioRate] freq=440 instrument=0 stickhardness=64 stickposition=64 vibratogain=20 vibratofreq=20 directstickmix=64 volume=64 trig=1-stkModalBar :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkModalBar rate freq instrument stickhardness stickposition vibratogain vibratofreq directstickmix volume trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkModalBar" [freq,instrument,stickhardness,stickposition,vibratogain,vibratofreq,directstickmix,volume,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkMoog [ControlRate,AudioRate] freq=440 filterQ=10 sweeprate=20 vibfreq=64 vibgain=0 gain=64 trig=1-stkMoog :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkMoog rate freq filterQ sweeprate vibfreq vibgain gain trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkMoog" [freq,filterQ,sweeprate,vibfreq,vibgain,gain,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkPluck [ControlRate,AudioRate] freq=440 decay=0.99-stkPluck :: Rate -> Ugen -> Ugen -> Ugen-stkPluck rate freq decay_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkPluck" [freq,decay_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkSaxofony [ControlRate,AudioRate] freq=220 reedstiffness=64 reedaperture=64 noisegain=20 blowposition=26 vibratofrequency=20 vibratogain=20 breathpressure=128 trig=1-stkSaxofony :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkSaxofony rate freq reedstiffness reedaperture noisegain blowposition vibratofrequency vibratogain breathpressure trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkSaxofony" [freq,reedstiffness,reedaperture,noisegain,blowposition,vibratofrequency,vibratogain,breathpressure,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkShakers [ControlRate,AudioRate] instr=0 energy=64 decay=64 objects=64 resfreq=64-stkShakers :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkShakers rate instr energy decay_ objects resfreq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkShakers" [instr,energy,decay_,objects,resfreq] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StkVoicForm [ControlRate,AudioRate] freq=440 vuvmix=64 vowelphon=64 vibfreq=64 vibgain=20 loudness=64 trig=1-stkVoicForm :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stkVoicForm rate freq vuvmix vowelphon vibfreq vibgain loudness_ trig_ = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "StkVoicForm" [freq,vuvmix,vowelphon,vibfreq,vibgain,loudness_,trig_] Nothing 1 (Special 0) NoId---- | String resonance filter------ Streson [ControlRate,AudioRate] input=0 delayTime=0.003 res=0.9; FILTER: TRUE-streson :: Ugen -> Ugen -> Ugen -> Ugen-streson input delayTime res = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Streson" [input,delayTime,res] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ StringVoice [AudioRate] trig=0 infsustain=0 freq=100 accent=0.5 structure=0.5 brightness=0.5 damping=0.5-stringVoice :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-stringVoice rate trig_ infsustain freq accent structure brightness damping = mkUgen Nothing [AudioRate] (Left rate) "StringVoice" [trig_,infsustain,freq,accent,structure,brightness,damping] Nothing 1 (Special 0) NoId---- | Pulse counter with floating point steps------ Summer [ControlRate,AudioRate] trig=0 step=1 reset=0 resetval=0; FILTER: TRUE-summer :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-summer trig_ step reset resetval = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "Summer" [trig_,step,reset,resetval] Nothing 1 (Special 0) NoId---- | feedback delay line implementing switch-and-ramp buffer jumping------ SwitchDelay [AudioRate] in=0 drylevel=1 wetlevel=1 delaytime=1 delayfactor=0.7 maxdelaytime=20; FILTER: TRUE-switchDelay :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-switchDelay in_ drylevel wetlevel delaytime delayfactor maxdelaytime = mkUgen Nothing [AudioRate] (Right [0]) "SwitchDelay" [in_,drylevel,wetlevel,delaytime,delayfactor,maxdelaytime] Nothing 1 (Special 0) NoId---- | triggered beta random distribution------ TBetaRand [ControlRate,AudioRate] lo=0 hi=1 prob1=0 prob2=0 trig=0; FILTER: TRUE, NONDET-tBetaRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tBetaRandId z lo hi prob1 prob2 trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [4]) "TBetaRand" [lo,hi,prob1,prob2,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of TBetaRand.-tBetaRandM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-tBetaRandM = liftUid5 tBetaRandId---- | Unsafe variant of TBetaRand.-tBetaRand :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tBetaRand = liftUnsafe5 tBetaRandM---- | triggered random walk generator------ TBrownRand [ControlRate,AudioRate] lo=0 hi=1 dev=1 dist=0 trig=0; FILTER: TRUE, NONDET-tBrownRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tBrownRandId z lo hi dev dist trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [4]) "TBrownRand" [lo,hi,dev,dist,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of TBrownRand.-tBrownRandM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen-tBrownRandM = liftUid5 tBrownRandId---- | Unsafe variant of TBrownRand.-tBrownRand :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tBrownRand = liftUnsafe5 tBrownRandM---- | triggered gaussian random distribution------ TGaussRand [ControlRate,AudioRate] lo=0 hi=1 trig=0; FILTER: TRUE, NONDET-tGaussRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen-tGaussRandId z lo hi trig_ = mkUgen Nothing [ControlRate,AudioRate] (Right [2]) "TGaussRand" [lo,hi,trig_] Nothing 1 (Special 0) (toUid z)---- | Monad variant of TGaussRand.-tGaussRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen-tGaussRandM = liftUid3 tGaussRandId---- | Unsafe variant of TGaussRand.-tGaussRand :: Ugen -> Ugen -> Ugen -> Ugen-tGaussRand = liftUnsafe3 tGaussRandM---- | buffer granulator with linear att/dec------ TGrains2 [AudioRate] trigger=0 bufnum=0 rate=1 centerPos=0 dur=0.1 pan=0 amp=0.1 att=0.5 dec=0.5 interp=4; NC INPUT: True-tGrains2 :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tGrains2 numChannels rate trigger bufnum rate_ centerPos dur pan amp att dec interp = mkUgen Nothing [AudioRate] (Left rate) "TGrains2" [trigger,bufnum,rate_,centerPos,dur,pan,amp,att,dec,interp] Nothing numChannels (Special 0) NoId---- | buffer granulator with user envelope------ TGrains3 [AudioRate] trigger=0 bufnum=0 rate=1 centerPos=0 dur=0.1 pan=0 amp=0.1 att=0.5 dec=0.5 window=1 interp=4; NC INPUT: True-tGrains3 :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tGrains3 numChannels rate trigger bufnum rate_ centerPos dur pan amp att dec window interp = mkUgen Nothing [AudioRate] (Left rate) "TGrains3" [trigger,bufnum,rate_,centerPos,dur,pan,amp,att,dec,window,interp] Nothing numChannels (Special 0) NoId---- | Tracking Phase Vocoder------ TPV [AudioRate] chain=0 windowsize=1024 hopsize=512 maxpeaks=80 currentpeaks=0 freqmult=1 tolerance=4 noisefloor=0.2-tpv :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tpv chain windowsize hopsize maxpeaks currentpeaks freqmult tolerance noisefloor = mkUgen Nothing [AudioRate] (Left AudioRate) "TPV" [chain,windowsize,hopsize,maxpeaks,currentpeaks,freqmult,tolerance,noisefloor] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ TTendency [ControlRate,AudioRate] trigger=0 dist=0 parX=0 parY=1 parA=0 parB=0-tTendency :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tTendency rate trigger dist parX parY parA parB = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "TTendency" [trigger,dist,parX,parY,parA,parB] Nothing 1 (Special 0) NoId---- | pitch tracker------ Tartini [ControlRate] in=0 threshold=0.93 n=2048 k=0 overlap=1024 smallCutoff=0.5-tartini :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tartini rate in_ threshold n k overlap smallCutoff = mkUgen Nothing [ControlRate] (Left rate) "Tartini" [in_,threshold,n,k,overlap,smallCutoff] Nothing 2 (Special 0) NoId---- | Neural Oscillator------ TermanWang [AudioRate] input=0 reset=0 ratex=0.01 ratey=0.01 alpha=1 beta=1 eta=1 initx=0 inity=0-termanWang :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-termanWang rate input reset ratex ratey alpha beta eta initx inity = mkUgen Nothing [AudioRate] (Left rate) "TermanWang" [input,reset,ratex,ratey,alpha,beta,eta,initx,inity] Nothing 1 (Special 0) NoId---- | display level of a Ugen as a textual meter------ TextVU [ControlRate,AudioRate] trig=2 in=0 label=0 width=21 reset=0 ana=0-textVU :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-textVU rate trig_ in_ label_ width reset ana = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "TextVU" [trig_,in_,label_,width,reset,ana] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Tilt [AudioRate] w=0 x=0 y=0 z=0 tilt=0-tilt :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tilt rate w x y z tilt_ = mkUgen Nothing [AudioRate] (Left rate) "Tilt" [w,x,y,z,tilt_] Nothing 1 (Special 0) NoId---- | triggered signal averager------ TrigAvg [ControlRate] in=0 trig=0-trigAvg :: Rate -> Ugen -> Ugen -> Ugen-trigAvg rate in_ trig_ = mkUgen Nothing [ControlRate] (Left rate) "TrigAvg" [in_,trig_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Tumble [AudioRate] w=0 x=0 y=0 z=0 tilt=0-tumble :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-tumble rate w x y z tilt_ = mkUgen Nothing [AudioRate] (Left rate) "Tumble" [w,x,y,z,tilt_] Nothing 1 (Special 0) NoId---- | physical modeling simulation; two tubes------ TwoTube [AudioRate] input=0 k=0.01 loss=1 d1length=100 d2length=100-twoTube :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-twoTube rate input k loss d1length d2length = mkUgen Nothing [AudioRate] (Left rate) "TwoTube" [input,k,loss,d1length,d2length] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ UHJ2B [AudioRate] ls=0 rs=0-uhj2b :: Rate -> Ugen -> Ugen -> Ugen-uhj2b rate ls rs = mkUgen Nothing [AudioRate] (Left rate) "UHJ2B" [ls,rs] Nothing 3 (Special 0) NoId---- | Vector Base Amplitude Panner------ VBAP [ControlRate,AudioRate] in=0 bufnum=0 azimuth=0 elevation=1 spread=0; NC INPUT: True-vbap :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vbap numChannels rate in_ bufnum azimuth elevation spread = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "VBAP" [in_,bufnum,azimuth,elevation,spread] Nothing numChannels (Special 0) NoId---- | a Chebyshev low/highpass filter------ VBChebyFilt [AudioRate] in=0 freq=880 mode=0 order=4-vbChebyFilt :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vbChebyFilt rate in_ freq mode order = mkUgen Nothing [AudioRate] (Left rate) "VBChebyFilt" [in_,freq,mode,order] Nothing 1 (Special 0) NoId---- | a chaotic oscillator network------ VBFourses [AudioRate] smoother=0.5 *freqarray=0; MCE=1, REORDERS INPUTS: [1,0]-vbFourses :: Rate -> Ugen -> Ugen -> Ugen-vbFourses rate smoother freqarray = mkUgen Nothing [AudioRate] (Left rate) "VBFourses" [smoother] (Just [freqarray]) 4 (Special 0) NoId---- | artifical reverberator------ VBJonVerb [AudioRate] in=0 decay=0.6 damping=0.3 inputbw=0.8 erfl=0.5 tail=0.5; FILTER: TRUE-vbJonVerb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vbJonVerb in_ decay_ damping inputbw erfl tail_ = mkUgen Nothing [AudioRate] (Right [0]) "VBJonVerb" [in_,decay_,damping,inputbw,erfl,tail_] Nothing 2 (Special 0) NoId---- | a simple phase vocoder for time-stretching------ VBPVoc [AudioRate] numChannels=0 bufnum=0 playpos=0 fftsize=2048-vbpVoc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vbpVoc rate numChannels bufnum playpos fftsize = mkUgen Nothing [AudioRate] (Left rate) "VBPVoc" [numChannels,bufnum,playpos,fftsize] Nothing 1 (Special 0) NoId---- | lowpass filter for envelope following------ VBSlide [KR,AR] in=0.0 slideup=50.0 slidedown=3000.0; FILTER: TRUE-vbSlide :: Ugen -> Ugen -> Ugen -> Ugen-vbSlide in_ slideup slidedown = mkUgen Nothing [ControlRate,AudioRate] (Right [0]) "VBSlide" [in_,slideup,slidedown] Nothing 1 (Special 0) NoId---- | 2D scanning pattern virtual machine------ VMScan2D [AudioRate] bufnum=0-vmScan2D :: Rate -> Ugen -> Ugen-vmScan2D rate bufnum = mkUgen Nothing [AudioRate] (Left rate) "VMScan2D" [bufnum] Nothing 2 (Special 0) NoId---- | vosim pulse generator------ VOSIM [AudioRate] trig=0.1 freq=400 nCycles=1 decay=0.9-vosim :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vosim rate trig_ freq nCycles decay_ = mkUgen Nothing [AudioRate] (Left rate) "VOSIM" [trig_,freq,nCycles,decay_] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ VarShapeOsc [ControlRate,AudioRate] freq=100 pw=0.5 waveshape=0.5 sync=1 syncfreq=105-varShapeOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-varShapeOsc rate freq pw waveshape sync syncfreq = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "VarShapeOsc" [freq,pw,waveshape,sync,syncfreq] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ VosimOsc [ControlRate,AudioRate] freq=100 form1freq=951 form2freq=919 shape=0-vosimOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-vosimOsc rate freq form1freq form2freq shape = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "VosimOsc" [freq,form1freq,form2freq,shape] Nothing 1 (Special 0) NoId---- | windowed amplitude follower------ WAmp [ControlRate] in=0 winSize=0.1-wAmp :: Rate -> Ugen -> Ugen -> Ugen-wAmp rate in_ winSize = mkUgen Nothing [ControlRate] (Left rate) "WAmp" [in_,winSize] Nothing 1 (Special 0) NoId---- | decomposition into square waves, and reconstruction------ WalshHadamard [AudioRate] input=0 which=0-walshHadamard :: Rate -> Ugen -> Ugen -> Ugen-walshHadamard rate input which = mkUgen Nothing [AudioRate] (Left rate) "WalshHadamard" [input,which] Nothing 1 (Special 0) NoId---- | Warp a buffer with a time pointer------ WarpZ [AudioRate] bufnum=0 pointer=0 freqScale=1 windowSize=0.2 envbufnum=-1 overlaps=8 windowRandRatio=0 interp=1 zeroSearch=0 zeroStart=0; NC INPUT: True-warpZ :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-warpZ numChannels rate bufnum pointer freqScale windowSize envbufnum overlaps windowRandRatio interp zeroSearch zeroStart = mkUgen Nothing [AudioRate] (Left rate) "WarpZ" [bufnum,pointer,freqScale,windowSize,envbufnum,overlaps,windowRandRatio,interp,zeroSearch,zeroStart] Nothing numChannels (Special 0) NoId---- | Lose bits of your waves------ WaveLoss [ControlRate,AudioRate] in=0 drop=20 outof=40 mode=1-waveLoss :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-waveLoss rate in_ drop_ outof mode = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "WaveLoss" [in_,drop_,outof,mode] Nothing 1 (Special 0) NoId---- | wave terrain synthesis------ WaveTerrain [AudioRate] bufnum=0 x=0 y=0 xsize=100 ysize=100-waveTerrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-waveTerrain rate bufnum x y xsize ysize = mkUgen Nothing [AudioRate] (Left rate) "WaveTerrain" [bufnum,x,y,xsize,ysize] Nothing 1 (Special 0) NoId---- | decomposition into Daub4 wavelets, and reconstruction------ WaveletDaub [AudioRate] input=0 n=64 which=0-waveletDaub :: Rate -> Ugen -> Ugen -> Ugen -> Ugen-waveletDaub rate input n which = mkUgen Nothing [AudioRate] (Left rate) "WaveletDaub" [input,n,which] Nothing 1 (Special 0) NoId---- | Weakly Nonlinear Oscillator------ WeaklyNonlinear [AudioRate] input=0 reset=0 ratex=1 ratey=1 freq=440 initx=0 inity=0 alpha=0 xexponent=0 beta=0 yexponent=0-weaklyNonlinear :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-weaklyNonlinear rate input reset ratex ratey freq initx inity alpha xexponent beta yexponent = mkUgen Nothing [AudioRate] (Left rate) "WeaklyNonlinear" [input,reset,ratex,ratey,freq,initx,inity,alpha,xexponent,beta,yexponent] Nothing 1 (Special 0) NoId---- | Weakly Nonlinear Oscillator------ WeaklyNonlinear2 [AudioRate] input=0 reset=0 ratex=1 ratey=1 freq=440 initx=0 inity=0 alpha=0 xexponent=0 beta=0 yexponent=0-weaklyNonlinear2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-weaklyNonlinear2 rate input reset ratex ratey freq initx inity alpha xexponent beta yexponent = mkUgen Nothing [AudioRate] (Left rate) "WeaklyNonlinear2" [input,reset,ratex,ratey,freq,initx,inity,alpha,xexponent,beta,yexponent] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ Werner [AudioRate] input=0 freq=0.5 damp=0.5 feedback=0.5 drive=0 oversample=1-werner :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-werner rate input freq damp feedback drive oversample = mkUgen Nothing [AudioRate] (Left rate) "Werner" [input,freq,damp,feedback,drive,oversample] Nothing 1 (Special 0) NoId---- | Pulse counter with floating point steps------ WrapSummer [ControlRate,AudioRate] trig=0 step=1 min=0 max=1 reset=0 resetval=0-wrapSummer :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-wrapSummer rate trig_ step min_ max_ reset resetval = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "WrapSummer" [trig_,step,min_,max_,reset,resetval] Nothing 1 (Special 0) NoId---- | (Undocumented class)------ ZOsc [ControlRate,AudioRate] freq=100 formantfreq=91 shape=0.5 mode=0.5-zOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-zOsc rate freq formantfreq shape mode = mkUgen Nothing [ControlRate,AudioRate] (Left rate) "ZOsc" [freq,formantfreq,shape,mode] Nothing 1 (Special 0) NoId+-- import Sound.Sc3.Common.Enum+-- import Sound.Sc3.Common.Envelope+import Sound.Sc3.Common.Rate+import Sound.Sc3.Common.Uid+import Sound.Sc3.Common.Unsafe++import Sound.Sc3.Ugen.Primitive+import Sound.Sc3.Ugen.Ugen+import Sound.Sc3.Ugen.Util++{- | (Undocumented class)++ A2B [AudioRate] a=0 b=0 c=0 d=0+-}+a2b :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+a2b rate a b c d = mkUgen Nothing [AudioRate] (Left rate) "A2B" [a, b, c, d] Nothing 4 (Special 0) NoId++{- | Emulator of the AY (aka YM) soundchip, used in Spectrum/Atari++ AY [AudioRate] tonea=1777 toneb=1666 tonec=1555 noise=1 control=7 vola=15 volb=15 volc=15 envfreq=4 envstyle=1 chiptype=0+-}+ay :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+ay rate tonea toneb tonec noise control_ vola volb volc envfreq envstyle chiptype = mkUgen Nothing [AudioRate] (Left rate) "AY" [tonea, toneb, tonec, noise, control_, vola, volb, volc, envfreq, envstyle, chiptype] Nothing 1 (Special 0) NoId++{- | AY-3-891X Chip Sound Simulator++ AY8910 [AudioRate] r0=0 r1=0 r2=0 r3=0 r4=0 r5=0 r6=0 r7=0 r8=0 r9=0 rA=0 rB=0 rC=0 rD=0 rate=1+-}+ay8910 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+ay8910 rate r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 rA rB rC rD rate_ = mkUgen Nothing [AudioRate] (Left rate) "AY8910" [r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, rA, rB, rC, rD, rate_] Nothing 3 (Special 0) NoId++{- | (Undocumented class)++ Allpass1 [AudioRate] in=0 freq=1200+-}+allpass1 :: Rate -> Ugen -> Ugen -> Ugen+allpass1 rate in_ freq = mkUgen Nothing [AudioRate] (Left rate) "Allpass1" [in_, freq] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Allpass2 [AudioRate] in=0 freq=1200 rq=1+-}+allpass2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+allpass2 rate in_ freq rq = mkUgen Nothing [AudioRate] (Left rate) "Allpass2" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | amplitude follower (deprecated)++ AmplitudeMod [ControlRate,AudioRate] in=0 attackTime=0.01 releaseTime=0.01+-}+amplitudeMod :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+amplitudeMod rate in_ attackTime releaseTime = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "AmplitudeMod" [in_, attackTime, releaseTime] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AnalogBassDrum [AudioRate] trig=0 infsustain=0 accent=0.5 freq=50 tone=0.5 decay=0.5 attackfm=0.5 selffm=0.25+-}+analogBassDrum :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+analogBassDrum rate trig_ infsustain accent freq tone decay_ attackfm selffm = mkUgen Nothing [AudioRate] (Left rate) "AnalogBassDrum" [trig_, infsustain, accent, freq, tone, decay_, attackfm, selffm] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AnalogFoldOsc [AudioRate] freq=100 amp=1+-}+analogFoldOsc :: Rate -> Ugen -> Ugen -> Ugen+analogFoldOsc rate freq amp = mkUgen Nothing [AudioRate] (Left rate) "AnalogFoldOsc" [freq, amp] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AnalogPhaser [AudioRate] input=0 lfoinput=0 skew=0 feedback=0.25 modulation=0.5 stages=8; FILTER: TRUE+-}+analogPhaser :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+analogPhaser input lfoinput skew feedback modulation stages = mkUgen Nothing [AudioRate] (Right [0]) "AnalogPhaser" [input, lfoinput, skew, feedback, modulation, stages] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AnalogPhaserMod [ControlRate,AudioRate] input=0 skew=0 modulation=0.5 stages=8; FILTER: TRUE+-}+analogPhaserMod :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+analogPhaserMod input skew modulation stages = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "AnalogPhaserMod" [input, skew, modulation, stages] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AnalogPulseShaper [AudioRate] pulseinput=0 width=0.5 decay=0.5 double=0.5+-}+analogPulseShaper :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+analogPulseShaper rate pulseinput width decay_ double = mkUgen Nothing [AudioRate] (Left rate) "AnalogPulseShaper" [pulseinput, width, decay_, double] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AnalogSnareDrum [AudioRate] trig=0 infsustain=0 accent=0.1 freq=200 tone=0.5 decay=0.5 snappy=0.5+-}+analogSnareDrum :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+analogSnareDrum rate trig_ infsustain accent freq tone decay_ snappy = mkUgen Nothing [AudioRate] (Left rate) "AnalogSnareDrum" [trig_, infsustain, accent, freq, tone, decay_, snappy] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AnalogTape [AudioRate] input=0 bias=0.5 saturation=0.5 drive=0.5 oversample=1 mode=0; FILTER: TRUE+-}+analogTape :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+analogTape input bias saturation drive oversample mode = mkUgen Nothing [AudioRate] (Right [0]) "AnalogTape" [input, bias, saturation, drive, oversample, mode] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AnalogVintageDistortion [AudioRate] input=0 drivegain=0.5 bias=0 lowgain=0.1 highgain=0.1 shelvingfreq=600 oversample=0; FILTER: TRUE+-}+analogVintageDistortion :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+analogVintageDistortion input drivegain bias lowgain highgain shelvingfreq oversample = mkUgen Nothing [AudioRate] (Right [0]) "AnalogVintageDistortion" [input, drivegain, bias, lowgain, highgain, shelvingfreq, oversample] Nothing 1 (Special 0) NoId++{- | event analyser (BBCut)++ AnalyseEvents2 [AudioRate] in=0 bufnum=0 threshold=0.34 triggerid=101 circular=0 pitch=0+-}+analyseEvents2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+analyseEvents2 rate in_ bufnum threshold triggerid circular pitch_ = mkUgen Nothing [AudioRate] (Left rate) "AnalyseEvents2" [in_, bufnum, threshold, triggerid, circular, pitch_] Nothing 1 (Special 0) NoId++{- | 2-species Predator-Prey model++ ArneodoCoulletTresser [AudioRate] freq=22050 alpha=1.5 h=0.05 xi=0.5 yi=0.5 zi=0.5+-}+arneodoCoulletTresser :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+arneodoCoulletTresser rate freq alpha h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "ArneodoCoulletTresser" [freq, alpha, h, xi, yi, zi] Nothing 3 (Special 0) NoId++{- | detect the largest value (and its position) in an array of Ugens++ ArrayMax [ControlRate,AudioRate] *array=0; MCE=1, FILTER: TRUE+-}+arrayMax :: Ugen -> Ugen+arrayMax array = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "ArrayMax" [] (Just [array]) 2 (Special 0) NoId++{- | detect the smallest value (and its position) in an array of Ugens++ ArrayMin [ControlRate,AudioRate] *array=0; MCE=1, FILTER: TRUE+-}+arrayMin :: Ugen -> Ugen+arrayMin array = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "ArrayMin" [] (Just [array]) 2 (Special 0) NoId++{- | Sound Chip Simulator++ Astrocade [AudioRate] reg0=0 reg1=127 reg2=0 reg3=0 reg4=0 reg5=0 reg6=15 reg7=0+-}+astrocade :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+astrocade rate reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 = mkUgen Nothing [AudioRate] (Left rate) "Astrocade" [reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7] Nothing 1 (Special 0) NoId++{- | TIA Chip Sound Simulator++ Atari2600 [AudioRate] audc0=1 audc1=2 audf0=3 audf1=4 audv0=5 audv1=5 rate=1+-}+atari2600 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+atari2600 rate audc0 audc1 audf0 audf1 audv0 audv1 rate_ = mkUgen Nothing [AudioRate] (Left rate) "Atari2600" [audc0, audc1, audf0, audf1, audv0, audv1, rate_] Nothing 1 (Special 0) NoId++{- | Use Amp data from a given partial++ AtsAmp [ControlRate,AudioRate] atsbuffer=0 partialNum=0 filePointer=0+-}+atsAmp :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+atsAmp rate atsbuffer partialNum filePointer = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "AtsAmp" [atsbuffer, partialNum, filePointer] Nothing 1 (Special 0) NoId++{- | (put short description here)++ AtsBand [AudioRate] atsbuffer=0 band=0 filePointer=0+-}+atsBand :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+atsBand rate atsbuffer band filePointer = mkUgen Nothing [AudioRate] (Left rate) "AtsBand" [atsbuffer, band, filePointer] Nothing 1 (Special 0) NoId++{- | Use Freq data from a given partial++ AtsFreq [ControlRate,AudioRate] atsbuffer=0 partialNum=0 filePointer=0+-}+atsFreq :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+atsFreq rate atsbuffer partialNum filePointer = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "AtsFreq" [atsbuffer, partialNum, filePointer] Nothing 1 (Special 0) NoId++{- | Resynthesize sine and noise data from an ATS analysis file++ AtsNoiSynth [AudioRate] atsbuffer=0 numPartials=0 partialStart=0 partialSkip=1 filePointer=0 sinePct=1 noisePct=1 freqMul=1 freqAdd=0 numBands=25 bandStart=0 bandSkip=1+-}+atsNoiSynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+atsNoiSynth rate atsbuffer numPartials partialStart partialSkip filePointer sinePct noisePct freqMul freqAdd numBands bandStart bandSkip = mkUgen Nothing [AudioRate] (Left rate) "AtsNoiSynth" [atsbuffer, numPartials, partialStart, partialSkip, filePointer, sinePct, noisePct, freqMul, freqAdd, numBands, bandStart, bandSkip] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ AtsNoise [ControlRate,AudioRate] atsbuffer=0 bandNum=0 filePointer=0+-}+atsNoise :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+atsNoise rate atsbuffer bandNum filePointer = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "AtsNoise" [atsbuffer, bandNum, filePointer] Nothing 1 (Special 0) NoId++{- | One Ugen to return both Amp and Freq info++ AtsParInfo [ControlRate,AudioRate] atsbuffer=0 partialNum=0 filePointer=0+-}+atsParInfo :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+atsParInfo rate atsbuffer partialNum filePointer = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "AtsParInfo" [atsbuffer, partialNum, filePointer] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ AtsPartial [AudioRate] atsbuffer=0 partial=0 filePointer=0 freqMul=1 freqAdd=0+-}+atsPartial :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+atsPartial rate atsbuffer partial filePointer freqMul freqAdd = mkUgen Nothing [AudioRate] (Left rate) "AtsPartial" [atsbuffer, partial, filePointer, freqMul, freqAdd] Nothing 1 (Special 0) NoId++{- | Resynthesize sine data from an ATS analysis file++ AtsSynth [AudioRate] atsbuffer=0 numPartials=0 partialStart=0 partialSkip=1 filePointer=0 freqMul=1 freqAdd=0+-}+atsSynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+atsSynth rate atsbuffer numPartials partialStart partialSkip filePointer freqMul freqAdd = mkUgen Nothing [AudioRate] (Left rate) "AtsSynth" [atsbuffer, numPartials, partialStart, partialSkip, filePointer, freqMul, freqAdd] Nothing 1 (Special 0) NoId++{- | Detect onsets and assess the nature of the attack slope++ AttackSlope [ControlRate] input=0 windowsize=1024 peakpicksize=20 leak=0.999 energythreshold=0.01 sumthreshold=20 mingap=30 numslopesaveraged=10+-}+attackSlope :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+attackSlope rate input windowsize peakpicksize leak energythreshold sumthreshold mingap numslopesaveraged = mkUgen Nothing [ControlRate] (Left rate) "AttackSlope" [input, windowsize, peakpicksize, leak, energythreshold, sumthreshold, mingap, numslopesaveraged] Nothing 6 (Special 0) NoId++{- | (Undocumented class)++ AudioMSG [AudioRate] in=0 index=0; FILTER: TRUE+-}+audioMSG :: Ugen -> Ugen -> Ugen+audioMSG in_ index_ = mkUgen Nothing [AudioRate] (Right [0]) "AudioMSG" [in_, index_] Nothing 1 (Special 0) NoId++{- | calculates mean average of audio or control rate signal++ AverageOutput [ControlRate,AudioRate] in=0 trig=0; FILTER: TRUE+-}+averageOutput :: Ugen -> Ugen -> Ugen+averageOutput in_ trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "AverageOutput" [in_, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ B2A [AudioRate] w=0 x=0 y=0 z=0+-}+b2a :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+b2a rate w x y z = mkUgen Nothing [AudioRate] (Left rate) "B2A" [w, x, y, z] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ B2Ster [AudioRate] w=0 x=0 y=0+-}+b2Ster :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+b2Ster rate w x y = mkUgen Nothing [AudioRate] (Left rate) "B2Ster" [w, x, y] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ B2UHJ [AudioRate] w=0 x=0 y=0+-}+b2uhj :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+b2uhj rate w x y = mkUgen Nothing [AudioRate] (Left rate) "B2UHJ" [w, x, y] Nothing 2 (Special 0) NoId++{- | MultiOut BetaBlocker VChip++ BBlockerBuf [AudioRate] freq=0 bufnum=0 startpoint=0+-}+bBlockerBuf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+bBlockerBuf rate freq bufnum startpoint = mkUgen Nothing [AudioRate] (Left rate) "BBlockerBuf" [freq, bufnum, startpoint] Nothing 9 (Special 0) NoId++{- | 3D Ambisonic decoder++ BFDecode1 [AudioRate] w=0 x=0 y=0 z=0 azimuth=0 elevation=0 wComp=0+-}+bfDecode1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bfDecode1 rate w x y z azimuth elevation wComp = mkUgen Nothing [AudioRate] (Left rate) "BFDecode1" [w, x, y, z, azimuth, elevation, wComp] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BFDecoder [] maxSize=0+-}+bfDecoder :: Rate -> Ugen -> Ugen+bfDecoder rate maxSize = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "BFDecoder" [maxSize] Nothing 1 (Special 0) NoId++{- | Ambisonic B format encoder++ BFEncode1 [AudioRate] in=0 azimuth=0 elevation=0 rho=1 gain=1 wComp=0+-}+bfEncode1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bfEncode1 rate in_ azimuth elevation rho gain wComp = mkUgen Nothing [AudioRate] (Left rate) "BFEncode1" [in_, azimuth, elevation, rho, gain, wComp] Nothing 4 (Special 0) NoId++{- | Ambisonic B format encoder++ BFEncode2 [AudioRate] in=0 point_x=1 point_y=1 elevation=0 gain=1 wComp=0+-}+bfEncode2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bfEncode2 rate in_ point_x point_y elevation gain wComp = mkUgen Nothing [AudioRate] (Left rate) "BFEncode2" [in_, point_x, point_y, elevation, gain, wComp] Nothing 4 (Special 0) NoId++{- | Ambisonic B format encoder for stereo signals++ BFEncodeSter [AudioRate] l=0 r=0 azimuth=0 width=1.5708 elevation=0 rho=1 gain=1 wComp=0+-}+bfEncodeSter :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bfEncodeSter rate l r azimuth width elevation rho gain wComp = mkUgen Nothing [AudioRate] (Left rate) "BFEncodeSter" [l, r, azimuth, width, elevation, rho, gain, wComp] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ BFGrainPanner [] maxSize=0+-}+bfGrainPanner :: Rate -> Ugen -> Ugen+bfGrainPanner rate maxSize = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "BFGrainPanner" [maxSize] Nothing 1 (Special 0) NoId++{- | BFormat sound manipulation++ BFManipulate [AudioRate] w=0 x=0 y=0 z=0 rotate=0 tilt=0 tumble=0+-}+bfManipulate :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bfManipulate rate w x y z rotate_ tilt_ tumble_ = mkUgen Nothing [AudioRate] (Left rate) "BFManipulate" [w, x, y, z, rotate_, tilt_, tumble_] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ BFPanner [] maxSize=0+-}+bfPanner :: Rate -> Ugen -> Ugen+bfPanner rate maxSize = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "BFPanner" [maxSize] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BLBufRd [ControlRate,AudioRate] bufnum=0 phase=0 ratio=1+-}+blBufRd :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+blBufRd rate bufnum phase ratio = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "BLBufRd" [bufnum, phase, ratio] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BLOsc [ControlRate,AudioRate] freq=100 pulsewidth=0.5 waveform=0+-}+blOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+blOsc rate freq pulsewidth waveform = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "BLOsc" [freq, pulsewidth, waveform] Nothing 1 (Special 0) NoId++{- | 24db/oct rolloff - 4nd order resonant Low/High/Band Pass Filter++ BMoog [AudioRate] in=0 freq=440 q=0.2 mode=0 saturation=0.95; FILTER: TRUE+-}+bMoog :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bMoog in_ freq q mode saturation = mkUgen Nothing [AudioRate] (Right [0]) "BMoog" [in_, freq, q, mode, saturation] Nothing 1 (Special 0) NoId++{- | Balances two signals with each other++ Balance [AudioRate] in=0 test=0 hp=10 stor=0+-}+balance :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+balance rate in_ test hp stor = mkUgen Nothing [AudioRate] (Left rate) "Balance" [in_, test, hp, stor] Nothing 1 (Special 0) NoId++{- | Extracts statistics on a beat histogram++ BeatStatistics [ControlRate] fft=0 leak=0.995 numpreviousbeats=4+-}+beatStatistics :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+beatStatistics rate fft_ leak numpreviousbeats = mkUgen Nothing [ControlRate] (Left rate) "BeatStatistics" [fft_, leak, numpreviousbeats] Nothing 4 (Special 0) NoId++{- | Sound Chip Simulator (well...)++ Beep [AudioRate] freq=3250 vol=1+-}+beep :: Rate -> Ugen -> Ugen -> Ugen+beep rate freq vol = mkUgen Nothing [AudioRate] (Left rate) "Beep" [freq, vol] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BeepU [] maxSize=0+-}+beepU :: Rate -> Ugen -> Ugen+beepU rate maxSize = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "BeepU" [maxSize] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BinData [ControlRate,AudioRate] buffer=0 bin=0 overlaps=0.5+-}+binData :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+binData rate buffer bin overlaps = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "BinData" [buffer, bin, overlaps] Nothing 2 (Special 0) NoId++{- | Band limited impulse generation++ BlitB3 [AudioRate] freq=440+-}+blitB3 :: Rate -> Ugen -> Ugen+blitB3 rate freq = mkUgen Nothing [AudioRate] (Left rate) "BlitB3" [freq] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BlitB3D [AudioRate] freq=440+-}+blitB3D :: Rate -> Ugen -> Ugen+blitB3D rate freq = mkUgen Nothing [AudioRate] (Left rate) "BlitB3D" [freq] Nothing 1 (Special 0) NoId++{- | BLIT derived sawtooth++ BlitB3Saw [AudioRate] freq=440 leak=0.99+-}+blitB3Saw :: Rate -> Ugen -> Ugen -> Ugen+blitB3Saw rate freq leak = mkUgen Nothing [AudioRate] (Left rate) "BlitB3Saw" [freq, leak] Nothing 1 (Special 0) NoId++{- | Bipolar BLIT derived square waveform++ BlitB3Square [AudioRate] freq=440 leak=0.99+-}+blitB3Square :: Rate -> Ugen -> Ugen -> Ugen+blitB3Square rate freq leak = mkUgen Nothing [AudioRate] (Left rate) "BlitB3Square" [freq, leak] Nothing 1 (Special 0) NoId++{- | Bipolar BLIT derived triangle++ BlitB3Tri [AudioRate] freq=440 leak=0.99 leak2=0.99+-}+blitB3Tri :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+blitB3Tri rate freq leak leak2 = mkUgen Nothing [AudioRate] (Left rate) "BlitB3Tri" [freq, leak, leak2] Nothing 1 (Special 0) NoId++{- | breakcore simulator++ Breakcore [AudioRate] bufnum=0 capturein=0 capturetrigger=0 duration=0.1 ampdropout=0+-}+breakcore :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+breakcore rate bufnum capturein capturetrigger duration ampdropout = mkUgen Nothing [AudioRate] (Left rate) "Breakcore" [bufnum, capturein, capturetrigger, duration, ampdropout] Nothing 1 (Special 0) NoId++{- | Prigogine oscillator++ Brusselator [AudioRate] reset=0 rate=0.01 mu=1 gamma=1 initx=0.5 inity=0.5+-}+brusselator :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+brusselator rate reset rate_ mu gamma initx inity = mkUgen Nothing [AudioRate] (Left rate) "Brusselator" [reset, rate_, mu, gamma, initx, inity] Nothing 2 (Special 0) NoId++{- | Granular synthesis with sound sampled in a buffer++ BufGrain [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 interp=2+-}+bufGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufGrain rate trigger dur sndbuf rate_ pos interp = mkUgen Nothing [AudioRate] (Left rate) "BufGrain" [trigger, dur, sndbuf, rate_, pos, interp] Nothing 1 (Special 0) NoId++{- | Granular synthesis with sound sampled in a buffer and user supplied envelope++ BufGrainB [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 envbuf=0 interp=2+-}+bufGrainB :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufGrainB rate trigger dur sndbuf rate_ pos envbuf interp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainB" [trigger, dur, sndbuf, rate_, pos, envbuf, interp] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BufGrainBBF [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 envbuf=0 azimuth=0 elevation=0 rho=1 interp=2 wComp=0+-}+bufGrainBBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufGrainBBF rate trigger dur sndbuf rate_ pos envbuf azimuth elevation rho interp wComp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainBBF" [trigger, dur, sndbuf, rate_, pos, envbuf, azimuth, elevation, rho, interp, wComp] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ BufGrainBF [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 azimuth=0 elevation=0 rho=1 interp=2 wComp=0+-}+bufGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufGrainBF rate trigger dur sndbuf rate_ pos azimuth elevation rho interp wComp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainBF" [trigger, dur, sndbuf, rate_, pos, azimuth, elevation, rho, interp, wComp] Nothing 4 (Special 0) NoId++{- | Granular synthesis with sound sampled in a buffer and user supplied envelopes++ BufGrainI [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 envbuf1=0 envbuf2=0 ifac=0.5 interp=2+-}+bufGrainI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufGrainI rate trigger dur sndbuf rate_ pos envbuf1 envbuf2 ifac interp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainI" [trigger, dur, sndbuf, rate_, pos, envbuf1, envbuf2, ifac, interp] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ BufGrainIBF [AudioRate] trigger=0 dur=1 sndbuf=0 rate=1 pos=0 envbuf1=0 envbuf2=0 ifac=0.5 azimuth=0 elevation=0 rho=1 interp=2 wComp=0+-}+bufGrainIBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bufGrainIBF rate trigger dur sndbuf rate_ pos envbuf1 envbuf2 ifac azimuth elevation rho interp wComp = mkUgen Nothing [AudioRate] (Left rate) "BufGrainIBF" [trigger, dur, sndbuf, rate_, pos, envbuf1, envbuf2, ifac, azimuth, elevation, rho, interp, wComp] Nothing 4 (Special 0) NoId++{- | detect the largest value (and its position) in an array of Ugens++ BufMax [ControlRate] bufnum=0 gate=1+-}+bufMax :: Rate -> Ugen -> Ugen -> Ugen+bufMax rate bufnum gate_ = mkUgen Nothing [ControlRate] (Left rate) "BufMax" [bufnum, gate_] Nothing 2 (Special 0) NoId++{- | detect the largest value (and its position) in an array of Ugens++ BufMin [ControlRate] bufnum=0 gate=1+-}+bufMin :: Rate -> Ugen -> Ugen -> Ugen+bufMin rate bufnum gate_ = mkUgen Nothing [ControlRate] (Left rate) "BufMin" [bufnum, gate_] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ CQ_Diff [ControlRate] in1=0 in2=0 databufnum=0+-}+cq_Diff :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+cq_Diff rate in1 in2 databufnum = mkUgen Nothing [ControlRate] (Left rate) "CQ_Diff" [in1, in2, databufnum] Nothing 1 (Special 0) NoId++{- | Quefrency analysis and liftering++ Cepstrum [] cepbuf=0 fftchain=0+-}+cepstrum :: Rate -> Ugen -> Ugen -> Ugen+cepstrum rate cepbuf fftchain = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "Cepstrum" [cepbuf, fftchain] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Chen [ControlRate,AudioRate] speed=0.5 a=0.5 b=0.3 c=0.28+-}+chen :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+chen rate speed a b c = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Chen" [speed, a, b, c] Nothing 3 (Special 0) NoId++{- | Octave chroma band based representation of energy in a signal; Chromagram for nTET tuning systems with any base reference++ Chromagram [ControlRate] fft=0 fftsize=2048 n=12 tuningbase=32.7032 octaves=8 integrationflag=0 coeff=0.9 octaveratio=2 perframenormalize=0+-}+chromagram :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+chromagram rate fft_ fftsize n tuningbase octaves integrationflag coeff octaveratio perframenormalize = mkUgen Nothing [ControlRate] (Left rate) "Chromagram" [fft_, fftsize, n, tuningbase, octaves, integrationflag, coeff, octaveratio, perframenormalize] Nothing 12 (Special 0) NoId++{- | circular linear lag++ CircleRamp [ControlRate,AudioRate] in=0 lagTime=0.1 circmin=-180 circmax=180+-}+circleRamp :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+circleRamp rate in_ lagTime circmin circmax = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "CircleRamp" [in_, lagTime, circmin, circmax] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Clipper32 [AudioRate] in=0 lo=-0.8 hi=0.8+-}+clipper32 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+clipper32 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "Clipper32" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Clipper4 [AudioRate] in=0 lo=-0.8 hi=0.8+-}+clipper4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+clipper4 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "Clipper4" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Clipper8 [AudioRate] in=0 lo=-0.8 hi=0.8+-}+clipper8 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+clipper8 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "Clipper8" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Clockmus [ControlRate]+-}+clockmus :: Rate -> Ugen+clockmus rate = mkUgen Nothing [ControlRate] (Left rate) "Clockmus" [] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ CombLP [AudioRate] in=0 gate=1 maxdelaytime=0.2 delaytime=0.2 decaytime=1 coef=0.5+-}+combLP :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+combLP rate in_ gate_ maxdelaytime delaytime decaytime coef = mkUgen Nothing [AudioRate] (Left rate) "CombLP" [in_, gate_, maxdelaytime, delaytime, decaytime, coef] Nothing 1 (Special 0) NoId++{- | FM-modulable resonating filter++ ComplexRes [AudioRate] in=0 freq=100 decay=0.2; FILTER: TRUE+-}+complexRes :: Ugen -> Ugen -> Ugen -> Ugen+complexRes in_ freq decay_ = mkUgen Nothing [AudioRate] (Right [0]) "ComplexRes" [in_, freq, decay_] Nothing 1 (Special 0) NoId++{- | Concatenative Cross-Synthesis on Live Streams++ Concat [AudioRate] control=0 source=0 storesize=1 seektime=1 seekdur=1 matchlength=0.05 freezestore=0 zcr=1 lms=1 sc=1 st=0 randscore=0+-}+concat :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+concat rate control_ source storesize seektime seekdur matchlength freezestore zcr lms sc st randscore = mkUgen Nothing [AudioRate] (Left rate) "Concat" [control_, source, storesize, seektime, seekdur, matchlength, freezestore, zcr, lms, sc, st, randscore] Nothing 1 (Special 0) NoId++{- | Concatenative Cross-Synthesis on Live Streams++ Concat2 [AudioRate] control=0 source=0 storesize=1 seektime=1 seekdur=1 matchlength=0.05 freezestore=0 zcr=1 lms=1 sc=1 st=0 randscore=0 threshold=0.01+-}+concat2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+concat2 rate control_ source storesize seektime seekdur matchlength freezestore zcr lms sc st randscore threshold = mkUgen Nothing [AudioRate] (Left rate) "Concat2" [control_, source, storesize, seektime, seekdur, matchlength, freezestore, zcr, lms, sc, st, randscore, threshold] Nothing 1 (Special 0) NoId++{- | an amplitude tracking based onset detector++ Coyote [ControlRate] in=0 trackFall=0.2 slowLag=0.2 fastLag=0.01 fastMul=0.5 thresh=0.05 minDur=0.1+-}+coyote :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+coyote rate in_ trackFall slowLag fastLag fastMul thresh minDur = mkUgen Nothing [ControlRate] (Left rate) "Coyote" [in_, trackFall, slowLag, fastLag, fastMul, thresh, minDur] Nothing 1 (Special 0) NoId++{- | Measure the temporal crest factor of a signal++ Crest [ControlRate] in=0 numsamps=400 gate=1+-}+crest :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+crest rate in_ numsamps gate_ = mkUgen Nothing [ControlRate] (Left rate) "Crest" [in_, numsamps, gate_] Nothing 1 (Special 0) NoId++{- | class B/AB power amp distortion simulation++ CrossoverDistortion [AudioRate] in=0 amp=0.5 smooth=0.5; FILTER: TRUE+-}+crossoverDistortion :: Ugen -> Ugen -> Ugen -> Ugen+crossoverDistortion in_ amp smooth = mkUgen Nothing [AudioRate] (Right [0]) "CrossoverDistortion" [in_, amp, smooth] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ DCompressor [AudioRate] input=0 sidechainIn=0 sidechain=0 ratio=4 threshold=-40 attack=0.1 release=100.1 makeup=0.5 automakeup=1; FILTER: TRUE+-}+dCompressor :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dCompressor input sidechainIn sidechain ratio threshold attack release makeup automakeup = mkUgen Nothing [AudioRate] (Right [0]) "DCompressor" [input, sidechainIn, sidechain, ratio, threshold, attack, release, makeup, automakeup] Nothing 1 (Special 0) NoId++{- | Digitally modelled analog filter++ DFM1 [AudioRate] in=0 freq=1000 res=0.1 inputgain=1 type=0 noiselevel=0.0003; FILTER: TRUE+-}+dfm1 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dfm1 in_ freq res inputgain type_ noiselevel = mkUgen Nothing [AudioRate] (Right [0]) "DFM1" [in_, freq, res, inputgain, type_, noiselevel] Nothing 1 (Special 0) NoId++{- | Demand rate implementation of a Wiard noise ring++ DNoiseRing [DemandRate] change=0.5 chance=0.5 shift=1 numBits=8 resetval=0; DEMAND/NONDET+-}+dNoiseRingId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dNoiseRingId z change chance shift numBits resetval = mkUgen Nothing [DemandRate] (Left DemandRate) "DNoiseRing" [change, chance, shift, numBits, resetval] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of DNoiseRing.+dNoiseRingM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+dNoiseRingM = liftUid5 dNoiseRingId++-- | Unsafe variant of DNoiseRing.+dNoiseRing :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dNoiseRing = liftUnsafe5 dNoiseRingM++{- | Triangle via 3rd order differerentiated polynomial waveform++ DPW3Tri [AudioRate] freq=440+-}+dpw3Tri :: Rate -> Ugen -> Ugen+dpw3Tri rate freq = mkUgen Nothing [AudioRate] (Left rate) "DPW3Tri" [freq] Nothing 1 (Special 0) NoId++{- | Sawtooth via 4th order differerentiated polynomial waveform++ DPW4Saw [AudioRate] freq=440+-}+dpw4Saw :: Rate -> Ugen -> Ugen+dpw4Saw rate freq = mkUgen Nothing [AudioRate] (Left rate) "DPW4Saw" [freq] Nothing 1 (Special 0) NoId++{- | Plucked physical model.++ DWGBowed [AudioRate] freq=440 velb=0.5 force=1 gate=1 pos=0.14 release=0.1 c1=1 c3=3 impZ=0.55 fB=2+-}+dwgBowed :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgBowed rate freq velb force gate_ pos release c1 c3 impZ fB = mkUgen Nothing [AudioRate] (Left rate) "DWGBowed" [freq, velb, force, gate_, pos, release, c1, c3, impZ, fB] Nothing 1 (Special 0) NoId++{- | Plucked physical model.++ DWGBowedSimple [AudioRate] freq=440 velb=0.5 force=1 gate=1 pos=0.14 release=0.1 c1=1 c3=30+-}+dwgBowedSimple :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgBowedSimple rate freq velb force gate_ pos release c1 c3 = mkUgen Nothing [AudioRate] (Left rate) "DWGBowedSimple" [freq, velb, force, gate_, pos, release, c1, c3] Nothing 1 (Special 0) NoId++{- | Plucked physical model.++ DWGBowedTor [AudioRate] freq=440 velb=0.5 force=1 gate=1 pos=0.14 release=0.1 c1=1 c3=3 impZ=0.55 fB=2 mistune=5.2 c1tor=1 c3tor=3000 iZtor=1.8+-}+dwgBowedTor :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgBowedTor rate freq velb force gate_ pos release c1 c3 impZ fB mistune c1tor c3tor iZtor = mkUgen Nothing [AudioRate] (Left rate) "DWGBowedTor" [freq, velb, force, gate_, pos, release, c1, c3, impZ, fB, mistune, c1tor, c3tor, iZtor] Nothing 1 (Special 0) NoId++{- | Clarinet physical model.++ DWGClarinet3 [AudioRate] freq=440.0 pm=1.0 pc=1.0 m=0.8 gate=1.0 release=1.0e-2 c1=0.25 c3=7.0+-}+dwgClarinet3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgClarinet3 rate freq pm pc m gate_ release c1 c3 = mkUgen Nothing [AudioRate] (Left rate) "DWGClarinet3" [freq, pm, pc, m, gate_, release, c1, c3] Nothing 1 (Special 0) NoId++{- | Reimplementation of STK flute model.++ DWGFlute [AudioRate] freq=400.0 pm=1.0 endr=0.5 jetr=0.25 jetRa=0.33 gate=1.0 release=0.1+-}+dwgFlute :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgFlute rate freq pm endr jetr jetRa gate_ release = mkUgen Nothing [AudioRate] (Left rate) "DWGFlute" [freq, pm, endr, jetr, jetRa, gate_, release] Nothing 1 (Special 0) NoId++{- | Plucked physical model.++ DWGPlucked [AudioRate] freq=440 amp=0.5 gate=1 pos=0.14 c1=1 c3=30 inp=0 release=0.1+-}+dwgPlucked :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgPlucked rate freq amp gate_ pos c1 c3 inp release = mkUgen Nothing [AudioRate] (Left rate) "DWGPlucked" [freq, amp, gate_, pos, c1, c3, inp, release] Nothing 1 (Special 0) NoId++{- | Plucked physical model.++ DWGPlucked2 [AudioRate] freq=440 amp=0.5 gate=1 pos=0.14 c1=1 c3=30 inp=0 release=0.1 mistune=1.008 mp=0.55 gc=0.01+-}+dwgPlucked2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgPlucked2 rate freq amp gate_ pos c1 c3 inp release mistune mp gc = mkUgen Nothing [AudioRate] (Left rate) "DWGPlucked2" [freq, amp, gate_, pos, c1, c3, inp, release, mistune, mp, gc] Nothing 1 (Special 0) NoId++{- | Plucked physical model.++ DWGPluckedStiff [AudioRate] freq=440 amp=0.5 gate=1 pos=0.14 c1=1 c3=30 inp=0 release=0.1 fB=2+-}+dwgPluckedStiff :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgPluckedStiff rate freq amp gate_ pos c1 c3 inp release fB = mkUgen Nothing [AudioRate] (Left rate) "DWGPluckedStiff" [freq, amp, gate_, pos, c1, c3, inp, release, fB] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ DWGSoundBoard [AudioRate] inp=0 c1=20 c3=20 mix=0.8 d1=199 d2=211 d3=223 d4=227 d5=229 d6=233 d7=239 d8=241; FILTER: TRUE+-}+dwgSoundBoard :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dwgSoundBoard inp c1 c3 mix d1 d2 d3 d4 d5 d6 d7 d8 = mkUgen Nothing [AudioRate] (Right [0]) "DWGSoundBoard" [inp, c1, c3, mix, d1, d2, d3, d4, d5, d6, d7, d8] Nothing 1 (Special 0) NoId++{- | demand rate brownian movement with Gendyn distributions++ Dbrown2 [] lo=0 hi=0 step=0 dist=0 length=100000000+-}+dbrown2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dbrown2 rate lo hi step dist length_ = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "Dbrown2" [lo, hi, step, dist, length_] Nothing 1 (Special 0) NoId++{- | demand rate tag system on a buffer++ DbufTag [DemandRate] bufnum=0 v=0 axiom=0 rules=0 recycle=0 mode=0; DEMAND/NONDET+-}+dbufTagId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dbufTagId z bufnum v axiom rules recycle mode = mkUgen Nothing [DemandRate] (Left DemandRate) "DbufTag" [bufnum, v, axiom, rules, recycle, mode] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of DbufTag.+dbufTagM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+dbufTagM = liftUid6 dbufTagId++-- | Unsafe variant of DbufTag.+dbufTag :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dbufTag = liftUnsafe6 dbufTagM++{- | Samplerate and bitrate reduction++ Decimator [AudioRate] in=0 rate=44100 bits=24+-}+decimator :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+decimator rate in_ rate_ bits = mkUgen Nothing [AudioRate] (Left rate) "Decimator" [in_, rate_, bits] Nothing 1 (Special 0) NoId++{- | Demand version of the BetaBlocker VChip++ DetaBlockerBuf [DemandRate] bufnum=0 startpoint=0; DEMAND/NONDET+-}+detaBlockerBufId :: ID a => a -> Ugen -> Ugen -> Ugen+detaBlockerBufId z bufnum startpoint = mkUgen Nothing [DemandRate] (Left DemandRate) "DetaBlockerBuf" [bufnum, startpoint] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of DetaBlockerBuf.+detaBlockerBufM :: Uid m => Ugen -> Ugen -> m Ugen+detaBlockerBufM = liftUid2 detaBlockerBufId++-- | Unsafe variant of DetaBlockerBuf.+detaBlockerBuf :: Ugen -> Ugen -> Ugen+detaBlockerBuf = liftUnsafe2 detaBlockerBufM++{- | demand rate finite state machine++ Dfsm [DemandRate] rules=0 n=1 rgen=0; DEMAND/NONDET+-}+dfsmId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+dfsmId z rules n rgen = mkUgen Nothing [DemandRate] (Left DemandRate) "Dfsm" [rules, n, rgen] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Dfsm.+dfsmM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+dfsmM = liftUid3 dfsmId++-- | Unsafe variant of Dfsm.+dfsm :: Ugen -> Ugen -> Ugen -> Ugen+dfsm = liftUnsafe3 dfsmM++{- | (Undocumented class)++ Dgauss [] lo=0 hi=0 length=100000000+-}+dgauss :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+dgauss rate lo hi length_ = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "Dgauss" [lo, hi, length_] Nothing 1 (Special 0) NoId++{- | Ring modulation based on the physical model of a diode.++ DiodeRingMod [AudioRate] car=0 mod=0; FILTER: TRUE+-}+diodeRingMod :: Ugen -> Ugen -> Ugen+diodeRingMod car mod_ = mkUgen Nothing [AudioRate] (Right [0]) "DiodeRingMod" [car, mod_] Nothing 1 (Special 0) NoId++{- | port of some ladspa plugins++ Disintegrator [AudioRate] in=0 probability=0.5 multiplier=0; FILTER: TRUE, NONDET+-}+disintegratorId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+disintegratorId z in_ probability multiplier = mkUgen Nothing [AudioRate] (Right [0]) "Disintegrator" [in_, probability, multiplier] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of Disintegrator.+disintegratorM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+disintegratorM = liftUid3 disintegratorId++-- | Unsafe variant of Disintegrator.+disintegrator :: Ugen -> Ugen -> Ugen -> Ugen+disintegrator = liftUnsafe3 disintegratorM++{- | discrete time neurodynamics++ Dneuromodule [ControlRate,AudioRate,DemandRate] dt=0 *theta=0 *x=0 *weights=0; MCE=3, NC INPUT: True, NONDET+-}+dneuromoduleId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dneuromoduleId numChannels z dt theta x weights = mkUgen Nothing [ControlRate, AudioRate, DemandRate] (Left DemandRate) "Dneuromodule" [dt] (Just [theta, x, weights]) numChannels (Special 0) (toUid z)++-- | Monad variant of Dneuromodule.+dneuromoduleM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+dneuromoduleM = liftUid5 dneuromoduleId++-- | Unsafe variant of Dneuromodule.+dneuromodule :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dneuromodule = liftUnsafe5 dneuromoduleM++{- | Nested Allpass filters as proposed by Vercoe and Pluckett++ DoubleNestedAllpassC [AudioRate] in=0 maxdelay1=0.0047 delay1=0.0047 gain1=0.15 maxdelay2=0.022 delay2=0.022 gain2=0.25 maxdelay3=0.0083 delay3=0.0083 gain3=0.3; FILTER: TRUE+-}+doubleNestedAllpassC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+doubleNestedAllpassC in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 maxdelay3 delay3 gain3 = mkUgen Nothing [AudioRate] (Right [0]) "DoubleNestedAllpassC" [in_, maxdelay1, delay1_, gain1, maxdelay2, delay2_, gain2, maxdelay3, delay3, gain3] Nothing 1 (Special 0) NoId++{- | Nested Allpass filters as proposed by Vercoe and Pluckett++ DoubleNestedAllpassL [AudioRate] in=0 maxdelay1=0.0047 delay1=0.0047 gain1=0.15 maxdelay2=0.022 delay2=0.022 gain2=0.25 maxdelay3=0.0083 delay3=0.0083 gain3=0.3; FILTER: TRUE+-}+doubleNestedAllpassL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+doubleNestedAllpassL in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 maxdelay3 delay3 gain3 = mkUgen Nothing [AudioRate] (Right [0]) "DoubleNestedAllpassL" [in_, maxdelay1, delay1_, gain1, maxdelay2, delay2_, gain2, maxdelay3, delay3, gain3] Nothing 1 (Special 0) NoId++{- | Nested Allpass filters as proposed by Vercoe and Pluckett++ DoubleNestedAllpassN [AudioRate] in=0 maxdelay1=0.0047 delay1=0.0047 gain1=0.15 maxdelay2=0.022 delay2=0.022 gain2=0.25 maxdelay3=0.0083 delay3=0.0083 gain3=0.3; FILTER: TRUE+-}+doubleNestedAllpassN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+doubleNestedAllpassN in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 maxdelay3 delay3 gain3 = mkUgen Nothing [AudioRate] (Right [0]) "DoubleNestedAllpassN" [in_, maxdelay1, delay1_, gain1, maxdelay2, delay2_, gain2, maxdelay3, delay3, gain3] Nothing 1 (Special 0) NoId++{- | Forced DoubleWell Oscillator++ DoubleWell [AudioRate] reset=0 ratex=0.01 ratey=0.01 f=1 w=0.001 delta=1 initx=0 inity=0+-}+doubleWell :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+doubleWell rate reset ratex ratey f w delta initx inity = mkUgen Nothing [AudioRate] (Left rate) "DoubleWell" [reset, ratex, ratey, f, w, delta, initx, inity] Nothing 1 (Special 0) NoId++{- | Forced DoubleWell Oscillator++ DoubleWell2 [AudioRate] reset=0 ratex=0.01 ratey=0.01 f=1 w=0.001 delta=1 initx=0 inity=0+-}+doubleWell2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+doubleWell2 rate reset ratex ratey f w delta initx inity = mkUgen Nothing [AudioRate] (Left rate) "DoubleWell2" [reset, ratex, ratey, f, w, delta, initx, inity] Nothing 1 (Special 0) NoId++{- | Forced DoubleWell Oscillator++ DoubleWell3 [AudioRate] reset=0 rate=0.01 f=0 delta=0.25 initx=0 inity=0+-}+doubleWell3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+doubleWell3 rate reset rate_ f delta initx inity = mkUgen Nothing [AudioRate] (Left rate) "DoubleWell3" [reset, rate_, f, delta, initx, inity] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ DriveNoise [AudioRate] in=0 amount=1 multi=5+-}+driveNoise :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+driveNoise rate in_ amount multi = mkUgen Nothing [AudioRate] (Left rate) "DriveNoise" [in_, amount, multi] Nothing 1 (Special 0) NoId++{- | Crosscorrelation search and drum pattern matching beat tracker++ DrumTrack [ControlRate] in=0 lock=0 dynleak=0 tempowt=0 phasewt=0 basswt=0 patternwt=1 prior=0 kicksensitivity=1 snaresensitivity=1 debugmode=0+-}+drumTrack :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+drumTrack rate in_ lock dynleak tempowt phasewt basswt patternwt prior kicksensitivity snaresensitivity debugmode = mkUgen Nothing [ControlRate] (Left rate) "DrumTrack" [in_, lock, dynleak, tempowt, phasewt, basswt, patternwt, prior, kicksensitivity, snaresensitivity, debugmode] Nothing 4 (Special 0) NoId++{- | demand rate tag system++ Dtag [] bufsize=0 v=0 axiom=0 rules=0 recycle=0 mode=0+-}+dtag :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dtag rate bufsize v axiom rules recycle mode = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "Dtag" [bufsize, v, axiom, rules, recycle, mode] Nothing 1 (Special 0) NoId++{- | Envelope Follower Filter++ EnvDetect [AudioRate] in=0 attack=100 release=0+-}+envDetect :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+envDetect rate in_ attack release = mkUgen Nothing [AudioRate] (Left rate) "EnvDetect" [in_, attack, release] Nothing 1 (Special 0) NoId++{- | Envelope Follower++ EnvFollow [ControlRate,AudioRate] input=0 decaycoeff=0.99+-}+envFollow :: Rate -> Ugen -> Ugen -> Ugen+envFollow rate input decaycoeff = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "EnvFollow" [input, decaycoeff] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FFTComplexDev [ControlRate] buffer=0 rectify=0 powthresh=0.1+-}+fftComplexDev :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+fftComplexDev rate buffer rectify powthresh = mkUgen Nothing [ControlRate] (Left rate) "FFTComplexDev" [buffer, rectify, powthresh] Nothing 1 (Special 0) NoId++{- | Spectral crest measure++ FFTCrest [ControlRate] buffer=0 freqlo=0 freqhi=50000+-}+fftCrest :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+fftCrest rate buffer freqlo freqhi = mkUgen Nothing [ControlRate] (Left rate) "FFTCrest" [buffer, freqlo, freqhi] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FFTDiffMags [ControlRate] bufferA=0 bufferB=0+-}+fftDiffMags :: Rate -> Ugen -> Ugen -> Ugen+fftDiffMags rate bufferA bufferB = mkUgen Nothing [ControlRate] (Left rate) "FFTDiffMags" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FFTFlux [ControlRate] buffer=0 normalise=1+-}+fftFlux :: Rate -> Ugen -> Ugen -> Ugen+fftFlux rate buffer normalise = mkUgen Nothing [ControlRate] (Left rate) "FFTFlux" [buffer, normalise] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FFTFluxPos [ControlRate] buffer=0 normalise=1+-}+fftFluxPos :: Rate -> Ugen -> Ugen -> Ugen+fftFluxPos rate buffer normalise = mkUgen Nothing [ControlRate] (Left rate) "FFTFluxPos" [buffer, normalise] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FFTMKL [ControlRate] buffer=0 epsilon=0.0+-}+fftmkl :: Rate -> Ugen -> Ugen -> Ugen+fftmkl rate buffer epsilon = mkUgen Nothing [ControlRate] (Left rate) "FFTMKL" [buffer, epsilon] Nothing 1 (Special 0) NoId++{- | Find peak value in an FFT frame++ FFTPeak [ControlRate] buffer=0 freqlo=0 freqhi=50000+-}+fftPeak :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+fftPeak rate buffer freqlo freqhi = mkUgen Nothing [ControlRate] (Left rate) "FFTPeak" [buffer, freqlo, freqhi] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ FFTPhaseDev [ControlRate] buffer=0 weight=0 powthresh=0.1+-}+fftPhaseDev :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+fftPhaseDev rate buffer weight powthresh = mkUgen Nothing [ControlRate] (Left rate) "FFTPhaseDev" [buffer, weight, powthresh] Nothing 1 (Special 0) NoId++{- | Instantaneous spectral power++ FFTPower [ControlRate] buffer=0 square=1+-}+fftPower :: Rate -> Ugen -> Ugen -> Ugen+fftPower rate buffer square = mkUgen Nothing [ControlRate] (Left rate) "FFTPower" [buffer, square] Nothing 1 (Special 0) NoId++{- | Spectral slope++ FFTSlope [ControlRate] buffer=0+-}+fftSlope :: Rate -> Ugen -> Ugen+fftSlope rate buffer = mkUgen Nothing [ControlRate] (Left rate) "FFTSlope" [buffer] Nothing 1 (Special 0) NoId++{- | Spectral spread++ FFTSpread [ControlRate] buffer=0 centroid=0+-}+fftSpread :: Rate -> Ugen -> Ugen -> Ugen+fftSpread rate buffer centroid = mkUgen Nothing [ControlRate] (Left rate) "FFTSpread" [buffer, centroid] Nothing 1 (Special 0) NoId++{- | Spectral flatness, divided into subbands++ FFTSubbandFlatness [ControlRate] chain=0 cutfreqs=0+-}+fftSubbandFlatness :: Rate -> Ugen -> Ugen -> Ugen+fftSubbandFlatness rate chain cutfreqs = mkUgen Nothing [ControlRate] (Left rate) "FFTSubbandFlatness" [chain, cutfreqs] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FFTSubbandFlux [ControlRate] chain=0 cutfreqs=0 posonly=0+-}+fftSubbandFlux :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+fftSubbandFlux rate chain cutfreqs posonly = mkUgen Nothing [ControlRate] (Left rate) "FFTSubbandFlux" [chain, cutfreqs, posonly] Nothing 1 (Special 0) NoId++{- | Spectral power, divided into subbands++ FFTSubbandPower [ControlRate] chain=0 cutfreqs=0 square=1 scalemode=1+-}+fftSubbandPower :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fftSubbandPower rate chain cutfreqs square scalemode = mkUgen Nothing [ControlRate] (Left rate) "FFTSubbandPower" [chain, cutfreqs, square, scalemode] Nothing 1 (Special 0) NoId++{- | Phase modulation oscillator matrix.++ FM7 [AudioRate] *ctlMatrix=0 *modMatrix=0; MCE=2+-}+fm7 :: Rate -> Ugen -> Ugen -> Ugen+fm7 rate ctlMatrix modMatrix = mkUgen Nothing [AudioRate] (Left rate) "FM7" [] (Just [ctlMatrix, modMatrix]) 6 (Special 0) NoId++{- | Granular synthesis with FM grains++ FMGrain [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1; FILTER: TRUE+-}+fmGrain :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmGrain trigger dur carfreq modfreq index_ = mkUgen Nothing [AudioRate] (Right [0]) "FMGrain" [trigger, dur, carfreq, modfreq, index_] Nothing 1 (Special 0) NoId++{- | Granular synthesis with FM grains and user supplied envelope++ FMGrainB [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 envbuf=0; FILTER: TRUE+-}+fmGrainB :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmGrainB trigger dur carfreq modfreq index_ envbuf = mkUgen Nothing [AudioRate] (Right [0]) "FMGrainB" [trigger, dur, carfreq, modfreq, index_, envbuf] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FMGrainBBF [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 envbuf=0 azimuth=0 elevation=0 rho=1 wComp=0+-}+fmGrainBBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmGrainBBF rate trigger dur carfreq modfreq index_ envbuf azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "FMGrainBBF" [trigger, dur, carfreq, modfreq, index_, envbuf, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ FMGrainBF [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 azimuth=0 elevation=0 rho=1 wComp=0+-}+fmGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmGrainBF rate trigger dur carfreq modfreq index_ azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "FMGrainBF" [trigger, dur, carfreq, modfreq, index_, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | Granular synthesis with FM grains and user supplied envelopes++ FMGrainI [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 envbuf1=0 envbuf2=0 ifac=0.5+-}+fmGrainI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmGrainI rate trigger dur carfreq modfreq index_ envbuf1 envbuf2 ifac = mkUgen Nothing [AudioRate] (Left rate) "FMGrainI" [trigger, dur, carfreq, modfreq, index_, envbuf1, envbuf2, ifac] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FMGrainIBF [AudioRate] trigger=0 dur=1 carfreq=440 modfreq=200 index=1 envbuf1=0 envbuf2=0 ifac=0.5 azimuth=0 elevation=0 rho=1 wComp=0+-}+fmGrainIBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmGrainIBF rate trigger dur carfreq modfreq index_ envbuf1 envbuf2 ifac azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "FMGrainIBF" [trigger, dur, carfreq, modfreq, index_, envbuf1, envbuf2, ifac, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | Decode an FMH signal for a specific speaker++ FMHDecode1 [AudioRate] w=0 x=0 y=0 z=0 r=0 s=0 t=0 u=0 v=0 azimuth=0 elevation=0+-}+fmhDecode1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmhDecode1 rate w x y z r s t u v azimuth elevation = mkUgen Nothing [AudioRate] (Left rate) "FMHDecode1" [w, x, y, z, r, s, t, u, v, azimuth, elevation] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FMHEncode0 [AudioRate] in=0 azimuth=0 elevation=0 gain=1+-}+fmhEncode0 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmhEncode0 rate in_ azimuth elevation gain = mkUgen Nothing [AudioRate] (Left rate) "FMHEncode0" [in_, azimuth, elevation, gain] Nothing 9 (Special 0) NoId++{- | Second Order Ambisonic encoder++ FMHEncode1 [AudioRate] in=0 azimuth=0 elevation=0 rho=1 gain=1 wComp=0+-}+fmhEncode1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmhEncode1 rate in_ azimuth elevation rho gain wComp = mkUgen Nothing [AudioRate] (Left rate) "FMHEncode1" [in_, azimuth, elevation, rho, gain, wComp] Nothing 9 (Special 0) NoId++{- | Second Order Ambisonic encoder++ FMHEncode2 [AudioRate] in=0 point_x=0 point_y=0 elevation=0 gain=1 wComp=0+-}+fmhEncode2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fmhEncode2 rate in_ point_x point_y elevation gain wComp = mkUgen Nothing [AudioRate] (Left rate) "FMHEncode2" [in_, point_x, point_y, elevation, gain, wComp] Nothing 9 (Special 0) NoId++{- | Storing feature data from Ugens in NRT mode++ FeatureSave [ControlRate] features=0 trig=0+-}+featureSave :: Rate -> Ugen -> Ugen -> Ugen+featureSave rate features trig_ = mkUgen Nothing [ControlRate] (Left rate) "FeatureSave" [features, trig_] Nothing 1 (Special 0) NoId++{- | FitzHughNagumo Neuron Firing Oscillator++ Fhn2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 urate=0.1 wrate=0.1 b0=0.6 b1=0.8 i=0 u0=0 w0=0+-}+fhn2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fhn2DC rate minfreq maxfreq urate wrate b0 b1 i u0 w0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Fhn2DC" [minfreq, maxfreq, urate, wrate, b0, b1, i, u0, w0] Nothing 1 (Special 0) NoId++{- | FitzHughNagumo Neuron Firing Oscillator++ Fhn2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 urate=0.1 wrate=0.1 b0=0.6 b1=0.8 i=0 u0=0 w0=0+-}+fhn2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fhn2DL rate minfreq maxfreq urate wrate b0 b1 i u0 w0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Fhn2DL" [minfreq, maxfreq, urate, wrate, b0, b1, i, u0, w0] Nothing 1 (Special 0) NoId++{- | FitzHughNagumo Neuron Firing Oscillator++ Fhn2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 urate=0.1 wrate=0.1 b0=0.6 b1=0.8 i=0 u0=0 w0=0+-}+fhn2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fhn2DN rate minfreq maxfreq urate wrate b0 b1 i u0 w0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Fhn2DN" [minfreq, maxfreq, urate, wrate, b0, b1, i, u0, w0] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FhnTrig [ControlRate,AudioRate] minfreq=4 maxfreq=10 urate=0.1 wrate=0.1 b0=0.6 b1=0.8 i=0 u0=0 w0=0+-}+fhnTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fhnTrig rate minfreq maxfreq urate wrate b0 b1 i u0 w0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "FhnTrig" [minfreq, maxfreq, urate, wrate, b0, b1, i, u0, w0] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ FincoSprottL [AudioRate] freq=22050 a=2.45 h=0.05 xi=0 yi=0 zi=0+-}+fincoSprottL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fincoSprottL rate freq a h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "FincoSprottL" [freq, a, h, xi, yi, zi] Nothing 3 (Special 0) NoId++{- | (Undocumented class)++ FincoSprottM [AudioRate] freq=22050 a=-7 b=4 h=0.05 xi=0 yi=0 zi=0+-}+fincoSprottM :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fincoSprottM rate freq a b h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "FincoSprottM" [freq, a, b, h, xi, yi, zi] Nothing 3 (Special 0) NoId++{- | (Undocumented class)++ FincoSprottS [AudioRate] freq=22050 a=8 b=2 h=0.05 xi=0 yi=0 zi=0+-}+fincoSprottS :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fincoSprottS rate freq a b h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "FincoSprottS" [freq, a, b, h, xi, yi, zi] Nothing 3 (Special 0) NoId++{- | Neuron Firing Model Oscillator++ FitzHughNagumo [AudioRate] reset=0 rateu=0.01 ratew=0.01 b0=1 b1=1 initu=0 initw=0+-}+fitzHughNagumo :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+fitzHughNagumo rate reset rateu ratew b0 b1 initu initw = mkUgen Nothing [AudioRate] (Left rate) "FitzHughNagumo" [reset, rateu, ratew, b0, b1, initu, initw] Nothing 1 (Special 0) NoId++{- | calculates spectral MSE distance of two fft chains++ FrameCompare [ControlRate] buffer1=0 buffer2=0 wAmount=0.5+-}+frameCompare :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+frameCompare rate buffer1 buffer2 wAmount = mkUgen Nothing [ControlRate] (Left rate) "FrameCompare" [buffer1, buffer2, wAmount] Nothing 1 (Special 0) NoId++{- | A physical model of a system with dry-friction. A chaotic filter.++ Friction [ControlRate,AudioRate] in=0 friction=0.5 spring=0.414 damp=0.313 mass=0.1 beltmass=1+-}+friction :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+friction rate in_ friction_ spring_ damp mass beltmass = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Friction" [in_, friction_, spring_, damp, mass, beltmass] Nothing 1 (Special 0) NoId++{- | Single gammatone filter++ Gammatone [AudioRate] input=0 centrefrequency=440 bandwidth=200; FILTER: TRUE+-}+gammatone :: Ugen -> Ugen -> Ugen -> Ugen+gammatone input centrefrequency bandwidth = mkUgen Nothing [AudioRate] (Right [0]) "Gammatone" [input, centrefrequency, bandwidth] Nothing 1 (Special 0) NoId++{- | Gaussian classifier++ GaussClass [ControlRate] in=0 bufnum=0 gate=0+-}+gaussClass :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+gaussClass rate in_ bufnum gate_ = mkUgen Nothing [ControlRate] (Left rate) "GaussClass" [in_, bufnum, gate_] Nothing 1 (Special 0) NoId++{- | impulses around a certain frequency++ GaussTrig [ControlRate,AudioRate] freq=440 dev=0.3+-}+gaussTrig :: Rate -> Ugen -> Ugen -> Ugen+gaussTrig rate freq dev = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "GaussTrig" [freq, dev] Nothing 1 (Special 0) NoId++{- | gingerbreadman map 2D chaotic generator++ Gbman2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 x0=1.2 y0=2.1+-}+gbman2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gbman2DC rate minfreq maxfreq x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Gbman2DC" [minfreq, maxfreq, x0, y0] Nothing 1 (Special 0) NoId++{- | gingerbreadman map 2D chaotic generator++ Gbman2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 x0=1.2 y0=2.1+-}+gbman2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gbman2DL rate minfreq maxfreq x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Gbman2DL" [minfreq, maxfreq, x0, y0] Nothing 1 (Special 0) NoId++{- | gingerbreadman map 2D chaotic generator++ Gbman2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 x0=1.2 y0=2.1+-}+gbman2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gbman2DN rate minfreq maxfreq x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Gbman2DN" [minfreq, maxfreq, x0, y0] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ GbmanTrig [ControlRate,AudioRate] minfreq=5 maxfreq=10 x0=1.2 y0=2.1+-}+gbmanTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gbmanTrig rate minfreq maxfreq x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "GbmanTrig" [minfreq, maxfreq, x0, y0] Nothing 1 (Special 0) NoId++{- | Dynamic stochastic synthesis generator++ Gendy4 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 minfreq=440 maxfreq=660 ampscale=0.5 durscale=0.5 initCPs=12 knum=0+-}+gendy4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gendy4 rate ampdist durdist adparam ddparam minfreq maxfreq ampscale durscale initCPs knum = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Gendy4" [ampdist, durdist, adparam, ddparam, minfreq, maxfreq, ampscale, durscale, initCPs, knum] Nothing 1 (Special 0) NoId++{- | Dynamic stochastic synthesis generator++ Gendy5 [ControlRate,AudioRate] ampdist=1 durdist=1 adparam=1 ddparam=1 minfreq=440 maxfreq=660 ampscale=0.5 durscale=0.5 initCPs=12 knum=0+-}+gendy5 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gendy5 rate ampdist durdist adparam ddparam minfreq maxfreq ampscale durscale initCPs knum = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Gendy5" [ampdist, durdist, adparam, ddparam, minfreq, maxfreq, ampscale, durscale, initCPs, knum] Nothing 1 (Special 0) NoId++{- | Read (numeric) shell environment variables into a synth++ Getenv [] key=0 defaultval=0+-}+getenv :: Rate -> Ugen -> Ugen -> Ugen+getenv rate key defaultval = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "Getenv" [key, defaultval] Nothing 1 (Special 0) NoId++{- | backward compatibility++ GlitchBPF [ControlRate,AudioRate] in=0 freq=440 rq=1+-}+glitchBPF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+glitchBPF rate in_ freq rq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "GlitchBPF" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | backward compatibility++ GlitchBRF [ControlRate,AudioRate] in=0 freq=440 rq=1+-}+glitchBRF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+glitchBRF rate in_ freq rq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "GlitchBRF" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | backward compatibility++ GlitchHPF [ControlRate,AudioRate] in=0 freq=440+-}+glitchHPF :: Rate -> Ugen -> Ugen -> Ugen+glitchHPF rate in_ freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "GlitchHPF" [in_, freq] Nothing 1 (Special 0) NoId++{- | backward compatibility++ GlitchRHPF [ControlRate,AudioRate] in=0 freq=440 rq=1; FILTER: TRUE+-}+glitchRHPF :: Ugen -> Ugen -> Ugen -> Ugen+glitchRHPF in_ freq rq = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "GlitchRHPF" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | Calculate a single DFT bin, to detect presence of a frequency++ Goertzel [ControlRate] in=0 bufsize=1024 freq=0 hop=1+-}+goertzel :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+goertzel rate in_ bufsize freq hop = mkUgen Nothing [ControlRate] (Left rate) "Goertzel" [in_, bufsize, freq, hop] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ GrainBufJ [AudioRate] numChannels=1 trigger=0 dur=1 sndbuf=0 rate=1 pos=0 loop=0 interp=2 grainAmp=1 pan=0 envbufnum=-1 maxGrains=512+-}+grainBufJ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+grainBufJ rate numChannels trigger dur sndbuf rate_ pos loop interp grainAmp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left rate) "GrainBufJ" [numChannels, trigger, dur, sndbuf, rate_, pos, loop, interp, grainAmp, pan, envbufnum, maxGrains] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ GrainFMJ [AudioRate] numChannels=1 trigger=0 dur=1 carfreq=440 modfreq=200 index=1 grainAmp=1 pan=0 envbufnum=-1 maxGrains=512+-}+grainFMJ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+grainFMJ rate numChannels trigger dur carfreq modfreq index_ grainAmp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left rate) "GrainFMJ" [numChannels, trigger, dur, carfreq, modfreq, index_, grainAmp, pan, envbufnum, maxGrains] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ GrainInJ [AudioRate] numChannels=1 trigger=0 dur=1 in=0 grainAmp=1 pan=0 envbufnum=-1 maxGrains=512+-}+grainInJ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+grainInJ rate numChannels trigger dur in_ grainAmp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left rate) "GrainInJ" [numChannels, trigger, dur, in_, grainAmp, pan, envbufnum, maxGrains] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ GrainSinJ [AudioRate] numChannels=1 trigger=0 dur=1 freq=440 grainAmp=1 pan=0 envbufnum=-1 maxGrains=512+-}+grainSinJ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+grainSinJ rate numChannels trigger dur freq grainAmp pan envbufnum maxGrains = mkUgen Nothing [AudioRate] (Left rate) "GrainSinJ" [numChannels, trigger, dur, freq, grainAmp, pan, envbufnum, maxGrains] Nothing 1 (Special 0) NoId++{- | dynamical system simulation (Newtonian gravitational force)++ GravityGrid [AudioRate] reset=0 rate=0.1 newx=0 newy=0 bufnum=0+-}+gravityGrid :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gravityGrid rate reset rate_ newx newy bufnum = mkUgen Nothing [AudioRate] (Left rate) "GravityGrid" [reset, rate_, newx, newy, bufnum] Nothing 1 (Special 0) NoId++{- | dynamical system simulation (Newtonian gravitational force)++ GravityGrid2 [AudioRate] reset=0 rate=0.1 newx=0 newy=0 bufnum=0+-}+gravityGrid2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+gravityGrid2 rate reset rate_ newx newy bufnum = mkUgen Nothing [AudioRate] (Left rate) "GravityGrid2" [reset, rate_, newx, newy, bufnum] Nothing 1 (Special 0) NoId++{- | algorithmic delay++ GreyholeRaw [AudioRate] in1=0 in2=0 damping=0 delaytime=2 diffusion=0.5 feedback=0.9 moddepth=0.1 modfreq=2 size=1; FILTER: TRUE+-}+greyholeRaw :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+greyholeRaw in1 in2 damping delaytime diffusion feedback moddepth modfreq size = mkUgen Nothing [AudioRate] (Right [0, 1]) "GreyholeRaw" [in1, in2, damping, delaytime, diffusion, feedback, moddepth, modfreq, size] Nothing 2 (Special 0) NoId++{- | Simple cochlear hair cell model++ HairCell [ControlRate,AudioRate] input=0 spontaneousrate=0 boostrate=200 restorerate=1000 loss=0.99; FILTER: TRUE+-}+hairCell :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+hairCell input spontaneousrate boostrate restorerate loss = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "HairCell" [input, spontaneousrate, boostrate, restorerate, loss] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ HarmonicOsc [ControlRate,AudioRate] freq=100 firstharmonic=1 *amplitudes=0; MCE=1+-}+harmonicOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+harmonicOsc rate freq firstharmonic amplitudes = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "HarmonicOsc" [freq, firstharmonic] (Just [amplitudes]) 1 (Special 0) NoId++{- | henon map 2D chaotic generator++ Henon2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1.4 b=0.3 x0=0.30502 y0=0.20939+-}+henon2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+henon2DC rate minfreq maxfreq a b x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Henon2DC" [minfreq, maxfreq, a, b, x0, y0] Nothing 1 (Special 0) NoId++{- | henon map 2D chaotic generator++ Henon2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1.4 b=0.3 x0=0.30502 y0=0.20939+-}+henon2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+henon2DL rate minfreq maxfreq a b x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Henon2DL" [minfreq, maxfreq, a, b, x0, y0] Nothing 1 (Special 0) NoId++{- | henon map 2D chaotic generator++ Henon2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1.4 b=0.3 x0=0.30502 y0=0.20939+-}+henon2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+henon2DN rate minfreq maxfreq a b x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Henon2DN" [minfreq, maxfreq, a, b, x0, y0] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ HenonTrig [ControlRate,AudioRate] minfreq=5 maxfreq=10 a=1.4 b=0.3 x0=0.30502 y0=0.20939+-}+henonTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+henonTrig rate minfreq maxfreq a b x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "HenonTrig" [minfreq, maxfreq, a, b, x0, y0] Nothing 1 (Special 0) NoId++{- | Transform a cepstrum back to a spectrum++ ICepstrum [] cepchain=0 fftbuf=0+-}+iCepstrum :: Rate -> Ugen -> Ugen -> Ugen+iCepstrum rate cepchain fftbuf = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "ICepstrum" [cepchain, fftbuf] Nothing 1 (Special 0) NoId++{- | 24db/oct rolloff, 4nd order resonant Low Pass Filter++ IirFilter [AudioRate] in=0 freq=440 rq=1; FILTER: TRUE+-}+iirFilter :: Ugen -> Ugen -> Ugen -> Ugen+iirFilter in_ freq rq = mkUgen Nothing [AudioRate] (Right [0]) "IirFilter" [in_, freq, rq] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ InGrain [AudioRate] trigger=0 dur=1 in=0+-}+inGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+inGrain rate trigger dur in_ = mkUgen Nothing [AudioRate] (Left rate) "InGrain" [trigger, dur, in_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ InGrainB [AudioRate] trigger=0 dur=1 in=0 envbuf=0+-}+inGrainB :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+inGrainB rate trigger dur in_ envbuf = mkUgen Nothing [AudioRate] (Left rate) "InGrainB" [trigger, dur, in_, envbuf] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ InGrainBBF [AudioRate] trigger=0 dur=1 in=0 envbuf=0 azimuth=0 elevation=0 rho=1 wComp=0+-}+inGrainBBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+inGrainBBF rate trigger dur in_ envbuf azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "InGrainBBF" [trigger, dur, in_, envbuf, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ InGrainBF [AudioRate] trigger=0 dur=1 in=0 azimuth=0 elevation=0 rho=1 wComp=0+-}+inGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+inGrainBF rate trigger dur in_ azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "InGrainBF" [trigger, dur, in_, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ InGrainI [AudioRate] trigger=0 dur=1 in=0 envbuf1=0 envbuf2=0 ifac=0.5+-}+inGrainI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+inGrainI rate trigger dur in_ envbuf1 envbuf2 ifac = mkUgen Nothing [AudioRate] (Left rate) "InGrainI" [trigger, dur, in_, envbuf1, envbuf2, ifac] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ InGrainIBF [AudioRate] trigger=0 dur=1 in=0 envbuf1=0 envbuf2=0 ifac=0.5 azimuth=0 elevation=0 rho=1 wComp=0+-}+inGrainIBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+inGrainIBF rate trigger dur in_ envbuf1 envbuf2 ifac azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "InGrainIBF" [trigger, dur, in_, envbuf1, envbuf2, ifac, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | Distortion by subtracting magnitude from 1++ InsideOut [ControlRate,AudioRate] in=0+-}+insideOut :: Rate -> Ugen -> Ugen+insideOut rate in_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "InsideOut" [in_] Nothing 1 (Special 0) NoId++{- | instruction synthesis (breakpoint set interpreter)++ Instruction [AudioRate] bufnum=0+-}+instruction :: Rate -> Ugen -> Ugen+instruction rate bufnum = mkUgen Nothing [AudioRate] (Left rate) "Instruction" [bufnum] Nothing 1 (Special 0) NoId++{- | Raw version of the JPverb algorithmic reverberator, designed to produce long tails with chorusing++ JPverbRaw [ControlRate,AudioRate] in1=0 in2=0 damp=0 earlydiff=0.707 highband=2000 highx=1 lowband=500 lowx=1 mdepth=0.1 mfreq=2 midx=1 size=1 t60=1; FILTER: TRUE+-}+jPverbRaw :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+jPverbRaw in1 in2 damp earlydiff highband highx lowband lowx mdepth mfreq midx size t60 = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "JPverbRaw" [in1, in2, damp, earlydiff, highband, highx, lowband, lowx, mdepth, mfreq, midx, size, t60] Nothing 2 (Special 0) NoId++{- | k-means classification in real time++ KMeansRT [ControlRate] bufnum=0 inputdata=0 k=5 gate=1 reset=0 learn=1+-}+kMeansRT :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+kMeansRT rate bufnum inputdata k gate_ reset learn = mkUgen Nothing [ControlRate] (Left rate) "KMeansRT" [bufnum, inputdata, k, gate_, reset, learn] Nothing 1 (Special 0) NoId++{- | Running score of maximum correlation of chromagram with key profiles++ KeyClarity [ControlRate] chain=0 keydecay=2 chromaleak=0.5+-}+keyClarity :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+keyClarity rate chain keydecay chromaleak = mkUgen Nothing [ControlRate] (Left rate) "KeyClarity" [chain, keydecay, chromaleak] Nothing 1 (Special 0) NoId++{- | Find best correlated key mode with chromagram between major, minor and chromatic cluster++ KeyMode [ControlRate] chain=0 keydecay=2 chromaleak=0.5+-}+keyMode :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+keyMode rate chain keydecay chromaleak = mkUgen Nothing [ControlRate] (Left rate) "KeyMode" [chain, keydecay, chromaleak] Nothing 1 (Special 0) NoId++{- | K-means Oscillator++ KmeansToBPSet1 [AudioRate] freq=440 numdatapoints=20 maxnummeans=4 nummeans=4 tnewdata=1 tnewmeans=1 soft=1 bufnum=0+-}+kmeansToBPSet1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+kmeansToBPSet1 rate freq numdatapoints maxnummeans nummeans tnewdata tnewmeans soft bufnum = mkUgen Nothing [AudioRate] (Left rate) "KmeansToBPSet1" [freq, numdatapoints, maxnummeans, nummeans, tnewdata, tnewmeans, soft, bufnum] Nothing 1 (Special 0) NoId++{-+-- | Run any LADSPA plugin inside SuperCollider+--+-- LADSPA [AudioRate] nChans=0 id=0 args=0+ladspa :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+ladspa rate nChans id_ args = mkUgen Nothing [AudioRate] (Left rate) "LADSPA" [nChans,id_,args] Nothing 0 (Special 0) NoId+-}++{- | random walk step++ LFBrownNoise0 [ControlRate,AudioRate] freq=20 dev=1 dist=0; NONDET+-}+lfBrownNoise0Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen+lfBrownNoise0Id z rate freq dev dist = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFBrownNoise0" [freq, dev, dist] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFBrownNoise0.+lfBrownNoise0M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> m Ugen+lfBrownNoise0M = liftUid4 lfBrownNoise0Id++-- | Unsafe variant of LFBrownNoise0.+lfBrownNoise0 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+lfBrownNoise0 = liftUnsafe4 lfBrownNoise0M++{- | random walk linear interp++ LFBrownNoise1 [ControlRate,AudioRate] freq=20 dev=1 dist=0; NONDET+-}+lfBrownNoise1Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen+lfBrownNoise1Id z rate freq dev dist = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFBrownNoise1" [freq, dev, dist] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFBrownNoise1.+lfBrownNoise1M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> m Ugen+lfBrownNoise1M = liftUid4 lfBrownNoise1Id++-- | Unsafe variant of LFBrownNoise1.+lfBrownNoise1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+lfBrownNoise1 = liftUnsafe4 lfBrownNoise1M++{- | random walk cubic interp++ LFBrownNoise2 [ControlRate,AudioRate] freq=20 dev=1 dist=0; NONDET+-}+lfBrownNoise2Id :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen -> Ugen+lfBrownNoise2Id z rate freq dev dist = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LFBrownNoise2" [freq, dev, dist] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of LFBrownNoise2.+lfBrownNoise2M :: Uid m => Rate -> Ugen -> Ugen -> Ugen -> m Ugen+lfBrownNoise2M = liftUid4 lfBrownNoise2Id++-- | Unsafe variant of LFBrownNoise2.+lfBrownNoise2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+lfBrownNoise2 = liftUnsafe4 lfBrownNoise2M++{- | Live Linear Predictive Coding Analysis and Resynthesis++ LPCAnalyzer [AudioRate] input=0 source=0.01 n=256 p=10 testE=0 delta=0.999 windowtype=0; FILTER: TRUE+-}+lpcAnalyzer :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lpcAnalyzer input source n p testE delta windowtype = mkUgen Nothing [AudioRate] (Right [0, 1]) "LPCAnalyzer" [input, source, n, p, testE, delta, windowtype] Nothing 1 (Special 0) NoId++{- | Linear Predictive Coding Gone Wrong++ LPCError [AudioRate] input=0 p=10+-}+lpcError :: Rate -> Ugen -> Ugen -> Ugen+lpcError rate input p = mkUgen Nothing [AudioRate] (Left rate) "LPCError" [input, p] Nothing 1 (Special 0) NoId++{- | Utilize LPC data++ LPCSynth [AudioRate] buffer=0 signal=0 pointer=0+-}+lpcSynth :: Ugen -> Ugen -> Ugen -> Ugen+lpcSynth buffer signal pointer = mkUgen Nothing [AudioRate] (Left AudioRate) "LPCSynth" [buffer, signal, pointer] Nothing 1 (Special 0) NoId++{- | Utilize LPC data++ LPCVals [ControlRate,AudioRate] buffer=0 pointer=0+-}+lpcVals :: Ugen -> Ugen -> Ugen+lpcVals buffer pointer = mkUgen Nothing [ControlRate, AudioRate] (Left AudioRate) "LPCVals" [buffer, pointer] Nothing 3 (Special 0) NoId++{- | (Undocumented class)++ LPF1 [ControlRate,AudioRate] in=0 freq=1000+-}+lpf1 :: Rate -> Ugen -> Ugen -> Ugen+lpf1 rate in_ freq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LPF1" [in_, freq] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ LPF18 [AudioRate] in=0 freq=100 res=1 dist=0.4+-}+lpf18 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lpf18 rate in_ freq res dist = mkUgen Nothing [AudioRate] (Left rate) "LPF18" [in_, freq, res, dist] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ LPFVS6 [ControlRate,AudioRate] in=0 freq=1000 slope=0.5+-}+lpfvs6 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+lpfvs6 rate in_ freq slope_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LPFVS6" [in_, freq, slope_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ LPG [AudioRate] input=0 controlinput=0 controloffset=0 controlscale=1 vca=1 resonance=1.5 lowpassmode=1 linearity=1; FILTER: TRUE+-}+lpg :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lpg input controlinput controloffset controlscale vca resonance lowpassmode linearity = mkUgen Nothing [AudioRate] (Right [0]) "LPG" [input, controlinput, controloffset, controlscale, vca, resonance, lowpassmode, linearity] Nothing 1 (Special 0) NoId++{- | Linear Time Invariant General Filter Equation++ LTI [AudioRate] input=0 bufnuma=0 bufnumb=1+-}+lti :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+lti rate input bufnuma bufnumb = mkUgen Nothing [AudioRate] (Left rate) "LTI" [input, bufnuma, bufnumb] Nothing 1 (Special 0) NoId++{- | latoocarfian 2D chaotic generator++ Latoocarfian2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1 b=3 c=0.5 d=0.5 x0=0.34082 y0=-0.3827+-}+latoocarfian2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+latoocarfian2DC rate minfreq maxfreq a b c d x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Latoocarfian2DC" [minfreq, maxfreq, a, b, c, d, x0, y0] Nothing 1 (Special 0) NoId++{- | latoocarfian 2D chaotic generator++ Latoocarfian2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1 b=3 c=0.5 d=0.5 x0=0.34082 y0=-0.3827+-}+latoocarfian2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+latoocarfian2DL rate minfreq maxfreq a b c d x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Latoocarfian2DL" [minfreq, maxfreq, a, b, c, d, x0, y0] Nothing 1 (Special 0) NoId++{- | latoocarfian 2D chaotic generator++ Latoocarfian2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 a=1 b=3 c=0.5 d=0.5 x0=0.34082 y0=-0.3827+-}+latoocarfian2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+latoocarfian2DN rate minfreq maxfreq a b c d x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Latoocarfian2DN" [minfreq, maxfreq, a, b, c, d, x0, y0] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ LatoocarfianTrig [ControlRate,AudioRate] minfreq=5 maxfreq=10 a=1 b=3 c=0.5 d=0.5 x0=0.34082 y0=-0.3827+-}+latoocarfianTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+latoocarfianTrig rate minfreq maxfreq a b c d x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LatoocarfianTrig" [minfreq, maxfreq, a, b, c, d, x0, y0] Nothing 1 (Special 0) NoId++{- | Emit a sequence of triggers at specified time offsets++ ListTrig [ControlRate] bufnum=0 reset=0 offset=0 numframes=0+-}+listTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+listTrig rate bufnum reset offset numframes = mkUgen Nothing [ControlRate] (Left rate) "ListTrig" [bufnum, reset, offset, numframes] Nothing 1 (Special 0) NoId++{- | Emit a sequence of triggers at specified time offsets++ ListTrig2 [ControlRate] bufnum=0 reset=0 numframes=0+-}+listTrig2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+listTrig2 rate bufnum reset numframes = mkUgen Nothing [ControlRate] (Left rate) "ListTrig2" [bufnum, reset, numframes] Nothing 1 (Special 0) NoId++{- | Store values to a buffer, whenever triggered++ Logger [ControlRate] inputArray=0 trig=0 bufnum=0 reset=0+-}+logger :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+logger rate inputArray trig_ bufnum reset = mkUgen Nothing [ControlRate] (Left rate) "Logger" [inputArray, trig_, bufnum, reset] Nothing 1 (Special 0) NoId++{- | sample looping oscillator++ LoopBuf [AudioRate] bufnum=0 rate=1 gate=1 startPos=0 startLoop=0 endLoop=0 interpolation=2; NC INPUT: True+-}+loopBuf :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+loopBuf numChannels rate bufnum rate_ gate_ startPos startLoop endLoop interpolation = mkUgen Nothing [AudioRate] (Left rate) "LoopBuf" [bufnum, rate_, gate_, startPos, startLoop, endLoop, interpolation] Nothing numChannels (Special 0) NoId++{- | lorenz 2D chaotic generator++ Lorenz2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 s=10 r=28 b=2.66667 h=0.02 x0=0.09088 y0=2.97077 z0=24.28204+-}+lorenz2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lorenz2DC rate minfreq maxfreq s r b h x0 y0 z0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Lorenz2DC" [minfreq, maxfreq, s, r, b, h, x0, y0, z0] Nothing 1 (Special 0) NoId++{- | lorenz 2D chaotic generator++ Lorenz2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 s=10 r=28 b=2.66667 h=0.02 x0=0.09088 y0=2.97077 z0=24.28204+-}+lorenz2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lorenz2DL rate minfreq maxfreq s r b h x0 y0 z0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Lorenz2DL" [minfreq, maxfreq, s, r, b, h, x0, y0, z0] Nothing 1 (Special 0) NoId++{- | lorenz 2D chaotic generator++ Lorenz2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 s=10 r=28 b=2.66667 h=0.02 x0=0.09088 y0=2.97077 z0=24.28204+-}+lorenz2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lorenz2DN rate minfreq maxfreq s r b h x0 y0 z0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Lorenz2DN" [minfreq, maxfreq, s, r, b, h, x0, y0, z0] Nothing 1 (Special 0) NoId++{- | lorenz chaotic trigger generator++ LorenzTrig [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 s=10 r=28 b=2.66667 h=0.02 x0=0.09088 y0=2.97077 z0=24.28204+-}+lorenzTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lorenzTrig rate minfreq maxfreq s r b h x0 y0 z0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "LorenzTrig" [minfreq, maxfreq, s, r, b, h, x0, y0, z0] Nothing 1 (Special 0) NoId++{- | simple resonating lowpass filter++ Lores [AudioRate] in=0 freq=880 res=0.5; FILTER: TRUE+-}+lores :: Ugen -> Ugen -> Ugen -> Ugen+lores in_ freq res = mkUgen Nothing [AudioRate] (Right [0]) "Lores" [in_, freq, res] Nothing 1 (Special 0) NoId++{- | 2-species Predator-Prey model++ LotkaVolterra [AudioRate] freq=22050 a=1.5 b=1.5 c=0.5 d=1.5 h=0.05 xi=1 yi=0.2+-}+lotkaVolterra :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+lotkaVolterra rate freq a b c d h xi yi = mkUgen Nothing [AudioRate] (Left rate) "LotkaVolterra" [freq, a, b, c, d, h, xi, yi] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ MCLDChaosGen [] maxSize=0+-}+mcldChaosGen :: Rate -> Ugen -> Ugen+mcldChaosGen rate maxSize = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "MCLDChaosGen" [maxSize] Nothing 1 (Special 0) NoId++{- | POKEY Chip Sound Simulator++ MZPokey [AudioRate] audf1=0 audc1=0 audf2=0 audc2=0 audf3=0 audc3=0 audf4=0 audc4=0 audctl=0+-}+mzPokey :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+mzPokey rate audf1 audc1 audf2 audc2 audf3 audc3 audf4 audc4 audctl = mkUgen Nothing [AudioRate] (Left rate) "MZPokey" [audf1, audc1, audf2, audc2, audf3, audc3, audf4, audc4, audctl] Nothing 1 (Special 0) NoId++{- | First order Markov Chain implementation for audio signals++ MarkovSynth [AudioRate] in=0 isRecording=1 waitTime=2 tableSize=10+-}+markovSynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+markovSynth rate in_ isRecording waitTime tableSize = mkUgen Nothing [AudioRate] (Left rate) "MarkovSynth" [in_, isRecording, waitTime, tableSize] Nothing 1 (Special 0) NoId++{- | Real time sparse representation++ MatchingP [ControlRate,AudioRate] dict=0 in=0 dictsize=1 ntofind=1 hop=1 method=0+-}+matchingP :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+matchingP rate dict in_ dictsize ntofind hop method = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "MatchingP" [dict, in_, dictsize, ntofind, hop, method] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ MatchingPResynth [ControlRate,AudioRate] dict=0 method=0 trigger=0 residual=0 activs=0+-}+matchingPResynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+matchingPResynth rate dict method trigger residual activs = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "MatchingPResynth" [dict, method, trigger, residual, activs] Nothing 1 (Special 0) NoId++{- | maximum within last x samples++ Max [ControlRate] in=0 numsamp=64+-}+max :: Rate -> Ugen -> Ugen -> Ugen+max rate in_ numsamp = mkUgen Nothing [ControlRate] (Left rate) "Max" [in_, numsamp] Nothing 1 (Special 0) NoId++{- | Tracks and prints amplitudes++ Maxamp [AudioRate] in=0 numSamps=1000+-}+maxamp :: Rate -> Ugen -> Ugen -> Ugen+maxamp rate in_ numSamps = mkUgen Nothing [AudioRate] (Left rate) "Maxamp" [in_, numSamps] Nothing 1 (Special 0) NoId++{- | Piano synthesiser++ MdaPiano [AudioRate] freq=440 gate=1 vel=100 decay=0.8 release=0.8 hard=0.8 velhard=0.8 muffle=0.8 velmuff=0.8 velcurve=0.8 stereo=0.2 tune=0.5 random=0.1 stretch=0.1 sustain=0+-}+mdaPiano :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+mdaPiano rate freq gate_ vel decay_ release hard velhard muffle velmuff velcurve stereo tune random stretch sustain = mkUgen Nothing [AudioRate] (Left rate) "MdaPiano" [freq, gate_, vel, decay_, release, hard, velhard, muffle, velmuff, velcurve, stereo, tune, random, stretch, sustain] Nothing 2 (Special 0) NoId++{- | Mean of recent values, triggered++ MeanTriggered [ControlRate,AudioRate] in=0 trig=0 length=10+-}+meanTriggered :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+meanTriggered rate in_ trig_ length_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "MeanTriggered" [in_, trig_, length_] Nothing 1 (Special 0) NoId++{- | Meddis cochlear hair cell model++ Meddis [ControlRate,AudioRate] input=0; FILTER: TRUE+-}+meddis :: Ugen -> Ugen+meddis input = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Meddis" [input] Nothing 1 (Special 0) NoId++{- | Separate harmonic and percussive parts of a signal++ MedianSeparation [] fft=0 fftharmonic=0 fftpercussive=0 fftsize=1024 mediansize=17 hardorsoft=0 p=2 medianormax=0+-}+medianSeparation :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+medianSeparation rate fft_ fftharmonic fftpercussive fftsize mediansize hardorsoft p medianormax = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "MedianSeparation" [fft_, fftharmonic, fftpercussive, fftsize, mediansize, hardorsoft, p, medianormax] Nothing 2 (Special 0) NoId++{- | Median of recent values, triggered++ MedianTriggered [ControlRate,AudioRate] in=0 trig=0 length=10+-}+medianTriggered :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+medianTriggered rate in_ trig_ length_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "MedianTriggered" [in_, trig_, length_] Nothing 1 (Special 0) NoId++{- | Waveguide mesh physical models of drum membranes++ MembraneCircle [AudioRate] excitation=0 tension=0.05 loss=0.99999+-}+membraneCircle :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+membraneCircle rate excitation tension loss = mkUgen Nothing [AudioRate] (Left rate) "MembraneCircle" [excitation, tension, loss] Nothing 1 (Special 0) NoId++{- | Waveguide mesh physical models of drum membranes++ MembraneHexagon [AudioRate] excitation=0 tension=0.05 loss=0.99999+-}+membraneHexagon :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+membraneHexagon rate excitation tension loss = mkUgen Nothing [AudioRate] (Left rate) "MembraneHexagon" [excitation, tension, loss] Nothing 1 (Special 0) NoId++{- | Metronome++ Metro [ControlRate,AudioRate] bpm=0 numBeats=0+-}+metro :: Rate -> Ugen -> Ugen -> Ugen+metro rate bpm numBeats = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Metro" [bpm, numBeats] Nothing 1 (Special 0) NoId++{- | a macro oscillator++ MiBraids [AudioRate] pitch=60 timbre=0.5 color=0.5 model=0 trig=0 resamp=0 decim=0 bits=0 ws=0+-}+miBraids :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miBraids rate pitch_ timbre color model trig_ resamp decim bits ws = mkUgen Nothing [AudioRate] (Left rate) "MiBraids" [pitch_, timbre, color, model, trig_, resamp, decim, bits, ws] Nothing 1 (Special 0) NoId++{- | granular audio processor and texture synthesizer++ MiClouds [AudioRate] pit=0 pos=0.5 size=0.25 dens=0.4 tex=0.5 drywet=0.5 in_gain=1 spread=0.5 rvb=0 fb=0 freeze=0 mode=0 lofi=0 trig=0 *inputArray=0; MCE=1, REORDERS INPUTS: [14,0,1,2,3,4,5,6,7,8,9,10,11,12,13]+-}+miClouds :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miClouds rate pit pos size dens tex drywet in_gain spread rvb fb freeze mode lofi trig_ inputArray = mkUgen Nothing [AudioRate] (Left rate) "MiClouds" [pit, pos, size, dens, tex, drywet, in_gain, spread, rvb, fb, freeze, mode, lofi, trig_] (Just [inputArray]) 2 (Special 0) NoId++{- | Physical modelling based on Modal Synthesis.++ MiElements [AudioRate] blow_in=0 strike_in=0 gate=0 pit=48 strength=0.5 contour=0.2 bow_level=0 blow_level=0 strike_level=0 flow=0.5 mallet=0.5 bow_timb=0.5 blow_timb=0.5 strike_timb=0.5 geom=0.25 bright=0.5 damp=0.7 pos=0.2 space=0.3 model=0 easteregg=0+-}+miElements :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miElements rate blow_in strike_in gate_ pit strength contour bow_level blow_level strike_level flow mallet bow_timb blow_timb strike_timb geom bright damp pos space model easteregg = mkUgen Nothing [AudioRate] (Left rate) "MiElements" [blow_in, strike_in, gate_, pit, strength, contour, bow_level, blow_level, strike_level, flow, mallet, bow_timb, blow_timb, strike_timb, geom, bright, damp, pos, space, model, easteregg] Nothing 2 (Special 0) NoId++{- | topographic drum sequencer++ MiGrids [AudioRate] bpm=120 map_x=0.5 map_y=0.5 chaos=0 bd_density=0.25 sd_density=0.25 hh_density=0.25 mode=1 swing=0 config=0+-}+miGrids :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miGrids rate bpm map_x map_y chaos bd_density sd_density hh_density mode swing config = mkUgen Nothing [AudioRate] (Left rate) "MiGrids" [bpm, map_x, map_y, chaos, bd_density, sd_density, hh_density, mode, swing, config] Nothing 6 (Special 0) NoId++{- | µ-law audio companding++ MiMu [AudioRate] in=0 gain=1 bypass=0+-}+miMu :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+miMu rate in_ gain bypass = mkUgen Nothing [AudioRate] (Left rate) "MiMu" [in_, gain, bypass] Nothing 1 (Special 0) NoId++{- | FM Synth-Voice based on 'ominous'++ MiOmi [AudioRate] audio_in=0 gate=0 pit=48 contour=0.2 detune=0.25 level1=0.5 level2=0.5 ratio1=0.5 ratio2=0.5 fm1=0 fm2=0 fb=0 xfb=0 filter_mode=0 cutoff=0.5 reson=0 strength=0.5 env=0.5 rotate=0.2 space=0.5+-}+miOmi :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miOmi rate audio_in gate_ pit contour detune level1 level2 ratio1 ratio2 fm1 fm2 fb xfb filter_mode cutoff reson strength env rotate_ space = mkUgen Nothing [AudioRate] (Left rate) "MiOmi" [audio_in, gate_, pit, contour, detune, level1, level2, ratio1, ratio2, fm1, fm2, fb, xfb, filter_mode, cutoff, reson, strength, env, rotate_, space] Nothing 2 (Special 0) NoId++{- | a macro oscillator++ MiPlaits [AudioRate] pitch=60 engine=0 harm=0.1 timbre=0.5 morph=0.5 trigger=0 level=0 fm_mod=0 timb_mod=0 morph_mod=0 decay=0.5 lpg_colour=0.5+-}+miPlaits :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miPlaits rate pitch_ engine harm timbre morph trigger level fm_mod timb_mod morph_mod decay_ lpg_colour = mkUgen Nothing [AudioRate] (Left rate) "MiPlaits" [pitch_, engine, harm, timbre, morph, trigger, level, fm_mod, timb_mod, morph_mod, decay_, lpg_colour] Nothing 2 (Special 0) NoId++{- | a resonator++ MiRings [AudioRate] in=0 trig=0 pit=60 struct=0.25 bright=0.5 damp=0.7 pos=0.25 model=0 poly=1 intern_exciter=0 easteregg=0 bypass=0+-}+miRings :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miRings rate in_ trig_ pit struct bright damp pos model poly intern_exciter easteregg bypass = mkUgen Nothing [AudioRate] (Left rate) "MiRings" [in_, trig_, pit, struct, bright, damp, pos, model, poly, intern_exciter, easteregg, bypass] Nothing 2 (Special 0) NoId++{- | Classic resonant LP filter++ MiRipples [AudioRate] in=0 cf=0.3 reson=0.2 drive=1; FILTER: TRUE+-}+miRipples :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miRipples in_ cf reson drive = mkUgen Nothing [AudioRate] (Right [0]) "MiRipples" [in_, cf, reson, drive] Nothing 1 (Special 0) NoId++{- | a quad LFO++ MiTides [AudioRate] freq=1 shape=0.5 slope=0.5 smooth=0.5 shift=0.2 trig=0 clock=0 output_mode=3 ramp_mode=1 ratio=9 rate=1+-}+miTides :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miTides rate freq shape slope_ smooth shift trig_ clock output_mode ramp_mode ratio rate_ = mkUgen Nothing [AudioRate] (Left rate) "MiTides" [freq, shape, slope_, smooth, shift, trig_, clock, output_mode, ramp_mode, ratio, rate_] Nothing 4 (Special 0) NoId++{- | stereo reverb++ MiVerb [AudioRate] time=0.7 drywet=0.5 damp=0.5 hp=0.05 freeze=0 diff=0.625 *inputArray=0; MCE=1, FILTER: TRUE, REORDERS INPUTS: [6,0,1,2,3,4,5]+-}+miVerb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miVerb time drywet damp hp freeze diff inputArray = mkUgen Nothing [AudioRate] (Right [6]) "MiVerb" [time, drywet, damp, hp, freeze, diff] (Just [inputArray]) 2 (Special 0) NoId++{- | a meta modulator++ MiWarps [AudioRate] carrier=0 modulator=0 lev1=0.5 lev2=0.5 algo=0 timb=0 osc=0 freq=110 vgain=1 easteregg=0+-}+miWarps :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+miWarps rate carrier modulator lev1 lev2 algo timb osc_ freq vgain easteregg = mkUgen Nothing [AudioRate] (Left rate) "MiWarps" [carrier, modulator, lev1, lev2, algo, timb, osc_, freq, vgain, easteregg] Nothing 2 (Special 0) NoId++{- | Granulates real-time input++ MonoGrain [AudioRate] in=0 winsize=0.1 grainrate=10 winrandpct=0+-}+monoGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+monoGrain rate in_ winsize grainrate winrandpct = mkUgen Nothing [AudioRate] (Left rate) "MonoGrain" [in_, winsize, grainrate, winrandpct] Nothing 1 (Special 0) NoId++{- | Granulates real-time input with Ambisonic panning++ MonoGrainBF [AudioRate] in=0 winsize=0.1 grainrate=10 winrandpct=0 azimuth=0 azrand=0 elevation=0 elrand=0 rho=1+-}+monoGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+monoGrainBF rate in_ winsize grainrate winrandpct azimuth azrand elevation elrand rho = mkUgen Nothing [AudioRate] (Left rate) "MonoGrainBF" [in_, winsize, grainrate, winrandpct, azimuth, azrand, elevation, elrand, rho] Nothing 4 (Special 0) NoId++{- | Moog Filter Emulation++ MoogLadder [ControlRate,AudioRate] in=0 ffreq=440 res=0; FILTER: TRUE+-}+moogLadder :: Ugen -> Ugen -> Ugen -> Ugen+moogLadder in_ ffreq res = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "MoogLadder" [in_, ffreq, res] Nothing 1 (Special 0) NoId++{- | Moog filter emulation++ MoogVCF [AudioRate] in=0 fco=0 res=0; FILTER: TRUE+-}+moogVCF :: Ugen -> Ugen -> Ugen -> Ugen+moogVCF in_ fco res = mkUgen Nothing [AudioRate] (Right [0]) "MoogVCF" [in_, fco, res] Nothing 1 (Special 0) NoId++{- | Stereo reverb++ NHHall [AudioRate] in1=0.0 in2=0.0 rt60=1.0 stereo=0.5 lowFreq=200.0 lowRatio=0.5 hiFreq=4000.0 hiRatio=0.5 earlyDiffusion=0.5 lateDiffusion=0.5 modRate=0.2 modDepth=0.3+-}+nhHall :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nhHall in1 in2 rt60 stereo lowFreq lowRatio hiFreq hiRatio earlyDiffusion lateDiffusion modRate modDepth = mkUgen Nothing [AudioRate] (Right [0, 1]) "NHHall" [in1, in2, rt60, stereo, lowFreq, lowRatio, hiFreq, hiRatio, earlyDiffusion, lateDiffusion, modRate, modDepth] Nothing 2 (Special 0) NoId++{- | Non Linear Filter Equation++ NL [AudioRate] input=0 bufnuma=0 bufnumb=1 guard1=1000 guard2=100+-}+nl :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nl rate input bufnuma bufnumb guard1 guard2 = mkUgen Nothing [AudioRate] (Left rate) "NL" [input, bufnuma, bufnumb, guard1, guard2] Nothing 1 (Special 0) NoId++{- | Arbitrary Non Linear Filter Equation++ NL2 [AudioRate] input=0 bufnum=0 maxsizea=10 maxsizeb=10 guard1=1000 guard2=100+-}+nl2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nl2 rate input bufnum maxsizea maxsizeb guard1 guard2 = mkUgen Nothing [AudioRate] (Left rate) "NL2" [input, bufnum, maxsizea, maxsizeb, guard1, guard2] Nothing 1 (Special 0) NoId++{- | Non-linear Filter++ NLFiltC [ControlRate,AudioRate] input=0 a=0 b=0 d=0 c=0 l=0+-}+nlFiltC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nlFiltC rate input a b d c l = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "NLFiltC" [input, a, b, d, c, l] Nothing 1 (Special 0) NoId++{- | Non-linear Filter++ NLFiltL [ControlRate,AudioRate] input=0 a=0 b=0 d=0 c=0 l=0+-}+nlFiltL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nlFiltL rate input a b d c l = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "NLFiltL" [input, a, b, d, c, l] Nothing 1 (Special 0) NoId++{- | Non-linear Filter++ NLFiltN [ControlRate,AudioRate] input=0 a=0 b=0 d=0 c=0 l=0+-}+nlFiltN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nlFiltN rate input a b d c l = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "NLFiltN" [input, a, b, d, c, l] Nothing 1 (Special 0) NoId++{- | physical modeling simulation; N tubes++ NTube [AudioRate] input=0 lossarray=1 karray=0 delaylengtharray=0+-}+nTube :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nTube rate input lossarray karray delaylengtharray = mkUgen Nothing [AudioRate] (Left rate) "NTube" [input, lossarray, karray, delaylengtharray] Nothing 1 (Special 0) NoId++{- | Find the nearest-neighbours in a set of points++ NearestN [ControlRate] treebuf=0 in=0 gate=1 num=1+-}+nearestN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nearestN rate treebuf in_ gate_ num = mkUgen Nothing [ControlRate] (Left rate) "NearestN" [treebuf, in_, gate_, num] Nothing 3 (Special 0) NoId++{- | (Undocumented class)++ NeedleRect [AudioRate] rate=1 imgWidth=100 imgHeight=100 rectX=0 rectY=0 rectW=100 rectH=100+-}+needleRect :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+needleRect rate rate_ imgWidth imgHeight rectX rectY rectW rectH = mkUgen Nothing [AudioRate] (Left rate) "NeedleRect" [rate_, imgWidth, imgHeight, rectX, rectY, rectW, rectH] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ NeoFormant [ControlRate,AudioRate] formantfreq=100 carrierfreq=200 phaseshift=0.5+-}+neoFormant :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+neoFormant rate formantfreq carrierfreq phaseshift = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "NeoFormant" [formantfreq, carrierfreq, phaseshift] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ NeoVarSawOsc [ControlRate,AudioRate] freq=100 pw=0.5 waveshape=0.5+-}+neoVarSawOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+neoVarSawOsc rate freq pw waveshape = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "NeoVarSawOsc" [freq, pw, waveshape] Nothing 1 (Special 0) NoId++{- | APU Chip Sound Simulator++ Nes2 [AudioRate] trig=0 a0=0 a1=0 a2=0 a3=0 b0=0 b1=0 b2=0 b3=0 c0=0 c2=0 c3=0 d0=0 d2=0 d3=0 e0=0 e1=0 e2=0 e3=0 smask=0+-}+nes2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nes2 rate trig_ a0 a1 a2 a3 b0 b1 b2 b3 c0 c2 c3 d0 d2 d3 e0 e1 e2 e3 smask = mkUgen Nothing [AudioRate] (Left rate) "Nes2" [trig_, a0, a1, a2, a3, b0, b1, b2, b3, c0, c2, c3, d0, d2, d3, e0, e1, e2, e3, smask] Nothing 1 (Special 0) NoId++{- | Nested Allpass filters as proposed by Vercoe and Pluckett++ NestedAllpassC [AudioRate] in=0 maxdelay1=0.036 delay1=0.036 gain1=0.08 maxdelay2=0.03 delay2=0.03 gain2=0.3; FILTER: TRUE+-}+nestedAllpassC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nestedAllpassC in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 = mkUgen Nothing [AudioRate] (Right [0]) "NestedAllpassC" [in_, maxdelay1, delay1_, gain1, maxdelay2, delay2_, gain2] Nothing 1 (Special 0) NoId++{- | Nested Allpass filters as proposed by Vercoe and Pluckett++ NestedAllpassL [AudioRate] in=0 maxdelay1=0.036 delay1=0.036 gain1=0.08 maxdelay2=0.03 delay2=0.03 gain2=0.3; FILTER: TRUE+-}+nestedAllpassL :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nestedAllpassL in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 = mkUgen Nothing [AudioRate] (Right [0]) "NestedAllpassL" [in_, maxdelay1, delay1_, gain1, maxdelay2, delay2_, gain2] Nothing 1 (Special 0) NoId++{- | Nested Allpass filters as proposed by Vercoe and Pluckett++ NestedAllpassN [AudioRate] in=0 maxdelay1=0.036 delay1=0.036 gain1=0.08 maxdelay2=0.03 delay2=0.03 gain2=0.3; FILTER: TRUE+-}+nestedAllpassN :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+nestedAllpassN in_ maxdelay1 delay1_ gain1 maxdelay2 delay2_ gain2 = mkUgen Nothing [AudioRate] (Right [0]) "NestedAllpassN" [in_, maxdelay1, delay1_, gain1, maxdelay2, delay2_, gain2] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ OSFold4 [AudioRate] in=0 lo=0 hi=0+-}+osFold4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+osFold4 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "OSFold4" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ OSFold8 [AudioRate] in=0 lo=0 hi=0+-}+osFold8 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+osFold8 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "OSFold8" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ OSTrunc4 [AudioRate] in=0 quant=0.5+-}+osTrunc4 :: Rate -> Ugen -> Ugen -> Ugen+osTrunc4 rate in_ quant = mkUgen Nothing [AudioRate] (Left rate) "OSTrunc4" [in_, quant] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ OSTrunc8 [AudioRate] in=0 quant=0.5+-}+osTrunc8 :: Rate -> Ugen -> Ugen -> Ugen+osTrunc8 rate in_ quant = mkUgen Nothing [AudioRate] (Left rate) "OSTrunc8" [in_, quant] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ OSWrap4 [AudioRate] in=0 lo=0 hi=0+-}+osWrap4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+osWrap4 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "OSWrap4" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ OSWrap8 [AudioRate] in=0 lo=0 hi=0+-}+osWrap8 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+osWrap8 rate in_ lo hi = mkUgen Nothing [AudioRate] (Left rate) "OSWrap8" [in_, lo, hi] Nothing 1 (Special 0) NoId++{- | Extract basic statistics from a series of onset triggers++ OnsetStatistics [ControlRate] input=0 windowsize=1 hopsize=0.1+-}+onsetStatistics :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+onsetStatistics rate input windowsize hopsize = mkUgen Nothing [ControlRate] (Left rate) "OnsetStatistics" [input, windowsize, hopsize] Nothing 3 (Special 0) NoId++{- | Chemical reaction modelling Oscillator++ Oregonator [AudioRate] reset=0 rate=0.01 epsilon=1 mu=1 q=1 initx=0.5 inity=0.5 initz=0.5+-}+oregonator :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+oregonator rate reset rate_ epsilon mu q initx inity initz = mkUgen Nothing [AudioRate] (Left rate) "Oregonator" [reset, rate_, epsilon, mu, q, initx, inity, initz] Nothing 3 (Special 0) NoId++{- | (Undocumented class)++ OscBank [ControlRate,AudioRate] freq=100 gain=1 saw8=0.5 square8=0.5 saw4=0.5 square4=0.5 saw2=0.5 square2=0.5 saw1=0.5+-}+oscBank :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+oscBank rate freq gain saw8 square8 saw4 square4 saw2 square2 saw1 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "OscBank" [freq, gain, saw8, square8, saw4, square4, saw2, square2, saw1] Nothing 1 (Special 0) NoId++{- | Piano physical model.++ OteyPiano [AudioRate] freq=440 vel=1 t_gate=0 rmin=0.35 rmax=2 rampl=4 rampr=8 rcore=1 lmin=0.07 lmax=1.4 lampl=-4 lampr=4 rho=1 e=1 zb=1 zh=0 mh=1 k=0.2 alpha=1 p=1 hpos=0.142 loss=1 detune=0.0003 hammer_type=1+-}+oteyPiano :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+oteyPiano rate freq vel t_gate rmin rmax rampl rampr rcore lmin lmax lampl lampr rho e zb zh mh k alpha p hpos loss detune hammer_type = mkUgen Nothing [AudioRate] (Left rate) "OteyPiano" [freq, vel, t_gate, rmin, rmax, rampl, rampr, rcore, lmin, lmax, lampl, lampr, rho, e, zb, zh, mh, k, alpha, p, hpos, loss, detune, hammer_type] Nothing 1 (Special 0) NoId++{- | Piano physical model.++ OteyPianoStrings [AudioRate] freq=440 vel=1 t_gate=0 rmin=0.35 rmax=2 rampl=4 rampr=8 rcore=1 lmin=0.07 lmax=1.4 lampl=-4 lampr=4 rho=1 e=1 zb=1 zh=0 mh=1 k=0.2 alpha=1 p=1 hpos=0.142 loss=1 detune=0.0003 hammer_type=1+-}+oteyPianoStrings :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+oteyPianoStrings rate freq vel t_gate rmin rmax rampl rampr rcore lmin lmax lampl lampr rho e zb zh mh k alpha p hpos loss detune hammer_type = mkUgen Nothing [AudioRate] (Left rate) "OteyPianoStrings" [freq, vel, t_gate, rmin, rmax, rampl, rampr, rcore, lmin, lmax, lampl, lampr, rho, e, zb, zh, mh, k, alpha, p, hpos, loss, detune, hammer_type] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ OteySoundBoard [AudioRate] inp=0 c1=20 c3=20 mix=0.8; FILTER: TRUE+-}+oteySoundBoard :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+oteySoundBoard inp c1 c3 mix = mkUgen Nothing [AudioRate] (Right [0]) "OteySoundBoard" [inp, c1, c3, mix] Nothing 1 (Special 0) NoId++{- | Return mag and freq data from a CSound pv++ PVInfo [ControlRate,AudioRate] pvbuffer=0 binNum=0 filePointer=0+-}+pvInfo :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+pvInfo rate pvbuffer binNum filePointer = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "PVInfo" [pvbuffer, binNum, filePointer] Nothing 2 (Special 0) NoId++{- | Resynthesize Csound PV data++ PVSynth [AudioRate] pvbuffer=0 numBins=0 binStart=0 binSkip=1 filePointer=0 freqMul=1 freqAdd=0+-}+pvSynth :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pvSynth rate pvbuffer numBins binStart binSkip filePointer freqMul freqAdd = mkUgen Nothing [AudioRate] (Left rate) "PVSynth" [pvbuffer, numBins, binStart, binSkip, filePointer, freqMul, freqAdd] Nothing 1 (Special 0) NoId++{- | Plays FFT data to a memory buffer++ PV_BinBufRd [ControlRate] buffer=0 playbuf=0 point=1 binStart=0 binSkip=1 numBins=1 clear=0+-}+pv_BinBufRd :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_BinBufRd buffer playbuf_ point binStart binSkip numBins clear = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinBufRd" [buffer, playbuf_, point, binStart, binSkip, numBins, clear] Nothing 1 (Special 0) NoId++{- | Delay and Feedback on a bin by bin basis.++ PV_BinDelay [ControlRate] buffer=0 maxdelay=0 delaybuf=0 fbbuf=0 hop=0.5+-}+pv_BinDelay :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_BinDelay buffer maxdelay delaybuf fbbuf hop = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinDelay" [buffer, maxdelay, delaybuf, fbbuf, hop] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PV_BinFilter [ControlRate] buffer=0 start=0 end=0+-}+pv_BinFilter :: Ugen -> Ugen -> Ugen -> Ugen+pv_BinFilter buffer start end = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinFilter" [buffer, start, end] Nothing 1 (Special 0) NoId++{- | Plays FFT data to a memory buffer++ PV_BinPlayBuf [ControlRate] buffer=0 playbuf=0 rate=1 offset=0 binStart=0 binSkip=1 numBins=1 loop=0 clear=0+-}+pv_BinPlayBuf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_BinPlayBuf buffer playbuf_ rate_ offset binStart binSkip numBins loop clear = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BinPlayBuf" [buffer, playbuf_, rate_, offset, binStart, binSkip, numBins, loop, clear] Nothing 1 (Special 0) NoId++{- | Plays FFT data from a memory buffer++ PV_BufRd [ControlRate] buffer=0 playbuf=0 point=1+-}+pv_BufRd :: Ugen -> Ugen -> Ugen -> Ugen+pv_BufRd buffer playbuf_ point = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_BufRd" [buffer, playbuf_, point] Nothing 1 (Special 0) NoId++{- | returns common magnitudes++ PV_CommonMag [ControlRate] bufferA=0 bufferB=0 tolerance=0 remove=0+-}+pv_CommonMag :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_CommonMag bufferA bufferB tolerance remove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_CommonMag" [bufferA, bufferB, tolerance, remove] Nothing 1 (Special 0) NoId++{- | multiplies common magnitudes++ PV_CommonMul [ControlRate] bufferA=0 bufferB=0 tolerance=0 remove=0+-}+pv_CommonMul :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_CommonMul bufferA bufferB tolerance remove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_CommonMul" [bufferA, bufferB, tolerance, remove] Nothing 1 (Special 0) NoId++{- | simple spectral compression/expansion++ PV_Compander [ControlRate] buffer=0 thresh=50 slopeBelow=1 slopeAbove=1+-}+pv_Compander :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_Compander buffer thresh slopeBelow slopeAbove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Compander" [buffer, thresh, slopeBelow, slopeAbove] Nothing 1 (Special 0) NoId++{- | zero bins with interpolation++ PV_Cutoff [ControlRate] bufferA=0 bufferB=0 wipe=0+-}+pv_Cutoff :: Ugen -> Ugen -> Ugen -> Ugen+pv_Cutoff bufferA bufferB wipe = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Cutoff" [bufferA, bufferB, wipe] Nothing 1 (Special 0) NoId++{- | Return the even numbered bins in an FFT buffer++ PV_EvenBin [ControlRate] buffer=0+-}+pv_EvenBin :: Ugen -> Ugen+pv_EvenBin buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_EvenBin" [buffer] Nothing 1 (Special 0) NoId++{- | extract a repeating loop out from audio++ PV_ExtractRepeat [ControlRate] buffer=0 loopbuf=0 loopdur=0 memorytime=30 which=0 ffthop=0.5 thresh=1+-}+pv_ExtractRepeat :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_ExtractRepeat buffer loopbuf_ loopdur memorytime which ffthop thresh = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_ExtractRepeat" [buffer, loopbuf_, loopdur, memorytime, which, ffthop, thresh] Nothing 1 (Special 0) NoId++{- | Freeze FFT frames++ PV_Freeze [ControlRate] buffer=0 freeze=0+-}+pv_Freeze :: Ugen -> Ugen -> Ugen+pv_Freeze buffer freeze = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Freeze" [buffer, freeze] Nothing 1 (Special 0) NoId++{- | Store FFT data in another buffer for other use++ PV_FreqBuffer [ControlRate] buffer=0 databuffer=0+-}+pv_FreqBuffer :: Ugen -> Ugen -> Ugen+pv_FreqBuffer buffer databuffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_FreqBuffer" [buffer, databuffer] Nothing 1 (Special 0) NoId++{- | Invert FFT frames++ PV_Invert [ControlRate] buffer=0+-}+pv_Invert :: Ugen -> Ugen+pv_Invert buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Invert" [buffer] Nothing 1 (Special 0) NoId++{- | Store FFT data in another buffer for other use++ PV_MagBuffer [ControlRate] buffer=0 databuffer=0+-}+pv_MagBuffer :: Ugen -> Ugen -> Ugen+pv_MagBuffer buffer databuffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagBuffer" [buffer, databuffer] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PV_MagExp [ControlRate] buffer=0+-}+pv_MagExp :: Ugen -> Ugen+pv_MagExp buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagExp" [buffer] Nothing 1 (Special 0) NoId++{- | reduces magnitudes above or below thresh++ PV_MagGate [ControlRate] buffer=0 thresh=1 remove=0+-}+pv_MagGate :: Ugen -> Ugen -> Ugen -> Ugen+pv_MagGate buffer thresh remove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagGate" [buffer, thresh, remove] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PV_MagLog [ControlRate] buffer=0+-}+pv_MagLog :: Ugen -> Ugen+pv_MagLog buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagLog" [buffer] Nothing 1 (Special 0) NoId++{- | Remap magnitudes to a new mag curve++ PV_MagMap [ControlRate] buffer=0 mapbuf=0+-}+pv_MagMap :: Ugen -> Ugen -> Ugen+pv_MagMap buffer mapbuf = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagMap" [buffer, mapbuf] Nothing 1 (Special 0) NoId++{- | subtract spectral energy++ PV_MagMinus [ControlRate] bufferA=0 bufferB=0 remove=1+-}+pv_MagMinus :: Ugen -> Ugen -> Ugen -> Ugen+pv_MagMinus bufferA bufferB remove = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagMinus" [bufferA, bufferB, remove] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PV_MagMulAdd [ControlRate] buffer=0+-}+pv_MagMulAdd :: Ugen -> Ugen+pv_MagMulAdd buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagMulAdd" [buffer] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PV_MagScale [ControlRate] bufferA=0 bufferB=0+-}+pv_MagScale :: Ugen -> Ugen -> Ugen+pv_MagScale bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagScale" [bufferA, bufferB] Nothing 1 (Special 0) NoId++{- | Smooth spectral magnitudes over time++ PV_MagSmooth [ControlRate] buffer=0 factor=0.1+-}+pv_MagSmooth :: Ugen -> Ugen -> Ugen+pv_MagSmooth buffer factor = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagSmooth" [buffer, factor] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PV_MagSubtract [ControlRate] bufferA=0 bufferB=0 zerolimit=0+-}+pv_MagSubtract :: Ugen -> Ugen -> Ugen -> Ugen+pv_MagSubtract bufferA bufferB zerolimit = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MagSubtract" [bufferA, bufferB, zerolimit] Nothing 1 (Special 0) NoId++{- | Return the N strongest bins++ PV_MaxMagN [ControlRate] buffer=0 numbins=0+-}+pv_MaxMagN :: Ugen -> Ugen -> Ugen+pv_MaxMagN buffer numbins = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MaxMagN" [buffer, numbins] Nothing 1 (Special 0) NoId++{- | Return the N weakest bins++ PV_MinMagN [ControlRate] buffer=0 numbins=0+-}+pv_MinMagN :: Ugen -> Ugen -> Ugen+pv_MinMagN buffer numbins = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_MinMagN" [buffer, numbins] Nothing 1 (Special 0) NoId++{- | one kind of spectral morphing++ PV_Morph [ControlRate] bufferA=0 bufferB=0 morph=0+-}+pv_Morph :: Ugen -> Ugen -> Ugen -> Ugen+pv_Morph bufferA bufferB morph = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Morph" [bufferA, bufferB, morph] Nothing 1 (Special 0) NoId++{- | Return only bins that are unstable++ PV_NoiseSynthF [ControlRate] buffer=0 threshold=0.1 numFrames=2 initflag=0+-}+pv_NoiseSynthF :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_NoiseSynthF buffer threshold numFrames initflag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_NoiseSynthF" [buffer, threshold, numFrames, initflag] Nothing 1 (Special 0) NoId++{- | Return only bins that are unstable++ PV_NoiseSynthP [ControlRate] buffer=0 threshold=0.1 numFrames=2 initflag=0+-}+pv_NoiseSynthP :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_NoiseSynthP buffer threshold numFrames initflag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_NoiseSynthP" [buffer, threshold, numFrames, initflag] Nothing 1 (Special 0) NoId++{- | Return the odd numbered bins in an FFT buffer++ PV_OddBin [ControlRate] buffer=0+-}+pv_OddBin :: Ugen -> Ugen+pv_OddBin buffer = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_OddBin" [buffer] Nothing 1 (Special 0) NoId++{- | Return only bins that are stable++ PV_PartialSynthF [ControlRate] buffer=0 threshold=0.1 numFrames=2 initflag=0+-}+pv_PartialSynthF :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_PartialSynthF buffer threshold numFrames initflag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PartialSynthF" [buffer, threshold, numFrames, initflag] Nothing 1 (Special 0) NoId++{- | Return only bins that are stable++ PV_PartialSynthP [ControlRate] buffer=0 threshold=0.1 numFrames=2 initflag=0+-}+pv_PartialSynthP :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_PartialSynthP buffer threshold numFrames initflag = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PartialSynthP" [buffer, threshold, numFrames, initflag] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PV_PitchShift [ControlRate] buffer=0 ratio=0+-}+pv_PitchShift :: Ugen -> Ugen -> Ugen+pv_PitchShift buffer ratio = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PitchShift" [buffer, ratio] Nothing 1 (Special 0) NoId++{- | Plays FFT data to a memory buffer++ PV_PlayBuf [ControlRate] buffer=0 playbuf=0 rate=1 offset=0 loop=0+-}+pv_PlayBuf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_PlayBuf buffer playbuf_ rate_ offset loop = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_PlayBuf" [buffer, playbuf_, rate_, offset, loop] Nothing 1 (Special 0) NoId++{- | Records FFT data to a memory buffer++ PV_RecordBuf [ControlRate] buffer=0 recbuf=0 offset=0 run=0 loop=0 hop=0.5 wintype=0+-}+pv_RecordBuf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_RecordBuf buffer recbuf offset run loop hop wintype = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_RecordBuf" [buffer, recbuf, offset, run, loop, hop, wintype] Nothing 1 (Special 0) NoId++{- | combine low and high bins from two inputs with interpolation++ PV_SoftWipe [ControlRate] bufferA=0 bufferB=0 wipe=0+-}+pv_SoftWipe :: Ugen -> Ugen -> Ugen -> Ugen+pv_SoftWipe bufferA bufferB wipe = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_SoftWipe" [bufferA, bufferB, wipe] Nothing 1 (Special 0) NoId++{- | A harmonic enhancer++ PV_SpectralEnhance [ControlRate] buffer=0 numPartials=8 ratio=2 strength=0.1+-}+pv_SpectralEnhance :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_SpectralEnhance buffer numPartials ratio strength = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_SpectralEnhance" [buffer, numPartials, ratio, strength] Nothing 1 (Special 0) NoId++{- | Maps the spectral envelope of one FFT process onto another++ PV_SpectralMap [ControlRate] buffer=0 specBuffer=0 floor=0 freeze=0 mode=0 norm=0 window=0+-}+pv_SpectralMap :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_SpectralMap buffer specBuffer floor_ freeze mode norm window = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_SpectralMap" [buffer, specBuffer, floor_, freeze, mode, norm, window] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PV_Split [ControlRate] bufferA=0 bufferB=0+-}+pv_Split :: Ugen -> Ugen -> Ugen+pv_Split bufferA bufferB = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Split" [bufferA, bufferB] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ PV_Whiten [ControlRate] chain=0 trackbufnum=0 relaxtime=2 floor=0.1 smear=0 bindownsample=0+-}+pv_Whiten :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pv_Whiten chain trackbufnum relaxtime floor_ smear bindownsample = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_Whiten" [chain, trackbufnum, relaxtime, floor_, smear, bindownsample] Nothing 1 (Special 0) NoId++{- | one kind of spectral morphing++ PV_XFade [ControlRate] bufferA=0 bufferB=0 fade=0+-}+pv_xFade :: Ugen -> Ugen -> Ugen -> Ugen+pv_xFade bufferA bufferB fade = mkUgen Nothing [ControlRate] (Left ControlRate) "PV_XFade" [bufferA, bufferB, fade] Nothing 1 (Special 0) NoId++{- | Equal power pan across an array of speakers++ PanX [ControlRate,AudioRate] numChans=0 in=0 pos=0 level=1 width=2+-}+panX :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+panX rate numChans in_ pos level width = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "PanX" [numChans, in_, pos, level, width] Nothing 0 (Special 0) NoId++{- | (Undocumented class)++ PanX2D [ControlRate,AudioRate] numChansX=0 numChansY=0 in=0 posX=0 posY=0 level=1 widthX=2 widthY=2+-}+panX2D :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+panX2D rate numChansX numChansY in_ posX posY level widthX widthY = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "PanX2D" [numChansX, numChansY, in_, posX, posY, level, widthX, widthY] Nothing 0 (Special 0) NoId++{- | (Undocumented class)++ PeakEQ2 [AudioRate] in=0 freq=1200 rs=1 db=0+-}+peakEQ2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+peakEQ2 rate in_ freq rs db = mkUgen Nothing [AudioRate] (Left rate) "PeakEQ2" [in_, freq, rs, db] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PeakEQ4 [AudioRate] in=0 freq=1200 rs=1 db=0+-}+peakEQ4 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+peakEQ4 rate in_ freq rs db = mkUgen Nothing [AudioRate] (Left rate) "PeakEQ4" [in_, freq, rs, db] Nothing 1 (Special 0) NoId++{- | 3D Perlin Noise++ Perlin3 [ControlRate,AudioRate] x=0 y=0 z=0+-}+perlin3 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+perlin3 rate x y z = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Perlin3" [x, y, z] Nothing 1 (Special 0) NoId++{- | Sample permutation Ugen.++ PermMod [AudioRate] in=0 freq=100+-}+permMod :: Rate -> Ugen -> Ugen -> Ugen+permMod rate in_ freq = mkUgen Nothing [AudioRate] (Left rate) "PermMod" [in_, freq] Nothing 1 (Special 0) NoId++{- | Sample permutation Ugen with programmable pattern.++ PermModArray [AudioRate] in=0 freq=50 pattern=0+-}+permModArray :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+permModArray rate in_ freq pattern_ = mkUgen Nothing [AudioRate] (Left rate) "PermModArray" [in_, freq, pattern_] Nothing 1 (Special 0) NoId++{- | Sample permutation Ugen with tail.++ PermModT [AudioRate] in=0 outfreq=440 infreq=5000+-}+permModT :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+permModT rate in_ outfreq infreq = mkUgen Nothing [AudioRate] (Left rate) "PermModT" [in_, outfreq, infreq] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PhasorModal [AudioRate] input=0 freq=100 decay=0.25 damp=1 amp=0.5 phase=0; FILTER: TRUE+-}+phasorModal :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+phasorModal input freq decay_ damp amp phase = mkUgen Nothing [AudioRate] (Right [0]) "PhasorModal" [input, freq, decay_, damp, amp, phase] Nothing 1 (Special 0) NoId++{- | Tree classifier using (hyper)planes – Ugen or language-side++ PlaneTree [ControlRate] treebuf=0 in=0 gate=1+-}+planeTree :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+planeTree rate treebuf in_ gate_ = mkUgen Nothing [ControlRate] (Left rate) "PlaneTree" [treebuf, in_, gate_] Nothing 1 (Special 0) NoId++{- | POKEY Chip Sound Simulator++ Pokey [AudioRate] audf1=0 audc1=0 audf2=0 audc2=0 audf3=0 audc3=0 audf4=0 audc4=0 audctl=0+-}+pokey :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+pokey rate audf1 audc1 audf2 audc2 audf3 audc3 audf4 audc4 audctl = mkUgen Nothing [AudioRate] (Left rate) "Pokey" [audf1, audc1, audf2, audc2, audf3, audc3, audf4, audc4, audctl] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ PosRatio [AudioRate] in=0 period=100 thresh=0.1+-}+posRatio :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+posRatio rate in_ period thresh = mkUgen Nothing [AudioRate] (Left rate) "PosRatio" [in_, period, thresh] Nothing 1 (Special 0) NoId++{- | debug assistance++ PrintVal [ControlRate] in=0 numblocks=100 id=0+-}+printVal :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+printVal rate in_ numblocks id_ = mkUgen Nothing [ControlRate] (Left rate) "PrintVal" [in_, numblocks, id_] Nothing 1 (Special 0) NoId++{- | constant Q transform pitch follower++ Qitch [ControlRate] in=0 databufnum=0 ampThreshold=0.01 algoflag=1 ampbufnum=0 minfreq=0 maxfreq=2500+-}+qitch :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+qitch rate in_ databufnum ampThreshold algoflag ampbufnum minfreq maxfreq = mkUgen Nothing [ControlRate] (Left rate) "Qitch" [in_, databufnum, ampThreshold, algoflag, ampbufnum, minfreq, maxfreq] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ Bezier [ControlRate,AudioRate] haltAfter=100 dx=0.0001 freq=440 phase=0 *param=0; MCE=1+-}+bezier :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+bezier rate haltAfter dx freq phase param = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Bezier" [haltAfter, dx, freq, phase] (Just [param]) 1 (Special 0) NoId++{- | rotating clock divider++ RCD [AudioRate] clock=0 rotate=0 reset=0 div=0 spread=0 auto=0 len=0 down=0 gates=0; FILTER: TRUE+-}+rcd :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rcd clock rotate_ reset div_ spread auto len down gates = mkUgen Nothing [AudioRate] (Right [0]) "RCD" [clock, rotate_, reset, div_, spread, auto, len, down, gates] Nothing 8 (Special 0) NoId++{- | (Undocumented class)++ RDL [AudioRate] numChannels=1 inputArray=0+-}+rdl :: Rate -> Ugen -> Ugen -> Ugen+rdl rate numChannels inputArray = mkUgen Nothing [AudioRate] (Left rate) "RDL" [numChannels, inputArray] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ DX7 [AudioRate] bufnum=0 on=0 off=0 data=0 vc=0 mnn=60 vel=99 pw=0 mw=0 bc=0 fc=0+-}+dx7 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+dx7 rate bufnum on off data_ vc mnn vel pw mw bc fc = mkUgen Nothing [AudioRate] (Left rate) "DX7" [bufnum, on, off, data_, vc, mnn, vel, pw, mw, bc, fc] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RDX7Env [AudioRate] gate=0 data=0 r1=0 r2=0 r3=0 r4=0 l1=0 l2=0 l3=0 l4=0 ol=0+-}+rdx7Env :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rdx7Env rate gate_ data_ r1 r2 r3 r4 l1 l2 l3 l4 ol = mkUgen Nothing [AudioRate] (Left rate) "RDX7Env" [gate_, data_, r1, r2, r3, r4, l1, l2, l3, l4, ol] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RDelayMap [AudioRate] bufnum=0 in=0 dynamic=0 *spec=0; MCE=1, FILTER: TRUE+-}+rDelayMap :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rDelayMap bufnum in_ dynamic spec = mkUgen Nothing [AudioRate] (Right [1]) "RDelayMap" [bufnum, in_, dynamic] (Just [spec]) 1 (Special 0) NoId++{- | (Undocumented class)++ RDelaySet [AudioRate] input=0 *setArray=0; MCE=1, FILTER: TRUE+-}+rDelaySet :: Ugen -> Ugen -> Ugen+rDelaySet input setArray = mkUgen Nothing [AudioRate] (Right [0]) "RDelaySet" [input] (Just [setArray]) 1 (Special 0) NoId++{- | (Undocumented class)++ RDelaySetBuf [AudioRate] bufnum=0 in=0 spec=0+-}+rDelaySetBuf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+rDelaySetBuf rate bufnum in_ spec = mkUgen Nothing [AudioRate] (Left rate) "RDelaySetBuf" [bufnum, in_, spec] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ dustRange [AudioRate] iot_min=0.1 iot_max=1+-}+dustRangeId :: ID a => a -> Rate -> Ugen -> Ugen -> Ugen+dustRangeId z rate iot_min iot_max = mkUgen Nothing [AudioRate] (Left rate) "DustRange" [iot_min, iot_max] Nothing 1 (Special 0) (toUid z)++{- | (Undocumented class)++ ExpRandN [InitialisationRate] lo=0 hi=1; NC INPUT: True, NONDET+-}+expRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen+expRandNId numChannels z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "ExpRandN" [lo, hi] Nothing numChannels (Special 0) (toUid z)++-- | Monad variant of ExpRandN.+expRandNM :: Uid m => Int -> Ugen -> Ugen -> m Ugen+expRandNM nc = liftUid2 (expRandNId nc)++-- | Unsafe variant of ExpRandN.+expRandN :: Int -> Ugen -> Ugen -> Ugen+expRandN nc = liftUnsafe2 (expRandNM nc)++{- | (Undocumented class)++ Freezer [AudioRate] bufnum=0 left=0 right=1 gain=1 increment=1 incrementOffset=0 incrementRandom=0 rightRandom=0 syncPhaseTrigger=0 randomizePhaseTrigger=0 numberOfLoops=4+-}+freezer :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+freezer bufnum left right gain increment incrementOffset incrementRandom rightRandom syncPhaseTrigger randomizePhaseTrigger numberOfLoops = mkUgen Nothing [AudioRate] (Left AudioRate) "Freezer" [bufnum, left, right, gain, increment, incrementOffset, incrementRandom, rightRandom, syncPhaseTrigger, randomizePhaseTrigger, numberOfLoops] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ IRandN [] numChannels=2 lo=0 hi=127+-}+iRandNId :: ID a => a -> Int -> Ugen -> Ugen -> Ugen+iRandNId z numChannels lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "IRandN" [lo, hi] Nothing numChannels (Special 0) (toUid z)++-- | Monad variant of IRandN.+iRandNM :: Uid m => Int -> Ugen -> Ugen -> m Ugen+iRandNM nc = liftUid2 (iRandNId nc)++-- | Unsafe variant of IRandN.+iRandN :: Int -> Ugen -> Ugen -> Ugen+iRandN nc = liftUnsafe2 (iRandNM nc)++{- | TB303 Filter Emulation++ RLPFD [ControlRate,AudioRate] in=0 ffreq=440 res=0 dist=0; FILTER: TRUE+-}+rlpfd :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rlpfd in_ ffreq res dist = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "RLPFD" [in_, ffreq, res, dist] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RLagC [ControlRate] in=0 timeUp=0.1 curveUp=0 timeDown=0.1 curveDown=0; FILTER: TRUE+-}+rLagC :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rLagC in_ timeUp curveUp timeDown curveDown = mkUgen Nothing [ControlRate] (Right [0]) "RLagC" [in_, timeUp, curveUp, timeDown, curveDown] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ LinRandN [InitialisationRate] lo=0 hi=1 minmax=0; NC INPUT: True, NONDET+-}+linRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen+linRandNId numChannels z lo hi minmax = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "LinRandN" [lo, hi, minmax] Nothing numChannels (Special 0) (toUid z)++-- | Monad variant of LinRandN.+linRandNM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> m Ugen+linRandNM nc = liftUid3 (linRandNId nc)++-- | Unsafe variant of LinRandN.+linRandN :: Int -> Ugen -> Ugen -> Ugen -> Ugen+linRandN nc = liftUnsafe3 (linRandNM nc)++{- | (Undocumented class)++ RLoopSet [AudioRate] bufnum=0 left=0 right=1 gain=1 increment=1 spec=0+-}+rLoopSet :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rLoopSet rate bufnum left right gain increment spec = mkUgen Nothing [AudioRate] (Left rate) "RLoopSet" [bufnum, left, right, gain, increment, spec] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RMAFoodChainL [AudioRate] freq=22050 a1=5 b1=3 d1=0.4 a2=0.1 b2=2 d2=0.01 k=1.0943 r=0.8904 h=0.05 xi=0.1 yi=0 zi=0+-}+rmaFoodChainL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rmaFoodChainL rate freq a1 b1 d1 a2 b2 d2 k r h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "RMAFoodChainL" [freq, a1, b1, d1, a2, b2, d2, k, r, h, xi, yi, zi] Nothing 3 (Special 0) NoId++{- | (Undocumented class)++ RMEQ [AudioRate] in=0 freq=440 rq=0.1 k=0; FILTER: TRUE+-}+rmeq :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rmeq in_ freq rq k = mkUgen Nothing [AudioRate] (Right [0]) "RMEQ" [in_, freq, rq, k] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RMEQSuite [] maxSize=0+-}+rmeqSuite :: Rate -> Ugen -> Ugen+rmeqSuite rate maxSize = mkUgen Nothing [InitialisationRate, ControlRate, AudioRate, DemandRate] (Left rate) "RMEQSuite" [maxSize] Nothing 1 (Special 0) NoId++{- | root mean square++ RMS [ControlRate,AudioRate] in=0 lpFreq=10+-}+rms :: Rate -> Ugen -> Ugen -> Ugen+rms rate in_ lpFreq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RMS" [in_, lpFreq] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RMShelf [AudioRate] in=0 freq=440 k=0+-}+rmShelf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+rmShelf rate in_ freq k = mkUgen Nothing [AudioRate] (Left rate) "RMShelf" [in_, freq, k] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RMShelf2 [AudioRate] in=0 freq=440 k=0+-}+rmShelf2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+rmShelf2 rate in_ freq k = mkUgen Nothing [AudioRate] (Left rate) "RMShelf2" [in_, freq, k] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ ObxdFilter [AudioRate] in=0 cutoff=440 resonance=0 multimode=0.5 bandpass=0 fourpole=0+-}+obxdFilter :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+obxdFilter in_ cutoff resonance multimode bandpass fourpole = mkUgen Nothing [AudioRate] (Right [0]) "ObxdFilter" [in_, cutoff, resonance, multimode, bandpass, fourpole] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RPVDecayTbl [] fft_buf=0 decay_rate_buf=0 history_buf=0+-}+rpvDecayTbl :: Ugen -> Ugen -> Ugen -> Ugen+rpvDecayTbl fft_buf decay_rate_buf history_buf = mkUgen Nothing [ControlRate] (Left ControlRate) "RPVDecayTbl" [fft_buf, decay_rate_buf, history_buf] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RandN [InitialisationRate] lo=0 hi=1; NC INPUT: True, NONDET+-}+randNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen+randNId numChannels z lo hi = mkUgen Nothing [InitialisationRate] (Left InitialisationRate) "RandN" [lo, hi] Nothing numChannels (Special 0) (toUid z)++-- | Monad variant of RandN.+randNM :: Uid m => Int -> Ugen -> Ugen -> m Ugen+randNM nc = liftUid2 (randNId nc)++-- | Unsafe variant of RandN.+randN :: Int -> Ugen -> Ugen -> Ugen+randN nc = liftUnsafe2 (randNM nc)++{- | (Undocumented class)++ RSVFBP [AudioRate] in=0 freq=440 q=0+-}+svfBp :: Ugen -> Ugen -> Ugen -> Ugen+svfBp in_ freq q = mkUgen Nothing [AudioRate] (Right [0]) "SvfBp" [in_, freq, q] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SvfHp [AudioRate] in=0 freq=440 q=0+-}+svfHp :: Ugen -> Ugen -> Ugen -> Ugen+svfHp in_ freq q = mkUgen Nothing [AudioRate] (Right [0]) "SvfHp" [in_, freq, q] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SvflP [AudioRate] in=0 freq=440 q=0+-}+svfLp :: Ugen -> Ugen -> Ugen -> Ugen+svfLp in_ freq q = mkUgen Nothing [AudioRate] (Right [0]) "SvfLp" [in_, freq, q] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ ShufflerB [AudioRate] bufnum=0 readLocationMinima=0.01 readLocationMaxima=0.02 readIncrementMinima=1 readIncrementMaxima=1 durationMinima=0.2 durationMaxima=0.2 envelopeAmplitudeMinima=0.5 envelopeAmplitudeMaxima=0.5 envelopeShapeMinima=0.5 envelopeShapeMaxima=0.5 envelopeSkewMinima=0.5 envelopeSkewMaxima=0.5 stereoLocationMinima=0.5 stereoLocationMaxima=0.5 interOffsetTimeMinima=0.05 interOffsetTimeMaxima=0.01 ftableReadLocationIncrement=1 readIncrementQuanta=0 interOffsetTimeQuanta=0+-}+shufflerB :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+shufflerB bufnum readLocationMinima readLocationMaxima readIncrementMinima readIncrementMaxima durationMinima durationMaxima envelopeAmplitudeMinima envelopeAmplitudeMaxima envelopeShapeMinima envelopeShapeMaxima envelopeSkewMinima envelopeSkewMaxima stereoLocationMinima stereoLocationMaxima interOffsetTimeMinima interOffsetTimeMaxima ftableReadLocationIncrement readIncrementQuanta interOffsetTimeQuanta = mkUgen Nothing [AudioRate] (Left AudioRate) "ShufflerB" [bufnum, readLocationMinima, readLocationMaxima, readIncrementMinima, readIncrementMaxima, durationMinima, durationMaxima, envelopeAmplitudeMinima, envelopeAmplitudeMaxima, envelopeShapeMinima, envelopeShapeMaxima, envelopeSkewMinima, envelopeSkewMaxima, stereoLocationMinima, stereoLocationMaxima, interOffsetTimeMinima, interOffsetTimeMaxima, ftableReadLocationIncrement, readIncrementQuanta, interOffsetTimeQuanta] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ RShufflerL [AudioRate] in=0 fragmentSize=0.01 maxDelay=0.01+-}+rShufflerL :: Ugen -> Ugen -> Ugen -> Ugen+rShufflerL in_ fragmentSize maxDelay = mkUgen Nothing [AudioRate] (Right [0]) "RShufflerL" [in_, fragmentSize, maxDelay] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RSmplrIndex [ControlRate] buf=0 size=0 mnn=60+-}+rSmplrIndex :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+rSmplrIndex rate buf size mnn = mkUgen Nothing [ControlRate] (Left rate) "RSmplrIndex" [buf, size, mnn] Nothing 2 (Special 0) NoId++{- | (Undocumented class)++ TExpRandN [ControlRate] lo=0 hi=1 trigger=0; NC INPUT: True, FILTER: TRUE, NONDET+-}+tExpRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen+tExpRandNId numChannels z lo hi trigger = mkUgen Nothing [ControlRate] (Right [2]) "TExpRandN" [lo, hi, trigger] Nothing numChannels (Special 0) (toUid z)++-- | Monad variant of TExpRandN.+tExpRandNM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> m Ugen+tExpRandNM nc = liftUid3 (tExpRandNId nc)++-- | Unsafe variant of TExpRandN.+tExpRandN :: Int -> Ugen -> Ugen -> Ugen -> Ugen+tExpRandN nc = liftUnsafe3 (tExpRandNM nc)++{- | (Undocumented class)++ TLinRandN [ControlRate] lo=0 hi=1 minmax=0 trigger=0; NC INPUT: True, FILTER: TRUE, NONDET+-}+tLinRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tLinRandNId numChannels z lo hi minmax trigger = mkUgen Nothing [ControlRate] (Right [3]) "TLinRandN" [lo, hi, minmax, trigger] Nothing numChannels (Special 0) (toUid z)++-- | Monad variant of TLinRandN.+tLinRandNM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+tLinRandNM nc = liftUid4 (tLinRandNId nc)++-- | Unsafe variant of TLinRandN.+tLinRandN :: Int -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tLinRandN nc = liftUnsafe4 (tLinRandNM nc)++{- | (Undocumented class)++ TRandN [ControlRate] lo=0 hi=1 trigger=0; NC INPUT: True, FILTER: TRUE, NONDET+-}+tRandNId :: ID a => Int -> a -> Ugen -> Ugen -> Ugen -> Ugen+tRandNId numChannels z lo hi trigger = mkUgen Nothing [ControlRate] (Right [2]) "TRandN" [lo, hi, trigger] Nothing numChannels (Special 0) (toUid z)++-- | Monad variant of TRandN.+tRandNM :: Uid m => Int -> Ugen -> Ugen -> Ugen -> m Ugen+tRandNM nc = liftUid3 (tRandNId nc)++-- | Unsafe variant of TRandN.+tRandN :: Int -> Ugen -> Ugen -> Ugen -> Ugen+tRandN nc = liftUnsafe3 (tRandNM nc)++{- | (Undocumented class)++ TScramble [InitialisationRate,ControlRate] trigger=0 *inputs=0; MCE=1, FILTER: TRUE, NONDET+-}+tScrambleId :: ID a => a -> Ugen -> Ugen -> Ugen+tScrambleId z trigger inputs = mkUgen Nothing [InitialisationRate, ControlRate] (Right [0]) "TScramble" [trigger] (Just [inputs]) (length (mceChannels inputs) + 0) (Special 0) (toUid z)++-- | Monad variant of TScramble.+tScrambleM :: Uid m => Ugen -> Ugen -> m Ugen+tScrambleM = liftUid2 tScrambleId++-- | Unsafe variant of TScramble.+tScramble :: Ugen -> Ugen -> Ugen+tScramble = liftUnsafe2 tScrambleM++{- | (Undocumented class)++ RTracePlay [ControlRate,AudioRate] bufnum=0 degree=4 rate=0 axis=1+-}+rTracePlay :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rTracePlay rate bufnum degree rate_ axis = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RTracePlay" [bufnum, degree, rate_, axis] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RTraceRd [ControlRate,AudioRate] bufnum=0 degree=4 index=0 axis=1+-}+rTraceRd :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rTraceRd rate bufnum degree index_ axis = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RTraceRd" [bufnum, degree, index_, axis] Nothing 1 (Special 0) NoId++{- | differential pulse-code modulation++ RedDPCMdecode [ControlRate,AudioRate] in=0+-}+redDPCMdecode :: Rate -> Ugen -> Ugen+redDPCMdecode rate in_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RedDPCMdecode" [in_] Nothing 1 (Special 0) NoId++{- | differential pulse-code modulation++ RedDPCMencode [ControlRate,AudioRate] in=0 round=0+-}+redDPCMencode :: Rate -> Ugen -> Ugen -> Ugen+redDPCMencode rate in_ round_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RedDPCMencode" [in_, round_] Nothing 1 (Special 0) NoId++{- | look before you leap++ RedLbyl [ControlRate,AudioRate] in=0 thresh=0.5 samples=2+-}+redLbyl :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+redLbyl rate in_ thresh samples = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RedLbyl" [in_, thresh, samples] Nothing 1 (Special 0) NoId++{- | a really bad pseudo-random noise generator++ RedNoise [ControlRate,AudioRate] clock=0+-}+redNoise :: Rate -> Ugen -> Ugen+redNoise rate clock = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RedNoise" [clock] Nothing 1 (Special 0) NoId++{- | a phasor that can loop++ RedPhasor [ControlRate,AudioRate] trig=0 rate=1 start=0 end=1 loop=0 loopstart=0 loopend=1+-}+redPhasor :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+redPhasor rate trig_ rate_ start end loop loopstart loopend = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RedPhasor" [trig_, rate_, start, end, loop, loopstart, loopend] Nothing 1 (Special 0) NoId++{- | a phasor that can loop - version2++ RedPhasor2 [ControlRate,AudioRate] trig=0 rate=1 start=0 end=1 loop=0 loopstart=0 loopend=1+-}+redPhasor2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+redPhasor2 rate trig_ rate_ start end loop loopstart loopend = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "RedPhasor2" [trig_, rate_, start, end, loop, loopstart, loopend] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ RegaliaMitraEQ [AudioRate] in=0 freq=440 rq=0.1 k=0+-}+regaliaMitraEQ :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+regaliaMitraEQ rate in_ freq rq k = mkUgen Nothing [AudioRate] (Left rate) "RegaliaMitraEQ" [in_, freq, rq, k] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Resonator [AudioRate] input=0 freq=100 position=0.001 resolution=24 structure=0.5 brightness=0.5 damping=0.5; FILTER: TRUE+-}+resonator :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+resonator input freq position resolution structure brightness damping = mkUgen Nothing [AudioRate] (Right [0]) "Resonator" [input, freq, position, resolution, structure, brightness, damping] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Rongs [AudioRate] trigger=0 sustain=1 f0=0.01 structure=0.5 brightness=0.5 damping=0.75 accent=0.9 stretch=0.5 position=0.15 loss=0.15 modeNum=2 cosFreq=0.25+-}+rongs :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rongs rate trigger sustain f0 structure brightness damping accent stretch position loss modeNum cosFreq = mkUgen Nothing [AudioRate] (Left rate) "Rongs" [trigger, sustain, f0, structure, brightness, damping, accent, stretch, position, loss, modeNum, cosFreq] Nothing 1 (Special 0) NoId++{- | Rossler chaotic generator++ RosslerL [AudioRate] freq=22050 a=0.2 b=0.2 c=5.7 h=0.05 xi=0.1 yi=0 zi=0+-}+rosslerL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rosslerL rate freq a b c h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "RosslerL" [freq, a, b, c, h, xi, yi, zi] Nothing 3 (Special 0) NoId++{- | (Undocumented class)++ RosslerResL [AudioRate] in=0 stiff=1 freq=22050 a=0.2 b=0.2 c=5.7 h=0.05 xi=0.1 yi=0 zi=0+-}+rosslerResL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rosslerResL rate in_ stiff freq a b c h xi yi zi = mkUgen Nothing [AudioRate] (Left rate) "RosslerResL" [in_, stiff, freq, a, b, c, h, xi, yi, zi] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Rotate [AudioRate] w=0 x=0 y=0 z=0 rotate=0+-}+rotate :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+rotate rate w x y z rotate_ = mkUgen Nothing [AudioRate] (Left rate) "Rotate" [w, x, y, z, rotate_] Nothing 1 (Special 0) NoId++{- | (faulty) SID Sound Chip Simulator++ SID6581f [AudioRate] freqLo0=0 freqHi0=0 pwLo0=0 pwHi0=0 ctrl0=0 atkDcy0=0 susRel0=0 freqLo1=0 freqHi1=0 pwLo1=0 pwHi1=0 ctrl1=0 atkDcy1=0 susRel1=0 freqLo2=0 freqHi2=0 pwLo2=0 pwHi2=0 ctrl2=0 atkDcy2=0 susRel2=0 fcLo=0 fcHi=0 resFilt=0 modeVol=0 rate=1+-}+sid6581f :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sid6581f rate freqLo0 freqHi0 pwLo0 pwHi0 ctrl0 atkDcy0 susRel0 freqLo1 freqHi1 pwLo1 pwHi1 ctrl1 atkDcy1 susRel1 freqLo2 freqHi2 pwLo2 pwHi2 ctrl2 atkDcy2 susRel2 fcLo fcHi resFilt modeVol rate_ = mkUgen Nothing [AudioRate] (Left rate) "SID6581f" [freqLo0, freqHi0, pwLo0, pwHi0, ctrl0, atkDcy0, susRel0, freqLo1, freqHi1, pwLo1, pwHi1, ctrl1, atkDcy1, susRel1, freqLo2, freqHi2, pwLo2, pwHi2, ctrl2, atkDcy2, susRel2, fcLo, fcHi, resFilt, modeVol, rate_] Nothing 1 (Special 0) NoId++{- | experimental time domain onset detector++ SLOnset [ControlRate] input=0 memorysize1=20 before=5 after=5 threshold=10 hysteresis=10+-}+slOnset :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+slOnset rate input memorysize1 before after threshold hysteresis = mkUgen Nothing [ControlRate] (Left rate) "SLOnset" [input, memorysize1, before, after, threshold, hysteresis] Nothing 1 (Special 0) NoId++{- | Spectral Modeling Synthesis++ SMS [AudioRate] input=0 maxpeaks=80 currentpeaks=80 tolerance=4 noisefloor=0.2 freqmult=1 freqadd=0 formantpreserve=0 useifft=0 ampmult=1 graphicsbufnum=0; FILTER: TRUE+-}+sms :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sms input maxpeaks currentpeaks tolerance noisefloor freqmult freqadd formantpreserve useifft ampmult graphicsbufnum = mkUgen Nothing [AudioRate] (Right [0]) "SMS" [input, maxpeaks, currentpeaks, tolerance, noisefloor, freqmult, freqadd, formantpreserve, useifft, ampmult, graphicsbufnum] Nothing 2 (Special 0) NoId++{- | Sound Chip Simulator++ SN76489 [AudioRate] tone0=512 tone1=0 tone2=0 noise=0 vol0=15 vol1=0 vol2=0 vol3=0 rate=1+-}+sn76489 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sn76489 rate tone0 tone1 tone2 noise vol0 vol1 vol2 vol3 rate_ = mkUgen Nothing [AudioRate] (Left rate) "SN76489" [tone0, tone1, tone2, noise, vol0, vol1, vol2, vol3, rate_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SOMAreaWr [ControlRate] bufnum=0 inputdata=0 coords=0 netsize=10 numdims=2 nhood=0.5 gate=1+-}+somAreaWr :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+somAreaWr rate bufnum inputdata coords netsize numdims nhood gate_ = mkUgen Nothing [ControlRate] (Left rate) "SOMAreaWr" [bufnum, inputdata, coords, netsize, numdims, nhood, gate_] Nothing 1 (Special 0) NoId++{- | Map an input using a Self-Organising Map++ SOMRd [ControlRate,AudioRate] bufnum=0 inputdata=0 netsize=10 numdims=2 gate=1+-}+somRd :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+somRd rate bufnum inputdata netsize numdims gate_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "SOMRd" [bufnum, inputdata, netsize, numdims, gate_] Nothing 2 (Special 0) NoId++{- | Create (train) a Self-Organising Map++ SOMTrain [ControlRate] bufnum=0 inputdata=0 netsize=10 numdims=2 traindur=5000 nhood=0.5 gate=1 initweight=1+-}+somTrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+somTrain rate bufnum inputdata netsize numdims traindur nhood gate_ initweight = mkUgen Nothing [ControlRate] (Left rate) "SOMTrain" [bufnum, inputdata, netsize, numdims, traindur, nhood, gate_, initweight] Nothing 3 (Special 0) NoId++{- | 12db/Oct State Variable Filter++ SVF [ControlRate,AudioRate] signal=0 cutoff=2200 res=0.1 lowpass=1 bandpass=0 highpass=0 notch=0 peak=0; FILTER: TRUE+-}+svf :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+svf signal cutoff res lowpass bandpass highpass notch peak_ = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "SVF" [signal, cutoff, res, lowpass, bandpass, highpass, notch, peak_] Nothing 1 (Special 0) NoId++{- | super-efficient sawtooth oscillator with low aliasing++ SawDPW [ControlRate,AudioRate] freq=440 iphase=0+-}+sawDPW :: Rate -> Ugen -> Ugen -> Ugen+sawDPW rate freq iphase = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "SawDPW" [freq, iphase] Nothing 1 (Special 0) NoId++{- | Perceptual feature modeling sensory dissonance++ SensoryDissonance [ControlRate] fft=0 maxpeaks=100 peakthreshold=0.1 norm=0 clamp=1+-}+sensoryDissonance :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sensoryDissonance rate fft_ maxpeaks peakthreshold norm clamp = mkUgen Nothing [ControlRate] (Left rate) "SensoryDissonance" [fft_, maxpeaks, peakthreshold, norm, clamp] Nothing 1 (Special 0) NoId++{- | Fuzzy sieve based synthesis++ Sieve1 [ControlRate,AudioRate] bufnum=0 gap=2 alternate=1+-}+sieve1 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+sieve1 rate bufnum gap alternate = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Sieve1" [bufnum, gap, alternate] Nothing 1 (Special 0) NoId++{- | Granular synthesis with sinusoidal grains++ SinGrain [AudioRate] trigger=0 dur=1 freq=440+-}+sinGrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+sinGrain rate trigger dur freq = mkUgen Nothing [AudioRate] (Left rate) "SinGrain" [trigger, dur, freq] Nothing 1 (Special 0) NoId++{- | Granular synthesis with sinusoidal grains and user supplied envelope++ SinGrainB [AudioRate] trigger=0 dur=1 freq=440 envbuf=0+-}+sinGrainB :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sinGrainB rate trigger dur freq envbuf = mkUgen Nothing [AudioRate] (Left rate) "SinGrainB" [trigger, dur, freq, envbuf] Nothing 1 (Special 0) NoId++{- | Granular synthesis with sinusoidal grains with Ambisonic panning and user supplied envelope++ SinGrainBBF [AudioRate] trigger=0 dur=1 freq=440 envbuf=0 azimuth=0 elevation=0 rho=1 wComp=0+-}+sinGrainBBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sinGrainBBF rate trigger dur freq envbuf azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "SinGrainBBF" [trigger, dur, freq, envbuf, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | Granular synthesis with sinusoidal grains with Ambisonic panning++ SinGrainBF [AudioRate] trigger=0 dur=1 freq=440 azimuth=0 elevation=0 rho=1 wComp=0+-}+sinGrainBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sinGrainBF rate trigger dur freq azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "SinGrainBF" [trigger, dur, freq, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | Granular synthesis with sinusoidal grains and user supplied envelopes++ SinGrainI [AudioRate] trigger=0 dur=1 freq=440 envbuf1=0 envbuf2=0 ifac=0.5+-}+sinGrainI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sinGrainI rate trigger dur freq envbuf1 envbuf2 ifac = mkUgen Nothing [AudioRate] (Left rate) "SinGrainI" [trigger, dur, freq, envbuf1, envbuf2, ifac] Nothing 1 (Special 0) NoId++{- | Granular synthesis with sinusoidal grains with Ambisonic panning and user supplied envelopes++ SinGrainIBF [AudioRate] trigger=0 dur=1 freq=440 envbuf1=0 envbuf2=0 ifac=0.5 azimuth=0 elevation=0 rho=1 wComp=0+-}+sinGrainIBF :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sinGrainIBF rate trigger dur freq envbuf1 envbuf2 ifac azimuth elevation rho wComp = mkUgen Nothing [AudioRate] (Left rate) "SinGrainIBF" [trigger, dur, freq, envbuf1, envbuf2, ifac, azimuth, elevation, rho, wComp] Nothing 4 (Special 0) NoId++{- | (Undocumented class)++ SinTone [AudioRate] freq=440 phase=0+-}+sinTone :: Rate -> Ugen -> Ugen -> Ugen+sinTone rate freq phase = mkUgen Nothing [AudioRate] (Left rate) "SinTone" [freq, phase] Nothing 1 (Special 0) NoId++{- | port of some ladspa plugins++ SineShaper [AudioRate] in=0 limit=1; FILTER: TRUE+-}+sineShaper :: Ugen -> Ugen -> Ugen+sineShaper in_ limit = mkUgen Nothing [AudioRate] (Right [0]) "SineShaper" [in_, limit] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SkipNeedle [AudioRate] range=44100 rate=10 offset=0+-}+skipNeedle :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+skipNeedle rate range rate_ offset = mkUgen Nothing [AudioRate] (Left rate) "SkipNeedle" [range, rate_, offset] Nothing 1 (Special 0) NoId++{- | lowpass filter for envelope following++ Slide [ControlRate,AudioRate] in=0 slideup=50 slidedown=3000+-}+slide :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+slide rate in_ slideup slidedown = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Slide" [in_, slideup, slidedown] Nothing 1 (Special 0) NoId++{- | generate cpu spikes++ Slub [ControlRate,AudioRate] trig=0 spike=4.04+-}+slub :: Rate -> Ugen -> Ugen -> Ugen+slub rate trig_ spike = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Slub" [trig_, spike] Nothing 1 (Special 0) NoId++{- | Smooth samplerate and bitrate reduction++ SmoothDecimator [AudioRate] in=0 rate=44100 smoothing=0.5+-}+smoothDecimator :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+smoothDecimator rate in_ rate_ smoothing = mkUgen Nothing [AudioRate] (Left rate) "SmoothDecimator" [in_, rate_, smoothing] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SoftClipAmp [AudioRate] in=0 pregain=1; FILTER: TRUE+-}+softClipAmp :: Ugen -> Ugen -> Ugen+softClipAmp in_ pregain = mkUgen Nothing [AudioRate] (Right [0]) "SoftClipAmp" [in_, pregain] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SoftClipAmp4 [AudioRate] in=0 pregain=1; FILTER: TRUE+-}+softClipAmp4 :: Ugen -> Ugen -> Ugen+softClipAmp4 in_ pregain = mkUgen Nothing [AudioRate] (Right [0]) "SoftClipAmp4" [in_, pregain] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SoftClipAmp8 [AudioRate] in=0 pregain=1; FILTER: TRUE+-}+softClipAmp8 :: Ugen -> Ugen -> Ugen+softClipAmp8 in_ pregain = mkUgen Nothing [AudioRate] (Right [0]) "SoftClipAmp8" [in_, pregain] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SoftClipper4 [AudioRate] in=0+-}+softClipper4 :: Rate -> Ugen -> Ugen+softClipper4 rate in_ = mkUgen Nothing [AudioRate] (Left rate) "SoftClipper4" [in_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SoftClipper8 [AudioRate] in=0+-}+softClipper8 :: Rate -> Ugen -> Ugen+softClipper8 rate in_ = mkUgen Nothing [AudioRate] (Left rate) "SoftClipper8" [in_] Nothing 1 (Special 0) NoId++{- | LPC analizer.++ SonLPC [AudioRate] buff=-1.0 in=0.0 hop=0.5 poles=10.0+-}+sonLPC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+sonLPC rate buff in_ hop poles = mkUgen Nothing [AudioRate] (Left rate) "SonLPC" [buff, in_, hop, poles] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SonLPCSynth [AudioRate] chain=-1.0+-}+sonLPCSynth :: Rate -> Ugen -> Ugen+sonLPCSynth rate chain = mkUgen Nothing [AudioRate] (Left rate) "SonLPCSynth" [chain] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ SonLPCSynthIn [AudioRate] chain=-1.0 in=0.0+-}+sonLPCSynthIn :: Rate -> Ugen -> Ugen -> Ugen+sonLPCSynthIn rate chain in_ = mkUgen Nothing [AudioRate] (Left rate) "SonLPCSynthIn" [chain, in_] Nothing 1 (Special 0) NoId++{- | Karplus-Strong via a sorting algorithm++ SortBuf [AudioRate] bufnum=0 sortrate=10 reset=0+-}+sortBuf :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+sortBuf rate bufnum sortrate reset = mkUgen Nothing [AudioRate] (Left rate) "SortBuf" [bufnum, sortrate, reset] Nothing 1 (Special 0) NoId++{- | Spectral feature extraction++ SpectralEntropy [ControlRate] fft=0 fftsize=2048 numbands=1; NC INPUT: True+-}+spectralEntropy :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen+spectralEntropy numChannels rate fft_ fftsize numbands = mkUgen Nothing [ControlRate] (Left rate) "SpectralEntropy" [fft_, fftsize, numbands] Nothing numChannels (Special 0) NoId++{- | (Undocumented class)++ Spreader [AudioRate] in=0 theta=1.5708 filtsPerOctave=8+-}+spreader :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+spreader rate in_ theta filtsPerOctave = mkUgen Nothing [AudioRate] (Left rate) "Spreader" [in_, theta, filtsPerOctave] Nothing 2 (Special 0) NoId++{- | Spruce bud worm model equations++ SpruceBudworm [AudioRate] reset=0 rate=0.1 k1=27.9 k2=1.5 alpha=0.1 beta=10.1 mu=0.3 rho=10.1 initx=0.9 inity=0.1+-}+spruceBudworm :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+spruceBudworm rate reset rate_ k1 k2 alpha beta mu rho initx inity = mkUgen Nothing [AudioRate] (Left rate) "SpruceBudworm" [reset, rate_, k1, k2, alpha, beta, mu, rho, initx, inity] Nothing 2 (Special 0) NoId++{- | Wave squeezer. Maybe a kind of pitch shifter.++ Squiz [ControlRate,AudioRate] in=0 pitchratio=2 zcperchunk=1 memlen=0.1; FILTER: TRUE+-}+squiz :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+squiz in_ pitchratio zcperchunk memlen = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Squiz" [in_, pitchratio, zcperchunk, memlen] Nothing 1 (Special 0) NoId++{- | standard map 2D chaotic generator++ Standard2DC [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 k=1.4 x0=4.97898 y0=5.74734+-}+standard2DC :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+standard2DC rate minfreq maxfreq k x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Standard2DC" [minfreq, maxfreq, k, x0, y0] Nothing 1 (Special 0) NoId++{- | standard map 2D chaotic generator++ Standard2DL [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 k=1.4 x0=4.97898 y0=5.74734+-}+standard2DL :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+standard2DL rate minfreq maxfreq k x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Standard2DL" [minfreq, maxfreq, k, x0, y0] Nothing 1 (Special 0) NoId++{- | standard map 2D chaotic generator++ Standard2DN [ControlRate,AudioRate] minfreq=11025 maxfreq=22050 k=1.4 x0=4.97898 y0=5.74734+-}+standard2DN :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+standard2DN rate minfreq maxfreq k x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "Standard2DN" [minfreq, maxfreq, k, x0, y0] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StandardTrig [ControlRate,AudioRate] minfreq=5 maxfreq=10 k=1.4 x0=4.97898 y0=5.74734+-}+standardTrig :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+standardTrig rate minfreq maxfreq k x0 y0 = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StandardTrig" [minfreq, maxfreq, k, x0, y0] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkBandedWG [ControlRate,AudioRate] freq=440 instr=0 bowpressure=0 bowmotion=0 integration=0 modalresonance=64 bowvelocity=0 setstriking=0 trig=1+-}+stkBandedWG :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkBandedWG rate freq instr bowpressure bowmotion integration modalresonance bowvelocity setstriking trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkBandedWG" [freq, instr, bowpressure, bowmotion, integration, modalresonance, bowvelocity, setstriking, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkBeeThree [ControlRate,AudioRate] freq=440 op4gain=10 op3gain=20 lfospeed=64 lfodepth=0 adsrtarget=64 trig=1+-}+stkBeeThree :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkBeeThree rate freq op4gain op3gain lfospeed lfodepth adsrtarget trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkBeeThree" [freq, op4gain, op3gain, lfospeed, lfodepth, adsrtarget, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkBlowHole [ControlRate,AudioRate] freq=440 reedstiffness=64 noisegain=20 tonehole=64 register=11 breathpressure=64+-}+stkBlowHole :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkBlowHole rate freq reedstiffness noisegain tonehole register breathpressure = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkBlowHole" [freq, reedstiffness, noisegain, tonehole, register, breathpressure] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkBowed [ControlRate,AudioRate] freq=220 bowpressure=64 bowposition=64 vibfreq=64 vibgain=64 loudness=64 gate=1 attackrate=1 decayrate=1+-}+stkBowed :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkBowed rate freq bowpressure bowposition vibfreq vibgain loudness_ gate_ attackrate decayrate = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkBowed" [freq, bowpressure, bowposition, vibfreq, vibgain, loudness_, gate_, attackrate, decayrate] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkClarinet [ControlRate,AudioRate] freq=440 reedstiffness=64 noisegain=4 vibfreq=64 vibgain=11 breathpressure=64 trig=1+-}+stkClarinet :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkClarinet rate freq reedstiffness noisegain vibfreq vibgain breathpressure trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkClarinet" [freq, reedstiffness, noisegain, vibfreq, vibgain, breathpressure, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkFlute [ControlRate,AudioRate] freq=440 jetDelay=49 noisegain=0.15 jetRatio=0.32+-}+stkFlute :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkFlute rate freq jetDelay noisegain jetRatio = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkFlute" [freq, jetDelay, noisegain, jetRatio] Nothing 1 (Special 0) NoId++{-+-- | Wrapping Synthesis toolkit.+--+-- StkGlobals [AudioRate] showWarnings=0 printErrors=0 rawfilepath=0+stkGlobals :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+stkGlobals rate showWarnings printErrors rawfilepath = mkUgen Nothing [AudioRate] (Left rate) "StkGlobals" [showWarnings,printErrors,rawfilepath] Nothing 1 (Special 0) NoId+-}++{- | Wrapping Synthesis toolkit.++ StkInst [AudioRate] freq=220 gate=1 onamp=1 offamp=0.5 instNumber=6 *args=0; MCE=1, REORDERS INPUTS: [4,0,1,2,3,5]+-}+stkInst :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkInst rate freq gate_ onamp offamp instNumber args = mkUgen Nothing [AudioRate] (Left rate) "StkInst" [freq, gate_, onamp, offamp, instNumber] (Just [args]) 1 (Special 0) NoId++{- | (Undocumented class)++ StkMandolin [ControlRate,AudioRate] freq=520 bodysize=64 pickposition=64 stringdamping=69 stringdetune=10 aftertouch=64 trig=1+-}+stkMandolin :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkMandolin rate freq bodysize pickposition stringdamping stringdetune aftertouch trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkMandolin" [freq, bodysize, pickposition, stringdamping, stringdetune, aftertouch, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkModalBar [ControlRate,AudioRate] freq=440 instrument=0 stickhardness=64 stickposition=64 vibratogain=20 vibratofreq=20 directstickmix=64 volume=64 trig=1+-}+stkModalBar :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkModalBar rate freq instrument stickhardness stickposition vibratogain vibratofreq directstickmix volume trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkModalBar" [freq, instrument, stickhardness, stickposition, vibratogain, vibratofreq, directstickmix, volume, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkMoog [ControlRate,AudioRate] freq=440 filterQ=10 sweeprate=20 vibfreq=64 vibgain=0 gain=64 trig=1+-}+stkMoog :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkMoog rate freq filterQ sweeprate vibfreq vibgain gain trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkMoog" [freq, filterQ, sweeprate, vibfreq, vibgain, gain, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkPluck [ControlRate,AudioRate] freq=440 decay=0.99+-}+stkPluck :: Rate -> Ugen -> Ugen -> Ugen+stkPluck rate freq decay_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkPluck" [freq, decay_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkSaxofony [ControlRate,AudioRate] freq=220 reedstiffness=64 reedaperture=64 noisegain=20 blowposition=26 vibratofrequency=20 vibratogain=20 breathpressure=128 trig=1+-}+stkSaxofony :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkSaxofony rate freq reedstiffness reedaperture noisegain blowposition vibratofrequency vibratogain breathpressure trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkSaxofony" [freq, reedstiffness, reedaperture, noisegain, blowposition, vibratofrequency, vibratogain, breathpressure, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkShakers [ControlRate,AudioRate] instr=0 energy=64 decay=64 objects=64 resfreq=64+-}+stkShakers :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkShakers rate instr energy decay_ objects resfreq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkShakers" [instr, energy, decay_, objects, resfreq] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StkVoicForm [ControlRate,AudioRate] freq=440 vuvmix=64 vowelphon=64 vibfreq=64 vibgain=20 loudness=64 trig=1+-}+stkVoicForm :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stkVoicForm rate freq vuvmix vowelphon vibfreq vibgain loudness_ trig_ = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "StkVoicForm" [freq, vuvmix, vowelphon, vibfreq, vibgain, loudness_, trig_] Nothing 1 (Special 0) NoId++{- | String resonance filter++ Streson [ControlRate,AudioRate] input=0 delayTime=0.003 res=0.9; FILTER: TRUE+-}+streson :: Ugen -> Ugen -> Ugen -> Ugen+streson input delayTime res = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Streson" [input, delayTime, res] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ StringVoice [AudioRate] trig=0 infsustain=0 freq=100 accent=0.5 structure=0.5 brightness=0.5 damping=0.5+-}+stringVoice :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+stringVoice rate trig_ infsustain freq accent structure brightness damping = mkUgen Nothing [AudioRate] (Left rate) "StringVoice" [trig_, infsustain, freq, accent, structure, brightness, damping] Nothing 1 (Special 0) NoId++{- | Pulse counter with floating point steps++ Summer [ControlRate,AudioRate] trig=0 step=1 reset=0 resetval=0; FILTER: TRUE+-}+summer :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen+summer trig_ step reset resetval = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "Summer" [trig_, step, reset, resetval] Nothing 1 (Special 0) NoId++{- | feedback delay line implementing switch-and-ramp buffer jumping++ SwitchDelay [AudioRate] in=0 drylevel=1 wetlevel=1 delaytime=1 delayfactor=0.7 maxdelaytime=20; FILTER: TRUE+-}+switchDelay :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+switchDelay in_ drylevel wetlevel delaytime delayfactor maxdelaytime = mkUgen Nothing [AudioRate] (Right [0]) "SwitchDelay" [in_, drylevel, wetlevel, delaytime, delayfactor, maxdelaytime] Nothing 1 (Special 0) NoId++{- | triggered beta random distribution++ TBetaRand [ControlRate,AudioRate] lo=0 hi=1 prob1=0 prob2=0 trig=0; FILTER: TRUE, NONDET+-}+tBetaRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tBetaRandId z lo hi prob1 prob2 trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [4]) "TBetaRand" [lo, hi, prob1, prob2, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of TBetaRand.+tBetaRandM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+tBetaRandM = liftUid5 tBetaRandId++-- | Unsafe variant of TBetaRand.+tBetaRand :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tBetaRand = liftUnsafe5 tBetaRandM++{- | triggered random walk generator++ TBrownRand [ControlRate,AudioRate] lo=0 hi=1 dev=1 dist=0 trig=0; FILTER: TRUE, NONDET+-}+tBrownRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tBrownRandId z lo hi dev dist trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [4]) "TBrownRand" [lo, hi, dev, dist, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of TBrownRand.+tBrownRandM :: Uid m => Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> m Ugen+tBrownRandM = liftUid5 tBrownRandId++-- | Unsafe variant of TBrownRand.+tBrownRand :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tBrownRand = liftUnsafe5 tBrownRandM++{- | triggered gaussian random distribution++ TGaussRand [ControlRate,AudioRate] lo=0 hi=1 trig=0; FILTER: TRUE, NONDET+-}+tGaussRandId :: ID a => a -> Ugen -> Ugen -> Ugen -> Ugen+tGaussRandId z lo hi trig_ = mkUgen Nothing [ControlRate, AudioRate] (Right [2]) "TGaussRand" [lo, hi, trig_] Nothing 1 (Special 0) (toUid z)++-- | Monad variant of TGaussRand.+tGaussRandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen+tGaussRandM = liftUid3 tGaussRandId++-- | Unsafe variant of TGaussRand.+tGaussRand :: Ugen -> Ugen -> Ugen -> Ugen+tGaussRand = liftUnsafe3 tGaussRandM++{- | buffer granulator with linear att/dec++ TGrains2 [AudioRate] trigger=0 bufnum=0 rate=1 centerPos=0 dur=0.1 pan=0 amp=0.1 att=0.5 dec=0.5 interp=4; NC INPUT: True+-}+tGrains2 :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tGrains2 numChannels rate trigger bufnum rate_ centerPos dur pan amp att dec interp = mkUgen Nothing [AudioRate] (Left rate) "TGrains2" [trigger, bufnum, rate_, centerPos, dur, pan, amp, att, dec, interp] Nothing numChannels (Special 0) NoId++{- | buffer granulator with user envelope++ TGrains3 [AudioRate] trigger=0 bufnum=0 rate=1 centerPos=0 dur=0.1 pan=0 amp=0.1 att=0.5 dec=0.5 window=1 interp=4; NC INPUT: True+-}+tGrains3 :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tGrains3 numChannels rate trigger bufnum rate_ centerPos dur pan amp att dec window interp = mkUgen Nothing [AudioRate] (Left rate) "TGrains3" [trigger, bufnum, rate_, centerPos, dur, pan, amp, att, dec, window, interp] Nothing numChannels (Special 0) NoId++{- | Tracking Phase Vocoder++ TPV [AudioRate] chain=0 windowsize=1024 hopsize=512 maxpeaks=80 currentpeaks=0 freqmult=1 tolerance=4 noisefloor=0.2+-}+tpv :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tpv chain windowsize hopsize maxpeaks currentpeaks freqmult tolerance noisefloor = mkUgen Nothing [AudioRate] (Left AudioRate) "TPV" [chain, windowsize, hopsize, maxpeaks, currentpeaks, freqmult, tolerance, noisefloor] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ TTendency [ControlRate,AudioRate] trigger=0 dist=0 parX=0 parY=1 parA=0 parB=0+-}+tTendency :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tTendency rate trigger dist parX parY parA parB = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "TTendency" [trigger, dist, parX, parY, parA, parB] Nothing 1 (Special 0) NoId++{- | pitch tracker++ Tartini [ControlRate] in=0 threshold=0.93 n=2048 k=0 overlap=1024 smallCutoff=0.5+-}+tartini :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tartini rate in_ threshold n k overlap smallCutoff = mkUgen Nothing [ControlRate] (Left rate) "Tartini" [in_, threshold, n, k, overlap, smallCutoff] Nothing 2 (Special 0) NoId++{- | Neural Oscillator++ TermanWang [AudioRate] input=0 reset=0 ratex=0.01 ratey=0.01 alpha=1 beta=1 eta=1 initx=0 inity=0+-}+termanWang :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+termanWang rate input reset ratex ratey alpha beta eta initx inity = mkUgen Nothing [AudioRate] (Left rate) "TermanWang" [input, reset, ratex, ratey, alpha, beta, eta, initx, inity] Nothing 1 (Special 0) NoId++{- | display level of a Ugen as a textual meter++ TextVU [ControlRate,AudioRate] trig=2 in=0 label=0 width=21 reset=0 ana=0+-}+textVU :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+textVU rate trig_ in_ label_ width reset ana = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "TextVU" [trig_, in_, label_, width, reset, ana] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Tilt [AudioRate] w=0 x=0 y=0 z=0 tilt=0+-}+tilt :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tilt rate w x y z tilt_ = mkUgen Nothing [AudioRate] (Left rate) "Tilt" [w, x, y, z, tilt_] Nothing 1 (Special 0) NoId++{- | triggered signal averager++ TrigAvg [ControlRate] in=0 trig=0+-}+trigAvg :: Rate -> Ugen -> Ugen -> Ugen+trigAvg rate in_ trig_ = mkUgen Nothing [ControlRate] (Left rate) "TrigAvg" [in_, trig_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Tumble [AudioRate] w=0 x=0 y=0 z=0 tilt=0+-}+tumble :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+tumble rate w x y z tilt_ = mkUgen Nothing [AudioRate] (Left rate) "Tumble" [w, x, y, z, tilt_] Nothing 1 (Special 0) NoId++{- | physical modeling simulation; two tubes++ TwoTube [AudioRate] input=0 k=0.01 loss=1 d1length=100 d2length=100+-}+twoTube :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+twoTube rate input k loss d1length d2length = mkUgen Nothing [AudioRate] (Left rate) "TwoTube" [input, k, loss, d1length, d2length] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ UHJ2B [AudioRate] ls=0 rs=0+-}+uhj2b :: Rate -> Ugen -> Ugen -> Ugen+uhj2b rate ls rs = mkUgen Nothing [AudioRate] (Left rate) "UHJ2B" [ls, rs] Nothing 3 (Special 0) NoId++{- | Vector Base Amplitude Panner++ VBAP [ControlRate,AudioRate] in=0 bufnum=0 azimuth=0 elevation=1 spread=0; NC INPUT: True+-}+vbap :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vbap numChannels rate in_ bufnum azimuth elevation spread = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "VBAP" [in_, bufnum, azimuth, elevation, spread] Nothing numChannels (Special 0) NoId++{- | a Chebyshev low/highpass filter++ VBChebyFilt [AudioRate] in=0 freq=880 mode=0 order=4+-}+vbChebyFilt :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vbChebyFilt rate in_ freq mode order = mkUgen Nothing [AudioRate] (Left rate) "VBChebyFilt" [in_, freq, mode, order] Nothing 1 (Special 0) NoId++{- | a chaotic oscillator network++ VBFourses [AudioRate] smoother=0.5 *freqarray=0; MCE=1, REORDERS INPUTS: [1,0]+-}+vbFourses :: Rate -> Ugen -> Ugen -> Ugen+vbFourses rate smoother freqarray = mkUgen Nothing [AudioRate] (Left rate) "VBFourses" [smoother] (Just [freqarray]) 4 (Special 0) NoId++{- | artifical reverberator++ VBJonVerb [AudioRate] in=0 decay=0.6 damping=0.3 inputbw=0.8 erfl=0.5 tail=0.5; FILTER: TRUE+-}+vbJonVerb :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vbJonVerb in_ decay_ damping inputbw erfl tail_ = mkUgen Nothing [AudioRate] (Right [0]) "VBJonVerb" [in_, decay_, damping, inputbw, erfl, tail_] Nothing 2 (Special 0) NoId++{- | a simple phase vocoder for time-stretching++ VBPVoc [AudioRate] numChannels=0 bufnum=0 playpos=0 fftsize=2048+-}+vbpVoc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vbpVoc rate numChannels bufnum playpos fftsize = mkUgen Nothing [AudioRate] (Left rate) "VBPVoc" [numChannels, bufnum, playpos, fftsize] Nothing 1 (Special 0) NoId++{- | lowpass filter for envelope following++ VBSlide [KR,AR] in=0.0 slideup=50.0 slidedown=3000.0; FILTER: TRUE+-}+vbSlide :: Ugen -> Ugen -> Ugen -> Ugen+vbSlide in_ slideup slidedown = mkUgen Nothing [ControlRate, AudioRate] (Right [0]) "VBSlide" [in_, slideup, slidedown] Nothing 1 (Special 0) NoId++{- | 2D scanning pattern virtual machine++ VMScan2D [AudioRate] bufnum=0+-}+vmScan2D :: Rate -> Ugen -> Ugen+vmScan2D rate bufnum = mkUgen Nothing [AudioRate] (Left rate) "VMScan2D" [bufnum] Nothing 2 (Special 0) NoId++{- | vosim pulse generator++ VOSIM [AudioRate] trig=0.1 freq=400 nCycles=1 decay=0.9+-}+vosim :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vosim rate trig_ freq nCycles decay_ = mkUgen Nothing [AudioRate] (Left rate) "VOSIM" [trig_, freq, nCycles, decay_] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ VarShapeOsc [ControlRate,AudioRate] freq=100 pw=0.5 waveshape=0.5 sync=1 syncfreq=105+-}+varShapeOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+varShapeOsc rate freq pw waveshape sync syncfreq = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "VarShapeOsc" [freq, pw, waveshape, sync, syncfreq] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ VosimOsc [ControlRate,AudioRate] freq=100 form1freq=951 form2freq=919 shape=0+-}+vosimOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+vosimOsc rate freq form1freq form2freq shape = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "VosimOsc" [freq, form1freq, form2freq, shape] Nothing 1 (Special 0) NoId++{- | windowed amplitude follower++ WAmp [ControlRate] in=0 winSize=0.1+-}+wAmp :: Rate -> Ugen -> Ugen -> Ugen+wAmp rate in_ winSize = mkUgen Nothing [ControlRate] (Left rate) "WAmp" [in_, winSize] Nothing 1 (Special 0) NoId++{- | decomposition into square waves, and reconstruction++ WalshHadamard [AudioRate] input=0 which=0+-}+walshHadamard :: Rate -> Ugen -> Ugen -> Ugen+walshHadamard rate input which = mkUgen Nothing [AudioRate] (Left rate) "WalshHadamard" [input, which] Nothing 1 (Special 0) NoId++{- | Warp a buffer with a time pointer++ WarpZ [AudioRate] bufnum=0 pointer=0 freqScale=1 windowSize=0.2 envbufnum=-1 overlaps=8 windowRandRatio=0 interp=1 zeroSearch=0 zeroStart=0; NC INPUT: True+-}+warpZ :: Int -> Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+warpZ numChannels rate bufnum pointer freqScale windowSize envbufnum overlaps windowRandRatio interp zeroSearch zeroStart = mkUgen Nothing [AudioRate] (Left rate) "WarpZ" [bufnum, pointer, freqScale, windowSize, envbufnum, overlaps, windowRandRatio, interp, zeroSearch, zeroStart] Nothing numChannels (Special 0) NoId++{- | Lose bits of your waves++ WaveLoss [ControlRate,AudioRate] in=0 drop=20 outof=40 mode=1+-}+waveLoss :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+waveLoss rate in_ drop_ outof mode = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "WaveLoss" [in_, drop_, outof, mode] Nothing 1 (Special 0) NoId++{- | wave terrain synthesis++ WaveTerrain [AudioRate] bufnum=0 x=0 y=0 xsize=100 ysize=100+-}+waveTerrain :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+waveTerrain rate bufnum x y xsize ysize = mkUgen Nothing [AudioRate] (Left rate) "WaveTerrain" [bufnum, x, y, xsize, ysize] Nothing 1 (Special 0) NoId++{- | decomposition into Daub4 wavelets, and reconstruction++ WaveletDaub [AudioRate] input=0 n=64 which=0+-}+waveletDaub :: Rate -> Ugen -> Ugen -> Ugen -> Ugen+waveletDaub rate input n which = mkUgen Nothing [AudioRate] (Left rate) "WaveletDaub" [input, n, which] Nothing 1 (Special 0) NoId++{- | Weakly Nonlinear Oscillator++ WeaklyNonlinear [AudioRate] input=0 reset=0 ratex=1 ratey=1 freq=440 initx=0 inity=0 alpha=0 xexponent=0 beta=0 yexponent=0+-}+weaklyNonlinear :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+weaklyNonlinear rate input reset ratex ratey freq initx inity alpha xexponent beta yexponent = mkUgen Nothing [AudioRate] (Left rate) "WeaklyNonlinear" [input, reset, ratex, ratey, freq, initx, inity, alpha, xexponent, beta, yexponent] Nothing 1 (Special 0) NoId++{- | Weakly Nonlinear Oscillator++ WeaklyNonlinear2 [AudioRate] input=0 reset=0 ratex=1 ratey=1 freq=440 initx=0 inity=0 alpha=0 xexponent=0 beta=0 yexponent=0+-}+weaklyNonlinear2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+weaklyNonlinear2 rate input reset ratex ratey freq initx inity alpha xexponent beta yexponent = mkUgen Nothing [AudioRate] (Left rate) "WeaklyNonlinear2" [input, reset, ratex, ratey, freq, initx, inity, alpha, xexponent, beta, yexponent] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ Werner [AudioRate] input=0 freq=0.5 damp=0.5 feedback=0.5 drive=0 oversample=1+-}+werner :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+werner rate input freq damp feedback drive oversample = mkUgen Nothing [AudioRate] (Left rate) "Werner" [input, freq, damp, feedback, drive, oversample] Nothing 1 (Special 0) NoId++{- | Pulse counter with floating point steps++ WrapSummer [ControlRate,AudioRate] trig=0 step=1 min=0 max=1 reset=0 resetval=0+-}+wrapSummer :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+wrapSummer rate trig_ step min_ max_ reset resetval = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "WrapSummer" [trig_, step, min_, max_, reset, resetval] Nothing 1 (Special 0) NoId++{- | (Undocumented class)++ ZOsc [ControlRate,AudioRate] freq=100 formantfreq=91 shape=0.5 mode=0.5+-}+zOsc :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen+zOsc rate freq formantfreq shape mode = mkUgen Nothing [ControlRate, AudioRate] (Left rate) "ZOsc" [freq, formantfreq, shape, mode] Nothing 1 (Special 0) NoId
Sound/Sc3/Ugen/Bindings/Hw.hs view
@@ -9,19 +9,20 @@ import Sound.Sc3.Ugen.Types import qualified Sound.Sc3.Ugen.Util as Util --- | Zero local buffer.------ ClearBuf does not copy the buffer number through so this is an Mrg node.+{- | Zero local buffer.++ClearBuf does not copy the buffer number through so this is an Mrg node.+-} clearBuf :: Ugen -> Ugen clearBuf b = Util.mrg2 b (C.mkOsc ir "ClearBuf" [b] 1) -- | Demand rate weighted random sequence generator. dwrandId :: ID i => i -> Ugen -> Ugen -> Ugen -> Ugen dwrandId z repeats weights list_ =- let n = mceDegree_err list_- weights' = mceExtend n weights- inp = repeats : constant n : weights'- in mkUgen Nothing [dr] (Left dr) "Dwrand" inp (Just [list_]) 1 (Special 0) (Util.toUid z)+ let n = mceDegree_err list_+ weights' = mceExtend n weights+ inp = repeats : constant n : weights'+ in mkUgen Nothing [dr] (Left dr) "Dwrand" inp (Just [list_]) 1 (Special 0) (Util.toUid z) dwrandM :: Uid m => Ugen -> Ugen -> Ugen -> m Ugen dwrandM = liftUid3 dwrandId@@ -31,45 +32,46 @@ -- | Variant on 'envGen' without enumeration types. envGen_ll :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-envGen_ll rate gate_ levelScale levelBias timeScale doneAction envelope_ = mkUgen Nothing [kr,ar] (Left rate) "EnvGen" [gate_,levelScale,levelBias,timeScale,doneAction] (Just [envelope_]) 1 (Special 0) NoId+envGen_ll rate gate_ levelScale levelBias timeScale doneAction envelope_ = mkUgen Nothing [kr, ar] (Left rate) "EnvGen" [gate_, levelScale, levelBias, timeScale, doneAction] (Just [envelope_]) 1 (Special 0) NoId -- | Outputs signal for @FFT@ chains, without performing FFT. fftTrigger :: Ugen -> Ugen -> Ugen -> Ugen-fftTrigger b h p = C.mkOsc kr "FFTTrigger" [b,h,p] 1+fftTrigger b h p = C.mkOsc kr "FFTTrigger" [b, h, p] 1 -- | Pack demand-rate FFT bin streams into an FFT chain. packFFT :: Ugen -> Int -> Int -> Int -> Ugen -> Ugen -> Ugen packFFT b sz from to z mp =- let n = constant (mceDegree_err mp)- in C.mkOscMCE kr "PackFFT" [b, constant sz, constant from, constant to, z, n] mp 1+ let n = constant (mceDegree_err mp)+ in C.mkOscMCE kr "PackFFT" [b, constant sz, constant from, constant to, z, n] mp 1 -- | Poll value of input Ugen when triggered. poll :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen poll trig_ in_ trigid label_ = let q = Util.unpackLabel True label_- in C.mkFilter "Poll" ([trig_,in_,trigid] ++ q) 0+ in C.mkFilter "Poll" ([trig_, in_, trigid] ++ q) 0 -- | FFT onset detector. pv_HainsworthFoote :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_HainsworthFoote buf h f thr wt = C.mkOsc ar "PV_HainsworthFoote" [buf,h,f,thr,wt] 1+pv_HainsworthFoote buf h f thr wt = C.mkOsc ar "PV_HainsworthFoote" [buf, h, f, thr, wt] 1 --- | FFT feature detector for onset detection.------ buffer, propsc=0.25, prophfe=0.25, prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04+{- | FFT feature detector for onset detection.++buffer, propsc=0.25, prophfe=0.25, prophfc=0.25, propsf=0.25, threshold=1.0, waittime=0.04+-} pv_JensenAndersen :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-pv_JensenAndersen buffer propsc prophfe prophfc propsf threshold waittime = C.mkOsc ar "PV_JensenAndersen" [buffer,propsc,prophfe,prophfc,propsf,threshold,waittime] 1+pv_JensenAndersen buffer propsc prophfe prophfc propsf threshold waittime = C.mkOsc ar "PV_JensenAndersen" [buffer, propsc, prophfe, prophfc, propsf, threshold, waittime] 1 --- | Ascii string to length prefixed list of constant Ugens.------ > string_to_ugens "/label" == map fromIntegral [6,47,108,97,98,101,108]+{- | Ascii string to length prefixed list of constant Ugens.++> string_to_ugens "/label" == map fromIntegral [6,47,108,97,98,101,108]+-} string_to_ugens :: String -> [Ugen] string_to_ugens nm = fromIntegral (length nm) : map (fromIntegral . fromEnum) nm -- | Send a reply message from the server back to all registered clients. sendReply :: Ugen -> Ugen -> String -> [Ugen] -> Ugen-sendReply i k n v = C.mkFilter "SendReply" ([i,k] ++ string_to_ugens n ++ v) 0+sendReply i k n v = C.mkFilter "SendReply" ([i, k] ++ string_to_ugens n ++ v) 0 -- | Unpack a single value (magnitude or phase) from an FFT chain unpack1FFT :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen unpack1FFT buf size index_ which = C.mkOsc dr "Unpack1FFT" [buf, size, index_, which] 1-
Sound/Sc3/Ugen/Bindings/Hw/Construct.hs view
@@ -8,7 +8,7 @@ -- | Oscillator constructor with constrained set of operating 'Rate's. mk_osc :: [Rate] -> UgenId -> Rate -> String -> [Ugen] -> Int -> Ugen mk_osc rs z r c i o =- if r `elem` rs+ if r `elem` rs then mkUgen Nothing rs (Left r) c i Nothing o (Special 0) z else error ("mk_osc: rate restricted: " ++ show (r, rs, c)) @@ -31,8 +31,8 @@ -- | Provided 'UgenId' variant of 'mkOscMCE'. mk_osc_mce :: UgenId -> Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen mk_osc_mce z r c i j =- let i' = i ++ mceChannels j- in mk_osc all_rates z r c i'+ let i' = i ++ mceChannels j+ in mk_osc all_rates z r c i' -- | Variant oscillator constructor with MCE collapsing input. mkOscMCE :: Rate -> String -> [Ugen] -> Ugen -> Int -> Ugen
Sound/Sc3/Ugen/Bindings/Hw/External/F0.hs view
@@ -7,19 +7,19 @@ -- | Emulation of the sound generation hardware of the Atari TIA chip. atari2600 :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-atari2600 audc0 audc1 audf0 audf1 audv0 audv1 rate = C.mkOsc ar "Atari2600" [audc0,audc1,audf0,audf1,audv0,audv1,rate] 1+atari2600 audc0 audc1 audf0 audf1 audv0 audv1 rate = C.mkOsc ar "Atari2600" [audc0, audc1, audf0, audf1, audv0, audv1, rate] 1 -- | POKEY Chip Sound Simulator mzPokey :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-mzPokey f1 c1 f2 c2 f3 c3 f4 c4 ctl = C.mkOsc ar "MZPokey" [f1,c1,f2,c2,f3,c3,f4,c4,ctl] 1+mzPokey f1 c1 f2 c2 f3 c3 f4 c4 ctl = C.mkOsc ar "MZPokey" [f1, c1, f2, c2, f3, c3, f4, c4, ctl] 1 -- | A phasor that can loop. redPhasor :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-redPhasor rate trig rate_ start end loop loopstart loopend = C.mkOsc rate "RedPhasor" [trig,rate_,start,end,loop,loopstart,loopend] 1+redPhasor rate trig rate_ start end loop loopstart loopend = C.mkOsc rate "RedPhasor" [trig, rate_, start, end, loop, loopstart, loopend] 1 -- | A phasor that can loop. redPhasor2 :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-redPhasor2 rate trig rate_ start end loop loopstart loopend = C.mkOsc rate "RedPhasor2" [trig,rate_,start,end,loop,loopstart,loopend] 1+redPhasor2 rate trig rate_ start end loop loopstart loopend = C.mkOsc rate "RedPhasor2" [trig, rate_, start, end, loop, loopstart, loopend] 1 -- Local Variables: -- truncate-lines:t
Sound/Sc3/Ugen/Bindings/Hw/External/Sc3_Plugins.hs view
@@ -3,41 +3,67 @@ import Sound.Sc3.Common.Rate +import qualified Sound.Sc3.Ugen.Bindings.Db.External as X import qualified Sound.Sc3.Ugen.Bindings.Hw.Construct as C import Sound.Sc3.Ugen.Types import qualified Sound.Sc3.Ugen.Util as Util-import qualified Sound.Sc3.Ugen.Bindings.Db.External as X --- | Convert frequency value to value appropriate for AY tone inputs.+-- | Convert frequency value to value appropriate for Ay tone inputs. ayFreqToTone :: Fractional a => a -> a ayFreqToTone f = 110300 / (f - 0.5) --- | LADSPA plugins inside SuperCollider.+-- | Ladspa plugins inside SuperCollider. ladspa :: Int -> Rate -> Ugen -> [Ugen] -> Ugen ladspa nc rt k z = C.mkOsc rt "LADSPA" (constant nc : k : z) nc --- | Lookup index of STK instrument by name.-stkAt :: (Num t,Enum t) => String -> t+-- | Lookup index of Stk instrument by name.+stkAt :: (Num t, Enum t) => String -> t stkAt nm =- let nm_seq = ["Clarinet", "BlowHole", "Saxofony", "Flute", "Brass"- ,"BlowBotl", "Bowed", "Plucked", "StifKarp", "Sitar", "Mandolin"- ,"Rhodey", "Wurley", "TubeBell", "HevyMetl", "PercFlut"- ,"BeeThree", "FMVoices", "VoicForm", "Moog", "Simple", "Drummer"- ,"BandedWG", "Shakers", "ModalBar", "Mesh2D", "Resonate", "Whistle"]- tbl = zip nm_seq [0..]+ let nm_seq =+ [ "Clarinet"+ , "BlowHole"+ , "Saxofony"+ , "Flute"+ , "Brass"+ , "BlowBotl"+ , "Bowed"+ , "Plucked"+ , "StifKarp"+ , "Sitar"+ , "Mandolin"+ , "Rhodey"+ , "Wurley"+ , "TubeBell"+ , "HevyMetl"+ , "PercFlut"+ , "BeeThree"+ , "FMVoices"+ , "VoicForm"+ , "Moog"+ , "Simple"+ , "Drummer"+ , "BandedWG"+ , "Shakers"+ , "ModalBar"+ , "Mesh2D"+ , "Resonate"+ , "Whistle"+ ]+ tbl = zip nm_seq [0 ..] in case lookup nm tbl of- Just ix -> ix- Nothing -> error "stkAt: unknown instr"+ Just ix -> ix+ Nothing -> error "stkAt: unknown instr" -- | freq=220, gate=1, onamp=1, offamp=1, bowpressure=64, bowposition=64, vibfreq=64, vibgain=64, loudness=64 stkBowedI :: Rate -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen stkBowedI rt freq gate_ onamp offamp bowpressure bowposition vibfreq vibgain loudness =- let args = mce [2,bowpressure,4,bowposition,11,vibfreq,1,vibgain,128,loudness]+ let args = mce [2, bowpressure, 4, bowposition, 11, vibfreq, 1, vibgain, 128, loudness] in X.stkInst rt (stkAt "Bowed") freq gate_ onamp offamp args --- | Wrapping Synthesis toolkit.------ StkGlobals [ar] showWarnings=0.0 printErrors=0.0 rawfilepath=0.0+{- | Wrapping Synthesis toolkit.++ StkGlobals [ar] showWarnings=0.0 printErrors=0.0 rawfilepath=0.0+-} stkGlobals :: Rate -> Ugen -> Ugen -> Ugen -> Ugen stkGlobals rate showWarnings printErrors rawfilepath =- mkUgen Nothing [ar] (Left rate) "StkGlobals" ([showWarnings,printErrors] ++ Util.unpackLabel False rawfilepath) Nothing 1 (Special 0) NoId+ mkUgen Nothing [ar] (Left rate) "StkGlobals" ([showWarnings, printErrors] ++ Util.unpackLabel False rawfilepath) Nothing 1 (Special 0) NoId
Sound/Sc3/Ugen/Bindings/Hw/External/Wavelets.hs view
@@ -7,25 +7,24 @@ -- | Forward wavelet transform. dwt :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-dwt buf i h wnt a wns wlt = mkOsc kr "DWT" [buf,i,h,wnt,a,wns,wlt] 1+dwt buf i h wnt a wns wlt = mkOsc kr "DWT" [buf, i, h, wnt, a, wns, wlt] 1 -- | Inverse of 'dwt'. idwt :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen-idwt buf wnt wns wlt = mkOsc ar "IDWT" [buf,wnt,wns,wlt] 1+idwt buf wnt wns wlt = mkOsc ar "IDWT" [buf, wnt, wns, wlt] 1 -- | Pass wavelets above a threshold, ie. 'pv_MagAbove'. wt_MagAbove :: Ugen -> Ugen -> Ugen-wt_MagAbove buf thr = mkOsc kr "WT_MagAbove" [buf,thr] 1+wt_MagAbove buf thr = mkOsc kr "WT_MagAbove" [buf, thr] 1 -- | Pass wavelets with /scale/ above threshold. wt_FilterScale :: Ugen -> Ugen -> Ugen-wt_FilterScale buf wp = mkOsc kr "WT_FilterScale" [buf,wp] 1+wt_FilterScale buf wp = mkOsc kr "WT_FilterScale" [buf, wp] 1 -- | Pass wavelets with /time/ above threshold. wt_TimeWipe :: Ugen -> Ugen -> Ugen-wt_TimeWipe buf wp = mkOsc kr "WT_TimeWipe" [buf,wp] 1+wt_TimeWipe buf wp = mkOsc kr "WT_TimeWipe" [buf, wp] 1 -- | Product in /W/ domain, ie. 'pv_Mul'. wt_Mul :: Ugen -> Ugen -> Ugen-wt_Mul ba bb = mkOsc kr "WT_Mul" [ba,bb] 1-+wt_Mul ba bb = mkOsc kr "WT_Mul" [ba, bb] 1
Sound/Sc3/Ugen/Bindings/Hw/External/Zita.hs view
@@ -1,6 +1,7 @@--- | Zita Ugen definitions.------ See hsc3/ext/faust to build the SC3 plugin.+{- | Zita Ugen definitions.++See hsc3/ext/faust to build the SC3 plugin.+-} module Sound.Sc3.Ugen.Bindings.Hw.External.Zita where import Sound.Sc3.Common.Rate@@ -8,21 +9,21 @@ import Sound.Sc3.Ugen.Ugen -- | Parameter (name,value) pairs.-zitaRev_param :: Num n => [(String,n,(n,n,String))]+zitaRev_param :: Num n => [(String, n, (n, n, String))] zitaRev_param =- [("in_delay",60,(20,100,"lin")) -- ms- ,("lf_x",200,(50,1000,"exp"))- ,("low_rt60",3,(1,8,"exp"))- ,("mid_rt60",2,(1,8,"exp"))- ,("hf_damping",6000,(1500,24000,"exp"))- ,("eq1_freq",315,(40,2500,"exp"))- ,("eq1_level",0,(-15,15,"lin"))- ,("eq2_freq",1500,(160,10000,"exp"))- ,("eq2_level",0,(-15,15,"lin"))- ,("dry_wet_mix",0,(0,1,"lin"))- ,("level",-20,(-9,9,"lin"))+ [ ("in_delay", 60, (20, 100, "lin")) -- ms+ , ("lf_x", 200, (50, 1000, "exp"))+ , ("low_rt60", 3, (1, 8, "exp"))+ , ("mid_rt60", 2, (1, 8, "exp"))+ , ("hf_damping", 6000, (1500, 24000, "exp"))+ , ("eq1_freq", 315, (40, 2500, "exp"))+ , ("eq1_level", 0, (-15, 15, "lin"))+ , ("eq2_freq", 1500, (160, 10000, "exp"))+ , ("eq2_level", 0, (-15, 15, "lin"))+ , ("dry_wet_mix", 0, (0, 1, "lin"))+ , ("level", -20, (-9, 9, "lin")) ] -- | ZitaRev binding. zitaRev :: Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen -> Ugen-zitaRev in1 in2 in_delay lf_x low_rt60 mid_rt60 hf_damping eq1_freq eq1_level eq2_freq eq2_level dry_wet_mix level = mkFilterR [ar] "FaustZitaRev" [in1,in2,in_delay,lf_x,low_rt60,mid_rt60,hf_damping,eq1_freq,eq1_level,eq2_freq,eq2_level,dry_wet_mix,level] 2+zitaRev in1 in2 in_delay lf_x low_rt60 mid_rt60 hf_damping eq1_freq eq1_level eq2_freq eq2_level dry_wet_mix level = mkFilterR [ar] "FaustZitaRev" [in1, in2, in_delay, lf_x, low_rt60, mid_rt60, hf_damping, eq1_freq, eq1_level, eq2_freq, eq2_level, dry_wet_mix, level] 2
Sound/Sc3/Ugen/Bracketed.hs view
@@ -34,10 +34,11 @@ readChanToNc :: Int -> [Int] -> Int readChanToNc sfNc readChan = if null readChan- then sfNc- else if maximum readChan < sfNc- then length readChan- else error "readChanToNc: channel error"+ then sfNc+ else+ if maximum readChan < sfNc+ then length readChan+ else error "readChanToNc: channel error" {- | diskIn or vDiskIn with brackets to 1. allocate and read and then 2. close and free buffer. If ctlName is empty the buffer is returned as a constant, else as a control with the given name.@@ -48,14 +49,15 @@ sndfileDiskIn :: (String, Buffer_Id, [Int]) -> FilePath -> Maybe Ugen -> Loop Ugen -> Ugen sndfileDiskIn (ctlName, bufId, readChan) sndFileName maybeRate loop = let fileName = sfResolve sndFileName- (sfNc,_sr,_nf) = sfInfo fileName+ (sfNc, _sr, _nf) = sfInfo fileName bufSize = 65536 buf = if null ctlName then constant bufId else control kr ctlName (fromIntegral bufId) bufNc = readChanToNc sfNc readChan in bracketUgen- (maybe (diskIn bufNc buf loop) (\rate -> vDiskIn bufNc buf rate loop 0) maybeRate)- ([b_alloc bufId bufSize bufNc, b_readChannel bufId fileName 0 (-1) 0 True readChan]- ,[b_close bufId, b_free bufId])+ (maybe (diskIn bufNc buf loop) (\rate -> vDiskIn bufNc buf rate loop 0) maybeRate)+ ( [b_alloc bufId bufSize bufNc, b_readChannel bufId fileName 0 (-1) 0 True readChan]+ , [b_close bufId, b_free bufId]+ ) -- | diskIn form of sndfileDiskIn sndfileIn :: (String, Buffer_Id, [Int]) -> FilePath -> Loop Ugen -> Ugen
Sound/Sc3/Ugen/Brackets.hs view
@@ -16,8 +16,9 @@ {- | Combine a sequence of Brackets into one Bracket. -> f = bimap concat concat . unzip-> f [(['a'],['A']),(['b'],['B'])]+>>> f = Data.Bifunctor.bimap concat concat . unzip+>>> f [(['a'],['A']),(['b'],['B'])]+("ab","AB") -} concatBrackets :: [Brackets] -> Brackets concatBrackets = bimap concat concat . unzip
Sound/Sc3/Ugen/Constant.hs view
@@ -7,12 +7,26 @@ Constants may have brackets. This allows for buffer allocation and deallocation to be associated with a buffer identifier. -> Constant 3 == Constant 3-> (Constant 3 > Constant 1) == True+>>> Constant 3 emptyBrackets == Constant 3 emptyBrackets+True++>>> Constant 3 emptyBrackets > Constant 1 emptyBrackets+True -}-data Constant =- Constant- {constantValue :: Double- ,constantBrackets :: Brackets}+data Constant = Constant+ { constantValue :: Double+ , constantBrackets :: Brackets+ } deriving (Ord, Eq, Read, Show) +-- | Get fractional part of a double.+fractionPart :: Double -> Double+fractionPart = snd . (properFraction :: Double -> (Integer, Double))++{- | Is integer?++>>> constantIsInteger (Constant 1 emptyBrackets)+True+-}+constantIsInteger :: Constant -> Bool+constantIsInteger (Constant n _) = fractionPart n == 0
Sound/Sc3/Ugen/Control.hs view
@@ -36,21 +36,27 @@ control_group_suffixes :: Control_Group -> [String] control_group_suffixes grp = case grp of- Control_Range -> ["[","]"]+ Control_Range -> ["[", "]"] Control_Array n -> map (printf "%02d") [0 .. n - 1]- Control_Xy -> ["X","Y"]+ Control_Xy -> ["X", "Y"] -- * Control Meta -- | Control meta-data.-data Control_Meta n =- Control_Meta- {ctl_min :: n -- ^ Minimum- ,ctl_max :: n -- ^ Maximum- ,ctl_warp :: String -- ^ @(0,1)@ @(min,max)@ transfer function.- ,ctl_step :: n -- ^ The step to increment & decrement by.- ,ctl_units :: String -- ^ Unit of measure (ie hz, ms etc.).- ,controlGroup :: Maybe Control_Group} -- ^ Control group.+data Control_Meta n = Control_Meta+ { ctl_min :: n+ -- ^ Minimum+ , ctl_max :: n+ -- ^ Maximum+ , ctl_warp :: String+ -- ^ @(0,1)@ @(min,max)@ transfer function.+ , ctl_step :: n+ -- ^ The step to increment & decrement by.+ , ctl_units :: String+ -- ^ Unit of measure (ie hz, ms etc.).+ , controlGroup :: Maybe Control_Group+ -- ^ Control group.+ } deriving (Ord, Eq, Read, Show) -- * Control Meta (T)@@ -60,29 +66,29 @@ -- | Lift 'Control_Meta_T3' to 'Control_Meta' allowing type coercion. control_meta_t3 :: Num m => (n -> m) -> Control_Meta_T3 n -> Control_Meta m-control_meta_t3 f (l,r,w) = Control_Meta (f l) (f r) w 0 "" Nothing+control_meta_t3 f (l, r, w) = Control_Meta (f l) (f r) w 0 "" Nothing -- | 5-tuple form of 'Control_Meta' data.-type Control_Meta_T5 n = (n,n,String,n,String)+type Control_Meta_T5 n = (n, n, String, n, String) -- | Lift 'Control_Meta_T5' to 'Control_Meta' allowing type coercion. control_meta_t5 :: (n -> m) -> Control_Meta_T5 n -> Control_Meta m-control_meta_t5 f (l,r,w,stp,u) = Control_Meta (f l) (f r) w (f stp) u Nothing+control_meta_t5 f (l, r, w, stp, u) = Control_Meta (f l) (f r) w (f stp) u Nothing -- * Control {- | Control inputs. It is an unchecked invariant that controls with equal names within a Ugen graph must be equal in all other respects. -}-data Control =- Control- {controlOperatingRate :: Rate- ,controlIndex :: Maybe Int- ,controlName :: String- ,controlDefault :: Double- ,controlTriggered :: Bool- ,controlMeta :: Maybe (Control_Meta Double)- ,controlBrackets :: Brackets}+data Control = Control+ { controlOperatingRate :: Rate+ , controlIndex :: Maybe Int+ , controlName :: String+ , controlDefault :: Double+ , controlTriggered :: Bool+ , controlMeta :: Maybe (Control_Meta Double)+ , controlBrackets :: Brackets+ } deriving (Ord, Eq, Read, Show) {-
Sound/Sc3/Ugen/Enum.hs view
@@ -1,9 +1,8 @@ -- | Data types for enumerated and non signal unit generator inputs. module Sound.Sc3.Ugen.Enum where -import Sound.Sc3.Common.Envelope {- hsc3 -} import Sound.Sc3.Common.Enum {- hsc3 -}-+import Sound.Sc3.Common.Envelope {- hsc3 -} import Sound.Sc3.Ugen.Ugen {- hsc3 -} -- | Type specialised envelope curve.@@ -12,6 +11,6 @@ -- | Lift to Ugen. from_buffer :: Buffer Ugen -> Ugen from_buffer b =- case b of- Buffer_Id i -> constant i- Buffer u -> u+ case b of+ Buffer_Id i -> constant i+ Buffer u -> u
Sound/Sc3/Ugen/Envelope.hs view
@@ -14,10 +14,9 @@ > import Sound.Sc3.Plot > plotEnvelope [envTrapezoid 0.99 0.5 1 1,envTrapezoid 0.5 0.75 0.65 0.35]- -} envTrapezoid :: OrdE t => t -> t -> t -> t -> Envelope t-envTrapezoid = envTrapezoid_f (less_than_or_equal_to,greater_than_or_equal_to)+envTrapezoid = envTrapezoid_f (less_than_or_equal_to, greater_than_or_equal_to) -- | 'latch' 1 of 'impulse' 0. first_zero_then_one :: Rate -> Ugen@@ -30,18 +29,19 @@ -- | Singleton fade envelope. envGate :: Ugen -> Ugen -> Ugen -> DoneAction Ugen -> Envelope_Curve Ugen -> Ugen envGate level gate_ fadeTime doneAction curve =- let startVal = fadeTime `less_than_or_equal_to` 0- e = Envelope [startVal,1,0] [1,1] [curve] (Just 1) Nothing 0- in envGen ControlRate gate_ level 0 fadeTime doneAction e+ let startVal = fadeTime `less_than_or_equal_to` 0+ e = Envelope [startVal, 1, 0] [1, 1] [curve] (Just 1) Nothing 0+ in envGen ControlRate gate_ level 0 fadeTime doneAction e --- | Variant with default values for all inputs. @gate@ and--- @fadeTime@ are 'control's, @doneAction@ is 'RemoveSynth', @curve@--- is 'EnvSin'.+{- | Variant with default values for all inputs. @gate@ and+@fadeTime@ are 'control's, @doneAction@ is 'RemoveSynth', @curve@+is 'EnvSin'.+-} envGate_def :: Ugen envGate_def =- let level = 1- gate_ = control_m ControlRate "gate" 1 (0,1,"gate")- fadeTime = control_m ControlRate "fadeTime" 0.02 (0,10,"lin")- doneAction = RemoveSynth- curve = EnvSin- in envGate level gate_ fadeTime doneAction curve+ let level = 1+ gate_ = control_m ControlRate "gate" 1 (0, 1, "gate")+ fadeTime = control_m ControlRate "fadeTime" 0.02 (0, 10, "lin")+ doneAction = RemoveSynth+ curve = EnvSin+ in envGate level gate_ fadeTime doneAction curve
Sound/Sc3/Ugen/Event.hs view
@@ -7,8 +7,8 @@ import Sound.Sc3.Common.Math {- hsc3 -} import Sound.Sc3.Common.Rate {- hsc3 -}-import Sound.Sc3.Ugen.Bindings.Db {- hsc3 -} import Sound.Sc3.Ugen.Bindings.Composite {- hsc3 -}+import Sound.Sc3.Ugen.Bindings.Db {- hsc3 -} import Sound.Sc3.Ugen.Types {- hsc3 -} import Sound.Sc3.Ugen.Util {- hsc3 -} @@ -40,12 +40,12 @@ ccEventMetaDefault = (13000, 10, 0) ccEventMetaControls :: CcEventMeta Int -> CcEventMeta Ugen-ccEventMetaControls (p,q,r) =+ccEventMetaControls (p, q, r) = let k nm i = control kr nm (fromIntegral i) in (k "ccEventAddr" p, k "ccEventIncr" q, k "ccEventZero" r) -- | c = event number (zero indexed)-ccEventAddr :: (Ugen,Ugen,Ugen) -> Int -> CcEvent Ugen+ccEventAddr :: (Ugen, Ugen, Ugen) -> Int -> CcEvent Ugen ccEventAddr (k0, stp, c0) c = let u = in' 10 kr (k0 + ((c0 + fromIntegral c) * stp)) in cc_event_from_list c (mceChannels u)@@ -66,68 +66,77 @@ ccEventVoicerParam :: Int -> (CcEvent Ugen -> Ugen) -> Ugen ccEventVoicerParam = ccEventVoicerAddr (ccEventMetaControls ccEventMetaDefault) -{- | Given /g/ and /p/ fields of an 'CcEvent' derive a 'gateReset' from g-and a trigger derived from monitoring /g/ and /p/ for changed values.+{- | Given /w|g/ and /p/ fields of an 'CcEvent' derive a 'gateReset' from g+and a trigger derived from monitoring /w|g/ and /p/ for changed values. -} ccEventGateReset :: Ugen -> Ugen -> (Ugen, Ugen)-ccEventGateReset g p = let tr = changed p 0.01 + changed g 0.01 in (gateReset g tr,tr)+ccEventGateReset g p =+ let tr = changed p 0.01 + changed g 0.01+ in (gateReset g tr, tr) -- * Ctl -- | Sequence of 8 continous controller inputs in range (0-1).-type Ctl8 = (Ugen,Ugen,Ugen,Ugen,Ugen,Ugen,Ugen,Ugen)+type Ctl8 = (Ugen, Ugen, Ugen, Ugen, Ugen, Ugen, Ugen, Ugen) -- | k0 = index of control bus zero ctl8At :: Int -> Ctl8 ctl8At k0 = let u = in' 8 kr (constant k0) in case mceChannels u of- [cc0,cc1,cc2,cc3,cc4,cc5,cc6,cc7] -> (cc0,cc1,cc2,cc3,cc4,cc5,cc6,cc7)- _ -> error "ctl8At?"+ [cc0, cc1, cc2, cc3, cc4, cc5, cc6, cc7] -> (cc0, cc1, cc2, cc3, cc4, cc5, cc6, cc7)+ _ -> error "ctl8At?" -- | 'ctlVoicerAddr' with 'control' inputs for /CtlAddr/ and /CtlZero/. ctl8Voicer :: Int -> (Int -> Ctl8 -> Ugen) -> Ugen ctl8Voicer n f = mce (map (\c -> f c (ctl8At (11000 + (8 * c)))) [0 .. n - 1]) -- | Sequence of 16 continous controller inputs arranged as two Ctl8 sequences.-type Ctl16 = (Ctl8,Ctl8)+type Ctl16 = (Ctl8, Ctl8) -- | 'ctl16VoicerAddr' with 'control' inputs for /CtlAddr/ and /CtlZero/. ctl16Voicer :: Int -> (Int -> Ctl16 -> Ugen) -> Ugen-ctl16Voicer n f = mce (map (\c -> let i = 11000 + (16 * c) in f c (ctl8At i,ctl8At (i + 8))) [0 .. n - 1])+ctl16Voicer n f = mce (map (\c -> let i = 11000 + (16 * c) in f c (ctl8At i, ctl8At (i + 8))) [0 .. n - 1]) -- * Names -- | Control Specificier. (name,default,(minValue,maxValue,warpName))-type ControlSpec t = (String,t,(t,t,String))+type ControlSpec t = (String, t, (t, t, String)) +control_spec_name :: ControlSpec t -> String+control_spec_name (name, _, _) = name+ -- | Comma separated, no spaces. control_spec_parse :: String -> ControlSpec Double control_spec_parse str = case splitOn "," str of- [cnmdef,lhs,rhs,wrp] -> case splitOn ":" cnmdef of- [cnm,def] -> (cnm,read def,(read lhs,read rhs,wrp))- _ -> error ("control_spec_parse: " ++ cnmdef)+ [cnmdef, lhs, rhs, wrp] -> case splitOn ":" cnmdef of+ [cnm, def] -> (cnm, read def, (read lhs, read rhs, wrp))+ _ -> error ("control_spec_parse: " ++ cnmdef) _ -> error ("control_spec_parse: " ++ str) --- | Semicolon separated, no spaces.------ > control_spec_seq_parse "freq:220,110,440,exp;amp:0.1,0,1,amp;pan:0,-1,1,lin"+{- | Semicolon separated, no spaces.++>>> control_spec_seq_parse "freq:220,110,440,exp;amp:0.1,0,1,amp;pan:0,-1,1,lin"+[("freq",220.0,(110.0,440.0,"exp")),("amp",0.1,(0.0,1.0,"amp")),("pan",0.0,(-1.0,1.0,"lin"))]+-} control_spec_seq_parse :: String -> [ControlSpec Double] control_spec_seq_parse = map control_spec_parse . splitOn ";" -- | Comma separated, 6 decimal places, no spaces. control_spec_print :: ControlSpec Double -> String-control_spec_print (cnm,def,(lhs,rhs,wrp)) = intercalate "," [concat [cnm,":",double_pp 6 def],double_pp 6 lhs,double_pp 6 rhs,wrp]+control_spec_print (cnm, def, (lhs, rhs, wrp)) = intercalate "," [concat [cnm, ":", double_pp 6 def], double_pp 6 lhs, double_pp 6 rhs, wrp] --- | Semicolon separated, no spaces.------ > control_spec_seq_print (control_spec_seq_parse "freq:220,220,440,exp;amp:0.1,0,1,amp;pan:0,-1,1,lin")+{- | Semicolon separated, no spaces.++>>> control_spec_seq_print (control_spec_seq_parse "freq:220,220,440,exp;amp:0.1,0,1,amp;pan:0,-1,1,lin")+"freq:220.0,220.0,440.0,exp;amp:0.1,0.0,1.0,amp;pan:0.0,-1.0,1.0,lin"+-} control_spec_seq_print :: [ControlSpec Double] -> String control_spec_seq_print = intercalate ";" . map control_spec_print control_spec_to_control :: ControlSpec Double -> Control-control_spec_to_control (cnm,def,(lhs,rhs,wrp)) =+control_spec_to_control (cnm, def, (lhs, rhs, wrp)) = let grp = if last cnm `elem` "[]" then Just Control_Range else Nothing in Control ControlRate Nothing cnm def False (Just (Control_Meta lhs rhs wrp 0 "" grp)) emptyBrackets @@ -139,25 +148,26 @@ -} sc3_control_spec :: Fractional t => [ControlSpec t] sc3_control_spec =- [("amp",0.1,(0,1,"amp"))- ,("beats",1,(0,20,"lin"))- ,("bipolar",0,(-1,1,"lin"))- ,("boostcut",0,(-20,20,"lin"))- ,("db",-12,(-180,0,"db"))- ,("delay",0.01,(0.0001,1,"exp"))- ,("detune",0,(-20,20,"lin"))- ,("freq",440,(20,20000,"exp"))- ,("lofreq",20,(0.1,100,"exp"))- ,("midfreq",440,(25,4200,"exp"))- ,("midi",64,(0,127,"lin"))- ,("midinote",64,(0,127,"lin"))- ,("midivelocity",64,(1,127,"lin"))- ,("pan",0,(-1,1,"lin"))- ,("phase",0,(0,6.28318,"lin"))- ,("rate",1,(0.125,8,"exp"))- ,("rq",0.1,(0.001,2,"exp"))- ,("unipolar",0,(0,1,"lin"))- ,("widefreq",440,(0.1,20000,"exp"))]+ [ ("amp", 0.1, (0, 1, "amp"))+ , ("beats", 1, (0, 20, "lin"))+ , ("bipolar", 0, (-1, 1, "lin"))+ , ("boostcut", 0, (-20, 20, "lin"))+ , ("db", -12, (-180, 0, "db"))+ , ("delay", 0.01, (0.0001, 1, "exp"))+ , ("detune", 0, (-20, 20, "lin"))+ , ("freq", 440, (20, 20000, "exp"))+ , ("lofreq", 20, (0.1, 100, "exp"))+ , ("midfreq", 440, (25, 4200, "exp"))+ , ("midi", 64, (0, 127, "lin"))+ , ("midinote", 64, (0, 127, "lin"))+ , ("midivelocity", 64, (1, 127, "lin"))+ , ("pan", 0, (-1, 1, "lin"))+ , ("phase", 0, (0, 6.28318, "lin"))+ , ("rate", 1, (0.125, 8, "exp"))+ , ("rq", 0.1, (0.001, 2, "exp"))+ , ("unipolar", 0, (0, 1, "lin"))+ , ("widefreq", 440, (0.1, 20000, "exp"))+ ] {- | See Kyma X Revealed, p.403 @@ -166,53 +176,60 @@ This list adds curve specifiers as strings and default values. -> let x = Data.List.intersect (map fst sc3_control_spec) (map fst kyma_event_value_ranges)-> x == ["beats","boostcut","freq","rate"]-> let c z = let (p,q) = unzip z in let f i = filter (flip elem i . fst) in zip (f p sc3_control_spec) (f q kyma_event_value_ranges)-> c (zip x x)+>>> Data.List.intersect (map control_spec_name sc3_control_spec) (map control_spec_name kyma_event_value_ranges)+["beats","boostcut","freq","rate"] -> c [("lofreq","freqlow"),("midfreq","freqmid")]-> lookup "freqhigh" kyma_event_value_ranges+>>> let f i = filter ((== i) . control_spec_name)+>>> let c (p,q) = (f p sc3_control_spec, f q kyma_event_value_ranges)+>>> c ("lofreq","freqlow")+([("lofreq",20.0,(0.1,100.0,"exp"))],[("freqlow",120.0,(0.0,1000.0,"exp"))])++>>> c ("midfreq","freqmid")+([("midfreq",440.0,(25.0,4200.0,"exp"))],[("freqmid",1200.0,(1000.0,8000.0,"exp"))])++>>> find ((==) "freqhigh" . control_spec_name) kyma_event_value_ranges+Just ("freqhigh",12000.0,(8000.0,24000.0,"exp")) -} kyma_event_value_ranges :: Fractional t => [ControlSpec t] kyma_event_value_ranges =- [("angle",0,(-0.5,1.5,"lin"))- ,("beats",1,(1,16,"lin"))- ,("boostcut",0,(-12,12,"lin"))- ,("bpm",60,(0,2000,"lin"))- ,("centervalue",0,(-1,1,"lin"))- ,("coef",0,(-1,1,"lin"))- ,("cutoff",440,(0,10000,"exp"))- ,("cycles",1,(0,100,"lin"))- ,("dcoffset",0,(-1,1,"lin"))- ,("direction",0,(-1,1,"lin"))- ,("distance",0,(-2,2,"lin"))- ,("fmntshift",1,(0.75,1.25,"lin"))- ,("freq",440,(0,10000,"exp"))- ,("freqhigh",12000,(8000,24000,"exp")) -- sampleRate / 2- ,("freqjitter",0,(0,1,"lin"))- ,("freqlow",120,(0,1000,"exp"))- ,("freqmid",1200,(1000,8000,"exp"))- ,("gain",0.1,(0,10,"amp"))- ,("gaindb",-12,(-128,128,"lin"))- ,("interval",0,(-24,24,"lin"))- ,("keynumber",64,(0,127,"lin"))- ,("logfreq",20,(0,127,"lin"))- ,("looplength",0,(-1,1,"lin"))- ,("offset",0,(-1,1,"lin"))- ,("onduration",0.1,(0,30,"lin"))- ,("panner",0,(-0.5,1.5,"lin"))- ,("pitch",64,(0,127,"lin"))- ,("q",0.1,(0,10,"lin"))- ,("radius",1,(-2,2,"lin"))- ,("rate",1,(0,2,"lin"))- ,("ratio",1,(0,100,"lin"))- ,("scale",0,(-2,2,"lin"))- ,("smallInterval",0,(0,12,"lin"))- ,("steps",1,(1,128,"lin"))- ,("swing",0,(0,0.5,"lin"))- ,("threshdb",-12,(-60,0,"lin"))- ,("timeconstant",1,(0.0001,5,"lin"))- ,("timeindex",0,(-1,1,"lin"))- ,("tune",0,(-1,1,"lin"))- ,("upinterval",0,(0,24,"lin"))]+ [ ("angle", 0, (-0.5, 1.5, "lin"))+ , ("beats", 1, (1, 16, "lin"))+ , ("boostcut", 0, (-12, 12, "lin"))+ , ("bpm", 60, (0, 2000, "lin"))+ , ("centervalue", 0, (-1, 1, "lin"))+ , ("coef", 0, (-1, 1, "lin"))+ , ("cutoff", 440, (0, 10000, "exp"))+ , ("cycles", 1, (0, 100, "lin"))+ , ("dcoffset", 0, (-1, 1, "lin"))+ , ("direction", 0, (-1, 1, "lin"))+ , ("distance", 0, (-2, 2, "lin"))+ , ("fmntshift", 1, (0.75, 1.25, "lin"))+ , ("freq", 440, (0, 10000, "exp"))+ , ("freqhigh", 12000, (8000, 24000, "exp")) -- sampleRate / 2+ , ("freqjitter", 0, (0, 1, "lin"))+ , ("freqlow", 120, (0, 1000, "exp"))+ , ("freqmid", 1200, (1000, 8000, "exp"))+ , ("gain", 0.1, (0, 10, "amp"))+ , ("gaindb", -12, (-128, 128, "lin"))+ , ("interval", 0, (-24, 24, "lin"))+ , ("keynumber", 64, (0, 127, "lin"))+ , ("logfreq", 20, (0, 127, "lin"))+ , ("looplength", 0, (-1, 1, "lin"))+ , ("offset", 0, (-1, 1, "lin"))+ , ("onduration", 0.1, (0, 30, "lin"))+ , ("panner", 0, (-0.5, 1.5, "lin"))+ , ("pitch", 64, (0, 127, "lin"))+ , ("q", 0.1, (0, 10, "lin"))+ , ("radius", 1, (-2, 2, "lin"))+ , ("rate", 1, (0, 2, "lin"))+ , ("ratio", 1, (0, 100, "lin"))+ , ("scale", 0, (-2, 2, "lin"))+ , ("smallInterval", 0, (0, 12, "lin"))+ , ("steps", 1, (1, 128, "lin"))+ , ("swing", 0, (0, 0.5, "lin"))+ , ("threshdb", -12, (-60, 0, "lin"))+ , ("timeconstant", 1, (0.0001, 5, "lin"))+ , ("timeindex", 0, (-1, 1, "lin"))+ , ("tune", 0, (-1, 1, "lin"))+ , ("upinterval", 0, (0, 24, "lin"))+ ]
Sound/Sc3/Ugen/Graph.hs view
@@ -11,7 +11,6 @@ A U_Graph is constructed by a stateful traversal of a Ugen. A U_Graph is represented as a partioned (by type) set of U_Nodes, edges are implicit.- -} module Sound.Sc3.Ugen.Graph where @@ -19,6 +18,8 @@ import Data.List {- base -} import Data.Maybe {- base -} +import qualified Safe {- safe -}+ import qualified Sound.Sc3.Common.Rate as Rate {- hsc3 -} import qualified Sound.Sc3.Common.Uid as Uid {- hsc3 -} @@ -34,47 +35,57 @@ {- | Type to represent the left hand side of an edge in a unit generator graph. C = constant, K = control, U = ugen. -}-data From_Port =- From_Port_C {from_port_nid :: Uid.Id}- | From_Port_K {from_port_nid :: Uid.Id,from_port_kt :: Rate.K_Type}- | From_Port_U {from_port_nid :: Uid.Id,from_port_idx :: Maybe Port_Index}- deriving (Eq,Show)+data From_Port+ = From_Port_C {from_port_nid :: Uid.Id}+ | From_Port_K {from_port_nid :: Uid.Id, from_port_kt :: Rate.K_Type}+ | From_Port_U {from_port_nid :: Uid.Id, from_port_idx :: Maybe Port_Index}+ deriving (Eq, Show) -- | A destination port.-data To_Port = To_Port {to_port_nid :: Uid.Id,to_port_idx :: Port_Index}- deriving (Eq,Show)+data To_Port = To_Port {to_port_nid :: Uid.Id, to_port_idx :: Port_Index}+ deriving (Eq, Show) -- | A connection from 'From_Port' to 'To_Port'.-type U_Edge = (From_Port,To_Port)+type U_Edge = (From_Port, To_Port) --- | Sum-type to represent nodes in unit generator graph.--- _C = constant, _K = control, _U = ugen, _P = proxy.-data U_Node = U_Node_C {u_node_id :: Uid.Id- ,u_node_c_value :: Sample}- | U_Node_K {u_node_id :: Uid.Id- ,u_node_k_rate :: Rate.Rate- ,u_node_k_index :: Maybe Int- ,u_node_k_name :: String- ,u_node_k_default :: Sample- ,u_node_k_type :: Rate.K_Type- ,u_node_k_meta :: Maybe (Control_Meta Sample)}- | U_Node_U {u_node_id :: Uid.Id- ,u_node_u_rate :: Rate.Rate- ,u_node_u_name :: String- ,u_node_u_inputs :: [From_Port]- ,u_node_u_outputs :: [Output]- ,u_node_u_special :: Special- ,u_node_u_ugenid :: UgenId}- | U_Node_P {u_node_id :: Uid.Id- ,u_node_p_id :: Uid.Id- ,u_node_p_index :: Port_Index- ,u_node_p_rate :: Rate.Rate}- deriving (Eq,Show)+{- | Sum-type to represent nodes in unit generator graph.+ _C = constant, _K = control, _U = ugen, _P = proxy.+-}+data U_Node+ = U_Node_C+ { u_node_id :: Uid.Id+ , u_node_c_value :: Sample+ }+ | U_Node_K+ { u_node_id :: Uid.Id+ , u_node_k_rate :: Rate.Rate+ , u_node_k_index :: Maybe Int+ , u_node_k_name :: String+ , u_node_k_default :: Sample+ , u_node_k_type :: Rate.K_Type+ , u_node_k_meta :: Maybe (Control_Meta Sample)+ }+ | U_Node_U+ { u_node_id :: Uid.Id+ , u_node_u_rate :: Rate.Rate+ , u_node_u_name :: String+ , u_node_u_inputs :: [From_Port]+ , u_node_u_outputs :: [Output]+ , u_node_u_special :: Special+ , u_node_u_ugenid :: UgenId+ }+ | U_Node_P+ { u_node_id :: Uid.Id+ , u_node_p_id :: Uid.Id+ , u_node_p_index :: Port_Index+ , u_node_p_rate :: Rate.Rate+ }+ deriving (Eq, Show) -u_node_is_c,u_node_is_k,u_node_is_u :: U_Node -> Bool-u_node_is_c n = case n of {U_Node_C {} -> True; _ -> False}-u_node_is_k n = case n of {U_Node_K {} -> True; _ -> False}-u_node_is_u n = case n of {U_Node_U {} -> True; _ -> False}+u_node_is_c, u_node_is_k, u_node_is_u :: U_Node -> Bool+u_node_is_c n = case n of U_Node_C {} -> True; _ -> False+u_node_is_k n = case n of U_Node_K {} -> True; _ -> False+u_node_is_u n = case n of U_Node_U {} -> True; _ -> False -- | Convert from U_Node_K to Control (ie. discard index). u_node_k_to_control :: U_Node -> Control@@ -88,65 +99,68 @@ u_node_user_name n = ugen_user_name (u_node_u_name n) (u_node_u_special n) -- | Type to represent a unit generator graph.-data U_Graph = U_Graph {ug_next_id :: Uid.Id- ,ug_constants :: [U_Node]- ,ug_controls :: [U_Node]- ,ug_ugens :: [U_Node]}- deriving (Show)+data U_Graph = U_Graph+ { ug_next_id :: Uid.Id+ , ug_constants :: [U_Node]+ , ug_controls :: [U_Node]+ , ug_ugens :: [U_Node]+ }+ deriving (Show) -- * Ports -- | Get 'port_idx' for 'From_Port_U', else @0@. port_idx_or_zero :: From_Port -> Port_Index port_idx_or_zero p =- case p of- From_Port_U _ (Just x) -> x- _ -> 0+ case p of+ From_Port_U _ (Just x) -> x+ _ -> 0 -- | Is 'From_Port' 'From_Port_U'. is_from_port_u :: From_Port -> Bool is_from_port_u p =- case p of- From_Port_U _ _ -> True- _ -> False+ case p of+ From_Port_U _ _ -> True+ _ -> False -- * Nodes -- | Is 'U_Node' a /constant/. is_u_node_c :: U_Node -> Bool is_u_node_c n =- case n of- U_Node_C _ _ -> True- _ -> False+ case n of+ U_Node_C _ _ -> True+ _ -> False -- | Predicate to determine if 'U_Node' is a constant with indicated /value/. is_u_node_c_of :: Sample -> U_Node -> Bool is_u_node_c_of x n =- case n of- U_Node_C _ y -> x == y- _ -> error "is_u_node_c_of: non U_Node_C"+ case n of+ U_Node_C _ y -> x == y+ _ -> error "is_u_node_c_of: non U_Node_C" -- | Is 'U_Node' a /control/. is_u_node_k :: U_Node -> Bool is_u_node_k n =- case n of- U_Node_K {} -> True- _ -> False+ case n of+ U_Node_K {} -> True+ _ -> False --- | Predicate to determine if 'U_Node' is a control with indicated--- /name/. Names must be unique.+{- | Predicate to determine if 'U_Node' is a control with indicated+/name/. Names must be unique.+-} is_u_node_k_of :: String -> U_Node -> Bool is_u_node_k_of x n =- case n of- U_Node_K _ _ _ y _ _ _ -> x == y- _ -> error "is_u_node_k_of"+ case n of+ U_Node_K _ _ _ y _ _ _ -> x == y+ _ -> error "is_u_node_k_of" -- | Is 'U_Node' a /Ugen/. is_u_node_u :: U_Node -> Bool is_u_node_u n =- case n of- U_Node_U {} -> True- _ -> False+ case n of+ U_Node_U {} -> True+ _ -> False -- | Compare 'U_Node_K' values 'on' 'u_node_k_type'. u_node_k_cmp :: U_Node -> U_Node -> Ordering@@ -160,75 +174,75 @@ u_node_k_eq :: U_Node -> U_Node -> Bool u_node_k_eq p q = if is_u_node_k p && is_u_node_k q- then p == q- else error "u_node_k_eq? not U_Node_K"+ then p == q+ else error "u_node_k_eq? not U_Node_K" {- | 'Rate' of 'U_Node', ie. 'InitialisationRate' for constants. See through 'U_Node_P'. Not used at hsc3 but used by hsc3-dot &etc. -} u_node_rate :: U_Node -> Rate.Rate u_node_rate n =- case n of- U_Node_C {} -> Rate.InitialisationRate- U_Node_K {} -> u_node_k_rate n- U_Node_U {} -> u_node_u_rate n- U_Node_P {} -> u_node_p_rate n+ case n of+ U_Node_C {} -> Rate.InitialisationRate+ U_Node_K {} -> u_node_k_rate n+ U_Node_U {} -> u_node_u_rate n+ U_Node_P {} -> u_node_p_rate n -- | Generate a label for 'U_Node' using the /type/ and the 'u_node_id'. u_node_label :: U_Node -> String u_node_label nd =- case nd of- U_Node_C n _ -> "c_" ++ show n- U_Node_K n _ _ _ _ _ _ -> "k_" ++ show n- U_Node_U n _ _ _ _ _ _ -> "u_" ++ show n- U_Node_P n _ _ _ -> "p_" ++ show n+ case nd of+ U_Node_C n _ -> "c_" ++ show n+ U_Node_K n _ _ _ _ _ _ -> "k_" ++ show n+ U_Node_U n _ _ _ _ _ _ -> "u_" ++ show n+ U_Node_P n _ _ _ -> "p_" ++ show n -- | Calculate all in edges for a 'U_Node_U'. u_node_in_edges :: U_Node -> [U_Edge] u_node_in_edges n =- case n of- U_Node_U x _ _ i _ _ _ -> zip i (map (To_Port x) [0..])- _ -> error "u_node_in_edges: non U_Node_U input node"+ case n of+ U_Node_U x _ _ i _ _ _ -> zip i (map (To_Port x) [0 ..])+ _ -> error "u_node_in_edges: non U_Node_U input node" -- | Transform 'U_Node' to 'From_Port'. u_node_from_port :: U_Node -> From_Port u_node_from_port d =- case d of- U_Node_C n _ -> From_Port_C n- U_Node_K n _ _ _ _ t _ -> From_Port_K n t- U_Node_U n _ _ _ o _ _ ->- case o of- [_] -> From_Port_U n Nothing- _ -> error (show ("u_node_from_port: non unary U_Node_U",d))- U_Node_P _ u p _ -> From_Port_U u (Just p)+ case d of+ U_Node_C n _ -> From_Port_C n+ U_Node_K n _ _ _ _ t _ -> From_Port_K n t+ U_Node_U n _ _ _ o _ _ ->+ case o of+ [_] -> From_Port_U n Nothing+ _ -> error (show ("u_node_from_port: non unary U_Node_U", d))+ U_Node_P _ u p _ -> From_Port_U u (Just p) -- | If controls have been given indices they must be coherent. u_node_sort_controls :: [U_Node] -> [U_Node] u_node_sort_controls c =- let u_node_k_ix n = fromMaybe maxBound (u_node_k_index n)- cmp = compare `on` u_node_k_ix- c' = sortBy cmp c- coheres z = maybe True (== z) . u_node_k_index- coherent = and (zipWith coheres [0..] c')- in if coherent then c' else error (show ("u_node_sort_controls: incoherent",c))+ let u_node_k_ix n = fromMaybe maxBound (u_node_k_index n)+ cmp = compare `on` u_node_k_ix+ c' = sortBy cmp c+ coheres z = maybe True (== z) . u_node_k_index+ coherent = and (zipWith coheres [0 ..] c')+ in if coherent then c' else error (show ("u_node_sort_controls: incoherent", c)) -- | Determine 'K_Type' of a /control/ Ugen at 'U_Node_U', or not. u_node_ktype :: U_Node -> Maybe Rate.K_Type u_node_ktype n =- case (u_node_u_name n,u_node_u_rate n) of- ("Control",Rate.InitialisationRate) -> Just Rate.K_InitialisationRate- ("Control",Rate.ControlRate) -> Just Rate.K_ControlRate- ("TrigControl",Rate.ControlRate) -> Just Rate.K_TriggerRate- ("AudioControl",Rate.AudioRate) -> Just Rate.K_AudioRate- _ -> Nothing+ case (u_node_u_name n, u_node_u_rate n) of+ ("Control", Rate.InitialisationRate) -> Just Rate.K_InitialisationRate+ ("Control", Rate.ControlRate) -> Just Rate.K_ControlRate+ ("TrigControl", Rate.ControlRate) -> Just Rate.K_TriggerRate+ ("AudioControl", Rate.AudioRate) -> Just Rate.K_AudioRate+ _ -> Nothing -- | Is 'U_Node' a control Ugen? u_node_is_control :: U_Node -> Bool u_node_is_control n =- let cs = ["AudioControl","Control","TrigControl"]- in case n of- U_Node_U _ _ s _ _ _ _ -> s `elem` cs- _ -> False+ let cs = ["AudioControl", "Control", "TrigControl"]+ in case n of+ U_Node_U _ _ s _ _ _ _ -> s `elem` cs+ _ -> False -- | Is 'U_Node' an /implicit/ control Ugen? u_node_is_implicit_control :: U_Node -> Bool@@ -241,89 +255,96 @@ -- | Zero if no local buffers, or if maxLocalBufs is given. u_node_localbuf_count :: [U_Node] -> Int u_node_localbuf_count us =- case find ((==) "MaxLocalBufs" . u_node_u_name) us of- Nothing -> length (filter ((==) "LocalBuf" . u_node_u_name) us)- Just _ -> 0+ case find ((==) "MaxLocalBufs" . u_node_u_name) us of+ Nothing -> length (filter ((==) "LocalBuf" . u_node_u_name) us)+ Just _ -> 0 --- | Controls are a special case. We need to know not the overall--- index but the index in relation to controls of the same type.+{- | Controls are a special case. We need to know not the overall+index but the index in relation to controls of the same type.+-} u_node_fetch_k :: Uid.Id -> Rate.K_Type -> [U_Node] -> Int u_node_fetch_k z t =- let recur i ns =- case ns of- [] -> error "u_node_fetch_k"- n:ns' -> if z == u_node_id n- then i- else if t == u_node_k_type n- then recur (i + 1) ns'- else recur i ns'- in recur 0+ let recur i ns =+ case ns of+ [] -> error "u_node_fetch_k"+ n : ns' ->+ if z == u_node_id n+ then i+ else+ if t == u_node_k_type n+ then recur (i + 1) ns'+ else recur i ns'+ in recur 0 -- | All the elements of a U_Node_U, except the u_node_id.-type U_Node_NoId = (Rate.Rate,String,[From_Port],[Output],Special,UgenId)+type U_Node_NoId = (Rate.Rate, String, [From_Port], [Output], Special, UgenId) -- | Predicate to locate primitive, names must be unique. u_node_eq_noid :: U_Node_NoId -> U_Node -> Bool u_node_eq_noid x nd =- case nd of- U_Node_U _ r n i o s d -> (r,n,i,o,s,d) == x- _ -> error "u_node_eq_noid"+ case nd of+ U_Node_U _ r n i o s d -> (r, n, i, o, s, d) == x+ _ -> error "u_node_eq_noid" -- | Make map associating 'K_Type' with Ugen index.-u_node_mk_ktype_map :: [U_Node] -> [(Rate.K_Type,Int)]+u_node_mk_ktype_map :: [U_Node] -> [(Rate.K_Type, Int)] u_node_mk_ktype_map =- let f (i,n) = let g ty = (ty,i) in fmap g (u_node_ktype n)- in mapMaybe f . zip [0..]+ let f (i, n) = let g ty = (ty, i) in fmap g (u_node_ktype n)+ in mapMaybe f . zip [0 ..] -- * Nodes (Implicit) -- | 4-tuple to count 'K_Type's, ie. (InitialisationRate,ControlRate,TriggerRate,AudioRate).-type U_NODE_KS_COUNT = (Int,Int,Int,Int)+type U_NODE_KS_COUNT = (Int, Int, Int, Int) -- | Count the number of /controls/ of each 'K_Type'. u_node_ks_count :: [U_Node] -> U_NODE_KS_COUNT u_node_ks_count =- let recur r ns =- let (i,k,t,a) = r- in case ns of- [] -> r- n:ns' -> let r' = case u_node_k_type n of- Rate.K_InitialisationRate -> (i+1,k,t,a)- Rate.K_ControlRate -> (i,k+1,t,a)- Rate.K_TriggerRate -> (i,k,t+1,a)- Rate.K_AudioRate -> (i,k,t,a+1)- in recur r' ns'- in recur (0,0,0,0)+ let recur r ns =+ let (i, k, t, a) = r+ in case ns of+ [] -> r+ n : ns' ->+ let r' = case u_node_k_type n of+ Rate.K_InitialisationRate -> (i + 1, k, t, a)+ Rate.K_ControlRate -> (i, k + 1, t, a)+ Rate.K_TriggerRate -> (i, k, t + 1, a)+ Rate.K_AudioRate -> (i, k, t, a + 1)+ in recur r' ns'+ in recur (0, 0, 0, 0) --- | Construct implicit /control/ unit generator 'U_Nodes'. Unit--- generators are only constructed for instances of control types that--- are present.+{- | Construct implicit /control/ unit generator 'U_Nodes'.+Unit generators are only constructed for instances of control types that are present.+The special-index holds the accumulated offset where multiple Control Ugens (at different rates) are present.+-} u_node_mk_implicit_ctl :: [U_Node] -> [U_Node] u_node_mk_implicit_ctl ks =- let (ni,nk,nt,na) = u_node_ks_count ks- mk_n t n o =- let (nm,r) = case t of- Rate.K_InitialisationRate -> ("Control",Rate.InitialisationRate)- Rate.K_ControlRate -> ("Control",Rate.ControlRate)- Rate.K_TriggerRate -> ("TrigControl",Rate.ControlRate)- Rate.K_AudioRate -> ("AudioControl",Rate.AudioRate)- i = replicate n r- in if n == 0- then Nothing- else Just (U_Node_U (-1) r nm [] i (Special o) no_id)- in catMaybes [mk_n Rate.K_InitialisationRate ni 0- ,mk_n Rate.K_ControlRate nk ni- ,mk_n Rate.K_TriggerRate nt (ni + nk)- ,mk_n Rate.K_AudioRate na (ni + nk + nt)]+ let (ni, nk, nt, na) = u_node_ks_count ks+ mk_n t n o =+ let (nm, r) = case t of+ Rate.K_InitialisationRate -> ("Control", Rate.InitialisationRate)+ Rate.K_ControlRate -> ("Control", Rate.ControlRate)+ Rate.K_TriggerRate -> ("TrigControl", Rate.ControlRate)+ Rate.K_AudioRate -> ("AudioControl", Rate.AudioRate)+ i = replicate n r+ in if n == 0+ then Nothing+ else Just (U_Node_U (-1) r nm [] i (Special o) no_id)+ in catMaybes+ [ mk_n Rate.K_InitialisationRate ni 0+ , mk_n Rate.K_ControlRate nk ni+ , mk_n Rate.K_TriggerRate nt (ni + nk)+ , mk_n Rate.K_AudioRate na (ni + nk + nt)+ ] -- * Edges -- | List of 'From_Port_U' at /e/ with multiple out edges. u_edge_multiple_out_edges :: [U_Edge] -> [From_Port] u_edge_multiple_out_edges e =- let p = filter is_from_port_u (map fst e)- p' = group (sortBy (compare `on` from_port_nid) p)- in map head (filter ((> 1) . length) p')+ let p = filter is_from_port_u (map fst e)+ p' = group (sortBy (compare `on` from_port_nid) p)+ in map (Safe.headNote "u_edge_multiple_out_edges") (filter ((> 1) . length) p') -- * Graph @@ -340,14 +361,14 @@ ug_maximum_id (U_Graph z c k u) = let z' = maximum (map u_node_id (c ++ k ++ u)) in if z' /= z- then error (show ("ug_maximum_id: not ug_next_id?",z,z'))- else z+ then error (show ("ug_maximum_id: not ug_next_id?", z, z'))+ else z -- | Find 'U_Node' with indicated 'Uid.Id'. ug_find_node :: U_Graph -> Uid.Id -> Maybe U_Node ug_find_node (U_Graph _ cs ks us) n =- let f x = u_node_id x == n- in find f (cs ++ ks ++ us)+ let f x = u_node_id x == n+ in find f (cs ++ ks ++ us) -- | Locate 'U_Node' of 'From_Port' in 'U_Graph'. ug_from_port_node :: U_Graph -> From_Port -> Maybe U_Node@@ -356,111 +377,126 @@ -- | Erroring variant. ug_from_port_node_err :: U_Graph -> From_Port -> U_Node ug_from_port_node_err g fp =- let e = error "ug_from_port_node_err"- in fromMaybe e (ug_from_port_node g fp)+ let e = error "ug_from_port_node_err"+ in fromMaybe e (ug_from_port_node g fp) -- * Graph (Construct from Ugen) -- | Insert a constant 'U_Node' into the 'U_Graph'.-ug_push_c :: Sample -> U_Graph -> (U_Node,U_Graph)+ug_push_c :: Sample -> U_Graph -> (U_Node, U_Graph) ug_push_c x g =- let n = U_Node_C (ug_next_id g) x- in (n,g {ug_constants = n : ug_constants g- ,ug_next_id = ug_next_id g + 1})+ let n = U_Node_C (ug_next_id g) x+ in ( n+ , g+ { ug_constants = n : ug_constants g+ , ug_next_id = ug_next_id g + 1+ }+ ) {- | Either find existing 'Constant' 'U_Node', or insert a new 'U_Node'. Brackets are discarded. -}-ug_mk_node_c :: Constant -> U_Graph -> (U_Node,U_Graph)+ug_mk_node_c :: Constant -> U_Graph -> (U_Node, U_Graph) ug_mk_node_c (Constant x _b) g =- let y = find (is_u_node_c_of x) (ug_constants g)- in maybe (ug_push_c x g) (\y' -> (y',g)) y+ let y = find (is_u_node_c_of x) (ug_constants g)+ in maybe (ug_push_c x g) (\y' -> (y', g)) y -- | Insert a control node into the 'U_Graph'.-ug_push_k :: Control -> U_Graph -> (U_Node,U_Graph)+ug_push_k :: Control -> U_Graph -> (U_Node, U_Graph) ug_push_k (Control r ix nm d tr meta _brk) g =- let n = U_Node_K (ug_next_id g) r ix nm d (Rate.ktype r tr) meta- in (n,g {ug_controls = n : ug_controls g- ,ug_next_id = ug_next_id g + 1})+ let n = U_Node_K (ug_next_id g) r ix nm d (Rate.ktype r tr) meta+ in ( n+ , g+ { ug_controls = n : ug_controls g+ , ug_next_id = ug_next_id g + 1+ }+ ) -- | Either find existing 'Control' 'U_Node', or insert a new 'U_Node'.-ug_mk_node_k :: Control -> U_Graph -> (U_Node,U_Graph)+ug_mk_node_k :: Control -> U_Graph -> (U_Node, U_Graph) ug_mk_node_k c g =- let nm = controlName c- y = find (is_u_node_k_of nm) (ug_controls g)- in maybe (ug_push_k c g) (\y' -> (y',g)) y+ let nm = controlName c+ y = find (is_u_node_k_of nm) (ug_controls g)+ in maybe (ug_push_k c g) (\y' -> (y', g)) y -- | Insert a /primitive/ 'U_Node_U' into the 'U_Graph'.-ug_push_u :: U_Node_NoId -> U_Graph -> (U_Node,U_Graph)-ug_push_u (r,nm,i,o,s,d) g =- let n = U_Node_U (ug_next_id g) r nm i o s d- in (n,g {ug_ugens = n : ug_ugens g- ,ug_next_id = ug_next_id g + 1})+ug_push_u :: U_Node_NoId -> U_Graph -> (U_Node, U_Graph)+ug_push_u (r, nm, i, o, s, d) g =+ let n = U_Node_U (ug_next_id g) r nm i o s d+ in ( n+ , g+ { ug_ugens = n : ug_ugens g+ , ug_next_id = ug_next_id g + 1+ }+ ) -- | Recursively traverse set of Ugen calling 'ug_mk_node'.-ug_mk_node_rec :: [Ugen] -> [U_Node] -> U_Graph -> ([U_Node],U_Graph)+ug_mk_node_rec :: [Ugen] -> [U_Node] -> U_Graph -> ([U_Node], U_Graph) ug_mk_node_rec u n g =- case u of- [] -> (reverse n,g)- x:xs -> let (y,g') = ug_mk_node x g- in ug_mk_node_rec xs (y:n) g'+ case u of+ [] -> (reverse n, g)+ x : xs ->+ let (y, g') = ug_mk_node x g+ in ug_mk_node_rec xs (y : n) g' {- | Run 'ug_mk_node_rec' at inputs and either find existing primitive node or insert a new one. Brackets are discarded. -}-ug_mk_node_u :: Primitive Ugen -> U_Graph -> (U_Node,U_Graph)+ug_mk_node_u :: Primitive Ugen -> U_Graph -> (U_Node, U_Graph) ug_mk_node_u (Primitive r nm i o s d _b) g =- let (i',g') = ug_mk_node_rec i [] g- i'' = map u_node_from_port i'- u = (r,nm,i'',o,s,d)- y = find (u_node_eq_noid u) (ug_ugens g')- in maybe (ug_push_u u g') (\y' -> (y',g')) y+ let (i', g') = ug_mk_node_rec i [] g+ i'' = map u_node_from_port i'+ u = (r, nm, i'', o, s, d)+ y = find (u_node_eq_noid u) (ug_ugens g')+ in maybe (ug_push_u u g') (\y' -> (y', g')) y -- | Proxies do not get stored in the graph. Proxies are always of U nodes.-ug_mk_node_p :: U_Node -> Port_Index -> U_Graph -> (U_Node,U_Graph)+ug_mk_node_p :: U_Node -> Port_Index -> U_Graph -> (U_Node, U_Graph) ug_mk_node_p n p g =- let z = ug_next_id g- in (U_Node_P z (u_node_id n) p (u_node_u_rate n),g {ug_next_id = z + 1})+ let z = ug_next_id g+ in (U_Node_P z (u_node_id n) p (u_node_u_rate n), g {ug_next_id = z + 1}) --- | Transform 'Ugen' into 'U_Graph', appending to existing 'U_Graph'.--- Allow rhs of Mrg node to be Mce (splice all nodes into graph).-ug_mk_node :: Ugen -> U_Graph -> (U_Node,U_Graph)+{- | Transform 'Ugen' into 'U_Graph', appending to existing 'U_Graph'.+ Allow rhs of Mrg node to be Mce (splice all nodes into graph).+-}+ug_mk_node :: Ugen -> U_Graph -> (U_Node, U_Graph) ug_mk_node u g =- case u of- Constant_U c -> ug_mk_node_c c g- Control_U k -> ug_mk_node_k k g- Label_U _ -> error (show ("ug_mk_node: label",u))- Primitive_U p -> ug_mk_node_u p g- Proxy_U p ->- let (n,g') = ug_mk_node_u (proxySource p) g- in ug_mk_node_p n (proxyIndex p) g'- Mrg_U m ->- let f g' l = case l of- [] -> g'- n:l' -> let (_,g'') = ug_mk_node n g' in f g'' l'- in ug_mk_node (mrgLeft m) (f g (mceChannels (mrgRight m)))- Mce_U _ -> error (show ("ug_mk_node: mce",u))+ case u of+ Constant_U c -> ug_mk_node_c c g+ Control_U k -> ug_mk_node_k k g+ Label_U _ -> error (show ("ug_mk_node: label", u))+ Primitive_U p -> ug_mk_node_u p g+ Proxy_U p ->+ let (n, g') = ug_mk_node_u (proxySource p) g+ in ug_mk_node_p n (proxyIndex p) g'+ Mrg_U m ->+ let f g' l = case l of+ [] -> g'+ n : l' -> let (_, g'') = ug_mk_node n g' in f g'' l'+ in ug_mk_node (mrgLeft m) (f g (mceChannels (mrgRight m)))+ Mce_U _ -> error (show ("ug_mk_node: mce", u)) -- * Implicit -- | Add implicit /control/ Ugens to 'U_Graph'. ug_add_implicit_ctl :: U_Graph -> U_Graph ug_add_implicit_ctl g =- let (U_Graph z cs ks us) = g- ks' = sortBy u_node_k_cmp ks- im = if null ks' then [] else u_node_mk_implicit_ctl ks'- us' = im ++ us- in U_Graph z cs ks' us'+ let (U_Graph z cs ks us) = g+ ks' = sortBy u_node_k_cmp ks+ im = if null ks' then [] else u_node_mk_implicit_ctl ks'+ us' = im ++ us+ in U_Graph z cs ks' us' -- | Add implicit 'maxLocalBufs' if not present. ug_add_implicit_buf :: U_Graph -> U_Graph ug_add_implicit_buf g =- case u_node_localbuf_count (ug_ugens g) of- 0 -> g- n -> let (c,g') = ug_mk_node_c (Constant (fromIntegral n) ([],[])) g- p = u_node_from_port c- u = U_Node_U (-1) Rate.InitialisationRate "MaxLocalBufs" [p] [] (Special 0) no_id- in g' {ug_ugens = u : ug_ugens g'}+ case u_node_localbuf_count (ug_ugens g) of+ 0 -> g+ n ->+ let (c, g') = ug_mk_node_c (Constant (fromIntegral n) ([], [])) g+ p = u_node_from_port c+ u = U_Node_U (-1) Rate.InitialisationRate "MaxLocalBufs" [p] [] (Special 0) no_id+ in g' {ug_ugens = u : ug_ugens g'} -- | 'ug_add_implicit_buf' and 'ug_add_implicit_ctl'. ug_add_implicit :: U_Graph -> U_Graph@@ -469,40 +505,41 @@ -- | Remove implicit Ugens from 'U_Graph' ug_remove_implicit :: U_Graph -> U_Graph ug_remove_implicit g =- let u = filter (not . u_node_is_implicit) (ug_ugens g)- in g {ug_ugens = u}+ let u = filter (not . u_node_is_implicit) (ug_ugens g)+ in g {ug_ugens = u} -- * Graph (Queries) -- | Descendents at 'U_Graph' of 'U_Node'. u_node_descendents :: U_Graph -> U_Node -> [U_Node] u_node_descendents g n =- let e = ug_edges g- c = filter ((== u_node_id n) . from_port_nid . fst) e- f (To_Port k _) = k- in mapMaybe (ug_find_node g . f . snd) c+ let e = ug_edges g+ c = filter ((== u_node_id n) . from_port_nid . fst) e+ f (To_Port k _) = k+ in mapMaybe (ug_find_node g . f . snd) c -- * PV edge accounting -- | List @PV@ 'U_Node's at 'U_Graph' with multiple out edges. ug_pv_multiple_out_edges :: U_Graph -> [U_Node] ug_pv_multiple_out_edges g =- let e = ug_edges g- p = u_edge_multiple_out_edges e- n = mapMaybe (ug_find_node g . from_port_nid) p- in filter (Analysis.primitive_is_pv_rate . u_node_u_name) n+ let e = ug_edges g+ p = u_edge_multiple_out_edges e+ n = mapMaybe (ug_find_node g . from_port_nid) p+ in filter (Analysis.primitive_is_pv_rate . u_node_u_name) n --- | Error string if graph has an invalid @PV@ subgraph, ie. multiple out edges--- at @PV@ node not connecting to @Unpack1FFT@ & @PackFFT@, else Nothing.+{- | Error string if graph has an invalid @PV@ subgraph, ie. multiple out edges+at @PV@ node not connecting to @Unpack1FFT@ & @PackFFT@, else Nothing.+-} ug_pv_check :: U_Graph -> Maybe String ug_pv_check g =- case ug_pv_multiple_out_edges g of- [] -> Nothing- n ->- let d = concatMap (map u_node_u_name . u_node_descendents g) n- in if any Analysis.primitive_is_pv_rate d || any (`elem` ["IFFT"]) d- then Just (show ("PV: multiple out edges, see pv_Split",map u_node_u_name n,d))- else Nothing+ case ug_pv_multiple_out_edges g of+ [] -> Nothing+ n ->+ let d = concatMap (map u_node_u_name . u_node_descendents g) n+ in if any Analysis.primitive_is_pv_rate d || any (`elem` ["IFFT"]) d+ then Just (show ("PV: multiple out edges, see pv_Split", map u_node_u_name n, d))+ else Nothing -- | Variant that runs 'error' as required. ug_pv_validate :: U_Graph -> U_Graph@@ -515,16 +552,18 @@ then reverses the resulting 'Ugen' list and sorts the 'Control' list, and finally adds implicit nodes and validates PV sub-graphs. -> import Sound.Sc3 {- hsc3 -}+> import Sound.Sc3 {\- hsc3 -\} > ugen_to_graph (out 0 (pan2 (sinOsc ar 440 0) 0.5 0.1))- -} ugen_to_graph_direct :: Ugen -> U_Graph ugen_to_graph_direct u =- let (_,g) = ug_mk_node (Util.prepare_root u) ug_empty_graph- g' = g {ug_ugens = reverse (ug_ugens g)- ,ug_controls = u_node_sort_controls (ug_controls g)}- in ug_pv_validate (ug_add_implicit g')+ let (_, g) = ug_mk_node (Util.prepare_root u) ug_empty_graph+ g' =+ g+ { ug_ugens = reverse (ug_ugens g)+ , ug_controls = u_node_sort_controls (ug_controls g)+ }+ in ug_pv_validate (ug_add_implicit g') {- ugen_to_graph_netlist :: Ugen -> U_Graph@@ -543,21 +582,22 @@ -- | Simple statistical analysis of a unit generator graph. ug_stat_ln :: U_Graph -> [String] ug_stat_ln s =- let cs = ug_constants s- ks = ug_controls s- us = ug_ugens s- hist pp_f =- let h (x:xs) = (x,length (x:xs))- h [] = error "graph_stat_ln"- in unwords . map ((\(p,q) -> pp_f p ++ "×" ++ show q) . h) . group . sort- in ["number of constants : " ++ show (length cs)- ,"number of controls : " ++ show (length ks)- ,"control rates : " ++ hist show (map u_node_k_rate ks)- ,"control names : " ++ unwords (map u_node_k_name ks)- ,"number of unit generators : " ++ show (length us)- ,"unit generator rates : " ++ hist Rate.rateAbbrev (map u_node_u_rate us)- ,"unit generator set : " ++ hist id (map u_node_user_name us)- ,"unit generator sequence : " ++ unwords (map u_node_user_name us)]+ let cs = ug_constants s+ ks = ug_controls s+ us = ug_ugens s+ hist pp_f =+ let h (x : xs) = (x, length (x : xs))+ h [] = error "graph_stat_ln"+ in unwords . map ((\(p, q) -> pp_f p ++ "×" ++ show q) . h) . group . sort+ in [ "number of constants : " ++ show (length cs)+ , "number of controls : " ++ show (length ks)+ , "control rates : " ++ hist show (map u_node_k_rate ks)+ , "control names : " ++ unwords (map u_node_k_name ks)+ , "number of unit generators : " ++ show (length us)+ , "unit generator rates : " ++ hist Rate.rateAbbrev (map u_node_u_rate us)+ , "unit generator set : " ++ hist id (map u_node_user_name us)+ , "unit generator sequence : " ++ unwords (map u_node_user_name us)+ ] -- | 'unlines' of 'ug_stat_ln'. ug_stat :: U_Graph -> String@@ -565,12 +605,13 @@ -- * Indices --- | Find indices of all instances of the named Ugen at 'Graph'.--- The index is required when using 'Sound.Sc3.Server.Command.u_cmd'.-ug_ugen_indices :: (Num n,Enum n) => String -> U_Graph -> [n]+{- | Find indices of all instances of the named Ugen at 'Graph'.+The index is required when using 'Sound.Sc3.Server.Command.u_cmd'.+-}+ug_ugen_indices :: (Num n, Enum n) => String -> U_Graph -> [n] ug_ugen_indices nm =- let f (k,nd) =- case nd of- U_Node_U _ _ nm' _ _ _ _ -> if nm == nm' then Just k else Nothing- _ -> Nothing- in mapMaybe f . zip [0..] . ug_ugens+ let f (k, nd) =+ case nd of+ U_Node_U _ _ nm' _ _ _ _ -> if nm == nm' then Just k else Nothing+ _ -> Nothing+ in mapMaybe f . zip [0 ..] . ug_ugens
Sound/Sc3/Ugen/Graph/Reconstruct.hs view
@@ -14,130 +14,137 @@ -- | Generate label for 'Graph.From_Port' from_port_label :: Char -> Graph.From_Port -> String from_port_label jn fp =- case fp of- Graph.From_Port_C n -> printf "c_%d" n- Graph.From_Port_K n _ -> printf "k_%d" n- Graph.From_Port_U n Nothing -> printf "u_%d" n- Graph.From_Port_U n (Just i) -> printf "u_%d%co_%d" n jn i+ case fp of+ Graph.From_Port_C n -> printf "c_%d" n+ Graph.From_Port_K n _ -> printf "k_%d" n+ Graph.From_Port_U n Nothing -> printf "u_%d" n+ Graph.From_Port_U n (Just i) -> printf "u_%d%co_%d" n jn i -- | Any name that does not begin with a letter is considered an operator. is_operator_name :: String -> Bool is_operator_name nm =- case nm of- c:_ -> not (isLetter c)- _ -> False+ case nm of+ c : _ -> not (isLetter c)+ _ -> False parenthesise_operator :: String -> String parenthesise_operator nm =- if is_operator_name nm+ if is_operator_name nm then printf "(%s)" nm else nm -reconstruct_graph :: Graph.U_Graph -> ([String],String)+reconstruct_graph :: Graph.U_Graph -> ([String], String) reconstruct_graph g =- let (Graph.U_Graph _ c k u) = g- ls = concat [map reconstruct_c_str (Graph.u_node_sort c)- ,map reconstruct_k_str (Graph.u_node_sort k)- ,concatMap reconstruct_u_str u]- in (filter (not . null) ls,reconstruct_mrg_str u)+ let (Graph.U_Graph _ c k u) = g+ ls =+ concat+ [ map reconstruct_c_str (Graph.u_node_sort c)+ , map reconstruct_k_str (Graph.u_node_sort k)+ , concatMap reconstruct_u_str u+ ]+ in (filter (not . null) ls, reconstruct_mrg_str u) reconstruct_graph_module :: String -> Graph.U_Graph -> [String] reconstruct_graph_module nm gr =- let imp = ["import Sound.Sc3 {- hsc3 -}"- ,"import Sound.Sc3.Common.Base {- hsc3 -}"- ,"import Sound.Sc3.Util.Plain {- hsc3 -}"]- (b0:bnd,res) = reconstruct_graph gr- hs = (" let " ++ b0) : map (" " ++ ) bnd ++ [" in " ++ res]- pre = [nm ++ " :: Ugen",nm ++ " ="]- in (imp ++ pre ++ hs)+ let imp =+ [ "import Sound.Sc3 {- hsc3 -}"+ , "import Sound.Sc3.Common.Base {- hsc3 -}"+ , "import Sound.Sc3.Ugen.Plain {- hsc3 -}"+ ]+ in case reconstruct_graph gr of+ (b0 : bnd, res) ->+ let hs = (" let " ++ b0) : map (" " ++) bnd ++ [" in " ++ res]+ pre = [nm ++ " :: Ugen", nm ++ " ="]+ in (imp ++ pre ++ hs)+ _ -> error "reconstruct_graph_module" {- | Generate a reconstruction of a 'Graph'. -> import Sound.Sc3 {- hsc3 -}-> import Sound.Sc3.Util.Graph {- hsc3 -}-> import Sound.Sc3.Util.Graph.Reconstruct {- hsc3 -}+> import Sound.Sc3+> import Sound.Sc3.Ugen.Graph+> import Sound.Sc3.Ugen.Graph.Reconstruct -> let k = control KR "bus" 0-> let o = sinOsc AR 440 0 + whiteNoise 'α' AR+> let k = control kr "bus" 0+> let o = sinOsc ar 440 0 + whiteNoiseId 'α' ar > let u = out k (pan2 (o * 0.1) 0 1)-> let m = mrg [u,out 1 (impulse AR 1 0 * 0.1)]+> let m = mrg [u,out 1 (impulse ar 1 0 * 0.1)] > putStrLn (reconstruct_graph_str "anon" (ugen_to_graph m))- -} reconstruct_graph_str :: String -> Graph.U_Graph -> String reconstruct_graph_str nm = unlines . reconstruct_graph_module nm reconstruct_c_str :: Graph.U_Node -> String reconstruct_c_str u =- let l = Graph.u_node_label u- c = Graph.u_node_c_value u- in printf "%s = constant (%f::Sample)" l c+ let l = Graph.u_node_label u+ c = Graph.u_node_c_value u+ in printf "%s = constant (%f::Sample)" l c reconstruct_c_ugen :: Graph.U_Node -> Types.Ugen reconstruct_c_ugen u = Types.constant (Graph.u_node_c_value u) -- | Discards index.-reconstruct_k_rnd :: Graph.U_Node -> (Rate.Rate,String,Types.Sample)+reconstruct_k_rnd :: Graph.U_Node -> (Rate.Rate, String, Types.Sample) reconstruct_k_rnd u =- let r = Graph.u_node_k_rate u- n = Graph.u_node_k_name u- d = Graph.u_node_k_default u- in (r,n,d)+ let r = Graph.u_node_k_rate u+ n = Graph.u_node_k_name u+ d = Graph.u_node_k_default u+ in (r, n, d) reconstruct_k_str :: Graph.U_Node -> String reconstruct_k_str u =- let l = Graph.u_node_label u- (r,n,d) = reconstruct_k_rnd u- in printf "%s = control %s \"%s\" %f" l (show r) n d+ let l = Graph.u_node_label u+ (r, n, d) = reconstruct_k_rnd u+ in printf "%s = control %s \"%s\" %f" l (show r) n d reconstruct_k_ugen :: Graph.U_Node -> Types.Ugen reconstruct_k_ugen u =- let (r,n,d) = reconstruct_k_rnd u- in Util.control_f64 r Nothing n d+ let (r, n, d) = reconstruct_k_rnd u+ in Util.control_f64 r Nothing n d -ugen_qname :: String -> Types.Special -> (String,String)+ugen_qname :: String -> Types.Special -> (String, String) ugen_qname nm (Types.Special n) =- case nm of- "UnaryOpUGen" -> ("uop CS",Operator.unaryName n)- "BinaryOpUGen" -> ("binop CS",Operator.binaryName n)- _ -> ("ugen",nm)+ case nm of+ "UnaryOpUGen" -> ("uop Cs", Operator.unaryName n)+ "BinaryOpUGen" -> ("binop Cs", Operator.binaryName n)+ _ -> ("ugen", nm) reconstruct_mce_str :: Graph.U_Node -> String reconstruct_mce_str u =- let o = length (Graph.u_node_u_outputs u)- l = Graph.u_node_label u- p = map (printf "%s_o_%d" l) [0 .. o - 1]- p' = intercalate "," p- in if o <= 1- then ""- else printf "[%s] = mceChannels %s" p' l+ let o = length (Graph.u_node_u_outputs u)+ l = Graph.u_node_label u+ p = map (printf "%s_o_%d" l) [0 .. o - 1]+ p' = intercalate "," p+ in if o <= 1+ then ""+ else printf "[%s] = mceChannels %s" p' l reconstruct_u_str :: Graph.U_Node -> [String] reconstruct_u_str u =- let l = Graph.u_node_label u- r = Graph.u_node_u_rate u- i = Graph.u_node_u_inputs u- i_s = unwords (map (from_port_label '_') i)- i_l = intercalate "," (map (from_port_label '_') i)- s = Graph.u_node_u_special u- (q,n) = ugen_qname (Graph.u_node_u_name u) s- z = Graph.u_node_id u- o = length (Graph.u_node_u_outputs u)- u_s = printf "%s = ugen \"%s\" %s [%s] %d" l n (show r) i_l o- nd_s = let t = "%s = nondet \"%s\" (UId %d) %s [%s] %d"- in printf t l n z (show r) i_l o- c = case q of- "ugen" -> if Graph.u_node_u_ugenid u == Types.NoId then u_s else nd_s- _ -> printf "%s = %s \"%s\" %s %s" l q n (show r) i_s- m = reconstruct_mce_str u- in if Graph.u_node_is_implicit_control u- then []- else if null m then [c] else [c,m]+ let l = Graph.u_node_label u+ r = Graph.u_node_u_rate u+ i = Graph.u_node_u_inputs u+ i_s = unwords (map (from_port_label '_') i)+ i_l = intercalate "," (map (from_port_label '_') i)+ s = Graph.u_node_u_special u+ (q, n) = ugen_qname (Graph.u_node_u_name u) s+ z = Graph.u_node_id u+ o = length (Graph.u_node_u_outputs u)+ u_s = printf "%s = ugen \"%s\" %s [%s] %d" l n (show r) i_l o+ nd_s =+ let t = "%s = nondet \"%s\" (Uid %d) %s [%s] %d"+ in printf t l n z (show r) i_l o+ c = case q of+ "ugen" -> if Graph.u_node_u_ugenid u == Types.NoId then u_s else nd_s+ _ -> printf "%s = %s \"%s\" %s %s" l q n (show r) i_s+ m = reconstruct_mce_str u+ in if Graph.u_node_is_implicit_control u+ then []+ else if null m then [c] else [c, m] reconstruct_mrg_str :: [Graph.U_Node] -> String reconstruct_mrg_str u =- let zero_out n = not (Graph.u_node_is_implicit_control n) && null (Graph.u_node_u_outputs n)- in case map Graph.u_node_label (filter zero_out u) of- [] -> error "reconstruct_mrg_str: nil input?"- [o] -> printf "%s" o- o -> printf "mrg [%s]" (intercalate "," o)+ let zero_out n = not (Graph.u_node_is_implicit_control n) && null (Graph.u_node_u_outputs n)+ in case map Graph.u_node_label (filter zero_out u) of+ [] -> error "reconstruct_mrg_str: nil input?"+ [o] -> printf "%s" o+ o -> printf "mrg [%s]" (intercalate "," o)
Sound/Sc3/Ugen/Graph/Transform.hs view
@@ -10,69 +10,74 @@ -- * Lift constants --- | Transform 'U_Node_C' to 'U_Node_K', 'id' for other 'U_Node' types.------ > let k = U_Node_K 8 ControlRate Nothing "k_8" 0.1 K_ControlRate Nothing--- > node_k_eq k (snd (constant_to_control 8 (U_Node_C 0 0.1)))-constant_to_control :: Uid.Id -> U_Node -> (Uid.Id,U_Node)+{- | Transform 'U_Node_C' to 'U_Node_K', 'id' for other 'U_Node' types.++> let k = U_Node_K 8 ControlRate Nothing "k_8" 0.1 K_ControlRate Nothing+> node_k_eq k (snd (constant_to_control 8 (U_Node_C 0 0.1)))+-}+constant_to_control :: Uid.Id -> U_Node -> (Uid.Id, U_Node) constant_to_control z n =- case n of- U_Node_C _ k -> (z + 1,U_Node_K z Rate.ControlRate Nothing ("k_" ++ show z) k Rate.K_ControlRate Nothing)- _ -> (z,n)+ case n of+ U_Node_C _ k -> (z + 1, U_Node_K z Rate.ControlRate Nothing ("k_" ++ show z) k Rate.K_ControlRate Nothing)+ _ -> (z, n) -- | If the 'From_Port' is a /constant/ generate a /control/ 'U_Node', else retain 'From_Port'.-c_lift_from_port :: U_Graph -> Uid.Id -> From_Port -> (Uid.Id,Either From_Port U_Node)+c_lift_from_port :: U_Graph -> Uid.Id -> From_Port -> (Uid.Id, Either From_Port U_Node) c_lift_from_port g z fp =- case fp of- From_Port_C _ ->- let n = ug_from_port_node_err g fp- (z',n') = constant_to_control z n- in (z',Right n')- _ -> (z,Left fp)+ case fp of+ From_Port_C _ ->+ let n = ug_from_port_node_err g fp+ (z', n') = constant_to_control z n+ in (z', Right n')+ _ -> (z, Left fp) --- | Lift a set of 'U_NodeU' /inputs/ from constants to controls. The--- result triple gives the incremented 'Uid.Id', the transformed--- 'From_Port' list, and the list of newly minted control 'U_Node's.-c_lift_inputs :: U_Graph -> Uid.Id -> [From_Port] -> (Uid.Id,[From_Port],[U_Node])+{- | Lift a set of 'U_NodeU' /inputs/ from constants to controls. The+result triple gives the incremented 'Uid.Id', the transformed+'From_Port' list, and the list of newly minted control 'U_Node's.+-}+c_lift_inputs :: U_Graph -> Uid.Id -> [From_Port] -> (Uid.Id, [From_Port], [U_Node]) c_lift_inputs g z i =- let (z',r) = mapAccumL (c_lift_from_port g) z i- f e = case e of- Left fp -> fp- Right n -> u_node_from_port n- r' = map f r- in (z',r',rights r)+ let (z', r) = mapAccumL (c_lift_from_port g) z i+ f e = case e of+ Left fp -> fp+ Right n -> u_node_from_port n+ r' = map f r+ in (z', r', rights r) -- | Lift inputs at 'U_Node_U' as required.-c_lift_ugen :: U_Graph -> Uid.Id -> U_Node -> (Uid.Id,U_Node,[U_Node])+c_lift_ugen :: U_Graph -> Uid.Id -> U_Node -> (Uid.Id, U_Node, [U_Node]) c_lift_ugen g z n =- let i = u_node_u_inputs n- (z',i',k) = c_lift_inputs g z i- in (z',n {u_node_u_inputs = i'},k)+ case n of+ U_Node_U {} ->+ let i = u_node_u_inputs n+ (z', i', k) = c_lift_inputs g z i+ in (z', n {u_node_u_inputs = i'}, k)+ _ -> error "c_lift_ugen" -- | 'c_lift_ugen' at list of 'U_Node_U'.-c_lift_ugens :: U_Graph -> Uid.Id -> [U_Node] -> (Uid.Id,[U_Node],[U_Node])-c_lift_ugens g =- let recur (k,r) z u =- case u of- [] -> (z,k,reverse r)- n:u' -> let (z',n',k') = c_lift_ugen g z n- in recur (k++k',n':r) z' u'- in recur ([],[])+c_lift_ugens :: U_Graph -> Uid.Id -> [U_Node] -> (Uid.Id, [U_Node], [U_Node])+c_lift_ugens g =+ let recur (k, r) z u =+ case u of+ [] -> (z, k, reverse r)+ n : u' ->+ let (z', n', k') = c_lift_ugen g z n+ in recur (k ++ k', n' : r) z' u'+ in recur ([], []) -{-| Lift constants to controls.+{- | Lift constants to controls. -> import Sound.Sc3 {- hsc3 -}-> import Sound.Sc3.Ugen.Dot {- hsc3-dot -}+> import Sound.Sc3 {\- hsc3 -\}+> import Sound.Sc3.Ugen.Dot {\- hsc3-dot -\} > let u = out 0 (sinOsc AR 440 0 * 0.1) > let g = ugen_to_graph u > draw g > draw (lift_constants g)- -} lift_constants :: U_Graph -> U_Graph lift_constants g =- let (U_Graph z _ k u) = ug_remove_implicit g- (z',k',u') = c_lift_ugens g z u- g' = U_Graph z' [] (nubBy u_node_k_eq (k ++ k')) u'- in ug_add_implicit g'+ let (U_Graph z _ k u) = ug_remove_implicit g+ (z', k', u') = c_lift_ugens g z u+ g' = U_Graph z' [] (nubBy u_node_k_eq (k ++ k')) u'+ in ug_add_implicit g'
Sound/Sc3/Ugen/Help/Graph.hs view
@@ -13,71 +13,75 @@ -- | The SC3 /default/ instrument 'Ugen' graph. default_ugen_graph :: Ugen default_ugen_graph =- let f = control kr "freq" 440- a = control kr "amp" 0.1- p = control kr "pan" 0- g = control kr "gate" 1- o = control kr "out" 0- e = linen g 0.01 0.7 0.3 RemoveSynth- f3 = mce [f,f + randId 'α' (-0.4) 0,f + randId 'β' 0 0.4]- l = xLine kr (randId 'γ' 4000 5000) (randId 'δ' 2500 3200) 1 DoNothing- z = lpf (mix (varSaw ar f3 0 0.3 * 0.3)) l * e- in out o (pan2 z p a)+ let f = control kr "freq" 440+ a = control kr "amp" 0.1+ p = control kr "pan" 0+ g = control kr "gate" 1+ o = control kr "out" 0+ e = linen g 0.01 0.7 0.3 RemoveSynth+ f3 = mce [f, f + randId 'α' (-0.4) 0, f + randId 'β' 0 0.4]+ l = xLine kr (randId 'γ' 4000 5000) (randId 'δ' 2500 3200) 1 DoNothing+ z = lpf (mix (varSaw ar f3 0 0.3 * 0.3)) l * e+ in out o (pan2 z p a) -- | A /Gabor/ grain, envelope is by 'lfGauss'. gabor_grain_ugen_graph :: Ugen gabor_grain_ugen_graph =- let o = control ir "out" 0- f = control ir "freq" 440- d = control ir "sustain" 1- l = control ir "pan" 0- a = control ir "amp" 0.1- w = control ir "width" 0.25- e = lfGauss ar d w 0 NoLoop RemoveSynth- s = fSinOsc ar f (0.5 * pi) * e- in offsetOut o (pan2 s l a)+ let o = control ir "out" 0+ f = control ir "freq" 440+ d = control ir "sustain" 1+ l = control ir "pan" 0+ a = control ir "amp" 0.1+ w = control ir "width" 0.25+ e = lfGauss ar d w 0 NoLoop RemoveSynth+ s = fSinOsc ar f (0.5 * pi) * e+ in offsetOut o (pan2 s l a) -- | A /sine/ grain, envelope is by 'envGen' of 'envSine'. sine_grain_ugen_graph :: Ugen sine_grain_ugen_graph =- let o = control ir "out" 0- f = control ir "freq" 440- d = control ir "sustain" 1- l = control ir "pan" 0- a = control ir "amp" 0.1- w = control ir "width" 0.25- e = envGen ar 1 1 0 1 RemoveSynth (envSine (d * w) 1)- s = fSinOsc ar f (0.5 * pi) * e- in offsetOut o (pan2 s l a)+ let o = control ir "out" 0+ f = control ir "freq" 440+ d = control ir "sustain" 1+ l = control ir "pan" 0+ a = control ir "amp" 0.1+ w = control ir "width" 0.25+ e = envGen ar 1 1 0 1 RemoveSynth (envSine (d * w) 1)+ s = fSinOsc ar f (0.5 * pi) * e+ in offsetOut o (pan2 s l a) --- | Trivial file playback instrument.------ If /use_gate/ is 'True' there is a /gate/ parameter and the synth--- ends either when the sound file ends or the gate closes, else there--- is a /sustain/ parameter to indicate the duration. In both cases a--- linear envelope with a decay time of /decay/ is applied.------ The /rdelay/ parameter sets the maximum pre-delay time (in--- seconds), each instance is randomly pre-delayed between zero and--- the indicated time. The /ramplitude/ parameter sets the maximum--- amplitude offset of the /amp/ parameter, each instance is randomly--- amplified between zero and the indicated value.+{- | Trivial file playback instrument.++If /use_gate/ is 'True' there is a /gate/ parameter and the synth+ends either when the sound file ends or the gate closes, else there+is a /sustain/ parameter to indicate the duration. In both cases a+linear envelope with a decay time of /decay/ is applied.++The /rdelay/ parameter sets the maximum pre-delay time (in+seconds), each instance is randomly pre-delayed between zero and+the indicated time. The /ramplitude/ parameter sets the maximum+amplitude offset of the /amp/ parameter, each instance is randomly+amplified between zero and the indicated value.+-} default_sampler_ugen_graph :: Bool -> Ugen default_sampler_ugen_graph use_gate =- let b = control kr "bufnum" 0- l = control kr "pan" 0- a = control kr "amp" 0.1- r = control kr "rate" 1- m = control kr "rdelay" 0- v = control kr "ramplitude" 0- w = control kr "attack" 0- y = control kr "decay" 0.5- r' = bufRateScale kr b * r- p = playBuf 1 ar b r' 1 0 NoLoop RemoveSynth- e = if use_gate- then let g = control kr "gate" 1- in envGen kr g 1 0 1 RemoveSynth (envAsr w 1 y EnvSin)- else let s = control kr "sustain" 1- in envGen kr 1 1 0 1 RemoveSynth (envLinen w s y 1)- d = delayC (p * e) m (randId 'α' 0 m)- in out 0 (pan2 d l (a + randId 'β' 0 v))+ let b = control kr "bufnum" 0+ l = control kr "pan" 0+ a = control kr "amp" 0.1+ r = control kr "rate" 1+ m = control kr "rdelay" 0+ v = control kr "ramplitude" 0+ w = control kr "attack" 0+ y = control kr "decay" 0.5+ r' = bufRateScale kr b * r+ p = playBuf 1 ar b r' 1 0 NoLoop RemoveSynth+ e =+ if use_gate+ then+ let g = control kr "gate" 1+ in envGen kr g 1 0 1 RemoveSynth (envAsr w 1 y EnvSin)+ else+ let s = control kr "sustain" 1+ in envGen kr 1 1 0 1 RemoveSynth (envLinen w s y 1)+ d = delayC (p * e) m (randId 'α' 0 m)+ in out 0 (pan2 d l (a + randId 'β' 0 v))
Sound/Sc3/Ugen/Hs.hs view
@@ -3,18 +3,21 @@ import Data.List {- base -} +import qualified Safe {- safe -} import qualified System.Random as R {- random -} import Sound.Sc3.Common.Base import Sound.Sc3.Common.Math import qualified Sound.Sc3.Common.Math.Filter as Filter --- | F = function, ST = state-type F_ST0 st o = st -> (o,st)-type F_ST1 st i o = (i,st) -> (o,st)+-- | F = function, St = state+type F_St0 st o = st -> (o, st) +type F_St1 st i o = (i, st) -> (o, st)+ -- | U = uniform type F_U2 n = n -> n -> n+ type F_U3 n = n -> n -> n -> n type F_U4 n = n -> n -> n -> n -> n type F_U5 n = n -> n -> n -> n -> n -> n@@ -24,12 +27,13 @@ type F_U9 n = n -> n -> n -> n -> n -> n -> n -> n -> n -> n -- | T = tuple (see Base for T2-T4)-type T5 n = (n,n,n,n,n)-type T6 n = (n,n,n,n,n,n)-type T7 n = (n,n,n,n,n,n,n)-type T8 n = (n,n,n,n,n,n,n,n)-type T9 n = (n,n,n,n,n,n,n,n,n)+type T5 n = (n, n, n, n, n) +type T6 n = (n, n, n, n, n, n)+type T7 n = (n, n, n, n, n, n, n)+type T8 n = (n, n, n, n, n, n, n, n)+type T9 n = (n, n, n, n, n, n, n, n, n)+ -- | avg = average avg2 :: Fractional n => F_U2 n avg2 p q = (p + q) / 2@@ -46,130 +50,144 @@ avg9 :: Fractional n => F_U9 n avg9 p q r s t u v w x = (p + q + r + s + t + u + v + w + x) / 9 --- | fir = finite impulse response------ > l_apply_f_st1 (fir1 (\x z1 -> (x + z1) / 2)) 0 [0 .. 5] == [0.0,0.5,1.5,2.5,3.5,4.5]-fir1 :: F_U2 n -> F_ST1 n n n-fir1 f (n,z0) = (f n z0,n)+{- | fir = finite impulse response --- | fir = finite impulse response------ > l_apply_f_st1 (fir2 (\x x1 x2 -> (x + x1 + x2) / 2)) (0,0) [0 .. 5] == [0.0,0.5,1.5,3.0,4.5,6.0]-fir2 :: F_U3 n -> F_ST1 (T2 n) n n-fir2 f (n,(z1,z0)) = (f n z0 z1,(z0,n))+>>> l_apply_f_st1 (fir1 (\x z1 -> (x + z1) / 2)) 0 [0 .. 5]+[0.0,0.5,1.5,2.5,3.5,4.5]+-}+fir1 :: F_U2 n -> F_St1 n n n+fir1 f (n, z0) = (f n z0, n) -fir3 :: F_U4 n -> F_ST1 (T3 n) n n-fir3 f (n,(z2,z1,z0)) = (f n z0 z1 z2,(z1,z0,n))+{- | fir = finite impulse response -fir4 :: F_U5 n -> F_ST1 (T4 n) n n-fir4 f (n,(z3,z2,z1,z0)) = (f n z0 z1 z2 z3,(z2,z1,z0,n))+>>> l_apply_f_st1 (fir2 (\x x1 x2 -> (x + x1 + x2) / 2)) (0,0) [0 .. 5]+[0.0,0.5,1.5,3.0,4.5,6.0]+-}+fir2 :: F_U3 n -> F_St1 (T2 n) n n+fir2 f (n, (z1, z0)) = (f n z0 z1, (z0, n)) -fir8 :: F_U9 n -> F_ST1 (T8 n) n n-fir8 f (n,(z7,z6,z5,z4,z3,z2,z1,z0)) = (f n z0 z1 z2 z3 z4 z5 z6 z7,(z6,z5,z4,z4,z2,z1,z0,n))+fir3 :: F_U4 n -> F_St1 (T3 n) n n+fir3 f (n, (z2, z1, z0)) = (f n z0 z1 z2, (z1, z0, n)) --- | iir = infinite impulse response------ > l_apply_f_st1 (iir1 (\x y1 -> x + y1)) 0 (replicate 10 1) == [1,2,3,4,5,6,7,8,9,10]-iir1 :: F_U2 n -> F_ST1 n n n-iir1 f (n,y0) = let r = f n y0 in (r,r)+fir4 :: F_U5 n -> F_St1 (T4 n) n n+fir4 f (n, (z3, z2, z1, z0)) = (f n z0 z1 z2 z3, (z2, z1, z0, n)) --- > l_apply_f_st1 (iir2 (\x y1 y2 -> x + y1 + y2)) (0,0) (replicate 10 1) == [1,2,4,7,12,20,33,54,88,143]--- > map (+1) [0+0,1+0,2+1,4+2,7+4,12+7,20+12,33+20,54+33,88+54] == [1,2,4,7,12,20,33,54,88,143] -- https://oeis.org/A000071-iir2 :: F_U3 n -> F_ST1 (T2 n) n n-iir2 f (n,(y1,y0)) = let r = f n y0 y1 in (r,(y0,r))+fir8 :: F_U9 n -> F_St1 (T8 n) n n+fir8 f (n, (z7, z6, z5, z4, z3, z2, z1, z0)) = (f n z0 z1 z2 z3 z4 z5 z6 z7, (z6, z5, z4, z4, z2, z1, z0, n)) +{- | iir = infinite impulse response++>> l_apply_f_st1 (iir1 (\x y1 -> x + y1)) 0 (replicate 10 1)+[1,2,3,4,5,6,7,8,9,10]+-}+iir1 :: F_U2 n -> F_St1 n n n+iir1 f (n, y0) = let r = f n y0 in (r, r)++{- | Two place iir++>>> l_apply_f_st1 (iir2 (\x y1 y2 -> x + y1 + y2)) (0,0) (replicate 10 1)+[1,2,4,7,12,20,33,54,88,143]++>>> map (+1) [0+0,1+0,2+1,4+2,7+4,12+7,20+12,33+20,54+33,88+54] -- https://oeis.org/A000071+[1,2,4,7,12,20,33,54,88,143]+-}+iir2 :: F_U3 n -> F_St1 (T2 n) n n+iir2 f (n, (y1, y0)) = let r = f n y0 y1 in (r, (y0, r))+ -- | ff = feed-forward, fb = feed-back-iir2_ff_fb :: (n -> n -> n -> T2 n) -> F_ST1 (T2 n) n n-iir2_ff_fb f (n,(y1,y0)) = let (r,y0') = f n y0 y1 in (r,(y0,y0'))+iir2_ff_fb :: (n -> n -> n -> T2 n) -> F_St1 (T2 n) n n+iir2_ff_fb f (n, (y1, y0)) = let (r, y0') = f n y0 y1 in (r, (y0, y0')) -biquad :: F_U5 n -> F_ST1 (T4 n) n n-biquad f (n,(x1,x0,y1,y0)) = let r = f n x0 x1 y0 y1 in (r,(x0,n,y0,r))+biquad :: F_U5 n -> F_St1 (T4 n) n n+biquad f (n, (x1, x0, y1, y0)) = let r = f n x0 x1 y0 y1 in (r, (x0, n, y0, r)) -- | sos = second order section sos_f :: Num n => T5 n -> F_U5 n-sos_f (a0,a1,a2,b1,b2) x x1 x2 y1 y2 = a0*x + a1*x1 + a2*x2 - b1*y1 - b2*y2+sos_f (a0, a1, a2, b1, b2) x x1 x2 y1 y2 = a0 * x + a1 * x1 + a2 * x2 - b1 * y1 - b2 * y2 -sos :: Num n => T5 n -> F_ST1 (T4 n) n n+sos :: Num n => T5 n -> F_St1 (T4 n) n n sos p = biquad (sos_f p) -- | hp = high pass-hpz1 :: Fractional n => F_ST1 n n n+hpz1 :: Fractional n => F_St1 n n n hpz1 = fir1 (\n z0 -> 0.5 * (n - z0)) -hpz2 :: Fractional n => F_ST1 (T2 n) n n+hpz2 :: Fractional n => F_St1 (T2 n) n n hpz2 = fir2 (\n z0 z1 -> 0.25 * (n - (2 * z0) + z1)) -- | lp = low pass-lpz1 :: Fractional n => F_ST1 n n n+lpz1 :: Fractional n => F_St1 n n n lpz1 = fir1 avg2 -lpz2 :: Fractional n => F_ST1 (T2 n) n n+lpz2 :: Fractional n => F_St1 (T2 n) n n lpz2 = fir2 (\n z0 z1 -> 0.25 * (n + (2 * z0) + z1)) -- | bp = band pass-bpz2 :: Fractional n => F_ST1 (T2 n) n n+bpz2 :: Fractional n => F_St1 (T2 n) n n bpz2 = fir2 (\n _z0 z1 -> 0.5 * (n - z1)) -- | br = band reject-brz2 :: Fractional n => F_ST1 (T2 n) n n+brz2 :: Fractional n => F_St1 (T2 n) n n brz2 = fir2 (\n _z0 z1 -> 0.5 * (n + z1)) -- | mavg = moving average-mavg5 :: Fractional n => F_ST1 (T4 n) n n+mavg5 :: Fractional n => F_St1 (T4 n) n n mavg5 = fir4 avg5 -mavg9 :: Fractional n => F_ST1 (T8 n) n n+mavg9 :: Fractional n => F_St1 (T8 n) n n mavg9 = fir8 avg9 --- | Sample rate (SR) to radians per sample (RPS).------ > sr_to_rps 44100 == 0.00014247585730565955+{- | Sample rate (SR) to radians per sample (RPS).++>>> sr_to_rps 44100 == 0.00014247585730565955+True+-} sr_to_rps :: Floating n => n -> n sr_to_rps sr = two_pi / sr -- | resonz iir2_ff_fb function. param are for 'Filter.resonz_coef'. resonz_f :: Floating n => T3 n -> (n -> n -> n -> T2 n) resonz_f param x y1 y2 =- let (a0,b1,b2) = Filter.resonz_coef param- y0 = x + b1 * y1 + b2 * y2- in (a0 * (y0 - y2),y0)+ let (a0, b1, b2) = Filter.resonz_coef param+ y0 = x + b1 * y1 + b2 * y2+ in (a0 * (y0 - y2), y0) -- | ir = initialization rate-resonz_ir :: Floating n => T3 n -> F_ST1 (T2 n) n n+resonz_ir :: Floating n => T3 n -> F_St1 (T2 n) n n resonz_ir p = iir2_ff_fb (resonz_f p) -- | rlpf = resonant low pass filter rlpf_f :: Floating n => (n -> n -> n) -> T3 n -> F_U3 n rlpf_f max_f param x y1 y2 =- let (a0,b1,b2) = Filter.rlpf_coef max_f param- in a0 * x + b1 * y1 + b2 * y2+ let (a0, b1, b2) = Filter.rlpf_coef max_f param+ in a0 * x + b1 * y1 + b2 * y2 -rlpf_ir :: (Floating n, Ord n) => T3 n -> F_ST1 (T2 n) n n+rlpf_ir :: (Floating n, Ord n) => T3 n -> F_St1 (T2 n) n n rlpf_ir p = iir2 (rlpf_f max p) -bw_hpf_ir :: Floating n => T2 n -> F_ST1 (T4 n) n n-bw_hpf_ir (sample_rate,f) = sos (Filter.bw_lpf_or_hpf_coef True sample_rate f)+bw_hpf_ir :: Floating n => T2 n -> F_St1 (T4 n) n n+bw_hpf_ir (sample_rate, f) = sos (Filter.bw_lpf_or_hpf_coef True sample_rate f) -bw_lpf_ir :: Floating n => T2 n -> F_ST1 (T4 n) n n-bw_lpf_ir (sample_rate,f) = sos (Filter.bw_lpf_or_hpf_coef False sample_rate f)+bw_lpf_ir :: Floating n => T2 n -> F_St1 (T4 n) n n+bw_lpf_ir (sample_rate, f) = sos (Filter.bw_lpf_or_hpf_coef False sample_rate f) -white_noise :: (R.RandomGen g, Fractional n, R.Random n) => F_ST0 g n-white_noise = R.randomR (-1.0,1.0)+white_noise :: (R.RandomGen g, Fractional n, R.Random n) => F_St0 g n+white_noise = R.randomR (-1.0, 1.0) brown_noise_f :: (Fractional n, Ord n) => n -> n -> n brown_noise_f x y1 =- let z = x + y1- in if z > 1.0 then 2.0 - z else if z < (-1.0) then (-2.0) - z else z+ let z = x + y1+ in if z > 1.0 then 2.0 - z else if z < (-1.0) then (-2.0) - z else z -brown_noise :: (R.RandomGen g, Fractional n, R.Random n, Ord n) => F_ST0 (g,n) n-brown_noise (g,y1) =- let (n,g') = white_noise g- r = brown_noise_f (n / 8.0) y1- in (r,(g',r))+brown_noise :: (R.RandomGen g, Fractional n, R.Random n, Ord n) => F_St0 (g, n) n+brown_noise (g, y1) =+ let (n, g') = white_noise g+ r = brown_noise_f (n / 8.0) y1+ in (r, (g', r)) -- | <http://musicdsp.org/files/pink.txt> pk_pinking_filter_f :: Fractional a => (a, a, a, a, a, a, a) -> a -> (a, (a, a, a, a, a, a, a))-pk_pinking_filter_f (b0,b1,b2,b3,b4,b5,b6) w =+pk_pinking_filter_f (b0, b1, b2, b3, b4, b5, b6) w = let b0' = 0.99886 * b0 + w * 0.0555179 b1' = 0.99332 * b1 + w * 0.0750759 b2' = 0.96900 * b2 + w * 0.1538520@@ -178,25 +196,26 @@ b5' = -0.7616 * b5 - w * 0.0168980 p = b0 + b1 + b2 + b3 + b4 + b5 + b6 + w * 0.5362 b6' = w * 0.115926- in (p,(b0',b1',b2',b3',b4',b5',b6'))+ in (p, (b0', b1', b2', b3', b4', b5', b6')) -- | <http://musicdsp.org/files/pink.txt> pk_pinking_filter_economy_f :: Fractional a => (a, a, a) -> a -> (a, (a, a, a))-pk_pinking_filter_economy_f (b0,b1,b2) w =+pk_pinking_filter_economy_f (b0, b1, b2) w = let b0' = 0.99765 * b0 + w * 0.0990460 b1' = 0.96300 * b1 + w * 0.2965164 b2' = 0.57000 * b2 + w * 1.0526913 p = b0 + b1 + b2 + w * 0.1848- in (p,(b0',b1',b2'))+ in (p, (b0', b1', b2')) -- | dt must not be zero. decay_f :: Floating a => a -> a -> a -> a -> a decay_f sr dt x y1 =- let b1 = exp (log 0.001 / (dt * sr))- in x + b1 * y1+ let b1 = exp (log 0.001 / (dt * sr))+ in x + b1 * y1 --- | Given time /dt/ in frames construct 'iir1' 'lag' function.--- dt must not be zero.+{- | Given time /dt/ in frames construct 'iir1' 'lag' function.+ dt must not be zero.+-} lag_f_frames :: Floating a => a -> a -> a -> a lag_f_frames dt x y1 = let b1 = exp (log 0.001 / dt) in x + b1 * (y1 - x) @@ -204,22 +223,22 @@ lag_f :: Floating a => a -> a -> a -> a -> a lag_f sr dt = lag_f_frames (dt * sr) -lag :: Floating t => t -> F_ST1 t (t,t) t-lag sr ((i,t),st) = let r = lag_f sr t i st in (r,r)+lag :: Floating t => t -> F_St1 t (t, t) t+lag sr ((i, t), st) = let r = lag_f sr t i st in (r, r) -slope :: Num t => t -> F_ST1 t t t+slope :: Num t => t -> F_St1 t t t slope sr = fir1 (\n z0 -> (n - z0) * sr) -latch :: F_ST1 t (t,Bool) t-latch ((n,b),y1) = let r = if b then n else y1 in (r,r)+latch :: F_St1 t (t, Bool) t+latch ((n, b), y1) = let r = if b then n else y1 in (r, r) -as_trig :: (Fractional t,Ord t) => F_ST1 t t Bool-as_trig (n,y1) = (y1 <= 0.0 && n > 0.0,n)+as_trig :: (Fractional t, Ord t) => F_St1 t t Bool+as_trig (n, y1) = (y1 <= 0.0 && n > 0.0, n) -phasor :: RealFrac t => F_ST1 t (Bool,t,t,t,t) t-phasor ((trig,rate,start,end,resetPos),ph) =- let r = if trig then resetPos else sc3_wrap start end (ph + rate)- in (ph,r)+phasor :: RealFrac t => F_St1 t (Bool, t, t, t, t) t+phasor ((trig, rate, start, end, resetPos), ph) =+ let r = if trig then resetPos else sc3_wrap (ph + rate) start end+ in (ph, r) -- > Sound.Sc3.Plot.plot_fn_r1_ln (\x -> mod_dif x 0 1) (0,4) mod_dif :: RealFrac a => a -> a -> a -> a@@ -237,24 +256,31 @@ in h - absDif d h -} --- | * LIST PROCESSING+-- | * List Processing+l_apply_f_st0 :: F_St0 st o -> st -> [o]+l_apply_f_st0 f st = let (r, st') = f st in r : l_apply_f_st0 f st' -l_apply_f_st0 :: F_ST0 st o -> st -> [o]-l_apply_f_st0 f st = let (r,st') = f st in r : l_apply_f_st0 f st'+{- | White noise --- > take 10 (l_white_noise 'α')+>>> take 4 (l_white_noise 'α')+[0.9687553280469108,0.808159221997721,-0.8993330152164296,0.23197278942699834]+-} l_white_noise :: (Enum e, Fractional n, R.Random n) => e -> [n] l_white_noise e = l_apply_f_st0 white_noise (R.mkStdGen (fromEnum e)) --- > take 10 (l_brown_noise 'α')+{- | Brown noise++>>> take 4 (l_brown_noise 'α')+[0.12109441600586385,0.22211431875557897,0.10969769185352526,0.13869429053190005]+-} l_brown_noise :: (Enum e, Fractional n, Ord n, R.Random n) => e -> [n]-l_brown_noise e = l_apply_f_st0 brown_noise (R.mkStdGen (fromEnum e),0.0)+l_brown_noise e = l_apply_f_st0 brown_noise (R.mkStdGen (fromEnum e), 0.0) -l_apply_f_st1 :: F_ST1 st i o -> st -> [i] -> [o]+l_apply_f_st1 :: F_St1 st i o -> st -> [i] -> [o] l_apply_f_st1 f st xs =- case xs of- [] -> []- x:xs' -> let (r,st') = f (x,st) in r : l_apply_f_st1 f st' xs'+ case xs of+ [] -> []+ x : xs' -> let (r, st') = f (x, st) in r : l_apply_f_st1 f st' xs' l_lag :: Floating t => t -> [t] -> [t] -> [t] l_lag sr i t = l_apply_f_st1 (lag sr) 0 (zip i t)@@ -262,17 +288,21 @@ l_slope :: Floating t => t -> [t] -> [t] l_slope sr = l_apply_f_st1 (slope sr) 0 --- > let rp = repeat--- > take 10 (l_phasor (rp False) (rp 1) (rp 0) (rp 4) (rp 0)) == [0,1,2,3,0,1,2,3,0,1]+{- | Phasor++>>> let rp = repeat+>>> take 10 (l_phasor (rp False) (rp 1) (rp 0) (rp 4) (rp 0))+[0.0,1.0,2.0,3.0,0.0,1.0,2.0,3.0,0.0,1.0]+-} l_phasor :: RealFrac n => [Bool] -> [n] -> [n] -> [n] -> [n] -> [n] l_phasor trig rate start end resetPos =- let i = zip5 trig rate start end resetPos- in l_apply_f_st1 phasor (head start) i+ let i = zip5 trig rate start end resetPos+ in l_apply_f_st1 phasor (Safe.headNote "l_phasor" start) i l_phasor_osc :: RealFrac n => n -> n -> [n] -> [n] l_phasor_osc sr k f =- let rp = repeat- in l_phasor (rp False) (map (cps_to_incr sr k) f) (rp 0) (rp k) (rp 0)+ let rp = repeat+ in l_phasor (rp False) (map (cps_to_incr sr k) f) (rp 0) (rp k) (rp 0) l_sin_osc :: (Floating n, RealFrac n) => n -> [n] -> [n] l_sin_osc sr f = map sin (l_phasor_osc sr two_pi f)@@ -284,37 +314,37 @@ l_hpz1 = l_apply_f_st1 hpz1 0 l_hpz2 :: Fractional n => [n] -> [n]-l_hpz2 = l_apply_f_st1 hpz2 (0,0)+l_hpz2 = l_apply_f_st1 hpz2 (0, 0) l_lpz1 :: Fractional n => [n] -> [n] l_lpz1 = l_apply_f_st1 lpz1 0 l_lpz2 :: Fractional n => [n] -> [n]-l_lpz2 = l_apply_f_st1 lpz2 (0,0)+l_lpz2 = l_apply_f_st1 lpz2 (0, 0) l_bpz2 :: Fractional n => [n] -> [n]-l_bpz2 = l_apply_f_st1 bpz2 (0,0)+l_bpz2 = l_apply_f_st1 bpz2 (0, 0) l_brz2 :: Fractional n => [n] -> [n]-l_brz2 = l_apply_f_st1 brz2 (0,0)+l_brz2 = l_apply_f_st1 brz2 (0, 0) l_bw_hpf :: Floating n => T2 n -> [n] -> [n]-l_bw_hpf p = l_apply_f_st1 (bw_hpf_ir p) (0,0,0,0)+l_bw_hpf p = l_apply_f_st1 (bw_hpf_ir p) (0, 0, 0, 0) l_bw_lpf :: Floating n => T2 n -> [n] -> [n]-l_bw_lpf p = l_apply_f_st1 (bw_lpf_ir p) (0,0,0,0)+l_bw_lpf p = l_apply_f_st1 (bw_lpf_ir p) (0, 0, 0, 0) l_resonz_ir :: Floating n => T3 n -> [n] -> [n]-l_resonz_ir p = l_apply_f_st1 (resonz_ir p) (0,0)+l_resonz_ir p = l_apply_f_st1 (resonz_ir p) (0, 0) l_rlpf_ir :: (Floating n, Ord n) => T3 n -> [n] -> [n]-l_rlpf_ir p = l_apply_f_st1 (rlpf_ir p) (0,0)+l_rlpf_ir p = l_apply_f_st1 (rlpf_ir p) (0, 0) l_mavg5 :: Fractional n => [n] -> [n]-l_mavg5 = l_apply_f_st1 mavg5 (0,0,0,0)+l_mavg5 = l_apply_f_st1 mavg5 (0, 0, 0, 0) l_mavg9 :: Fractional n => [n] -> [n]-l_mavg9 = l_apply_f_st1 mavg9 (0,0,0,0,0,0,0,0)+l_mavg9 = l_apply_f_st1 mavg9 (0, 0, 0, 0, 0, 0, 0, 0) {-
Sound/Sc3/Ugen/Math.hs view
@@ -16,15 +16,15 @@ ceil :: Ugen.Ugen -> Ugen.Ugen ceil = Operator.ceilingE --- | Midi note number and velocity data is in (0, 127). This maps (0,1) to (0,127), i.e. is it (* 127).-unitMidi :: Num t => t -> t-unitMidi = (*) 127+-- | Midi note number and velocity data is in (0, 127). This maps (0,1) to (0,100), i.e. is it (* 100).+unitMidi :: Num t => t -> t+unitMidi = (*) 100 -{- | midiCps of (0,1) scaled to (0,127).+{- | midiCps of (0,1) scaled to (0,100). To make control signal data uniform, all control signals are in (0, 1). -}-unitCps :: Operator.UnaryOp t => t -> t-unitCps = Operator.midiCps . (* 127)+unitCps :: Operator.UnaryOp t => t -> t+unitCps = Operator.midiCps . (* 100) -- | Optimised Ugen sum function. sum_opt :: [Ugen.Ugen] -> Ugen.Ugen
Sound/Sc3/Ugen/Math/Composite.hs view
@@ -10,19 +10,23 @@ ugen_if :: Num a => a -> a -> a -> a ugen_if p q r = (p * q) + ((1 - p) * r) --- | Separate input into integral and fractional parts.------ > ugen_integral_and_fractional_parts 1.5 == mce2 1 0.5+{- | Separate input into integral and fractional parts.++>>> ugen_integral_and_fractional_parts 1.5 == mce2 1 0.5+True+-} ugen_integral_and_fractional_parts :: Ugen -> Ugen ugen_integral_and_fractional_parts n =- let gt_eq_0 = let n' = floorE n in mce2 n' (n - n')- lt_0 = let n' = ceilingE n in mce2 n' (n - n')- in ugen_if (n `greater_than_or_equal_to` 0) gt_eq_0 lt_0+ let gt_eq_0 = let n' = floorE n in mce2 n' (n - n')+ lt_0 = let n' = ceilingE n in mce2 n' (n - n')+ in ugen_if (n `greater_than_or_equal_to` 0) gt_eq_0 lt_0 --- | Fractional midi into integral midi and cents detune.------ > ugen_fmidi_to_midi_detune 60.5 == mce2 60 50+{- | Fractional midi into integral midi and cents detune.++>>> ugen_fmidi_to_midi_detune 60.5 == mce2 60 50+True+-} ugen_fmidi_to_midi_detune :: Ugen -> Ugen ugen_fmidi_to_midi_detune mnn =- let (n,c) = unmce2 (ugen_integral_and_fractional_parts mnn)- in mce2 n (c * 100)+ let (n, c) = unmce2 (ugen_integral_and_fractional_parts mnn)+ in mce2 n (c * 100)
Sound/Sc3/Ugen/Mce.hs view
@@ -12,7 +12,7 @@ -- | Construct a list of Ugens by applying f to consecutive identifiers (from z) and indices (from 0). listFillId :: (Integral n, ID z, Enum z) => z -> Int -> (z -> n -> Ugen) -> [Ugen]-listFillId z n f = zipWith f [z..] [0 .. fromIntegral n - 1]+listFillId z n f = zipWith f [z ..] [0 .. fromIntegral n - 1] -- | Construct a list of Ugens by applying f at consecutive indices (from 0). listFillM :: (Uid m, Integral n) => Int -> (n -> m Ugen) -> m [Ugen]@@ -61,8 +61,8 @@ -- | Mix variant, sum to n channels. mixTo :: Int -> Ugen -> Ugen mixTo n u =- let xs = transpose (Split.chunksOf n (mceChannels u))- in mce (map Math.sum_opt xs)+ let xs = transpose (Split.chunksOf n (mceChannels u))+ in mce (map Math.sum_opt xs) -- | 'mix' of 'mceFill' mixFill :: Integral n => Int -> (n -> Ugen) -> Ugen
Sound/Sc3/Ugen/Mrg.hs view
@@ -1,8 +1,8 @@ -- | Multiple root graph (Mrg) module Sound.Sc3.Ugen.Mrg where -data Mrg t =- Mrg- {mrgLeft :: t- ,mrgRight :: t}+data Mrg t = Mrg+ { mrgLeft :: t+ , mrgRight :: t+ } deriving (Ord, Eq, Read, Show)
Sound/Sc3/Ugen/Name.hs view
@@ -22,58 +22,76 @@ is_lc_or_num c = isLower c || isDigit c -} --- | Find all Sc3 name edges. Edges occur at non lower-case letters.--- This rule is very simple but is coherent and predictable and works well for .hs names.+{- | Find all Sc3 name edges. Edges occur at non lower-case letters.+ This rule is very simple but is coherent and predictable and works well for .hs names.+-} sc3_name_edges_plain :: String -> [Bool] sc3_name_edges_plain = map (not . isLower) {- | Find non-initial Sc3 name edges. -> sc3_name_edges "SinOsc" == [False,False,False,True,False,False]-> sc3_name_edges "FFT" == [False,False,False]-> sc3_name_edges "DFM1" == [False,False,False,False]-> sc3_name_edges "PV_Add" == [False,False,False,True,False,False]-> sc3_name_edges "A2K" == [False,False,False]-> sc3_name_edges "Lag2UD" == [False,False,False,True,True,True]-> sc3_name_edges "PeakEQ" == [False,False,False,False,True,True]+>>> sc3_name_edges "SinOsc"+[False,False,False,True,False,False]++>>> sc3_name_edges "FFT"+[False,False,False]++>>> sc3_name_edges "DFM1"+[False,False,False,False]++>>> sc3_name_edges "PV_Add"+[False,False,False,True,False,False]++>>> sc3_name_edges "A2K"+[False,False,False]++>>> sc3_name_edges "Lag2UD"+[False,False,False,True,True,True]++>>> sc3_name_edges "PeakEQ"+[False,False,False,False,True,True] -} sc3_name_edges :: String -> [Bool] sc3_name_edges s =- let (p,q) = span (== True) (sc3_name_edges_plain s)+ let (p, q) = span (== True) (sc3_name_edges_plain s) n = length p in if n < 2 || null q- then replicate n False ++ q- else replicate (n - 1) False ++ [True] ++ q+ then replicate n False ++ q+ else replicate (n - 1) False ++ [True] ++ q {- | Convert from ScLang (class) name to Haskell (function) name. -> s = words "SinOsc LFSaw FFT PV_Add AllpassN BHiPass BinaryOpUGen HPZ1 RLPF TGrains DFM1 FBSineC A2K Lag2UD IIRFilter FMGrainB Pan2 PeakEQ RIRandN"-> l = words "sinOsc lfSaw fft pv_Add allpassN bHiPass binaryOpUGen hpz1 rlpf tGrains dfm1 fbSineC a2k lag2UD iirFilter fmGrainB pan2 peakEQ riRandN"-> map sc3_name_to_hs_name s == l+>>> let f = unwords . map sc3_name_to_hs_name . words+>>> f "SinOsc LFSaw FFT PV_Add AllpassN BHiPass BinaryOpUGen HPZ1 RLPF"+"sinOsc lfSaw fft pv_Add allpassN bHiPass binaryOpUGen hpz1 rlpf"++>>> f "TGrains DFM1 FBSineC A2K Lag2UD IIRFilter FMGrainB Pan2 PeakEQ RIRandN"+"tGrains dfm1 fbSineC a2k lag2UD iirFilter fmGrainB pan2 peakEQ riRandN" -} sc3_name_to_hs_name :: String -> String sc3_name_to_hs_name s =- let f (c,e) = if e then toUpper c else c- in zipWith (curry f) (map toLower s) (sc3_name_edges s)+ let f (c, e) = if e then toUpper c else c+ in zipWith (curry f) (map toLower s) (sc3_name_edges s) {- | Convert from Sc3 name to Lisp style name. -> s = words "SinOsc LFSaw FFT PV_Add AllpassN BHiPass BinaryOpUGen HPZ1 RLPF TGrains DFM1 BPeakEQ Pan2 RIRandN"-> l = words "sin-osc lf-saw fft pv-add allpass-n b-hi-pass binary-op-u-gen hpz1 rlpf t-grains dfm1 b-peak-e-q pan-2 ri-rand-n"-> map sc3_name_to_lisp_name s == l+>>> let f = unwords . map sc3_name_to_lisp_name . words+>>> f "SinOsc LFSaw FFT PV_Add AllpassN BHiPass BinaryOpUGen HPZ1 RLPF TGrains DFM1 BPeakEQ Pan2 RIRandN"+"sin-osc lf-saw fft pv-add allpass-n b-hi-pass binary-op-u-gen hpz1 rlpf t-grains dfm1 b-peak-e-q pan-2 ri-rand-n" -} sc3_name_to_lisp_name :: String -> String sc3_name_to_lisp_name s =- let f (c,e) = if e then ['-',c] else if c == '_' then [] else [c]- in concatMap f (zip (map toLower s) (sc3_name_edges s))+ let f (c, e) = if e then ['-', c] else if c == '_' then [] else [c]+ in concatMap f (zip (map toLower s) (sc3_name_edges s)) {- | Sc3 Ugen /names/ are given with rate suffixes if oscillators, without if filters. -> map sc3_ugen_name_sep (words "SinOsc.ar LPF *")+>>> map sc3_ugen_name_sep (words "SinOsc.ar LPF *")+[Just ("SinOsc",Just AudioRate),Just ("LPF",Nothing),Just ("*",Nothing)] -}-sc3_ugen_name_sep :: String -> Maybe (String,Maybe Rate)+sc3_ugen_name_sep :: String -> Maybe (String, Maybe Rate) sc3_ugen_name_sep u =- case string_split_at_char '.' u of- [nm,rt] -> Just (nm,rate_parse (map toUpper rt))- [nm] -> Just (nm,Nothing)- _ -> Nothing+ case string_split_at_char '.' u of+ [nm, rt] -> Just (nm, rate_parse (map toUpper rt))+ [nm] -> Just (nm, Nothing)+ _ -> Nothing
Sound/Sc3/Ugen/Optimise.hs view
@@ -12,7 +12,7 @@ -- | Constant form of 'rand' Ugen. c_rand :: Random a => Int -> a -> a -> a-c_rand z l r = fst (randomR (l,r) (mkStdGen z))+c_rand z l r = fst (randomR (l, r) (mkStdGen z)) -- | Constant form of 'iRand' Ugen. c_irand :: (Num b, RealFrac a, Random a) => Int -> a -> a -> b@@ -24,7 +24,7 @@ transformation for very large graphs which are being constructed and sent each time the graph is played. -> import Sound.Sc3.Ugen.Dot {- hsc3-dot -}+> import Sound.Sc3.Ugen.Dot {\- hsc3-dot -\} > let u = sinOsc ar (randId 'a' 220 440) 0 * 0.1 > draw (u + ugen_optimise_ir_rand u)@@ -38,24 +38,26 @@ Primitive InitialisationRate "Rand"- [Constant_U (Constant l ([],[]))- ,Constant_U (Constant r ([],[]))]+ [ Constant_U (Constant l ([], []))+ , Constant_U (Constant r ([], []))+ ] [InitialisationRate] _ (Uid z)- ([],[]) -> Constant_U (Constant (c_rand z l r) ([],[]))+ ([], []) -> Constant_U (Constant (c_rand z l r) ([], [])) Primitive InitialisationRate "IRand"- [Constant_U (Constant l ([],[]))- ,Constant_U (Constant r ([],[]))]+ [ Constant_U (Constant l ([], []))+ , Constant_U (Constant r ([], []))+ ] [InitialisationRate] _ (Uid z)- ([],[]) -> Constant_U (Constant (c_irand z l r) ([],[]))+ ([], []) -> Constant_U (Constant (c_irand z l r) ([], [])) _ -> u _ -> u- in ugenTraverse (const False) f+ in ugenTraverse (const False) f {- | Optimise 'Ugen' graph by re-writing binary operators with 'Constant' inputs. The standard graph constructors already do@@ -63,16 +65,31 @@ can re-introduce these sub-graphs, and the /Plain/ graph constructors are un-optimised. -> let u = constant-> u 5 * u 10 == u 50-> u 5 ==** u 5 == u 1-> u 5 >** u 4 == u 1-> u 5 <=** u 5 == u 1-> abs (u (-1)) == u 1-> u 5 / u 2 == u 2.5-> min (u 2) (u 3) == u 2-> max (u 1) (u 3) == u 3+>>> let u = constant+>>> u 5 * u 10 == u 50+True +>>> u 5 ==** u 5 == u 1+True++>>> u 5 >** u 4 == u 1+True++>>> u 5 <=** u 5 == u 1+True++>>> abs (u (-1)) == u 1+True++>>> u 5 / u 2 == u 2.5+True++>>> min (u 2) (u 3) == u 2+True++>>> max (u 1) (u 3) == u 3+True+ > let u = lfPulse ar (2 ** randId 'α' (-9) 1) 0 0.5 > let u' = ugen_optimise_ir_rand u > draw (mix (mce [u,u',ugen_optimise_const_operator u']))@@ -88,25 +105,26 @@ Primitive _ "BinaryOpUGen"- [Constant_U (Constant l ([],[]))- ,Constant_U (Constant r ([],[]))]+ [ Constant_U (Constant l ([], []))+ , Constant_U (Constant r ([], []))+ ] [_] (Special z) _- ([],[]) -> case binop_special_hs z of- Just fn -> Constant_U (Constant (fn l r) ([],[]))- _ -> u+ ([], []) -> case binop_special_hs z of+ Just fn -> Constant_U (Constant (fn l r) ([], []))+ _ -> u Primitive _ "UnaryOpUGen"- [Constant_U (Constant i ([],[]))]+ [Constant_U (Constant i ([], []))] [_] (Special z) _- ([],[]) -> case uop_special_hs z of- Just fn -> Constant_U (Constant (fn i) ([],[]))- _ -> u- Primitive _ "MulAdd" [i, m, a] [_] _ _ ([],[]) -> mulAddOptimised i m a+ ([], []) -> case uop_special_hs z of+ Just fn -> Constant_U (Constant (fn i) ([], []))+ _ -> u+ Primitive _ "MulAdd" [i, m, a] [_] _ _ ([], []) -> mulAddOptimised i m a _ -> u _ -> u in ugenTraverse (const False) f@@ -124,8 +142,8 @@ -} mulAddOptimised :: Ugen -> Ugen -> Ugen -> Ugen mulAddOptimised u m a =- case (is_constant_of 1 m,is_constant_of 0 a) of- (True,True) -> u- (False,True) -> u * m- (True,False) -> u + a- (False,False) -> Bindings.mulAdd u m a+ case (is_constant_of 1 m, is_constant_of 0 a) of+ (True, True) -> u+ (False, True) -> u * m+ (True, False) -> u + a+ (False, False) -> Bindings.mulAdd u m a
Sound/Sc3/Ugen/Plain.hs view
@@ -1,9 +1,10 @@ {- | Plain notation for SuperCollider Ugen graphs. > s = ugen "SinOsc" ar [440,0] 1-> m = binop CI "*" ar s 0.1+> m = binop Ci "*" ar s 0.1 > o = ugen "Out" ar [0,m] 0-> map ugen_concise_pp [s, m, o]+> map Sound.Sc3.Ugen.Pp.ugen_concise_pp [s, m, o]+["SinOsc","*","Out"] -} module Sound.Sc3.Ugen.Plain where @@ -19,24 +20,27 @@ {- | Construct unary operator. -> uop CI "Neg" ar 1+> uop Ci "Neg" ar 1 -} uop :: Case_Rule -> String -> Rate -> Ugen -> Ugen uop cr nm r p =- case unaryIndex cr nm of- Just s -> mk_plain r "UnaryOpUGen" [p] 1 (Special s) NoId- Nothing -> error "uop"+ case unaryIndex cr nm of+ Just s -> mk_plain r "UnaryOpUGen" [p] 1 (Special s) NoId+ Nothing -> error "uop" {- | Construct binary operator. -> binop CI "*" ar 1 2 == binop CI "Mul" ar 1 2-> binop CS "*" ar (ugen "SinOsc" ar [440,0] 1) 0.1 == sinOsc ar 440 0 * 0.1+>>> binop Ci "*" ar 1 2 == binop Ci "Mul" ar 1 2+True++> binop Cs "*" ar (ugen "SinOsc" ar [440,0] 1) 0.1 == sinOsc ar 440 0 * 0.1+True -} binop :: Case_Rule -> String -> Rate -> Ugen -> Ugen -> Ugen binop cr nm r p q =- case binaryIndex cr nm of- Just s -> mk_plain r "BinaryOpUGen" [p,q] 1 (Special s) NoId- Nothing -> error "binop"+ case binaryIndex cr nm of+ Just s -> mk_plain r "BinaryOpUGen" [p, q] 1 (Special s) NoId+ Nothing -> error "binop" {- | Construct deterministic Ugen. @@ -50,7 +54,7 @@ {- | Construct non-deterministic Ugen. > import Sound.Sc3.Common.Uid-> binop CI "*" ar (nondet "WhiteNoise" (Uid (fromEnum 'α')) ar [] 1) 0.05+> binop Ci "*" ar (nondet "WhiteNoise" (Uid (fromEnum 'α')) ar [] 1) 0.05 -} nondet :: String -> UgenId -> Rate -> [Ugen] -> Int -> Ugen nondet nm z r i nc = mk_plain r nm i nc (Special 0) z
Sound/Sc3/Ugen/Pp.hs view
@@ -18,15 +18,15 @@ -} ugen_concise_pp :: Ugen -> String ugen_concise_pp u =- let bracketed (l,r) x = l : x ++ [r]- prim_pp (Primitive _ nm _ _ sp _ _) = ugen_user_name nm sp- k = 5- in case u of- Constant_U (Constant n _) -> real_pp k n- Control_U (Control _ _ nm def _ _ _) -> nm ++ "=" ++ real_pp k def- Label_U (Label s) -> bracketed ('"','"') s- Primitive_U p -> prim_pp p- Proxy_U (Proxy p n) -> prim_pp p ++ "@" ++ show n- Mce_U (Mce_Scalar s) -> ugen_concise_pp s- Mce_U (Mce_Vector v) -> bracketed ('[',']') (concat (intersperse "," (map (ugen_concise_pp . mce_scalar_value) v))) -- hugs- Mrg_U (Mrg l r) -> unwords [ugen_concise_pp l,"&",ugen_concise_pp r]+ let bracketed (l, r) x = l : x ++ [r]+ prim_pp (Primitive _ nm _ _ sp _ _) = ugen_user_name nm sp+ k = 5+ in case u of+ Constant_U (Constant n _) -> real_pp k n+ Control_U (Control _ _ nm def _ _ _) -> nm ++ "=" ++ real_pp k def+ Label_U (Label s) -> bracketed ('"', '"') s+ Primitive_U p -> prim_pp p+ Proxy_U (Proxy p n) -> prim_pp p ++ "@" ++ show n+ Mce_U (Mce_Scalar s) -> ugen_concise_pp s+ Mce_U (Mce_Vector v) -> bracketed ('[', ']') (concat (intersperse "," (map (ugen_concise_pp . mce_scalar_value) v))) -- hugs+ Mrg_U (Mrg l r) -> unwords [ugen_concise_pp l, "&", ugen_concise_pp r]
Sound/Sc3/Ugen/Primitive.hs view
@@ -17,16 +17,16 @@ -- | Selector for unary and binary operators. newtype Special = Special Int- deriving (Ord, Eq, Read, Show)+ deriving (Ord, Eq, Read, Show) -- | Sc Ugen primitive.-data Primitive t =- Primitive- {ugenRate :: Rate- ,ugenName :: String- ,ugenInputs :: [t]- ,ugenOutputs :: [Output]- ,ugenSpecial :: Special- ,ugenId :: UgenId- ,primitiveBrackets :: Brackets}+data Primitive t = Primitive+ { ugenRate :: Rate+ , ugenName :: String+ , ugenInputs :: [t]+ , ugenOutputs :: [Output]+ , ugenSpecial :: Special+ , ugenId :: UgenId+ , primitiveBrackets :: Brackets+ } deriving (Ord, Eq, Read, Show)
Sound/Sc3/Ugen/Proxy.hs view
@@ -5,10 +5,10 @@ import Sound.Sc3.Ugen.Primitive {- hsc3 -} -data Proxy t =- Proxy- {proxySource :: Primitive t- ,proxyIndex :: Int}+data Proxy t = Proxy+ { proxySource :: Primitive t+ , proxyIndex :: Int+ } deriving (Ord, Eq, Read, Show) proxyRate :: Proxy t -> Rate
Sound/Sc3/Ugen/Types.hs view
@@ -2,8 +2,8 @@ module Sound.Sc3.Ugen.Types (module M) where import Sound.Sc3.Ugen.Brackets as M-import Sound.Sc3.Ugen.Control as M import Sound.Sc3.Ugen.Constant as M+import Sound.Sc3.Ugen.Control as M import Sound.Sc3.Ugen.Label as M import Sound.Sc3.Ugen.Mrg as M import Sound.Sc3.Ugen.Primitive as M
Sound/Sc3/Ugen/Ugen.hs view
@@ -10,8 +10,8 @@ import qualified Sound.Sc3.Common.Math as Math import Sound.Sc3.Common.Math.Operator-import Sound.Sc3.Common.Rate import Sound.Sc3.Common.Mce+import Sound.Sc3.Common.Rate import Sound.Sc3.Ugen.Brackets import Sound.Sc3.Ugen.Constant@@ -38,92 +38,96 @@ | Proxy_U (Proxy Ugen) | Mce_U (Mce Ugen) | Mrg_U (Mrg Ugen)- deriving (Eq,Read,Show)+ deriving (Eq, Read, Show) -- * Name --- | Lookup operator name for operator Ugens, else Ugen name.+{- | Lookup operator name for operator Ugens, else Ugen name.++>>> map (\k -> ugen_user_name "BinaryOpUGen" (Special k)) [0, 2, 4, 9, 12, 17, 25]+["+","*","/",">","Min","Lcm","**"]+-} ugen_user_name :: String -> Special -> String ugen_user_name nm (Special n) = fromMaybe nm (ugen_operator_name nm n) -- * Instances instance EqE Ugen where- equal_to = mkBinaryOperator OpEq Math.sc3_eq- not_equal_to = mkBinaryOperator OpNe Math.sc3_neq+ equal_to = mkBinaryOperator OpEq Math.sc3_eq+ not_equal_to = mkBinaryOperator OpNe Math.sc3_neq instance OrdE Ugen where- less_than = mkBinaryOperator OpLt Math.sc3_lt- less_than_or_equal_to = mkBinaryOperator OpLe Math.sc3_lte- greater_than = mkBinaryOperator OpGt Math.sc3_gt- greater_than_or_equal_to = mkBinaryOperator OpGe Math.sc3_gte+ less_than = mkBinaryOperator OpLt Math.sc3_lt+ less_than_or_equal_to = mkBinaryOperator OpLe Math.sc3_lte+ greater_than = mkBinaryOperator OpGt Math.sc3_gt+ greater_than_or_equal_to = mkBinaryOperator OpGe Math.sc3_gte -- | 'Ugen' form or 'Math.sc3_round_to'. roundTo :: Ugen -> Ugen -> Ugen roundTo = mkBinaryOperator OpRoundTo Math.sc3_round_to instance RealFracE Ugen where- properFractionE = error "Ugen.properFractionE"- truncateE = error "Ugen.truncateE"- roundE i = roundTo i 1- ceilingE = mkUnaryOperator OpCeil ceilingE- floorE = mkUnaryOperator OpFloor floorE+ properFractionE = error "Ugen.properFractionE"+ truncateE = error "Ugen.truncateE"+ roundE i = roundTo i 1+ ceilingE = mkUnaryOperator OpCeil ceilingE+ floorE = mkUnaryOperator OpFloor floorE instance UnaryOp Ugen where- ampDb = mkUnaryOperator OpAmpDb ampDb- asFloat = mkUnaryOperator OpAsFloat asFloat- asInt = mkUnaryOperator OpAsInt asInt- cpsMidi = mkUnaryOperator OpCpsMidi cpsMidi- cpsOct = mkUnaryOperator OpCpsOct cpsOct- cubed = mkUnaryOperator OpCubed cubed- dbAmp = mkUnaryOperator OpDbAmp dbAmp- distort = mkUnaryOperator OpDistort distort- frac = mkUnaryOperator OpFrac frac- isNil = mkUnaryOperator OpIsNil isNil- log10 = mkUnaryOperator OpLog10 log10- log2 = mkUnaryOperator OpLog2 log2- midiCps = mkUnaryOperator OpMidiCps midiCps- midiRatio = mkUnaryOperator OpMidiRatio midiRatio- notE = mkUnaryOperator OpNot notE- notNil = mkUnaryOperator OpNotNil notNil- octCps = mkUnaryOperator OpOctCps octCps- ramp_ = mkUnaryOperator OpRamp_ ramp_- ratioMidi = mkUnaryOperator OpRatioMidi ratioMidi- softClip = mkUnaryOperator OpSoftClip softClip- squared = mkUnaryOperator OpSquared squared+ ampDb = mkUnaryOperator OpAmpDb ampDb+ asFloat = mkUnaryOperator OpAsFloat asFloat+ asInt = mkUnaryOperator OpAsInt asInt+ cpsMidi = mkUnaryOperator OpCpsMidi cpsMidi+ cpsOct = mkUnaryOperator OpCpsOct cpsOct+ cubed = mkUnaryOperator OpCubed cubed+ dbAmp = mkUnaryOperator OpDbAmp dbAmp+ distort = mkUnaryOperator OpDistort distort+ frac = mkUnaryOperator OpFrac frac+ isNil = mkUnaryOperator OpIsNil isNil+ log10 = mkUnaryOperator OpLog10 log10+ log2 = mkUnaryOperator OpLog2 log2+ midiCps = mkUnaryOperator OpMidiCps midiCps+ midiRatio = mkUnaryOperator OpMidiRatio midiRatio+ notE = mkUnaryOperator OpNot notE+ notNil = mkUnaryOperator OpNotNil notNil+ octCps = mkUnaryOperator OpOctCps octCps+ ramp_ = mkUnaryOperator OpRamp_ ramp_+ ratioMidi = mkUnaryOperator OpRatioMidi ratioMidi+ softClip = mkUnaryOperator OpSoftClip softClip+ squared = mkUnaryOperator OpSquared squared instance BinaryOp Ugen where- iDiv = mkBinaryOperator OpIdiv iDiv- modE = mkBinaryOperator OpMod Fixed.mod'- lcmE = mkBinaryOperator OpLcm lcmE- gcdE = mkBinaryOperator OpGcd gcdE- roundUp = mkBinaryOperator OpRoundUp roundUp- trunc = mkBinaryOperator OpTrunc trunc- atan2E = mkBinaryOperator OpAtan2 atan2E- hypot = mkBinaryOperator OpHypot hypot- hypotx = mkBinaryOperator OpHypotx hypotx- fill = mkBinaryOperator OpFill fill- ring1 = mkBinaryOperator OpRing1 ring1- ring2 = mkBinaryOperator OpRing2 ring2- ring3 = mkBinaryOperator OpRing3 ring3- ring4 = mkBinaryOperator OpRing4 ring4- difSqr = mkBinaryOperator OpDifSqr difSqr- sumSqr = mkBinaryOperator OpSumSqr sumSqr- sqrSum = mkBinaryOperator OpSqrSum sqrSum- sqrDif = mkBinaryOperator OpSqrDif sqrDif- absDif = mkBinaryOperator OpAbsDif absDif- thresh = mkBinaryOperator OpThresh thresh- amClip = mkBinaryOperator OpAmClip amClip- scaleNeg = mkBinaryOperator OpScaleNeg scaleNeg- clip2 = mkBinaryOperator OpClip2 clip2- excess = mkBinaryOperator OpExcess excess- fold2 = mkBinaryOperator OpFold2 fold2- wrap2 = mkBinaryOperator OpWrap2 wrap2- firstArg = mkBinaryOperator OpFirstArg firstArg- randRange = mkBinaryOperator OpRandRange randRange- exprandRange = mkBinaryOperator OpExpRandRange exprandRange+ iDiv = mkBinaryOperator OpIdiv iDiv+ modE = mkBinaryOperator OpMod Fixed.mod'+ lcmE = mkBinaryOperator OpLcm lcmE+ gcdE = mkBinaryOperator OpGcd gcdE+ roundUp = mkBinaryOperator OpRoundUp roundUp+ trunc = mkBinaryOperator OpTrunc trunc+ atan2E = mkBinaryOperator OpAtan2 atan2E+ hypot = mkBinaryOperator OpHypot hypot+ hypotx = mkBinaryOperator OpHypotx hypotx+ fill = mkBinaryOperator OpFill fill+ ring1 = mkBinaryOperator OpRing1 ring1+ ring2 = mkBinaryOperator OpRing2 ring2+ ring3 = mkBinaryOperator OpRing3 ring3+ ring4 = mkBinaryOperator OpRing4 ring4+ difSqr = mkBinaryOperator OpDifSqr difSqr+ sumSqr = mkBinaryOperator OpSumSqr sumSqr+ sqrSum = mkBinaryOperator OpSqrSum sqrSum+ sqrDif = mkBinaryOperator OpSqrDif sqrDif+ absDif = mkBinaryOperator OpAbsDif absDif+ thresh = mkBinaryOperator OpThresh thresh+ amClip = mkBinaryOperator OpAmClip amClip+ scaleNeg = mkBinaryOperator OpScaleNeg scaleNeg+ clip2 = mkBinaryOperator OpClip2 clip2+ excess = mkBinaryOperator OpExcess excess+ fold2 = mkBinaryOperator OpFold2 fold2+ wrap2 = mkBinaryOperator OpWrap2 wrap2+ firstArg = mkBinaryOperator OpFirstArg firstArg+ randRange = mkBinaryOperator OpRandRange randRange+ exprandRange = mkBinaryOperator OpExpRandRange exprandRange ---instance MulAdd Ugen where mul_add = mulAdd+-- instance MulAdd Ugen where mul_add = mulAdd -- * Parser @@ -136,9 +140,9 @@ -- | See into 'Constant_U'. un_constant :: Ugen -> Maybe Constant un_constant u =- case u of- Constant_U c -> Just c- _ -> Nothing+ case u of+ Constant_U c -> Just c+ _ -> Nothing -- | Value of 'Constant_U' 'Constant'. u_constant :: Ugen -> Maybe Sample@@ -153,17 +157,17 @@ -- | Multiple root graph constructor. mrg :: [Ugen] -> Ugen mrg u =- case u of- [] -> error "mrg: []"- [x] -> x- (x:xs) -> Mrg_U (Mrg x (mrg xs))+ case u of+ [] -> error "mrg: []"+ [x] -> x+ (x : xs) -> Mrg_U (Mrg x (mrg xs)) -- | See into 'Mrg_U', follows leftmost rule until arriving at non-Mrg node. mrg_leftmost :: Ugen -> Ugen mrg_leftmost u =- case u of- Mrg_U m -> mrg_leftmost (mrgLeft m)- _ -> u+ case u of+ Mrg_U m -> mrg_leftmost (mrgLeft m)+ _ -> u -- * Predicates @@ -174,17 +178,17 @@ -- | True if input is a sink 'Ugen', ie. has no outputs. Sees into Mrg. isSink :: Ugen -> Bool isSink u =- case mrg_leftmost u of- Primitive_U p -> null (ugenOutputs p)- Mce_U m -> all isSink (mce_to_list m)- _ -> False+ case mrg_leftmost u of+ Primitive_U p -> null (ugenOutputs p)+ Mce_U m -> all isSink (mce_to_list m)+ _ -> False -- | See into 'Proxy_U'. un_proxy :: Ugen -> Maybe (Proxy Ugen) un_proxy u =- case u of- Proxy_U p -> Just p- _ -> Nothing+ case u of+ Proxy_U p -> Just p+ _ -> Nothing -- | Is 'Ugen' a 'Proxy'? isProxy :: Ugen -> Bool@@ -206,10 +210,10 @@ -- | Multiple channel expansion node constructor. mce :: [Ugen] -> Ugen mce xs =- case xs of- [] -> error "mce: []"- [x] -> Mce_U (Mce_Scalar x)- _ -> Mce_U (mce_from_list xs)+ case xs of+ [] -> error "mce: []"+ [x] -> Mce_U (Mce_Scalar x)+ _ -> Mce_U (mce_from_list xs) -- | Type specified 'mce_to_list'. mceProxies :: Mce Ugen -> [Ugen]@@ -218,24 +222,30 @@ -- | Multiple channel expansion node ('Mce_U') predicate. Sees into Mrg. isMce :: Ugen -> Bool isMce u =- case mrg_leftmost u of- Mce_U _ -> True- _ -> False+ case mrg_leftmost u of+ Mce_U _ -> True+ _ -> False --- | Output channels of Ugen as a list. If required, preserves the RHS of and Mrg node in channel 0.+{- | Output channels of Ugen as a list.+If required, preserves the RHS of an Mrg node in channel 0.+See also: mceChannel+-} mceChannels :: Ugen -> [Ugen] mceChannels u =- case u of- Mce_U m -> mce_to_list m- Mrg_U (Mrg x y) -> let r:rs = mceChannels x in Mrg_U (Mrg r y) : rs- _ -> [u]+ case u of+ Mce_U m -> mce_to_list m+ Mrg_U (Mrg x y) ->+ case mceChannels x of+ r : rs -> Mrg_U (Mrg r y) : rs+ _ -> error "mceChannels"+ _ -> [u] -- | Number of channels to expand to. This function sees into Mrg, and is defined only for Mce nodes. mceDegree :: Ugen -> Maybe Int mceDegree u =- case mrg_leftmost u of- Mce_U m -> Just (length (mceProxies m))- _ -> Nothing+ case mrg_leftmost u of+ Mce_U m -> Just (length (mceProxies m))+ _ -> Nothing -- | Erroring variant. mceDegree_err :: Ugen -> Int@@ -244,11 +254,13 @@ -- | Extend Ugen to specified degree. Follows "leftmost" rule for Mrg nodes. mceExtend :: Int -> Ugen -> [Ugen] mceExtend n u =- case u of- Mce_U m -> mceProxies (mce_extend n m)- Mrg_U (Mrg x y) -> let (r:rs) = mceExtend n x- in Mrg_U (Mrg r y) : rs- _ -> replicate n u+ case u of+ Mce_U m -> mceProxies (mce_extend n m)+ Mrg_U (Mrg x y) ->+ case mceExtend n x of+ r : rs -> Mrg_U (Mrg r y) : rs+ _ -> error "mceExtend"+ _ -> replicate n u -- | Is Mce required, ie. are any input values Mce? mceRequired :: [Ugen] -> Bool@@ -257,23 +269,29 @@ {- | Apply Mce transform to a list of inputs. The transform extends each input so all are of equal length, and then transposes the matrix. -> mceInputTransform [mce2 1 2,mce2 3 4] == Just [[1,3],[2,4]]-> mceInputTransform [mce2 1 2,mce2 3 4,mce3 5 6 7] == Just [[1,3,5],[2,4,6],[1,3,7]]-> mceInputTransform [mce2 (mce2 1 2) (mce2 3 4),mce2 5 6] == Just [[mce2 1 2,5],[mce2 3 4,6]]+>>> mceInputTransform [mce [1, 2],mce [3, 4]] == Just [[1,3],[2,4]]+True++>>> mceInputTransform [mce [1, 2],mce [3, 4], mce [5, 6, 7]] == Just [[1,3,5],[2,4,6],[1,3,7]]+True++>>> mceInputTransform [mce [mce [1, 2], mce [3, 4]], mce [5, 6]] == Just [[mce [1, 2],5],[mce [3, 4],6]]+True -} mceInputTransform :: [Ugen] -> Maybe [[Ugen]] mceInputTransform i =- if mceRequired i- then let n = maximum (map mceDegree_err (filter isMce i))- in Just (transpose (map (mceExtend n) i))+ if mceRequired i+ then+ let n = maximum (map mceDegree_err (filter isMce i))+ in Just (transpose (map (mceExtend n) i)) else Nothing -- | Build a Ugen after Mce transformation of inputs. mceBuild :: ([Ugen] -> Ugen) -> [Ugen] -> Ugen mceBuild f i =- case mceInputTransform i of- Nothing -> f i- Just i' -> let xs = map (mceBuild f) i' in Mce_U (mce_from_list xs)+ case mceInputTransform i of+ Nothing -> f i+ Just i' -> let xs = map (mceBuild f) i' in Mce_U (mce_from_list xs) {- | True if Mce is an immediate proxy for a multiple-out Primitive. This is useful when disassembling graphs, ie. ugen_graph_forth_pp at hsc3-db.@@ -281,14 +299,14 @@ -} mce_is_direct_proxy :: Mce Ugen -> Bool mce_is_direct_proxy m =- case m of- Mce_Scalar _ -> False- Mce_Vector _ ->- let p = map un_proxy (mce_to_list m)- p' = catMaybes p- in all isJust p &&- length (nub (map proxySource p')) == 1 &&- map proxyIndex p' `isPrefixOf` [0..]+ case m of+ Mce_Scalar _ -> False+ Mce_Vector _ ->+ let p = map un_proxy (mce_to_list m)+ p' = catMaybes p+ in all isJust p+ && length (nub (map proxySource p')) == 1+ && map proxyIndex p' `isPrefixOf` [0 ..] -- * Bracketed @@ -305,14 +323,14 @@ let (lhs, rhs) = primitiveBrackets p in Proxy_U (Proxy (p {primitiveBrackets = (lhs ++ pre, rhs ++ post)}) pix) _ -> err in case u of- Constant_U c -> let (lhs, rhs) = constantBrackets c in Constant_U (c {constantBrackets = (lhs ++ pre, rhs ++ post)})- Control_U c -> let (lhs, rhs) = controlBrackets c in Control_U (c {controlBrackets = (lhs ++ pre, rhs ++ post)})- Primitive_U p -> let (lhs, rhs) = primitiveBrackets p in Primitive_U (p {primitiveBrackets = (lhs ++ pre, rhs ++ post)})- Mce_U m ->- if mce_is_direct_proxy m- then Mce_U (mce_map rw_proxy m)- else err- _ -> err+ Constant_U c -> let (lhs, rhs) = constantBrackets c in Constant_U (c {constantBrackets = (lhs ++ pre, rhs ++ post)})+ Control_U c -> let (lhs, rhs) = controlBrackets c in Control_U (c {controlBrackets = (lhs ++ pre, rhs ++ post)})+ Primitive_U p -> let (lhs, rhs) = primitiveBrackets p in Primitive_U (p {primitiveBrackets = (lhs ++ pre, rhs ++ post)})+ Mce_U m ->+ if mce_is_direct_proxy m+ then Mce_U (mce_map rw_proxy m)+ else err+ _ -> err -- | Retrieve Brackets from Ugen. ugenBrackets :: Ugen -> Brackets@@ -328,7 +346,7 @@ -- | Ensure input 'Ugen' is valid, ie. not a sink. checkInput :: Ugen -> Ugen checkInput u =- if isSink u+ if isSink u then error ("checkInput: " ++ show u) else u @@ -353,35 +371,35 @@ -- | Unit generator proxy node constructor. proxy :: Ugen -> Int -> Ugen proxy u n =- case u of- Primitive_U p -> Proxy_U (Proxy p n)- _ -> error "proxy: not primitive?"+ case u of+ Primitive_U p -> Proxy_U (Proxy p n)+ _ -> error "proxy: not primitive?" -- | Determine the rate of a Ugen. rateOf :: Ugen -> Rate rateOf u =- case u of- Constant_U _ -> InitialisationRate- Control_U c -> controlOperatingRate c- Label_U _ -> InitialisationRate- Primitive_U p -> ugenRate p- Proxy_U p -> ugenRate (proxySource p)- Mce_U _ -> maximum (map rateOf (mceChannels u))- Mrg_U m -> rateOf (mrgLeft m)+ case u of+ Constant_U _ -> InitialisationRate+ Control_U c -> controlOperatingRate c+ Label_U _ -> InitialisationRate+ Primitive_U p -> ugenRate p+ Proxy_U p -> ugenRate (proxySource p)+ Mce_U _ -> maximum (map rateOf (mceChannels u))+ Mrg_U m -> rateOf (mrgLeft m) -- | Apply proxy transformation if required. proxify :: Ugen -> Ugen proxify u =- case u of- Mce_U m -> mce (map proxify (mce_to_list m))- Mrg_U m -> mrg [proxify (mrgLeft m), mrgRight m]- Primitive_U p ->- let o = ugenOutputs p- in case o of- _:_:_ -> mce (map (proxy u) [0 .. length o - 1])- _ -> u- Constant_U _ -> u- _ -> error "proxify: illegal ugen"+ case u of+ Mce_U m -> mce (map proxify (mce_to_list m))+ Mrg_U m -> mrg [proxify (mrgLeft m), mrgRight m]+ Primitive_U p ->+ let o = ugenOutputs p+ in case o of+ _ : _ : _ -> mce (map (proxy u) [0 .. length o - 1])+ _ -> u+ Constant_U _ -> u+ _ -> error "proxify: illegal ugen" {- | Filters with DemandRate inputs run at ControlRate. This is a little unfortunate, it'd be nicer if the rate in this circumstance could be given.@@ -389,102 +407,127 @@ mk_ugen_select_rate :: String -> [Ugen] -> [Rate] -> Either Rate [Int] -> Rate mk_ugen_select_rate nm h rs r = let at_note note list index = if index < 0 || index >= length list then error note else list !! index -- hugs...- is_right e = case e of { Right _ -> True; _ -> False } -- hugs...+ is_right e = case e of Right _ -> True; _ -> False -- hugs... r' = either id (maximum . map (rateOf . at_note ("mkUgen: " ++ nm) h)) r in if is_right r && r' == DemandRate && DemandRate `notElem` rs- then if ControlRate `elem` rs then ControlRate else error "mkUgen: DemandRate input to non-ControlRate filter"- else if r' `elem` rs || r' == DemandRate+ then if ControlRate `elem` rs then ControlRate else error "mkUgen: DemandRate input to non-ControlRate filter"+ else+ if r' `elem` rs || r' == DemandRate then r'- else error ("mkUgen: rate restricted: " ++ show (r,r',rs,nm))+ else error ("mkUgen: rate restricted: " ++ show (r, r', rs, nm)) {- | Construct proxied and multiple channel expanded Ugen. cf = constant function, rs = rate set, r = rate, nm = name, i = inputs, i_mce = list of Mce inputs, o = outputs. -}-mkUgen :: Maybe ([Sample] -> Sample) -> [Rate] -> Either Rate [Int] ->- String -> [Ugen] -> Maybe [Ugen] -> Int -> Special -> UgenId -> Ugen+mkUgen ::+ Maybe ([Sample] -> Sample) ->+ [Rate] ->+ Either Rate [Int] ->+ String ->+ [Ugen] ->+ Maybe [Ugen] ->+ Int ->+ Special ->+ UgenId ->+ Ugen mkUgen cf rs r nm i i_mce o s z =- let i' = maybe i ((i ++) . concatMap mceChannels) i_mce- f h = let r' = mk_ugen_select_rate nm h rs r- o' = replicate o r'- u = Primitive_U (Primitive r' nm h o' s z emptyBrackets)- in case cf of- Just cf' ->- if all isConstant h- then constant (cf' (mapMaybe u_constant h))- else u- Nothing -> u- in proxify (mceBuild f (map checkInput i'))+ let i' = maybe i ((i ++) . concatMap mceChannels) i_mce+ f h =+ let r' = mk_ugen_select_rate nm h rs r+ o' = replicate o r'+ u = Primitive_U (Primitive r' nm h o' s z emptyBrackets)+ in case cf of+ Just cf' ->+ if all isConstant h+ then constant (cf' (mapMaybe u_constant h))+ else u+ Nothing -> u+ in proxify (mceBuild f (map checkInput i')) -- * Operators -- | Operator Ugen constructor. mkOperator :: ([Sample] -> Sample) -> String -> [Ugen] -> Int -> Ugen mkOperator f c i s =- let ix = [0 .. length i - 1]- in mkUgen (Just f) all_rates (Right ix) c i Nothing 1 (Special s) NoId+ let ix = [0 .. length i - 1]+ in mkUgen (Just f) all_rates (Right ix) c i Nothing 1 (Special s) NoId -- | Unary math constructor. mkUnaryOperator :: Sc3_Unary_Op -> (Sample -> Sample) -> Ugen -> Ugen mkUnaryOperator i f a =- let g [x] = f x- g _ = error "mkUnaryOperator: non unary input"- in mkOperator g "UnaryOpUGen" [a] (fromEnum i)+ let g [x] = f x+ g _ = error "mkUnaryOperator: non unary input"+ in mkOperator g "UnaryOpUGen" [a] (fromEnum i) --- | Binary math constructor with constant optimisation.------ > constant 2 * constant 3 == constant 6------ > let o = sinOsc ar 440 0------ > o * 1 == o && 1 * o == o && o * 2 /= o--- > o + 0 == o && 0 + o == o && o + 1 /= o--- > o - 0 == o && 0 - o /= o--- > o / 1 == o && 1 / o /= o--- > o ** 1 == o && o ** 2 /= o-mkBinaryOperator_optimise_constants :: Sc3_Binary_Op -> (Sample -> Sample -> Sample) ->- (Either Sample Sample -> Bool) ->- Ugen -> Ugen -> Ugen+{- | Binary math constructor with constant optimisation.++>>> constant 2 * constant 3 == constant 6+True++>>> let o = mkUgen Nothing [AudioRate] (Left AudioRate) "SinOsc" [constant 440, constant 0] Nothing 1 (Special 0) (Uid 0)+>>> o * 1 == o && 1 * o == o && o * 2 /= o+True++>>> o + 0 == o && 0 + o == o && o + 1 /= o+True++>>> o - 0 == o && 0 - o /= o+True++>>> o / 1 == o && 1 / o /= o+True++>>> o ** 1 == o && o ** 2 /= o+True+-}+mkBinaryOperator_optimise_constants ::+ Sc3_Binary_Op ->+ (Sample -> Sample -> Sample) ->+ (Either Sample Sample -> Bool) ->+ Ugen ->+ Ugen ->+ Ugen mkBinaryOperator_optimise_constants i f o a b =- let g [x,y] = f x y- g _ = error "mkBinaryOperator: non binary input"- r = case (a,b) of- (Constant_U (Constant a' ([],[])),_) ->- if o (Left a') then Just b else Nothing- (_,Constant_U (Constant b' ([],[]))) ->- if o (Right b') then Just a else Nothing- _ -> Nothing- in fromMaybe (mkOperator g "BinaryOpUGen" [a, b] (fromEnum i)) r+ let g [x, y] = f x y+ g _ = error "mkBinaryOperator: non binary input"+ r = case (a, b) of+ (Constant_U (Constant a' ([], [])), _) ->+ if o (Left a') then Just b else Nothing+ (_, Constant_U (Constant b' ([], []))) ->+ if o (Right b') then Just a else Nothing+ _ -> Nothing+ in fromMaybe (mkOperator g "BinaryOpUGen" [a, b] (fromEnum i)) r -- | Plain (non-optimised) binary math constructor. mkBinaryOperator :: Sc3_Binary_Op -> (Sample -> Sample -> Sample) -> Ugen -> Ugen -> Ugen mkBinaryOperator i f a b =- let g [x,y] = f x y- g _ = error "mkBinaryOperator: non binary input"- in mkOperator g "BinaryOpUGen" [a, b] (fromEnum i)+ let g [x, y] = f x y+ g _ = error "mkBinaryOperator: non binary input"+ in mkOperator g "BinaryOpUGen" [a, b] (fromEnum i) -- * Numeric instances -- | Is /u/ the primitive for the named Ugen. is_primitive_for :: String -> Ugen -> Bool is_primitive_for k u =- case u of- Primitive_U (Primitive _ nm [_,_] [_] _ _ _) -> nm == k- _ -> False+ case u of+ Primitive_U (Primitive _ nm [_, _] [_] _ _ _) -> nm == k+ _ -> False -- | Is /u/ the primitive for the named Ugen. is_constant_of :: Sample -> Ugen -> Bool is_constant_of k u =- case u of- Constant_U c -> constantValue c == k- _ -> False+ case u of+ Constant_U c -> constantValue c == k+ _ -> False -- | Is /u/ a binary math operator with SPECIAL of /k/. is_math_binop :: Int -> Ugen -> Bool is_math_binop k u =- case u of- Primitive_U (Primitive _ "BinaryOpUGen" [_,_] [_] (Special s) NoId _) -> s == k- _ -> False+ case u of+ Primitive_U (Primitive _ "BinaryOpUGen" [_, _] [_] (Special s) NoId _) -> s == k+ _ -> False -- | Is /u/ an ADD operator? is_add_operator :: Ugen -> Bool@@ -504,23 +547,23 @@ -} mul_add_optimise_direct :: Ugen -> Ugen mul_add_optimise_direct u =- let reorder (i,j,k) =- let (ri,rj,rk) = (rateOf i,rateOf j,rateOf k)+ let reorder (i, j, k) =+ let (ri, rj, rk) = (rateOf i, rateOf j, rateOf k) in if rk > max ri rj- then Nothing- else Just (max (max ri rj) rk,if rj > ri then (j,i,k) else (i,j,k))+ then Nothing+ else Just (max (max ri rj) rk, if rj > ri then (j, i, k) else (i, j, k)) in case assert_is_add_operator "MUL-ADD" u of- Primitive_U- (Primitive _ _ [Primitive_U (Primitive _ "BinaryOpUGen" [i,j] [_] (Special 2) NoId ([],[])),k] [_] _ NoId ([],[])) ->- case reorder (i,j,k) of- Just (rt,(p,q,r)) -> Primitive_U (Primitive rt "MulAdd" [p,q,r] [rt] (Special 0) NoId ([],[]))- Nothing -> u- Primitive_U- (Primitive _ _ [k,Primitive_U (Primitive _ "BinaryOpUGen" [i,j] [_] (Special 2) NoId ([],[]))] [_] _ NoId ([],[])) ->- case reorder (i,j,k) of- Just (rt,(p,q,r)) -> Primitive_U (Primitive rt "MulAdd" [p,q,r] [rt] (Special 0) NoId ([],[]))- Nothing -> u- _ -> u+ Primitive_U+ (Primitive _ _ [Primitive_U (Primitive _ "BinaryOpUGen" [i, j] [_] (Special 2) NoId ([], [])), k] [_] _ NoId ([], [])) ->+ case reorder (i, j, k) of+ Just (rt, (p, q, r)) -> Primitive_U (Primitive rt "MulAdd" [p, q, r] [rt] (Special 0) NoId ([], []))+ Nothing -> u+ Primitive_U+ (Primitive _ _ [k, Primitive_U (Primitive _ "BinaryOpUGen" [i, j] [_] (Special 2) NoId ([], []))] [_] _ NoId ([], [])) ->+ case reorder (i, j, k) of+ Just (rt, (p, q, r)) -> Primitive_U (Primitive rt "MulAdd" [p, q, r] [rt] (Special 0) NoId ([], []))+ Nothing -> u+ _ -> u {- | MulAdd optimiser, applicable at any Ugen (ie. checks /u/ is an ADD ugen) @@ -539,10 +582,10 @@ sum3_optimise_direct :: Ugen -> Ugen sum3_optimise_direct u = case assert_is_add_operator "SUM3" u of- Primitive_U (Primitive r _ [Primitive_U (Primitive _ "BinaryOpUGen" [i,j] [_] (Special 0) NoId ([],[])),k] [_] _ NoId ([],[])) ->- Primitive_U (Primitive r "Sum3" [i,j,k] [r] (Special 0) NoId ([],[]))- Primitive_U (Primitive r _ [k,Primitive_U (Primitive _ "BinaryOpUGen" [i,j] [_] (Special 0) NoId ([],[]))] [_] _ NoId ([],[])) ->- Primitive_U (Primitive r "Sum3" [i,j,k] [r] (Special 0) NoId ([],[]))+ Primitive_U (Primitive r _ [Primitive_U (Primitive _ "BinaryOpUGen" [i, j] [_] (Special 0) NoId ([], [])), k] [_] _ NoId ([], [])) ->+ Primitive_U (Primitive r "Sum3" [i, j, k] [r] (Special 0) NoId ([], []))+ Primitive_U (Primitive r _ [k, Primitive_U (Primitive _ "BinaryOpUGen" [i, j] [_] (Special 0) NoId ([], []))] [_] _ NoId ([], [])) ->+ Primitive_U (Primitive r "Sum3" [i, j, k] [r] (Special 0) NoId ([], [])) _ -> u -- | /Sum3/ optimiser, applicable at any /u/ (ie. checks if /u/ is an ADD operator).@@ -555,56 +598,57 @@ -- | Unit generators are numbers. instance Num Ugen where- negate = mkUnaryOperator OpNeg negate- (+) = fmap add_optimise .- mkBinaryOperator_optimise_constants OpAdd (+) (`elem` [Left 0,Right 0])- (-) = mkBinaryOperator_optimise_constants OpSub (-) (Right 0 ==)- (*) = mkBinaryOperator_optimise_constants OpMul (*) (`elem` [Left 1,Right 1])- abs = mkUnaryOperator OpAbs abs- signum = mkUnaryOperator OpSign signum- fromInteger = Constant_U . flip Constant ([],[]) . fromInteger+ negate = mkUnaryOperator OpNeg negate+ (+) =+ fmap add_optimise+ . mkBinaryOperator_optimise_constants OpAdd (+) (`elem` [Left 0, Right 0])+ (-) = mkBinaryOperator_optimise_constants OpSub (-) (Right 0 ==)+ (*) = mkBinaryOperator_optimise_constants OpMul (*) (`elem` [Left 1, Right 1])+ abs = mkUnaryOperator OpAbs abs+ signum = mkUnaryOperator OpSign signum+ fromInteger = Constant_U . flip Constant ([], []) . fromInteger -- | Unit generators are fractional. instance Fractional Ugen where- recip = mkUnaryOperator OpRecip recip- (/) = mkBinaryOperator_optimise_constants OpFdiv (/) (Right 1 ==)- fromRational = Constant_U . flip Constant ([],[]) . fromRational+ recip = mkUnaryOperator OpRecip recip+ (/) = mkBinaryOperator_optimise_constants OpFdiv (/) (Right 1 ==)+ fromRational = Constant_U . flip Constant ([], []) . fromRational -- | Unit generators are floating point. instance Floating Ugen where- pi = Constant_U (Constant pi ([],[]))- exp = mkUnaryOperator OpExp exp- log = mkUnaryOperator OpLog log- sqrt = mkUnaryOperator OpSqrt sqrt- (**) = mkBinaryOperator_optimise_constants OpPow (**) (Right 1 ==)- logBase a b = log b / log a- sin = mkUnaryOperator OpSin sin- cos = mkUnaryOperator OpCos cos- tan = mkUnaryOperator OpTan tan- asin = mkUnaryOperator OpArcSin asin- acos = mkUnaryOperator OpArcCos acos- atan = mkUnaryOperator OpArcTan atan- sinh = mkUnaryOperator OpSinh sinh- cosh = mkUnaryOperator OpCosh cosh- tanh = mkUnaryOperator OpTanh tanh- asinh x = log (sqrt (x*x+1) + x)- acosh x = log (sqrt (x*x-1) + x)- atanh x = (log (1+x) - log (1-x)) / 2+ pi = Constant_U (Constant pi ([], []))+ exp = mkUnaryOperator OpExp exp+ log = mkUnaryOperator OpLog log+ sqrt = mkUnaryOperator OpSqrt sqrt+ (**) = mkBinaryOperator_optimise_constants OpPow (**) (Right 1 ==)+ logBase a b = log b / log a+ sin = mkUnaryOperator OpSin sin+ cos = mkUnaryOperator OpCos cos+ tan = mkUnaryOperator OpTan tan+ asin = mkUnaryOperator OpArcSin asin+ acos = mkUnaryOperator OpArcCos acos+ atan = mkUnaryOperator OpArcTan atan+ sinh = mkUnaryOperator OpSinh sinh+ cosh = mkUnaryOperator OpCosh cosh+ tanh = mkUnaryOperator OpTanh tanh+ asinh x = log (sqrt (x * x + 1) + x)+ acosh x = log (sqrt (x * x - 1) + x)+ atanh x = (log (1 + x) - log (1 - x)) / 2 -- | Unit generators are real. instance Real Ugen where- toRational (Constant_U (Constant n ([],[]))) = toRational n- toRational _ = error "Ugen.toRational: only un-bracketed constants considered"+ toRational (Constant_U (Constant n ([], []))) = toRational n+ toRational _ = error "Ugen.toRational: only un-bracketed constants considered" -- | Unit generators are integral. instance Integral Ugen where- quot = mkBinaryOperator OpIdiv (error "Ugen.quot")- rem = mkBinaryOperator OpMod (error "Ugen.rem")- quotRem a b = (quot a b, rem a b)- div = mkBinaryOperator OpIdiv (error "Ugen.div")- mod = mkBinaryOperator OpMod (error "Ugen.mod")- toInteger (Constant_U (Constant n ([],[]))) = floor n- toInteger _ = error "Ugen.toInteger: only un-bracketed constants considered"+ quot = mkBinaryOperator OpIdiv (error "Ugen.quot")+ rem = mkBinaryOperator OpMod (error "Ugen.rem")+ quotRem a b = (quot a b, rem a b)+ div = mkBinaryOperator OpIdiv (error "Ugen.div")+ mod = mkBinaryOperator OpMod (error "Ugen.mod")+ toInteger (Constant_U (Constant n ([], []))) = floor n+ toInteger _ = error "Ugen.toInteger: only un-bracketed constants considered" instance RealFrac Ugen where properFraction = error "Ugen.properFraction, see properFractionE"@@ -612,59 +656,92 @@ ceiling = error "Ugen.ceiling, see ceilingE" floor = error "Ugen.floor, see floorE" --- | Unit generators are orderable (when 'Constants').------ > (constant 2 > constant 1) == True+{- | Unit generators are orderable (when 'Constants').++>>> constant 2 > constant 1+True+-} instance Ord Ugen where- (Constant_U a) < (Constant_U b) = a < b- _ < _ = error "Ugen.<, see <*"- (Constant_U a) <= (Constant_U b) = a <= b- _ <= _ = error "Ugen.<= at, see <=*"- (Constant_U a) > (Constant_U b) = a > b- _ > _ = error "Ugen.>, see >*"- (Constant_U a) >= (Constant_U b) = a >= b- _ >= _ = error "Ugen.>=, see >=*"- min = mkBinaryOperator OpMin min- max = mkBinaryOperator OpMax max+ (Constant_U a) < (Constant_U b) = a < b+ _ < _ = error "Ugen.<, see <*"+ (Constant_U a) <= (Constant_U b) = a <= b+ _ <= _ = error "Ugen.<= at, see <=*"+ (Constant_U a) > (Constant_U b) = a > b+ _ > _ = error "Ugen.>, see >*"+ (Constant_U a) >= (Constant_U b) = a >= b+ _ >= _ = error "Ugen.>=, see >=*"+ min = mkBinaryOperator OpMin min+ max = mkBinaryOperator OpMax max -- | Unit generators are enumerable. instance Enum Ugen where- succ u = u + 1- pred u = u - 1- toEnum n = Constant_U (Constant (fromIntegral n) ([],[]))- fromEnum (Constant_U (Constant n ([],[]))) = truncate n- fromEnum _ = error "Ugen.fromEnum: non-constant"- enumFrom = iterate (+1)- enumFromThen n m = iterate (+(m-n)) n- enumFromTo n m = takeWhile (<= m+1/2) (enumFrom n)- enumFromThenTo n n' m =- let p = if n' >= n then (>=) else (<=)- in takeWhile (p (m + (n'-n)/2)) (enumFromThen n n')+ succ u = u + 1+ pred u = u - 1+ toEnum n = Constant_U (Constant (fromIntegral n) ([], []))+ fromEnum (Constant_U (Constant n ([], []))) = truncate n+ fromEnum _ = error "Ugen.fromEnum: non-constant"+ enumFrom = iterate (+ 1)+ enumFromThen n m = iterate (+ (m - n)) n+ enumFromTo n m = takeWhile (<= m + 1 / 2) (enumFrom n)+ enumFromThenTo n n' m =+ let p = if n' >= n then (>=) else (<=)+ in takeWhile (p (m + (n' - n) / 2)) (enumFromThen n n') {- | Unit generators are stochastic. Only un-bracketed constant values are considered. -} instance Random.Random Ugen where- randomR (Constant_U (Constant l ([],[])), Constant_U (Constant r ([],[]))) g =- let (n, g') = Random.randomR (l,r) g- in (Constant_U (Constant n ([],[])), g')- randomR _ _ = error "Ugen.randomR: non constant (l,r)"- random = Random.randomR (-1.0, 1.0)+ randomR (Constant_U (Constant l ([], [])), Constant_U (Constant r ([], []))) g =+ let (n, g') = Random.randomR (l, r) g+ in (Constant_U (Constant n ([], [])), g')+ randomR _ _ = error "Ugen.randomR: non constant (l,r)"+ random = Random.randomR (-1.0, 1.0) +-- * Bitwise++-- | 'Operator.OpBitAnd'+bitAnd :: Ugen -> Ugen -> Ugen+bitAnd = mkBinaryOperator OpBitAnd undefined++-- | 'Operator.OpBitOr'+bitOr :: Ugen -> Ugen -> Ugen+bitOr = mkBinaryOperator OpBitOr undefined++-- | 'OpBitXor'+bitXOr :: Ugen -> Ugen -> Ugen+bitXOr = mkBinaryOperator OpBitXor undefined++-- | 'OpBitNot'+bitNot :: Ugen -> Ugen+bitNot = mkUnaryOperator OpBitNot undefined++-- | 'OpShiftLeft'+shiftLeft :: Ugen -> Ugen -> Ugen+shiftLeft = mkBinaryOperator OpShiftLeft undefined++-- | 'OpShiftRight'+shiftRight :: Ugen -> Ugen -> Ugen+shiftRight = mkBinaryOperator OpShiftRight undefined++-- | 'OpUnsignedShift'+unsignedShift :: Ugen -> Ugen -> Ugen+unsignedShift = mkBinaryOperator OpUnsignedShift undefined+ -- | Ugens are bit patterns. instance Bits Ugen where- (.&.) = mkBinaryOperator OpBitAnd undefined- (.|.) = mkBinaryOperator OpBitOr undefined- xor = mkBinaryOperator OpBitXor undefined- complement = mkUnaryOperator OpBitNot undefined- shift = error "Ugen.shift"- rotate = error "Ugen.rotate"- bitSize = error "Ugen.bitSize"- bit = error "Ugen.bit"- testBit = error "Ugen.testBit"- popCount = error "Ugen.popCount" -- hugs...- bitSizeMaybe = error "Ugen.bitSizeMaybe" -- hugs...- isSigned _ = True+ (.&.) = bitAnd+ (.|.) = bitOr+ xor = bitXOr+ complement = bitNot+ shiftL p q = shiftLeft p (constant q)+ shiftR p q = shiftRight p (constant q)+ rotate = error "Ugen.rotate"+ bitSize = error "Ugen.bitSize"+ bit = error "Ugen.bit"+ testBit = error "Ugen.testBit"+ popCount = error "Ugen.popCount" -- hugs...+ bitSizeMaybe = error "Ugen.bitSizeMaybe" -- hugs...+ isSigned _ = True {- import qualified GHC.Exts as Exts {- base -}
Sound/Sc3/Ugen/Util.hs view
@@ -2,14 +2,13 @@ module Sound.Sc3.Ugen.Util where import qualified Data.Char {- base -}-import Data.Maybe {- base -} import Data.List {- base -}+import Data.Maybe {- base -} import qualified Data.List.Split as Split {- split -} -import qualified Sound.Sc3.Common.Envelope as Envelope {- hsc3 -} import qualified Sound.Sc3.Common.Base as Base {- hsc3 -}-import qualified Sound.Sc3.Common.Math.Operator as Operator {- hsc3 -}+import qualified Sound.Sc3.Common.Envelope as Envelope {- hsc3 -} import qualified Sound.Sc3.Common.Mce as Mce {- hsc3 -} import qualified Sound.Sc3.Common.Rate as Rate {- hsc3 -} import qualified Sound.Sc3.Common.Uid as Uid {- hsc3 -}@@ -32,46 +31,51 @@ ugenTraverse :: (Ugen -> Bool) -> (Ugen -> Ugen) -> Ugen -> Ugen ugenTraverse halt_f map_f u = if halt_f u- then u- else- let recur = ugenTraverse halt_f map_f- in case u of- Primitive_U p ->- let i = ugenInputs p- in map_f (Primitive_U (p {ugenInputs = map recur i}))- Proxy_U (Proxy p ix) ->- let i = ugenInputs p- in map_f (Proxy_U (Proxy (p {ugenInputs = map recur i}) ix))- Mce_U m -> map_f (mce (map recur (mceProxies m)))- Mrg_U (Mrg l r) -> map_f (Mrg_U (Mrg (recur l) (recur r)))- _ -> map_f u+ then u+ else+ let recur = ugenTraverse halt_f map_f+ in case u of+ Primitive_U p ->+ let i = ugenInputs p+ in map_f (Primitive_U (p {ugenInputs = map recur i}))+ Proxy_U (Proxy p ix) ->+ let i = ugenInputs p+ in map_f (Proxy_U (Proxy (p {ugenInputs = map recur i}) ix))+ Mce_U m -> map_f (mce (map recur (mceProxies m)))+ Mrg_U (Mrg l r) -> map_f (Mrg_U (Mrg (recur l) (recur r)))+ _ -> map_f u {- | Right fold of Ugen graph. -> map Sound.Sc3.Ugen.PP.ugen_concise_pp $ ugenFoldr (:) [] (sinOsc ar 440 0 * 0.1)-> map Sound.Sc3.Ugen.PP.ugen_concise_pp $ ugenFoldr (:) [] (pan2 (sinOsc ar 440 0) 0.25 0.1)+> import qualified Sound.Sc3.Ugen.Pp as Pp+> let pp = Pp.ugen_concise_pp+> map pp (ugenFoldr (:) [] (sinOsc ar 440 0 * 0.1))+["*","SinOsc","440","0","0.1"]++> map pp (ugenFoldr (:) [] (pan2 (sinOsc ar 440 0) 0.25 0.1))+["[Pan2@0,Pan2@1]","Pan2@0","SinOsc","440","0","0.25","0.1","Pan2@1","SinOsc","440","0","0.25","0.1"] -} ugenFoldr :: (Ugen -> a -> a) -> a -> Ugen -> a ugenFoldr f st u =- let recur = flip (ugenFoldr f)- in case u of- Primitive_U p -> f u (foldr recur st (ugenInputs p))- Proxy_U (Proxy p _) -> f u (foldr recur st (ugenInputs p)) -- ...- Mce_U m -> f u (foldr recur st (mceProxies m))- Mrg_U (Mrg l r) -> f u (f l (f r st))- _ -> f u st+ let recur = flip (ugenFoldr f)+ in case u of+ Primitive_U p -> f u (foldr recur st (ugenInputs p))+ Proxy_U (Proxy p _) -> f u (foldr recur st (ugenInputs p)) -- ...+ Mce_U m -> f u (foldr recur st (mceProxies m))+ Mrg_U (Mrg l r) -> f u (f l (f r st))+ _ -> f u st -- | Fold over Ugen and collect all bracketing messages from all Primitive nodes. ugenCollectBrackets :: Ugen -> Brackets ugenCollectBrackets =- concatBrackets .- map ugenBrackets .- nub .- ugenFoldr (:) []+ concatBrackets+ . map ugenBrackets+ . nub+ . ugenFoldr (:) [] -- | Are there any brackets at Ugen. ugenHasAnyBrackets :: Ugen -> Bool-ugenHasAnyBrackets = (/= ([],[])) . ugenCollectBrackets+ugenHasAnyBrackets = (/= ([], [])) . ugenCollectBrackets -- * Unit generator node constructors @@ -79,31 +83,33 @@ control_f64 :: Rate.Rate -> Maybe Int -> String -> Sample -> Ugen control_f64 r ix nm d = Control_U (Control r ix nm d False Nothing emptyBrackets) --- | Control input node constructor.------ Note that if the name begins with a t_ prefix the control is /not/--- converted to a triggered control. Please see 'trigControl'.+{- | Control input node constructor.++Note that if the name begins with a t_ prefix the control is /not/+converted to a triggered control. Please see 'trigControl'.+-} control :: Rate.Rate -> String -> Double -> Ugen control r = control_f64 r Nothing -- | Variant of 'control' with meta data. control_m :: Rate.Rate -> String -> Double -> Control_Meta_T3 Double -> Ugen control_m rt nm df meta =- let m = control_meta_t3 id meta- in Control_U (Control rt Nothing nm df False (Just m) emptyBrackets)+ let m = control_meta_t3 id meta+ in Control_U (Control rt Nothing nm df False (Just m) emptyBrackets) -- | Generate group of two controls. Names are generated according to 'control_group_suffixes'-control_pair :: Control_Group -> Rate.Rate -> String -> (Double,Double) -> Control_Meta_T3 Double -> (Ugen,Ugen)-control_pair grp rt nm (df1,df2) meta =- let m = (control_meta_t3 id meta) {controlGroup = Just grp}- in case control_group_suffixes grp of- [lhs,rhs] ->- (Control_U (Control rt Nothing (nm ++ lhs) df1 False (Just m) emptyBrackets)- ,Control_U (Control rt Nothing (nm ++ rhs) df2 False (Just m) emptyBrackets))- _ -> error "control_pair"+control_pair :: Control_Group -> Rate.Rate -> String -> (Double, Double) -> Control_Meta_T3 Double -> (Ugen, Ugen)+control_pair grp rt nm (df1, df2) meta =+ let m = (control_meta_t3 id meta) {controlGroup = Just grp}+ in case control_group_suffixes grp of+ [lhs, rhs] ->+ ( Control_U (Control rt Nothing (nm ++ lhs) df1 False (Just m) emptyBrackets)+ , Control_U (Control rt Nothing (nm ++ rhs) df2 False (Just m) emptyBrackets)+ )+ _ -> error "control_pair" -- | Generate range controls. Names are generated according to 'control_group_suffixes'-control_rng :: Rate.Rate -> String -> (Double,Double) -> Control_Meta_T3 Double -> (Ugen,Ugen)+control_rng :: Rate.Rate -> String -> (Double, Double) -> Control_Meta_T3 Double -> (Ugen, Ugen) control_rng = control_pair Control_Range -- | Triggered (kr) control input node constructor.@@ -117,10 +123,10 @@ -- | Set indices at a list of controls. control_set :: [Ugen] -> [Ugen] control_set =- let f ix u = case u of- Control_U c -> Control_U (c {controlIndex = Just ix})- _ -> error "control_set: non control input?"- in zipWith f [0..]+ let f ix u = case u of+ Control_U c -> Control_U (c {controlIndex = Just ix})+ _ -> error "control_set: non control input?"+ in zipWith f [0 ..] -- * Multiple channel expansion @@ -129,15 +135,15 @@ -- | Multiple channel expansion for two inputs. mce2 :: Ugen -> Ugen -> Ugen-mce2 x y = mce [x,y]+mce2 x y = mce [x, y] -- | Extract two channels from possible Mce, if there is only one channel it is duplicated.-mce2c :: Ugen -> (Ugen,Ugen)+mce2c :: Ugen -> (Ugen, Ugen) mce2c u =- case mceChannels u of- [] -> error "mce2c"- [p] -> (p,p)- p:q:_ -> (p,q)+ case mceChannels u of+ [] -> error "mce2c"+ [p] -> (p, p)+ p : q : _ -> (p, q) -- | Variant of 'mce2c' that requires input to have two channels. unmce2 :: Ugen -> (Ugen, Ugen)@@ -145,7 +151,7 @@ -- | Multiple channel expansion for two inputs. mce3 :: Ugen -> Ugen -> Ugen -> Ugen-mce3 x y z = mce [x,y,z]+mce3 x y z = mce [x, y, z] -- | Variant of 'mce2c' that requires input to have two channels. unmce3 :: Ugen -> (Ugen, Ugen, Ugen)@@ -156,19 +162,19 @@ mceMap f u = mce (map f (mceChannels u)) -- | Map with element index.-map_ix :: ((Int,a) -> b) -> [a] -> [b]-map_ix f = zipWith (curry f) [0..]+map_ix :: ((Int, a) -> b) -> [a] -> [b]+map_ix f = zipWith (curry f) [0 ..] -- | Variant of 'mceMap' with element index.-mce_map_ix :: ((Int,Ugen) -> Ugen) -> Ugen -> Ugen+mce_map_ix :: ((Int, Ugen) -> Ugen) -> Ugen -> Ugen mce_map_ix f u = mce (map_ix f (mceChannels u)) -- | Apply Ugen list operation on Mce contents. mceEdit :: ([Ugen] -> [Ugen]) -> Ugen -> Ugen mceEdit f u =- case u of- Mce_U m -> mce (f (mceProxies m))- _ -> error "mceEdit: non Mce value"+ case u of+ Mce_U m -> mce (f (mceProxies m))+ _ -> error "mceEdit: non Mce value" -- | Reverse order of channels at Mce. mceReverse :: Ugen -> Ugen@@ -177,41 +183,48 @@ -- | Obtain indexed channel at Mce. mceChannel :: Int -> Ugen -> Ugen mceChannel n u =- case u of- Mce_U m -> mceProxies m !! n- _ -> if n == 0 then u else error "mceChannel: non Mce value, non ZERO index"+ case u of+ Mce_U m -> mceProxies m !! n+ _ -> if n == 0 then u else error "mceChannel: non Mce value, non ZERO index" -{- | Obtain indexed channel at Mce, indicex wrap around.+{- | Obtain indexed channel at Mce, indices wrap around. -> map (\ix -> mceChannelWrap ix (mce [1,2,3,4,5])) [0 .. 9]+> map (\ix -> pp (mceChannelWrap ix (mce [1,2,3,4,5]))) [0 .. 9]+["1","2","3","4","5","1","2","3","4","5"] -} mceChannelWrap :: Int -> Ugen -> Ugen mceChannelWrap n u =- case u of- Mce_U m -> mceProxies m !! (n `mod` Mce.mce_length m)- _ -> u+ case u of+ Mce_U m -> mceProxies m !! (n `mod` Mce.mce_length m)+ _ -> u -- | Transpose rows and columns, ie. {{a,b},{c,d}} to {{a,c},{b,d}}. mceTranspose :: Ugen -> Ugen mceTranspose = mce . map mce . transpose . map mceChannels . mceChannels --- | Rotate mce /k/ places to the right, ie. {a,b,c,d} to {d,a,b,c}------ > mceRotate 1 (mce [1,2,3,4]) == mce [4,1,2,3]+{- | Rotate mce /k/ places to the right, ie. {a,b,c,d} to {d,a,b,c}++>>> mceRotate 1 (mce [1,2,3,4]) == mce [4,1,2,3]+True+-} mceRotate :: Int -> Ugen -> Ugen mceRotate k =- let rotateRight n p = let (b,a) = splitAt (length p - n) p in a ++ b+ let rotateRight n p = let (b, a) = splitAt (length p - n) p in a ++ b in mce . rotateRight k . mceChannels --- | 'concat' at mce channels of each input, ie. {{a,b},{c,d}} to {a,b,c,d}.------ > mceConcat (map mce [[1,2],[3,4]]) == mce [1..4]+{- | 'concat' at mce channels of each input, ie. {{a,b},{c,d}} to {a,b,c,d}.++>>> mceConcat (map mce [[1,2],[3,4]]) == mce [1..4]+True+-} mceConcat :: [Ugen] -> Ugen mceConcat = mce . concatMap mceChannels --- | Collect subarrays of mce.------ > mceClump 2 (mce [1,2,3,4]) == mce2 (mce2 1 2) (mce2 3 4)+{- | Collect subarrays of mce.++>>> mceClump 2 (mce [1,2,3,4]) == mce2 (mce2 1 2) (mce2 3 4)+True+-} mceClump :: Int -> Ugen -> Ugen mceClump k = mce . map mce . Split.chunksOf k . mceChannels @@ -228,23 +241,25 @@ -- | Given /unmce/ function make halt mce transform. halt_mce_transform_f :: (a -> [a]) -> [a] -> [a] halt_mce_transform_f f l =- let (l',e) = fromMaybe (error "halt_mce_transform: null?") (Base.sep_last l)- in l' ++ f e+ let (l', e) = fromMaybe (error "halt_mce_transform: null?") (Base.sep_last l)+ in l' ++ f e --- | The halt Mce transform, ie. lift channels of last input into list.--- This is not used by hsc3, but it is used by hsc3-forth and stsc3.------ > halt_mce_transform [1,2,mce2 3 4] == [1,2,3,4]+{- | The halt Mce transform, ie. lift channels of last input into list.+This is not used by hsc3, but it is used by hsc3-forth and stsc3.++>>> halt_mce_transform [1,2,mce2 3 4] == [1,2,3,4]+True+-} halt_mce_transform :: [Ugen] -> [Ugen] halt_mce_transform = halt_mce_transform_f mceChannels -- | If the root node of a Ugen graph is /mce/, transform to /mrg/. prepare_root :: Ugen -> Ugen prepare_root u =- case u of- Mce_U m -> mrg (mceProxies m)- Mrg_U m -> mrg2 (prepare_root (mrgLeft m)) (prepare_root (mrgRight m))- _ -> u+ case u of+ Mce_U m -> mrg (mceProxies m)+ Mrg_U m -> mrg2 (prepare_root (mrgLeft m)) (prepare_root (mrgRight m))+ _ -> u -- * Multiple root graphs @@ -267,70 +282,32 @@ -} unpackLabel :: Bool -> Ugen -> [Ugen] unpackLabel length_prefix u =- case u of- Label_U (Label s) ->- let q = fromEnum '?'- f c = if Data.Char.isAscii c then fromEnum c else q- s' = map (fromIntegral . f) s- in if length_prefix then fromIntegral (length s) : s' else s'- Mce_U m ->- let x = map (unpackLabel length_prefix) (mceProxies m)- in if Base.equal_length_p x- then map mce (transpose x)- else error (show ("unpackLabel: mce length /=",x))- _ -> error (show ("unpackLabel: non-label",u))+ case u of+ Label_U (Label s) ->+ let q = fromEnum '?'+ f c = if Data.Char.isAscii c then fromEnum c else q+ s' = map (fromIntegral . f) s+ in if length_prefix then fromIntegral (length s) : s' else s'+ Mce_U m ->+ let x = map (unpackLabel length_prefix) (mceProxies m)+ in if Base.equal_length_p x+ then map mce (transpose x)+ else error (show ("unpackLabel: mce length /=", x))+ _ -> error (show ("unpackLabel: non-label", u)) -- * Envelope -- | 'mce' of 'Envelope.envelope_sc3_array'. envelope_to_ugen :: Envelope.Envelope Ugen -> Ugen envelope_to_ugen =- let err = error "envGen: bad Envelope"- in mce . fromMaybe err . Envelope.envelope_sc3_array+ let err = error "envGen: bad Envelope"+ in mce . fromMaybe err . Envelope.envelope_sc3_array -- | 'mce' of 'Envelope.envelope_sc3_ienvgen_array'. envelope_to_ienvgen_ugen :: Envelope.Envelope Ugen -> Ugen envelope_to_ienvgen_ugen =- let err = error "envGen: bad Envelope"- in mce . fromMaybe err . Envelope.envelope_sc3_ienvgen_array---- * Bitwise---- | 'Operator.OpBitAnd'-bitAnd :: Ugen -> Ugen -> Ugen-bitAnd = mkBinaryOperator Operator.OpBitAnd undefined---- | 'Operator.OpBitOr'-bitOr :: Ugen -> Ugen -> Ugen-bitOr = mkBinaryOperator Operator.OpBitOr undefined---- | 'Operator.OpBitXor'-bitXOr :: Ugen -> Ugen -> Ugen-bitXOr = mkBinaryOperator Operator.OpBitXor undefined---- | 'Operator.OpBitNot'-bitNot :: Ugen -> Ugen-bitNot = mkUnaryOperator Operator.OpBitNot undefined---- | 'Operator.OpShiftLeft'-shiftLeft :: Ugen -> Ugen -> Ugen-shiftLeft = mkBinaryOperator Operator.OpShiftLeft undefined---- | 'Operator.OpShiftRight'-shiftRight :: Ugen -> Ugen -> Ugen-shiftRight = mkBinaryOperator Operator.OpShiftRight undefined---- | 'Operator.OpUnsignedShift'-unsignedShift :: Ugen -> Ugen -> Ugen-unsignedShift = mkBinaryOperator Operator.OpUnsignedShift undefined---- | 'shiftLeft' operator.-(.<<.) :: Ugen -> Ugen -> Ugen-(.<<.) = shiftLeft---- | 'shiftRight' operator.-(.>>.) :: Ugen -> Ugen -> Ugen-(.>>.) = shiftRight+ let err = error "envGen: bad Envelope"+ in mce . fromMaybe err . Envelope.envelope_sc3_ienvgen_array -- * Rate Flow @@ -338,8 +315,8 @@ rewriteUgenRates :: (Rate.Rate -> Bool) -> Rate.Rate -> Ugen -> Ugen rewriteUgenRates sel_f set_rt = let f u = case u of- Primitive_U (Primitive rt nm i o s z b) -> Primitive_U (Primitive (if sel_f rt then set_rt else rt) nm i o s z b)- _ -> u+ Primitive_U (Primitive rt nm i o s z b) -> Primitive_U (Primitive (if sel_f rt then set_rt else rt) nm i o s z b)+ _ -> u in ugenTraverse (const False) f -- requires endRewrite node (see rsc3-arf) -- | Traverse graph rewriting audio rate nodes as control rate.@@ -352,7 +329,7 @@ -- | Traverse graph rewriting audio and control nodes as initialisation rate. rewriteToInitialisationRate :: Ugen -> Ugen-rewriteToInitialisationRate = rewriteUgenRates (`elem` [Rate.ControlRate,Rate.AudioRate]) Rate.InitialisationRate+rewriteToInitialisationRate = rewriteUgenRates (`elem` [Rate.ControlRate, Rate.AudioRate]) Rate.InitialisationRate -- | Select rewriting function given 'Rate.Rate'. rewriteToRate :: Rate.Rate -> Ugen -> Ugen
emacs/hsc3.el view
@@ -67,7 +67,10 @@ (defun hsc3-send-text-fn (fn str) "Send string STR with haskell function FN applied using the $ operator. If STR has a newline the layout is adjusted accordingly."- (hsc3-send-text (if (string-match "\n" str) (concat fn " $\n" str) (concat fn " $ " str))))+ (hsc3-send-text+ (if (string-match "\n" str)+ (concat fn " $\n" str)+ (concat fn " $ " str)))) (defun hsc3-send-quit () "Send :quit instruction to haskell."@@ -161,6 +164,13 @@ (interactive) (hsc3-send-line "main")) +(defun hsc3-set-region-to-paragraph ()+ "Set the mark at the start and point at the end of the current paragraph."+ (interactive)+ (backward-paragraph)+ (push-mark nil t t)+ (forward-paragraph))+ (defun hsc3-region-string () "Get current region as string." (buffer-substring-no-properties (region-beginning) (region-end)))@@ -174,19 +184,30 @@ "Send region text with haskell function FN to be applied." (hsc3-send-text-fn fn (hsc3-region-string))) -(defun hsc3-play-region ()- "Play region at scsynth."- (interactive)- (hsc3-send-region-fn "Sound.Sc3.scsynthPlay scsynth"))- (defun hsc3-play-region-at (k) "Play region at scsynth. The (one-indexed) prefix agument K indicates which server to send to." (interactive "p") (hsc3-send-region-fn (format "Sound.Sc3.auditionAt (\"%s\",%d + %d) Sound.Sc3.def_play_opt"- hsc3-server-host hsc3-server-port (- k 1))))+ (hsc3-server-host) (hsc3-server-port) k))) +(defun hsc3-play-region ()+ "Play region at scsynth."+ (interactive)+ (hsc3-send-region-fn "Sound.Sc3.audition"))++(defun hsc3-play ()+ "Play at scsynth."+ (interactive)+ (hsc3-set-region-to-paragraph)+ (hsc3-play-region))++(defun hsc3-play-region-stateful ()+ "Play region at scsynth using stateful interface."+ (interactive)+ (hsc3-send-region-fn "Sound.Sc3.scSynthPlay scSynth"))+ (defcustom hsc3-draw-command "draw" "*The un-qualified name of the draw function to use at `hsc3-draw-region'." :type 'string)@@ -196,6 +217,12 @@ (interactive) (hsc3-send-region-fn (format "Sound.Sc3.Ugen.Dot.%s $ wrapOut Nothing " hsc3-draw-command))) +(defun hsc3-draw ()+ "Draw Ugen graph."+ (interactive)+ (hsc3-set-region-to-paragraph)+ (hsc3-draw-region))+ (defun hsc3-dump-ugens-region () "Print region Ugen graph." (interactive)@@ -246,24 +273,30 @@ (interactive) (shell-command-on-region (region-beginning) (region-end) "hsc3-rw uparam expand" nil t)) -(defcustom hsc3-server-host "127.0.0.1"+(defun hsc3-server-protocol ()+ "The protocol that scsynth is listening at."+ (or (getenv "ScProtocol") "Udp"))++(defun hsc3-server-host () "The host that scsynth is listening at."- :type 'string)+ (or (getenv "ScHostname") "127.0.0.1")) -(defcustom hsc3-server-port 57110+(defun hsc3-server-port () "The port that scsynth is listening at."- :type 'integer)+ (read (or (getenv "ScPort") "57110"))) (defun hsc3-with-sc3 (txt) "Sound.Sc3.withSc3 at `hsc3-server-host' and `hsc3-server-port' of the string TXT." (hsc3-send-line- (format "Sound.Sc3.withSc3At (\"%s\",%d) %s" hsc3-server-host hsc3-server-port txt)))+ (format "Sound.Sc3.withSc3At (%s,\"%s\",%d) %s" (hsc3-server-protocol) (hsc3-server-host) (hsc3-server-port) txt))) (defun hsc3-reset-scsynth () "Send Sc3 reset instruction to haskell." (interactive)- (hsc3-send-line "Sound.Sc3.scsynthReset scsynth"))+ (hsc3-with-sc3 "Sound.Sc3.reset")) +;;(hsc3-send-line "Sound.Sc3.scsynthReset scsynth")+ (defun hsc3-start-haskell () "Start the hsc3 haskell process. @@ -281,9 +314,7 @@ (cdr hsc3-interpreter)) (hsc3-set-prompt) (if hsc3-auto-import-modules- (progn- (hsc3-import-standard-modules)- (hsc3-init-scsynth)))+ (hsc3-import-standard-modules)) (hsc3-see-haskell))) (defun hsc3-interrupt-haskell ()@@ -307,7 +338,7 @@ (defun hsc3-quit-scsynth () "Quit." (interactive)- (hsc3-with-sc3 "(Sound.OSC.sendMessage Sound.Sc3.quit)"))+ (hsc3-with-sc3 "(Sound.Osc.sendMessage Sound.Sc3.quit)")) (defcustom hsc3-seq-degree 2 "Number of scsynth processes to address at -seq operations (default=2)."@@ -319,7 +350,7 @@ (hsc3-send-line (format "Sound.Sc3.withSc3AtSeq (\"%s\",%d) %d Sound.Sc3.serverStatus >>= mapM putStrLn . concat"- hsc3-server-host hsc3-server-port hsc3-seq-degree)))+ (hsc3-server-host) (hsc3-server-port) hsc3-seq-degree))) (defun hsc3-play-region-seq () "Sound.Sc3.auditionAtSeq of `hsc3-seq-degree'."@@ -327,7 +358,7 @@ (hsc3-send-region-fn (format "Sound.Sc3.auditionAtSeq (\"%s\",%d) def_play_opt %d"- hsc3-server-host hsc3-server-port hsc3-seq-degree)))+ (hsc3-server-host) (hsc3-server-port) hsc3-seq-degree))) (defun hsc3-reset-scsynth-seq () "Send Sc3 reset instruction to haskell."@@ -335,7 +366,7 @@ (hsc3-send-line (format "Sound.Sc3.withSc3AtSeq_ (\"%s\",%d) %d Sound.Sc3.reset"- hsc3-server-host hsc3-server-port hsc3-seq-degree)))+ (hsc3-server-host) (hsc3-server-port) hsc3-seq-degree))) (defun hsc3-dmenu-ugen-core () "Run dmenu to select a core Sc3 Ugen."@@ -396,7 +427,7 @@ (defun hsc3-init-scsynth () "Initialise the scsynth interpreter variable." (interactive)- (hsc3-send-line "scsynth <- Sound.Sc3.Server.Scsynth.newScsynth"))+ (hsc3-send-line "scSynth <- Sound.Sc3.Server.ScSynth.newScSynth")) (defun hsc3-set-prompt () "Set ghci prompt to hsc3> and the continuation prompt to nil."@@ -427,9 +458,9 @@ (define-key map (kbd "C-c C-c") 'hsc3-send-current-line) (define-key map (kbd "C-c C-h") 'hsc3-help) (define-key map (kbd "C-c C-r") 'hsc3-send-region)- (define-key map (kbd "C-c C-a") 'hsc3-play-region)+ (define-key map (kbd "C-c C-a") 'hsc3-play) (define-key map (kbd "C-c C-S-a") 'hsc3-play-region-seq)- (define-key map (kbd "C-c C-g") 'hsc3-draw-region)+ (define-key map (kbd "C-c C-g") 'hsc3-draw) (define-key map (kbd "C-c C-d") 'hsc3-dump-ugens-region) (define-key map (kbd "C-c C-v") 'hsc3-ui-region) (define-key map (kbd "C-c C-f") 'hsc3-ui-comment)
hsc3.cabal view
@@ -1,16 +1,16 @@ cabal-version: 2.4 Name: hsc3-Version: 0.20+Version: 0.21 Synopsis: Haskell SuperCollider Description: Library for communicating with the SuperCollider synthesiser License: GPL-3.0-only Category: Sound-Copyright: (c) Rohan Drape and others, 2005-2022+Copyright: (c) Rohan Drape and others, 2005-2024 Author: Rohan Drape Maintainer: rd@rohandrape.net Stability: Experimental Homepage: http://rohandrape.net/t/hsc3-Tested-With: GHC == 9.4.2+Tested-With: GHC == 9.10.1 Build-Type: Simple Data-files: README.md@@ -28,7 +28,7 @@ data-ordlist, directory, filepath,- hosc == 0.20.*,+ hosc == 0.21.*, mtl, murmur-hash, network,@@ -39,7 +39,7 @@ transformers, vector Default-Language:Haskell2010- GHC-Options: -Wall -fwarn-tabs+ GHC-Options: -Wall -Wno-x-partial -Wno-incomplete-uni-patterns Exposed-modules: Sound.Sc3 Sound.Sc3.Common Sound.Sc3.Common.Base@@ -76,6 +76,7 @@ Sound.Sc3.Server.Command.Enum Sound.Sc3.Server.Command.Generic Sound.Sc3.Server.Command.Plain+ Sound.Sc3.Server.Command.Plain.Completion Sound.Sc3.Server.Enum Sound.Sc3.Server.Graphdef Sound.Sc3.Server.Graphdef.Binary