-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell SuperCollider -- -- Haskell client for the SuperCollider synthesis server, -- http://audiosynth.com/. -- -- For installation and configuration see the Tutorial at -- http://rd.slavepianos.org/?t=hsc3-texts. -- -- hsc3 has two implementations of the non-determinstic Unit Generators, -- Sound.SC3.UGen.ID and Sound.SC3.UGen.Monad. @package hsc3 @version 0.13 -- | Multiple channel expansion. module Sound.SC3.UGen.MCE -- | Multiple channel expansion. data MCE n MCE_Unit :: n -> MCE n MCE_Vector :: [n] -> MCE n mce_elem :: MCE t -> [t] -- | Extend MCE to specified degree. mce_extend :: Int -> MCE n -> MCE n mce_map :: (a -> b) -> MCE a -> MCE b mce_binop :: (a -> b -> c) -> MCE a -> MCE b -> MCE c instance Eq n => Eq (MCE n) instance Show n => Show (MCE n) instance Fractional n => Fractional (MCE n) instance Num n => Num (MCE n) -- | Interpolation function for envelope segments. Each function takes -- three arguments, x0 is the left or begin value, x1 is -- the right or end value, and t is a (0,1) index. module Sound.SC3.UGen.Envelope.Interpolate type Interpolation_F t = t -> t -> t -> t step :: Interpolation_F t linear :: Num t => Interpolation_F t exponential :: Floating t => Interpolation_F t sine :: Floating t => Interpolation_F t half_pi :: Floating a => a welch :: (Ord t, Floating t) => Interpolation_F t curve :: (Ord t, Floating t) => t -> Interpolation_F t squared :: Floating t => Interpolation_F t cubed :: Floating t => Interpolation_F t -- | Typeclass and functions to manage UGen identifiers. module Sound.SC3.UGen.Identifier -- | Typeclass to constrain UGen identifiers. class ID a resolveID :: ID a => a -> Int -- | Hash value to Int. hash :: Hashable32 a => a -> Int -- | Hash ID to Int. idHash :: ID a => a -> Int -- | Hash IDs p and q and sum to form an Int. -- --
-- 'a' `joinID` (1::Int) == 149929881 --joinID :: (ID a, ID b) => a -> b -> Int instance ID Char instance ID Integer instance ID Int -- | Unique identifier class for use by non-deterministic (noise) and -- non-sharable (demand) unit generators. module Sound.SC3.UGen.UId -- | A class indicating a monad that will generate a sequence of unique -- integer identifiers. class (Functor m, MonadIO m) => UId m where generateUId = fmap hashUnique (liftIO newUnique) generateUId :: UId m => m Int instance (Transport t, Functor io, MonadIO io) => UId (ReaderT t io) instance UId IO -- | Functions to normalise UGen names. module Sound.SC3.UGen.Name -- | Convert from hsc3 name to SC3 name. -- --
-- toSC3Name "sinOsc" == "SinOsc" -- toSC3Name "lfSaw" == "LFSaw" -- toSC3Name "pv_Copy" == "PV_Copy" -- map toSC3Name ["bpf","fft","tpv"] == ["BPF","FFT","TPV"] --toSC3Name :: String -> String -- | Inverse of toSC3Name. -- --
-- let nm = ["SinOsc","LFSaw","PV_Copy"] -- in map fromSC3Name nm == ["sinOsc","lfSaw","pv_Copy"] ---- --
-- map fromSC3Name ["BPF","FFT","TPV"] == ["bpf","fft","tpv"] --fromSC3Name :: String -> String -- | Reader for LPC analysis data files. module Sound.SC3.UGen.External.LPC -- | LPC analysis data. data LPC LPC :: LPCHeader -> [LPCFrame] -> LPC lpcHeader :: LPC -> LPCHeader lpcFrames :: LPC -> [LPCFrame] -- | LPC analysis meta-data. data LPCHeader LPCHeader :: Int -> Int -> Int -> Int -> Double -> Double -> Double -> Int -> LPCHeader lpcHeaderSize :: LPCHeader -> Int lpcMagic :: LPCHeader -> Int lpcNPoles :: LPCHeader -> Int lpcFrameSize :: LPCHeader -> Int lpcFrameRate :: LPCHeader -> Double lpcSampleRate :: LPCHeader -> Double lpcAnalysisDuration :: LPCHeader -> Double lpcNFrames :: LPCHeader -> Int -- | LPC analysis frame data. type LPCFrame = [Double] -- | Read an lpanal format LPC data file. lpcRead :: FilePath -> IO LPC -- | Analysis data in format required by the sc3 LPC UGens. lpcSC3 :: LPC -> [Double] instance Eq LPCHeader instance Show LPCHeader instance Eq LPC instance Show LPC -- | Reader for ATS analyis data files. module Sound.SC3.UGen.External.ATS -- | ATS analysis data. data ATS ATS :: ATSHeader -> [Double] -> ATS atsHeader :: ATS -> ATSHeader atsData :: ATS -> [Double] -- | ATS analysis meta-data. data ATSHeader ATSHeader :: Double -> Int -> Int -> Int -> Int -> Double -> Double -> Double -> Int -> Int -> ATSHeader atsSampleRate :: ATSHeader -> Double atsFrameSize :: ATSHeader -> Int atsWindowSize :: ATSHeader -> Int atsNPartials :: ATSHeader -> Int atsNFrames :: ATSHeader -> Int atsMaxAmplitude :: ATSHeader -> Double atsMaxFrequency :: ATSHeader -> Double atsAnalysisDuration :: ATSHeader -> Double atsFileType :: ATSHeader -> Int atsFrameLength :: ATSHeader -> Int -- | ATS analysis frame data. type ATSFrame = [Double] -- | Extract set of ATSFrames from ATS. atsFrames :: ATS -> [ATSFrame] -- | Read an ATS data file. atsRead :: FilePath -> IO ATS instance Eq ATSHeader instance Show ATSHeader instance Eq ATS instance Show ATS -- | Enumerations of the unary and binary math unit generators. module Sound.SC3.UGen.Operator -- | Enumeration of SC3 unary operator UGens. data Unary Neg :: Unary Not :: Unary IsNil :: Unary NotNil :: Unary BitNot :: Unary Abs :: Unary AsFloat :: Unary AsInt :: Unary Ceil :: Unary Floor :: Unary Frac :: Unary Sign :: Unary Squared :: Unary Cubed :: Unary Sqrt :: Unary Exp :: Unary Recip :: Unary MIDICPS :: Unary CPSMIDI :: Unary MIDIRatio :: Unary RatioMIDI :: Unary DbAmp :: Unary AmpDb :: Unary OctCPS :: Unary CPSOct :: Unary Log :: Unary Log2 :: Unary Log10 :: Unary Sin :: Unary Cos :: Unary Tan :: Unary ArcSin :: Unary ArcCos :: Unary ArcTan :: Unary SinH :: Unary CosH :: Unary TanH :: Unary Rand :: Unary Rand2 :: Unary LinRand :: Unary BiLinRand :: Unary Sum3Rand :: Unary Distort :: Unary SoftClip :: Unary Coin :: Unary DigitValue :: Unary Silence :: Unary Thru :: Unary RectWindow :: Unary HanWindow :: Unary WelchWindow :: Unary TriWindow :: Unary Ramp :: Unary SCurve :: Unary -- | Enumeration of SC3 unary operator UGens. data Binary Add :: Binary Sub :: Binary Mul :: Binary IDiv :: Binary FDiv :: Binary Mod :: Binary EQ_ :: Binary NE :: Binary LT_ :: Binary GT_ :: Binary LE :: Binary GE :: Binary Min :: Binary Max :: Binary BitAnd :: Binary BitOr :: Binary BitXor :: Binary LCM :: Binary GCD :: Binary Round :: Binary RoundUp :: Binary Trunc :: Binary Atan2 :: Binary Hypot :: Binary Hypotx :: Binary Pow :: Binary ShiftLeft :: Binary ShiftRight :: Binary UnsignedShift :: Binary Fill :: Binary Ring1 :: Binary Ring2 :: Binary Ring3 :: Binary Ring4 :: Binary DifSqr :: Binary SumSqr :: Binary SqrSum :: Binary SqrDif :: Binary AbsDif :: Binary Thresh :: Binary AMClip :: Binary ScaleNeg :: Binary Clip2 :: Binary Excess :: Binary Fold2 :: Binary Wrap2 :: Binary FirstArg :: Binary RandRange :: Binary ExpRandRange :: Binary -- | Table of symbolic names for standard unary operators. unaryTable :: [(Int, String)] -- | Lookup possibly symbolic name for standard unary operators. unaryName :: Int -> String -- | Table of symbolic names for standard binary operators. binaryTable :: [(Int, String)] -- | Lookup possibly symbolic name for standard binary operators. -- --
-- map binaryName [1,2,8] == ["-","*","<"] --binaryName :: Int -> String -- | Reverse lookup. rlookup :: Eq b => b -> [(a, b)] -> Maybe a -- | Given name of binary operator derive index. -- --
-- map binaryIndex ["*","Mul","Ring1"] == [2,2,30] --binaryIndex :: String -> Int -- | Given name of unary operator derive index. -- --
-- map unaryIndex ["-","Neg","Cubed"] == [0,0,13] --unaryIndex :: String -> Int instance Eq Unary instance Show Unary instance Enum Unary instance Read Unary instance Eq Binary instance Show Binary instance Enum Binary instance Read Binary -- | Operating rate definitions and utilities. module Sound.SC3.UGen.Rate -- | Operating rate of unit generator. data Rate IR :: Rate KR :: Rate AR :: Rate DR :: Rate -- | Integer rate identifier, as required for scsynth bytecode. rateId :: Rate -> Int -- | Rates as ordered for filter rate selection. rate_ord :: Rate -> Int -- | Color identifiers for each Rate. rate_color :: Rate -> String -- | Set of all Rate values. all_rates :: [Rate] instance Eq Rate instance Show Rate instance Enum Rate instance Bounded Rate instance Ord Rate module Sound.SC3.UGen.Type -- | Data type for internalised identifier at UGen. data UGenId NoId :: UGenId UId :: Int -> UGenId -- | Constants. -- --
-- Constant 3 == Constant 3 -- (Constant 3 > Constant 1) == True --data Constant Constant :: Double -> Constant constantValue :: Constant -> Double -- | Control inputs. data Control Control :: Rate -> String -> Double -> Bool -> Control controlOperatingRate :: Control -> Rate controlName :: Control -> String controlDefault :: Control -> Double controlTriggered :: Control -> Bool -- | Labels. data Label Label :: String -> Label ugenLabel :: Label -> String -- | Unit generator output descriptor. type Output = Rate -- | Operating mode of unary and binary operators. newtype Special Special :: Int -> Special -- | UGen primitives. data Primitive Primitive :: Rate -> String -> [UGen] -> [Output] -> Special -> UGenId -> Primitive ugenRate :: Primitive -> Rate ugenName :: Primitive -> String ugenInputs :: Primitive -> [UGen] ugenOutputs :: Primitive -> [Output] ugenSpecial :: Primitive -> Special ugenId :: Primitive -> UGenId -- | Proxy to multiple channel input. data Proxy Proxy :: Primitive -> Int -> Proxy proxySource :: Proxy -> Primitive proxyIndex :: Proxy -> Int -- | Multiple root graph. data MRG MRG :: UGen -> UGen -> MRG mrgLeft :: MRG -> UGen mrgRight :: MRG -> UGen -- | Union type of Unit Generator forms. data UGen Constant_U :: Constant -> UGen Control_U :: Control -> UGen Label_U :: Label -> UGen Primitive_U :: Primitive -> UGen Proxy_U :: Proxy -> UGen MCE_U :: (MCE UGen) -> UGen MRG_U :: MRG -> UGen -- | Constant node predicate. isConstant :: UGen -> Bool -- | True if input is a sink UGen, ie. has no outputs. isSink :: UGen -> Bool -- | Ensure input UGen is valid, ie. not a sink. checkInput :: UGen -> UGen -- | Value of Constant_U Constant. u_constant :: UGen -> Double -- | Constant value node constructor. constant :: Real a => a -> UGen -- | Multiple channel expansion node constructor. mce :: [UGen] -> UGen -- | Multiple root graph constructor. mrg :: [UGen] -> UGen -- | Unit generator proxy node constructor. proxy :: UGen -> Int -> UGen -- | Type specified mce_elem. mceProxies :: MCE UGen -> [UGen] -- | Multiple channel expansion node (MCE_U) predicate. isMCE :: UGen -> Bool -- | Output channels of UGen as a list. mceChannels :: UGen -> [UGen] -- | Number of channels to expand to. mceDegree :: UGen -> Int -- | Extend UGen to specified degree. mceExtend :: Int -> UGen -> [UGen] -- | Apply MCE transform to a list of inputs. mceInputTransform :: [UGen] -> Maybe [[UGen]] -- | Build a UGen after MCE transformation of inputs. mceBuild :: ([UGen] -> UGen) -> [UGen] -> UGen -- | Determine the rate of a UGen. rateOf :: UGen -> Rate -- | Apply proxy transformation if required. proxify :: UGen -> UGen -- | Construct proxied and multiple channel expanded UGen. mkUGen :: Maybe ([Double] -> Double) -> [Rate] -> Maybe Rate -> String -> [UGen] -> Int -> Special -> UGenId -> UGen -- | Operator UGen constructor. mkOperator :: ([Double] -> Double) -> String -> [UGen] -> Int -> UGen -- | Unary math constructor with constant optimization. mkUnaryOperator :: Unary -> (Double -> Double) -> UGen -> UGen -- | Binary math constructor with constant optimization. -- --
-- 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_optimize :: Binary -> (Double -> Double -> Double) -> (Either Double Double -> Bool) -> UGen -> UGen -> UGen -- | Binary math constructor with constant optimization. mkBinaryOperator :: Binary -> (Double -> Double -> Double) -> UGen -> UGen -> UGen -- | Hash function for unit generators. hashUGen :: UGen -> Int instance Eq UGenId instance Show UGenId instance Eq Constant instance Ord Constant instance Show Constant instance Eq Control instance Show Control instance Eq Label instance Show Label instance Eq Special instance Show Special instance Eq UGen instance Show UGen instance Eq MRG instance Show MRG instance Eq Proxy instance Show Proxy instance Eq Primitive instance Show Primitive instance ID UGen instance Bits UGen instance Random UGen instance Enum UGen instance Ord UGen instance Integral UGen instance Real UGen instance Floating UGen instance Fractional UGen instance Num UGen -- | UGen data structure representation and associated functions. module Sound.SC3.UGen.UGen -- | Lookup operator name for operator UGens, else UGen name. ugen_user_name :: String -> Special -> String -- | Depth first traversal of graph at u applying f to -- each node. ugenTraverse :: (UGen -> UGen) -> UGen -> UGen -- | Right fold of UGen graph. ugenFoldr :: (UGen -> a -> a) -> a -> UGen -> a -- | 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 tr_control. control :: Rate -> String -> Double -> UGen -- | Triggered (kr) control input node constructor. tr_control :: String -> Double -> UGen -- | Multiple root graph node constructor. mrg2 :: UGen -> UGen -> UGen -- | Multiple channel expansion for two inputs. mce2 :: UGen -> UGen -> UGen -- | Extract two channels from possible MCE. mce2c :: UGen -> (UGen, UGen) -- | Multiple channel expansion for two inputs. mce3 :: UGen -> UGen -> UGen -> UGen -- | Apply a function to each channel at a unit generator. mceMap :: (UGen -> UGen) -> UGen -> UGen -- | Apply UGen list operation on MCE contents. mceEdit :: ([UGen] -> [UGen]) -> UGen -> UGen -- | Reverse order of channels at MCE. mceReverse :: UGen -> UGen -- | Obtain indexed channel at MCE. mceChannel :: Int -> UGen -> UGen -- | Transpose rows and columns, ie. {{a,b},{c,d}} to {{a,c},{b,d}}. mceTranspose :: UGen -> UGen -- | Collapse mce by summing (see also mix and mixN). mceSum :: UGen -> UGen -- | Lift a String to a UGen label (ie. for poll). label :: String -> UGen -- | Are lists of equal length? -- --
-- equal_length_p ["t1","t2"] == True -- equal_length_p ["t","t1","t2"] == False --equal_length_p :: [[a]] -> Bool -- | Unpack a label to a length prefixed list of Constants. There is -- a special case for mce nodes, but it requires labels to be equal -- length. Properly, poll would not unpack the label, it would -- be done by the synthdef builder. unpackLabel :: UGen -> [UGen] -- | Oscillator constructor with constrained set of operating Rates. mk_osc :: [Rate] -> UGenId -> Rate -> String -> [UGen] -> Int -> UGen -- | UGenId used for deterministic UGens. no_id :: UGenId -- | Oscillator constructor with all_rates. mkOsc :: Rate -> String -> [UGen] -> Int -> UGen -- | Oscillator constructor, rate restricted variant. mkOscR :: [Rate] -> Rate -> String -> [UGen] -> Int -> UGen toUId :: ID a => a -> UGenId -- | Rate restricted oscillator constructor, setting identifier. mkOscIdR :: ID a => [Rate] -> a -> Rate -> String -> [UGen] -> Int -> UGen -- | Oscillator constructor, setting identifier. mkOscId :: ID a => a -> Rate -> String -> [UGen] -> Int -> UGen -- | Provided UGenId variant of mkOscMCE. mk_osc_mce :: UGenId -> Rate -> String -> [UGen] -> UGen -> Int -> UGen -- | Variant oscillator constructor with MCE collapsing input. mkOscMCE :: Rate -> String -> [UGen] -> UGen -> Int -> UGen -- | Variant oscillator constructor with MCE collapsing input. mkOscMCEId :: ID a => a -> Rate -> String -> [UGen] -> UGen -> Int -> UGen -- | Rate constrained filter UGen constructor. mk_filter :: [Rate] -> UGenId -> String -> [UGen] -> Int -> UGen -- | Filter UGen constructor. mkFilter :: String -> [UGen] -> Int -> UGen -- | Filter UGen constructor. mkFilterR :: [Rate] -> String -> [UGen] -> Int -> UGen -- | Filter UGen constructor. mkFilterId :: ID a => a -> String -> [UGen] -> Int -> UGen -- | Variant filter with rate derived from keyed input. mkFilterKeyed :: String -> Int -> [UGen] -> Int -> UGen -- | Provided UGenId filter with mce input. mk_filter_mce :: [Rate] -> UGenId -> String -> [UGen] -> UGen -> Int -> UGen -- | Variant filter constructor with MCE collapsing input. mkFilterMCER :: [Rate] -> String -> [UGen] -> UGen -> Int -> UGen -- | Variant filter constructor with MCE collapsing input. mkFilterMCE :: String -> [UGen] -> UGen -> Int -> UGen -- | Variant filter constructor with MCE collapsing input. mkFilterMCEId :: ID a => a -> String -> [UGen] -> UGen -> Int -> UGen -- | Information unit generators are very specialized. mkInfo :: String -> UGen bitAnd :: UGen -> UGen -> UGen bitOr :: UGen -> UGen -> UGen bitXOr :: UGen -> UGen -> UGen bitNot :: UGen -> UGen shiftLeft :: UGen -> UGen -> UGen shiftRight :: UGen -> UGen -> UGen unsignedShift :: UGen -> UGen -> UGen (.<<.) :: UGen -> UGen -> UGen (.>>.) :: UGen -> UGen -> UGen -- | Signal analysis unit generators. module Sound.SC3.UGen.Analysis -- | Amplitude follower. amplitude :: Rate -> UGen -> UGen -> UGen -> UGen -- | Calculates mean average of audio or control rate signal. averageOutput :: UGen -> UGen -> UGen -- | Autocorrelation pitch follower. pitch :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Slope of signal. slope :: UGen -> UGen -- | Zero crossing frequency follower. zeroCrossing :: UGen -> UGen -- | Chaotic functions. module Sound.SC3.UGen.Chaos -- | Chaotic noise. crackle :: Rate -> UGen -> UGen -- | Cusp map chaotic generator (linear interpolation). cuspL :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -- | Cusp map chaotic generator (no interpolation). cuspN :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -- | Feedback sine with chaotic phase indexing (cubic interpolation). fbSineC :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Feedback sine with chaotic phase indexing (linear interpolation). fbSineL :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Feedback sine with chaotic phase indexing (no interpolation). fbSineN :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Gingerbreadman map chaotic generator gbmanL :: Rate -> UGen -> UGen -> UGen -> UGen -- | Gingerbreadman map chaotic generator gbmanN :: Rate -> UGen -> UGen -> UGen -> UGen -- | Henon map chaotic generator (cubic interpolation). henonC :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Henon map chaotic generator (linear interpolation). henonL :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Henon map chaotic generator (no interpolation). henonN :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Latoocarfian chaotic function (cubic interpolation). latoocarfianC :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Latoocarfian chaotic function (linear interpolation). latoocarfianL :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Latoocarfian chaotic function (no interpolation). latoocarfianN :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Linear congruential chaotic generator (cubic interpolation). linCongC :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Linear congruential chaotic generator (linear interpolation). linCongL :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Linear congruential chaotic generator (no interpolation). linCongN :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | The logistic map y = chaosParam * y * (1.0 - y) logistic :: Rate -> UGen -> UGen -> UGen -> UGen -- | Lorenz chaotic generator (linear interpolation). lorenzL :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | General quadratic map chaotic generator (cubic interpolation). quadC :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | General quadratic map chaotic generator (linear interpolation). quadL :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | General quadratic map chaotic generator (no interpolation). quadN :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Bindings to unit generators not distributed with SuperCollider proper. module Sound.SC3.UGen.External -- | Variant FM synthesis node. dfm1 :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Emulation of the sound generation hardware of the Atari TIA chip. atari2600 :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | POKEY Chip Sound Simulator mzPokey :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Phase modulation oscillator matrix. fm7 :: [[UGen]] -> [[UGen]] -> UGen -- | Tartini model pitch tracker. tartini :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Constant Q transform pitch follower. qitch :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Bindings to unit generators in sc3-plugins. module Sound.SC3.UGen.External.SC3_Plugins -- | Emulation of AY (aka YM) soundchip, used in Spectrum/Atari. ay :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Convert frequency value to value appropriate for AY tone inputs. ayFreqToTone :: Fractional a => a -> a -- | Concatenative cross-synthesis. concat' :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Concatenative cross-synthesis (variant). concat2 :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Brown noise. disintegrator :: ID a => a -> UGen -> UGen -> UGen -> UGen -- | Resynthesize sinusoidal ATS analysis data. atsSynth :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Resynthesize sinusoidal and critical noise ATS analysis data. atsNoiSynth :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Granular synthesis with FM grains. fmGrain :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Granular synthesis with FM grains and user supplied envelope. fmGrainB :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Resynthesize LPC analysis data. lpcSynth :: UGen -> UGen -> UGen -> UGen -- | Extract cps, rmso and err signals from LPC data. lpcVals :: Rate -> UGen -> UGen -> UGen -- | Metronome metro :: Rate -> UGen -> UGen -> UGen -- | Invert FFT amplitude data. pv_Invert :: UGen -> UGen -- | Triangular waveguide mesh of a drum-like membrane. membraneCircle :: UGen -> UGen -> UGen -> UGen -- | Triangular waveguide mesh of a drum-like membrane. membraneHexagon :: UGen -> UGen -> UGen -> UGen -- | Tracking Phase Vocoder tpv :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | STK bowed string model. stkBowed :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | STK flute model. stkFlute :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | STK mandolin model. stkMandolin :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | STK modal bar models. stkModalBar :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | STK shaker models. stkShakers :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Vocal simulation due to W. Kaegi. vosim :: UGen -> UGen -> UGen -> UGen -> UGen -- | Time-domain filter unit generators. module Sound.SC3.UGen.Filter -- | Audio to control rate converter. a2K :: UGen -> UGen -- | Allpass filter (no interpolation) allpassN :: UGen -> UGen -> UGen -> UGen -> UGen -- | Allpass filter (linear interpolation) allpassL :: UGen -> UGen -> UGen -> UGen -> UGen -- | Allpass filter (cubic interpolation) allpassC :: UGen -> UGen -> UGen -> UGen -> UGen -- | Basic psychoacoustic amplitude compensation. ampComp :: UGen -> UGen -> UGen -> UGen -- | ANSI A-weighting curve psychoacoustic amplitude compensation. ampCompA :: UGen -> UGen -> UGen -> UGen -> UGen -- | Bandpass filter bpf :: UGen -> UGen -> UGen -> UGen -- | Two zero fixed midpass filter. bpz2 :: UGen -> UGen -- | Band reject filter brf :: UGen -> UGen -> UGen -> UGen -- | Two zero fixed midcut filter. brz2 :: UGen -> UGen -- | Clip input between lower and upper bounds. clip :: UGen -> UGen -> UGen -> UGen -- | Comb filter (no interpolation) combN :: UGen -> UGen -> UGen -> UGen -> UGen -- | Comb filter (linear interpolation) combL :: UGen -> UGen -> UGen -> UGen -> UGen -- | Comb filter (cubic interpolation) combC :: UGen -> UGen -> UGen -> UGen -> UGen -- | Compressor,expander,limiter,gate,ducker. compander :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Convert signal to modal pitch. degreeToKey :: UGen -> UGen -> UGen -> UGen -- | Exponential decay. decay :: UGen -> UGen -> UGen -- | Exponential decay (equvalent to $decay dcy - decay atk$). decay2 :: UGen -> UGen -> UGen -> UGen -- | Single sample delay. delay1 :: UGen -> UGen -- | Two sample delay. delay2 :: UGen -> UGen -- | Simple delay line (cubic interpolation). delayC :: UGen -> UGen -> UGen -> UGen -- | Simple delay line (linear interpolation). delayL :: UGen -> UGen -> UGen -> UGen -- | Simple delay line (no interpolation). delayN :: UGen -> UGen -> UGen -> UGen -- | Tap a delay line from a DelTapWr UGen delTapRd :: UGen -> UGen -> UGen -> UGen -> UGen -- | Write to a buffer for a DelTapRd UGen delTapWr :: Rate -> UGen -> UGen -> UGen -- | Fold to range. fold :: UGen -> UGen -> UGen -> UGen -- | FOF like filter. formlet :: UGen -> UGen -> UGen -> UGen -> UGen -- | First order filter section. fos :: UGen -> UGen -> UGen -> UGen -> UGen -- | A simple reverb. freeVerb :: UGen -> UGen -> UGen -> UGen -> UGen -- | A simple reverb (two channel). freeVerb2 :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Gate. gate :: UGen -> UGen -> UGen -- | A less-simple reverb. gVerb :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Hash input values. hasher :: UGen -> UGen -- | Hilbert transform. hilbert :: UGen -> UGen -- | Highpass filter. hpf :: UGen -> UGen -> UGen -- | Two point difference filter. hpz1 :: UGen -> UGen -- | Two zero fixed highpass filter. hpz2 :: UGen -> UGen -- | Is signal within specified range. inRange :: UGen -> UGen -> UGen -> UGen -- | Control to audio rate converter. k2A :: UGen -> UGen -- | Fixed resonator filter bank. klank :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Format frequency, amplitude and decay time data as required for klank. klankSpec :: [UGen] -> [UGen] -> [UGen] -> UGen -- | Variant for non-UGen inputs. klankSpec' :: [Double] -> [Double] -> [Double] -> UGen -- | Variant of klankSpec for MCE inputs. klankSpec_mce :: UGen -> UGen -> UGen -> UGen -- | Simple averaging filter. lag :: UGen -> UGen -> UGen -- | Nested lag filter. lag2 :: UGen -> UGen -> UGen -- | Twice nested lag filter. lag3 :: UGen -> UGen -> UGen -- | Lag variant with separate upward and downward times. lagUD :: UGen -> UGen -> UGen -> UGen -- | Nested lag filter. lag2UD :: UGen -> UGen -> UGen -> UGen -- | Twice nested lag filter. lag3UD :: UGen -> UGen -> UGen -> UGen -- | Last value before chang above threshhold. lastValue :: UGen -> UGen -> UGen -- | Sample and hold. latch :: UGen -> UGen -> UGen -- | Remove DC offset. leakDC :: UGen -> UGen -> UGen -- | Limiter. limiter :: UGen -> UGen -> UGen -> UGen -- | Map from a linear range to an exponential range. linExp :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Lowpass filter. lpf :: UGen -> UGen -> UGen -- | Two point average filter. lpz1 :: UGen -> UGen -- | Two zero fixed lowpass filter. lpz2 :: UGen -> UGen -- | Masks off bits in the mantissa of signal. mantissaMask :: UGen -> UGen -> UGen -- | Median filter. median :: UGen -> UGen -> UGen -- | Parametric filter. midEQ :: UGen -> UGen -> UGen -> UGen -> UGen -- | Moog VCF implementation. moogFF :: UGen -> UGen -> UGen -> UGen -> UGen -- | Most changed input. mostChange :: UGen -> UGen -> UGen -- | Multiply add ternary operator. mulAdd :: UGen -> UGen -> UGen -> UGen -- | Normalizer (flattens dynamics). normalizer :: UGen -> UGen -> UGen -> UGen -- | One pole filter. onePole :: UGen -> UGen -> UGen -- | One zero filter. oneZero :: UGen -> UGen -> UGen -- | Maximum value. peak :: UGen -> UGen -> UGen -- | Simple time domain pitch shifter. pitchShift :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Karplus-Strong synthesis. pluck :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Trigger counter. pulseCount :: UGen -> UGen -> UGen -- | Pass every nth trigger. pulseDivider :: UGen -> UGen -> UGen -> UGen -- | Linear lag. ramp :: UGen -> UGen -> UGen -- | Resonant highpass filter. rhpf :: UGen -> UGen -> UGen -> UGen -- | Resonant lowpass filter. rlpf :: UGen -> UGen -> UGen -> UGen -- | Resonant filter. resonz :: UGen -> UGen -> UGen -> UGen -- | Ringing filter (equivalent to Resonz). ringz :: UGen -> UGen -> UGen -> UGen -- | Track maximum level. runningMax :: UGen -> UGen -> UGen -- | Track minimum level. runningMin :: UGen -> UGen -> UGen -- | Running sum. runningSum :: UGen -> UGen -> UGen -- | Select output from array of inputs. select :: UGen -> UGen -> UGen -- | Send a trigger message from the server back to the all registered -- clients. sendTrig :: UGen -> UGen -> UGen -> UGen -- | Send a reply message from the server back to the all registered -- clients. sendReply :: UGen -> UGen -> String -> [UGen] -> UGen -- | Set-reset flip flop. setResetFF :: UGen -> UGen -> UGen -- | Wave shaper. shaper :: UGen -> UGen -> UGen -- | Remove transients and higher frequencies. slew :: UGen -> UGen -> UGen -> UGen -- | Second order filter section (biquad). sos :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Stepper pulse counter. stepper :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Triggered linear ramp. sweep :: UGen -> UGen -> UGen -- | Control rate trigger to audio rate trigger converter t2A :: UGen -> UGen -> UGen -- | Audio rate trigger to control rate trigger converter t2K :: UGen -> UGen -- | Delay trigger by specified interval. tDelay :: UGen -> UGen -> UGen -- | Time since last triggered. timer :: UGen -> UGen -- | Toggle flip flop. toggleFF :: UGen -> UGen -- | When triggered output trigger for specified duration. trig :: UGen -> UGen -> UGen -- | When triggered output unit signal for specified duration. trig1 :: UGen -> UGen -> UGen -- | Two pole filter. twoPole :: UGen -> UGen -> UGen -> UGen -- | Two zero filter. twoZero :: UGen -> UGen -> UGen -> UGen -- | Variable shaped lag. varLag :: UGen -> UGen -> UGen -> UGen -- | Wrap to range. wrap :: UGen -> UGen -> UGen -> UGen -- | Index into a table with a signal. wrapIndex :: UGen -> UGen -> UGen -- | Bi-quad low-pass filter. bLowPass :: UGen -> UGen -> UGen -> UGen -- | Bi-quad high-pass filter. bHiPass :: UGen -> UGen -> UGen -> UGen -- | Bi-quad all-pass filter. bAllPass :: UGen -> UGen -> UGen -> UGen -- | Bi-quad band-pass filter. bBandPass :: UGen -> UGen -> UGen -> UGen -- | Bi-quad band-stop filter. bBandStop :: UGen -> UGen -> UGen -> UGen -- | Bi-quad peak equaliser. bPeakEQ :: UGen -> UGen -> UGen -> UGen -> UGen -- | Bi-quad low shelf filter. bLowShelf :: UGen -> UGen -> UGen -> UGen -> UGen -- | Bi-quad high shelf filter. bHiShelf :: UGen -> UGen -> UGen -> UGen -> UGen -- | Calculate coefficients for bi-quad low pass filter. bLowPassCoef :: Floating a => a -> a -> a -> (a, a, a, a, a) -- | Granular synthesis unit generators. module Sound.SC3.UGen.Granular -- | Granular synthesis with sound stored in a buffer. grainBuf :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Granular synthesis with frequency modulated sine tones. grainFM :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Granulate an input signal. grainIn :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Granular synthesis with sine tones. grainSin :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Warp a buffer with a time pointer. warp1 :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Unit generators to access information related to the synthesis -- environment. module Sound.SC3.UGen.Information -- | Sample rate of synthesis server, frames per second. sampleRate :: UGen -- | Duration of one sample, seconds. sampleDur :: UGen -- | Duration of one sample, radians. radiansPerSample :: UGen -- | Control rate of synthesis server, periods per second. controlRate :: UGen -- | Sub-sample accurate scheduling offset. subsampleOffset :: UGen -- | Number of allocated output audio rate buses. numOutputBuses :: UGen -- | Number of allocated input audio rate buses. numInputBuses :: UGen -- | Number of allocated audio rate buses. numAudioBuses :: UGen -- | Number of allocated control rate buses. numControlBuses :: UGen -- | Number of allocated buffers. numBuffers :: UGen -- | Number of runnings synthesis nodes. numRunningSynths :: UGen -- | Poll value of input UGen when triggered. poll :: UGen -> UGen -> UGen -> UGen -> UGen -- | Variant of poll that generates an mrg value with the -- input signal at left. poll' :: UGen -> UGen -> UGen -> UGen -> UGen -- | Non-standard mathematical classes and class instances. module Sound.SC3.UGen.Math -- | Variant on Eq class, result is of the same type as the values -- compared. class EqE a (==*) :: EqE a => a -> a -> a (/=*) :: EqE a => a -> a -> a -- | Variant on Ord class, result is of the same type as the values -- compared. class OrdE a (<*) :: OrdE a => a -> a -> a (<=*) :: OrdE a => a -> a -> a (>*) :: OrdE a => a -> a -> a (>=*) :: OrdE a => a -> a -> a -- | Variant of RealFrac with non Integral results. class RealFracE a properFractionE :: RealFracE a => a -> (a, a) truncateE :: RealFracE a => a -> a roundE :: RealFracE a => a -> a ceilingE :: RealFracE a => a -> a floorE :: RealFracE a => a -> a -- | Variant of truncate. truncatef :: RealFrac a => a -> a -- | Variant of round. roundf :: RealFrac a => a -> a -- | Variant of ceiling. ceilingf :: RealFrac a => a -> a -- | Variant of floor. floorf :: RealFrac a => a -> a -- | Variant of SC3 roundTo function. roundTo_ :: Double -> Double -> Double -- | UGen form or roundTo_. roundTo :: UGen -> UGen -> UGen -- | UGen form of ceilingE. ceil :: UGen -> UGen -- | Floating form of midiCPS. midiCPS' :: Floating a => a -> a -- | 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 = log10 a * 20 asFloat = error "asFloat" asInt = error "asInt" cpsMIDI a = (log2 (a * (1.0 / 440.0)) * 12.0) + 69.0 cpsOct a = log2 (a * (1.0 / 440.0)) + 4.75 cubed a = a * a * a dbAmp a = 10 ** (a * 0.05) distort = error "distort" frac = error "frac" isNil a = if a == 0.0 then 0.0 else 1.0 log10 = logBase 10 log2 = logBase 2 midiCPS = midiCPS' midiRatio a = 2.0 ** (a * (1.0 / 12.0)) notE a = if a > 0.0 then 0.0 else 1.0 notNil a = if a /= 0.0 then 0.0 else 1.0 octCPS a = 440.0 * (2.0 ** (a - 4.75)) ramp_ _ = error "ramp_" ratioMIDI a = 12.0 * log2 a softClip = error "softClip" squared a = a * a ampDb :: UnaryOp a => a -> a asFloat :: UnaryOp a => a -> a asInt :: UnaryOp a => a -> a cpsMIDI :: UnaryOp a => a -> a cpsOct :: UnaryOp a => a -> a cubed :: UnaryOp a => a -> a dbAmp :: UnaryOp a => a -> a distort :: UnaryOp a => a -> a frac :: UnaryOp a => a -> a isNil :: UnaryOp a => a -> a log10 :: UnaryOp a => a -> a log2 :: UnaryOp a => a -> a midiCPS :: UnaryOp a => a -> a midiRatio :: UnaryOp a => a -> a notE :: UnaryOp a => a -> a notNil :: UnaryOp a => a -> a octCPS :: UnaryOp a => a -> a ramp_ :: UnaryOp a => a -> a ratioMIDI :: UnaryOp a => a -> a softClip :: UnaryOp a => a -> a squared :: UnaryOp a => a -> a -- | Binary operator class. class (Floating a, Ord a) => BinaryOp a where absDif a b = abs (a - b) amClip a b = if b <= 0 then 0 else a * b atan2E a b = atan (b / a) clip2 a b = clip_ a (- b) b difSqr a b = (a * a) - (b * b) excess a b = a - clip_ a (- b) b exprandRange = error "exprandRange" fill = error "fill" firstArg a _ = a gcdE = error "gcdE" hypot = error "hypot" hypotx = error "hypotx" iDiv = error "iDiv" lcmE = error "lcmE" randRange = error "randRange" ring1 a b = a * b + a ring2 a b = a * b + a + b ring3 a b = a * a * b ring4 a b = a * a * b - a * b * b scaleNeg a b = (abs a - a) * b' + a where b' = 0.5 * b + 0.5 sqrDif a b = (a - b) * (a - b) sqrSum a b = (a + b) * (a + b) sumSqr a b = (a * a) + (b * b) thresh a b = if a < b then 0 else a trunc = error "trunc" absDif :: BinaryOp a => a -> a -> a amClip :: BinaryOp a => a -> a -> a atan2E :: BinaryOp a => a -> a -> a clip2 :: BinaryOp a => a -> a -> a difSqr :: BinaryOp a => a -> a -> a excess :: BinaryOp a => a -> a -> a exprandRange :: BinaryOp a => a -> a -> a fill :: BinaryOp a => a -> a -> a firstArg :: BinaryOp a => a -> a -> a fold2 :: BinaryOp a => a -> a -> a gcdE :: BinaryOp a => a -> a -> a hypot :: BinaryOp a => a -> a -> a hypotx :: BinaryOp a => a -> a -> a iDiv :: BinaryOp a => a -> a -> a lcmE :: BinaryOp a => a -> a -> a modE :: BinaryOp a => a -> a -> a randRange :: BinaryOp a => a -> a -> a ring1 :: BinaryOp a => a -> a -> a ring2 :: BinaryOp a => a -> a -> a ring3 :: BinaryOp a => a -> a -> a ring4 :: BinaryOp a => a -> a -> a roundUp :: BinaryOp a => a -> a -> a scaleNeg :: BinaryOp a => a -> a -> a sqrDif :: BinaryOp a => a -> a -> a sqrSum :: BinaryOp a => a -> a -> a sumSqr :: BinaryOp a => a -> a -> a thresh :: BinaryOp a => a -> a -> a trunc :: BinaryOp a => a -> a -> a wrap2 :: BinaryOp a => a -> a -> a -- | The SC3 % operator is libc fmod 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 `fmod` 1.2 -- ~= 0.3 -- (-1.5) `fmod` 1.2 -- ~= 0.9 -- 1.5 `fmod` (-1.2) -- ~= -0.9 -- (-1.5) `fmod` (-1.2) -- ~= -0.3 ---- --
-- 1.2 `fmod` 1.5 -- ~= 1.2 -- (-1.2) `fmod` 1.5 -- ~= 0.3 -- 1.2 `fmod` (-1.5) -- ~= -0.3 -- (-1.2) `fmod` (-1.5) -- ~= -1.2 --fmod :: Double -> Double -> Double -- | Wrap k to within range (i,j), ie. -- AbstractFunction.wrap. -- --
-- map (wrap' 5 10) [3..12] == [8,9,5,6,7,8,9,10,6,7] --wrap' :: Double -> Double -> Double -> Double -- | Generic variant of wrap'. -- --
-- map (genericWrap (5::Integer) 10) [3..12] == [8,9,5,6,7,8,9,10,6,7] --genericWrap :: (Ord a, Num a) => a -> a -> a -> a -- | Variant of wrap' with SC3 argument ordering. -- --
-- map (\n -> wrap_ n 5 10) [3..12] == map (wrap' 5 10) [3..12] --wrap_ :: Double -> Double -> Double -> Double -- | 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 -- | Variant of foldToRange with SC3 argument ordering. fold_ :: (Ord a, Num a) => a -> a -> a -> a -- | Clip k to within range (i,j), -- --
-- map (clip' 5 10) [3..12] == [5,5,5,6,7,8,9,10,10,10] --clip' :: Ord a => a -> a -> a -> a -- | Variant of clip' with SC3 argument ordering. clip_ :: Ord a => a -> a -> a -> a instance BinaryOp UGen instance BinaryOp Double instance UnaryOp UGen instance UnaryOp Double instance RealFracE UGen instance RealFracE Double instance OrdE UGen instance OrdE Double instance EqE UGen instance EqE Double -- | Machine listening & feature extraction analysis unit generators. module Sound.SC3.UGen.MachineListening -- | Autocorrelation beat tracker. beatTrack :: UGen -> UGen -> UGen -- | Template matching beat tracker. beatTrack2 :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Extraction of instantaneous loudness in sones. loudness :: UGen -> UGen -> UGen -> UGen -- | Translate onset type string to constant UGen value. onsetType :: Num a => String -> a -- | Onset detector. onsets :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Onset detector with default values for minor parameters. onsets' :: UGen -> UGen -> UGen -> UGen -- | Key tracker. keyTrack :: UGen -> UGen -> UGen -> UGen -> UGen -- | Mel frequency cepstral coefficients. mfcc :: Int -> UGen -> UGen -- | Spectral Flatness measure. specFlatness :: UGen -> UGen -- | Find a percentile of FFT magnitude spectrum. specPcile :: UGen -> UGen -> UGen -> UGen -- | Spectral centroid. specCentroid :: UGen -> UGen -- | Sound field location and analysis unit generators. module Sound.SC3.UGen.Panner -- | Two channel equal power panner. pan2 :: UGen -> UGen -> UGen -> UGen -- | Two channel linear pan. linPan2 :: UGen -> UGen -> UGen -> UGen -- | Four channel equal power panner. pan4 :: UGen -> UGen -> UGen -> UGen -> UGen -- | Stereo signal balancer. balance2 :: UGen -> UGen -> UGen -> UGen -> UGen -- | Rotate a sound field. rotate2 :: UGen -> UGen -> UGen -> UGen -- | Ambisonic B-format panner. panB :: UGen -> UGen -> UGen -> UGen -> UGen -- | 2D Ambisonic B-format panner. panB2 :: UGen -> UGen -> UGen -> UGen -- | 2D Ambisonic B-format panner. biPanB2 :: UGen -> UGen -> UGen -> UGen -> UGen -- | 2D Ambisonic B-format decoder. decodeB2 :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -- | Azimuth panner. panAz :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Equal power two channel cross fade. xFade2 :: UGen -> UGen -> UGen -> UGen -> UGen -- | Two channel linear crossfade. linXFade2 :: UGen -> UGen -> UGen -> UGen -- | Wavelet unit generators (Nick Collins). module Sound.SC3.UGen.Wavelets -- | Forward wavelet transform. dwt :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Inverse of dwt. idwt :: UGen -> UGen -> UGen -> UGen -> UGen -- | Pass wavelets above a threshold, ie. pv_MagAbove. wt_MagAbove :: UGen -> UGen -> UGen -- | Pass wavelets with scale above threshold. wt_FilterScale :: UGen -> UGen -> UGen -- | Pass wavelets with time above threshold. wt_TimeWipe :: UGen -> UGen -> UGen -- | Product in W domain, ie. pv_Mul. wt_Mul :: UGen -> UGen -> UGen -- | Non-deterministic noise UGens. module Sound.SC3.UGen.Noise.ID -- | Brown noise. brownNoise :: ID a => a -> Rate -> UGen -- | Clip noise. clipNoise :: ID a => a -> Rate -> UGen -- | Randomly pass or block triggers. coinGate :: ID a => a -> UGen -> UGen -> UGen -- | Random impulses in (-1, 1). dust2 :: ID a => a -> Rate -> UGen -> UGen -- | Random impulse in (0,1). dust :: ID a => a -> Rate -> UGen -> UGen -- | Random value in exponential distribution. expRand :: ID a => a -> UGen -> UGen -> UGen -- | Gray noise. grayNoise :: ID a => a -> Rate -> UGen -- | Random integer in uniform distribution. iRand :: ID a => a -> UGen -> UGen -> UGen -- | Clip noise. lfClipNoise :: ID a => a -> Rate -> UGen -> UGen -- | Dynamic clip noise. lfdClipNoise :: ID a => a -> Rate -> UGen -> UGen -- | Dynamic step noise. lfdNoise0 :: ID a => a -> Rate -> UGen -> UGen -- | Dynamic ramp noise. lfdNoise1 :: ID a => a -> Rate -> UGen -> UGen -- | Dynamic quadratic noise lfdNoise2 :: ID a => a -> Rate -> UGen -> UGen -- | Dynamic cubic noise lfdNoise3 :: ID a => a -> Rate -> UGen -> UGen -- | Step noise. lfNoise0 :: ID a => a -> Rate -> UGen -> UGen -- | Ramp noise. lfNoise1 :: ID a => a -> Rate -> UGen -> UGen -- | Quadratic noise. lfNoise2 :: ID a => a -> Rate -> UGen -> UGen -- | Random value in skewed linear distribution. linRand :: ID a => a -> UGen -> UGen -> UGen -> UGen -- | Random value in sum of n linear distribution. nRand :: ID a => a -> UGen -> UGen -> UGen -> UGen -- | Pink noise. pinkNoise :: ID a => a -> Rate -> UGen -- | Random value in uniform distribution. rand :: ID a => a -> UGen -> UGen -> UGen -- | Random value in exponential distribution on trigger. tExpRand :: ID a => a -> UGen -> UGen -> UGen -> UGen -- | Random integer in uniform distribution on trigger. tIRand :: ID a => a -> UGen -> UGen -> UGen -> UGen -- | Random value in uniform distribution on trigger. tRand :: ID a => a -> UGen -> UGen -> UGen -> UGen -- | Triggered windex. tWindex :: ID a => a -> UGen -> UGen -> UGen -> UGen -- | White noise. whiteNoise :: ID a => a -> Rate -> UGen -- | Lifting functions from explicit identifier UGen functions to -- monadic UGen constructors. module Sound.SC3.UGen.UGen.Lift -- | Lift base UGen to monadic form. liftU :: UId m => (Int -> a -> UGen) -> a -> m UGen -- | Lift base UGen to monadic form. liftU2 :: UId m => (Int -> a -> b -> UGen) -> a -> b -> m UGen -- | Lift base UGen to monadic form. liftU3 :: UId m => (Int -> a -> b -> c -> UGen) -> a -> b -> c -> m UGen -- | Lift base UGen to monadic form. liftU4 :: UId m => (Int -> a -> b -> c -> d -> UGen) -> a -> b -> c -> d -> m UGen -- | Monad constructors for noise UGens. module Sound.SC3.UGen.Noise.Monad -- | Brown noise. brownNoise :: UId m => Rate -> m UGen -- | Clip noise. clipNoise :: UId m => Rate -> m UGen -- | Randomly pass or block triggers. coinGate :: UId m => UGen -> UGen -> m UGen -- | Random impulses in (-1, 1). dust2 :: UId m => Rate -> UGen -> m UGen -- | Random impulse in (0,1). dust :: UId m => Rate -> UGen -> m UGen -- | Random value in exponential distribution. expRand :: UId m => UGen -> UGen -> m UGen -- | Gray noise. grayNoise :: UId m => Rate -> m UGen -- | Random integer in uniform distribution. iRand :: UId m => UGen -> UGen -> m UGen -- | Clip noise. lfClipNoise :: UId m => Rate -> UGen -> m UGen -- | Dynamic clip noise. lfdClipNoise :: UId m => Rate -> UGen -> m UGen -- | Dynamic step noise. lfdNoise0 :: UId m => Rate -> UGen -> m UGen -- | Dynamic ramp noise. lfdNoise1 :: UId m => Rate -> UGen -> m UGen -- | Dynamic quadratic noise lfdNoise2 :: UId m => Rate -> UGen -> m UGen -- | Dynamic cubic noise lfdNoise3 :: UId m => Rate -> UGen -> m UGen -- | Step noise. lfNoise0 :: UId m => Rate -> UGen -> m UGen -- | Ramp noise. lfNoise1 :: UId m => Rate -> UGen -> m UGen -- | Quadratic noise. lfNoise2 :: UId m => Rate -> UGen -> m UGen -- | Random value in skewed linear distribution. linRand :: UId m => UGen -> UGen -> UGen -> m UGen -- | Random value in sum of n linear distribution. nRand :: UId m => UGen -> UGen -> UGen -> m UGen -- | Pink noise. pinkNoise :: UId m => Rate -> m UGen -- | Random value in uniform distribution. rand :: UId m => UGen -> UGen -> m UGen -- | Random value in exponential distribution on trigger. tExpRand :: UId m => UGen -> UGen -> UGen -> m UGen -- | Random integer in uniform distribution on trigger. tIRand :: UId m => UGen -> UGen -> UGen -> m UGen -- | Random value in uniform distribution on trigger. tRand :: UId m => UGen -> UGen -> UGen -> m UGen -- | Triggered windex. tWindex :: UId m => UGen -> UGen -> UGen -> m UGen -- | White noise. whiteNoise :: UId m => Rate -> m UGen -- | Non-deterministic external UGens. module Sound.SC3.UGen.External.ID -- | random walk step lfBrownNoise0 :: ID a => a -> Rate -> UGen -> UGen -> UGen -> UGen -- | random walk linear interp lfBrownNoise1 :: ID a => a -> Rate -> UGen -> UGen -> UGen -> UGen -- | random walk cubic interp lfBrownNoise2 :: ID a => a -> Rate -> UGen -> UGen -> UGen -> UGen -- | Non-deterministic FFT UGens. module Sound.SC3.UGen.FFT.ID -- | Randomize order of bins. pv_BinScramble :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen -- | Randomly clear bins. pv_RandComb :: ID i => i -> UGen -> UGen -> UGen -> UGen -- | Cross fade, copying bins in random order. pv_RandWipe :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen -- | Monad constructors for non-deterministic FFT UGens. module Sound.SC3.UGen.FFT.Monad -- | Randomize order of bins. pv_BinScramble :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen -- | Randomly clear bins. pv_RandComb :: UId m => UGen -> UGen -> UGen -> m UGen -- | Cross fade, copying bins in random order. pv_RandWipe :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen -- | Plain UGen constructor functions. -- --
-- let {s = ugen "SinOsc" AR [440,0] 1
-- ;m = binop "*" AR s 0.1
-- ;o = ugen "Out" AR [0,m] 0}
-- in Sound.SC3.Server.Play.audition o >> Sound.SC3.UGen.Dot.draw o
--
--
-- -- audition (out 0 (sinOsc AR 440 0 * 0.1)) --module Sound.SC3.UGen.Plain -- | Variant of mkUGen. mk_plain :: Rate -> String -> [UGen] -> Int -> Special -> UGenId -> UGen -- | Construct unary operator, the name can textual or symbolic. -- --
-- uop "-" AR 1 == uop "Neg" AR 1 --uop :: String -> Rate -> UGen -> UGen -- | Construct binary operator, the name can textual or symbolic. -- --
-- binop "*" AR 1 2 == binop "Mul" AR 1 2 -- binop "*" AR (ugen "SinOsc" AR [440,0] 1) 0.1 == sinOsc AR 440 0 * 0.1 -- ugenName (binop "*" AR 1 2) == "BinaryOpUGen" --binop :: String -> Rate -> UGen -> UGen -> UGen -- | Construct deterministic UGen. -- --
-- let o = ugen "SinOsc" AR [440,0] 1 -- o == sinOsc AR 440 0 -- ugen "Out" AR [0,o] 0 == out 0 (sinOsc AR 440 0) --ugen :: String -> Rate -> [UGen] -> Int -> UGen -- | Construct non-deterministic UGen. -- --
-- import Sound.SC3.ID -- nondet "WhiteNoise" (UId (fromEnum 'a')) AR [] 1 == whiteNoise 'a' AR --nondet :: String -> UGenId -> Rate -> [UGen] -> Int -> UGen -- | Functions to re-write assigned node identifiers at UGen graphs. Used -- carefully it allows for composition of sub-graphs with psuedo-random -- nodes. module Sound.SC3.UGen.Protect -- | Collect Ids at UGen graph ugenIds :: UGen -> [UGenId] -- | Apply f at UId, or no-op at NoId. atUGenId :: (Int -> Int) -> UGenId -> UGenId -- | Add idHash of e to all Primitive_U at u. uprotect :: ID a => a -> UGen -> UGen -- | Variant of uprotect with subsequent identifiers derived by -- incrementing initial identifier. uprotect' :: ID a => a -> [UGen] -> [UGen] -- | Make n parallel instances of UGen with protected -- identifiers. uclone' :: ID a => a -> Int -> UGen -> [UGen] -- | mce variant of uclone'. uclone :: ID a => a -> Int -> UGen -> UGen -- | Left to right UGen function composition with UGenId protection. ucompose :: ID a => a -> [UGen -> UGen] -> UGen -> UGen -- | Make n sequential instances of f with protected Ids. useq :: ID a => a -> Int -> (UGen -> UGen) -> UGen -> UGen -- | Functions to provide mediated access to the SC3 help system. module Sound.SC3.UGen.Help -- | Guarded variant of getEnv with default value. get_env_default :: String -> String -> IO String -- | Read the environment variable SC3_HELP, the default value is -- ~/.local/share/SuperCollider/Help. sc3HelpDirectory :: IO String -- | Locate path to indicated SC3 class help file. -- --
-- import System.FilePath -- -- d <- sc3HelpDirectory -- h <- sc3HelpClassFile d "SinOsc" -- h == Just (d </> "Classes/SinOsc.html") --sc3HelpClassFile :: FilePath -> String -> IO (Maybe FilePath) -- | Generate path to indicated SC3 operator help file. -- --
-- sc3HelpOperatorEntry "." "+" == "./Overviews/Operators.html#.+" --sc3HelpOperatorEntry :: FilePath -> String -> FilePath -- | Generate path to indicated SC3 method help. -- --
-- sc3HelpMethod "." '*' ("C","m") == "./Classes/C.html#*m"
--
sc3HelpMethod :: FilePath -> Char -> (String, String) -> FilePath
-- | Generate path to indicated SC3 class method help.
--
--
-- sc3HelpClassMethod "." ("C","m") == "./Classes/C.html#*m"
--
sc3HelpClassMethod :: FilePath -> (String, String) -> FilePath
-- | Generate path to indicated SC3 instance method help.
--
--
-- sc3HelpInstanceMethod "." ("C","m") == "./Classes/C.html#-m"
--
sc3HelpInstanceMethod :: FilePath -> (String, String) -> FilePath
-- | The name of the local SC3 Help file documenting u. Deletes
-- @ to allow use on haddock quoted comments.
--
-- -- import Sound.SC3.UGen.Name -- -- ugenSC3HelpFile "Collection.*fill" -- ugenSC3HelpFile "Collection.inject" -- ugenSC3HelpFile (toSC3Name "sinOsc") --ugenSC3HelpFile :: String -> IO FilePath -- | Use BROWSER or x-www-browser to view SC3 help file -- for u. -- --
-- import Sound.SC3.UGen.Name -- -- viewSC3Help (toSC3Name "Collection.*fill") -- viewSC3Help (toSC3Name "Collection.inject") -- viewSC3Help (toSC3Name "sinOsc") --viewSC3Help :: String -> IO () -- | Functions to provide mediated access to the SC3 help system. module Sound.SC3.Server.Help -- | Generate path to indicated SC3 instance method help. -- --
-- let r = "./Reference/Server-Command-Reference.html#/b_alloc" -- in sc3HelpServerCommand "." "b_alloc" == r --sc3_server_command_ref :: FilePath -> String -> FilePath -- | Lookup SC3 help file for server command c. -- --
-- Sound.SC3.Server.Help.viewServerHelp "/b_allocRead" -- viewServerHelp "done" --viewServerHelp :: String -> IO () -- | Data types for enumerated and non signal unit generator inputs. module Sound.SC3.UGen.Enum -- | Loop indicator input. data Loop Loop :: Loop NoLoop :: Loop WithLoop :: UGen -> Loop -- | Resolve Loop. from_loop :: Loop -> UGen -- | Interpolation indicator input. data Interpolation NoInterpolation :: Interpolation LinearInterpolation :: Interpolation CubicInterpolation :: Interpolation Interpolation :: UGen -> Interpolation -- | Resolve Interpolation. from_interpolation :: Interpolation -> UGen -- | Completion mode indicator input. data DoneAction DoNothing :: DoneAction PauseSynth :: DoneAction RemoveSynth :: DoneAction DoneAction :: UGen -> DoneAction -- | Resolve DoneAction. from_done_action :: DoneAction -> UGen -- | Warp interpolation indicator input. data Warp Linear :: Warp Exponential :: Warp Warp :: UGen -> Warp -- | Resolve Warp. from_warp :: Warp -> UGen -- | Envelope curve indicator input. data Envelope_Curve a EnvStep :: Envelope_Curve a EnvLin :: Envelope_Curve a EnvExp :: Envelope_Curve a EnvSin :: Envelope_Curve a -- | Note: not implemented at SC3 EnvCos :: Envelope_Curve a EnvNum :: a -> Envelope_Curve a EnvSqr :: Envelope_Curve a EnvCub :: Envelope_Curve a type EnvCurve = Envelope_Curve UGen -- | Convert Envelope_Curve to shape value. -- --
-- map env_curve_shape [EnvSin,EnvSqr] == [3,6] --env_curve_shape :: Num a => Envelope_Curve a -> a -- | The value of EnvCurve is non-zero for EnvNum. -- --
-- map env_curve_value [EnvCos,EnvNum 2] == [0,2] --env_curve_value :: Num a => Envelope_Curve a -> a env_curve_interpolation_f :: (Ord t, Floating t) => Envelope_Curve t -> Interpolation_F t -- | Enumeration of flags for '/b_gen' command. data B_Gen Normalise :: B_Gen Wavetable :: B_Gen Clear :: B_Gen -- | B_Gen to bit number. -- --
-- map b_gen_bit [minBound .. maxBound] --b_gen_bit :: B_Gen -> Int -- | Set of B_Gen to flag. -- --
-- b_gen_flag [minBound .. maxBound] == 7 --b_gen_flag :: [B_Gen] -> Int instance Eq Loop instance Show Loop instance Eq Interpolation instance Show Interpolation instance Eq DoneAction instance Show DoneAction instance Eq Warp instance Show Warp instance Eq a => Eq (Envelope_Curve a) instance Show a => Show (Envelope_Curve a) instance Eq B_Gen instance Enum B_Gen instance Bounded B_Gen instance Show B_Gen -- | Unit generators to query, read and write audio buffers. module Sound.SC3.UGen.Buffer -- | Buffer channel count. bufChannels :: Rate -> UGen -> UGen -- | Buffer duration, in seconds. bufDur :: Rate -> UGen -> UGen -- | Buffer frame count. bufFrames :: Rate -> UGen -> UGen -- | Buffer rate scalar with respect to server sample rate. bufRateScale :: Rate -> UGen -> UGen -- | Buffer sample rate. bufSampleRate :: Rate -> UGen -> UGen -- | Buffer sample count (ie. frame count by channel count). bufSamples :: Rate -> UGen -> UGen -- | Allpass filter (cubic interpolation). bufAllpassC :: UGen -> UGen -> UGen -> UGen -> UGen -- | Allpass filter (linear interpolation). bufAllpassL :: UGen -> UGen -> UGen -> UGen -> UGen -- | Allpass filter (no interpolation). bufAllpassN :: UGen -> UGen -> UGen -> UGen -> UGen -- | Comb filter (cubic interpolation). bufCombC :: UGen -> UGen -> UGen -> UGen -> UGen -- | Comb filter (linear interpolation). bufCombL :: UGen -> UGen -> UGen -> UGen -> UGen -- | Comb filter (no interpolation). bufCombN :: UGen -> UGen -> UGen -> UGen -> UGen -- | Delay line (cubic interpolation). bufDelayC :: UGen -> UGen -> UGen -> UGen -- | Delay line (linear interpolation). bufDelayL :: UGen -> UGen -> UGen -> UGen -- | Delay line (no interpolation). bufDelayN :: UGen -> UGen -> UGen -> UGen -- | Buffer reader. bufRd :: Int -> Rate -> UGen -> UGen -> Loop -> Interpolation -> UGen -- | Buffer reader (no interpolation). bufRdN :: Int -> Rate -> UGen -> UGen -> Loop -> UGen -- | Buffer reader (linear interpolation). bufRdL :: Int -> Rate -> UGen -> UGen -> Loop -> UGen -- | Buffer reader (cubic interpolation). bufRdC :: Int -> Rate -> UGen -> UGen -> Loop -> UGen -- | Buffer writer. bufWr :: UGen -> UGen -> Loop -> UGen -> UGen -- | Search a buffer for a value. detectIndex :: UGen -> UGen -> UGen -- | Index into table with signal. index :: UGen -> UGen -> UGen -- | Interpolating search in ordered table. indexInBetween :: UGen -> UGen -> UGen -- | Wavetable oscillator. osc :: Rate -> UGen -> UGen -> UGen -> UGen -- | Wavetable oscillator. oscN :: Rate -> UGen -> UGen -> UGen -> UGen -- | Buffer playback. playBuf :: Int -> Rate -> UGen -> UGen -> UGen -> UGen -> Loop -> DoneAction -> UGen -- | Buffer recording. recordBuf :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> Loop -> UGen -> DoneAction -> UGen -> UGen -- | Triggered buffer shuffler (grain generator). tGrains :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Three variable wavetable oscillator. vOsc3 :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -- | Variable wavetable oscillator. vOsc :: Rate -> UGen -> UGen -> UGen -> UGen -- | Allocate a buffer local to the synth. localBuf :: ID i => i -> UGen -> UGen -> UGen -- | Set the maximum number of local buffers in a synth. maxLocalBufs :: UGen -> UGen -- | Set local buffer values. setBuf :: UGen -> [UGen] -> UGen -> UGen -- | Generate a localBuf and use setBuf to initialise it. asLocalBuf :: ID i => i -> [UGen] -> UGen -- | Demand rate unit generators. module Sound.SC3.UGen.Demand -- | Infinte repeat counter for demand rate unit generators. dinf :: UGen -- | Demand results from demand rate ugens. demand :: UGen -> UGen -> UGen -> UGen -- | Demand envelope generator. demandEnvGen :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> DoneAction -> UGen -- | Demand results from demand rate ugens. duty :: Rate -> UGen -> UGen -> DoneAction -> UGen -> UGen -- | Demand results as trigger from demand rate ugens. tDuty :: Rate -> UGen -> UGen -> DoneAction -> UGen -> UGen -> UGen -- | Disk file input and output UGens. module Sound.SC3.UGen.DiskIO -- | Stream soundfile from disk. -- --
-- let e = envCoord [(0,0),(1/4,1),(1,0)] 1 1 EnvLin -- in envelope_sc3_array e == Just [0,2,-99,-99,1,1/4,1,0,0,3/4,1,0] --envCoord :: Num a => [(a, a)] -> a -> a -> Envelope_Curve a -> Envelope a -- | Trapezoidal envelope generator. The arguments are: 1. shape -- determines the sustain time as a proportion of dur, zero is a -- triangular envelope, one a rectangular 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 :: (Num a, OrdE a) => a -> a -> a -> a -> Envelope a -- | Variant envPerc with user specified 'Envelope_Curve a'. envPerc' :: Num a => a -> a -> a -> (Envelope_Curve a, Envelope_Curve a) -> Envelope a -- | Percussive envelope, with attack, release, level and curve inputs. envPerc :: Num a => a -> a -> Envelope a -- | Triangular envelope, with duration and level inputs. -- --
-- let e = envTriangle 1 0.1 -- in envelope_sc3_array e = Just [0,2,-99,-99,0.1,0.5,1,0,0,0.5,1,0] --envTriangle :: (Num a, Fractional a) => a -> a -> Envelope a -- | Sine envelope, with duration and level inputs. -- --
-- let e = envSine 0 0.1 -- in envelope_sc3_array e == Just [0,2,-99,-99,0.1,0,3.0,0,0,0,3,0] --envSine :: (Num a, Fractional a) => a -> a -> Envelope a -- | Variant of envLinen with user specified 'Envelope_Curve a'. envLinen' :: Num a => a -> a -> a -> a -> (Envelope_Curve a, Envelope_Curve a, Envelope_Curve a) -> Envelope a -- | Linear envelope parameter constructor. envLinen :: Num a => a -> a -> a -> a -> Envelope a -- | Parameters for ADSR envelopes. data ADSR a ADSR :: a -> a -> a -> a -> a -> (Envelope_Curve a, Envelope_Curve a, Envelope_Curve a) -> a -> ADSR a attackTime :: ADSR a -> a decayTime :: ADSR a -> a sustainLevel :: ADSR a -> a releaseTime :: ADSR a -> a peakLevel :: ADSR a -> a curve :: ADSR a -> (Envelope_Curve a, Envelope_Curve a, Envelope_Curve a) bias :: ADSR a -> a -- | Attack, decay, sustain, release envelope parameter constructor. envADSR :: Num a => a -> a -> a -> a -> a -> Envelope_Curve a -> a -> Envelope a -- | Record (ADSR) variant of envADSR. envADSR_r :: Num a => ADSR a -> Envelope a -- | Attack, sustain, release envelope parameter constructor. envASR :: Num a => a -> a -> a -> Envelope_Curve a -> Envelope a -- | Audio bus, control bus and input device unit generators. module Sound.SC3.UGen.IO -- | Read signal from an audio or control bus. in' :: Int -> Rate -> UGen -> UGen -- | Define and read from buses local to a synthesis node. localIn :: Int -> Rate -> UGen -- | Control rate bus input with lag. lagIn :: Int -> UGen -> UGen -> UGen -- | Read signal from a bus without erasing it. inFeedback :: Int -> UGen -> UGen -- | Generate a trigger anytime a bus is set. inTrig :: Int -> UGen -> UGen -- | Mix signal to an audio or control bus. out :: UGen -> UGen -> UGen -- | Over-write signal to an audio or control bus. replaceOut :: UGen -> UGen -> UGen -- | Mix signal to an audio bus at precise sample offset. offsetOut :: UGen -> UGen -> UGen -- | Write signal to bus local to a synthesis node, see localIn. localOut :: UGen -> UGen -- | Crossfade signal to an audio or control bus. xOut :: UGen -> UGen -> UGen -> UGen -- | Write to a shared control bus. sharedOut :: UGen -> UGen -> UGen -- | Read from a shared control bus. sharedIn :: Int -> UGen -> UGen -- | Report the status of a particular key. keyState :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -- | Report the status of the first pointer button. mouseButton :: Rate -> UGen -> UGen -> UGen -> UGen -- | Cursor UGen, X axis. mouseX :: Rate -> UGen -> UGen -> Warp -> UGen -> UGen -- | Cursor UGen, Y axis. mouseY :: Rate -> UGen -> UGen -> Warp -> UGen -> UGen -- | Control variant. trigControl :: Int -> Rate -> UGen -- | Set the synth's random generator ID. randID :: Rate -> UGen -> UGen -- | Set the synth's random generator seed. randSeed :: Rate -> UGen -> UGen -> UGen -- | Oscillators. module Sound.SC3.UGen.Oscillator -- | Band Limited ImPulse generator. blip :: Rate -> UGen -> UGen -> UGen -- | Chorusing wavetable oscillator. cOsc :: Rate -> UGen -> UGen -> UGen -> UGen -- | Create a constant amplitude signal. dc :: Rate -> UGen -> UGen -- | Formant oscillator. formant :: Rate -> UGen -> UGen -> UGen -> UGen -- | Fast sine wave oscillator implemented using a ringing filter. fSinOsc :: Rate -> UGen -> UGen -> UGen -- | Dynamic stochastic synthesis generator conceived by Iannis Xenakis. gendy1 :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Impulse oscillator (non band limited). impulse :: Rate -> UGen -> UGen -> UGen -- | Bank of fixed oscillators. klang :: Rate -> UGen -> UGen -> UGen -> UGen -- | Format frequency, amplitude and phase data as required for klang. klangSpec :: [UGen] -> [UGen] -> [UGen] -> UGen -- | Variant of klangSpec for non-UGen inputs. klangSpec' :: [Double] -> [Double] -> [Double] -> UGen -- | Variant of klangSpec for MCE inputs. klangSpec_mce :: UGen -> UGen -> UGen -> UGen -- | A sine like shape made of two cubic pieces. lfCub :: Rate -> UGen -> UGen -> UGen -- | Gaussian function oscillator lfGauss :: Rate -> UGen -> UGen -> UGen -> Loop -> DoneAction -> UGen -- | A sine like shape made of two cubic pieces. lfPar :: Rate -> UGen -> UGen -> UGen -- | Pulse oscillator (non band limited). lfPulse :: Rate -> UGen -> UGen -> UGen -> UGen -- | Sawtooth oscillator (non band limited). lfSaw :: Rate -> UGen -> UGen -> UGen -- | Sawtooth oscillator (non band limited). lfTri :: Rate -> UGen -> UGen -> UGen -- | Triggered linear ramp between two levels. phasor :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Pulse wave generator (band limited). pulse :: Rate -> UGen -> UGen -> UGen -- | Sawtooth oscillator (band limited). saw :: Rate -> UGen -> UGen -- | Sine oscillator. sinOsc :: Rate -> UGen -> UGen -> UGen -- | Feedback FM oscillator. sinOscFB :: Rate -> UGen -> UGen -> UGen -- | Sawtooth oscillator hard synched to a fundamental. syncSaw :: Rate -> UGen -> UGen -> UGen -- | Variable duty sawtooth oscillator. varSaw :: Rate -> UGen -> UGen -> UGen -> UGen -- | The Vibrato oscillator models a slow frequency modulation. vibrato :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Common unit generator graphs. module Sound.SC3.UGen.Composite -- | Dynamic klang, dynamic sine oscillator bank dynKlang :: Rate -> UGen -> UGen -> UGen -> UGen -- | Dynamic klank, set of non-fixed resonating filters. dynKlank :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Frequency shifter, in terms of Hilbert UGen. freqShift :: UGen -> UGen -> UGen -> UGen -- | Linear interpolating variant on index. indexL :: UGen -> UGen -> UGen -- | Map from one linear range to another linear range. linLin :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Collapse possible mce by summing. mix :: UGen -> UGen -- | Mix variant, sum to n channels. mixN :: Int -> UGen -> UGen -- | Construct and sum a set of UGens. mixFill :: Integral n => Int -> (n -> UGen) -> UGen -- | Monad variant on mixFill. mixFillM :: (Integral n, Monad m) => Int -> (n -> m UGen) -> m UGen -- | Variant that is randomly pressed. mouseButton' :: Rate -> UGen -> UGen -> UGen -> UGen -- | Randomised mouse UGen (see also mouseX' and mouseY'). mouseR :: ID a => a -> Rate -> UGen -> UGen -> Warp -> UGen -> UGen -- | Variant that randomly traverses the mouseX space. mouseX' :: Rate -> UGen -> UGen -> Warp -> UGen -> UGen -- | Variant that randomly traverses the mouseY space. mouseY' :: Rate -> UGen -> UGen -> Warp -> UGen -> UGen -- | PM oscillator. pmOsc :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -- | Scale uni-polar (0,1) input to linear (l,r) range -- --
-- map (urange 3 4) [0,0.5,1] == [3,3.5,4] --urange :: Fractional c => c -> c -> c -> c -- | Scale bi-polar (-1,1) input to linear (l,r) range -- --
-- map (range 3 4) [-1,0,1] == [3,3.5,4] --range :: Fractional c => c -> c -> c -> c -- | Mix one output from many sources selectX :: UGen -> UGen -> UGen -- | Silence. silent :: Int -> UGen -- | Zero indexed audio input buses. soundIn :: UGen -> UGen -- | Pan a set of channels across the stereo field. splay :: UGen -> UGen -> UGen -> UGen -> Bool -> UGen -- | Explicit identifier demand rate UGen functions. module Sound.SC3.UGen.Demand.ID -- | Buffer demand ugen. dbufrd :: ID i => i -> UGen -> UGen -> Loop -> UGen -- | Buffer write on demand unit generator. dbufwr :: ID i => i -> UGen -> UGen -> UGen -> Loop -> UGen -- | Demand rate white noise. dwhite :: ID i => i -> UGen -> UGen -> UGen -> UGen -- | Demand rate integer white noise. diwhite :: ID i => i -> UGen -> UGen -> UGen -> UGen -- | Demand rate brown noise. dbrown :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen -- | Demand rate integer brown noise. dibrown :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen -- | Demand rate random selection. drand :: ID i => i -> UGen -> UGen -> UGen -- | Demand rate random selection with no immediate repetition. dxrand :: ID i => i -> UGen -> UGen -> UGen -- | Demand rate weighted random sequence generator. dwrand :: ID i => i -> UGen -> UGen -> UGen -> UGen -- | Demand rate arithmetic series. dseries :: ID i => i -> UGen -> UGen -> UGen -> UGen -- | Demand rate geometric series. dgeom :: ID i => i -> UGen -> UGen -> UGen -> UGen -- | Demand rate sequence generator. dseq :: ID i => i -> UGen -> UGen -> UGen -- | Demand rate series generator. dser :: ID i => i -> UGen -> UGen -> UGen -- | Demand rate sequence shuffler. dshuf :: ID i => i -> UGen -> UGen -> UGen -- | Demand input replication dstutter :: ID i => i -> UGen -> UGen -> UGen -- | Demand rate input switching. dswitch1 :: ID i => i -> UGen -> UGen -> UGen -- | Demand rate input switching. dswitch :: ID i => i -> UGen -> UGen -> UGen -- | Explicit identifier functions for composite UGens. module Sound.SC3.UGen.Composite.ID -- | Demand rate (:) function. dcons :: ID m => (m, m, m) -> UGen -> UGen -> UGen -- | Count mce channels. mceN :: UGen -> UGen -- | Randomly select one of a list of UGens (initialiastion rate). lchoose :: ID m => m -> [UGen] -> UGen -- | mce variant of lchoose. choose :: ID m => m -> UGen -> UGen -- | Randomly select one of several inputs on trigger. tChoose :: ID m => m -> UGen -> UGen -> UGen -- | Randomly select one of several inputs on trigger (weighted). tWChoose :: ID m => m -> UGen -> UGen -> UGen -> UGen -> UGen -- | Monad constructors for demand UGens, see also -- Sound.SC3.UGen.Demand.ID. module Sound.SC3.UGen.Demand.Monad -- | Buffer demand ugen. dbufrd :: UId m => UGen -> UGen -> Loop -> m UGen -- | Buffer write on demand unit generator. dbufwr :: UId m => UGen -> UGen -> UGen -> Loop -> m UGen -- | Demand rate white noise. dwhite :: UId m => UGen -> UGen -> UGen -> m UGen -- | Demand rate integer white noise. diwhite :: UId m => UGen -> UGen -> UGen -> m UGen -- | Demand rate brown noise. dbrown :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen -- | Demand rate integer brown noise. dibrown :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen -- | Demand rate random selection. drand :: UId m => UGen -> UGen -> m UGen -- | Demand rate random selection with no immediate repetition. dxrand :: UId m => UGen -> UGen -> m UGen -- | Demand rate weighted random sequence generator. dwrand :: UId m => UGen -> UGen -> UGen -> m UGen -- | Demand rate arithmetic series. dseries :: UId m => UGen -> UGen -> UGen -> m UGen -- | Demand rate geometric series. dgeom :: UId m => UGen -> UGen -> UGen -> m UGen -- | Demand rate sequence generator. dseq :: UId m => UGen -> UGen -> m UGen -- | Demand rate series generator. dser :: UId m => UGen -> UGen -> m UGen -- | Demand rate sequence shuffler. dshuf :: UId m => UGen -> UGen -> m UGen -- | Demand input replication dstutter :: UId m => UGen -> UGen -> m UGen -- | Demand rate input switching. dswitch1 :: UId m => UGen -> UGen -> m UGen -- | Demand rate input switching. dswitch :: UId m => UGen -> UGen -> m UGen -- | Monad constructors for composite UGens. module Sound.SC3.UGen.Composite.Monad -- | Demand rate (:) function. dcons :: UId m => UGen -> UGen -> m UGen -- | liftU of choose. choose :: UId m => UGen -> m UGen -- | liftU of lchoose. lchoose :: UId m => [UGen] -> m UGen -- | Randomly select one of several inputs. tChoose :: UId m => UGen -> UGen -> m UGen -- | Randomly select one of several inputs (weighted). tWChoose :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen -- | Non-realtime score generation. module Sound.SC3.Server.NRT -- | Encode and prefix with encoded length. oscWithSize :: Bundle -> ByteString -- | An NRT score is a sequence of Bundles. data NRT NRT :: [Bundle] -> NRT nrt_bundles :: NRT -> [Bundle] -- | Encode an NRT score. encodeNRT :: NRT -> ByteString -- | Write an NRT score. writeNRT :: FilePath -> NRT -> IO () -- | Write an NRT score to a file handle. putNRT :: Handle -> NRT -> IO () -- | Decode an NRT ByteString to a list of Bundles. decode_nrt_bundles :: ByteString -> [Bundle] -- | Decode an NRT ByteString. decodeNRT :: ByteString -> NRT -- | decodeNRT of readFile. readNRT :: FilePath -> IO NRT instance Show NRT -- | Request and display status information from the synthesis server. module Sound.SC3.Server.Status -- | Get nth field of status as Double. extractStatusField :: Int -> [Datum] -> Double -- | Names of status fields. statusFields :: [String] -- | Status pretty printer. statusFormat :: [Datum] -> [String] -- | The Graph and Synthdef types. module Sound.SC3.Server.Synthdef.Type -- | Node identifier. type NodeId = Int -- | Port index. type PortIndex = Int -- | Type to represent unit generator graph. data Graph Graph :: NodeId -> [Node] -> [Node] -> [Node] -> Graph nextId :: Graph -> NodeId constants :: Graph -> [Node] controls :: Graph -> [Node] ugens :: Graph -> [Node] -- | Binary representation of a unit generator graph. type Graphdef = ByteString -- | Enumeration of the four operating rates for controls. data KType K_IR :: KType K_KR :: KType K_TR :: KType K_AR :: KType -- | Type to represent the left hand side of an edge in a unit generator -- graph. data FromPort FromPort_C :: NodeId -> FromPort port_nid :: FromPort -> NodeId FromPort_K :: NodeId -> KType -> FromPort port_nid :: FromPort -> NodeId port_kt :: FromPort -> KType FromPort_U :: NodeId -> Maybe PortIndex -> FromPort port_nid :: FromPort -> NodeId port_idx :: FromPort -> Maybe PortIndex -- | A destination port. data ToPort ToPort :: NodeId -> PortIndex -> ToPort -- | A connection from FromPort to ToPort. type Edge = (FromPort, ToPort) -- | Type to represent nodes in unit generator graph. data Node NodeC :: NodeId -> Double -> Node node_id :: Node -> NodeId node_c_value :: Node -> Double NodeK :: NodeId -> Rate -> String -> Double -> KType -> Node node_id :: Node -> NodeId node_k_rate :: Node -> Rate node_k_name :: Node -> String node_k_default :: Node -> Double node_k_type :: Node -> KType NodeU :: NodeId -> Rate -> String -> [FromPort] -> [Output] -> Special -> UGenId -> Node node_id :: Node -> NodeId node_u_rate :: Node -> Rate node_u_name :: Node -> String node_u_inputs :: Node -> [FromPort] node_u_outputs :: Node -> [Output] node_u_special :: Node -> Special node_u_ugenid :: Node -> UGenId NodeP :: NodeId -> Node -> PortIndex -> Node node_id :: Node -> NodeId node_p_node :: Node -> Node node_p_index :: Node -> PortIndex -- | Binary representation of a unit generator synth definition. data Synthdef Synthdef :: String -> Graph -> Synthdef synthdefName :: Synthdef -> String synthdefGraph :: Synthdef -> Graph instance Eq KType instance Show KType instance Ord KType instance Eq FromPort instance Show FromPort instance Eq ToPort instance Show ToPort instance Eq Node instance Show Node instance Eq Graph instance Show Graph instance Eq Synthdef instance Show Synthdef module Sound.SC3.Server.Synthdef.Internal -- | Find Node with indicated NodeId. find_node :: Graph -> NodeId -> Maybe Node -- | Is Node an implicit control UGen? is_implicit_control :: Node -> Bool -- | Generate a label for Node using the type and the -- node_id. node_label :: Node -> String -- | Get port_idx for FromPort_U, else 0. port_idx_or_zero :: FromPort -> PortIndex -- | Is Node a constant. is_node_c :: Node -> Bool -- | Is Node a control. is_node_k :: Node -> Bool -- | Is Node a UGen. is_node_u :: Node -> Bool -- | Calculate all edges given a set of NodeU. edges :: [Node] -> [Edge] -- | Transform Node to FromPort. as_from_port :: Node -> FromPort -- | Locate Node of FromPort in Graph. from_port_node :: Graph -> FromPort -> Maybe Node -- | The empty Graph. empty_graph :: Graph -- | Find the maximum NodeId used at Graph (this ought -- normally be the nextId). graph_maximum_id :: Graph -> NodeId -- | Compare NodeK values on node_k_type. node_k_cmp :: Node -> Node -> Ordering -- | Determine class of control given Rate and trigger -- status. ktype :: Rate -> Bool -> KType -- | Remove implicit control UGens from Graph remove_implicit :: Graph -> Graph -- | Add implicit control UGens to Graph. add_implicit :: Graph -> Graph -- | Predicate to determine if Node is a constant with indicated -- value. find_c_p :: Double -> Node -> Bool -- | Insert a constant Node into the Graph. push_c :: Double -> Graph -> (Node, Graph) -- | Either find existing Constant Node, or insert a new -- Node. mk_node_c :: Constant -> Graph -> (Node, Graph) -- | Predicate to determine if Node is a control with indicated -- name. Names must be unique. find_k_p :: String -> Node -> Bool -- | Insert a control node into the Graph. push_k :: (Rate, String, Double, Bool) -> Graph -> (Node, Graph) -- | Either find existing Control Node, or insert a new -- Node. mk_node_k :: Control -> Graph -> (Node, Graph) type UGenParts = (Rate, String, [FromPort], [Output], Special, UGenId) -- | Predicate to locate primitive, names must be unique. find_u_p :: UGenParts -> Node -> Bool -- | Insert a primitive NodeU into the Graph. push_u :: UGenParts -> Graph -> (Node, Graph) mk_node_u_acc :: [UGen] -> [Node] -> Graph -> ([Node], Graph) -- | Either find existing Primitive node, or insert a new -- Node. mk_node_u :: Primitive -> Graph -> (Node, Graph) -- | Proxies do not get stored in the graph. mk_node_p :: Node -> PortIndex -> Graph -> (Node, Graph) mk_node :: UGen -> Graph -> (Node, Graph) type Map = IntMap Int type Maps = (Map, [Node], Map, Map, [(KType, Int)]) data Input Input :: Int -> Int -> Input -- | Determine KType of a control UGen at NodeU, or -- not. node_ktype :: Node -> Maybe KType -- | Map associating KType with UGen index. mk_ktype_map :: [Node] -> [(KType, Int)] -- | Lookup KType index from map (erroring variant of -- lookup). ktype_map_lookup :: KType -> [(KType, Int)] -> Int -- | Generate Maps translating node identifiers to synthdef indexes. mk_maps :: Graph -> Maps -- | Locate index in map given node identifer NodeId. fetch :: NodeId -> Map -> Int -- | Controls are a special case. We need to know not the overall index but -- the index in relation to controls of the same type. fetch_k :: NodeId -> KType -> [Node] -> Int -- | Construct Input form required by byte-code generator. make_input :: Maps -> FromPort -> Input -- | Byte-encode Input value. encode_input :: Input -> ByteString -- | Byte-encode NodeK control node. encode_node_k :: Maps -> Node -> ByteString -- | Byte-encode NodeU primitive node. encode_node_u :: Maps -> Node -> ByteString -- | Construct instrument definition bytecode. encode_graphdef :: Graph -> ByteString -- | 4-tuple to count KTypes. type KS_COUNT = (Int, Int, Int, Int) -- | Count the number of controls if each KType. ks_count :: [Node] -> KS_COUNT -- | Construct implicit control unit generator Nodes. Unit -- generators are only constructed for instances of control types that -- are present. mk_implicit :: [Node] -> [Node] -- | Transform mce nodes to mrg nodes prepare_root :: UGen -> UGen instance Eq Input instance Show Input module Sound.SC3.Server.Synthdef.Reconstruct node_sort :: [Node] -> [Node] from_port_label :: Char -> FromPort -> String is_operator_name :: String -> Bool parenthesise_operator :: String -> String reconstruct_graph_str :: Graph -> String reconstruct_c_str :: Node -> String reconstruct_c_ugen :: Node -> UGen reconstruct_k_rnd :: Node -> (Rate, String, Double) reconstruct_k_str :: Node -> String reconstruct_k_ugen :: Node -> UGen ugen_qname :: String -> Special -> (String, String) reconstruct_mce_str :: Node -> String reconstruct_u_str :: Node -> [String] reconstruct_mrg_str :: [Node] -> String -- | Transformations over Graph structure. module Sound.SC3.Server.Synthdef.Transform -- | Transform NodeC to NodeK, id for other -- Node types. -- --
-- constant_to_control 8 (NodeC 0 0.1) == (NodeK 8 KR "k_8" 0.1 K_KR,9) --constant_to_control :: NodeId -> Node -> (NodeId, Node) -- | Erroring variant of from_port_node. from_port_node_err :: Graph -> FromPort -> Node -- | If the FromPort is a constant generate a control -- Node, else retain FromPort. c_lift_from_port :: Graph -> NodeId -> FromPort -> (NodeId, Either FromPort Node) -- | Lift a set of NodeU inputs from constants to controls. -- The result triple gives the incremented NodeId, the transformed -- FromPort list, and the list of newly minted control -- Nodes. c_lift_inputs :: Graph -> NodeId -> [FromPort] -> (NodeId, [FromPort], [Node]) c_lift_ugen :: Graph -> NodeId -> Node -> (NodeId, Node, [Node]) c_lift_ugens :: Graph -> NodeId -> [Node] -> (NodeId, [Node], [Node]) lift_constants :: Graph -> Graph -- | The unit-generator graph structure implemented by the SuperCollider -- synthesis server. module Sound.SC3.Server.Synthdef -- | Transform a unit generator into a graph. -- --
-- import Sound.SC3.UGen -- synth (out 0 (pan2 (sinOsc AR 440 0) 0.5 0.1)) --synth :: UGen -> Graph -- | Transform a unit generator graph into bytecode. graphdef :: Graph -> Graphdef -- | Encode Synthdef as a binary data stream. synthdefData :: Synthdef -> Graphdef -- | Transform a unit generator synth definition into bytecode. synthdef :: String -> UGen -> Synthdef -- | Write Synthdef to indicated directory. The filename is the -- synthdefName with the appropriate extension -- (scsyndef). synthdefWrite :: Synthdef -> FilePath -> IO () -- | Simple statistical analysis of a unit generator graph. synthstat :: UGen -> String -- | Server input enumerations. module Sound.SC3.Server.Enum -- | Sound file format. data SoundFileFormat Aiff :: SoundFileFormat Flac :: SoundFileFormat Ircam :: SoundFileFormat Next :: SoundFileFormat Raw :: SoundFileFormat Wave :: SoundFileFormat -- | Sample format. data SampleFormat PcmInt8 :: SampleFormat PcmInt16 :: SampleFormat PcmInt24 :: SampleFormat PcmInt32 :: SampleFormat PcmFloat :: SampleFormat PcmDouble :: SampleFormat PcmMulaw :: SampleFormat PcmAlaw :: SampleFormat soundFileFormatString :: SoundFileFormat -> String sampleFormatString :: SampleFormat -> String instance Enum SoundFileFormat instance Eq SoundFileFormat instance Read SoundFileFormat instance Show SoundFileFormat instance Enum SampleFormat instance Eq SampleFormat instance Read SampleFormat instance Show SampleFormat -- | 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.Completion -- | Install a bytecode instrument definition. (Asynchronous) d_recv' :: OSC o => o -> Synthdef -> Message -- | Load an instrument definition from a named file. (Asynchronous) d_load' :: OSC o => o -> String -> Message -- | Load a directory of instrument definitions files. (Asynchronous) d_loadDir' :: OSC o => o -> String -> Message -- | Allocates zero filled buffer to number of channels and samples. -- (Asynchronous) b_alloc' :: OSC o => o -> Int -> Int -> Int -> Message -- | Allocate buffer space and read a sound file. (Asynchronous) b_allocRead' :: OSC o => o -> Int -> String -> Int -> Int -> Message -- | Allocate buffer space and read a sound file, picking specific -- channels. (Asynchronous) b_allocReadChannel' :: OSC o => o -> Int -> String -> Int -> Int -> [Int] -> Message -- | Free buffer data. (Asynchronous) b_free' :: OSC o => o -> Int -> Message -- | Close attached soundfile and write header information. (Asynchronous) b_close' :: OSC o => o -> Int -> Message -- | Read sound file data into an existing buffer. (Asynchronous) b_read' :: OSC o => o -> Int -> String -> Int -> Int -> Int -> Bool -> Message -- | Read sound file data into an existing buffer. (Asynchronous) b_readChannel' :: OSC o => o -> Int -> String -> Int -> Int -> Int -> Bool -> [Int] -> Message -- | Write sound file data. (Asynchronous) b_write' :: OSC o => o -> Int -> String -> SoundFileFormat -> SampleFormat -> Int -> Int -> Bool -> Message -- | Zero sample data. (Asynchronous) b_zero' :: OSC o => o -> Int -> Message -- | Constructors for the command set implemented by the SuperCollider -- synthesis server. module Sound.SC3.Server.Command -- | Install a bytecode instrument definition. (Asynchronous) d_recv :: Synthdef -> Message -- | Load an instrument definition from a named file. (Asynchronous) d_load :: String -> Message -- | Load a directory of instrument definitions files. (Asynchronous) d_loadDir :: String -> Message -- | Remove definition once all nodes using it have ended. d_free :: [String] -> Message -- | Place a node after another. n_after :: [(Int, Int)] -> Message -- | Place a node before another. n_before :: [(Int, Int)] -> Message -- | Fill ranges of a node's control values. n_fill :: Int -> [(String, Int, Double)] -> Message -- | Delete a node. n_free :: [Int] -> Message -- | Map a node's controls to read from a bus. n_map :: Int -> [(String, Int)] -> Message -- | Map a node's controls to read from buses. n_mapn :: Int -> [(String, Int, Int)] -> Message -- | Map a node's controls to read from an audio bus. n_mapa :: Int -> [(String, Int)] -> Message -- | Map a node's controls to read from audio buses. n_mapan :: Int -> [(String, Int, Int)] -> Message -- | Get info about a node. n_query :: [Int] -> Message -- | Turn node on or off. n_run :: [(Int, Bool)] -> Message -- | Set a node's control values. n_set :: Int -> [(String, Double)] -> Message -- | Set ranges of a node's control values. n_setn :: Int -> [(String, [Double])] -> Message -- | Trace a node. n_trace :: [Int] -> Message -- | Move an ordered sequence of nodes. n_order :: AddAction -> Int -> [Int] -> Message -- | Get control values. s_get :: Int -> [String] -> Message -- | Get ranges of control values. s_getn :: Int -> [(String, Int)] -> Message -- | Enumeration of possible locations to add new nodes (s_new and g_new). data AddAction AddToHead :: AddAction AddToTail :: AddAction AddBefore :: AddAction AddAfter :: AddAction AddReplace :: AddAction -- | Create a new synth. s_new :: String -> Int -> AddAction -> Int -> [(String, Double)] -> Message -- | Auto-reassign synth's ID to a reserved value. s_noid :: [Int] -> Message -- | Free all synths in this group and all its sub-groups. g_deepFree :: [Int] -> Message -- | Delete all nodes in a group. g_freeAll :: [Int] -> Message -- | Add node to head of group. g_head :: [(Int, Int)] -> Message -- | Create a new group. g_new :: [(Int, AddAction, Int)] -> Message -- | Add node to tail of group. g_tail :: [(Int, Int)] -> Message -- | Post a representation of a group's node subtree, optionally including -- the current control values for synths. g_dumpTree :: [(Int, 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: -- --
-- int - if synth control values are included 1, else 0 -- int - node ID of the requested group -- int - number of child nodes contained within the requested group -- -- For each node in the subtree: -- [ -- int - node ID -- int - 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: -- int - 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 :: [(Int, Bool)] -> Message -- | Create a new parallel group (supernova specific). p_new :: [(Int, AddAction, Int)] -> Message -- | Send a plugin command. cmd :: String -> [Datum] -> Message -- | Send a command to a unit generator. u_cmd :: Int -> Int -> String -> [Datum] -> Message -- | Allocates zero filled buffer to number of channels and samples. -- (Asynchronous) b_alloc :: Int -> Int -> Int -> Message -- | Allocate buffer space and read a sound file. (Asynchronous) b_allocRead :: Int -> String -> Int -> Int -> Message -- | Allocate buffer space and read a sound file, picking specific -- channels. (Asynchronous) b_allocReadChannel :: Int -> String -> Int -> Int -> [Int] -> Message -- | Close attached soundfile and write header information. (Asynchronous) b_close :: Int -> Message -- | Fill ranges of sample values. b_fill :: Int -> [(Int, Int, Double)] -> Message -- | Free buffer data. (Asynchronous) b_free :: Int -> Message -- | Call a command to fill a buffer. (Asynchronous) b_gen :: Int -> String -> [Datum] -> Message -- | Call sine1 b_gen command. b_gen_sine1 :: Int -> [B_Gen] -> [Double] -> Message -- | Call sine2 b_gen command. b_gen_sine2 :: Int -> [B_Gen] -> [(Double, Double)] -> Message -- | Call sine3 b_gen command. b_gen_sine3 :: Int -> [B_Gen] -> [(Double, Double, Double)] -> Message -- | Call cheby b_gen command. b_gen_cheby :: Int -> [B_Gen] -> [Double] -> Message -- | Call copy b_gen command. b_gen_copy :: Int -> Int -> Int -> Int -> Maybe Int -> Message -- | Get sample values. b_get :: Int -> [Int] -> Message -- | Get ranges of sample values. b_getn :: Int -> [(Int, Int)] -> Message -- | Request /b_info messages. b_query :: [Int] -> Message -- | Read sound file data into an existing buffer. (Asynchronous) b_read :: Int -> String -> Int -> Int -> Int -> Bool -> Message -- | Read sound file data into an existing buffer, picking specific -- channels. (Asynchronous) b_readChannel :: Int -> String -> Int -> Int -> Int -> Bool -> [Int] -> Message -- | Set sample values. b_set :: Int -> [(Int, Double)] -> Message -- | Set ranges of sample values. b_setn :: Int -> [(Int, [Double])] -> Message -- | Write sound file data. (Asynchronous) b_write :: Int -> String -> SoundFileFormat -> SampleFormat -> Int -> Int -> Bool -> Message -- | Zero sample data. (Asynchronous) b_zero :: Int -> Message -- | Fill ranges of bus values. c_fill :: [(Int, Int, Double)] -> Message -- | Get bus values. c_get :: [Int] -> Message -- | Get ranges of bus values. c_getn :: [(Int, Int)] -> Message -- | Set bus values. c_set :: [(Int, Double)] -> Message -- | Set ranges of bus values. c_setn :: [(Int, [Double])] -> Message -- | Remove all bundles from the scheduling queue. clearSched :: Message -- | Enumeration of Message printer types. data PrintLevel NoPrinter :: PrintLevel TextPrinter :: PrintLevel HexPrinter :: PrintLevel AllPrinter :: PrintLevel -- | Select printing of incoming Open Sound Control messages. dumpOSC :: PrintLevel -> Message -- | Select reception of notification messages. (Asynchronous) notify :: Bool -> Message -- | Stop synthesis server. quit :: Message -- | Request /status.reply message. status :: Message -- | Request /synced message when all current asynchronous commands -- complete. sync :: Int -> Message -- | Error posting scope. data ErrorScope -- | Global scope Globally :: ErrorScope -- | Bundle scope Locally :: ErrorScope -- | Error posting mode. data ErrorMode -- | Turn error posting off ErrorsOff :: ErrorMode -- | Turn error posting on ErrorsOn :: ErrorMode -- | Set error posting scope and mode. errorMode :: ErrorScope -> ErrorMode -> Message -- | Pre-allocate for b_setn1, values preceding offset are zeroed. b_alloc_setn1 :: Int -> Int -> [Double] -> Message -- | Get ranges of sample values. b_getn1 :: Int -> (Int, Int) -> Message -- | Set single sample value. b_set1 :: Int -> Int -> Double -> Message -- | Set a range of sample values. b_setn1 :: Int -> Int -> [Double] -> Message -- | Variant on b_query. b_query1 :: Int -> Message -- | Set single bus values. c_set1 :: Int -> Double -> Message -- | Set a signle node control value. n_set1 :: Int -> String -> Double -> Message -- | List of asynchronous server commands. async_cmds :: [String] -- | True if Message is an asynchronous Message. -- --
-- map isAsync [b_close 0,n_set1 0 "0" 0] == [True,False] --isAsync :: Message -> Bool -- | Add a completion message (or bundle, the name is misleading) to an -- existing asynchronous command. -- --
-- let {m = n_set1 0 "0" 0
-- ;m' = encodeMessage m}
-- in withCM (b_close 0) m == Message "/b_close" [Int 0,Blob m']
--
withCM :: OSC o => Message -> o -> Message
-- | 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 --b_segment :: 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) -- b_indices 1024 2056 16 == [(16,8),(24,1024),(1048,1024)] --b_indices :: Int -> Int -> Int -> [(Int, Int)] instance Eq AddAction instance Show AddAction instance Enum AddAction instance Eq PrintLevel instance Show PrintLevel instance Enum PrintLevel instance Eq ErrorScope instance Show ErrorScope instance Enum ErrorScope instance Eq ErrorMode instance Show ErrorMode instance Enum ErrorMode -- | FD variant of interaction with the scsynth server. module Sound.SC3.Server.Transport.FD -- | Synonym for sendMessage. send :: Transport t => t -> Message -> IO () -- | Send a Message and waitReply for a /done reply. async :: Transport t => t -> Message -> IO Message -- | Bracket SC3 communication. withSC3 :: (UDP -> IO a) -> IO a -- | Free all nodes (g_freeAll) at group 1. stop :: Transport t => t -> IO () -- | Free all nodes (g_freeAll) at and re-create groups 1 -- and 2. reset :: Transport t => t -> IO () -- | Send d_recv and s_new messages to scsynth. playSynthdef :: Transport t => t -> Synthdef -> IO () -- | Send an anonymous instrument definition using -- playSynthdef. playUGen :: Transport t => t -> UGen -> 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 -> Bundle -> IO () -- | Perform an NRT score (as would be rendered by writeNRT). -- In particular note that all timestamps must be in NTPr -- form. performNRT :: Transport t => t -> NRT -> IO () -- | Class for values that can be encoded and send to scsynth for -- audition. class Audible e where audition e = withSC3 (`play` e) play :: (Audible e, Transport t) => t -> e -> IO () audition :: Audible e => e -> IO () -- | Turn on notifications, run f, turn off notifications, return -- result. withNotifications :: Transport t => t -> (t -> IO a) -> IO a -- | 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_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] -- | Variant of b_getn1_data_segment that gets the entire buffer. b_fetch :: Transport t => t -> Int -> Int -> IO [Double] -- | Collect server status information. serverStatus :: Transport t => t -> IO [String] -- | Read nominal sample rate of server. serverSampleRateNominal :: Transport t => t -> IO Double -- | Read actual sample rate of server. serverSampleRateActual :: Transport t => t -> IO Double -- | Retrieve status data from server. serverStatusData :: Transport t => t -> IO [Datum] instance Audible NRT instance Audible UGen instance Audible Synthdef instance Audible Graph -- | Monad variant of interaction with the scsynth server. module Sound.SC3.Server.Transport.Monad -- | Synonym for sendMessage. send :: SendOSC m => Message -> m () -- | Send a Message and waitReply for a /done reply. async :: DuplexOSC m => Message -> m Message -- | Bracket SC3 communication. withTransport at standard -- SC3 UDP port. -- --
-- import Sound.SC3.Server.Command ---- --
-- withSC3 (send status >> waitReply "/status.reply") --withSC3 :: Connection UDP a -> IO a -- | Free all nodes (g_freeAll) at group 1. stop :: SendOSC m => m () -- | Free all nodes (g_freeAll) at and re-create groups 1 -- and 2. reset :: SendOSC m => m () -- | Send d_recv and s_new messages to scsynth. playSynthdef :: DuplexOSC m => Synthdef -> m () -- | Send an anonymous instrument definition using -- playSynthdef. playUGen :: DuplexOSC m => UGen -> m () -- | 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 () -- | Perform an NRT score (as would be rendered by writeNRT). -- In particular note that all timestamps must be in NTPr -- form. performNRT :: Transport m => NRT -> m () -- | Class for values that can be encoded and send to scsynth for -- audition. class Audible e play :: (Audible e, Transport m) => e -> m () audition :: Audible e => e -> IO () -- | Turn on notifications, run f, turn off notifications, return -- result. withNotifications :: DuplexOSC m => m a -> m a -- | Variant of b_getn1 that waits for return message and unpacks -- it. -- --
-- withSC3 (b_getn1_data 0 (0,5)) --b_getn1_data :: DuplexOSC m => Int -> (Int, Int) -> m [Double] -- | Variant of b_getn1_data that segments individual b_getn -- messages to n elements. -- --
-- withSC3 (b_getn1_data_segment 1 0 (0,5)) --b_getn1_data_segment :: DuplexOSC m => Int -> Int -> (Int, Int) -> m [Double] -- | Variant of b_getn1_data_segment that gets the entire buffer. b_fetch :: DuplexOSC m => Int -> Int -> m [Double] -- | Collect server status information. serverStatus :: DuplexOSC m => m [String] -- | Read nominal sample rate of server. serverSampleRateNominal :: DuplexOSC m => m Double -- | Read actual sample rate of server. serverSampleRateActual :: DuplexOSC m => m Double -- | Retrieve status data from server. serverStatusData :: DuplexOSC m => m [Datum] instance Audible NRT instance Audible UGen instance Audible Synthdef instance Audible Graph -- | Frequency domain unit generators. module Sound.SC3.UGen.FFT -- | Fast fourier transform. fft :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Variant FFT constructor with default values for hop size, window | -- type, active status and window size. fft' :: UGen -> UGen -> UGen -- | Outputs signal for FFT chains, without performing FFT. fftTrigger :: UGen -> UGen -> UGen -> UGen -- | Inverse Fast Fourier Transform. ifft :: UGen -> UGen -> UGen -> UGen -- | Variant ifft with default value for window type. ifft' :: UGen -> UGen -- | Strict convolution of two continuously changing inputs. convolution :: UGen -> UGen -> UGen -> UGen -- | Real-time fixed kernel convolver. convolution2 :: UGen -> UGen -> UGen -> UGen -> UGen -- | Real-time convolver with linear interpolation convolution2L :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Time based convolver. convolution3 :: Rate -> UGen -> UGen -> UGen -> UGen -> UGen -- | Pack demand-rate FFT bin streams into an FFT chain. packFFT :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Format magnitude and phase data data as required for packFFT. packFFTSpec :: [UGen] -> [UGen] -> UGen -- | Apply function f to each bin of an FFT chain, f -- receives magnitude, phase and index and returns a (magnitude,phase). pvcollect :: UGen -> UGen -> (UGen -> UGen -> UGen -> (UGen, UGen)) -> UGen -> UGen -> UGen -> UGen -- | Complex addition. pv_Add :: UGen -> UGen -> UGen -- | Shift and scale the bin positions. pv_BinShift :: UGen -> UGen -> UGen -> UGen -- | Combine low and high bins from two inputs. pv_BinWipe :: UGen -> UGen -> UGen -> UGen -- | Clear bins above or below a cutoff point. pv_BrickWall :: UGen -> UGen -> UGen -- | Complex plane attack. pv_ConformalMap :: UGen -> UGen -> UGen -> UGen -- | Copies spectral frame. pv_Copy :: UGen -> UGen -> UGen -- | Copy magnitudes and phases. pv_CopyPhase :: UGen -> UGen -> UGen -- | Random phase shifting. pv_Diffuser :: UGen -> UGen -> UGen -- | FFT onset detector. pv_HainsworthFoote :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | FFT feature detector for onset detection. pv_JensenAndersen :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Pass bins which are a local maximum. pv_LocalMax :: UGen -> UGen -> UGen -- | Pass bins above a threshold. pv_MagAbove :: UGen -> UGen -> UGen -- | Pass bins below a threshold. pv_MagBelow :: UGen -> UGen -> UGen -- | Clip bins to a threshold. pv_MagClip :: UGen -> UGen -> UGen -- | Freeze magnitudes. pv_MagFreeze :: UGen -> UGen -> UGen -- | Multiply magnitudes. pv_MagMul :: UGen -> UGen -> UGen -- | Multiply magnitudes by noise. pv_MagNoise :: UGen -> UGen -- | Shift and stretch magnitude bin position. pv_MagShift :: UGen -> UGen -> UGen -> UGen -- | Average magnitudes across bins. pv_MagSmear :: UGen -> UGen -> UGen -- | Square magnitudes. pv_MagSquared :: UGen -> UGen -- | Maximum magnitude. pv_Max :: UGen -> UGen -> UGen -- | Minimum magnitude. pv_Min :: UGen -> UGen -> UGen -- | Complex multiply. pv_Mul :: UGen -> UGen -> UGen -- | Shift phase by 270 degrees. pv_PhaseShift270 :: UGen -> UGen -- | Shift phase by 90 degrees. pv_PhaseShift90 :: UGen -> UGen -- | Shift phase. pv_PhaseShift :: UGen -> UGen -> UGen -- | Make gaps in spectrum. pv_RectComb2 :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -- | Make gaps in spectrum. pv_RectComb :: UGen -> UGen -> UGen -> UGen -> UGen -- | Unpack a single value (magnitude or phase) from an FFT chain unpack1FFT :: UGen -> UGen -> UGen -> UGen -> UGen -- | Unpack an FFT chain into separate demand-rate FFT bin streams. unpackFFT :: UGen -> UGen -> UGen -> UGen -> UGen -> [UGen] -- | Calculate size of accumulation buffer given FFT and IR sizes. pc_calcAccumSize :: Int -> Int -> Int -- | Generate accumulation buffer given time-domain IR buffer and FFT size. pc_preparePartConv :: Int -> Int -> Int -> Message -- | Partitioned convolution. partConv :: UGen -> UGen -> UGen -> UGen -- | Collection of modules for writing unit-generator graphs. module Sound.SC3.UGen -- | Module exporting all of Sound.SC3 and also the explicit -- identifier variants for non-deterministic and non-sharable unit -- generators. module Sound.SC3.UGen.ID -- | Module exporting all of Sound.SC3.UGen and also the monad -- constructor variants for non-deterministic and non-sharable unit -- generators. module Sound.SC3.UGen.Monad -- | Clone a unit generator (mce . replicateM). clone :: UId m => Int -> m UGen -> m UGen -- | 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 -- | Composite of Sound.SC3.Server and -- Sound.SC3.Server.Transport.Monad. module Sound.SC3.Server.Monad -- | Composite of Sound.SC3.UGen.ID and -- Sound.SC3.Server.Monad. module Sound.SC3.ID -- | Composite of Sound.SC3.UGen.Monad and -- Sound.SC3.Server.Monad module Sound.SC3.Monad -- | Composite of Sound.SC3.Server and -- Sound.SC3.Server.Transport.FD. module Sound.SC3.Server.FD -- | Composite of Sound.SC3.Server.FD and Sound.SC3.UGen. module Sound.SC3.FD -- | Composite of Sound.SC3.UGen.ID and Sound.SC3.Server.FD. module Sound.SC3.ID.FD -- | Composite of Sound.SC3.UGen.Monad and -- Sound.SC3.Server.FD module Sound.SC3.Monad.FD -- | Composite of Sound.SC3.Server.Monad and Sound.SC3.UGen. module Sound.SC3