hsc3 0.7 → 0.8
raw patch · 293 files changed
+1854/−4923 lines, 293 filesdep +splitdep ~basedep ~hoscPVP ok
version bump matches the API change (PVP)
Dependencies added: split
Dependency ranges changed: base, hosc
API changes (from Hackage documentation)
- Sound.SC3.UGen.Demand.Base: dbrown :: UGenId -> UGen -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dbufrd :: UGenId -> UGen -> UGen -> Loop -> UGen
- Sound.SC3.UGen.Demand.Base: dbufwr :: UGenId -> UGen -> UGen -> UGen -> Loop -> UGen
- Sound.SC3.UGen.Demand.Base: dgeom :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dibrown :: UGenId -> UGen -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: diwhite :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: drand :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dseq :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dser :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dseries :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dstutter :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dswitch :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dswitch1 :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dwhite :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Base: dxrand :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.FFT.Base: pv_BinScramble :: UGenId -> UGen -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.FFT.Base: pv_RandComb :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.FFT.Base: pv_RandWipe :: UGenId -> UGen -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: brownNoise :: UGenId -> Rate -> UGen
- Sound.SC3.UGen.Noise.Base: clipNoise :: UGenId -> Rate -> UGen
- Sound.SC3.UGen.Noise.Base: coinGate :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: dust :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: dust2 :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: expRand :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: grayNoise :: UGenId -> Rate -> UGen
- Sound.SC3.UGen.Noise.Base: iRand :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfClipNoise :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfNoise0 :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfNoise1 :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfNoise2 :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfdClipNoise :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfdNoise0 :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfdNoise1 :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfdNoise2 :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: lfdNoise3 :: UGenId -> Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: linRand :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: nRand :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: pinkNoise :: UGenId -> Rate -> UGen
- Sound.SC3.UGen.Noise.Base: rand :: UGenId -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: tExpRand :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: tRand :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: tiRand :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: twindex :: UGenId -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Base: whiteNoise :: UGenId -> Rate -> UGen
- Sound.SC3.UGen.UGen: UGenId :: Int -> UGenId
- Sound.SC3.UGen.UGen: instance Eq UGenId
- Sound.SC3.UGen.UGen: instance Show UGenId
- Sound.SC3.UGen.UGen: newtype UGenId
- Sound.SC3.UGen.UGen: uid :: Int -> UGenId
+ Sound.SC3.Server.Command: async_cmds :: [String]
+ Sound.SC3.Server.Command: b_allocReadChannel :: Int -> String -> Int -> Int -> [Int] -> OSC
+ Sound.SC3.Server.Command: b_readChannel :: Int -> String -> Int -> Int -> Int -> Int -> [Int] -> OSC
+ Sound.SC3.Server.Command: withCM :: OSC -> OSC -> OSC
+ Sound.SC3.Server.Command.Completion: b_alloc' :: OSC -> Int -> Int -> Int -> OSC
+ Sound.SC3.Server.Command.Completion: b_allocRead' :: OSC -> Int -> String -> Int -> Int -> OSC
+ Sound.SC3.Server.Command.Completion: b_allocReadChannel' :: OSC -> Int -> String -> Int -> Int -> [Int] -> OSC
+ Sound.SC3.Server.Command.Completion: b_close' :: OSC -> Int -> OSC
+ Sound.SC3.Server.Command.Completion: b_free' :: OSC -> Int -> OSC
+ Sound.SC3.Server.Command.Completion: b_read' :: OSC -> Int -> String -> Int -> Int -> Int -> Int -> OSC
+ Sound.SC3.Server.Command.Completion: b_readChannel' :: OSC -> Int -> String -> Int -> Int -> Int -> Int -> [Int] -> OSC
+ Sound.SC3.Server.Command.Completion: b_write' :: OSC -> Int -> String -> Int -> Int -> Int -> Int -> Int -> OSC
+ Sound.SC3.Server.Command.Completion: b_zero' :: OSC -> Int -> OSC
+ Sound.SC3.Server.Command.Completion: d_load' :: OSC -> String -> OSC
+ Sound.SC3.Server.Command.Completion: d_loadDir' :: OSC -> String -> OSC
+ Sound.SC3.Server.Command.Completion: d_recv' :: OSC -> [Word8] -> OSC
+ Sound.SC3.Server.Synthdef: instance Eq KType
+ Sound.SC3.Server.Synthdef: instance Ord KType
+ Sound.SC3.Server.Synthdef: instance Show KType
+ Sound.SC3.Server.Synthdef: node_k_type :: Node -> KType
+ Sound.SC3.UGen.Composite: mixN :: Int -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dbrown :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dbufrd :: ID i => i -> UGen -> UGen -> Loop -> UGen
+ Sound.SC3.UGen.Demand.ID: dbufwr :: ID i => i -> UGen -> UGen -> UGen -> Loop -> UGen
+ Sound.SC3.UGen.Demand.ID: dgeom :: ID i => i -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dibrown :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: diwhite :: ID i => i -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: drand :: ID i => i -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dseq :: ID i => i -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dser :: ID i => i -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dseries :: ID i => i -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dstutter :: ID i => i -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dswitch :: ID i => i -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dswitch1 :: ID i => i -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dwhite :: ID i => i -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.ID: dxrand :: ID i => i -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Envelope.Construct: envLinen' :: UGen -> UGen -> UGen -> UGen -> (EnvCurve, EnvCurve, EnvCurve) -> [UGen]
+ Sound.SC3.UGen.FFT.ID: pv_BinScramble :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.FFT.ID: pv_RandComb :: ID i => i -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.FFT.ID: pv_RandWipe :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Filter: bLowPassCoef :: Floating a => a -> a -> a -> (a, a, a, a, a)
+ Sound.SC3.UGen.Noise.ID: brownNoise :: ID a => a -> Rate -> UGen
+ Sound.SC3.UGen.Noise.ID: clipNoise :: ID a => a -> Rate -> UGen
+ Sound.SC3.UGen.Noise.ID: coinGate :: ID a => a -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: dust :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: dust2 :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: expRand :: ID a => a -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: grayNoise :: ID a => a -> Rate -> UGen
+ Sound.SC3.UGen.Noise.ID: iRand :: ID a => a -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfClipNoise :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfNoise0 :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfNoise1 :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfNoise2 :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfdClipNoise :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfdNoise0 :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfdNoise1 :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfdNoise2 :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: lfdNoise3 :: ID a => a -> Rate -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: linRand :: ID a => a -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: nRand :: ID a => a -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: pinkNoise :: ID a => a -> Rate -> UGen
+ Sound.SC3.UGen.Noise.ID: rand :: ID a => a -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: tExpRand :: ID a => a -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: tRand :: ID a => a -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: tiRand :: ID a => a -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: twindex :: ID a => a -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Noise.ID: whiteNoise :: ID a => a -> Rate -> UGen
+ Sound.SC3.UGen.UGen: class ID a
+ Sound.SC3.UGen.UGen: controlTriggered :: UGen -> Bool
+ Sound.SC3.UGen.UGen: defaultID :: Int
+ Sound.SC3.UGen.UGen: hashUGen :: UGen -> Int
+ Sound.SC3.UGen.UGen: instance ID Char
+ Sound.SC3.UGen.UGen: instance ID Int
+ Sound.SC3.UGen.UGen: instance ID UGen
+ Sound.SC3.UGen.UGen: mceMap :: (UGen -> UGen) -> UGen -> UGen
+ Sound.SC3.UGen.UGen: mceSum :: UGen -> UGen
+ Sound.SC3.UGen.UGen: resolveID :: ID a => a -> Int
+ Sound.SC3.UGen.UGen: tr_control :: String -> Double -> UGen
- Sound.SC3.Server.Play: async :: (Transport t) => t -> OSC -> IO OSC
+ Sound.SC3.Server.Play: async :: Transport t => t -> OSC -> IO OSC
- Sound.SC3.Server.Play: play :: (Transport t) => t -> UGen -> IO OSC
+ Sound.SC3.Server.Play: play :: Transport t => t -> UGen -> IO OSC
- Sound.SC3.Server.Play: reset :: (Transport t) => t -> IO ()
+ Sound.SC3.Server.Play: reset :: Transport t => t -> IO ()
- Sound.SC3.Server.Play: send :: (Transport t) => t -> OSC -> IO ()
+ Sound.SC3.Server.Play: send :: Transport t => t -> OSC -> IO ()
- Sound.SC3.Server.Play: stop :: (Transport t) => t -> IO ()
+ Sound.SC3.Server.Play: stop :: Transport t => t -> IO ()
- Sound.SC3.Server.Status: serverSampleRateActual :: (Transport t) => t -> IO Double
+ Sound.SC3.Server.Status: serverSampleRateActual :: Transport t => t -> IO Double
- Sound.SC3.Server.Status: serverSampleRateNominal :: (Transport t) => t -> IO Double
+ Sound.SC3.Server.Status: serverSampleRateNominal :: Transport t => t -> IO Double
- Sound.SC3.Server.Status: serverStatus :: (Transport t) => t -> IO [String]
+ Sound.SC3.Server.Status: serverStatus :: Transport t => t -> IO [String]
- Sound.SC3.Server.Synthdef: K :: NodeId -> FromPort
+ Sound.SC3.Server.Synthdef: K :: NodeId -> KType -> FromPort
- Sound.SC3.Server.Synthdef: NodeK :: NodeId -> Rate -> String -> Double -> Node
+ Sound.SC3.Server.Synthdef: NodeK :: NodeId -> Rate -> String -> Double -> KType -> Node
- Sound.SC3.Server.Synthdef: NodeU :: NodeId -> Rate -> String -> [FromPort] -> [Output] -> Special -> Maybe UGenId -> Node
+ Sound.SC3.Server.Synthdef: NodeU :: NodeId -> Rate -> String -> [FromPort] -> [Output] -> Special -> Int -> Node
- Sound.SC3.Server.Synthdef: node_u_ugenid :: Node -> Maybe UGenId
+ Sound.SC3.Server.Synthdef: node_u_ugenid :: Node -> Int
- Sound.SC3.UGen.Buffer: asLocalBuf :: UGenId -> [UGen] -> UGen
+ Sound.SC3.UGen.Buffer: asLocalBuf :: ID i => i -> [UGen] -> UGen
- Sound.SC3.UGen.Buffer: localBuf :: UGenId -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Buffer: localBuf :: ID i => i -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Buffer: recordBuf :: UGen -> UGen -> UGen -> UGen -> UGen -> Loop -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Buffer: recordBuf :: UGen -> UGen -> UGen -> UGen -> UGen -> Loop -> UGen -> DoneAction -> UGen -> UGen
- Sound.SC3.UGen.Composite: mixFillM :: (Monad m) => Int -> (Int -> m UGen) -> m UGen
+ Sound.SC3.UGen.Composite: mixFillM :: Monad m => Int -> (Int -> m UGen) -> m UGen
- Sound.SC3.UGen.Composite.Monadic: dcons :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Composite.Monadic: dcons :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Composite.Monadic: tChoose :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Composite.Monadic: tChoose :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Composite.Monadic: twChoose :: (UId m) => UGen -> UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Composite.Monadic: twChoose :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dbrown :: (UId m) => UGen -> UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dbrown :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dbufrd :: (UId m) => UGen -> UGen -> Loop -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dbufrd :: UId m => UGen -> UGen -> Loop -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dbufwr :: (UId m) => UGen -> UGen -> UGen -> Loop -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dbufwr :: UId m => UGen -> UGen -> UGen -> Loop -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dgeom :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dgeom :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dibrown :: (UId m) => UGen -> UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dibrown :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: diwhite :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: diwhite :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: drand :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: drand :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dseq :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dseq :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dser :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dser :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dseries :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dseries :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dstutter :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dstutter :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dswitch :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dswitch :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dswitch1 :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dswitch1 :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dwhite :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dwhite :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Demand.Monadic: dxrand :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Demand.Monadic: dxrand :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Envelope.Construct: envLinen :: UGen -> UGen -> UGen -> UGen -> [EnvCurve] -> [UGen]
+ Sound.SC3.UGen.Envelope.Construct: envLinen :: UGen -> UGen -> UGen -> UGen -> [UGen]
- Sound.SC3.UGen.Envelope.Construct: envPerc' :: UGen -> UGen -> UGen -> [EnvCurve] -> [UGen]
+ Sound.SC3.UGen.Envelope.Construct: envPerc' :: UGen -> UGen -> UGen -> (EnvCurve, EnvCurve) -> [UGen]
- Sound.SC3.UGen.External: ayFreqToTone :: (Fractional a) => a -> a
+ Sound.SC3.UGen.External: ayFreqToTone :: Fractional a => a -> a
- Sound.SC3.UGen.FFT.Monadic: pv_BinScramble :: (UId m) => UGen -> UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.FFT.Monadic: pv_BinScramble :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.FFT.Monadic: pv_RandComb :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.FFT.Monadic: pv_RandComb :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.FFT.Monadic: pv_RandWipe :: (UId m) => UGen -> UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.FFT.Monadic: pv_RandWipe :: UId m => UGen -> UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.MachineListening: onsetType :: String -> UGen
+ Sound.SC3.UGen.MachineListening: onsetType :: Num a => String -> a
- Sound.SC3.UGen.Math: (/=*) :: (EqE a) => a -> a -> a
+ Sound.SC3.UGen.Math: (/=*) :: EqE a => a -> a -> a
- Sound.SC3.UGen.Math: (<*) :: (OrdE a) => a -> a -> a
+ Sound.SC3.UGen.Math: (<*) :: OrdE a => a -> a -> a
- Sound.SC3.UGen.Math: (<=*) :: (OrdE a) => a -> a -> a
+ Sound.SC3.UGen.Math: (<=*) :: OrdE a => a -> a -> a
- Sound.SC3.UGen.Math: (==*) :: (EqE a) => a -> a -> a
+ Sound.SC3.UGen.Math: (==*) :: EqE a => a -> a -> a
- Sound.SC3.UGen.Math: (>*) :: (OrdE a) => a -> a -> a
+ Sound.SC3.UGen.Math: (>*) :: OrdE a => a -> a -> a
- Sound.SC3.UGen.Math: (>=*) :: (OrdE a) => a -> a -> a
+ Sound.SC3.UGen.Math: (>=*) :: OrdE a => a -> a -> a
- Sound.SC3.UGen.Math: absDif :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: absDif :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: amClip :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: amClip :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: ampDb :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: ampDb :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: asFloat :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: asFloat :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: asInt :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: asInt :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: atan2E :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: atan2E :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: bitAnd :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: bitAnd :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: bitNot :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: bitNot :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: bitOr :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: bitOr :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: bitXOr :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: bitXOr :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: ceil :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: ceil :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: clip2 :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: clip2 :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: clip_ :: (Ord a) => a -> a -> a -> a
+ Sound.SC3.UGen.Math: clip_ :: Ord a => a -> a -> a -> a
- Sound.SC3.UGen.Math: cpsMIDI :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: cpsMIDI :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: cpsOct :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: cpsOct :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: cubed :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: cubed :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: dbAmp :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: dbAmp :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: difSqr :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: difSqr :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: distort :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: distort :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: excess :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: excess :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: exprandRange :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: exprandRange :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: fill :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: fill :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: firstArg :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: firstArg :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: floorE :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: floorE :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: fold2 :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: fold2 :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: frac :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: frac :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: gcdE :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: gcdE :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: hypot :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: hypot :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: hypotx :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: hypotx :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: iDiv :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: iDiv :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: isNil :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: isNil :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: lcmE :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: lcmE :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: log10 :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: log10 :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: log2 :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: log2 :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: midiCPS :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: midiCPS :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: midiRatio :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: midiRatio :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: modE :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: modE :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: notE :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: notE :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: notNil :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: notNil :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: octCPS :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: octCPS :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: ramp_ :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: ramp_ :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: randRange :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: randRange :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: ratioMIDI :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: ratioMIDI :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: ring1 :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: ring1 :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: ring2 :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: ring2 :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: ring3 :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: ring3 :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: ring4 :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: ring4 :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: roundE :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: roundE :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: roundUp :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: roundUp :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: scaleNeg :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: scaleNeg :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: shiftLeft :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: shiftLeft :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: shiftRight :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: shiftRight :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: softClip :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: softClip :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: sqrDif :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: sqrDif :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: sqrSum :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: sqrSum :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: squared :: (UnaryOp a) => a -> a
+ Sound.SC3.UGen.Math: squared :: UnaryOp a => a -> a
- Sound.SC3.UGen.Math: sumSqr :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: sumSqr :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: thresh :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: thresh :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: trunc :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: trunc :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: unsignedShift :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: unsignedShift :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Math: wrap2 :: (BinaryOp a) => a -> a -> a
+ Sound.SC3.UGen.Math: wrap2 :: BinaryOp a => a -> a -> a
- Sound.SC3.UGen.Noise.Monadic: brownNoise :: (UId m) => Rate -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: brownNoise :: UId m => Rate -> m UGen
- Sound.SC3.UGen.Noise.Monadic: clipNoise :: (UId m) => Rate -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: clipNoise :: UId m => Rate -> m UGen
- Sound.SC3.UGen.Noise.Monadic: coinGate :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: coinGate :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: dust :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: dust :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: dust2 :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: dust2 :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: expRand :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: expRand :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: grayNoise :: (UId m) => Rate -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: grayNoise :: UId m => Rate -> m UGen
- Sound.SC3.UGen.Noise.Monadic: iRand :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: iRand :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfClipNoise :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfClipNoise :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfNoise0 :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfNoise0 :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfNoise1 :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfNoise1 :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfNoise2 :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfNoise2 :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfdClipNoise :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfdClipNoise :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfdNoise0 :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfdNoise0 :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfdNoise1 :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfdNoise1 :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfdNoise2 :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfdNoise2 :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: lfdNoise3 :: (UId m) => Rate -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: lfdNoise3 :: UId m => Rate -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: linRand :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: linRand :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: nRand :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: nRand :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: pinkNoise :: (UId m) => Rate -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: pinkNoise :: UId m => Rate -> m UGen
- Sound.SC3.UGen.Noise.Monadic: rand :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: rand :: UId m => UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: tExpRand :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: tExpRand :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: tRand :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: tRand :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: tiRand :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: tiRand :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: twindex :: (UId m) => UGen -> UGen -> UGen -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: twindex :: UId m => UGen -> UGen -> UGen -> m UGen
- Sound.SC3.UGen.Noise.Monadic: whiteNoise :: (UId m) => Rate -> m UGen
+ Sound.SC3.UGen.Noise.Monadic: whiteNoise :: UId m => Rate -> m UGen
- Sound.SC3.UGen.UGen: Control :: Rate -> String -> Double -> UGen
+ Sound.SC3.UGen.UGen: Control :: Rate -> String -> Double -> Bool -> UGen
- Sound.SC3.UGen.UGen: Primitive :: Rate -> String -> [UGen] -> [Output] -> Special -> Maybe UGenId -> UGen
+ Sound.SC3.UGen.UGen: Primitive :: Rate -> String -> [UGen] -> [Output] -> Special -> Int -> UGen
- Sound.SC3.UGen.UGen: clone :: (UId m) => Int -> m UGen -> m UGen
+ Sound.SC3.UGen.UGen: clone :: UId m => Int -> m UGen -> m UGen
- Sound.SC3.UGen.UGen: constant :: (Real a) => a -> UGen
+ Sound.SC3.UGen.UGen: constant :: Real a => a -> UGen
- Sound.SC3.UGen.UGen: mkFilterId :: UGenId -> String -> [UGen] -> Int -> UGen
+ Sound.SC3.UGen.UGen: mkFilterId :: ID a => a -> String -> [UGen] -> Int -> UGen
- Sound.SC3.UGen.UGen: mkFilterMCEId :: UGenId -> String -> [UGen] -> UGen -> Int -> UGen
+ Sound.SC3.UGen.UGen: mkFilterMCEId :: ID a => a -> String -> [UGen] -> UGen -> Int -> UGen
- Sound.SC3.UGen.UGen: mkOscId :: UGenId -> Rate -> String -> [UGen] -> Int -> UGen
+ Sound.SC3.UGen.UGen: mkOscId :: ID a => a -> Rate -> String -> [UGen] -> Int -> UGen
- Sound.SC3.UGen.UGen: mkOscMCEId :: UGenId -> Rate -> String -> [UGen] -> UGen -> Int -> UGen
+ Sound.SC3.UGen.UGen: mkOscMCEId :: ID a => a -> Rate -> String -> [UGen] -> UGen -> Int -> UGen
- Sound.SC3.UGen.UGen: mkUGen :: Rate -> String -> [UGen] -> [Output] -> Special -> Maybe UGenId -> UGen
+ Sound.SC3.UGen.UGen: mkUGen :: ID a => Rate -> String -> [UGen] -> [Output] -> Special -> a -> UGen
- Sound.SC3.UGen.UGen: mk_filter :: [Rate] -> Maybe UGenId -> String -> [UGen] -> Int -> UGen
+ Sound.SC3.UGen.UGen: mk_filter :: ID a => [Rate] -> a -> String -> [UGen] -> Int -> UGen
- Sound.SC3.UGen.UGen: mk_filter_mce :: [Rate] -> Maybe UGenId -> String -> [UGen] -> UGen -> Int -> UGen
+ Sound.SC3.UGen.UGen: mk_filter_mce :: ID a => [Rate] -> a -> String -> [UGen] -> UGen -> Int -> UGen
- Sound.SC3.UGen.UGen: mk_osc :: [Rate] -> Maybe UGenId -> Rate -> String -> [UGen] -> Int -> UGen
+ Sound.SC3.UGen.UGen: mk_osc :: ID a => [Rate] -> a -> Rate -> String -> [UGen] -> Int -> UGen
- Sound.SC3.UGen.UGen: mk_osc_mce :: Maybe UGenId -> Rate -> String -> [UGen] -> UGen -> Int -> UGen
+ Sound.SC3.UGen.UGen: mk_osc_mce :: ID a => a -> Rate -> String -> [UGen] -> UGen -> Int -> UGen
- Sound.SC3.UGen.UGen: ugenId :: UGen -> Maybe UGenId
+ Sound.SC3.UGen.UGen: ugenId :: UGen -> Int
- Sound.SC3.UGen.UGen.Lift: liftU :: (UId m) => (UGenId -> a -> UGen) -> (a -> m UGen)
+ Sound.SC3.UGen.UGen.Lift: liftU :: UId m => (Int -> a -> UGen) -> (a -> m UGen)
- Sound.SC3.UGen.UGen.Lift: liftU2 :: (UId m) => (UGenId -> a -> b -> UGen) -> (a -> b -> m UGen)
+ Sound.SC3.UGen.UGen.Lift: liftU2 :: UId m => (Int -> a -> b -> UGen) -> (a -> b -> m UGen)
- Sound.SC3.UGen.UGen.Lift: liftU3 :: (UId m) => (UGenId -> a -> b -> c -> UGen) -> (a -> b -> c -> m UGen)
+ Sound.SC3.UGen.UGen.Lift: liftU3 :: UId m => (Int -> a -> b -> c -> UGen) -> (a -> b -> c -> m UGen)
- Sound.SC3.UGen.UGen.Lift: liftU4 :: (UId m) => (UGenId -> a -> b -> c -> d -> UGen) -> (a -> b -> c -> d -> m UGen)
+ Sound.SC3.UGen.UGen.Lift: liftU4 :: UId m => (Int -> a -> b -> c -> d -> UGen) -> (a -> b -> c -> d -> m UGen)
- Sound.SC3.UGen.UId: class (Monad m) => UId m
+ Sound.SC3.UGen.UId: class Monad m => UId m
- Sound.SC3.UGen.UId: generateUId :: (UId m) => m Int
+ Sound.SC3.UGen.UId: generateUId :: UId m => m Int
Files
- Help/Graphs/adso.lhs +0/−33
- Help/Graphs/aleatoric-quartet.lhs +0/−50
- Help/Graphs/analog-bubbles.lhs +0/−13
- Help/Graphs/babbling-brook.lhs +0/−21
- Help/Graphs/birds.lhs +0/−27
- Help/Graphs/bit-reduction.lhs +0/−37
- Help/Graphs/bottle.lhs +0/−22
- Help/Graphs/bowed-string.lhs +0/−43
- Help/Graphs/ccomb.lhs +0/−27
- Help/Graphs/chain-saw.lhs +0/−58
- Help/Graphs/chrd.lhs +0/−35
- Help/Graphs/cricket.lhs +0/−21
- Help/Graphs/crotale.lhs +0/−335
- Help/Graphs/cut-outs.lhs +0/−26
- Help/Graphs/cymbalism.lhs +0/−29
- Help/Graphs/deep-sea.lhs +0/−39
- Help/Graphs/default.lhs +0/−35
- Help/Graphs/demanding-studies.lhs +0/−25
- Help/Graphs/dial-history.lhs +0/−52
- Help/Graphs/diffraction.lhs +0/−43
- Help/Graphs/discretion.lhs +0/−14
- Help/Graphs/drummer.lhs +0/−24
- Help/Graphs/e-lamell.lhs +0/−54
- Help/Graphs/eggcrate.lhs +0/−26
- Help/Graphs/f-lets.lhs +0/−25
- Help/Graphs/fbl-fbf.lhs +0/−26
- Help/Graphs/feedr.lhs +0/−22
- Help/Graphs/fm-iter.lhs +0/−16
- Help/Graphs/fm-kltr.lhs +0/−48
- Help/Graphs/forest-sounds.lhs +0/−17
- Help/Graphs/fwalk.lhs +0/−27
- Help/Graphs/h-chatter.lhs +0/−44
- Help/Graphs/half-life.lhs +0/−17
- Help/Graphs/harmonic-swimming.lhs +0/−24
- Help/Graphs/harmonic-tumbling.lhs +0/−22
- Help/Graphs/hh-808.lhs +0/−24
- Help/Graphs/implosion.lhs +0/−21
- Help/Graphs/insects.lhs +0/−14
- Help/Graphs/k-ppr.lhs +0/−35
- Help/Graphs/karplus-strong.lhs +0/−39
- Help/Graphs/klink.lhs +0/−27
- Help/Graphs/lf-pulses.lhs +0/−17
- Help/Graphs/lfo-modulation.lhs +0/−13
- Help/Graphs/lg-timed.lhs +0/−38
- Help/Graphs/lin-sosc.lhs +0/−58
- Help/Graphs/lucier.hs +0/−95
- Help/Graphs/modal-space.lhs +0/−36
- Help/Graphs/moto-rev.lhs +0/−11
- Help/Graphs/mouse-clatter.lhs +0/−54
- Help/Graphs/nharm.lhs +0/−25
- Help/Graphs/noise-burst-sweep.lhs +0/−17
- Help/Graphs/one-line.lhs +0/−13
- Help/Graphs/oscillator-cluster.lhs +0/−48
- Help/Graphs/overlap-add.lhs +0/−39
- Help/Graphs/pattern-buffer.lhs +0/−26
- Help/Graphs/plucked-strings.lhs +0/−22
- Help/Graphs/police-state.lhs +0/−34
- Help/Graphs/pulsing-bottles.lhs +0/−15
- Help/Graphs/record-scratcher.lhs +0/−29
- Help/Graphs/red-frik.lhs +0/−31
- Help/Graphs/reverberated-sine-percussion.lhs +0/−37
- Help/Graphs/rm-octaver.lhs +0/−9
- Help/Graphs/s-chirp.lhs +0/−22
- Help/Graphs/sample-and-hold-liquidities.lhs +0/−24
- Help/Graphs/scratchy.lhs +0/−19
- Help/Graphs/scritto.lhs +0/−125
- Help/Graphs/shepard-tones.lhs +0/−41
- Help/Graphs/shifting-pulses.lhs +0/−22
- Help/Graphs/snare-909.lhs +0/−45
- Help/Graphs/sosc-lp.lhs +0/−32
- Help/Graphs/spe.lhs +0/−22
- Help/Graphs/sprinkler.lhs +0/−21
- Help/Graphs/strummable-guitar.lhs +0/−29
- Help/Graphs/sweepy-noise.lhs +0/−16
- Help/Graphs/synthetic-piano.lhs +0/−32
- Help/Graphs/tank.lhs +0/−66
- Help/Graphs/tgb.lhs +0/−33
- Help/Graphs/tgr-rpr.lhs +0/−41
- Help/Graphs/tgrn.lhs +0/−23
- Help/Graphs/theremin.lhs +0/−21
- Help/Graphs/three-cpsw.lhs +0/−23
- Help/Graphs/thx.lhs +0/−37
- Help/Graphs/tipnso.lhs +0/−14
- Help/Graphs/tr-out.lhs +0/−22
- Help/Graphs/train.lhs +0/−24
- Help/Graphs/trkl.lhs +0/−26
- Help/Graphs/tsort.lhs +0/−21
- Help/Graphs/vlc-distrtn.lhs +0/−132
- Help/Graphs/what-was-i-thinking.lhs +0/−33
- Help/Graphs/wial.lhs +0/−21
- Help/Graphs/wind-metals.lhs +0/−28
- Help/Graphs/xy-interference.lhs +0/−31
- Help/Server/dumpOSC.help.lhs +5/−5
- Help/Server/s_newargs.help.lhs +3/−1
- Help/Tutorial/Tutorial.lhs +0/−244
- Help/Tutorial/Waveset.hs +0/−170
- Help/Tutorial/non-real-time.hs +0/−23
- Help/UGen/Buffer/bufAllpassC.help.lhs +2/−0
- Help/UGen/Buffer/bufCombC.help.lhs +2/−0
- Help/UGen/Buffer/bufDelayC.help.lhs +2/−0
- Help/UGen/Buffer/bufDur.help.lhs +4/−1
- Help/UGen/Buffer/bufFrames.help.lhs +4/−1
- Help/UGen/Buffer/bufRateScale.help.lhs +4/−1
- Help/UGen/Buffer/bufRd.help.lhs +9/−4
- Help/UGen/Buffer/bufSampleRate.help.lhs +4/−1
- Help/UGen/Buffer/index.help.lhs +2/−0
- Help/UGen/Buffer/indexInBetween.help.lhs +2/−0
- Help/UGen/Buffer/osc.help.lhs +6/−1
- Help/UGen/Buffer/playBuf.help.lhs +13/−8
- Help/UGen/Buffer/recordBuf.help.lhs +1/−1
- Help/UGen/Chaos/crackle.help.lhs +2/−0
- Help/UGen/Chaos/cuspL.help.lhs +3/−1
- Help/UGen/Chaos/fbSineC.help.lhs +10/−5
- Help/UGen/Chaos/henonN.help.lhs +5/−1
- Help/UGen/Chaos/latoocarfianC.help.lhs +9/−3
- Help/UGen/Chaos/linCongC.help.lhs +4/−0
- Help/UGen/Chaos/logistic.help.lhs +2/−0
- Help/UGen/Chaos/lorenzL.help.lhs +6/−1
- Help/UGen/Chaos/quadN.help.lhs +2/−0
- Help/UGen/Chaos/rossler.help.lhs +2/−0
- Help/UGen/Control/mrg2.help.lhs +2/−0
- Help/UGen/Demand/dbrown.help.lhs +2/−0
- Help/UGen/Demand/dbufrd.help.lhs +1/−1
- Help/UGen/Demand/dbufwr.help.lhs +2/−0
- Help/UGen/Demand/demand.help.lhs +2/−0
- Help/UGen/Demand/demandEnvGen.help.lhs +2/−0
- Help/UGen/Demand/dgeom.help.lhs +2/−0
- Help/UGen/Demand/drand.help.lhs +2/−0
- Help/UGen/Demand/dseq.help.lhs +2/−0
- Help/UGen/Demand/dser.help.lhs +2/−0
- Help/UGen/Demand/dseries.help.lhs +2/−0
- Help/UGen/Demand/dstutter.help.lhs +2/−0
- Help/UGen/Demand/dswitch.help.lhs +2/−0
- Help/UGen/Demand/dswitch1.help.lhs +2/−0
- Help/UGen/Demand/duty.help.lhs +2/−0
- Help/UGen/Demand/dwhite.help.lhs +2/−0
- Help/UGen/Demand/tDuty.help.lhs +7/−3
- Help/UGen/Envelope/detectSilence.help.lhs +2/−0
- Help/UGen/Envelope/done.help.lhs +2/−0
- Help/UGen/Envelope/envCoord.help.lhs +11/−0
- Help/UGen/Envelope/envGen.help.lhs +2/−23
- Help/UGen/Envelope/envLinen.help.lhs +9/−0
- Help/UGen/Envelope/envPerc.help.lhs +9/−0
- Help/UGen/Envelope/envSine.help.lhs +10/−0
- Help/UGen/Envelope/envTrapezoid.help.lhs +9/−0
- Help/UGen/Envelope/free.help.lhs +5/−3
- Help/UGen/Envelope/freeSelf.help.lhs +2/−0
- Help/UGen/Envelope/freeSelfWhenDone.help.lhs +2/−0
- Help/UGen/Envelope/line.help.lhs +2/−0
- Help/UGen/Envelope/linen.help.lhs +2/−0
- Help/UGen/Envelope/pause.help.lhs +3/−1
- Help/UGen/Envelope/pauseSelf.help.lhs +2/−0
- Help/UGen/Envelope/pauseSelfWhenDone.help.lhs +6/−0
- Help/UGen/Envelope/xLine.help.lhs +2/−0
- Help/UGen/External/fm7.help.lhs +2/−0
- Help/UGen/External/membraneCircle.help.lhs +2/−0
- Help/UGen/External/pv_Invert.help.lhs +7/−4
- Help/UGen/Filter/allpassN.help.lhs +18/−16
- Help/UGen/Filter/bLowPass.help.lhs +17/−1
- Help/UGen/Filter/freqShift.help.lhs +9/−8
- Help/UGen/Filter/klank.help.lhs +2/−0
- Help/UGen/Filter/moogFF.help.lhs +17/−7
- Help/UGen/Filter/pluck.help.lhs +2/−0
- Help/UGen/Filter/resonz.help.lhs +13/−11
- Help/UGen/Filter/rhpf.help.lhs +2/−0
- Help/UGen/Filter/ringz.help.lhs +2/−0
- Help/UGen/Filter/rlpf.help.lhs +6/−4
- Help/UGen/Filter/select.help.lhs +2/−0
- Help/UGen/Filter/shaper.help.lhs +2/−0
- Help/UGen/Filter/slew.help.lhs +2/−0
- Help/UGen/Filter/sos.help.lhs +2/−0
- Help/UGen/Filter/twoPole.help.lhs +2/−0
- Help/UGen/Filter/twoZero.help.lhs +2/−0
- Help/UGen/Filter/wrapIndex.help.lhs +2/−0
- Help/UGen/Granular/grainBuf.help.lhs +16/−12
- Help/UGen/Granular/grainFM.help.lhs +2/−0
- Help/UGen/Granular/grainIn.help.lhs +2/−0
- Help/UGen/Granular/grainSin.help.lhs +2/−0
- Help/UGen/Granular/warp1.help.lhs +8/−5
- Help/UGen/IO/in.help.lhs +8/−4
- Help/UGen/IO/inFeedback.help.lhs +2/−0
- Help/UGen/IO/inTrig.help.lhs +3/−2
- Help/UGen/IO/lagIn.help.lhs +8/−4
- Help/UGen/IO/localBuf.help.lhs +8/−8
- Help/UGen/IO/localIn.help.lhs +7/−7
- Help/UGen/IO/localOut.help.lhs +7/−7
- Help/UGen/IO/offsetOut.help.lhs +2/−0
- Help/UGen/IO/out.help.lhs +2/−0
- Help/UGen/IO/replaceOut.help.lhs +2/−0
- Help/UGen/IO/soundIn.help.lhs +2/−0
- Help/UGen/IO/xOut.help.lhs +2/−0
- Help/UGen/MachineListening/beatTrack.help.lhs +5/−2
- Help/UGen/MachineListening/loudness.help.lhs +10/−7
- Help/UGen/MachineListening/onsets.help.lhs +2/−0
- Help/UGen/Math/add.help.lhs +4/−4
- Help/UGen/Math/amClip.help.lhs +3/−3
- Help/UGen/Math/distort.help.lhs +2/−0
- Help/UGen/Math/fdiv.help.lhs +4/−4
- Help/UGen/Math/mul.help.lhs +4/−2
- Help/UGen/Math/pow.help.lhs +4/−0
- Help/UGen/Math/ring1.help.lhs +6/−0
- Help/UGen/Math/thresh.help.lhs +3/−3
- Help/UGen/Noise/brownNoise.help.lhs +7/−6
- Help/UGen/Noise/clipNoise.help.lhs +2/−0
- Help/UGen/Noise/coinGate.help.lhs +2/−0
- Help/UGen/Noise/dust.help.lhs +2/−0
- Help/UGen/Noise/dust2.help.lhs +2/−0
- Help/UGen/Noise/expRand.help.lhs +5/−3
- Help/UGen/Noise/grayNoise.help.lhs +2/−0
- Help/UGen/Noise/iRand.help.lhs +5/−3
- Help/UGen/Noise/lfClipNoise.help.lhs +2/−0
- Help/UGen/Noise/lfNoise0.help.lhs +4/−2
- Help/UGen/Noise/lfNoise1.help.lhs +2/−0
- Help/UGen/Noise/lfNoise2.help.lhs +2/−0
- Help/UGen/Noise/lfdClipNoise.help.lhs +2/−0
- Help/UGen/Noise/lfdNoise0.help.lhs +2/−0
- Help/UGen/Noise/linRand.help.lhs +2/−0
- Help/UGen/Noise/nRand.help.lhs +2/−0
- Help/UGen/Noise/pinkNoise.help.lhs +2/−0
- Help/UGen/Noise/rand.help.lhs +2/−0
- Help/UGen/Noise/tExpRand.help.lhs +2/−0
- Help/UGen/Noise/tRand.help.lhs +2/−0
- Help/UGen/Noise/tiRand.help.lhs +2/−0
- Help/UGen/Noise/whiteNoise.help.lhs +2/−0
- Help/UGen/Oscillator/fSinOsc.help.lhs +2/−0
- Help/UGen/Oscillator/gendy1.help.lhs +5/−0
- Help/UGen/Oscillator/impulse.help.lhs +5/−2
- Help/UGen/Oscillator/klang.help.lhs +2/−0
- Help/UGen/Oscillator/lfCub.help.lhs +2/−0
- Help/UGen/Oscillator/lfPulse.help.lhs +6/−2
- Help/UGen/Oscillator/lfSaw.help.lhs +2/−0
- Help/UGen/Oscillator/lfTri.help.lhs +2/−0
- Help/UGen/Oscillator/pmOsc.help.lhs +23/−0
- Help/UGen/Oscillator/silent.help.lhs +2/−0
- Help/UGen/Oscillator/sinOsc.help.lhs +10/−0
- Help/UGen/Oscillator/syncSaw.help.lhs +2/−0
- Help/UGen/Oscillator/tChoose.help.lhs +3/−0
- Help/UGen/Oscillator/tGrains.help.lhs +6/−1
- Help/UGen/Oscillator/twChoose.help.lhs +2/−0
- Help/UGen/Oscillator/twindex.help.lhs +5/−3
- Help/UGen/Panner/linPan2.help.lhs +4/−2
- Help/UGen/Panner/pan2.help.lhs +8/−6
- Help/UGen/Panner/rotate2.help.lhs +6/−4
- Help/UGen/Panner/splay.help.lhs +6/−3
- Help/UGen/Trigger/gate.help.lhs +2/−0
- Help/UGen/Trigger/inRange.help.lhs +6/−4
- Help/UGen/Trigger/lastValue.help.lhs +2/−0
- Help/UGen/Trigger/mostChange.help.lhs +6/−4
- Help/UGen/Trigger/peak.help.lhs +6/−4
- Help/UGen/Trigger/phasor.help.lhs +2/−0
- Help/UGen/Trigger/pulseCount.help.lhs +3/−1
- Help/UGen/Trigger/pulseDivider.help.lhs +2/−0
- Help/UGen/Trigger/runningMax.help.lhs +6/−4
- Help/UGen/Trigger/runningMin.help.lhs +8/−4
- Help/UGen/Trigger/sendTrig.help.lhs +9/−7
- Help/UGen/Trigger/setResetFF.help.lhs +6/−4
- Help/UGen/Trigger/stepper.help.lhs +6/−6
- Help/UGen/Trigger/sweep.help.lhs +12/−7
- Help/UGen/Trigger/tDelay.help.lhs +2/−0
- Help/UGen/Trigger/timer.help.lhs +2/−0
- Help/UGen/Trigger/toggleFF.help.lhs +7/−3
- Help/UGen/Trigger/trig.help.lhs +5/−3
- Help/UGen/Trigger/trig1.help.lhs +4/−2
- Help/hsc3.help.lhs +10/−4
- Help/tutorial.lhs +313/−0
- README +3/−3
- Sound/SC3.hs +5/−7
- Sound/SC3/ID.hs +11/−0
- Sound/SC3/Monadic.hs +14/−0
- Sound/SC3/Server/Command.hs +35/−7
- Sound/SC3/Server/Command/Completion.hs +82/−0
- Sound/SC3/Server/Synthdef.hs +115/−49
- Sound/SC3/UGen.hs +8/−8
- Sound/SC3/UGen/Base.hs +0/−7
- Sound/SC3/UGen/Buffer.hs +5/−5
- Sound/SC3/UGen/Composite.hs +10/−3
- Sound/SC3/UGen/Demand/Base.hs +0/−66
- Sound/SC3/UGen/Demand/ID.hs +66/−0
- Sound/SC3/UGen/Demand/Monadic.hs +1/−1
- Sound/SC3/UGen/Envelope/Construct.hs +72/−27
- Sound/SC3/UGen/FFT/Base.hs +0/−20
- Sound/SC3/UGen/FFT/ID.hs +20/−0
- Sound/SC3/UGen/FFT/Monadic.hs +1/−1
- Sound/SC3/UGen/Filter.hs +13/−0
- Sound/SC3/UGen/MachineListening.hs +2/−2
- Sound/SC3/UGen/Monadic.hs +0/−9
- Sound/SC3/UGen/Noise/Base.hs +0/−108
- Sound/SC3/UGen/Noise/ID.hs +108/−0
- Sound/SC3/UGen/Noise/Monadic.hs +1/−1
- Sound/SC3/UGen/UGen.hs +171/−117
- Sound/SC3/UGen/UGen/Lift.hs +24/−12
- Sound/SC3/UGen/Utilities.hs +0/−23
- hsc3.cabal +39/−475
− Help/Graphs/adso.lhs
@@ -1,33 +0,0 @@-adso (rd)--> import Sound.OpenSoundControl-> import Sound.SC3-> import System.Random--> let { rrand l r = getStdRandom (randomR (l, r))-> ; rrand_l j l r = sequence (replicate j (rrand l r))-> ; n = 24-> ; adso = let { get b j = let k = mce [0 .. constant j - 1]-> in bufRdN 1 kr b k NoLoop-> ; m = sinOsc kr (get 3 n) 0-> ; f = midiCPS (get 0 n) * (m * get 4 n + 1)-> ; l = get 2 n-> ; g = get 1 n }-> in out 0 (mix (pan2 (sinOsc ar f 0) l g))-> ; pattern fd t = do { z <- do { l <- rrand 22 48-> ; r <- rrand 54 122-> ; sequence (replicate n (rrand l r)) }-> ; send fd (b_setn1 0 0 z)-> ; let rn i l r = do { d <- rrand_l n l r-> ; send fd (b_setn1 i 0 d) }-> in do { rn 1 0 0.1-> ; rn 2 (-1) 1-> ; rn 3 2 12-> ; rn 4 0.001 0.0075-> ; rn 5 1 24-> ; rn 6 0.05 2.4 }-> ; pauseThread t } }-> in withSC3 (\fd -> do { mapM_ (\i -> async fd (b_alloc i n 1)) [0..6]-> ; play fd adso-> ; mapM_ (pattern fd) =<< rrand_l 32 0.025 0.75-> ; reset fd })
− Help/Graphs/aleatoric-quartet.lhs
@@ -1,50 +0,0 @@-aleatoric quartet (jmcc)--> import Sound.SC3--> let { base_mn = Control KR "note" 66-> ; amp = Control KR "ampl" 0.07-> ; density = mouseX kr 0.01 1 Linear 0.1-> ; dmul = recip density * 0.5 * amp-> ; dadd = amp - dmul-> ; (>=>) f g = \x -> f x >>= g-> ; chain n f = foldl (>=>) return (replicate n f)-> ; rapf i = do { r <- clone 2 (rand 0 0.05)-> ; return (allpassN i 0.05 r 1) }-> ; mk_f = do { i0 <- iRand 0 2-> ; let r0 = select i0 (mce [1, 0.5, 0.25])-> in do { r1 <- rand (-30) 30-> ; n0 <- lfNoise0 kr r0-> ; let m = lag (roundE (n0 * 7 + base_mn + r1) 1) 0.2-> in return (midiCPS m) } }-> ; mk_s = do { f <- fmap recip mk_f-> ; r <- rand (-1) 1-> ; x <- do { n0 <- pinkNoise ar-> ; n1 <- lfNoise1 kr 8-> ; return (n0 * max 0 (n1 * dmul + dadd)) }-> ; return (pan2 (combL x 0.02 f 3) r 1) } }-> in do { g <- chain 5 rapf =<< fmap sum (sequence (replicate 4 mk_s))-> ; audition (out 0 (leakDC g 0.995)) }--{ var amp = 0.07-; var density = MouseX.kr(0.01, 1, 'linear', 0.1)-; var dmul = density.reciprocal * 0.5 * amp-; var dadd = amp - dmul-; var rapf = { arg i- ; var r = Array.fill(2, { Rand(0, 0.05) })- ; AllpassN.ar(i, 0.05, r, 1) }-; var mk_f = { var i0 = IRand.new(0, 2)- ; var r0 = Select.kr(i0, [1, 0.5, 0.25])- ; var r1 = Rand.new(-30, 30)- ; var n0 = LFNoise0.kr(r0)- ; var m = Lag.kr((n0 * 7 + 66 + r1).round(1), 0.2)- ; m.midicps }-; var mk_s = { var f = mk_f.value.reciprocal- ; var r = Rand.new(-1, 1)- ; var n0 = PinkNoise.ar()- ; var n1 = LFNoise1.kr(8)- ; var x = n0 * 0.max(n1 * dmul + dadd)- ; Pan2.ar(CombL.ar(x, 0.02, f, 3), r, 1) }-; var g = Mix.fill(4, mk_s)-; 5.do({ g = rapf.value(g) })-; Out.ar(0, LeakDC.ar(g, 0.995)) }.play
− Help/Graphs/analog-bubbles.lhs
@@ -1,13 +0,0 @@-analog bubbles (jmcc)--> import Sound.SC3--> let { o = lfSaw kr (mce2 8 7.23) 0 * 3 + 80-> ; f = lfSaw kr 0.4 0 * 24 + o-> ; s = sinOsc ar (midiCPS f) 0 * 0.04 }-> in audition (out 0 (combN s 0.2 0.2 4))--{ var o = LFSaw.kr([8, 7.23], 0, 3, 80)-; var f = LFSaw.kr(0.4, 0, 24, o)-; var s = SinOsc.ar(f.midicps, 0, 0.04)-; Out.ar(0, CombN.ar(s, 0.2, 0.2, 4)) }.play
− Help/Graphs/babbling-brook.lhs
@@ -1,21 +0,0 @@-babbling brook (jmcc)--> import Sound.SC3--> let b f m a g = do { n1 <- brownNoise ar-> ; n2 <- brownNoise ar-> ; let n3 = lpf n2 f * m + a-> in return (rhpf (onePole n1 0.99) n3 0.03 * g) }-> in do { x <- clone 2 (b 14 400 500 0.006)-> ; y <- clone 2 (b 20 800 1000 0.010)-> ; audition (out 0 (x + y)) }--{ var b = { arg f, m, a, g - ; { var n1 = OnePole.ar(BrownNoise.ar, 0.99)- ; var n2 = LPF.ar(BrownNoise.ar, f) - ; RHPF.ar(n1, n2 * m + a, 0.03, g) } }-; var x = b.value(14, 400, 500, 0.006) ! 2-; var y = b.value(20, 800, 1000, 0.010) ! 2-; Out.ar(0, x + y) }.play--http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html
− Help/Graphs/birds.lhs
@@ -1,27 +0,0 @@-birds (jmcc)--> import Sound.SC3--> let { node = do { r1 <- rand 94.0 102.0-> ; r2 <- rand (-1.5) 1.5-> ; r3 <- rand 0.0 1.0-> ; r4 <- rand 11.0 15.0-> ; r5 <- rand 0.0 1.0-> ; r6 <- rand 12.0 15.6-> ; r7 <- rand 0.0 1.0-> ; r8 <- rand (-1.0) 1.0-> ; let { f = r1 + lag (lfSaw AR (7 + r2) r3 * r4) 0.1-> ; a = lfPulse KR (1.0 / r6) r7 0.16 * 0.05-> ; b = sinOsc AR (midiCPS f) r5 * a } -> in return (rotate2 b (silent 1) r8) }-> ; apf i = do { r1 <- rand 0.0 0.06-> ; r2 <- rand 0.7 2.0-> ; return (allpassL i 0.07 r1 r2) }-> ; composeM [] i = return i-> ; composeM (f:fs) i = f =<< composeM fs i-> ; chainM n f = composeM (replicate n f) }-> in do { d <- return . sum =<< sequence (replicate 6 node)-> ; w <- chainM 12 apf d-> ; audition (out 0 (d * 0.7 + w * 0.3)) }--http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html
− Help/Graphs/bit-reduction.lhs
@@ -1,37 +0,0 @@-bit reduction (adc)--sample rate decrease--> import Sound.SC3--> do { f <- lfNoise2 kr 8-> ; nh <- lfNoise2 kr 3-> ; let { src = blip ar (f * 200 + 300) (nh * 10 + 20)-> ; sr = mouseX kr 1000 (sampleRate * 0.1) Exponential 0.2 }-> in audition (out 0 (latch src (impulse ar sr 0))) }--{ var f = LFNoise2.kr(8)-; var nh = LFNoise2.kr(3)-; var src = Blip.ar(f * 200 + 300, nh * 10 + 20)-; var sr = MouseX.kr(1000, s.sampleRate * 0.1, 'exponential', 0.2)-; Out.ar(0, Latch.ar(src, Impulse.ar(sr, 0))) }.play--bit rate decrease--> do { f <- lfNoise2 kr 8-> ; nh <- lfNoise2 kr 3-> ; let { src = blip ar (f * 200 + 300) (nh * 10 + 20)-> ; sr = mouseX kr 1000 (sampleRate * 0.1) Exponential 0.2-> ; bit_sz = mouseY kr 1 24 Exponential 0.2-> ; down_sample = latch src (impulse ar sr 0)-> ; bit_redux = roundE down_sample (0.5 ** bit_sz) }-> in audition (out 0 (mce2 down_sample bit_redux)) }--{ var f = LFNoise2.kr(8)-; var nh = LFNoise2.kr(3)-; var src = Blip.ar(f * 200 + 300, nh * 10 + 20)-; var sr = MouseX.kr(1000, s.sampleRate * 0.1, 'exponential', 0.2)-; var bit_sz = MouseY.kr(1, 24, 'exponential', 0.2) -; var down_sample = Latch.ar(src, Impulse.ar(sr, 0))-; var bit_redux = down_sample.round(0.5 ** bit_sz)-; Out.ar(0, [down_sample, bit_redux]) }.play
− Help/Graphs/bottle.lhs
@@ -1,22 +0,0 @@-bottle (sc)--> import Sound.SC3--> do { freq <- rand 220 880-> ; wn <- whiteNoise ar-> ; pn <- pinkNoise ar-> ; let { (>=>) f g = \x -> f x >>= g-> ; chain n f = foldl (>=>) return (replicate n f)-> ; perc = envPerc 0.1 0.6-> ; ex = envGen kr 1 1 0 1 DoNothing perc * wn * 0.02-> ; flute = ringz ex freq 0.3-> ; r = resonz pn (5 + (freq / 2)) 0.1-> ; breath = envGen kr 1 1 0 1 DoNothing perc * r-> ; rapf i = do { x <- linRand 0.001 0.1 (-1)-> ; return (i + allpassN i 0.1 x 1.0 * 0.5) }-> ; cls i = let { en = replicate 3 (EnvNum (-4))-> ; l = envLinen 0.01 3.0 1.0 1 en-> ; z = (breath + i) * envGen kr 1 1 0 1 RemoveSynth l }-> in mce2 z z }-> in do { f <- (chain 2 rapf) flute-> ; audition (out 0 (cls f)) } }
− Help/Graphs/bowed-string.lhs
@@ -1,43 +0,0 @@-bowed string (jmcc)--> import Control.Monad-> import Sound.SC3-> import qualified Sound.SC3.UGen.Monadic as M-> import System.Random--> bowed_string :: IO ()-> bowed_string =-> let { rrand l r = getStdRandom (randomR (l, r))-> ; choose l = fmap (l !!) (rrand 0 (length l - 1))-> ; root = 5-> ; scale = map (+ root) [0, 2, 4, 5, 7, 9, 11]-> ; oct = [24, 36, 48, 60, 72, 84] }-> in do { n0 <- clone 2 (M.brownNoise ar)-> ; r0 <- M.expRand 0.125 0.5-> ; r1 <- M.rand 0.7 0.9-> ; r2 <- sequence (replicate 12 (M.rand 1.0 3.0))-> ; f <- fmap midiCPS (liftM2 (+) (choose scale) (choose oct))-> ; n1 <- M.lfNoise1 kr r0-> ; let { x = n0 * 0.007 * max 0 (n1 * 0.6 + 0.4)-> ; geom n i z = take n (iterate (* z) i)-> ; iota n i z = take n (iterate (+ z) i)-> ; d = klankSpec (iota 12 f f) (geom 12 1 r1) r2-> ; k = klank x 1 0 1 d }-> in audition (out 0 (softClip (k * 0.1))) }--> main :: IO ()-> main = bowed_string--{ var root = 5-; var scale = #[0, 2, 4, 5, 7, 9, 11] + root-; var oct = #[24, 36, 48, 60, 72, 84]-; var f = (scale.choose + oct.choose).midicps-; var n0 = BrownNoise.ar().dup-; var r0 = ExpRand.new(0.125, 0.5)-; var n1 = LFNoise1.kr(r0)-; var r1 = Rand.new(0.7,0.9)-; var r2 = Array.fill(12, { Rand.new(1.0, 3.0) })-; var x = n0 * 0.007 * max(0, n1 * 0.6 + 0.4)-; var d = `[Array.series(12, f, f), Array.geom(12, 1, r1), r2]-; var k = Klank.ar(d, x)-; Out.ar(0, (k * 0.1).softclip) }.play
− Help/Graphs/ccomb.lhs
@@ -1,27 +0,0 @@-ccomb (rd)--> import Sound.SC3--> let { rng l r i = linLin i (-1) 1 l r-> ; lwr = 48-> ; flwr = midiCPS lwr-> ; spart t = do { n <- fmap (rng lwr 72.0) (lfNoise2 kr 0.1)-> ; e <- fmap (decay2 t 0.01) (tRand 0.05 0.75 t)-> ; x <- fmap (* e) (whiteNoise ar)-> ; m <- lfNoise2 kr 0.1-> ; let f = lag (midiCPS n) 0.25-> in return (combC x (recip flwr) (recip f) (rng 1 8 m)) } }-> in do { t <- dust kr (mce2 0.75 0.35)-> ; audition . (out 0) . (* 0.1) . sum =<< sequence (replicate 12 (spart t)) }--{ var lwr = 48-; var flwr = lwr.midicps-; var spart = { arg t- ; { var n = LFNoise2.kr(0.1).range(lwr, 72.0)- ; var e = Decay2.kr(t, 0.01, TRand.kr(0.05, 0.75, t))- ; var x = WhiteNoise.ar() * e- ; var m = LFNoise2.kr(0.1)- ; var f = Lag.kr(n.midicps, 0.25)- ; CombC.ar(x, flwr.reciprocal, f.reciprocal, m.range(1, 8)) } }-; var t = Dust.kr([0.75, 0.35])-; Out.ar(0, Mix.fill(12, spart.value(t)) * 0.1) }.play
− Help/Graphs/chain-saw.lhs
@@ -1,58 +0,0 @@-chain saw (jrhb)--[this graph generates long chains of unit generators and may require-increasing the stack limit of the haskell run time system]--> import Control.Monad-> import Sound.SC3-> import qualified Sound.SC3.UGen.Monadic as M-> import System.Random--> main :: IO ()-> main =-> let { rrand l r = getStdRandom (randomR (l, r)) :: IO Double-> ; coin n a b = do { m <- rrand 0.0 1.0-> ; return (if m > n then a else b) }-> ; exprange s l r = linExp s (-1) 1 l r-> ; chain n fn = foldr (<=<) return (replicate n fn)-> ; mceProduct = mceEdit (\l -> [product l])-> ; clipu s = clip2 s 1-> ; dup a = mce2 a a-> ; f s1 = do { xr <- fmap dup (M.expRand 0.1 2)-> ; n1 <- M.lfNoise1 kr xr-> ; n2 <- M.lfNoise1 kr xr-> ; n3 <- M.lfNoise1 kr xr-> ; f1 <- coin 0.6 (exprange n1 0.01 10) (exprange n2 10 50)-> ; s2 <- coin 0.5 (1 - s1) (mceReverse s1)-> ; let { f2 = linExp s1 (-1) 1 f1 (f1 * exprange n3 2 10)-> ; u1 = lfSaw kr f2 0-> ; u2 = lfSaw kr (f1 * 0.1) 0 * 0.1 + 1 }-> in return . clipu =<< coin 0.5 (u1 * s2) (u1 * u2) }-> ; inp = lfSaw kr (0.2 * mce2 1 1.1) 0-> ; b_freq = mce [70, 800, 9000, 5242] }-> in do { ff <- chain 8 f inp-> ; let { c_saw = mceProduct (saw ar (exprange ff 6 11000))-> ; b_saw = dup (mix (bpf c_saw b_freq 0.2)) }-> in audition (out 0 (b_saw * 0.3)) }--{ var f = { arg s1- ; var rate = ExpRand.new(0.1, 2).dup- ; var n1 = { LFNoise1.kr(rate).exprange(0.01, 10) }- ; var n2 = { LFNoise1.kr(rate).exprange(10, 50) }- ; var n3 = LFNoise1.kr(rate).exprange(2, 10)- ; var f1 = if(0.6.coin) { n1.value } { n2.value }- ; var s2 = [1 - s1, s1.reverse].choose- ; var f2 = LinExp.kr(s1, -1, 1, f1, f1 * n3)- ; var u1 = LFSaw.kr(f2, 0)- ; var u2 = LFSaw.kr(f1 * 0.1, 0, 0.1, 1)- ; var u3 = if(0.5.coin) { u1 * s2 } { u1 * u2 }- ; u3.clip2(1) }-; var g = { arg func, n- ; n.do { func = func <> func }- ; func }-; var inp = LFSaw.kr(0.2 * [1, 1.1], 0)-; var b_freq = [70, 800, 9000, 5242]-; var ff = g.(f, 4).value(inp)-; var c_saw = Saw.ar(ff.exprange(6, 11000)).product-; var b_saw = BPF.ar(c_saw, b_freq, 0.2).sum.dup-; Out.ar(0, b_saw * 0.3) }.play
− Help/Graphs/chrd.lhs
@@ -1,35 +0,0 @@-chrd (rd)--> import Sound.SC3--> let chrd = do { r0 <- rand 0.05 0.5-> ; [r1, r2] <- sequence (replicate 2 (rand (-1) 1))-> ; r3 <- rand 0.15 0.35-> ; r4 <- rand 0.005 0.01-> ; let { m = mce [60, 65, 72, 77, 79, 84]-> ; ds = 3-> ; d = mce (map (* ds) [5, 4, 5, 7, 4, 5])-> ; f = midiCPS (xLine kr m (m + r0) d DoNothing)-> ; z = envTrapezoid 0 r3 d r4-> ; e = envGen kr 1 1 0 1 DoNothing z-> ; p = xLine kr r1 r2 d DoNothing-> ; o = fSinOsc ar f 0 }-> in return (mix (pan2 o p e)) }-> in audition . out 0 . mix =<< clone 9 chrd--{ var chrd = { var r0 = Rand.new(0.05, 0.5)- ; var r1 = Rand.new(-1, 1)- ; var r2 = Rand.new(-1, 1)- ; var r3 = Rand.new(0.15, 0.35)- ; var r4 = Rand.new(0.005, 0.01)- ; var m = [60, 65, 72, 77, 79, 84]- ; var ds = 3- ; var d = [5, 4, 5, 7, 4, 5] * ds- ; var f = XLine.kr(m, m + r0, d).midicps- ; var z_ = Env.linen(r3 * d, 0, (1 - r3) * d, r4)- ; var z = Env.sine(d.maxItem, r4)- ; var e = EnvGen.kr(z, 1, 1, 0, 1)- ; var p = XLine.kr(r1, r2, d)- ; var o = SinOsc.ar(f, 0)- ; Mix.ar(Pan2.ar(o, p, e)) }-; Out.ar(0, Mix.fill(9, chrd)) }.play
− Help/Graphs/cricket.lhs
@@ -1,21 +0,0 @@-cricket (rd)--> import Sound.SC3--> do { r1 <- clone 2 (rand 10 13)-> ; r2 <- clone 2 (rand 10 13)-> ; r3 <- clone 2 (rand 4 7)-> ; let { t = impulse kr 0.7 0-> ; e = decay2 (impulse kr r1 0) 0.001 0.005-> ; f = sinOsc kr r2 0 * e * r3 }-> in do { r4 <- clone 2 (tRand 2220 2227 t)-> ; audition (out 0 (sinOsc ar r4 0 * f * 0.25)) } }--{ var r1 = Array.fill(2, { Rand.new(10, 13) })-; var r2 = Array.fill(2, { Rand.new(10, 13) })-; var r3 = Array.fill(2, { Rand.new(4, 7) })-; var t = Impulse.kr(0.7, 0)-; var e = Decay2.kr(Impulse.kr(r1, 0), 0.001, 0.005)-; var f = SinOsc.kr(r2, 0) * e * r3-; var r4 = Array.fill(2, { TRand.kr(2220, 2227, t) })-; Out.ar(0, SinOsc.ar(r4, 0) * f * 0.25) }.play
− Help/Graphs/crotale.lhs
@@ -1,335 +0,0 @@-crotale (rd)--> import Sound.SC3-> import qualified Sound.SC3.UGen.Base as B--> main :: IO ()-> main =-> let { crotale = ( [ 35.45676040649414-> , 128.59849548339844-> , 346.9721984863281-> , 483.5544128417969-> , 1049.2449951171875-> , 1564.0279541015625-> , 1756.3399658203125-> , 3391.666015625-> , 3451.802001953125-> , 3497.261962890625-> , 3596.89794921875-> , 3696.739013671875-> , 3835.235107421875-> , 3845.955078125-> , 4254.85107421875-> , 4407.533203125-> , 4415.26416015625-> , 4552.865234375-> , 5538.076171875-> , 5637.73681640625-> , 5690.2978515625-> , 5728.0068359375-> , 5764.27685546875-> , 5824.4189453125-> , 6377.60498046875-> , 6544.35009765625-> , 6807.14404296875-> , 6994.97021484375-> , 7026.84619140625-> , 7144.5859375-> , 7269.61279296875-> , 7393.6708984375-> , 7897.259765625-> , 8040.4580078125-> , 8157.77099609375-> , 8225.01953125-> , 9126.150390625-> , 9488.529296875-> , 9916.408203125-> , 10155.599609375-> , 11715.9599609375-> , 12111.830078125-> , 12339.990234375-> , 12417.669921875-> , 12459.2802734375-> , 12618.330078125-> , 13116.490234375-> , 13201.1298828125-> , 13297.830078125-> , 13533.75 ]-> , [ 0.0012827360769733787-> , 0.0008040848188102245-> , 0.017361238598823547-> , 0.004835359752178192-> , 0.004413491114974022-> , 0.004110544919967651-> , 0.0003338181704748422-> , 0.0036140112206339836-> , 0.006919348146766424-> , 0.0003224937245249748-> , 0.0006031467346474528-> , 0.06686479598283768-> , 0.000605064386036247-> , 0.003602313343435526-> , 0.0002835785271599889-> , 0.015243238769471645-> , 0.020536603406071663-> , 0.016677580773830414-> , 0.0009245267719961703-> , 0.20205098390579224-> , 0.0012542791664600372-> , 0.012705927714705467-> , 0.0002523190632928163-> , 0.0004866079252678901-> , 0.0006429700297303498-> , 0.0007763264584355056-> , 0.2081160992383957-> , 0.0024918108247220516-> , 0.00193469924852252-> , 0.005231771152466536-> , 0.0069242212921381-> , 0.001203975174576044-> , 0.2050020843744278-> , 0.04060448706150055-> , 0.0038344631902873516-> , 0.002189427148550749-> , 0.18056060373783112-> , 0.002192433224990964-> , 0.006516554858535528-> , 0.009982921183109283-> , 0.004745401442050934-> , 0.046154771000146866-> , 0.000510294979903847-> , 0.0018905038014054298-> , 0.0019782145973294973-> , 0.006729386281222105-> , 0.0023426134139299393-> , 0.0024002245627343655-> , 0.03515550494194031-> , 0.0014084168942645192 ]-> , [ 5.203680992126465-> , 1.7034343481063843-> , 40.16516876220703-> , 27.282501220703125-> , 0.8950523138046265-> , 42.84742736816406-> , 2.6603667736053467-> , 15.7678861618042-> , 6.848367214202881-> , 3.2325007915496826-> , 1.7343382835388184-> , 2.0202419757843018-> , 4.7279052734375-> , 9.400103569030762-> , 0.7102512717247009-> , 37.494625091552734-> , 36.24879455566406-> , 29.172658920288086-> , 3.891019344329834-> , 4.757885456085205-> , 3.851426124572754-> , 20.90781021118164-> , 3.732874870300293-> , 2.3834102153778076-> , 10.443285942077637-> , 8.795611381530762-> , 20.98564338684082-> , 18.01180076599121-> , 25.297883987426758-> , 14.819819450378418-> , 42.39189910888672-> , 2.9485135078430176-> , 11.043763160705566-> , 49.55165100097656-> , 29.882694244384766-> , 10.527188301086426-> , 23.5572452545166-> , 26.55561637878418-> , 45.099605560302734-> , 22.550390243530273-> , 36.46126174926758-> , 11.826201438903809-> , 16.818185806274414-> , 14.903121948242188-> , 32.81113815307617-> , 43.1389045715332-> , 12.289558410644531-> , 11.498942375183105-> , 10.465788841247559-> , 24.93169593811035 ] )-> ; (cf, ca, cd) = crotale-> ; ps = mce [-12, -5, 0, 2, 4, 5, 7, 12]-> ; n = B.pinkNoise (uid 0) ar-> ; t = B.dust (uid 0) kr 3-> ; fs = select (B.tiRand (uid 0) 0 7 t) ps-> ; g = B.tRand (uid 0) 0 1 t-> ; fo = B.tRand (uid 1) 0 1 t-> ; ds = B.tRand (uid 2) 2 7 t-> ; p = B.tRand (uid 3) (-1) 1 t-> ; s = decay2 t 0.06 0.01 * n * g-> ; ks = klankSpec cf ca (map recip cd)-> ; k = dynKlank s (midiRatio fs) fo ds ks }-> in audition (out 0 (pan2 k p 1))--{ var crotale = [ [ 35.45676040649414- , 128.59849548339844- , 346.9721984863281- , 483.5544128417969- , 1049.2449951171875- , 1564.0279541015625- , 1756.3399658203125- , 3391.666015625- , 3451.802001953125- , 3497.261962890625- , 3596.89794921875- , 3696.739013671875- , 3835.235107421875- , 3845.955078125- , 4254.85107421875- , 4407.533203125- , 4415.26416015625- , 4552.865234375- , 5538.076171875- , 5637.73681640625- , 5690.2978515625- , 5728.0068359375- , 5764.27685546875- , 5824.4189453125- , 6377.60498046875- , 6544.35009765625- , 6807.14404296875- , 6994.97021484375- , 7026.84619140625- , 7144.5859375- , 7269.61279296875- , 7393.6708984375- , 7897.259765625- , 8040.4580078125- , 8157.77099609375- , 8225.01953125- , 9126.150390625- , 9488.529296875- , 9916.408203125- , 10155.599609375- , 11715.9599609375- , 12111.830078125- , 12339.990234375- , 12417.669921875- , 12459.2802734375- , 12618.330078125- , 13116.490234375- , 13201.1298828125- , 13297.830078125- , 13533.75 ]- , [ 0.0012827360769733787- , 0.0008040848188102245- , 0.017361238598823547- , 0.004835359752178192- , 0.004413491114974022- , 0.004110544919967651- , 0.0003338181704748422- , 0.0036140112206339836- , 0.006919348146766424- , 0.0003224937245249748- , 0.0006031467346474528- , 0.06686479598283768- , 0.000605064386036247- , 0.003602313343435526- , 0.0002835785271599889- , 0.015243238769471645- , 0.020536603406071663- , 0.016677580773830414- , 0.0009245267719961703- , 0.20205098390579224- , 0.0012542791664600372- , 0.012705927714705467- , 0.0002523190632928163- , 0.0004866079252678901- , 0.0006429700297303498- , 0.0007763264584355056- , 0.2081160992383957- , 0.0024918108247220516- , 0.00193469924852252- , 0.005231771152466536- , 0.0069242212921381- , 0.001203975174576044- , 0.2050020843744278- , 0.04060448706150055- , 0.0038344631902873516- , 0.002189427148550749- , 0.18056060373783112- , 0.002192433224990964- , 0.006516554858535528- , 0.009982921183109283- , 0.004745401442050934- , 0.046154771000146866- , 0.000510294979903847- , 0.0018905038014054298- , 0.0019782145973294973- , 0.006729386281222105- , 0.0023426134139299393- , 0.0024002245627343655- , 0.03515550494194031- , 0.0014084168942645192 ]- , [ 5.203680992126465- , 1.7034343481063843- , 40.16516876220703- , 27.282501220703125- , 0.8950523138046265- , 42.84742736816406- , 2.6603667736053467- , 15.7678861618042- , 6.848367214202881- , 3.2325007915496826- , 1.7343382835388184- , 2.0202419757843018- , 4.7279052734375- , 9.400103569030762- , 0.7102512717247009- , 37.494625091552734- , 36.24879455566406- , 29.172658920288086- , 3.891019344329834- , 4.757885456085205- , 3.851426124572754- , 20.90781021118164- , 3.732874870300293- , 2.3834102153778076- , 10.443285942077637- , 8.795611381530762- , 20.98564338684082- , 18.01180076599121- , 25.297883987426758- , 14.819819450378418- , 42.39189910888672- , 2.9485135078430176- , 11.043763160705566- , 49.55165100097656- , 29.882694244384766- , 10.527188301086426- , 23.5572452545166- , 26.55561637878418- , 45.099605560302734- , 22.550390243530273- , 36.46126174926758- , 11.826201438903809- , 16.818185806274414- , 14.903121948242188- , 32.81113815307617- , 43.1389045715332- , 12.289558410644531- , 11.498942375183105- , 10.465788841247559- , 24.93169593811035 ] ]-; var cf = crotale[0]-; var ca = crotale[1]-; var cd = crotale[2]-; var ps = [-12, -5, 0, 2, 4, 5, 7, 12]-; var n = PinkNoise.ar()-; var t = Dust.kr(3)-; var fs = Select.kr(TIRand.kr(0, 7, t), ps)-; var g = TRand.kr(0, 1, t)-; var fo = TRand.kr(0, 1, t)-; var ds = TRand.kr(2, 7, t)-; var p = TRand.kr(-1, 1, t)-; var s = Decay2.kr(t, 0.06, 0.01) * n * g-; var k = DynKlank.ar(`[cf, ca, cd.reciprocal], s, fs.midiratio, fo, ds)-; Out.ar(0, Pan2.ar(k, p, 1)) }.play
− Help/Graphs/cut-outs.lhs
@@ -1,26 +0,0 @@-cut-outs (rd)--> import Sound.SC3--> let { t = impulse ar 22 0 * (sinOsc kr 0.5 0 + 1)-> ; x = mouseX kr 0.005 0.12 Exponential 0.1-> ; y = mouseY kr 0.01 0.52 Exponential 0.1 -> ; n = do { n1 <- lfNoise0 kr 2-> ; n2 <- coinGate (0.05 + n1 + y * 0.4 + t * 0.5) (t * 0.5)-> ; n3 <- tExpRand (mce2 500 900) 1600 t-> ; return (ringz n2 n3 x) } }-> in do { s <- fmap sum (sequence (replicate 3 n))-> ; b <- tRand 0 1 =<< dust kr 8-> ; audition (mrg [out 0 b, out 0 (clip2 s (in' 1 kr 0) * 0.25)]) }--{ var t = Impulse.ar(22, 0) * (SinOsc.kr(0.5, 0) + 1)-; var x = MouseX.kr(0.005, 0.12, 'exponential', 0.1)-; var y = MouseY.kr(0.01, 0.52, 'exponential', 0.1)-; var n = { var n1 = LFNoise0.kr(2)- ; var n2 = CoinGate.ar(0.05 + n1 + (y * 0.4) + (t * 0.5), t * 0.5)- ; var n3 = TExpRand.ar([500, 900], 1600, t)- ; Ringz.ar(n2, n3, x) }-; var s = Mix.fill(3, n)-; var b = TRand.kr(0, 1, Dust.kr(8))-; Out.kr(0, b)-; Out.ar(0, s.clip2(In.kr(0, 1)) * 0.25) }.play
− Help/Graphs/cymbalism.lhs
@@ -1,29 +0,0 @@-cymbalism (jmcc)--> import Sound.SC3--> let p = 15-> in do { f1 <- rand 500 2500-> ; f2 <- rand 0 8000-> ; let y = do { f <- sequence (replicate p (rand f1 (f1 + f2)))-> ; rt <- sequence (replicate p (rand 1 5))-> ; return (klankSpec f (replicate p 1) rt) }-> in do { z <- clone 2 y-> ; n <- fmap (* 0.03) (whiteNoise ar)-> ; tf <- rand 0.5 3.5-> ; let { t = impulse ar tf 0-> ; s = decay t 0.004 * n-> ; k = klank s 1 0 1 (mceTranspose z) }-> in audition (out 0 k) } }--{ var p = 15-; var f1 = Rand.new(500, 2500)-; var f2 = Rand.new(0, 8000)-; var y = { var f = Array.fill(p, { f1 + Rand.new(0, f2) } )- ; var rt = Array.fill(p, { 1 + Rand.new(0, 4) })- ; `[f, nil, rt] }-; var z = Array.fill(2, y)-; var t = Impulse.ar(Rand.new(0, 3) + 0.5, 0)-; var n = WhiteNoise.ar() * 0.03-; var s = Decay.ar(t, 0.004) * n-; Out.ar(0, Klank.ar(z, s)) }.play
− Help/Graphs/deep-sea.lhs
@@ -1,39 +0,0 @@-deep sea (jrhb)--> import Sound.SC3-> import qualified Sound.SC3.UGen.Base as B--> main :: IO ()-> main =-> let { range s l r = let m = (r - l) * 0.5 in mulAdd s m (m + l)-> ; amp = 1-> ; pan = 0-> ; variation = 0.9-> ; n = B.rand (uid 0) 7 46-> ; dt1 = 25.0 + B.rand (uid 1) (-1.7) 1.7-> ; dt2 = (dt1 + B.lfNoise2 (uid 0) kr 2) * variation * 0.001-> ; freq = 901 + B.rand (uid 2) 0 65-> ; t = impulse ar (recip dt2) 0 * 100-> ; count = pulseCount t 0-> ; mul = count <* n-> ; u1 = bpf (mul * t) freq 1 * 0.1-> ; freq2 = freq * ((count `modE` range (B.lfNoise1 (uid 0) kr 1) 2 20) + 1)-> ; u2 = bpf u1 freq2 1 * 0.2 }-> in audition (mrg [ detectSilence u2 0.0001 0.2 RemoveSynth-> , out 0 (pan2 u2 pan (amp * 10)) ])--{ var amp = 1-; var pan = 0-; var variation = 0.9-; var n = Rand.new(7, 46)-; var dt1 = 25.0 + Rand.new(-1.7, 1.7)-; var dt2 = (dt1 + LFNoise2.kr(2)) * variation * 0.001-; var freq = 901 + Rand.new(0, 65)-; var t = Impulse.ar(dt2.reciprocal, 0, 100)-; var count = PulseCount.ar(t, 0)-; var mul = count < n-; var u1 = BPF.ar(mul * t, freq, 1) * 0.1-; var freq2 = freq * ((count % LFNoise1.kr(1).range(2, 20)) + 1)-; var u2 = BPF.ar(u1, freq2, 1) * 0.2-; DetectSilence.ar(u2, 0.0001, 0.2, 2)-; Out.ar(0, Pan2.ar(u2, pan, amp * 10)) }.play
− Help/Graphs/default.lhs
@@ -1,35 +0,0 @@-default (jmcc)--> import Sound.SC3-> import Sound.OpenSoundControl-> import System.Random--> let { def = do { r0 <- rand (-0.4) 0.0-> ; r1 <- rand 0.0 0.4-> ; r2 <- rand 4000 5000-> ; r3 <- rand 2500 3200-> ; let { f = Control KR "freq" 440-> ; a = Control KR "amp" 0.1-> ; p = Control KR "pan" 0-> ; g = Control KR "gate" 1-> ; e = linen g 0.01 (a * 0.7) 0.3 RemoveSynth-> ; f3 = mce [f, f + r0, f + r1]-> ; l = xLine KR r2 r3 1 DoNothing-> ; z = lpf (mix (varSaw AR f3 0 0.3)) l * e }-> in return (pan2 z p 1) }-> ; rrand lr = getStdRandom (randomR lr)-> ; tone fd nid = do { pan <- rrand (-1, 1)-> ; amp <- rrand (0.1, 0.3)-> ; indx <- rrand (0, 7)-> ; let note = [60, 62, 64, 65, 67, 69, 71, 72] !! indx-> in send fd (s_new "default" nid AddToTail 1-> [("freq", midiCPS note)-> ,("pan", pan)-> ,("amp", amp)])-> ; pauseThread 0.075-> ; send fd (n_set nid [("gate", 0)])-> ; pauseThread 0.075 } }-> in withSC3 (\fd -> do { u <- def-> ; async fd (d_recv (synthdef "default" (out 0 u)))-> ; reset fd-> ; mapM_ (tone fd) [1024..1036] })
− Help/Graphs/demanding-studies.lhs
@@ -1,25 +0,0 @@-demanding studies (jmcc)--> import Sound.SC3--> do { s1 <- drand dinf (mce [72, 75, 79, 82])-> ; s2 <- drand 1 (mce [82, 84, 86])-> ; s3 <- dseq dinf (mce [72, 75, 79, s2])-> ; let { x = mouseX kr 5 13 Linear 0.2-> ; tr = impulse kr x 0-> ; f = demand tr 0 (mce [midiCPS (s1 - 12), midiCPS s3])-> ; o1 = sinOsc ar (f + mce2 0 0.7) 0-> ; o2 = saw ar (f + mce2 0 0.7) * 0.3-> ; o3 = cubed (distort (log (distort (o1 + o2)))) }-> in audition (out 0 (o3 * 0.1)) }--{ var s1 = Drand.new([72, 75, 79, 82], inf)-; var s2 = Drand.new([82, 84, 86], 1)-; var s3 = Dseq.new([72, 75, 79, s2], inf)-; var x = MouseX.kr(5, 13, 'linear', 0.2)-; var tr = Impulse.kr(x, 0)-; var f = Demand.kr(tr, 0, [(s1 - 12).midicps, s3.midicps])-; var o1 = SinOsc.ar(f + [0, 0.7], 0)-; var o2 = Saw.ar(f + [0, 0.7]) * 0.3-; var o3 = (o1 + o2).distort.log.distort.cubed-; Out.ar(0, o3 * 0.1) }.play
− Help/Graphs/dial-history.lhs
@@ -1,52 +0,0 @@-dial history (jrhb)--> import Data.List-> import Sound.SC3--> let { mfv = [[697, 770, 852, 941], [1209, 1336, 1477, 1633]]-> ; numbers = [[3, 1]] ++ [[a, b] | a <- [0..2], b <- [0..2]]-> ; range s l r = linLin s 0 1 l r-> ; mce_r = mce . map mce -> ; mce_mrg = mrg . mceProxies }-> in do { n <- dwhite dinf 7 12-> ; w <- dwhite 1 2 7-> ; b <- dbrown n 0.1 0.2 0.01-> ; rate <- dseq dinf (mce2 w b)-> ; q <- dseq dinf (mce [1..10])-> ; g1 <- grayNoise ar-> ; g2 <- grayNoise ar-> ; d <- lfdNoise3 kr 0.5-> ; let { tr = trig (tDuty kr rate 0 DoNothing q 1) 0.09-> ; pat = latch tr tr-> ; x = mouseX kr 0 1 Linear 0.2-> ; h = hasher (pat * x)-> ; which = trunc (range h 0 (constant (length numbers))) 1-> ; both = select which (mce_r numbers)-> ; dial = select both (mce_r (transpose mfv))-> ; sig = sinOsc ar dial 0 * 0.05 * tr-> ; dsig = delayN sig 0.2 (range d 0 0.01)-> ; hiss = g1 * 0.01 + hpf (g2 * 0.02) 3000 }-> in audition (out 0 (dsig + hiss)) }--{ var mfv = [[697, 770, 852, 941], [1209, 1336, 1477, 1633]]-; var numbers = [[3, 1]] ++ {: [a, b], a <- (0..2), b <- (0..2) }.all-; var n = Dwhite.new(7, 12, inf)-; var w = Dwhite.new(2, 7, 1)-; var b = Dbrown.new(0.1, 0.2, 0.01, n)-; var rate = Dseq.new([w, b], inf)-; var q = Dseq.new((1..10), inf)-; var trig = Trig.kr(TDuty.kr(rate, 0, q), 0.09)-; var pat = Latch.kr(trig, trig)-; var x = MouseX.kr(0, 1, 'linear', 0.2)-; var h = Hasher.kr(pat * x)-; var which = h.range(0, numbers.size).trunc.(1)-; var both = Select.kr(which, numbers)-; var dial = Select.kr(both, mfv.flop)-; var sig = SinOsc.ar(dial, 0) * 0.05 * trig-; var d = LFDNoise3.kr(0.5)-; var dsig = DelayC.ar(sig, 0.2, d.range(0, 0.01))-; var g1 = GrayNoise.ar-; var g2 = GrayNoise.ar-; var z = Silent.ar(1)-; var hiss = g1 * 0.01 + HPF.ar(g2 * 0.02, 3000)-; Out.ar(0, [z, dsig + hiss]) }.play
− Help/Graphs/diffraction.lhs
@@ -1,43 +0,0 @@-diffraction (rd)--> import Control.Monad-> import Sound.SC3--> let { p = let { x = mouseX kr 0.001 0.02 Exponential 0.1-> ; y = mouseY kr 120 400 Exponential 0.1 }-> in do { f <- fmap (* mce2 32 64) (lfNoise0 kr 4)-> ; w <- fmap (* x) (lfNoise0 kr 32)-> ; z <- fmap (* 0.1) (lfNoise0 kr 2)-> ; m <- lfNoise0 kr 6-> ; let s = pulse ar f w-> in return (resonz s (y + z) (m * 0.4 + 0.8) * 0.5) }-> ; q = do { n <- lfNoise0 kr 128-> ; s <- p-> ; return (combN s 0.2 (n * 0.1 + 0.1) 3) }-> ; r = let { x = mouseX kr 0.75 1.25 Exponential 0.1-> ; y = mouseY kr 0.25 1 Exponential 0.1-> ; f _ = do { fr <- fmap (* x) (rand 50 59)-> ; am <- fmap (* y) (rand 0.04 0.16)-> ; return (sinOsc ar fr 0 * am) } }-> in liftM2 mce2 (mixFillM 16 f) (mixFillM 12 f) }-> in audition . (out 0) . sum =<< sequence [p, q, r]--{ var x = MouseX.kr(0.001, 0.02, 'exponential', 0.1)-; var y = MouseY.kr(120, 400, 'exponential', 0.1)-; var p = { var f = LFNoise0.kr(4) * [32, 64]- ; var w = LFNoise0.kr(32) * x- ; var z = LFNoise0.kr(2) * 0.1- ; var m = LFNoise0.kr(6)- ; var s = Pulse.ar(f, w)- ; Resonz.ar(s, y + z, (m * 0.4) + 0.8) * 0.5 }-; var q = { var n = LFNoise0.kr(128)- ; CombN.ar(p.value, 0.2, (n * 0.1) + 0.1, 3) }-; var r = { var x1 = MouseX.kr(0.75, 1.25, 'exponential', 0.1)- ; var y1 = MouseY.kr(0.25, 1, 'exponential', 0.1)- ; var f = { var fr = Rand(50, 59) * x1- ; var am = Rand(0.04, 0.16) * y1- ; SinOsc.ar(fr, 0) * am }- ; [Mix.fill(16, f), Mix.fill(12, f)] }-; Out.ar(0, p.value + q.value + r.value) }.play--
− Help/Graphs/discretion.lhs
@@ -1,14 +0,0 @@-discretion (rd)--> import Sound.SC3--> let { mkls bp t = envGen kr 1 1 0 1 RemoveSynth (envCoord bp t 1 EnvLin)-> ; part = do { f1 <- clone 2 (rand 50 55)-> ; f2 <- clone 2 (rand 50 65)-> ; f3 <- clone 2 (rand 50 55)-> ; a <- clone 2 (rand 0.01 0.035)-> ; let { t = 21-> ; f_ = mkls [(0, f1), (0.33, f2), (1, f3)] t-> ; a_ = mkls [(0, 0), (0.33, a), (1, 0)] t }-> in return (saw ar f_ * a_) } }-> in audition . out 0 . mix =<< clone 8 part
− Help/Graphs/drummer.lhs
@@ -1,24 +0,0 @@-drummer (thor magnusson)--> import Sound.SC3--> do { n <- whiteNoise ar-> ; let { tempo = 4-> ; dup a = mce2 a a -> ; tr = impulse ar tempo 0-> ; tr_2 = pulseDivider tr 4 2-> ; tr_4 = pulseDivider tr 4 0-> ; snare = n * decay2 tr_2 0.005 0.5-> ; bass = sinOsc ar 60 0 * decay2 tr_4 0.005 0.5-> ; hihat = hpf n 10000 * decay2 tr 0.005 0.5 }-> in audition (out 0 (pan2 (snare + bass + hihat) 0 0.4)) }--{ var tempo = 4-; var n = WhiteNoise.ar()-; var tr = Impulse.ar(tempo, 0)-; var tr_2 = PulseDivider.ar(tr, 4, 2)-; var tr_4 = PulseDivider.ar(tr, 4, 0)-; var snare = n * Decay2.ar(tr_2, 0.005, 0.5)-; var bass = SinOsc.ar(60, 0) * Decay2.ar(tr_4, 0.005, 0.5)-; var hihat = HPF.ar(n, 10000) * Decay2.ar(tr, 0.005, 0.5)-; Out.ar(0, Pan2.ar(snare + bass + hihat, 0, 0.4)) }.play
− Help/Graphs/e-lamell.lhs
@@ -1,54 +0,0 @@-e-lamell (rd)--> import Control.Monad-> import Sound.OpenSoundControl-> import Sound.SC3-> import System.Random--> let { now = NTPi 1-> ; rrand l r = getStdRandom (randomR (l, r))-> ; i_rrand l r = return . floorE =<< rrand l r-> ; exp_rrand a b = do { n <- rrand 0 1-> ; let r = b / a -> in return ((r ** n) * a) }-> ; choose l = return . (l !!) =<< rrand 0 (length l - 1)-> ; sendSynth fd n u = async fd (d_recv (synthdef n u))-> ; e_lamell = let { ctl s v = Control kr s v-> ; f = ctl "f" 440-> ; n = ctl "n" 12-> ; d = ctl "d" 0.1-> ; l = ctl "l" 0-> ; a = ctl "a" 1 }-> in do { t <- tChoose 1 (mce2 1 32)-> ; let { h = line ar n t d DoNothing-> ; s = blip ar f h-> ; e_d = envPerc 0.005 d-> ; e = envGen ar 1 a 0 1 RemoveSynth e_d }-> in return (out 0 (pan2 s l e)) }-> ; r_note o p = do { oe <- choose o-> ; pe <- choose p-> ; return (oe * 12 + pe) }-> ; l_sel = r_note [2, 3] [0]-> ; h_sel = r_note [2, 3, 4] [0]-> ; mk_s_new f n d a l = s_new "blip" (-1) AddToTail 1-> [("f", f)-> ,("n", n)-> ,("d", d)-> ,("a", a)-> ,("l", l)]-> ; pattern fd = do { p <- do { f <- liftM midiCPS l_sel-> ; n <- rrand 2 36-> ; d <- exp_rrand 0.01 0.4-> ; a <- rrand 0 0.75-> ; l <- rrand (-1) 1-> ; return (mk_s_new f n d a l) }-> ; q <- do { f <- liftM midiCPS h_sel-> ; n <- rrand 2 36-> ; d <- exp_rrand 0.01 0.4-> ; a <- choose [0, 0.25, 0.5, 1]-> ; l <- rrand (-1) 1-> ; return (mk_s_new f n d a l) }-> ; send fd (Bundle now [p, q]) -> ; pauseThread 0.1 } }-> in withSC3 (\fd -> do { sendSynth fd "blip" =<< e_lamell-> ; replicateM_ 64 (pattern fd) })
− Help/Graphs/eggcrate.lhs
@@ -1,26 +0,0 @@-eggcrate (rd)--> import Sound.SC3--> let { cosu = cos . (* pi) -> ; sinu = sin . (* pi)-> ; eggcrate u v = cosu u * sinu v-> ; p = mce [64, 72, 96, 128, 256, 6400, 7200, 8400, 9600] }-> in do { [x, y] <- sequence (replicate 2 (brownNoise kr))-> ; t <- dust kr 2.4-> ; [f0, f1] <- sequence (replicate 2 (tChoose t p))-> ; let { f = linLin (eggcrate x y) (-1) 1 f0 f1-> ; a = linLin x (-1) 1 0 0.1 }-> in audition (out 0 (pan2 (mix (sinOsc ar f 0)) y a)) }--{ var eggcrate = { arg u, v- ; (u * pi).cos * (v * pi).sin }-; var p = [64, 72, 96, 128, 256, 6400, 7200, 8400, 9600]-; var x = BrownNoise.kr()-; var y = BrownNoise.kr()-; var t = Dust.kr(2.4)-; var f0 = TChoose.kr(t, p)-; var f1 = TChoose.kr(t, p)-; var f = LinLin.kr(eggcrate.value(x, y), -1, 1, f0, f1)-; var a = LinLin.kr(x, -1, 1, 0, 0.1)-; Out.ar(0, Pan2.ar(Mix.ar(SinOsc.ar(f, 0)), y, a)) }.play
− Help/Graphs/f-lets.lhs
@@ -1,25 +0,0 @@-f-lets (rd)--> import Sound.SC3--> let { f_let t g j n f = -> let pd = pulseDivider t j 0-> in do { r0 <- tiRand (mce2 2 1) n pd-> ; r1 <- tRand 0.01 0.04 pd-> ; r2 <- tRand 0.05 0.10 pd-> ; return (formlet pd (f * r0) r1 r2 * g) }-> ; mk_n t = do { r0 <- tRand 0 1 t-> ; r1 <- tRand 0 1 t-> ; r2 <- tRand 0 1 t-> ; r3 <- tRand 0 1 t-> ; r4 <- coinGate 0.2 t-> ; sequence-> [ f_let t 0.15 2 9 (mce2 200 400)-> , f_let t 0.25 2 9 (mce2 (200 + r0) (400 + r1))-> , f_let t 0.05 4 5 (mce2 25 50)-> , f_let t 0.15 4 5 (mce2 (25 + r2) (50 + r3))-> , let lr = fmap (* (latch r4 t))-> in lr (f_let t 0.5 1 16 (mce2 300 600)) ] }-> ; tr = impulse ar 24 0 }-> in do { n <- lfNoise0 kr 2-> ; audition . out 0 . (* (n * 0.25 + 0.25)) . sum =<< mk_n tr }
− Help/Graphs/fbl-fbf.lhs
@@ -1,26 +0,0 @@-fbl-fbf (rd)--> import Sound.SC3--> let { fbl l i d g = let { a0 = l + mce i-> ; a1 = delayL a0 (maximum d) (mce d) }-> in (localOut (a1 * mce g), a1)-> ; fbf b i d g = let { a0 = inFeedback 1 (mce b) + mce i-> ; a1 = delayL a0 (maximum d) (mce d) }-> in (offsetOut (mce b) (mce [a1 * mce g]), a1) }-> in do { withSC3 reset-> ; n <- brownNoise ar-> ; let { e = decay (impulse ar 0.3 0) 0.1 * n * 0.2-> ; c = 4-> ; e' = replicate c e-> ; b0 = [24, 26, 28, 30]-> ; d0 = [0.1, 0.3, 0.5, 0.7]-> ; g0 = [0.8, 0.6, 0.4, 0.2]-> ; b1 = [25, 27, 29, 31]-> ; d1 = [0.2, 0.3, 0.6, 0.7]-> ; g1 = [0.8, 0.7, 0.4, 0.3]-> ; (u0, s0) = fbl (localIn c ar) e' d0 g0-> ; (u1, s1) = fbf b0 e' d0 g0-> ; (u2, s2) = fbf b1 (mceChannels s1) d1 g1-> ; o = mce [mix (s0 + s1), mix s2] }-> in audition (mrg [u0, u1, u2, offsetOut 0 o]) }
− Help/Graphs/feedr.lhs
@@ -1,22 +0,0 @@-feedr (rd)-warning: input/output feedback loop--> import Sound.SC3--> let { delayWr b i = recordBuf b 0 1 0 1 Loop 0 i-> ; tap nc b dt = playBuf nc b 1 0 (dt * (- sampleRate)) Loop DoNothing-> ; dl = 6-> ; feedr n = do { t <- sequence (replicate n (rand 0.0 (constant dl)))-> ; g <- sequence (replicate n (rand 0.4 1.0))-> ; f <- sequence (replicate n (rand 0.9 0.95))-> ; let { d = zipWith (\p q -> tap 2 10 p * q) t g-> ; x = mouseX kr 0.02 1.0 Exponential 0.1-> ; s = clip2 (leakDC (hpf (sum d) 20) 0.995) 1-> ; i = soundIn (mce2 0 1)-> ; r = i + sum (map (* x) (zipWith (*) d f)) }-> in return (mrg [out 0 s, delayWr 10 r]) } }-> in withSC3 (\fd -> do { nf <- fmap (* dl) (serverSampleRateActual fd)-> ; send fd (b_alloc 10 (floor nf) 2)-> ; audition =<< feedr 18 })--> withSC3 (\fd -> send fd (b_zero 10))
− Help/Graphs/fm-iter.lhs
@@ -1,16 +0,0 @@-fm-iter (rd)--> import Sound.SC3--> let { t0 = impulse ar (recip 0.30) 0-> ; t1 = tDelay t0 0.15-> ; t = mce2 t0 t1 }-> in do { k <- tRand 56 57 t-> ; i <- tRand 40 480 t-> ; j <- tRand (-1) 1 t-> ; let { c = midiCPS k-> ; m = midiCPS (k + 1 + j)-> ; s = envPerc 0.01 0.9-> ; e = envGen ar t 0.1 0 1 RemoveSynth s-> ; f = sinOsc ar c 0 * i + m }-> in audition (out 0 (sinOsc ar f 0 * e)) }
− Help/Graphs/fm-kltr.lhs
@@ -1,48 +0,0 @@-fm-kltr (rd)--> import Sound.OpenSoundControl-> import Sound.SC3-> import System.Random--> let { rrand l r = getStdRandom (randomR (l, r))-> ; gr =-> do { r1 <- rand 0.975 1.025-> ; r2 <- rand 0.5 1.5-> ; r3 <- rand 0.975 1.025-> ; r4 <- rand 0.75 1.25-> ; let { o = Control kr "out" 0-> ; t = Control kr "trig" 0-> ; a = Control kr "amp" 0.1-> ; d = Control kr "dur" 0.1-> ; f = Control kr "freq" 400.0-> ; i = Control kr "index" 40.0-> ; p = Control kr "pan" 0.0-> ; f2 = Control kr "freq2" 600-> ; ep = envPerc 0.01 d-> ; e = envGen ar 1 a 0 1 RemoveSynth ep-> ; so = sinOsc ar (xLine kr f (f * r1) d DoNothing) 0-> ; xl = xLine kr f2 (f2 * r3) d DoNothing-> ; m = so * line kr i (f * r2) d DoNothing + xl-> ; l = line kr p (p * r4) d DoNothing }-> in return (out o (pan2 (sinOsc ar m 0) l e)) }-> ; fm fd f ff a d i =-> do { r1 <- rrand (-1) 1-> ; r2 <- rrand (-1) 1-> ; send fd (s_new "fm" (-1) AddToTail 1-> [("freq", midiCPS f)-> ,("freq2", midiCPS ff + r1)-> ,("amp", a)-> ,("dur", d)-> ,("index", i)-> ,("pan", r2)]) }-> ; nd fd =-> do { ff <- rrand 48 96-> ; a <- rrand 0.1 0.4-> ; d <- rrand 1.2 7.2-> ; i <- rrand 240 1480-> ; t <- rrand 0.15 1.25-> ; fm fd 53 ff a d i-> ; pauseThread t } }-> in withSC3 (\fd -> do { u <- gr-> ; async fd (d_recv (synthdef "fm" u))-> ; sequence (replicate 32 (nd fd)) })
− Help/Graphs/forest-sounds.lhs
@@ -1,17 +0,0 @@-forest sounds (paul jones)--> import Sound.SC3--> let insects = do { n1 <- brownNoise ar-> ; n2 <- lfNoise2 kr 50-> ; let o = sinOsc kr (n2 * 50 + 50) 0 * 100 + 2000-> in return (bpf n1 o 0.001 * 10) }-> in audition . (out 0) =<< clone 2 insects--{ var insects = { var n1 = BrownNoise.ar- ; var n2 = LFNoise2.kr(50)- ; var o = SinOsc.kr(n2 * 50 + 50, 0) * 100 + 2000- ; BPF.ar(n1, o, 0.001) * 10 }-; Out.ar(0, Array.fill(2, insects)) }.play--sc-users, 2007-04-06
− Help/Graphs/fwalk.lhs
@@ -1,27 +0,0 @@-fwalk (rd)--> import Sound.SC3--> let { n = [ 40.0, 47.0, 42.0, 40.0, 50.0-> , 43.0, 35.0, 43.0, 40.0, 47.0-> , 45.0, 35.0, 43.0, 42.0, 59.0-> , 48.0, 40.0, 47.0, 52.0, 45.0 ]-> ; m = [ 40.0, 40.0, 42.0, 47.0, 50.0-> , 35.0, 43.0, 43.0, 40.0, 45.0-> , 42.0, 35.0, 48.0, 47.0, 43.0-> , 40.0, 59.0, 45.0, 47.0, 52.0 ] -> ; a = map (\b -> b_alloc b 20 1) [0, 1]-> ; s = map (\(b, d) -> b_setn1 b 0 d) [(0, n), (1, m)]-> ; fwalk r = do { t <- dust kr 3-> ; r1 <- tiRand 0 6 t-> ; r2 <- tRand (-0.0001) 0.0001 t-> ; let { f = bufRdL 1 kr (mce2 0 1) r1 NoLoop-> ; f' = f + r2-> ; o1 = blip ar (midiCPS (r + f)) 12-> ; o2 = blip ar (midiCPS (r + f')) 12 }-> in return ((o1 + o2) * decay2 t 0.3 1.2 * 0.1) } }-> in withSC3 (\fd -> do { f1 <- fwalk 24-> ; f2 <- fwalk 36-> ; mapM_ (async fd) a-> ; mapM_ (send fd) s-> ; play fd (out 0 (f1 + f2)) })
− Help/Graphs/h-chatter.lhs
@@ -1,44 +0,0 @@-h-chatter (rd)--> import Control.Monad-> import Sound.SC3--> let { wrp i l r = linLin i (-1) 1 l r-> ; mma m a = return . (+ a) . (* m)-> ; h0 = do { n <- mma 5 5 =<< lfNoise0 kr 1-> ; a <- mma 0.2 1.2 =<< lfNoise2 kr n-> ; b <- mma 0.15 0.15 =<< lfNoise2 kr n-> ; let { f = 40-> ; h = henonN ar (mce2 f (f * 0.5)) a b 0 0 }-> in return (saw ar (h * 3200 + 1600) * 0.35) }-> ; h1 = do { n0 <- lfNoise0 kr 32-> ; n1 <- lfNoise0 kr 2-> ; let { a = mouseX kr 1.2 1.4 Linear 0.1-> ; b = mouseY kr 0.2 0.3 Linear 0.1-> ; h = wrp n0 1 32-> ; p = wrp n1 2400 3200-> ; l = wrp n1 (-0.75) 0.75-> ; g = wrp n1 0.55 0.85-> ; f = 40-> ; o = blip ar (wrp (henonN ar f a b 0 0) p (p * 2)) h }-> in return (pan2 o l g * 0.35) } }-> in audition . out 0 =<< liftM2 (+) h0 h1--{ var h0 = { var n = LFNoise0.kr(1, 5, 5)- ; var a = LFNoise0.kr(1, 0.2, 1.2)- ; var b = LFNoise0.kr(1, 0.15, 0.15)- ; var f = 40- ; var h = HenonN.ar([f, f * 0.5], a, b, 0, 0)- ; Saw.ar(h * 3200 + 1600) * 0.35 }-; var h1 = { var n0 = LFNoise0.kr(32)- ; var n1 = LFNoise0.kr(2)- ; var a = MouseX.kr(1.2, 1.4, 'linear', 0.1)- ; var b = MouseY.kr(0.2, 0.3, 'linear', 0.1)- ; var h = n0.range(1, 32)- ; var p = n1.range(2400, 3200)- ; var l = n1.range(-0.75, 0.75)- ; var g = n1.range(0.55, 0.85)- ; var f = 40- ; var o = Blip.ar(HenonN.ar(f, a, b, 0, 0).range(p, p * 2), h)- ; Pan2.ar(o, l, g) * 0.35 }-; Out.ar(0, h0.value + h1.value) }.play
− Help/Graphs/half-life.lhs
@@ -1,17 +0,0 @@-half-life (jrhb)--> import Sound.SC3--> let { t_half = 3.92-> ; n_atoms = 1e+5-> ; n = max 0 (n_atoms - pulseCount (localIn 2 ar) 0) }-> in do { activity <- dust ar (n * log 2 / t_half)-> ; audition (mrg [ localOut activity-> , out 0 activity ]) }--{ var t_half = 3.92-; var n_atoms = 1e+5-; var n = max(0, n_atoms - PulseCount.ar(LocalIn.ar(2), 0))-; var activity = Dust.ar(n * 2.log / t_half)-; LocalOut.ar(activity)-; Out.ar(0, activity) }.play
− Help/Graphs/harmonic-swimming.lhs
@@ -1,24 +0,0 @@-harmonic swimming (jmcc)--> import Sound.SC3--> let { a = 0.02-> ; f = 50-> ; p = 20-> ; l = line kr 0 (- a) 60 DoNothing -> ; o h = do { r <- clone 2 (rand 2 8)-> ; n <- lfNoise1 kr r-> ; let e = max 0 (n * a + l)-> in return (fSinOsc ar (f * (h + 1)) 0 * e) } }-> in audition . out 0 . sum =<< mapM o [0..p]--{ var a = 0.02-; var f = 50-; var p = 20-; var l = Line.kr(0, a.neg, 60, 0)-; var o = { arg h- ; var r = 6 + [Rand.new(-4, 4), Rand.new(-4, 4)]- ; var n = LFNoise1.kr(r)- ; var e = max(0, n * a + l)- ; FSinOsc.ar(f * (h + 1), 0) * e }-; Out.ar(0, (0..p).collect(o).sum) }.play
− Help/Graphs/harmonic-tumbling.lhs
@@ -1,22 +0,0 @@-harmonic tumbling (jmcc)--> import Sound.SC3--> let { f = 80-> ; p = 10-> ; t = xLine kr (mce2 10 11) 0.1 60 DoNothing-> ; o h = do { n <- dust kr t-> ; r <- rand 0 0.5-> ; let e = decay2 (n * 0.02) 0.005 r-> in return (fSinOsc ar (f * (h + 1)) 0 * e) } }-> in audition . out 0 . sum =<< mapM o [0..p]--{ var f = 80-; var p = 10-; var t = XLine.kr([10, 11], 0.1, 60, doneAction: 0)-; var o = { arg h- ; var n = Dust.kr(t)- ; var r = Rand.new(0, 0.5)- ; var e = Decay2.kr(n * 0.02, 0.005, r)- ; FSinOsc.ar(f * (h + 1), 0) * e }-; Out.ar(0, (0..p).collect(o).sum) }.play
− Help/Graphs/hh-808.lhs
@@ -1,24 +0,0 @@-hh-808 (ryan at wabdo.com)--> import Sound.SC3--> let { time = 250-> ; freqs = [205.35, 304.41, 369.64, 522.71, 540.54, 812.21]-> ; pulseEnv = let e = env [1.0, 0.6] [time] [EnvNum (-0.5)] 0 0-> in envGen ar 1 1 0 (1/1000) DoNothing e-> ; s = mix (lfPulse ar (mce (map (* 4.09) freqs)) 0 0.5)-> ; f = [ \a -> ((a ==* 6.0) * 0.6) + ((a ==* 2.0) * 0.2) + ((a ==* 1.0) * 0.9)-> , \a -> (a * pulseEnv) + ((mix (lfPulse ar (mce freqs) 0 0.55)) * 0.9)-> , \a -> rlpf a 7000 0.6-> , \a -> rhpf a 6800 1.5-> , \a -> rhpf a 6800 1.5-> , \a -> rhpf a 1200 1.5-> , \a -> a + freeVerb a 0.33 0.5 0.5-> , \a -> let { c = map EnvNum [0, -0.5, 0, -50]-> ; e = env [0, 1, 0.4, 0, 0] [2, time, 50, 500] c 0 0 }-> in a * envGen ar 1 1 0 (1/1000) RemoveSynth e-> , \a -> mce [a, delayN a 0.005 0.005] ]-> ; (>>>) = flip (.) }-> in audition (out 0 (foldl1 (>>>) f s * 2))--http://www.create.ucsb.edu/pipermail/sc-users/2007-August/036131.html
− Help/Graphs/implosion.lhs
@@ -1,21 +0,0 @@-implosion (rd)--> import Sound.SC3--> let { mkls bp t = let e = envCoord bp t 1 EnvLin-> in envGen kr 1 1 0 1 RemoveSynth e-> ; mkrmp l r t = mkls [(0, l), (1, r)] t-> ; wrp i l r = linLin i (-1) 1 l r-> ; pmr_n rt l0 l1 r0 r1 d = let { le = mkrmp l0 r0 d-> ; re = mkrmp l1 r1 d }-> in do { n <- whiteNoise rt-> ; return (wrp n le re) } }-> in do { n0 <- rand (-1) 0-> ; n1 <- rand 0 1-> ; d <- rand 7.5 13.5-> ; f0 <- rand 10990 16220-> ; f1 <- rand 9440 19550-> ; f <- pmr_n ar 440 f0 f1 f1 d-> ; l <- pmr_n kr n0 n1 0 0 d-> ; a <- pmr_n kr 0.1 0.6 0 0 d-> ; audition (out 0 (pan2 (saw ar f) l a)) }
− Help/Graphs/insects.lhs
@@ -1,14 +0,0 @@-insects (sam pluta)--> import Sound.SC3--> let insect = do { r1 <- rand 2000 3000-> ; r2 <- rand 0.05 0.1-> ; n1 <- lfNoise2 KR (r2 * 50 + 50)-> ; r4 <- rand 1 10-> ; r5 <- rand 0.05 0.1-> ; n2 <- lfNoise2 KR r5-> ; let { a = sinOsc KR r4 0 * 0.5 + 0.5-> ; o = sinOsc AR (r1 + n1) r2 * 0.005 * a }-> in return (pan2 o n2 1) }-> in audition . (out 0) . sum =<< sequence (replicate 60 insect)
− Help/Graphs/k-ppr.lhs
@@ -1,35 +0,0 @@-k-ppr (rd)--> import Control.Monad-> import Sound.SC3--> let { wrp i l r = linLin i (-1) 1 l r-> ; x = mouseX kr 0.05 0.35 Linear 0.1-> ; y = mouseY kr 0.15 0.75 Linear 0.1-> ; ti = lfTri kr x 0-> ; tf = wrp ti 100 200-> ; t = impulse ar tf 0-> ; stream lf rf ld rd g = -> do { r1 <- rand 9 18-> ; let t' = pulseDivider t r1 0-> in do { r2 <- tRand lf (wrp ti lf rf) t'-> ; r3 <- tRand ld rd t'-> ; return (ringz (decay2 t' 0.01 0.5) r2 (r3 * y) * g) } } -> ; s1 = stream 3140 6240 0.050 0.005 0.15 -> ; s2 = stream 0400 9000 0.005 0.005 0.15 }-> in audition . out 0 =<< liftM2 (+) (clone 2 s1) (clone 2 s2)--{ var x = MouseX.kr(0.05, 0.35, 'linear', 0.1)-; var y = MouseY.kr(0.15, 0.75, 'linear', 0.1)-; var ti = LFTri.kr(x, 0)-; var tf = ti.range(100, 200)-; var t = Impulse.ar(tf, 0)-; var stream = { arg lf, rf, ld, rd, g- ; { var r1 = Rand.new(9, 18)- ; var t_ = PulseDivider.ar(t, r1, 0)- ; var r2 = TRand.ar(lf, ti.range(lf, rf), t_)- ; var r3 = TRand.ar(ld, rd, t_)- ; Ringz.ar(Decay2.ar(t_, 0.01, 0.5), r2, r3 * y) * g } }-; var s1 = stream.value(3140, 6240, 0.050, 0.005, 0.15)-; var s2 = stream.value(0400, 9000, 0.005, 0.005, 0.15)-; Out.ar(0, Array.fill(2, s1) + Array.fill(2, s2)) }.play
− Help/Graphs/karplus-strong.lhs
@@ -1,39 +0,0 @@-karplus strong (alex mclean)--> import Sound.SC3--> let { aA = ( "aA" -> , [800, 1150, 2800, 3500, 4950]-> , [0, -4 , -20, -36 , -60]-> , [80, 90, 120, 130, 140] )-> ; aU = ( "aU" -> , [325, 700, 2530, 3500, 4950]-> , [0, -12 , -30, -40, -64]-> , [50, 60, 170, 180, 200] )-> ; cs (_, c1, c2, c3) = c1 ++ c2 ++ c3-> ; vf i s = let { f = in' 5 kr i-> ; a = in' 5 kr (i + 5)-> ; b = in' 5 kr (i + 10) }-> in mix (resonz s f (b / f) * dbAmp a)-> ; ks n d = let { x = mouseX kr 0 0.01 Linear 0.1 {- delay -}-> ; y = mouseY kr 0.85 1 Linear 0.1 {- blend / gain -}-> ; ugenIf a b c = (a * b) + ((1 - a) * c)-> ; n0 = (n / 2) + 0.5-> ; probSwitch i prob = ugenIf (n0 >* prob) i (negate i)-> ; laggedDelay = lag x 0.01-> ; o = sinOsc ar 200 0-> ; a0 = decay d 0.025 * o-> ; a1 = localIn 1 ar + (a0 * (y - 0.25))-> ; a2 = delayN a1 0.01 laggedDelay-> ; a3 = delay1 a2-> ; a4 = (a2 + a3) / 2.0-> ; a5 = probSwitch a4 y-> ; a6 = vf (toggleFF d * 15) a5-> ; a7 = a6 * 1.5 }-> in mrg [localOut (a5 * 0.99), out 0 (mce [a7, a7])] }-> in withSC3 (\fd -> do { send fd (c_setn [(0,cs aA), (15, cs aU)])-> ; n <- whiteNoise ar-> ; d <- dust kr 4-> ; play fd (ks n d) })--Variant on http://doc.gold.ac.uk/~ma503am/alex/vocable-source-released/
− Help/Graphs/klink.lhs
@@ -1,27 +0,0 @@-klink (rd)--> import Sound.SC3--> do { n1 <- lfNoise0 kr (mce2 0.5 1.5)-> ; let { o = sinOsc kr n1 0-> ; f = mce2 2 3-> ; a = abs (slope o) * f-> ; t = impulse ar a 0-> ; i = decay2 t 0.01 0.1-> ; x = mouseX kr 960 3620 Exponential 0.2-> ; y = mouseY kr 0.5 2.0 Linear 0.2 }-> in do { n2 <- tRand x 3940 t-> ; n3 <- tRand 0.005 0.275 t-> ; audition (out 0 (ringz i n2 (n3 * y))) } }--{ var n1 = LFNoise0.kr([0.5, 1.5])-; var o = SinOsc.kr(n1, 0)-; var f = [2, 3]-; var a = Slope.kr(o).abs * f-; var t = Impulse.ar(a, 0)-; var i = Decay2.ar(t, 0.01, 0.1)-; var x = MouseX.kr(960, 3620, 'exponential', 0.2)-; var y = MouseY.kr(0.5, 2.0, 'linear', 0.2)-; var n2 = TRand.ar(x, 3940, t)-; var n3 = TRand.ar(0.005, 0.275, t)-; Out.ar(0, Ringz.ar(i, n2, n3 * y)) }.play
− Help/Graphs/lf-pulses.lhs
@@ -1,17 +0,0 @@-lf pulses (rd)--> import Sound.SC3--> do { n0 <- lfNoise0 ar (mce2 20 40)-> ; n1 <- lfNoise0 ar (mce2 5 10)-> ; let { x = mouseX kr 0.012 0.19 Exponential 0.1-> ; f = formlet (blip ar 10 12) (n0 * 43 + 700) 0.005 x -> ; o = sinOsc ar 40 0 * n1 }-> in audition (out 0 (clip2 (leakDC (f + o) 0.995) 0.75)) }--{ var n0 = LFNoise0.ar([20, 40])-; var n1 = LFNoise0.ar([5, 10])-; var x = MouseX.kr(0.012, 0.19, 'exponential', 0.1)-; var f = Formlet.ar(Blip.ar(10, 12), n0 * 43 + 700, 0.005, x)-; var o = SinOsc.ar(40, 0) * n1-; Out.ar(0, LeakDC.ar(f + o, 0.995).clip2(0.75)) }.play
− Help/Graphs/lfo-modulation.lhs
@@ -1,13 +0,0 @@-lfo modulation (jmcc)--> import Sound.SC3--> let { o = fSinOsc kr 0.05 0 * 80 + 160-> ; p = fSinOsc kr (mce2 0.6 0.7) 0 * 3600 + 4000-> ; s = rlpf (lfPulse ar o 0 0.4 * 0.05) p 0.2 }-> in audition (out 0 (combL s 0.3 (mce2 0.2 0.25) 2))--{ var o = FSinOsc.kr(0.05, 0, 80, 160)-; var p = FSinOsc.kr([0.6, 0.7], 0, 3600, 4000)-; var s = RLPF.ar(LFPulse.ar(o, 0, 0.4, 0.05), p, 0.2)-; Out.ar(0, CombL.ar(s, 0.3, [0.2, 0.25], 2)) }.play
− Help/Graphs/lg-timed.lhs
@@ -1,38 +0,0 @@-lg-timed (rd)--> import Sound.SC3--> let { timed r y p =-> do { d0 <- dser r p-> ; d1 <- dcons 0 d0-> ; d2 <- dser r y-> ; let t = tDuty ar d1 0 RemoveSynth d2 1-> in return (latch t t) }-> ; lg u = return (lag u 0.03)-> ; n = mce [52, 76, 66, 67, 68, 69]-> ; a = mce [0.35, 0.15, 0.04, 0.05, 0.16, 0.07]-> ; d = mce [0.1, 0.5, 0.09, 0.08, 0.07, 0.3]-> ; x = mouseX kr 0.5 1.25 Linear 0.2 }-> in do { tn <- lg =<< timed dinf n (d * x)-> ; ta <- lg =<< timed dinf a (d * x)-> ; audition (out 0 (sinOsc ar (midiCPS tn) 0 * ta)) }--{ var dcons = { arg x, xs- ; var i = Dseq.new([0, 1], 1)- ; var a = Dseq.new([x, xs], 1)- ; Dswitch.new(a, i) }-; var timed = { arg r, y, p- ; var d0 = Dser.new(p, r)- ; var d1 = dcons.value(0, d0)- ; var d2 = Dser.new(y, r)- ; var t = TDuty.ar(d1, 0, d2, 2, 1)- ; Latch.ar(t, t) }-; var lg = { arg u- ; Lag.ar(u, 0.03) }-; var n = [52, 76, 66, 67, 68, 69]-; var a = [0.35, 0.15, 0.04, 0.05, 0.16, 0.07]-; var d = [0.1, 0.5, 0.09, 0.08, 0.07, 0.3]-; var x = MouseX.kr(0.5, 1.25, 'linear', 0.2)-; var tn = lg.value(timed.value(inf, n, d * x))-; var ta = lg.value(timed.value(inf, a, d * x))-; Out.ar(0, SinOsc.ar(tn.midicps, 0) * ta) }.play
− Help/Graphs/lin-sosc.lhs
@@ -1,58 +0,0 @@-lin-sosc (rd)--> import Control.Concurrent-> import Control.Monad-> import Sound.OpenSoundControl-> import Sound.SC3-> import System.Random--> let { n = 1024-> ; x = mouseX kr 0.001 1.0 Linear 0.1-> ; tblM b = playBuf 1 b (x * bufRateScale kr b) 0 0 Loop DoNothing-> ; tblC b c = playBuf 1 b (in' 1 kr c * bufRateScale kr b) 0 0 Loop DoNothing-> ; o = sinOsc ar (tblM 0) 0 * tblM 1 -> ; co = clip2 (pan2 o (tblC 1 0) 0.025) 0.25-> ; rrand (a, b) = getStdRandom (randomR (a,b))-> ; choose l = fmap (l !!) (rrand (0, length l - 1))-> ; iota 0 _ _ = []-> ; iota n l s = l : iota (n - 1) (l + s) s-> ; geom 0 _ _ = []-> ; geom n i f = i : geom (n - 1) (i * f) f-> ; lineTo n l r = iota n l ((r - l) / n)-> ; xlineTo n l r = geom n l ((r / l) ** (1.0 / n))-> ; twoPi = pi * 2.0-> ; rng l r e = l + (e * (l - r))-> ; srng l r e = let m = (l - r ) / 2-> in m + l + (e * m) -> ; freq = [ lineTo n 440.0 444.0-> , lineTo n 40.0 16000.0-> , xlineTo n 40.0 16000.0-> , map (srng 20 21000 . sin) (lineTo n 0.0 twoPi)-> , map (srng 20 12000 . cos) (lineTo n 0.0 twoPi)-> , map (srng 20 22000 . tan) (lineTo n 0.0 twoPi)-> , map (srng 20 90 . tan) (lineTo n 0.0 twoPi) ]-> ; ampl = [ lineTo n 0.1 1.0-> , lineTo n 1.0 0.1-> , lineTo n 0.5 0.01-> , lineTo n 0.01 0.5-> , xlineTo n 1.0 0.1-> , xlineTo n 0.1 1.0-> , map sin (lineTo n 0.0 twoPi)-> , map cos (lineTo n 0.0 twoPi)-> , map (* 0.001) (map tan (lineTo n 0 twoPi)) ]-> ; sloc = [ 0.005, 0.0075, 0.01, 0.025, 0.05, 0.075-> , 0.1, 0.25, 0.5, 0.75-> , 0.8, 0.85, 1.0, 1.005 ]-> ; paus = [0.01, 0.05, 0.1, 0.15, 0.25, 0.5, 0.75]-> ; update fd = do { f <- choose freq-> ; a <- choose ampl-> ; s <- choose sloc-> ; p <- choose paus-> ; send fd (b_setn 0 [(0, f)])-> ; send fd (b_setn 1 [(0, a)])-> ; send fd (c_set [(0, s)])-> ; pauseThread p } }-> in do { withSC3 (\fd -> do { async fd (b_alloc 0 (floor n) 1)-> ; async fd (b_alloc 1 (floor n) 1)-> ; play fd (out 0 co) })-> ; forkIO (withSC3 (\fd -> replicateM_ 128 (update fd))) }
− Help/Graphs/lucier.hs
@@ -1,95 +0,0 @@-{--Alvin Lucier, "Music on a Long Thin Wire, Simulated"-Chandrasekhar Ramakrishnan-http://www.listarc.bham.ac.uk/lists/sc-users/msg47539.html-http://www.listarc.bham.ac.uk/lists/sc-users/msg47540.html--}--import Sound.SC3-import qualified Sound.SC3.UGen.Base as B--lucier_wire :: UGen -> IO ()-lucier_wire freq =- let block_size = recip controlRate- mk_dt f = recip f - block_size- string_delay = mk_dt freq- pk1_pos = 0.1 -- pickup one position- src_pos = 0.3 -- source position- pk2_pos = 0.9 -- pickup two postion- max_delay = 1.0 -- maximum delay time (corresponds to a length = c * s)- mk_delay i r = lpz1 (delayC i max_delay (r * string_delay))- mk_allpass i r dt = lpz1 (allpassC i max_delay (r * string_delay) dt)- drv = localIn 1 AR -- driver (source + data stored in the string)- pk1_R =- let i = drv- r = src_pos - pk1_pos- in mk_delay i r- pk1_L =- let i = pk1_R * negate 1- r = pk1_pos * 2- dt = B.rand (uid 0) 0.001 0.11- in mk_allpass i r dt- pk2_L =- let i = pk1_L- r = pk2_pos - pk1_pos- in mk_delay i r * 0.99- stringL =- let i = pk2_L- r = 1.0 - pk2_pos- in mk_delay i r- pk2_R =- let i = stringL * negate 1- r = 1.0 - pk2_pos- dt = 2 + B.rand (uid 1) 0.001 0.11- in mk_allpass i r dt * 0.99- stringR =- let i = pk2_R- r = pk2_pos - src_pos- in mk_delay i r- source =- let s = sinOsc AR 220 0 * 0.01- p = pulse AR (60 + amplitude KR drv 0.01 0.01 * 11) 0.5 * 0.1- f = rlpf (s + p) 320 0.05- e = 1.0 - min (amplitude KR drv 0.01 0.01) 1.0- in normalizer f 0.7 0.01 * e- l_out = localOut (source * 0.2 + stringR)- outL = pk1_L + pk1_R- outR = pk2_L + pk2_R- in audition (out 0 (mrg [mce2 outL outR, drv, source, l_out]))--main :: IO ()-main = lucier_wire 60--{--lucier_wire 60--{ var blocksize = ControlRate.ir.reciprocal-; var mk_dt = { |f| f.reciprocal - blocksize }-; var string_dt = mk_dt.(60)-; var c = 425-; var len = 40-; var pk1_p = 0.1-; var src_p = 0.3-; var pk2_p = 0.9-; var max_dt = 1-; var mk_dl = { arg i, r- ; LPZ1.ar(DelayC.ar(i, max_dt, r * string_dt)) }-; var mk_ap = { arg i, r, dt- ; LPZ1.ar(AllpassC.ar(i, max_dt, r * string_dt, dt)) }-; var drv = LocalIn.ar(1)-; var r = { Rand(0.001, 0.11) }-; var pk1_R = mk_dl.(drv, src_p - pk1_p, 2 + r.())-; var pk1_L = mk_ap.(pk1_R * -1, pk1_p * 2, r.())-; var pk2_L = mk_dl.(pk1_L, pk2_p - pk1_p, r.()) * 0.99-; var strL = mk_dl.(pk2_L, 1 - pk2_p, r.())-; var pk2_R = mk_ap.(strL * -1, 1 - pk2_p, 2 + r.()) * 0.99-; var strR = mk_dl.(pk2_R, pk2_p - src_p, 2 + r.())-; var src = { var a = Amplitude.kr(drv, mul: 11)- ; p = Pulse.ar(60 + a, mul: 0.1)- ; RLPF.ar((SinOsc.ar(220, 0) * 0.01) + p, 320, 0.05) }-; var src_n = { var a = Amplitude.kr(drv).min(1.0)- ; Normalizer.ar(src, 0.7) * (1.0 - a) }-; LocalOut.ar(src * 0.2 + strR)-; [pk1_L + pk1_R, pk2_L + pk2_R, drv, src] }.play---}
− Help/Graphs/modal-space.lhs
@@ -1,36 +0,0 @@-modal space (jmcc)--> import Sound.SC3--> let { b = 0-> ; p = [0, 2, 3.2, 5, 7, 9, 10] -> ; x = mouseX kr 0 15 Linear 0.1-> ; k = degreeToKey 0 x 12-> ; c n r = let { o = sinOsc ar (midiCPS (r + k + n * 0.04)) 0 * 0.1-> ; t = lfPulse ar (midiCPS (mce2 48 55)) 0.15 0.5-> ; f = midiCPS (sinOsc kr 0.1 0 * 10 + r)-> ; d = rlpf t f 0.1 * 0.1-> ; m = o + d }-> in combN m 0.31 0.31 2 + m }-> in withSC3 (\fd -> do { async fd (b_alloc b (length p) 1)-> ; send fd (b_setn1 b 0 p)-> ; n <- clone 2 (lfNoise1 kr 3)-> ; play fd (out 0 ((c n 48 + c n 72) * 0.25)) })--{ var s = Server.default-; var b = 0-; var p = FloatArray[0, 2, 3.2, 5, 7, 9, 10]-; var x = MouseX.kr(0, 15, 'linear', 0.1)-; var k = DegreeToKey.kr(b, x, 12)-; var c = { arg n, r- ; var o = SinOsc.ar((r + k + (n * 0.04)).midicps, 0) * 0.1- ; var t = LFPulse.ar([48, 55].midicps, 0.15, 0.5)- ; var f = (SinOsc.kr(0.1, 0) * 10 + r).midicps- ; var d = RLPF.ar(t, f, 0.1) * 0.1- ; var m = o + d- ; CombN.ar(m, 0.31, 0.31, 2) + m }-; var n = LFNoise1.kr([3, 3])-; var b_setn1 = { arg b, i, p- ; ["/b_setn", b, i, p.size] ++ p }-; s.sendMsg("/b_alloc", b, p.size, 1, b_setn1.value(b, 0, p).asRawOSC)-; Out.ar(0, (c.value(n, 48) + c.value(n, 72)) * 0.25) }.play
− Help/Graphs/moto-rev.lhs
@@ -1,11 +0,0 @@-moto rev (jmcc)--> import Sound.SC3--> let { f = sinOsc kr 0.2 0 * 10 + 21-> ; s = lfPulse ar f (mce2 0 0.1) 0.1 }-> in audition (out 0 (clip2 (rlpf s 100 0.1) 0.4))--{ var f = SinOsc.kr(0.2, 0) * 10 + 21-; var s = LFPulse.ar(f, [0, 0.1], 0.1)-; Out.ar(0, RLPF.ar(s, 100, 0.1).clip2(0.4)) }.play
− Help/Graphs/mouse-clatter.lhs
@@ -1,54 +0,0 @@-mouse clatter (rd)--> import Sound.SC3--> let { x = mouseX kr 100 12000 Linear 0.1-> ; y = mouseY kr 0.01 0.15 Linear 0.1 }-> in do { n1 <- lfNoise0 kr (mce [3, 3.25])-> ; let { t = impulse kr (n1 * 16 + 18) 0-> ; s = do { n2 <- tRand 0.005 y t-> ; n3 <- whiteNoise ar-> ; n4 <- tRand 10 x t-> ; n5 <- tRand 0 1 t-> ; n6 <- tExpRand 0.15 1 t-> ; o <- let e = decay2 t 0.01 n2-> in return (bpf (n3 * e) n4 n5)-> ; n7 <- pv_RandComb (fft' 10 o) n6 t-> ; return (o * 0.05 + ifft' n7) } }-> in withSC3 (\fd -> do { async fd (b_alloc 10 2048 1)-> ; play fd . out 0 =<< s }) }--s.sendMsg('b_alloc', 10, 2048, 1);--{ var x = MouseX.kr(100, 12000, 'linear', 0.1)-; var y = MouseY.kr(0.01, 0.15, 'linear', 0.1)-; var n1 = LFNoise0.kr([3, 3.25])-; var t = Impulse.kr((n1 * 16) + 18, 0)-; var n2 = TRand.kr(0.005, y, t)-; var n3 = WhiteNoise.ar()-; var n4 = TRand.kr(10, x, t)-; var n5 = TRand.kr(0, 1, t)-; var n6 = TExpRand.kr(0.15, 1, t)-; var o = { var e = Decay2.kr(t, 0.01, n2)- ; BPF.ar(n3 * e, n4, n5) }-; var n7 = PV_RandComb(FFT(10, o), n6, t)-; var s = (o * 0.05) + IFFT(n7)-; Out.ar(0, s) }.play--(let* ((x (MouseX kr 100 12000 0 0.1))- (y (MouseY kr 0.01 0.15 0 0.1))- (n1 (LFNoise0 kr (mce2 3 3.25)))- (t (Impulse kr (MulAdd n1 16 18) 0))- (n2 (TRand 0.005 y t))- (n3 (WhiteNoise ar))- (n4 (TRand 10 x t))- (n5 (TRand 0.0 1.0 t))- (n6 (TExpRand 0.15 1.0 t))- (e (Decay2 t 0.01 n2))- (o (BPF (Mul n3 e) n4 n5))- (n7 (PV_RandComb (FFT* 10 o) n6 t))- (s (Add (Mul o 0.05) (IFFT* n7))))- (with-sc3- (lambda (fd)- (async fd (/b_alloc 10 2048 1))- (play fd (Out 0 s)))))
− Help/Graphs/nharm.lhs
@@ -1,25 +0,0 @@-nharm (rd)--> import Control.Concurrent-> import Control.Monad-> import Sound.SC3-> import System.Random--> let { nharm n f = map ((* f) . fromIntegral) [1..n]-> ; rrand l r = getStdRandom (randomR (l, r))-> ; threadPause n = when (n>0) (threadDelay (floor (n * 1e6)))-> ; klg m u = do { n <- rrand 4 u-> ; d <- rrand 9 12-> ; f <- rrand m (m + 2)-> ; l <- sequence (replicate n (rrand 0.01 0.02))-> ; p <- rrand (-1.0) 1.0-> ; let { a = 0.5-> ; e = envGen kr 1 0.9 0 1 RemoveSynth (envSine d a)-> ; nh = nharm n (midiCPS f)-> ; s = klangSpec nh l (replicate n 0.0) }-> in return (pan2 (klang ar 1 0 s) p e) }-> ; ply :: Int -> (Double, Double) -> UGen -> Int -> IO ()-> ; ply n (l,r) m u = replicateM_ n (do { threadPause =<< rrand l r-> ; audition . out 0 =<< klg m u }) }-> in do { forkIO (ply 32 (0.25, 0.75) 92 24)-> ; forkIO (ply 8 (1.25, 1.75) 12 54) }
− Help/Graphs/noise-burst-sweep.lhs
@@ -1,17 +0,0 @@-noise burst sweep (jmcc)--> import Sound.SC3--> do { n <- clone 2 (whiteNoise ar)-> ; let { lfoRate = mouseX kr 10 60 Exponential 0.2-> ; amp = max 0 (lfSaw kr lfoRate (-1))-> ; cfreq = mouseY kr 400 8000 Exponential 0.2-> ; freq = sinOsc kr 0.2 0 * cfreq + (1.05 * cfreq) }-> in audition (out 0 (resonz (n * amp) freq 0.1)) }--{ var n = WhiteNoise.ar ! 2-; var lfoRate = MouseX.kr(10, 60, 'exponential', 0.2)-; var amp = max(0, LFSaw.kr(lfoRate, -1))-; var cfreq = MouseY.kr(400, 8000, 'exponential', 0.2)-; var freq = SinOsc.kr(0.2, 0) * cfreq + (1.05 * cfreq)-; Out.ar(0, Resonz.ar(n * amp, freq, 0.1)) }.play
− Help/Graphs/one-line.lhs
@@ -1,13 +0,0 @@-one-line (lance putnam)--> import Sound.SC3--> let { lfs = lfSaw ar (mce2 1 0.99) (mce2 0 0.6) * 2000 + 2000-> ; lfs_t = trunc lfs (mce2 400 600) * mce2 1 (-1)-> ; f = onePole (mix lfs_t) 0.98 }-> in audition (out 0 (pan2 (sinOsc ar f 0) 0 0.1))--{ var lfs = LFSaw.ar([1, 0.99], [0, 0.6], 2000, 2000)-; var lfs_t = lfs.trunc([400, 600]) * [1, -1]-; var f = OnePole.ar(Mix.new(lfs_t), 0.98)-; Out.ar(0, Pan2.ar(SinOsc.ar(f, 0), 0, 0.1)) }.play
− Help/Graphs/oscillator-cluster.lhs
@@ -1,48 +0,0 @@-oscillator cluster (rd)--> import Sound.SC3--> let { rng i l r = linLin i (-1) 1 l r-> ; ln a b d = line kr a b d RemoveSynth-> ; xln a b d = xLine kr a b d RemoveSynth-> ; rln r a b d = fmap (\n -> ln (a + n) b d) (rand 0 r)-> ; rxln r a b d = fmap (\n -> xln (a + n) b d) (rand 0 r)-> ; prt d a cf = do { r1 <- rand cf (cf + 2)-> ; r2 <- rln 1 5 0.01 d-> ; r3 <- rln 10 20 0 d-> ; r4 <- rand 0.1 0.2-> ; let { f = mce2 cf r1 + sinOsc kr r2 0 * r3-> ; o = fSinOsc ar f 0-> ; e = decay2 (impulse ar 0 0) r4 d * a }-> in return (o * e) }-> ; np = 12-> ; fp = sequence (replicate np (rand 220 660)) }-> in do { d <- rand 4 7-> ; a <- rand 0.01 0.05-> ; audition . (out 0) . sum =<< mapM (prt d a) =<< fp }--{ var ln = { arg a, b, d- ; Line.kr(a, b, d, 1) }-; var xln = { arg a, b, d- ; XLine.kr(a, b, d, 1) }-; var rln = { arg r, a, b, d- ; var n = Rand.new(0, r)- ; ln.value(a + n, b, d) }-; var rxln = { arg r, a, b, d- ; var n = Rand.new(0, r)- ; xln.value(a + n, b, d) }-; var prt = { arg d, a- ; { arg cf- ; var r1 = Rand.new(cf, cf + 2)- ; var r2 = rln.value(1, 5, 0.01, d)- ; var r3 = rln.value(10, 20, 0, d)- ; var r4 = Rand.new(0.1, 0.2)- ; var f = [cf, r1] + (SinOsc.kr(r2, 0) * r3)- ; var o = FSinOsc.ar(f, 0)- ; var e = Decay2.ar(Impulse.ar(0, 0), r4, d) * a- ; o * e } }-; var np = 12-; var fp = Array.fill(np, { Rand.new(220, 660) })-; var d = Rand.new(4, 7)-; var a = Rand.new(0.01, 0.05)-; Out.ar(0, fp.collect(prt.value(d, a)).sum) }.play
− Help/Graphs/overlap-add.lhs
@@ -1,39 +0,0 @@-overlap-add (jmcc, rd)--> import Control.Concurrent-> import Sound.OpenSoundControl-> import Sound.SC3--> let { at t f -> = let at' t' f' = do { n <- f' t'-> ; pauseThreadUntil (t' + n)-> ; at' (t' + n) f' }-> in do { pauseThreadUntil t-> ; at' t f-> ; return () }-> ; mk_env a s -> = let c = EnvNum 4-> in envGen KR 1 1 0 1 RemoveSynth (envLinen a s a 1 [c,c,c])-> ; with_env g a s -> = out 0 (g * (mk_env a s))-> ; overlap_add fd n o a s g -> = do { t <- utcr-> ; let { g' = with_env g (constant a) (constant s)-> ; dt = (a + s + a) / o -> ; f _ = do { send fd (s_new n (-1) AddToTail 1 [])-> ; return dt } }-> in do { async fd (d_recv (synthdef n g'))-> ; at t f } }-> ; oSine fd -> = do { r0 <- expRand 500 1400-> ; r1 <- rand (-1) 1-> ; let g = pan2 (sinOsc AR r0 0) r1 0.01-> in overlap_add fd "random-sines" 4 2 4 g }-> ; oNoise fd -> = do { n0 <- whiteNoise AR-> ; r0 <- expRand 800 8400-> ; r1 <- rand (-1) 1-> ; let g = pan2 (resonz (n0 * 0.1) r0 0.05) r1 0.25-> in overlap_add fd "random-noise" 4 2 4 g } }-> in do { forkIO (withSC3 (\fd -> oSine fd))-> ; forkIO (withSC3 (\fd -> oNoise fd)) }
− Help/Graphs/pattern-buffer.lhs
@@ -1,26 +0,0 @@-pattern buffer (rd)--> import Sound.SC3-> import System.Random--> let { nf = 2 * 48000-> ; c = 24-> ; tseq l = let n = fromIntegral (length l) / 2.0-> in select (lfSaw kr 0.5 0 * n + n) (mce l)-> ; rrand l r = getStdRandom (randomR (l, r))-> ; p = phasor ar 0 (bufRateScale kr 10) 0 (bufFrames kr 10) 0-> ; t = bufRdC 1 ar 10 p Loop -> ; rs h = do { r0 <- rrand 0 nf-> ; r1 <- rrand 0.0 1.0-> ; send h (b_set1 10 r0 r1) } }-> in do { r1 <- sequence (replicate c (rrand 36 96))-> ; r2 <- sequence (replicate c (rrand (-1.0) 1.0))-> ; r3 <- rrand 0 1-> ; n1 <- tRand 0.02 0.08 t-> ; let { e = decay2 t 0.01 n1-> ; f = midiCPS (tseq r1)-> ; l = tseq r2-> ; o = [sinOsc ar f 0, saw ar f] !! r3 }-> in withSC3 (\fd -> do { async fd (b_alloc 10 (nf * 2) 1)-> ; sequence (replicate c (rs fd))-> ; play fd (out 0 (pan2 o l e)) }) }
− Help/Graphs/plucked-strings.lhs
@@ -1,22 +0,0 @@-plucked strings (jmcc)--> import Sound.SC3--> let { s = do { n0 <- pinkNoise ar-> ; r1 <- rand (-1) 1-> ; im <- i-> ; dt' <- dt-> ; let t = decay im 0.1 * n0 * 0.1-> in return (pan2 (combL t dt' dt' 4) r1 1) }-> ; i = do { r0 <- rand 2 2.2-> ; n0 <- dust ar 0.5-> ; r1 <- rand 0.05 0.15-> ; r2 <- rand 0 (pi * 2)-> ; r3 <- iRand 0 2-> ; let { s0 = impulse ar r0 0.3-> ; s1 = n0 * 0.3-> ; s2 = impulse ar (sinOsc kr r1 r2 * 5 + 5.2) 0.3 }-> in return (select r3 (mce [s0, s1, s2])) }-> ; dt = do { r0 <- rand 60 90-> ; return (1 / (midiCPS (floorE r0))) } }-> in audition . out 0 . sum =<< sequence (replicate 5 s)
− Help/Graphs/police-state.lhs
@@ -1,34 +0,0 @@-police state (jmcc)--> import Sound.SC3--> let node = do { r0 <- rand 0.02 0.12-> ; r1 <- rand 0 (pi*2)-> ; r2 <- rand 0 600-> ; r3 <- rand 700 1300-> ; r4 <- rand (-1) 1-> ; r5 <- rand 80 120-> ; n0 <- lfNoise2 ar r5-> ; let f = sinOsc kr r0 r1 * r2 + r3-> in return (pan2 (sinOsc ar f 0 * n0 * 0.1) r4 1) }-> in do { nodes <- clone 4 node-> ; n0 <- clone 2 (lfNoise2 kr 0.4)-> ; n1 <- lfNoise2 ar (n0 * 90 + 620)-> ; n2 <- lfNoise2 kr (mce2 0.3 0.301)-> ; let e = n1 * (n2 * 0.15 + 0.18)-> in audition (out 0 (combL (mix nodes + e) 0.3 0.3 3)) }--{ var node = { var r0 = Rand.new(0.02, 0.12)- ; var r1 = Rand.new(0, 2pi)- ; var r2 = Rand.new(0, 600)- ; var r3 = 1000 + Rand.new(-300, 300)- ; var r4 = Rand.new(-1, 1)- ; var r5 = 100 + Rand.new(-20, 20)- ; var n0 = LFNoise2.ar(r5)- ; var f = SinOsc.kr(r0, r1, r2, r3)- ; Pan2.ar(SinOsc.ar(f, 0) * n0 * 0.1, r4, 1) }-; var n0 = LFNoise2.kr([0.4, 0.4])-; var n1 = LFNoise2.ar(n0 * 90 + 620)-; var n2 = LFNoise2.kr([0.3,0.3])-; var e = n1 * (n2 * 0.15 + 0.18)-; Out.ar(0, CombL.ar(Mix.fill(4, node) + e, 0.3, 0.3, 3)) }.play
− Help/Graphs/pulsing-bottles.lhs
@@ -1,15 +0,0 @@-pulsing bottles (jmcc)--> import Control.Monad-> import Sound.SC3--> let { r = do { n <- whiteNoise ar-> ; r0 <- rand 4 14-> ; r1 <- rand 0 0.7-> ; r2 <- rand 400 7400-> ; return (resonz (n * lfPulse kr r0 0 0.25 * r1) r2 0.01) }-> ; s = do { f <- rand 0.1 0.5-> ; p <- rand 0 (pi * 2)-> ; return (sinOsc kr f p) }-> ; u = liftM2 (\x y -> pan2 x y 1) r s }-> in audition . out 0 . sum =<< sequence (replicate 6 u)
− Help/Graphs/record-scratcher.lhs
@@ -1,29 +0,0 @@-record scratcher (josh parmenter)--> import Sound.SC3--> let { dup a = mce2 a a-> ; fn = "/home/rohan/audio/metal.wav"-> ; d = env [0, 1, 0] [0.1, 0.1] [EnvSin] 1 0-> ; e = envGen kr 1 1 0 1 RemoveSynth d-> ; x = mouseX kr (-10) 10 Linear 0.2-> ; dx = x - delayN x 0.1 0.1-> ; bdx = mouseButton kr 1 0 0.3 + dx-> ; bdxr = bdx * bufRateScale kr 0-> ; scr = playBuf 1 0 bdxr 0 0 Loop DoNothing }-> in withSC3 (\fd -> do { async fd (b_allocRead 0 fn 0 0)-> ; play fd (out 0 (dup (scr * e))) })--{ var fn = "/home/rohan/audio/metal.wav"-; var b = 0-; var gate = 1-; var e = Env.new([0, 1, 0], [0.1, 0.1], \sin, 1, nil)-; var env = EnvGen.kr(e, gate, doneAction: 2)-; var x = MouseX.kr(-10, 10, 'linear', 0.2)-; var dx = x - DelayN.kr(x, 0.1, 0.1)-; var bdx = MouseButton.kr(1, 0, 0.3) + dx-; var bdxr = bdx * BufRateScale.kr(b)-; var scr = PlayBuf.ar(1, b, bdxr, 0, 0, 1)-; var s = Server.default-; s.sendMsg("/b_allocRead", b, fn, 0, 0)-; Out.ar(0, (scr * env).dup ) }.play
− Help/Graphs/red-frik.lhs
@@ -1,31 +0,0 @@-red frik (f0)--> import Sound.SC3--> let red tr n = -> do { r1 <- tRand 0.3 3 tr-> ; r2 <- tRand 0.3 5 tr-> ; r3 <- tRand 0 0.5 tr-> ; r4 <- tRand 0.49 0.56 tr-> ; r5 <- tRand 0.3 0.6 tr-> ; r6 <- tRand 0.3 0.5 tr-> ; let { o1 = fSinOsc kr r2 0 * r3 + r4-> ; o2 = fSinOsc kr o1 r5 * r6 }-> in return (rhpf n r1 o2) }-> in do { n <- clone 2 (brownNoise ar)-> ; let tr = impulse kr 0.1 0-> in audition . out 0 =<< red tr n }--{ var red = { arg tr, n- ; var r1 = TRand.kr(0.3, 3, tr)- ; var r2 = TRand.kr(0.3, 5, tr)- ; var r3 = TRand.kr(0, 0.5, tr)- ; var r4 = TRand.kr(0.49, 0.56, tr)- ; var r5 = TRand.kr(0.3, 0.6, tr)- ; var r6 = TRand.kr(0.3, 0.5, tr)- ; var o1 = FSinOsc.kr(r2, 0, r3, r4)- ; var o2 = FSinOsc.kr(o1, r5, r6)- ; RHPF.ar(n, r1, o2) }-; var n = [BrownNoise.ar, BrownNoise.ar]-; var tr = Impulse.kr(0.1, 0)-; Out.ar(0, red.value(tr, n)) }.play
− Help/Graphs/reverberated-sine-percussion.lhs
@@ -1,37 +0,0 @@-reverberated sine percussion (jmcc)--> import Sound.SC3--> let { d = 6-> ; c = 5-> ; a = 4-> ; s_ = do { n <- dust ar (2 / constant d)-> ; r <- rand 0 3000-> ; return (resonz (n * 50) (200 + r) 0.003) }-> ; x_ i = do { r <- clone 2 (rand 0 0.05)-> ; return (allpassN i 0.05 r 1) } -> ; (>=>) f g = \x -> f x >>= g-> ; chain n f = foldl (>=>) return (replicate n f) }-> in do { s <- fmap sum (sequence (replicate d s_))-> ; y <- let z = delayN s 0.048 0.48-> in do { r <- clone c (rand 0 0.1)-> ; n <- lfNoise1 kr r-> ; return (mix (combL z 0.1 (n * 0.04 + 0.05) 15)) }-> ; x <- chain a x_ y-> ; audition (out 0 (s + x * 0.2)) }--{ var d = 6-; var c = 5-; var a = 4-; var s_ = { var n = Dust.ar(2 / d)- ; var r = Rand.new(0, 3000)- ; Resonz.ar(n * 50, 200 + r, 0.003) }-; var s = Mix.ar(Array.fill(d, s_))-; var z = DelayN.ar(s, 0.048)-; var y_ = LFNoise1.kr(Array.fill(c, { Rand.new(0, 0.1) }), 0.04, 0.05)-; var y = Mix.ar(CombL.ar(z, 0.1, y_, 15))-; var x = y-; var x_ = { var r = [Rand.new(0, 0.05), Rand.new(0, 0.05)]- ; x = AllpassN.ar(x, 0.050, r, 1) }-; a.do(x_)-; Out.ar(0, s + (0.2 * x)) }.play
− Help/Graphs/rm-octaver.lhs
@@ -1,9 +0,0 @@-rm-octaver (andrea valle, miller puckette)--> import Sound.SC3--> let { defaultPitch x = pitch x 440 60 4000 100 16 1 0.01 0.5 1-> ; i = soundIn 0-> ; p = defaultPitch i-> ; f = mceChannel 0 p }-> in audition (out 0 (sinOsc ar (f * 0.5) 0 * i + i))
− Help/Graphs/s-chirp.lhs
@@ -1,22 +0,0 @@-s-chirp (rd)--> import Sound.SC3--> let { x = mouseX kr 15 0 Linear 0.1-> ; y = mouseY kr 15 27 Linear 0.1-> ; scl = [0, 2, 3.2, 5, 7, 9, 10] }-> in do { t <- dust kr 9-> ; b <- tChoose t (mce [36, 48, 60, 72])-> ; n <- fmap (* 0.04) (lfNoise1 kr (mce2 3 3.05))-> ; d <- tiRand x y t-> ; e <- fmap (decay2 t 0.005) (tRand 0.02 0.15 t)-> ; o <- let { k = degreeToKey 0 d 12-> ; f = midiCPS (b + k + n)-> ; m = e * sinOsc ar f 0 * 0.2-> ; u = pulseDivider t 9 0 }-> in do { r0 <- tRand 0.0075 0.125 u-> ; r1 <- tRand 0.05 0.15 u-> ; return (m * 0.5 + allpassC m 0.15 r0 r1) }-> ; withSC3 (\fd -> do { async fd (b_alloc 0 7 1)-> ; send fd (b_setn1 0 0 scl)-> ; play fd (out 0 o) }) }
− Help/Graphs/sample-and-hold-liquidities.lhs
@@ -1,24 +0,0 @@-sample and hold liquidities (jmcc)--> import Sound.SC3-> import qualified Sound.SC3.UGen.Base as B--> main :: IO ()-> main =-> let { r = mouseX kr 1 200 Exponential 0.1-> ; t = recip r-> ; c = impulse kr r 0.4-> ; cf = mouseY kr 100 8000 Exponential 0.1-> ; f = latch (B.whiteNoise (uid 0) kr * cf * 0.5 + cf) c-> ; p = latch (B.whiteNoise (uid 1) kr) c-> ; i = pan2 (sinOsc ar f 0 * decay2 c (t * 0.1) (t * 0.9)) p 1 }-> in audition (out 0 (combN i 0.3 0.3 2))--{ var r = MouseX.kr(1, 200, 'exponential', 0.1)-; var t = r.reciprocal-; var c = Impulse.kr(r, 0.4)-; var cf = MouseY.kr(100, 8000, 'exponential', 0.1)-; var f = Latch.kr(WhiteNoise.kr * cf * 0.5 + cf, c)-; var p = Latch.kr(WhiteNoise.kr, c)-; var i = Pan2.ar(SinOsc.ar(f, 0, Decay2.kr(c, 0.1 * t, 0.9 * t)), p, 1)-; Out.ar(0, CombN.ar(i, 0.3, 0.3, 2)) }.play
− Help/Graphs/scratchy.lhs
@@ -1,19 +0,0 @@-scratchy (jmcc)--> import Sound.SC3--> do { n <- clone 2 (brownNoise ar)-> ; let f = max (n * 0.5 - 0.49) 0 * 20-> in audition (out 0 (rhpf f 5000 1)) }--{ var n = BrownNoise.ar([0.5, 0.5])-; var f = (n - 0.49).max(0) * 20-; Out.ar(0, RHPF.ar(f, 5000, 1)) }.play--the same graph, written using a non-monadic noise constructor--> import qualified Sound.SC3.UGen.Base as B--> let { f m = B.brownNoise (uid m) ar * 0.5 - 0.49-> ; n = mce [f 0, f 1] }-> in audition (out 0 (rhpf (max n 0 * 20) 5000 1))
− Help/Graphs/scritto.lhs
@@ -1,125 +0,0 @@-scritto (rd)--> import Sound.SC3--> let { scritto = [ ( "sA" -> , [800, 1150, 2900, 3900, 4950]-> , [0, -6, -32, -20, -50]-> , [80, 90, 120, 130, 140] )-> , ( "sE" -> , [350, 2000, 2800, 3600, 4950]-> , [0, -20, -15, -40, -56]-> , [60, 100, 120, 150, 200] )-> , ( "sI" -> , [270, 2140, 2950, 3900, 4950]-> , [0, -12 , -26 , -26 , -44]-> , [60, 90, 100, 120, 120] )-> , ( "sO" -> , [450, 800, 2830, 3800, 4950]-> , [0, -11 , -22 , -22 , -50]-> , [70, 80, 100, 130, 135] )-> , ( "sU" -> , [325, 700, 2700, 3800, 4950]-> , [0, -16, -35, -40, -60]-> , [50, 60, 170, 180, 200] )-> , ( "aA" -> , [800, 1150, 2800, 3500, 4950]-> , [0, -4 , -20, -36 , -60]-> , [80, 90, 120, 130, 140] )-> , ( "aE" -> , [400, 1600, 2700, 3300, 4950]-> , [0, -24 , -30, -35, -60]-> , [60, 80, 120, 150, 200] )-> , ( "aI" -> , [350, 1700, 2700, 3700, 4950]-> , [0, -20, -30, -36 , -60]-> , [50, 100, 120, 150, 200] )-> , ( "aO" -> , [450, 800, 2830, 3500, 4950]-> , [0, -9 , -16 , -28 , -55]-> , [70, 80, 100, 130, 135] )-> , ( "aU" -> , [325, 700, 2530, 3500, 4950]-> , [0, -12 , -30, -40, -64]-> , [50, 60, 170, 180, 200] )-> , ( "ctA"-> , [660, 1120, 2750, 3000, 3350]-> , [0, -6 , -23 , -24 , -38]-> , [80, 90, 120, 130, 140] )-> , ( "ctE"-> , [440, 1800, 2700, 3000, 3300]-> , [0, -14 , -18 , -20, -20]-> , [70, 80, 100, 120, 120] )-> , ( "ctI"-> , [270, 1850, 2900, 3350, 3590]-> , [0, -24 , -24 , -36 , -36]-> , [40, 90, 100, 120, 120] )-> , ( "ctO"-> , [430, 820, 2700, 3000, 3300]-> , [0, -10, -26 , -22 , -34]-> , [40, 80, 100, 120, 120] )-> , ( "ctU"-> , [370, 630, 2750, 3000, 3400]-> , [0, -20, -23 , -30, -34]-> , [40, 60, 100, 120, 120] )-> , ( "tA" -> , [650, 1080, 2650, 2900, 3250]-> , [0, -6 , -7 , -8 , -22]-> , [80, 90, 120, 130, 140] )-> , ( "tE" -> , [400, 1700, 2600, 3200, 3580]-> , [0, -14 , -12 , -14 , -20]-> , [70, 80, 100, 120, 120] )-> , ( "tI" -> , [290, 1870, 2800, 3250, 3540]-> , [0, -15, -18 , -20, -30]-> , [40, 90, 100, 120, 120] )-> , ( "tO" -> , [400, 800, 2600, 2800, 3000]-> , [0, -10, -12 , -12 , -26]-> , [40, 80, 100, 120, 120] )-> , ( "tU" -> , [350, 600, 2700, 2900, 3300]-> , [0, -20, -17 , -14 , -26]-> , [40, 60, 100, 120, 120] )-> , ( "bA" -> , [600, 1040, 2250, 2450, 2750]-> , [0, -7 , -9 , -9 , -20]-> , [60, 70, 110, 120, 130] )-> , ( "bE" -> , [400, 1620, 2400, 2800, 3100]-> , [0, -12 , -9 , -12 , -18]-> , [40, 80, 100, 120, 120] )-> , ( "bI" -> , [250, 1750, 2600, 3050, 3340]-> , [0, -30, -16 , -22 , -28]-> , [60, 90, 100, 120, 120] )-> , ( "bO" -> , [400, 750, 2400, 2600, 2900]-> , [0, -11 , -21 , -20, -40]-> , [40, 80, 100, 120, 120] )-> , ( "bU" -> , [350, 600, 2400, 2675, 2950]-> , [0, -20, -32 , -28 , -36]-> , [40, 80, 100, 120, 120] ) ]-> ; s_msg n (_, f, a, b) = b_setn1 n 0 (f ++ a ++ b)-> ; s_alloc fd (s, b) = do { async fd (b_alloc b 15 1)-> ; send fd (s_msg b s) }-> ; buf_at b n = bufRd 1 kr b (mce [n .. n + 4]) NoLoop NoInterpolation-> ; v_filter i f a b = resonz i f (b / f) * dbAmp a-> ; v_filter_b bi i = v_filter i (buf_at bi 0) (buf_at bi 5) (buf_at bi 10)-> ; mk_instr bx = do -> { n <- lfNoise2 kr 3-> ; let { t = impulse ar (n * 9 + 9) 0-> ; i d = do { n1 <- tRand 0.02 0.06 t-> ; n2 <- tiRand 30 52 t-> ; n3 <- tiRand 16 32 t-> ; let { p = pulseDivider t d 0-> ; b = blip ar (midiCPS n2) n3 }-> in return (decay2 p 0.01 n1 * b * 12) }-> ; bi = linLin n (-1) 1 0 bx-> ; voice = mix . v_filter_b bi }-> in return . out 0 . mce . map voice =<< mapM i [1, 2] } }-> in withSC3 (\fd -> do { mapM_ (s_alloc fd) (zip scritto [0..])-> ; let n = constant (length scritto)-> in audition =<< mk_instr n })
− Help/Graphs/shepard-tones.lhs
@@ -1,41 +0,0 @@-shepard tones (alberto de campo)--> import Sound.SC3--> let { indxs n l r = let i = (r - l) / n -> in [l, l + i .. r - i]-> ; hanningWindow n = -> let { lp = pi * (-0.5)-> ; rp = lp + 2 * pi -> ; hf i = sin i * 0.5 + 0.5 }-> in map hf (indxs n lp rp)-> ; square x = x * x-> ; ampTable = map square (hanningWindow 1024) -> ; amp_f i = (0.5 ** i) * 20000-> ; freqTable = map amp_f (indxs 1024 0 10)-> ; ratescale = 1024 / 44100 / 10-> ; rate = 0.1-> ; ph = phasor ar 0 (rate * ratescale) 0 1024 0-> ; phases = mce (map (\n -> n * 0.1 * 1024 + ph) [0..9])-> ; freqs = bufRdC 1 ar 1 phases Loop-> ; amps = bufRdC 1 ar 2 phases Loop-> ; tone = mix (sinOsc ar freqs 0 * amps) * 0.1 }-> in withSC3 (\fd -> do { async fd (b_alloc 1 1024 1)-> ; async fd (b_alloc 2 1024 1)-> ; send fd (b_setn1 1 0 freqTable)-> ; send fd (b_setn1 2 0 ampTable)-> ; audition (out 0 tone) })--{ var ampTable = Signal.hanningWindow(1024).squared-; var amp_f = { arg i; 0.5 ** i * 20000 }-; var freqTable = Signal.newClear(1024).waveFill(amp_f, 0, 10)-; var b1 = Buffer.loadCollection(s, freqTable)-; var b2 = Buffer.loadCollection(s, ampTable)-; var ratescale = 1024 / 44100 / 10-; var rate = 0.1-; var ph = Phasor.ar(0, rate * ratescale, 0, 1024, 0)-; var phases = (0..9) * 0.1 * 1024 + ph-; var freqs = BufRd.ar(1, b1.bufnum, phases)-; var amps = BufRd.ar(1, b2.bufnum, phases)-; var tone = Mix.ar(SinOsc.ar(freqs) * amps) * 0.1 -; Out.ar(0, tone)}.play
− Help/Graphs/shifting-pulses.lhs
@@ -1,22 +0,0 @@-shifting pulses (rd)--> import Sound.SC3--> do { [n0, n1, n2] <- sequence (replicate 3 (clone 2 (brownNoise kr)))-> ; t <- dust kr 0.75-> ; let { warp i = linLin i (-1) 1-> ; l = latch t t-> ; p = pulse ar (warp n0 2 (mce2 11 15)) 0.01 * 0.1 -> ; f = warp n1 300 1800 -> ; rq = warp n2 0.01 2 }-> in audition (out 0 (l * rlpf p f rq)) }--{ var n0 = BrownNoise.kr.dup-; var n1 = BrownNoise.kr.dup-; var n2 = BrownNoise.kr.dup-; var t = Dust.kr(0.75)-; var l = Latch.kr(t, t)-; var p = Pulse.ar(n0.range(2, [11, 15]), 0.01) * 0.1 -; var f = n1.range(300, 1800)-; var rq = n2.range(0.01, 2)-; Out.ar(0, l * RLPF.ar(p, f, rq)) }.play
− Help/Graphs/snare-909.lhs
@@ -1,45 +0,0 @@-snare-909 (jmcc)--> import Sound.SC3--> let { snr tr n v =-> let { e a b = envGen ar tr 1 0 1 DoNothing (envPerc a b)-> ; e1 = e 0.0005 0.055-> ; e2 = e 0.0005 0.075-> ; e3 = e 0.0005 0.4-> ; e4 = e 0.0005 0.283-> ; t1 = lfTri ar 330 0-> ; t2 = lfTri ar 185 0-> ; x1 = lpf n 7040 * 0.1 + v-> ; x2 = hpf x1 523-> ; m1 = t1 * e1 * 0.25 + t2 * e2 * 0.25-> ; m2 = x1 * e3 * 0.20 + x2 * e4 * 0.20 }-> in m1 + m2-> ; x = mouseX kr 1 4 Linear 0.2-> ; y = mouseY kr 0.25 0.75 Exponential 0.2-> ; t = impulse kr (3 * x) 0 }-> in do { n <- whiteNoise ar-> ; v <- tRand 0.25 1.0 t-> ; audition (out 0 (pan2 (snr t n v) 0 y)) }--{ var snr =- { arg tr, n, v- ; var e = { arg a, b- ; EnvGen.ar(Env.perc(a, b), tr, 1, 0, 1, 0) }- ; var e1 = e.value(0.0005, 0.055)- ; var e2 = e.value(0.0005, 0.075)- ; var e3 = e.value(0.0005, 0.4)- ; var e4 = e.value(0.0005, 0.283)- ; var t1 = LFTri.ar(330, 0)- ; var t2 = LFTri.ar(185, 0)- ; var x1 = LPF.ar(n, 7040) * (0.1 + v)- ; var x2 = HPF.ar(x1, 523)- ; var m1 = (t1 * e1 * 0.25) + (t2 * e2 * 0.25)- ; var m2 = (x1 * e3 * 0.20) + (x2 * e4 * 0.20)- ; m1 + m2 }-; var x = MouseX.kr(1, 4, 'linear', 0.2)-; var y = MouseY.kr(0.25, 0.75, 'exponential', 0.2)-; var t = Impulse.kr(3 * x, 0)-; var n = WhiteNoise.ar-; var v = TRand.kr(0.25, 1.0, t)-; Out.ar(0, Pan2.ar(snr.value(t, n, v), 0, y)) }.play
− Help/Graphs/sosc-lp.lhs
@@ -1,32 +0,0 @@-sosc-lp (rd)--> import Sound.SC3--> let { dustR r lo hi = do { n1 <- dwhite 1 lo hi-> ; n2 <- whiteNoise r-> ; d <- dseq dinf n1-> ; return (tDuty r d 0 DoNothing (abs n2) 1) }-> ; a = [60, 71, 89, 65, 36, 57, 92, 97, 92, 97]-> ; b = [71, 89, 60, 57, 65, 36, 95, 92, 93, 97]-> ; setup fd = do { async fd (b_alloc 10 9 1)-> ; async fd (b_alloc 11 9 1)-> ; send fd (b_setn1 10 0 a)-> ; send fd (b_setn1 11 0 b) }-> ; d_env t = decay2 t 0.002 2.5-> ; idx t = stepper t 0 0 15 1 0-> ; f1 t = let { l = (bufRdL 1 kr 10 (idx t) Loop - 24)-> ; r = (bufRdL 1 kr 11 (idx t) Loop - 24) }-> in midiCPS (mce2 l r)-> ; f2 t n = f1 t + n * 1.2-> ; o1 t = sinOsc ar (f1 t) 0 * d_env t-> ; o2 t n = sinOsc ar (f2 t n) 0 * d_env t-> ; sosc_lp t n = out 0 ((o1 t + o2 t n) * 0.2) }-> in do { clk <- dustR kr 0.2 0.9-> ; n <- lfNoise0 kr (mce2 1 3)-> ; audition (sosc_lp clk n) }--> let { a = [71, 60, 65, 89, 36, 57, 95, 97, 92, 97]-> ; b = [89, 71, 60, 65, 57, 36, 92, 95, 93, 97]-> ; resetup fd = do { send fd (b_setn1 10 0 a)-> ; send fd (b_setn1 11 0 b) } }-> in withSC3 resetup
− Help/Graphs/spe.lhs
@@ -1,22 +0,0 @@-spe (jmcc)--> import Sound.SC3--> let { (>=>) f g = \x -> f x >>= g-> ; chain n f = foldl (>=>) return (replicate n f)-> ; rapf i = do { r <- clone 2 (rand 0 0.05)-> ; return (allpassN i 0.05 r 4) }-> ; src = let { t = impulse kr 9 0-> ; e = envGen kr t 0.1 0 1 DoNothing (envPerc 0.1 1)-> ; s = mce [ 00, 03, 02, 07-> , 08, 32, 16, 18-> , 00, 12, 24, 32 ] }-> in do { n <- lfNoise1 kr 1-> ; m <- dseq dinf s-> ; let { f = midiCPS (demand t 0 m + 32)-> ; o = lfSaw ar f 0 * e-> ; rq = midiCPS (n * 36 + 110) }-> in return (rlpf o rq 0.1) } }-> in audition . (out 0) =<< chain 4 rapf =<< src--[variant of graph in streams & patterns tutorial]
− Help/Graphs/sprinkler.lhs
@@ -1,21 +0,0 @@-sprinkler (jmcc)--> import Sound.SC3--> do { n <- whiteNoise ar-> ; let { f = lfPulse kr 0.09 0 0.16 * 10 + 7-> ; t = lfPulse kr f 0 0.25 * 0.1 }-> in audition (out 0 (bpz2 (n * t))) }--{ var f = LFPulse.kr(0.09, 0, 0.16, 10, 7)-; var t = LFPulse.kr(f, 0, 0.25, 0.1)-; Out.ar(0, BPZ2.ar(WhiteNoise.ar * t)) }.play--the same graph, with a non-monadic noise constructor--> import qualified Sound.SC3.UGen.Base as B--> let { n = B.whiteNoise (uid 0) ar-> ; f = lfPulse kr 0.09 0 0.16 * 10 + 7-> ; t = lfPulse kr f 0 0.25 * 0.1 }-> in audition (out 0 (bpz2 (n * t)))
− Help/Graphs/strummable-guitar.lhs
@@ -1,29 +0,0 @@-strummable guitar (jmcc)--> import Sound.SC3-> import qualified Sound.SC3.UGen.Base as B--> main :: IO ()-> main =-> let { scale = [ 52, 57, 62, 67, 71, 76 ]-> ; str i = let { x = mouseX kr 0 1 Linear 0.2-> ; t = abs (hpz1 (x >* (0.25 + constant i * 0.1)))-> ; e = decay t 0.05-> ; n = B.pinkNoise (uid i) ar * e-> ; dt = 1 / (midiCPS (scale !! i))-> ; s = combL n dt dt 4 }-> in pan2 s (constant i * 0.2 - 0.5) 1-> ; strs = mixFill (length scale) str }-> in audition (out 0 (leakDC (lpf strs 12000) 0.995))--{ var scale = [ 52, 57, 62, 67, 71, 76 ]-; var str = { arg i- ; var x = MouseX.kr(0, 1, 'linear', 0.2)- ; var t = HPZ1.kr(x > (0.25 + (i * 0.1))).abs- ; var e = Decay.kr(t, 0.05)- ; var n = PinkNoise.ar * e- ; var dt = scale.at(i).midicps.reciprocal- ; var s = CombL.ar(n, dt, dt, 4)- ; Pan2.ar(s, i * 0.2 - 0.5, 1) }-; var strs = Mix.fill(scale.size, str)-; Out.ar(0, LeakDC.ar(LPF.ar(strs, 12000), 0.995)) }.play
− Help/Graphs/sweepy-noise.lhs
@@ -1,16 +0,0 @@-sweepy noise (jmcc)--> import Sound.SC3--> do { n <- clone 2 (whiteNoise ar)-> ; let { lfoDepth = mouseY kr 200 8000 Exponential 0.1-> ; lfoRate = mouseX kr 4 60 Exponential 0.1-> ; freq = lfSaw kr lfoRate 0 * lfoDepth + (lfoDepth * 1.2)-> ; filtered = rlpf (n * 0.03) freq 0.1 }-> in audition (out 0 (combN filtered 0.3 0.3 2 + filtered)) }--{ var lfoDepth = MouseY.kr(200, 8000, 'exponential', 0.1)-; var lfoRate = MouseX.kr(4, 60, 'exponential', 0.1)-; var freq = LFSaw.kr(lfoRate, 0) * lfoDepth + (lfoDepth * 1.2)-; var filtered = RLPF.ar(WhiteNoise.ar([0.03,0.03]), freq, 0.1)-; Out.ar(0, CombN.ar(filtered, 0.3, 0.3, 2) + filtered) }.play
− Help/Graphs/synthetic-piano.lhs
@@ -1,32 +0,0 @@-synthetic piano (jmcc)--> import Sound.SC3--> let p = do { n <- iRand 36 90-> ; f <- rand 0.1 0.5-> ; ph <- rand 0 (pi * 2)-> ; let { s = impulse ar f ph * 0.1-> ; e = decay2 s 0.008 0.04-> ; c i = do { n0 <- lfNoise2 ar 3000-> ; let { o = [-0.05, 0, 0.04] !! i-> ; dt = 1 / (midiCPS (n + o)) }-> in return (combL (n0 * e) dt dt 6) }-> ; l = ((n - 36) / 27) - 1 }-> in do { c_ <- mixFillM 3 c-> ; return (pan2 c_ l 1) } }-> in audition . out 0 =<< mixFillM 6 (const p)--{ var p = { var n = IRand.new(36, 90)- ; var f = Rand.new(0.1, 0.5)- ; var ph = Rand.new(0, pi * 2)- ; var s = Impulse.ar(f, ph) * 0.1- ; var e = Decay2.ar(s, 0.008, 0.04)- ; var c = { arg i- ; var n0 = LFNoise2.ar(3000)- ; var o = [-0.05, 0, 0.04].at(i)- ; var dt = 1 / (n + o).midicps- ; CombL.ar(n0 * e, dt, dt, 6) }- ; var l = ((n - 36) / 27) - 1- ; var c_ = Mix.fill(3, c)- ; Pan2.ar(c_, l, 1) }-; Out.ar(0, Mix.fill(6, p)) }.play
− Help/Graphs/tank.lhs
@@ -1,66 +0,0 @@-tank (jmcc)--> import Control.Monad-> import Sound.SC3-> import qualified Sound.SC3.UGen.Monadic as M--> main :: IO ()-> main =-> let { r_allpass i = do { r <- clone 2 (M.rand 0.005 0.02)-> ; return (allpassN i 0.03 r 1) }-> ; chain n f = foldl (>=>) return (replicate n f)-> ; pling = do { d <- M.dust ar 0.2-> ; f <- M.expRand 300 2200-> ; p <- M.rand (-1) 1-> ; let { s1 = cubed (fSinOsc ar f 0)-> ; s2 = decay2 d 0.1 0.5 * 0.1 * s1 }-> in return (pan2 s2 p 1) }-> ; bang = do { d <- M.dust ar 0.01-> ; n <- M.brownNoise ar-> ; return (pan2 (decay2 d 0.04 0.3 * n) 0 1) }-> ; tank i = do { r1 <- clone 2 (M.rand 0.01 0.05)-> ; r2 <- clone 2 (M.rand 0.03 0.15)-> ; let { l0 = localIn 2 ar * 0.98-> ; l1 = onePole l0 0.33-> ; [l1l, l1r] = mceChannels l1-> ; l2 = rotate2 l1l l1r 0.23-> ; l3 = allpassN l2 0.05 r1 2-> ; l4 = delayN l3 0.3 (mce [0.17, 0.23])-> ; l5 = allpassN l4 0.05 r2 2-> ; l6 = leakDC l5 0.995-> ; l7 = l6 + i }-> in return (mrg [l7, localOut l7]) }-> ; signal = do { s <- liftM2 (+) bang (mixFillM 8 (const pling))-> ; chain 4 r_allpass s } }-> in audition . out 0 =<< tank =<< signal--{ var r_allpass = { arg signal- ; var r = { Rand.new(0.005, 0.02) }.dup- ; AllpassN.ar(signal, 0.03, r, 1); }-; var pling = { var d = Dust.ar(0.2)- ; var f = ExpRand.new(300, 2200)- ; var p = Rand.new(-1, 1)- ; var s1 = FSinOsc.ar(f, 0).cubed- ; var s2 = Decay2.ar(d, 0.1, 0.5) * 0.1 * s1- ; Pan2.ar(s2, p, 1) }-; var bang = { var d = Dust.ar(0.01)- ; var n = BrownNoise.ar- ; Pan2.ar(Decay2.ar(d, 0.04, 0.3) * n, 0, 1) }-; var tank = { arg i- ; var r1 = { Rand.new(0.01,0.05) }.dup- ; var r2 = { Rand.new(0.03,0.15) }.dup- ; var l0 = LocalIn.ar(2) * 0.98- ; var l1 = OnePole.ar(l0, 0.33)- ; var l2 = Rotate2.ar(l1[0], l1[1], 0.23)- ; var l3 = AllpassN.ar(l2, 0.05, r1, 2)- ; var l4 = DelayN.ar(l3, 0.3, [0.17,0.23])- ; var l5 = AllpassN.ar(l4, 0.05, r2, 2)- ; var l6 = LeakDC.ar(l5, 0.995)- ; var l7 = l6 + i- ; LocalOut.ar(l7)- ; l7 }-; var signal = Mix.fill(12, pling) + bang.value-; 4.do({ signal = r_allpass.value(signal) })-; Out.ar(0, tank.value(signal)) }.play--http://create.ucsb.edu/pipermail/sc-users/2004-April/009692.html
− Help/Graphs/tgb.lhs
@@ -1,33 +0,0 @@-tgb (rd)--> import Sound.SC3-> import System.Random--> let { mkls bp t = envGen kr 1 1 0 1 RemoveSynth (envCoord bp t 1 EnvLin)-> ; pm_t l r d t = let { le = mkls l d-> ; re = mkls r d }-> in tRand le re t-> ; wrp i l r = linLin i (-1) 1 l r-> ; pm_n rt l d = let { le = mkls l d-> ; re = mkls l d }-> in do { n <- whiteNoise rt-> ; return (wrp n le re) }-> ; rrand l r = getStdRandom (randomR (l, r))-> ; gb b d = do { gps <- pm_n ar [(0, 400), (1, 900)] d-> ; let { t = impulse ar gps 0-> ; pm_f (l, r) = pm_t l r d t }-> in do { du <- pm_f ([(0, 0.005), (0.5, 0.015), (1, 0.005)]-> ,[(0, 0.009), (0.5, 0.020), (1, 0.009)])-> ; pn <- pm_f ([(0, -1.0), (0.5, -0.5), (1, 0.5)]-> ,[(0, -0.5), (0.5, 0.5), (1, 1.0)])-> ; rt <- pm_f ([(0, 6), (0.5, 12), (1, 6)]-> ,[(0, 12), (0.5, 12), (1, 12)])-> ; cs <- pm_f ([(0, 0), (1, 0.95)]-> ,[(0, 0), (1, 1)])-> ; am <- pm_f ([(0, 0.25), (0.5, 0.55), (1, 0.15)]-> ,[(0, 0.5), (0.5, 0.75), (1, 0.25)])-> ; let cs' = cs * (bufDur kr b)-> in return (tGrains 2 t b rt cs' du pn am 2) } }-> ; fn = "/home/rohan/audio/text.snd" }-> in withSC3 (\fd -> do { async fd (b_allocRead 10 fn 0 0)-> ; play fd . (out 0) =<< gb 10 12 })
− Help/Graphs/tgr-rpr.lhs
@@ -1,41 +0,0 @@-tgr-rpr (rd)--> import Sound.OpenSoundControl-> import Sound.SC3-> import System.Random--> let { sf = "/home/rohan/audio/text.snd"-> ; preset = [ 0.01, 0.02-> , 0.95, 1.05-> , 0.02, 0.06-> , 0.2, 0.3-> , 0.7, 0.9-> , -1.0, 1.0 ]-> ; dustR r lo hi = do { n1 <- dwhite 1 lo hi-> ; n2 <- whiteNoise r-> ; d <- dseq dinf n1-> ; return (tDuty r d 0 DoNothing (abs n2) 1) }-> ; rpr n t = tRand (in' 1 kr n) (in' 1 kr (n + 1)) t-> ; rrand l r = getStdRandom (randomR (l, r))-> ; rSet = [ (0.005, 0.025), (0.05, 0.25)-> , (0.75, 0.95) , (1.05, 1.25)-> , (0.001, 0.01) , (0.02, 0.04)-> , (0.1, 0.2) , (0.2, 0.4)-> , (0.0, 0.45) , (0.55, 1.0)-> , (-1.0, 0.0) , (0.0, 1.0) ]-> ; edit fd = do { s <- mapM (\(l,r) -> rrand l r) rSet-> ; send fd (c_setn [(0, s)])-> ; pauseThread 0.35 } }-> in do { clk <- dustR ar (in' 1 kr 0) (in' 1 kr 1)-> ; rat <- rpr 2 clk-> ; dur <- rpr 4 clk-> ; pos <- fmap (* (bufDur kr 10)) (rpr 8 clk)-> ; pan <- rpr 10 clk-> ; amp <- rpr 6 clk-> ; withSC3 (\fd -> do { async fd (b_allocRead 10 sf 0 0)-> ; send fd (c_setn [(0, preset)])-> ; let o = tGrains 2 clk 10 rat pos dur pan amp 2-> in play fd (out 0 o)-> ; pauseThread 0.3-> ; sequence (replicate 16 (edit fd))-> ; reset fd }) }
− Help/Graphs/tgrn.lhs
@@ -1,23 +0,0 @@-tgrn (rd)-ghci -e main tgrn.lhs-C-cC-l C-cC-m--> import Sound.SC3-> import qualified Sound.SC3.UGen.Base as B--> tgrn :: UGen -> UGen-> tgrn b =-> let { trate = mouseY kr 2 120 Exponential 0.1-> ; dur = 1.2 / trate-> ; clk = impulse ar trate 0-> ; pos = mouseX kr 0 (bufDur kr b) Linear 0.1-> ; pan = B.whiteNoise (uid 1) kr * 0.6-> ; n = roundE (B.whiteNoise (uid 2) kr * 3) 1-> ; rate = shiftLeft 1.2 n }-> in tGrains 2 clk b rate pos dur pan 0.25 2--> main :: IO ()-> main =-> let fn = "/home/rohan/audio/text.snd"-> in withSC3 (\fd -> do { async fd (b_allocRead 10 fn 0 0)-> ; audition (out 0 (tgrn 10)) })
− Help/Graphs/theremin.lhs
@@ -1,21 +0,0 @@-theremin (jmcc)--> import Sound.SC3--> let { m = 7-> ; detune = 0-> ; x = mouseX kr 0 0.9 Linear 0.2-> ; y = mouseY kr 4000 200 Exponential 0.8-> ; f = y + detune-> ; f' = f + f * sinOsc ar m 0 * 0.02-> ; a = sinOsc ar f' 0 * x }-> in audition (out 0 (pan2 a 0 1))--{ var mod = 7-; var detune = 0-; var x = MouseX.kr(0, 0.9, 'linear', 0.2)-; var y = MouseY.kr(4000, 200, 'exponential', 0.8)-; var f = y + detune-; var f_ = f + (f * SinOsc.ar(mod, 0) * 0.02)-; var a = SinOsc.ar(f_, 0) * x-; Out.ar(0, (Pan2.ar(a, 0, 1))) }.play
− Help/Graphs/three-cpsw.lhs
@@ -1,23 +0,0 @@-three-cpsw (rd)--> import Sound.SC3--> do { t <- dust kr (mce2 12 18)-> ; f0 <- tRand 1 64 t-> ; f1 <- lfNoise0 kr f0-> ; a <- tRand 0.0 0.5 t-> ; dt <- tRand 0.975 1.025 t-> ; dh <- tRand 0.750 0.7505 t-> ; let { f = f1 * mce2 9000 12000 + 9500-> ; o = saw ar f + saw ar (f * dh) + saw ar (f * dt) }-> in audition (out 0 (clip2 (o * a) 0.75)) }--{ var t = Dust.kr([12, 18])-; var f0 = TRand.kr(1, 64, t)-; var f1 = LFNoise0.kr(f0)-; var a = TRand.kr(0.0, 0.5, t)-; var dt = TRand.kr(0.975, 1.025, t)-; var dh = TRand.kr(0.750, 0.7505, t)-; var f = f1 * [9000, 12000] + 9500-; var o = Saw.ar(f) + Saw.ar(f * dh) + Saw.ar(f * dt)-; Out.ar(0, (o * a).clip2(0.75)) }.play
− Help/Graphs/thx.lhs
@@ -1,37 +0,0 @@-thx (perry cook)--> import Sound.SC3-> import System.Random--> let { rvb i rT -> = let { d = mce [0.0297, 0.0371, 0.0411, 0.0437]-> ; c = mix (combN i 0.05 d rT * 0.25)-> ; f = (allpassN c 0.01 0.005 0.096835) }-> in allpassN f 0.01 0.0017 0.032924-> ; mk_env z0 t0 z1 t1 t2 z2 t3 c-> = let { z = [z0, z1, z1, z2, z2]-> ; t = [t0, t1, t2, t3]-> ; e = env z t [c, c, c] (-1.0) (-1.0) }-> in envGen KR 1 1 0 1 RemoveSynth e-> ; mk_node t4 f0 f1 l -> = let { f = mk_env f0 t0 f0 t1 t2 f1 (t3 + t4 + t5 + t5) EnvLin-> ; g = mk_env 0 t0 0.1 (t1 + t2 + t3) t4 0.0 (t5 + t5) EnvLin-> ; s = saw AR f-> ; t0 = 0.035-> ; t1 = 0.2267573696-> ; t2 = 2.2675736061-> ; t3 = 6.8027210884-> ; t5 = 1.75 }-> in pan2 s l g-> ; thx -> = let { s = foldl1 (+) (zipWith3 (mk_node t4) f0 f1 l)-> ; t4 = 7.9365079365-> ; n = 30-> ; l = take n (randomRs (-1.0, 1.0) (mkStdGen 1))-> ; f = [29, 87.5, 116, 175, 233, 350, 524, 880, 1048, 1760]-> ; f0 = take n (randomRs (200.0, 800.0) (mkStdGen 2))-> ; f1 = take n (cycle f) }-> in out 0 (rvb (mce [s]) t4) }-> in audition thx--http://ccrma-mail.stanford.edu/pipermail/stk/2007-January/000327.html
− Help/Graphs/tipnso.lhs
@@ -1,14 +0,0 @@-tipnso (rd)--> import Sound.SC3--> let { x = mouseX kr 1 32 Linear 0.1-> ; t = impulse ar x 0 }-> in do { n1 <- tiRand 16 72 t-> ; n2 <- tiRand 0 1 t-> ; n3 <- pinkNoise ar-> ; let { e = decay2 t 0.01 (mce2 0.1 0.15)-> ; f = midiCPS (n1 + 36 + (12 * n2))-> ; s = sinOsc ar f 0 * e-> ; b = bpf (n3 * e) (36 + midiCPS n1) (175 / (midiCPS n1)) }-> in audition (out 0 ((s + b) * mce2 0.15 0.1)) }
− Help/Graphs/tr-out.lhs
@@ -1,22 +0,0 @@-tr-out (rd)--> import Sound.SC3--> let node n = do { t <- dust kr 1.6-> ; r1 <- tRand 0 6 t-> ; r2 <- tRand 0 6 t-> ; r3 <- tRand 0 6 t-> ; let { f = midiCPS (bufRdN 1 kr 0 r1 NoLoop)-> ; p = bufRdN 1 kr 1 r2 NoLoop-> ; a = bufRdN 1 kr 2 r3 NoLoop }-> in return ( pan2 (sinOsc ar f 0) p a-> , sendTrig t n (f / 660) ) }-> in withSC3 (\fd -> do { async fd (b_alloc 0 6 1)-> ; send fd (b_setn1 0 0 [60, 62, 64, 65, 67, 69])-> ; async fd (b_alloc 1 6 1)-> ; send fd (b_setn1 1 0 [-1, -0.5, 0, 0.25, 0.75, 1.0])-> ; async fd (b_alloc 2 6 1)-> ; send fd (b_setn1 2 0 [0.01, 0.05, 0.1, 0.15, 0.25, 0.35])-> ; ns <- mapM node [1..4]-> ; let o = sum (map fst ns)-> in play fd (out 0 (mrg (o : map snd ns))) })
− Help/Graphs/train.lhs
@@ -1,24 +0,0 @@-train (th.list at gmail.com)--> import Sound.SC3--> let { time = 24-> ; steam n1 n2 = let { piston = lfSaw AR (xLine AR 1 7 time DoNothing) 0-> ; air = lpf (n1 * piston + n2 * piston) 5000 -> ; e = envGen AR 1 1 0 1 DoNothing (envSine time 9) }-> in bpf air 600 (1 + e)-> ; whistle n3 = let { f = [800, 600, 1200, 990]-> ; s = klankSpec f [1, 1, 1, 1] [1, 1, 1, 1]-> ; t = [0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0]-> ; l = [2, 0, 0.2, 0, 0.2, 0, 0.8, 0, 4, 0, 3]-> ; d = env t l (repeat EnvLin) 0 0-> ; e = envGen AR 1 1 0 (time/10) DoNothing d }-> in klank (n3 * 0.004) 1 0 1 s * e-> ; loc = let e = env [-0.8, 0.8] [time + 2] [EnvSin, EnvSin] 0 0-> in envGen AR 1 1 0 1 RemoveSynth e }-> in do { n1 <- whiteNoise AR-> ; n2 <- pinkNoise AR-> ; n3 <- whiteNoise AR-> ; audition (out 0 (pan2 (steam n1 n2 + whistle n3) loc 1)) }--http://www.create.ucsb.edu/pipermail/sc-users/2007-August/035957.html
− Help/Graphs/trkl.lhs
@@ -1,26 +0,0 @@-trkl (rd)--> import Sound.SC3--> let trkl d ul fu dy la fy =-> let { tf = xLine kr 1 ul d RemoveSynth-> ; st = impulse ar (tf * 8) 0-> ; t = impulse ar tf 0 }-> in do { r0 <- rand (-1) 1-> ; r1 <- rand (-1) 1-> ; r2 <- tRand 0.05 1.0 t-> ; r3 <- tExpRand 0.0 0.25 st -> ; fh <- tRand 1.75 2.25 t -> ; let { a = dbAmp (line kr 12 la d RemoveSynth)-> ; f = xLine kr fu 900 d RemoveSynth-> ; p = line kr r0 r1 d RemoveSynth-> ; o1 = mix (ringz (decay2 t 0.01 dy) (mce2 f (f * fh)) fy)-> ; o2 = mix (saw ar (mce2 f (f * fh))) }-> in return (pan2 (o1 + o2 * decay2 t 0.1 r2 * r3) p a) }-> in do { d <- rand 0.5 16-> ; ul <- rand 16 64-> ; fu <- rand 1200 9000-> ; dy <- rand 0.005 0.175-> ; la <- rand (-60) (-25)-> ; fy <- rand 0.015 0.125-> ; audition . (out 0) =<< trkl d ul fu dy la fy }
− Help/Graphs/tsort.lhs
@@ -1,21 +0,0 @@-tsort (jmcc)--This simple graph tests the topological sort of the unit generator-graph, it ought only to use a minimal number of interconnect buffers.--The below 369 node graph works with 'scsynth -u 57110 -w 2'. --(Note that graphs loaded from disk during startup will grow the number-of interconnect buffers, so to test this we must delete all graphs that-would otherwise be loaded.)--> import Sound.SC3--> let { n = 122-> ; c = envCoord [(0,0), (0.15, 1), (6, 0)] 1 1 EnvLin-> ; e = envGen kr 1 1 0 1 RemoveSynth c-> ; f o = sinOsc ar (440 + constant o) 0 * 0.001-> ; s = mixFill n f }-> in audition (out 0 (s * e))--http://create.ucsb.edu/pipermail/sc-users/2003-March/002807.html
− Help/Graphs/vlc-distrtn.lhs
@@ -1,132 +0,0 @@-vlc-distrtn (rd)-caution - audio feedback graph--> import Sound.OpenSoundControl-> import Sound.SC3-> import System.Random--> let { rrand l r = getStdRandom (randomR (l, r))-> ; choose l = return . (l !!) =<< rrand 0 (length l - 1)-> ; prep (ampl, phase) = [dbAmp ampl, phase]-> ; vlc = [ (0.00000, 1.85550)-> , (-9.92383, -0.65147)-> , (-8.74205, -0.74728)-> , (-3.70464, -1.39796)-> , (-9.43435, -1.14812)-> , (-25.84790, -1.03375)-> , (-16.99500, -2.41724)-> , (-29.17040, 2.67419)-> , (-26.82750, -1.61810)-> , (-18.59870, 1.34568)-> , (-19.72160, -2.85972)-> , (-29.43650, 0.54603)-> , (-23.63120, -1.47813)-> , (-28.20100, -1.98501)-> , (-41.20700, -1.11808)-> , (-33.14310, -2.19369)-> , (-31.54010, 1.43134)-> , (-47.62740, 1.28571)-> , (-28.79740, -1.03754)-> , (-34.97950, 0.37740)-> , (-39.05770, -0.57557)-> , (-38.84060, 2.34836)-> , (-40.18090, -0.96978)-> , (-47.32150, 2.14768)-> , (-45.49290, 2.52100)-> , (-40.57100, -1.39905)-> , (-47.19530, -2.23994)-> , (-50.80920, 2.97853)-> , (-48.13640, 0.46815)-> , (-58.56890, -1.01821)-> , (-57.81200, -3.08971)-> , (-47.96870, -0.48657)-> , (-43.96100, -0.10311)-> , (-50.49810, -2.80977)-> , (-50.61640, -0.17212)-> , (-60.64640, -1.02433)-> , (-58.03410, 1.06921)-> , (-55.46390, -2.04501)-> , (-54.31000, -1.53512)-> , (-52.78670, -1.49875)-> , (-57.99380, 0.17697)-> , (-56.76990, 2.28241)-> , (-54.17450, -1.85553)-> , (-62.58220, -2.40971)-> , (-59.86460, 1.04782)-> , (-61.58570, 1.56183)-> , (-52.62080, 1.68360)-> , (-49.82940, -1.11019)-> , (-56.18160, -0.78538)-> , (-57.73320, -2.23918)-> , (-49.87560, 3.09604)-> , (-51.00100, -0.53762)-> , (-59.71530, 0.99017)-> , (-65.73280, 2.43855)-> , (-73.01270, -0.90664)-> , (-61.81450, -0.53346)-> , (-65.58980, 1.51174)-> , (-75.94320, -3.06072)-> , (-65.22210, -1.49937)-> , (-70.79970, -2.96199)-> , (-64.72450, 1.78172)-> , (-73.24130, 0.26939)-> , (-66.17110, -0.23305)-> , (-61.32910, -3.12592)-> , (-66.98180, 0.64700)-> , (-65.23060, -2.94395)-> , (-70.13430, 1.29805)-> , (-68.43470, -1.35906)-> , (-71.33000, -2.71582)-> , (-86.90080, 2.11646)-> , (-74.97450, 2.76118)-> , (-68.02520, 0.94979)-> , (-67.32960, 3.05994)-> , (-67.32140, -2.79905)-> , (-68.22010, -2.33831) ]-> ; partial i freq detune fall n =-> do { n0 <- lfNoise1 kr 1-> ; n1 <- rand 0.75 1.25-> ; let { m = n * 2-> ; ampl = bufRdN 1 kr 0 m NoLoop-> ; f = freq * (n + 1) * (n0 * detune + 1) }-> in return (ringz i f (fall * n1) * ampl) }-> ; plyr n =-> let { ctl j k = Control kr j k-> ; buf = ctl "buf" 0-> ; iamp = ctl "iamp" 0.1-> ; ampl = ctl "ampl" 0.1-> ; freq = ctl "freq" 129.897-> ; fall = ctl "fall" 0.5-> ; loc = ctl "loc" 0.0-> ; detune = ctl "detune" 0.001-> ; i = soundIn 0 * iamp }-> in do { s <- mapM (partial i freq detune fall) [0 .. n-1]-> ; return (out 0 (clip2 (pan2 (sum s) loc ampl) 0.1)) }-> ; degree_to_key degree scale steps =-> let scale_n = length scale-> in (steps * (degree `div` scale_n)) + (scale !! (degree `mod` scale_n))-> ; getCps b =-> do { b_ <- choose b-> ; d <- choose [0 .. 8]-> ; let k = degree_to_key d [0, 2, 3, 5, 7, 8, 10] 12-> in return (midiCPS (b_ + realToFrac k)) }-> ; pattern fd =-> do { f <- getCps [24, 36, 48, 55, 60]-> ; ia <- rrand 0.05 0.75-> ; l <- rrand (-1) 1-> ; a <- rrand 0.05 0.1-> ; d <- rrand 0.001 0.005-> ; fl <- rrand 1 7-> ; send fd (n_set 1002 [("freq", f)-> ,("iamp", ia)-> ,("buf", 0)-> ,("loc", l)-> ,("ampl", a)-> ,("detune", d)-> ,("fall", fl)])-> ; pauseThread =<< choose [0.25, 0.5, 0.75, 1.5] } }-> in withSC3 (\fd -> do { async fd (b_alloc 0 (length vlc * 2) 1)-> ; send fd (b_setn1 0 0 (concatMap prep vlc))-> ; async fd . d_recv . synthdef "plyr48" =<< plyr 48-> ; send fd (s_new "plyr48" 1002 AddToTail 1 [])-> ; sequence (replicate 32 (pattern fd)) })
− Help/Graphs/what-was-i-thinking.lhs
@@ -1,33 +0,0 @@-what was i thinking? (jmcc)--> import Sound.SC3--> do { n0 <- lfNoise1 kr 0.2-> ; n1 <- lfNoise1 kr 0.157-> ; let { p = pulse ar f (n1 * 0.4 + 0.5) * 0.04-> ; i = lfPulse ar 0.1 0 0.05 * impulse ar 8 0 * 500-> ; d = decay i 2-> ; f = max (sinOsc kr 4 0 + 80) d-> ; z = rlpf p (n0 * 2000 + 2400) 0.2-> ; c x = do { r <- rand 0 0.3-> ; n <- lfNoise1 kr r-> ; return (combL x 0.06 (n * 0.025 + 0.035) 1) }-> ; y = z * 0.6 }-> in do { z0 <- clone 2 (c y)-> ; z1 <- clone 2 (c y)-> ; audition (out 0 (z + mce [mix z0, mix z1])) } }--{ var n0 = LFNoise1.kr(0.2, 2000, 2400)-; var n1 = LFNoise1.kr(0.157, 0.4, 0.5)-; var i = LFPulse.ar(0.1, 0, 0.05) * Impulse.ar(8, 0) * 500-; var d = Decay.ar(i, 2)-; var f = max(SinOsc.kr(4, 0) + 80, d)-; var p = Pulse.ar(f, n1) * 0.04-; var z = RLPF.ar(p, n0, 0.2)-; var c = { arg i- ; var r = Rand.new(0, 0.3)- ; var n = LFNoise1.kr(r, 0.025, 0.035)- ; CombL.ar(i, 0.06, n, 1) }-; var y = z * 0.6-; Out.ar(0, z + [ c.value(y) + c.value(y)- , c.value(y) + c.value(y) ]) }.play
− Help/Graphs/wial.lhs
@@ -1,21 +0,0 @@-wial (rd)--> import Sound.SC3--> let { pls c d f = let { t = pulseDivider c d 0-> ; e = decay2 t 0.05 0.75-> ; o = sinOsc ar (toggleFF t * f + f * 2) 0 }-> in do { n0 <- tiRand 0 1 t-> ; return (o * e * n0 * 0.5) }-> ; smpl f = [ (4, 6, f , 0.75)-> , (2, 6, f * 2, 0.75)-> , (1, 2, f * 16, 0.025)-> , (1, 5, f * 64, 0.005)-> , (1, 4, f * 128, 0.035)-> , (1, 3, f * 256, 0.15)-> , (2, 3, f * 512, 0.35) ]-> ; plss c (d0, d1, f, a) = fmap (* a) (pls c (mce2 d0 d1) f)-> ; clk = impulse ar 16 0 }-> in do { n0 <- dust kr 2-> ; f <- twChoose n0 (mce2 (20 * 0.66) 20) (mce2 0.25 0.75) 0-> ; audition . out 0 . sum =<< mapM (plss clk) (smpl f) }
− Help/Graphs/wind-metals.lhs
@@ -1,28 +0,0 @@-wind metals (jmcc)--> import Sound.SC3--> let n = 6-> in do { base <- expRand 60 4000-> ; range <- rand 500 8000-> ; n0 <- clone 2 (brownNoise ar)-> ; r0 <- expRand 0.125 0.5-> ; n1 <- lfNoise1 kr r0-> ; f <- sequence (replicate n (rand base (base + range)))-> ; dt <- sequence (replicate n (rand 0.1 2))-> ; let { exc = n0 * 0.007 * max 0 (n1 * 0.75 + 0.25)-> ; k = klankSpec f (replicate n 1) dt-> ; s = klank exc 1 0 1 k }-> in audition (out 0 (softClip (s * 0.1))) }--{ var n = 6-; var base = ExpRand.new(60, 4000)-; var range = Rand.new(500.0, 8000.0)-; var n0 = BrownNoise.ar([0.007, 0.007])-; var r0 = ExpRand.new(0.125, 0.5)-; var n1 = LFNoise1.kr(r0, 0.75, 0.25)-; var exc = n0 * max(0, n1)-; var f = Array.fill(n, { Rand.new(0, range) + base })-; var dt = Array.fill(n, { Rand.new(0.1, 2.0) })-; var s = Klank.ar(`[f, nil, dt], exc)-; Out.ar(0, (s * 0.1).softclip) }.play
− Help/Graphs/xy-interference.lhs
@@ -1,31 +0,0 @@-xy-interference (rd)--> import Sound.SC3--> let { x = mouseX kr 20 22000 Linear (mce2 0.005 0.025)-> ; y = mouseY kr 20 22000 Linear (mce2 0.005 0.075)-> ; nd = do { n <- lfNoise0 kr (mce2 5 9)-> ; let { a = sinOsc ar (x + n) 0-> ; b = sinOsc ar y 0 }-> in return (a * b) } }-> in audition . (out 0) . sum =<< sequence (replicate 3 nd)--the same graph, written using a non-monadic noise constructor--> import qualified Sound.SC3.UGen.Base as B--> let { x = mouseX kr 20 22000 Linear (mce2 0.005 0.025)-> ; y = mouseY kr 20 22000 Linear (mce2 0.005 0.075)-> ; nd k = let { n = B.lfNoise0 (uid k) kr (mce2 5 9)-> ; a = sinOsc ar (x + n) 0-> ; b = sinOsc ar y 0 }-> in a * b }-> in audition (out 0 (sum (map nd [1..3])))--{ var x = MouseX.kr(20, 22000, 'linear', [0.005, 0.025])-; var y = MouseY.kr(20, 22000, 'linear', [0.005, 0.075])-; var nd = { var n = LFNoise0.kr([5, 9])- ; var a = SinOsc.ar(x + n, 0)- ; var b = SinOsc.ar(y, 0)- ; a * b }-; Out.ar(0, Mix.fill(3, nd)) }.play
Help/Server/dumpOSC.help.lhs view
@@ -1,13 +1,13 @@ /dumpOSC Display incoming OSC messages -int - code+PrintLevel (int) - code Turns on and off printing of the contents of incoming Open Sound Control messages. This is useful when debugging your command stream. The values for the code are as follows: -0 - turn dumping OFF.-1 - print the parsed contents of the message.-2 - print the contents in hexadecimal.-3 - print both the parsed and hexadecimal representations of the contents.+NoPrinter (0) - turn dumping OFF.+TextPrinter (1) - print the parsed contents of the message.+HexPrinter (2) - print the contents in hexadecimal.+AllPrinter (3) - print both the parsed and hexadecimal representations of the contents.
Help/Server/s_newargs.help.lhs view
@@ -16,8 +16,10 @@ graphs generated by hsc3 since, as a rule, it is not possible to fix the ordering of control variables. +> import Sound.SC3+ > let { ks n is = let { js = (Nothing : map Just [1..])-> ; f (i,j) = Control KR (maybe n ((n ++) . show) j) i }+> ; f (i,j) = control KR (maybe n ((n ++) . show) j) i } > in mce (reverse (map f (zip is js))) > ; f = ks "f" [1,2,3,4] > ; g = out 0 (mix (sinOsc AR f 0 * 0.1))
− Help/Tutorial/Tutorial.lhs
@@ -1,244 +0,0 @@-* Haskell SuperCollider, a Tutorial.--* Prerequisites--Haskell SuperCollider requires that SuperCollider [1], GHC [2], the-GHC binary package[3], Emacs [4] and the standard Haskell Emacs mode-[5] are all installed and working properly.--* Setting up Haskell SuperCollider--Haskell SuperCollider is available through the haskell community-library system Hackage [6]. To install type:-- $ cabal install hsc3--Haskell SuperCollider is also available as a set of darcs [7]-repositories, the first implementing the Sound.OpenSoundControl-module, the second the Sound.SC3 module.-- $ darcs get http://slavepianos.org/rd/sw/hosc- $ darcs get http://slavepianos.org/rd/sw/hsc3--To build use the standard Cabal process in each repository in-sequence. To install to the user package database type:-- $ runhaskell Setup.lhs configure --prefix ~- $ runhaskell Setup.lhs build- $ runhaskell Setup.lhs install --user--* Setting up the Haskell SuperCollider Emacs mode--Add an appropriately modified variant of the following to ~/.emacs-- (push "~/sw/hsc3/emacs" load-path)- (setq hsc3-help-directory "~/sw/hsc3/Help/")- (require 'hsc3)--The hsc3 emacs mode associates itself with files having the extension-'.lhs'. When the hsc3 emacs mode is active there is a 'Haskell-SuperCollider' menu available.--* Literate Haskell--The documentation for Haskell SuperCollider, including this tutorial,-is written in 'Bird' notation, a form of 'literate Haskell' where-lines starting with '>' are Haskell code and everything else is-commentary.--Unlike ordinary literate programs the Haskell SuperCollider help files-cannot be compiled to executables. Each help file contains multiple-independant examples that can be evaluated using editor commands,-either by selecting from the 'Haskell SuperCollider' menu or using the-associated keybinding.--* Interpreter Interaction & User Configuration--To start ghci and load the file at 'hsc3-run-control' file use C-cC-s-(Haskell SuperCollider -> Haskell -> Start haskell). --If there is no file at 'hsc3-run-control' one will be created and the-modules at 'hsc3-modules' will be imported. By default this list-contains the hosc and hsc3 modules as well as Control.Concurrent,-Control.Monad, Data.List, and System.Random.--Starting the interpreter splits the current window into two windows. If-the ghci output window becomes obscured during a session you can see-it again by typing C-cC-g (Haskell SuperCollider -> Haskell -> See-output).--To interrupt ghci type C-cC-i (Haskell SuperCollider -> Haskell ->-Interrupt haskell).--To stop ghci type C-cC-x (Haskell SuperCollider -> Haskell -> Quit-haskell).--* Starting the SuperCollider server--The SuperCollider server can be started from the command line. The-help files assume that scsynth is listening for UDP connections at the-standard port on the local machine.-- $ scsynth -u 57110--* Basic SuperCollider Interaction--The SuperCollider server manages a graph of nodes with integer-identifiers. The root node has ID zero. By convention ordinary graph-nodes are placed in a group with identifier 1, however this node is-not created when scsynth starts.--To create this node we need to send an OSC message to the server, the-expression to do this is written below. To run single line-expressions move the cursor to the line and type C-cC-c (Haskell-SuperCollider -> Expression -> Run line).--> withSC3 (\fd -> send fd (g_new [(1, AddToTail, 0)]))--We can then audition a quiet sine oscillator at A440.--> audition (out 0 (sinOsc AR 440 0 * 0.1))--To stop the sound we can delete the group it is a part of, the-audition function places the synthesis node into the group node with-ID 1, the expression below deletes that group.--> withSC3 (\fd -> send fd (n_free [1]))--In order to audition another graph we need to re-create a group with-ID 1. Sound.SC3 includes a function 'reset' that sequences these two-actions, first deleting the group node, then re-creating a new empty-group.--> withSC3 reset--Using this command is so common there is a keybinding for it, C-cC-k-(Haskell SuperCollider -> SCSynth -> Reset scsynth). After a reset we-can audition a new graph.--> audition (out 0 (sinOsc AR 220 0 * 0.1))--To see the server status type C-cC-w (Haskell SuperCollider -> SCSynth--> Display status). This prints a table indicating server activity to-the ghci output window.-- ***** SuperCollider Server Status *****- # UGens Int 3- # Synths Int 1- # Groups Int 2- # Instruments Int 1- % CPU (Average) Float 2.6957032680511475- % CPU (Peak) Float 2.7786526679992676- Sample Rate (Nominal) Double 44100.0- Sample Rate (Actual) Double 44099.958404246536--* Multiple line expressions--There are two variants for expressions that are written over multiple-lines.--To evaluate an expression that is written without using the Haskell-layout rules select the region and type C-cC-e (Haskell SuperCollider--> Expression -> Run multiple lines). To select a region use the-mouse or place the cursor at one end, type C-[Space] then move the-cursor to the other end.--> let { f0 = xLine KR 1 1000 9 RemoveSynth-> ; f1 = sinOsc AR f0 0 * 200 + 800 }-> in audition (out 0 (sinOsc AR f1 0 * 0.1))--To evaluate a multiple line expression written using the layout rules-as applicable within a do block, select the region and type C-cC-r-(Haskell SuperCollider -> Expression -> Run region).--> let f0 = xLine KR 1 1000 9 RemoveSynth-> f1 = sinOsc AR f0 0 * 200 + 800-> audition (out 0 (sinOsc AR f1 0 * 0.1))--This writes the region in a do block in a procedure to a temporary-file, /tmp/hsc3.lhs, loads the file and then runs the procedure. The-preamble imports the modules listed at the emacs variable-hsc3-modules.--ghci understands import expressions, so to add a module to-the current scope it is enough to type C-cC-c at an appropriate-location. If hsc3-dot is installed, the following two -expressions will load the module and make a drawing.--> import Sound.SC3.UGen.Dot--> let { o = control KR "bus" 0-> ; f = mouseX KR 440 880 Exponential 0.1 }-> in draw (out o (sinOsc AR f 0))--* Help Files--To find help on a unit generator or on a SuperCollider server command-place the cursor over the identifier and type C-cC-h (Haskell-SuperCollider -> Help -> Haskell SuperCollider help). This opens the-help file, which ought to have working examples in it, the above graph-is in the sinOsc help file, the s_new help file explains what-arguments are required and what they mean.--The Haskell SuperCollider help files are derived from the help files-distributed with SuperCollider, the text is re-formatted to read well-as plain text and examples are translated into Haskell.--There is also partial haddock documentation for the Sound.SC3 and-Sound.OpenSoundControl modules, to build type:-- $ runhaskell Setup.lhs haddock--* Identifier lookup & hasktags--The emacs command M-. (find-tag) looks up an identifier in-a 'tags' table. The hasktags utility can generate tags files-from haskell source files that are usable with emacs.--To generate a tags file for hsc3, visit the hsc3 directory-and type:-- $ find Sound -name '*.*hs' | xargs hasktags -e--To use the hsc3 tags table type `M-x visit-tags-table', or add-an entry to ~/.emacs:-- (setq tags-table-list '("~/sw/hsc3"))--* External Unit Generators--hsc3 includes bindings and help files for some unit generators-not in the standard supercollider distribution. In order to-use these unit generators they must be installed, see:-- http://sf.net/projects/sc3-plugins/--* Example Unit Generator Graphs--The Help/ directory contains example unit generator graphs. The-graphs are self contained, selecting the graph and typing C-cC-e will-audition it. In many cases both supercollider language and haskell-versions are given, switch the emacs buffer to sclang-mode to run the-supercollider language versions.--* Monitoring incoming server messages--To monitor what OSC messages scsynth is receiving use the 'dumpOSC'-server command to request that scsynth print text traces of incoming-messages to its standard output.--> withSC3 ((flip send) (dumpOSC TextPrinter))--To end printing send:--> withSC3 ((flip send) (dumpOSC NoPrinter))--* References--[1] http://audiosynth.com/-[2] http://haskell.org/ghc/-[3] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/binary-0.3-[4] http://gnu.org/software/emacs/-[5] http://haskell.org/haskell-mode/-[6] http://hackage.haskell.org/-[7] http://darcs.net/
− Help/Tutorial/Waveset.hs
@@ -1,170 +0,0 @@-{- A simple waveset synthesiser (rd) -}--import Control.Monad-import Data.Array-import qualified Data.Array.Storable as A-import Data.List-import qualified Sound.File.Sndfile as F-import Sound.OpenSoundControl-import Sound.SC3-import System.Environment-import System.Random---- * Sound file utilities.---- | file-name -> (channel-count, frame-count, sample-rate)-sf_info :: String -> IO (Int, Integer, Double)-sf_info fn = do h <- F.openFile fn F.ReadMode F.defaultInfo- let i = F.hInfo h- nc = F.channels i- nf = F.frames i- sr = F.samplerate i- F.hClose h- return (nc, fromIntegral nf, fromIntegral sr)---- | channel-count -> channel -> interleaved-data -> channel-data-extract_channel :: Int -> Int -> [a] -> [a]-extract_channel _ _ [] = []-extract_channel nc n xs = (xs !! n) : extract_channel nc n (drop nc xs)---- | file-name -> channel -> data-sf_channel :: String -> Int -> IO [Double]-sf_channel fn n = - do h <- F.openFile fn F.ReadMode F.defaultInfo- let i = F.hInfo h- nc = F.channels i- nf = F.frames i- ns = nc * nf- b <- A.newArray_ (0, ns) :: IO (A.StorableArray F.Index Double)- F.hGetSamples h b ns- e <- A.getElems b- return (extract_channel nc n e)---- * Score model.---- | Interval to schedule in advance.-latency :: Double-latency = 0.15---- | Add t to timestamp.-offset :: Double -> OSC -> OSC-offset t (Bundle (UTCr t0) m) = Bundle (UTCr (t + t0)) m-offset _ _ = undefined---- | Play non-empty set of osc bundles.-play_set :: Transport t => t -> [OSC] -> IO ()-play_set _ [] = undefined-play_set fd (x:xs) = do let (Bundle (UTCr t) _) = x- pauseThreadUntil (t - latency)- mapM_ (\e -> send fd e) (x:xs)---- | Play grouped score.-play_sets :: Transport t => t -> [[OSC]] -> IO ()-play_sets _ [] = return ()-play_sets fd s = do t <- utcr- mapM_ (play_set fd) (map (\g -> map (offset t) g) s)---- | Split l into chunks of at most n elements.-form_sets :: Int -> [a] -> [[a]]-form_sets _ [] = []-form_sets n l = let (a,b) = splitAt n l in a : form_sets n b ---- | Play score, send in sets on indicated cardinality.-play_score :: Transport t => Int -> t -> [OSC] -> IO ()-play_score n fd s = play_sets fd (form_sets n s)---- * Waveset analysis---- | Zero-crossing predicate.-is_zc :: (Num a, Ord a) => a -> a -> Bool-is_zc a b = a <= 0 && b > 0 ---- | Locate fractional zero-crossing point.-locate_fzc :: (Ord a, Fractional a) => a -> a -> a-locate_fzc x y = (1.0 / (y - x)) * abs x---- | Fractional zero-crossing constructor, n is the initial frame location.-fzc :: (Ord a, Fractional a) => a -> [a] -> [a]-fzc _ [] = []-fzc _ [_] = []-fzc n (x:y:z) = if is_zc x y - then (n + locate_fzc x y) : fzc (n + 2.0) z - else fzc (n + 1.0) (y : z)---- | Remove zero crossings so that no waveset has length less than m.-prune :: (Ord a, Num a) => a -> a -> [a] -> [a]-prune _ _ [] = [] -- hmmm....-prune m n (x:xs) = if (x - n) < m then prune m n xs else x : prune m x xs---- | zc -> ws-ws :: [a] -> [(a,a)]-ws [] = []-ws [_] = []-ws (x:y:z) = (x,y) : ws (y : z)---- * Waveset instrument---- | A trivial waveset instrument with unit envelope.-waveset :: UGen-waveset = offsetOut o (bufRdL 1 AR b ph Loop * e_ugen)- where k = Control KR- o = k "out" 0- b = k "bufnum" 0- s = k "start" 0- e = k "end" 0- r = k "rate" 1- d = k "dur" 1- a = k "amp" 0.2- rs = bufRateScale KR b * r- ph = phasor AR 0 rs 0 (e - s) 0 + s- e_data = env [a, a, 0] [d, 0] [EnvLin] (-1) (-1)- e_ugen = envGen AR 1 1 0 1 RemoveSynth e_data---- * Waveset synthesizer---- | Construct s_new message for synthesiser.-mk_msg :: Double -> Double -> Double -> Double -> OSC-mk_msg b sf ef d = s_new "waveset" (-1) AddToTail 1 a- where a = [("bufnum", b), ("start", sf), ("end", ef), ("dur", d)]---- | Compare wavesets by duration.-dur_ord :: (Num t, Ord t) => (t, t) -> (t, t) -> Ordering-dur_ord (s0, e0) (s1, e1) = compare (e0 - s0) (e1 - s1)---- | Generate score from waveset data.-mk_score :: Double -> [Double] -> [(Double, Double)] -> [OSC]-mk_score sr repeats w = zipWith3 mk_elem w start_times durations- where durations = zipWith (\(s, e) r -> (e - s) * r / sr) w repeats- start_times = scanl (+) 0 durations- mk_elem (s,e) t d = Bundle (UTCr t) [mk_msg 10 s e d]---- | n randomly chosen elements of w.-mk_randomness :: Int -> [a] -> [a]-mk_randomness n w = take n (map (a !) (randomRs (l,r) (mkStdGen 1)))- where (l, r) = (1, length w)- a = listArray (l,r) w---- | Load waveset instrument, allocate sound file buffer, do waveset--- analysis, generate & play scores.-run_waveset :: Transport t => t -> String -> IO ()-run_waveset fd fn = - do async fd (d_recv (synthdef "waveset" waveset))- async fd (b_allocRead 10 fn 0 0)- (nc, nf, sr) <- sf_info fn - b <- sf_channel fn 0- let w = ws (prune 64 0 (fzc 0 b))- pl s = play_score 10 fd s >> pauseThread 1- putStrLn ("#f: " ++ show (nc, nf, sr))- putStrLn ("#w: " ++ show (length w)) -- force w- pl (mk_score sr (repeat 1) w)- pl (mk_score sr (repeat 2) (reverse w))- pl (mk_score sr (cycle [2,4,8]) (sortBy dur_ord w))- pl (mk_score sr (randomRs (1,24) (mkStdGen 2)) (mk_randomness 512 w))--main :: IO ()-main = do (fn:_) <- getArgs- withSC3 (\fd -> run_waveset fd fn)--{---withSC3 (\fd -> run_waveset fd "/home/rohan/audio/text.snd")---}
− Help/Tutorial/non-real-time.hs
@@ -1,23 +0,0 @@-import Sound.OpenSoundControl-import Sound.SC3-import System.Cmd--graph :: UGen-graph = out 0 (pan2 o 0 g)- where f = control KR "freq" 440- g = control KR "gain" 0.1- e = envGen KR 1 1 0 1 RemoveSynth (envPerc 0.1 1.0)- o = sinOsc AR f 0 * e--score :: [OSC]-score = at 0.0 [mk_instr, mk_group] : notes- where at t m = Bundle (NTPr t) m- mk_instr = d_recv (synthdef "test" graph)- mk_group = g_new [(1, AddToTail, 0)]- mk_node t f = at t [s_new "test" (-1) AddToTail 1 [("freq", f)]]- notes = take 128 (zipWith mk_node [0.0, 0.05 ..] [330, 350 ..])--main :: IO ()-main = do writeNRT "/tmp/nrt.score" score- system "scsynth -N /tmp/nrt.score _ /tmp/nrt.wav 44100 WAVE float"- return ()
Help/UGen/Buffer/bufAllpassC.help.lhs view
@@ -18,6 +18,8 @@ negative, thus emphasizing only odd harmonics at an octave lower. +> import Sound.SC3.Monadic+ > withSC3 (\fd -> async fd (b_alloc 0 44100 1)) > do { d <- dust AR 1
Help/UGen/Buffer/bufCombC.help.lhs view
@@ -16,6 +16,8 @@ negative, thus emphasizing only odd harmonics at an octave lower. +> import Sound.SC3.Monadic+ > withSC3 (\fd -> async fd (b_alloc 0 44100 1)) > do { d <- dust AR 1
Help/UGen/Buffer/bufDelayC.help.lhs view
@@ -14,6 +14,8 @@ in - the input signal. delaytime - delay time in seconds. +> import Sound.SC3.Monadic+ > withSC3 (\fd -> async fd (b_alloc 0 44100 1)) > do { d <- dust AR 1
Help/UGen/Buffer/bufDur.help.lhs view
@@ -2,7 +2,10 @@ Current duration of buffer (in seconds). -> withSC3 (\fd -> async fd (b_allocRead 0 "/home/rohan/audio/metal.wav" 0 0))+> import Sound.SC3++> let fn = "/home/rohan/audio/metal.wav"+> in withSC3 (\fd -> async fd (b_allocRead 0 fn 0 0)) > let { t = impulse AR (recip (bufDur KR 0)) 0 > ; p = sweep t (bufSampleRate KR 0) }
Help/UGen/Buffer/bufFrames.help.lhs view
@@ -2,7 +2,10 @@ Current duration of buffer. -> withSC3 (\fd -> async fd (b_allocRead 0 "/home/rohan/audio/metal.wav" 0 0))+> import Sound.SC3++> let fn = "/home/rohan/audio/metal.wav"+> in withSC3 (\fd -> async fd (b_allocRead 0 fn 0 0)) > let p = phasor AR 0 (bufRateScale KR 0) 0 (bufFrames KR 0) 0 > in audition (out 0 (bufRdL 1 AR 0 p NoLoop))
Help/UGen/Buffer/bufRateScale.help.lhs view
@@ -3,7 +3,10 @@ Buffer rate scaling in respect to server samplerate. Returns a ratio by which the playback of a soundfile is to be scaled. -> withSC3 (\fd -> async fd (b_allocRead 0 "/home/rohan/audio/metal.wav" 0 0))+> import Sound.SC3.Monadic++> let fn = "/home/rohan/audio/metal.wav"+> in withSC3 (\fd -> async fd (b_allocRead 0 fn 0 0)) > let { r = 1.25 * bufRateScale KR 0 > ; p = phasor AR 0 r 0 (bufFrames KR 0) 0 }
Help/UGen/Buffer/bufRd.help.lhs view
@@ -10,14 +10,19 @@ The interpolation value should be either NoInterpolation, LinearInterpolation, CubicInterpolation or (Interpolation UGen). -> withSC3 (\fd -> send fd (b_allocRead 0 "/home/rohan/audio/metal.wav" 0 0))+> import Sound.SC3 +> let fn = "/home/rohan/audio/metal.wav"+> in withSC3 (\fd -> send fd (b_allocRead 0 fn 0 0))+ > let phase = (sinOsc AR 0.1 0 * bufFrames KR 0) > in audition (out 0 (bufRd 1 AR 0 phase Loop NoInterpolation)) There are constructors, bufRdN, bufRdL, and bufRdC for the fixed cases. -> let x = mouseX KR (mce [5, 10]) 100 Linear 0.1-> in do { n <- lfNoise1 AR x-> ; audition (out 0 (bufRdL 1 AR 0 (n * bufFrames KR 0) Loop)) }+> import Sound.SC3.ID++> let { x = mouseX KR (mce [5, 10]) 100 Linear 0.1+> ; n = lfNoise1 'a' AR x }+> in audition (out 0 (bufRdL 1 AR 0 (n * bufFrames KR 0) Loop))
Help/UGen/Buffer/bufSampleRate.help.lhs view
@@ -2,7 +2,10 @@ Buffer sample rate. -> withSC3 (\fd -> async fd (b_allocRead 0 "/home/rohan/audio/metal.wav" 0 0))+> import Sound.SC3++> let fn = "/home/rohan/audio/metal.wav"+> in withSC3 (\fd -> async fd (b_allocRead 0 fn 0 0)) Compare a sine tone derived from sample rate of a buffer with a 440Hz tone.
Help/UGen/Buffer/index.help.lhs view
@@ -6,6 +6,8 @@ Allocate and set values at buffer 10. +> import Sound.SC3+ > withSC3 (\fd -> do { async fd (b_alloc 10 6 1) > ; send fd (b_setn 10 [(0, [50, 100, 200, 400, 800, 1600])]) })
Help/UGen/Buffer/indexInBetween.help.lhs view
@@ -4,6 +4,8 @@ Allocate and set values at buffer 10. +> import Sound.SC3+ > withSC3 (\fd -> do { async fd (b_alloc 10 6 1) > ; send fd (b_setn 10 [(0, [200, 210, 400, 430, 600, 800])]) })
Help/UGen/Buffer/osc.help.lhs view
@@ -15,6 +15,8 @@ Note about wavetables: OscN requires the b_gen sine1 wavetable flag to be OFF. Osc requires the b_gen sine1 wavetable flag to be ON. +> import Sound.SC3+ > withSC3 (\fd -> do { async fd (b_alloc 10 512 1) > ; send fd (b_gen 10 "sine1" [1 + 2 + 4, 1, 1/2, 1/3, 1/4, 1/5]) }) @@ -39,5 +41,8 @@ > audition (out 0 (osc AR 10 220 0 * 0.1)) +> import System.Random+ > do { r <- getStdRandom (randomR (0.0,1.0))-> ; withSC3 (\fd -> send fd (b_gen 10 "sine1" [1 + 2 + 4, 1, r, 1/4])) }+> ; let g = b_gen 10 "sine1" [1 + 2 + 4, 1, r, 1/4]+> in withSC3 (\fd -> send fd g) }
Help/UGen/Buffer/playBuf.help.lhs view
@@ -36,22 +36,26 @@ Play once only. -> audition (out 0 (playBuf 1 10 (bufRateScale KR 10) 1 0 NoLoop RemoveSynth))+> let s = bufRateScale KR 10+> in audition (out 0 (playBuf 1 10 s 1 0 NoLoop RemoveSynth)) Play in infinite loop. -> audition (out 0 (playBuf 1 10 (bufRateScale KR 10) 1 0 Loop DoNothing))+> let s = bufRateScale KR 10+> in audition (out 0 (playBuf 1 10 s 1 0 Loop DoNothing)) Trigger playback at each pulse. -> let t = impulse KR 2 0-> in audition (out 0 (playBuf 1 10 (bufRateScale KR 10) t 0 NoLoop DoNothing))+> let { t = impulse KR 2 0+> ; s = bufRateScale KR 10 }+> in audition (out 0 (playBuf 1 10 s t 0 NoLoop DoNothing)) Trigger playback at each pulse (diminishing intervals). > let { f = xLine KR 0.1 100 10 RemoveSynth-> ; t = impulse KR f 0 }-> in audition (out 0 (playBuf 1 10 (bufRateScale KR 10) t 0 NoLoop DoNothing))+> ; t = impulse KR f 0 +> ; s = bufRateScale KR 10 }+> in audition (out 0 (playBuf 1 10 s t 0 NoLoop DoNothing)) Loop playback, accelerating pitch. @@ -61,8 +65,9 @@ Sine wave control of playback rate, negative rate plays backwards. > let { f = xLine KR 0.2 8 30 RemoveSynth-> ; r = fSinOsc KR f 0 * 3 + 0.6 }-> in audition (out 0 (playBuf 1 10 (bufRateScale KR 10 * r) 1 0 Loop DoNothing))+> ; r = fSinOsc KR f 0 * 3 + 0.6+> ; s = bufRateScale KR 10 * r }+> in audition (out 0 (playBuf 1 10 s 1 0 Loop DoNothing)) Release buffer.
Help/UGen/Buffer/recordBuf.help.lhs view
@@ -1,1 +1,1 @@-recordBuf bufnum offset reclevel prelevel run loop trigger inputs+recordBuf bufnum offset reclevel prelevel run loop trigger doneAction inputs
Help/UGen/Chaos/crackle.help.lhs view
@@ -6,6 +6,8 @@ The equation implemented is: y0 = fabs(y1 * param - y2 - 0.05f) +> import Sound.SC3+ > audition (out 0 (crackle AR 1.95 * 0.2)) Modulate chaos parameter
Help/UGen/Chaos/cuspL.help.lhs view
@@ -12,8 +12,10 @@ Vary frequency +> import Sound.SC3+ > let x = mouseX KR 20 sampleRate Linear 0.1-> audition (out 0 (cuspL AR x 1.0 1.99 0 * 0.3))+> in audition (out 0 (cuspL AR x 1.0 1.99 0 * 0.3)) Mouse-controlled parameters.
Help/UGen/Chaos/fbSineC.help.lhs view
@@ -24,17 +24,22 @@ sclang default values -> audition (out 0 (fbSineC AR (sampleRate / 4) 1 0.1 1.1 0.5 0.1 0.1 * 0.2))+> import Sound.SC3 +> let o = fbSineC AR (sampleRate / 4) 1 0.1 1.1 0.5 0.1 0.1 * 0.2+> in audition (out 0 o)+ Increase feedback -> let fb = line KR 0.01 4 10 DoNothing-> in audition (out 0 (fbSineC AR sampleRate 1 fb 1.1 0.5 0.1 0.1 * 0.2))+> let { fb = line KR 0.01 4 10 DoNothing+> ; o = fbSineC AR sampleRate 1 fb 1.1 0.5 0.1 0.1 * 0.2 }+> in audition (out 0 o) Increase phase multiplier -> let a = line KR 1 2 10 DoNothing-> in audition (out 0 (fbSineC AR sampleRate 1 0 a 0.5 0.1 0.1 * 0.2))+> let { a = line KR 1 2 10 DoNothing+> ; o = fbSineC AR sampleRate 1 0 a 0.5 0.1 0.1 * 0.2 }+> in audition (out 0 o) Randomly modulate parameters
Help/UGen/Chaos/henonN.help.lhs view
@@ -18,6 +18,8 @@ With default initial parameters. +> import Sound.SC3+ > let x = mouseX KR 20 sampleRate Linear 0.1 > in audition (out 0 (henonN AR x 1.4 0.3 0 0 * 0.1)) @@ -27,7 +29,9 @@ > ; y = mouseY KR 0 0.3 Linear 0.1 } > in audition (out 0 (henonN AR (sampleRate / 4) x y 0 0 * 0.1)) -With randomly modulate parameters.+With randomly modulated parameters.++> import Sound.SC3.Monadic > do { n0 <- return . (+ 1.20) . (* 0.20) =<< lfNoise2 KR 1 > ; n1 <- return . (+ 0.15) . (* 0.15) =<< lfNoise2 KR 1
Help/UGen/Chaos/latoocarfianC.help.lhs view
@@ -22,15 +22,21 @@ sclang default initial parameters. +> import Sound.SC3+ > let x = mouseX KR 20 sampleRate Linear 0.1 > in audition (out 0 (latoocarfianC AR x 1 3 0.5 0.5 0.5 0.5 * 0.2)) Randomly modulate all parameters. -> do { [n0, n1, n2, n3] <- replicateM 4 (lfNoise2 KR 2)+> import Control.Monad+> import Sound.SC3.Monadic++> do { [n0, n1, n2, n3] <- replicateM 4 (lfNoise2 KR 5) > ; let { f = sampleRate / 4 > ; a = n0 * 1.5 + 1.5 > ; b = n1 * 1.5 + 1.5 > ; c = n2 * 0.5 + 1.5-> ; d = n3 * 0.5 + 1.5 }-> in audition (out 0 (latoocarfianC AR f a b c d 0.5 0.5 * 0.2)) }+> ; d = n3 * 0.5 + 1.5 +> ; o = latoocarfianC AR f a b c d 0.5 0.5 * 0.2 }+> in audition (out 0 o) }
Help/UGen/Chaos/linCongC.help.lhs view
@@ -20,10 +20,14 @@ Default initial parameters. +> import Sound.SC3+ > let x = mouseX KR 20 sampleRate Linear 0.1 > in audition (out 0 (linCongC AR x 1.1 0.13 1 0 * 0.2)) Randomly modulate parameters.++> import Sound.SC3.Monadic > do { [n0, n1, n2, m] <- mapM (lfNoise2 KR) [1.0, 0.1, 0.1, 0.1] > ; let { f = n0 * 1e4 + 1e4
Help/UGen/Chaos/logistic.help.lhs view
@@ -4,4 +4,6 @@ Implements the equation: y1 = param * y1 * (1.0 - y1) +> import Sound.SC3+ > audition (out 0 (logistic AR 3.5699457 1000.0 0.01))
Help/UGen/Chaos/lorenzL.help.lhs view
@@ -21,17 +21,22 @@ Vary frequency +> import Sound.SC3+ > let x = mouseX KR 20 sampleRate Linear 0.1 > in audition (out 0 (lorenzL AR x 10 27 2.667 0.05 0.1 0 0 * 0.3)) Randomly modulate params +> import Sound.SC3.Monadic+ > let { madd a m = return . (+ a) . (* m) > ; n = lfNoise0 KR 1 } > in do { n0 <- madd 10 2 =<< n > ; n1 <- madd 38 20 =<< n > ; n2 <- madd 2 1.5 =<< n-> ; audition (out 0 (lorenzL AR sampleRate n0 n1 n2 0.05 0.1 0 0 * 0.2)) }+> ; let o = lorenzL AR sampleRate n0 n1 n2 0.05 0.1 0 0 * 0.2+> in audition (out 0 o) } As frequency control
Help/UGen/Chaos/quadN.help.lhs view
@@ -10,6 +10,8 @@ interpolating sound generators based on the difference equation: xn+1 = axn2 + bxn + c +> import Sound.SC3+ > audition (out 0 (quadC AR 4000 1 (-1) (-0.75) 0 * 0.2)) > let x = mouseX KR 3.5441 4 Linear 0.1
Help/UGen/Chaos/rossler.help.lhs view
@@ -4,4 +4,6 @@ chaosParam can be varied from 1.0 to 25.0 with a dt of 0.04. Valid ranges for chaosParam vary depending on dt. +> import Sound.SC3+ > audition (out 0 (rossler AR 4 0.08))
Help/UGen/Control/mrg2.help.lhs view
@@ -2,6 +2,8 @@ mrg2 defines a node indicating a multiple root graph. +> import Sound.SC3+ > let { l = out 0 (sinOsc AR 300 0 * 0.1) > ; r = out 1 (sinOsc AR 900 0 * 0.1) } > in audition (mrg2 l r)
Help/UGen/Demand/dbrown.help.lhs view
@@ -12,6 +12,8 @@ Dibrown returns integer values. The arguments can be a number or any other ugen. +> import Sound.SC3.Monadic+ > do { n <- dbrown dinf 0 15 1 > ; let { x = mouseX KR 1 40 Exponential 0.1 > ; t = impulse KR x 0
Help/UGen/Demand/dbufrd.help.lhs view
@@ -6,7 +6,7 @@ phase - index into the buffer (demand ugen or any other ugen) loop - loop when phase exceeds number of frames in buffer -> import Sound.SC3+> import Sound.SC3.Monadic > import System.Random > let n = randomRs (200.0, 500.0) (mkStdGen 0)
Help/UGen/Demand/dbufwr.help.lhs view
@@ -9,6 +9,8 @@ loop - when phase exceeds number of frames in buffer, loops when set to 1 (default :1) +> import Sound.SC3.Monadic+ > do { s1 <- dseries 30 0 3 > ; s2 <- dseries 30 0 1 > ; s3 <- dseries 16 1 1
Help/UGen/Demand/demand.help.lhs view
@@ -14,6 +14,8 @@ reset - Resets the list of ugens when triggered. +> import Sound.SC3.Monadic+ > do { r <- dust KR 1 > ; s <- dgeom dinf (midiCPS 72) (midiRatio 1) > ; let { t = impulse KR 10 0
Help/UGen/Demand/demandEnvGen.help.lhs view
@@ -25,6 +25,8 @@ Frequency ramp, exponential curve. +> import Sound.SC3.Monadic+ > do { l <- dseq dinf (mce2 440 9600) > ; let { y = mouseY KR 0.01 3 Exponential 0.1 > ; f = demandEnvGen AR l y 2 0 1 1 1 0 1 DoNothing }
Help/UGen/Demand/dgeom.help.lhs view
@@ -8,6 +8,8 @@ The arguments can be a number or any other ugen +> import Sound.SC3.Monadic+ > do { n <- dgeom 15 1 1.2 > ; let { x = mouseX KR 1 40 Exponential 0.1 > ; t = impulse KR x 0
Help/UGen/Demand/drand.help.lhs view
@@ -9,6 +9,8 @@ Dxrand never plays the same value twice, whereas Drand chooses any value in the list. +> import Sound.SC3.Monadic+ > do { n <- drand dinf (mce [1, 3, 2, 7, 8]) > ; let { x = mouseX KR 1 400 Exponential 0.1 > ; t = impulse KR x 0
Help/UGen/Demand/dseq.help.lhs view
@@ -5,6 +5,8 @@ array - array of values or other ugens length - number of repeats +> import Sound.SC3.Monadic+ > do { n <- dseq 3 (mce [1, 3, 2, 7, 8]) > ; let { x = mouseX KR 1 40 Exponential 0.1 > ; t = impulse KR x 0
Help/UGen/Demand/dser.help.lhs view
@@ -5,6 +5,8 @@ array - array of values or other ugens length - number of values to return +> import Sound.SC3.Monadic+ > do { a <- dser 7 (mce [1, 3, 2, 7, 8]) > ; let { x = mouseX KR 1 40 Exponential 0.1 > ; t = impulse KR x 0
Help/UGen/Demand/dseries.help.lhs view
@@ -8,6 +8,8 @@ The arguments can be a number or any other ugen +> import Sound.SC3.Monadic+ > do { n <- dseries 15 0 1 > ; let { x = mouseX KR 1 40 Exponential 0.1 > ; t = impulse KR x 0
Help/UGen/Demand/dstutter.help.lhs view
@@ -5,6 +5,8 @@ n - number of repeats (can be a demand ugen) in - input ugen +> import Sound.SC3.Monadic+ > do { inp <- dseq dinf (mce [1, 2, 3]) > ; nse <- diwhite dinf 2 8 > ; rep <- dstutter nse inp
Help/UGen/Demand/dswitch.help.lhs view
@@ -8,6 +8,8 @@ In difference to dswitch1, dswitch embeds all items of an input demand ugen first before looking up the next index. +> import Sound.SC3.Monadic+ > do { a0 <- dwhite 2 3 4 > ; a1 <- dwhite 2 0 1 > ; a2 <- dseq 2 (mce [1, 1, 1, 0])
Help/UGen/Demand/dswitch1.help.lhs view
@@ -5,6 +5,8 @@ index - which of the inputs to return array - array of values or other ugens +> import Sound.SC3.Monadic+ > let { x = mouseX KR 0 4 Linear 0.1 > ; y = mouseY KR 1 15 Linear 0.1 > ; t = impulse KR 3 0 }
Help/UGen/Demand/duty.help.lhs view
@@ -20,6 +20,8 @@ level - demand ugen providing the output values. +> import Sound.SC3.Monadic+ > do { n0 <- drand dinf (mce [0.01, 0.2, 0.4]) > ; n1 <- dseq dinf (mce [204, 400, 201, 502, 300, 200]) > ; let f = duty KR n0 0 RemoveSynth n1
Help/UGen/Demand/dwhite.help.lhs view
@@ -11,6 +11,8 @@ Diwhite returns integer values. The arguments can be a number or any other ugen +> import Sound.SC3.Monadic+ > do { n <- dwhite dinf 0 15 > ; let { x = mouseX KR 1 40 Exponential 0.1 > ; t = impulse KR x 0
Help/UGen/Demand/tDuty.help.lhs view
@@ -28,6 +28,8 @@ Play a little rhythm +> import Sound.SC3.Monadic+ > do { d <- dseq dinf (mce [0.1, 0.2, 0.4, 0.3]) > ; audition (out 0 (tDuty AR d 0 DoNothing 1 1)) } @@ -35,13 +37,15 @@ > do { d0 <- dseq dinf (mce [0.1, 0.2, 0.4, 0.3]) > ; d1 <- dseq dinf (mce [0.1, 0.4, 0.01, 0.5, 1.0])-> ; audition (out 0 (ringz (tDuty AR d0 0 DoNothing d1 1) 1000 0.1)) }+> ; let s = ringz (tDuty AR d0 0 DoNothing d1 1) 1000 0.1+> in audition (out 0 s) } Mouse control. > do { d <- dseq dinf (mce [0.1, 0.4, 0.01, 0.5, 1.0])-> ; let x = mouseX KR 0.003 1 Exponential 0.1-> in audition (out 0 (ringz (tDuty AR x 0 DoNothing d 1) 1000 0.1)) }+> ; let { x = mouseX KR 0.003 1 Exponential 0.1+> ; s = ringz (tDuty AR x 0 DoNothing d 1) 1000 0.1 }+> in audition (out 0 s) } Note that the 440 is the shorter pitch, since gap is set to false
Help/UGen/Envelope/detectSilence.help.lhs view
@@ -3,6 +3,8 @@ If the signal at `in' falls below `amp' for `time' seconds then `doneAction' is raised. +> import Sound.SC3+ > let { s = sinOsc AR 440 0 * mouseY KR 0 0.4 Linear 0.1 > ; d = detectSilence s 0.1 0.2 RemoveSynth } > in audition (mrg [out 0 s, d])
Help/UGen/Envelope/done.help.lhs view
@@ -3,6 +3,8 @@ Outputs a unit signal if the 'done' flag of the unit at `src' is set, else output zero. +> import Sound.SC3+ > let { x = mouseX KR (-1) 1 Linear 0.1 > ; e = linen x 0.1 0.1 0.5 DoNothing > ; o1 = sinOsc AR 880 0 * 0.1
+ Help/UGen/Envelope/envCoord.help.lhs view
@@ -0,0 +1,11 @@+envCoord :: [(UGen, UGen)] -> UGen -> UGen -> EnvCurve -> [UGen]++Co-ordinate (break-point) envelope++> import Sound.SC3++> let { c = EnvLin+> ; p = envCoord [(0,0), (0.5, 0.1), (0.55, 1), (1, 0)] 9 0.1 c+> ; e = envGen KR 1 1 0 1 RemoveSynth p }+> in audition (out 0 (sinOsc AR 440 0 * e))+
Help/UGen/Envelope/envGen.help.lhs view
@@ -28,26 +28,5 @@ the env is finished playing. This can be used to free the enclosing synth, etc. -Percussive envelope--> let { p = envPerc 0.01 1-> ; e = envGen KR 1 0.1 0 1 RemoveSynth p }-> in audition (out 0 (sinOsc AR 440 0 * e))--Sine envelope--> let { s = envSine 9 0.1-> ; e = envGen KR 1 1 0 1 RemoveSynth s }-> in audition (out 0 (sinOsc AR 440 0 * e))--Co-ordinate (break-point) envelope--> let { c = envCoord [(0,0), (0.5, 0.1), (0.55, 1), (1, 0)] 9 0.1 EnvLin-> ; e = envGen KR 1 1 0 1 RemoveSynth c }-> in audition (out 0 (sinOsc AR 440 0 * e))--Trapezoidal envelope--> let { t = envTrapezoid 0.05 0.95 3 0.1-> ; e = envGen KR 1 1 0 1 RemoveSynth t }-> in audition (out 0 (sinOsc AR 440 0 * e))+The following envelope constructors are provided: envPerc, envSine,+envCoord, envTrapezoid, and envLinen.
+ Help/UGen/Envelope/envLinen.help.lhs view
@@ -0,0 +1,9 @@+envLinen :: UGen -> UGen -> UGen -> UGen -> [UGen]++Linear envelope parameter constructor.++> import Sound.SC3++> let { t = envLinen 0.4 2 0.4 0.1+> ; e = envGen KR 1 1 0 1 RemoveSynth t }+> in audition (out 0 (sinOsc AR 440 0 * e))
+ Help/UGen/Envelope/envPerc.help.lhs view
@@ -0,0 +1,9 @@+envPerc :: UGen -> UGen -> [UGen]++Percussive envelope++> import Sound.SC3++> let { p = envPerc 0.01 1+> ; e = envGen KR 1 0.1 0 1 RemoveSynth p }+> in audition (out 0 (sinOsc AR 440 0 * e))
+ Help/UGen/Envelope/envSine.help.lhs view
@@ -0,0 +1,10 @@+envSine :: UGen -> UGen -> [UGen]++Sine envelope++> import Sound.SC3++> let { s = envSine 9 0.1+> ; e = envGen KR 1 1 0 1 RemoveSynth s }+> in audition (out 0 (sinOsc AR 440 0 * e))+
+ Help/UGen/Envelope/envTrapezoid.help.lhs view
@@ -0,0 +1,9 @@+envTrapezoid :: UGen -> UGen -> UGen -> UGen -> [UGen]++Trapezoidal envelope data.++> import Sound.SC3++> let { t = envTrapezoid 0.05 0.95 3 0.1+> ; e = envGen KR 1 1 0 1 RemoveSynth t }+> in audition (out 0 (sinOsc AR 440 0 * e))
Help/UGen/Envelope/free.help.lhs view
@@ -5,11 +5,13 @@ trig - when triggered, frees node nodeID - node to be freed +> import Sound.SC3.Monadic+ > let { a = out 0 (sinOsc AR 880 0 * 0.1) > ; b = do { n0 <- pinkNoise AR-> ; n1 <- dust AR 2+> ; n1 <- dust AR 20 > ; return (mrg [out 1 (n0 * 0.1), free n1 1001]) } }-> in withSC3 (\fd -> do { async fd . d_recv . graphdef "a" . graph $ a-> ; async fd . d_recv . graphdef "b" . graph =<< b+> in withSC3 (\fd -> do { async fd (d_recv (synthdef "a" a))+> ; async fd . d_recv . synthdef "b" =<< b > ; send fd (s_new "a" 1001 AddToTail 0 []) > ; send fd (s_new "b" (-1) AddToTail 0 []) } )
Help/UGen/Envelope/freeSelf.help.lhs view
@@ -3,6 +3,8 @@ Free enclosing synth when the input signal crosses from non-positive to positive. +> import Sound.SC3.Monadic+ > do { n <- dust KR 0.5 > ; let { a = freeSelf n > ; b = out 0 (sinOsc AR 440 0 * 0.1) }
Help/UGen/Envelope/freeSelfWhenDone.help.lhs view
@@ -2,6 +2,8 @@ Free the synth when the 'done' flag of the unit at `src' is set. +> import Sound.SC3+ > let { x = mouseX KR (-1) 1 Linear 0.1 > ; e = linen x 1 0.1 1 RemoveSynth } > in audition (out 0 (sinOsc AR 440 0 * e))
Help/UGen/Envelope/line.help.lhs view
@@ -9,5 +9,7 @@ Note: The SC3 UGen reorders the mul and add inputs to precede the doneAction input. +> import Sound.SC3+ > let f = line KR 200 17000 5 RemoveSynth > in audition (out 0 (sinOsc AR f 0 * 0.1))
Help/UGen/Envelope/linen.help.lhs view
@@ -6,6 +6,8 @@ Note that the sustain level input is consulted only at the instant when the gate is opened. +> import Sound.SC3+ > let e = linen (impulse KR 2 0) 0.01 0.6 0.4 DoNothing > in audition (out 0 (e * sinOsc AR 440 0 * 0.1))
Help/UGen/Envelope/pause.help.lhs view
@@ -5,10 +5,12 @@ gate - when gate is 0, node is paused, when 1 it runs nodeID - node to be paused +> import Sound.SC3+ > let { f = control KR "f" 440 > ; g = control KR "g" 1 > ; a = mrg [out 0 (sinOsc AR f 0 * 0.1), pause g 1001]-> ; a' = graphdef "a" (graph a) }+> ; a' = synthdef "a" a } > in withSC3 (\fd -> do { async fd (d_recv a') > ; send fd (s_new "a" 1001 AddToTail 0 []) > ; send fd (s_new "a" 1002 AddToTail 0 [("f", 880)]) } )
Help/UGen/Envelope/pauseSelf.help.lhs view
@@ -3,6 +3,8 @@ Pause enclosing synth when input signal crosses from non-positive to positive. +> import Sound.SC3+ > let { x = mouseX KR (-1) 1 Linear 0.1 > ; o = sinOsc AR 440 0 * 0.1 } > in audition (mrg [pauseSelf x, out 0 o])
Help/UGen/Envelope/pauseSelfWhenDone.help.lhs view
@@ -2,9 +2,15 @@ Pauses the synth when the 'done' flag of the unit at `src' is set. +> import Sound.SC3+ > let { x = mouseX KR (-1) 1 Linear 0.1 > ; e = linen x 1 0.1 1 PauseSynth } > in audition (out 0 (sinOsc AR 440 0 * e))++Run paused node (assuming no intermediate node is created).++> withSC3 (\fd -> send fd (n_run [(-1, True)])) > let { x = mouseX KR (-1) 1 Linear 0.1 > ; e = linen x 1 0.1 1 DoNothing
Help/UGen/Envelope/xLine.help.lhs view
@@ -13,6 +13,8 @@ Note: The sclang interface reorders the mul and add inputs to precede the doneAction input. +> import Sound.SC3+ > let { f = xLine KR 200 17000 10 RemoveSynth > ; o = sinOsc AR f 0 * 0.1 } > in audition (out 0 o)
Help/UGen/External/fm7.help.lhs view
@@ -28,6 +28,8 @@ The UGen outputs the six individual oscillator signals. +> import Sound.SC3+ > let { c = [ [xLine KR 300 310 4 DoNothing, 0, 1] > , [xLine KR 300 310 8 DoNothing, 0, 1] > , [0, 0, 1]
Help/UGen/External/membraneCircle.help.lhs view
@@ -12,6 +12,8 @@ impulse generator. mouseX is tension and impulse frequency, mouseY is duration of excitation, release-time and amplitude. +> import Sound.SC3+ > let { x = mouseX KR 0 1 Linear 0.2 > ; y = mouseY KR 1e-9 1 Exponential 0.2 > ; loss = linLin y 0 1 0.999999 0.999
Help/UGen/External/pv_Invert.help.lhs view
@@ -1,9 +1,12 @@ pv_Invert buffer +> import Sound.SC3+ > let { s = sinOsc AR 440 0 * 0.4-> ; n = Sound.SC3.UGen.Base.pinkNoise (uid 0) AR * 0.1+> ; n = Sound.SC3.UGen.Base.pinkNoise 'a' AR * 0.1 > ; i = s + n > ; c0 = fft' 10 i-> ; c1 = pv_Invert c0 }-> in withSC3 (\fd -> do { async fd (b_alloc 10 2048 1)-> ; audition (out 0 (mce2 i (ifft' c1) * 0.5)) })+> ; c1 = pv_Invert c0 +> ; run fd = do { async fd (b_alloc 10 2048 1)+> ; audition (out 0 (mce2 i (ifft' c1) * 0.5)) } }+> in withSC3 run
Help/UGen/Filter/allpassN.help.lhs view
@@ -10,34 +10,36 @@ Since the allpass delay has no audible effect as a resonator on steady state sound ... -> let dly = xLine KR 0.0001 0.01 20 RemoveSynth-> in do { n <- whiteNoise AR-> ; audition (out 0 (allpassC (n * 0.1) 0.01 dly 0.2)) }+> import Sound.SC3.ID +> let { dly = xLine KR 0.0001 0.01 20 RemoveSynth+> ; n = whiteNoise 'a' AR }+> in audition (out 0 (allpassC (n * 0.1) 0.01 dly 0.2))+ ...these examples add the input to the effected sound so that you can hear the effect of the phase comb. -> do { n <- whiteNoise AR-> ; let dly = xLine KR 0.0001 0.01 20 RemoveSynth-> in audition (out 0 ((n + allpassN (n * 0.1) 0.01 dly 0.2) * 0.1)) }+> let { n = whiteNoise 'a' AR+> ; dly = xLine KR 0.0001 0.01 20 RemoveSynth }+> in audition (out 0 ((n + allpassN (n * 0.1) 0.01 dly 0.2) * 0.1)) Linear variant -> do { n <- whiteNoise AR-> ; let dly = xLine KR 0.0001 0.01 20 RemoveSynth-> in audition (out 0 ((n + allpassL (n * 0.1) 0.01 dly 0.2) * 0.1)) }+> let { n = whiteNoise 'a' AR+> ; dly = xLine KR 0.0001 0.01 20 RemoveSynth }+> in audition (out 0 ((n + allpassL (n * 0.1) 0.01 dly 0.2) * 0.1)) Cubic variant -> do { n <- whiteNoise AR-> ; let dly = xLine KR 0.0001 0.01 20 RemoveSynth-> in audition (out 0 ((n + allpassC (n * 0.1) 0.01 dly 0.2) * 0.1)) }+> let { n = whiteNoise 'a' AR+> ; dly = xLine KR 0.0001 0.01 20 RemoveSynth }+> in audition (out 0 ((n + allpassC (n * 0.1) 0.01 dly 0.2) * 0.1)) Used as an echo - doesn't really sound different than Comb, but it outputs the input signal immediately (inverted) and the echoes are lower in amplitude. -> do { n <- whiteNoise AR-> ; d <- dust AR 1-> ; let src = decay (d * 0.5) 0.2 * n-> in audition (out 0 (allpassN src 0.2 0.2 3)) }+> let { n = whiteNoise 'a' AR+> ; d = dust 'a' AR 1+> ; src = decay (d * 0.5) 0.2 * n }+> in audition (out 0 (allpassN src 0.2 0.2 3))
Help/UGen/Filter/bLowPass.help.lhs view
@@ -1,6 +1,8 @@ bLowPass i f rq+bLowPassCoef sr f rq i - input signal to be processed+ sr - sample rate f - cutoff frequency rq - the reciprocal of Q, ie. bandwidth / cutoffFreq @@ -9,6 +11,20 @@ > import Sound.SC3 > let { i = soundIn (mce2 0 1)-> ; f = mouseX KR 10 20000 Exponential 0.2 +> ; f = mouseX KR 10 20000 Exponential 0.2 > ; rq = mouseY KR 0 1 Linear 0.2 } > in audition (out 0 (bLowPass i f rq))++> let { i = mix (saw AR (mce [0.99, 1, 1.01] * 440) * 0.3)+> ; f = mouseX KR 100 20000 Exponential 0.2+> ; rq = mouseY KR 0.1 1 Linear 0.2 }+> in audition (out 0 (bLowPass i f rq))++Calculate coefficients and use sos.++> let { i = mix (saw AR (mce [0.99, 1, 1.01] * 440) * 0.3)+> ; f = mouseX KR 100 20000 Exponential 0.2+> ; rq = mouseY KR 0.1 1 Linear 0.2+> ; (a0, a1, a2, b1, b2) = bLowPassCoef sampleRate f rq+> ; flt ip = sos ip a0 a1 a2 b1 b2 }+> in audition (out 0 (flt (flt i)))
Help/UGen/Filter/freqShift.help.lhs view
@@ -1,14 +1,15 @@ freqShift input shift phase -freq-shift implements single sideband amplitude modulation, also-known as frequency shifting, but not to be confused with pitch-shifting. Frequency shifting moves all the components of a signal-by a fixed amount but does not preserve the original harmonic-relationships.+Single sideband amplitude modulation, also known as frequency+shifting, but not to be confused with pitch shifting. Frequency+shifting moves all the components of a signal by a fixed amount but+does not preserve the original harmonic relationships. -input - audio input-shift - amount of shift in cycles per second-phase - phase of the frequency shift (0 - 2pi) + input - audio input+ shift - amount of shift in cycles per second+ phase - phase of the frequency shift (0 - 2pi)++> import Sound.SC3 shifting a 100Hz tone by 1 Hz rising to 500Hz
Help/UGen/Filter/klank.help.lhs view
@@ -19,6 +19,8 @@ decayscale - a scale factor multiplied by all ring times at initialization time. +> import Sound.SC3+ > let s = klankSpec [800, 1071, 1153, 1723] [1, 1, 1, 1] [1, 1, 1, 1] > in audition (out 0 (klank (impulse AR 2 0 * 0.1) 1 0 1 s))
Help/UGen/Filter/moogFF.help.lhs view
@@ -3,24 +3,34 @@ Moog VCF implementation, designed by Federico Fontana. A digital implementation of the Moog VCF (filter). -in - the input signal-freq - the cutoff frequency-gain - the filter resonance gain, between zero and 4-reset - when greater than zero, this will reset the - state of the digital filters at the beginning - of a computational block.+ in - the input signal+ freq - the cutoff frequency+ gain - the filter resonance gain, between zero and 4+ reset - when greater than zero, this will reset the+ state of the digital filters at the beginning+ of a computational block. The design of this filter is described in the conference paper Fontana, F. (2007) Preserving the Digital Structure of the Moog VCF. In Proc. ICMC07, Copenhagen, 25-31 August 2007 +> import Sound.SC3+ > do { n <- whiteNoise AR > ; let { y = mouseY KR 100 10000 Exponential 0.1 > ; x = mouseX KR 0 4 Linear 0.1 } > in audition (out 0 (moogFF (n * 0.1) y x 0)) } +Note distortion at high gain.++> let { x = mouseX KR 100 20000 Exponential 0.1+> ; y = mouseY KR 0.1 4.0 Linear 0.1+> ; i = mix (saw AR (mce [0.99, 1, 1.01] * 440)) * 0.3 }+> in audition (out 0 (moogFF i x y 0))+ > do { n <- lfNoise0 KR 0.43 > ; let { p = pulse AR (mce [40, 121]) (mce [0.3, 0.7])-> ; f = linLin (sinOsc KR (linLin n 0 1 0.001 2.2) 0) (-1) 1 30 4200+> ; f0 = linLin n 0 1 0.001 2.2+> ; f = linLin (sinOsc KR f0 0) (-1) 1 30 4200 > ; y = mouseY KR 1 4 Linear 0.1 } > in audition (out 0 (moogFF p f (0.83 * y) 0)) }
Help/UGen/Filter/pluck.help.lhs view
@@ -22,6 +22,8 @@ Excitation signal is WhiteNoise, triggered twice a second with varying OnePole coef. +> import Sound.SC3.Monadic+ > do { n <- whiteNoise AR > ; let { t = impulse KR 9 0 > ; x = mouseX KR (-0.999) 0.999 Linear 0.1
Help/UGen/Filter/resonz.help.lhs view
@@ -13,23 +13,25 @@ rq - bandwidth ratio (reciprocal of Q). rq = bandwidth / centerFreq -> do { n <- whiteNoise AR-> ; audition (out 0 (resonz (n * 0.5) 2000 0.1)) }+> import Sound.SC3.ID +> let n = whiteNoise 'a' AR+> in audition (out 0 (resonz (n * 0.5) 2000 0.1))+ Modulate frequency -> do { n <- whiteNoise AR-> ; let f = xLine KR 1000 8000 10 RemoveSynth-> in audition (out 0 (resonz (n * 0.5) f 0.05)) }+> let { n = whiteNoise 'a' AR+> ; f = xLine KR 1000 8000 10 RemoveSynth }+> in audition (out 0 (resonz (n * 0.5) f 0.05)) Modulate bandwidth -> do { n <- whiteNoise AR-> ; let bw = xLine KR 1 0.001 8 RemoveSynth-> in audition (out 0 (resonz (n * 0.5) 2000 bw)) }+> let { n = whiteNoise 'a' AR+> ; bw = xLine KR 1 0.001 8 RemoveSynth }+> in audition (out 0 (resonz (n * 0.5) 2000 bw)) Modulate bandwidth opposite direction -> do { n <- whiteNoise AR-> ; let bw = xLine KR 0.001 1 8 RemoveSynth-> in audition (out 0 (resonz (n * 0.5) 2000 bw)) }+> let { n = whiteNoise 'a' AR+> ; bw = xLine KR 0.001 1 8 RemoveSynth }+> in audition (out 0 (resonz (n * 0.5) 2000 bw))
Help/UGen/Filter/rhpf.help.lhs view
@@ -2,5 +2,7 @@ A resonant high pass filter. +> import Sound.SC3+ > let f = fSinOsc KR (xLine KR 0.7 300 20 RemoveSynth) 0 * 3600 + 4000 > in audition (out 0 (rhpf (saw AR 200 * 0.1) f 0.2))
Help/UGen/Filter/ringz.help.lhs view
@@ -5,6 +5,8 @@ decay time. One Ringz is equivalent to one component of the Klank UGen. +> import Sound.SC3.Monadic+ > do { n <- dust AR 3 > ; audition (out 0 (ringz (n * 0.3) 2000 2)) }
Help/UGen/Filter/rlpf.help.lhs view
@@ -2,10 +2,12 @@ A resonant low pass filter. -> do { n <- M.whiteNoise AR-> ; let { f = sinOsc AR 0.5 0 * 40 + 220-> ; r = rlpf n f 0.1 }-> in audition (out 0 r) }+> import Sound.SC3.ID++> let { n = whiteNoise 'a' AR+> ; f = sinOsc AR 0.5 0 * 40 + 220+> ; r = rlpf n f 0.1 }+> in audition (out 0 r) > let f = fSinOsc KR (xLine KR 0.7 300 20 RemoveSynth) 0 * 3600 + 4000 > in audition (out 0 (rlpf (saw AR 200 * 0.1) f 0.2))
Help/UGen/Filter/select.help.lhs view
@@ -2,6 +2,8 @@ The output is selected from an array of inputs. +> import Sound.SC3+ > let { n = 3/2 > ; a = mce [sinOsc AR 440 0, saw AR 440, pulse AR 440 0.1] } > in audition (out 0 (select (lfSaw KR 1 0 * n + n) a * 0.2))
Help/UGen/Filter/shaper.help.lhs view
@@ -8,6 +8,8 @@ in - the input signal. +> import Sound.SC3+ > let s = sinOsc AR 300 0 * line KR 0 1 6 RemoveSynth > in withSC3 (\fd -> do { async fd (b_alloc 10 512 1) > ; async fd (b_gen 10 "cheby" [0, 1, 0, 1, 1, 0, 1])
Help/UGen/Filter/slew.help.lhs view
@@ -2,4 +2,6 @@ Has the effect of removing transients and higher frequencies. +> import Sound.SC3+ > audition (out 0 (slew (saw AR 800 * 0.2) 400 400))
Help/UGen/Filter/sos.help.lhs view
@@ -6,6 +6,8 @@ Same as TwoPole +> import Sound.SC3+ > let { theta = line KR (0.2 * pi) pi 5 RemoveSynth > ; rho = line KR 0.6 0.99 5 RemoveSynth > ; b1 = 2 * rho * cos theta
Help/UGen/Filter/twoPole.help.lhs view
@@ -4,6 +4,8 @@ access to setting of pole location. For general purposes Resonz is better. +> import Sound.SC3.Monadic+ > do { n <- whiteNoise AR > ; audition (out 0 (twoPole (n * 0.005) 2000 0.95)) }
Help/UGen/Filter/twoZero.help.lhs view
@@ -2,6 +2,8 @@ Two zero filter +> import Sound.SC3.Monadic+ > do { n <- whiteNoise AR > ; let f = xLine KR 20 20000 8 RemoveSynth > in audition (out 0 (twoZero (n * 0.125) f 1)) }
Help/UGen/Filter/wrapIndex.help.lhs view
@@ -9,6 +9,8 @@ bufnum - index of the buffer in - the input signal. +> import Sound.SC3+ > withSC3 (\fd -> do { async fd (b_alloc 0 6 1) > ; send fd (b_setn 0 [(0, [200, 300, 400, 500, 600, 800])]) })
Help/UGen/Granular/grainBuf.help.lhs view
@@ -26,17 +26,21 @@ pan - a value from -1 to 1. Determines where to pan the output in the same manner as PanAz. -envb - the buffer number containing a singal to use for the+envb - the buffer number containing a signal to use for the grain envelope. -1 uses a built-in Hanning envelope. -> do { withSC3 (\fd -> send fd (b_allocRead 10 "/home/rohan/audio/metal.wav" 0 0))-> ; n1 <- lfNoise1 KR 500-> ; n2 <- lfNoise2 KR 0.1-> ; let { b = 10-> ; e = -1-> ; x = mouseX KR (-1) 1 Linear 0.1-> ; y = mouseY KR 10 45 Linear 0.1-> ; i = impulse KR y 0-> ; r = linLin n1 (-1) 1 0.5 2-> ; p = linLin n2 (-1) 1 0 1 }-> in audition (out 0 (grainBuf 2 i 0.1 b r p 2 x e)) }+> import Sound.SC3.Monadic++> let { fn = "/home/rohan/audio/metal.wav"+> ; b = 10+> ; e = -1+> ; x = mouseX KR (-1) 1 Linear 0.1+> ; y = mouseY KR 10 45 Linear 0.1+> ; i = impulse KR y 0+> ; r n = linLin n (-1) 1 0.5 2+> ; p n = linLin n (-1) 1 0 1+> ; g n1 n2 = grainBuf 2 i 0.1 b (r n1) (p n2) 2 x e }+> in withSC3 (\fd -> do { send fd (b_allocRead 10 fn 0 0)+> ; n1 <- lfNoise1 KR 500+> ; n2 <- lfNoise2 KR 0.1+> ; play fd (out 0 (g n1 n2)) })
Help/UGen/Granular/grainFM.help.lhs view
@@ -26,6 +26,8 @@ envbuf - the buffer number containing a singal to use for the grain envelope. -1 uses a built-in Hanning envelope. +> import Sound.SC3.Monadic+ > do { n1 <- whiteNoise KR > ; n2 <- lfNoise1 KR 500 > ; let { x = mouseX KR (-0.5) 0.5 Linear 0.1
Help/UGen/Granular/grainIn.help.lhs view
@@ -20,6 +20,8 @@ envbuf - the buffer number containing a singal to use for the grain envelope. -1 uses a built-in Hanning envelope. +> import Sound.SC3.Monadic+ > do { n <- pinkNoise AR > ; let { x = mouseX KR (-0.5) 0.5 Linear 0.1 > ; y = mouseY KR 5 25 Linear 0.1
Help/UGen/Granular/grainSin.help.lhs view
@@ -20,6 +20,8 @@ envbuf - the buffer number containing a singal to use for the grain envelope. -1 uses a built-in Hanning envelope. +> import Sound.SC3.Monadic+ > do { n <- whiteNoise KR > ; let { x = mouseX KR (-0.5) 0.5 Linear 0.1 > ; y = mouseY KR 0 400 Linear 0.1
Help/UGen/Granular/warp1.help.lhs view
@@ -33,8 +33,11 @@ = no interpolation. 2 = linear. 4 = cubic interpolation (more computationally intensive). -> do { withSC3 (\fd -> send fd (b_allocRead 10 "/home/rohan/audio/metal.wav" 0 0))-> ; let { p = linLin (lfSaw KR 0.05 0) (-1) 1 0 1-> ; x = mouseX KR 0.5 2 Linear 0.1-> ; w = warp1 1 10 p x 0.1 (-1) 8 0.1 2 }-> in audition (out 0 w) }+> import Sound.SC3++> let { fn = "/home/rohan/audio/metal.wav"+> ; p = linLin (lfSaw KR 0.05 0) (-1) 1 0 1+> ; x = mouseX KR 0.5 2 Linear 0.1+> ; w = warp1 1 10 p x 0.1 (-1) 8 0.1 2 }+> in withSC3 (\fd -> do { send fd (b_allocRead 10 fn 0 0)+> ; play fd (out 0 w) })
Help/UGen/IO/in.help.lhs view
@@ -4,6 +4,8 @@ Patching input to output. +> import Sound.SC3+ > audition (out 0 (in' 2 AR numOutputBuses)) Patching input to output, with delay.@@ -14,10 +16,12 @@ Write noise to bus 10, then read it out. The multiple root graph is ordered. -> do { n <- pinkNoise AR-> ; let { wr = out 10 (n * 0.3)-> ; rd = out 0 (in' 1 AR 10) }-> in audition (mrg [rd, wr]) }+> import Sound.SC3.ID++> let { n = pinkNoise 'a' AR+> ; wr = out 10 (n * 0.3)+> ; rd = out 0 (in' 1 AR 10) }+> in audition (mrg [rd, wr]) Reading a control bus.
Help/UGen/IO/inFeedback.help.lhs view
@@ -25,6 +25,8 @@ Audio feedback modulation. +> import Sound.SC3+ > let { f = inFeedback 1 0 * 1300 + 300 > ; s = sinOsc AR f 0 * 0.4 } > in audition (out 0 s)
Help/UGen/IO/inTrig.help.lhs view
@@ -8,11 +8,12 @@ Run an oscillator with the trigger at bus 10. +> import Sound.SC3+ > let { t = inTrig 1 10 > ; e = envGen KR t t 0 1 DoNothing (envPerc 0.01 1) } > in audition (out 0 (sinOsc AR 440 0 * e)) Set bus 10, each set will trigger a ping. -> let c_set1 i n = c_set [(i,n)]-> in withSC3 (\fd -> send fd (c_set1 10 0.1))+> withSC3 (\fd -> send fd (c_set1 10 0.1))
Help/UGen/IO/lagIn.help.lhs view
@@ -2,7 +2,11 @@ Smooth a control rate input signal. -> withSC3 (\fd -> do { send fd (c_set [(10, 200)])-> ; play fd (out 0 (sinOsc AR (lagIn 1 10 1) 0 * 0.1))-> ; threadDelay 500000-> ; send fd (c_set [(10, 2000)]) })+> import Control.Concurrent+> import Sound.SC3++> withSC3 (\fd -> do +> { send fd (c_set [(10, 200)])+> ; play fd (out 0 (sinOsc AR (lagIn 1 10 1) 0 * 0.1))+> ; threadDelay 500000+> ; send fd (c_set [(10, 2000)]) })
Help/UGen/IO/localBuf.help.lhs view
@@ -12,18 +12,18 @@ Allocate a buffer local to the synthesis graph. -> import Sound.SC3+> import Sound.SC3.Monadic > do { n <- whiteNoise AR > ; let { m = maxLocalBufs 1-> ; b = mrg2 (localBuf (uid 0) 2048 1) m+> ; b = mrg2 (localBuf 'α' 2048 1) m > ; f = fft' b n > ; c = pv_BrickWall f (sinOsc KR 0.1 0 * 0.75) } > in audition (out 0 (ifft' c * 0.1)) } > do { n <- clone 2 (whiteNoise AR) > ; let { m = maxLocalBufs 2-> ; b = mrg2 (mce (map (\i -> localBuf (uid i) 2048 1) [0, 1])) m+> ; b = mrg2 (mce (map (\i -> localBuf i 2048 1) ['α', 'β'])) m > ; f = fft' b n > ; c = pv_BrickWall f (sinOsc KR (mce2 0.1 0.11) 0 * 0.75) } > in audition (out 0 (ifft' c * 0.1)) }@@ -32,7 +32,7 @@ slowly overwrite data with noise > let { m = maxLocalBufs 1-> ; b = mrg2 (localBuf (uid 0) 2048 2) m+> ; b = mrg2 (localBuf 'α' 2048 2) m > ; nf = bufFrames KR b > ; x = mouseX KR 1 2 Linear 0.2 > ; r = playBuf 2 b x 1 0 Loop DoNothing * 0.1@@ -49,18 +49,18 @@ > ; l = xLine KR 0.0001 0.01 20 DoNothing > ; sr = sampleRate > ; m = maxLocalBufs 2-> ; b = mrg2 (mce (map (\i -> localBuf (uid i) sr 2) [0, 1])) m }+> ; b = mrg2 (mce (map (\i -> localBuf i sr 2) ['α', 'β'])) m } > in audition (out 0 (bufCombC b z l 0.2)) } asLocalBuf combines localBuf and setBuf -> let { b = asLocalBuf (uid 0) [2, 1, 5, 3, 4, 0]+> let { b = asLocalBuf 'α' [2, 1, 5, 3, 4, 0] > ; x = mouseX KR 0 (bufFrames KR b) Linear 0.2 > ; f = indexL b x * 100 + 40 > ; o = saw AR (f * mce2 1 1.1) * 0.1 } > in audition (out 0 o) -> let { b = asLocalBuf (uid 0) [2, 3, 4, 0, 1, 5]+> let { b = asLocalBuf 'α' [2, 3, 4, 0, 1, 5] > ; n = bufFrames KR b > ; x = floorE (mouseX KR 0 n Linear 0.1) > ; i = detectIndex b x }@@ -68,7 +68,7 @@ > do { n <- lfNoise1 KR (mce [3, 3.05]) > ; let { x = mouseX KR 0 15 Linear 0.1-> ; b = asLocalBuf (uid 0) [0, 2, 3.2, 5, 7, 9, 10]+> ; b = asLocalBuf 'α' [0, 2, 3.2, 5, 7, 9, 10] > ; k = degreeToKey b x 12 > ; mk_c bf = let { f0 = midiCPS (bf + k + n * 0.04) > ; o = sinOsc AR f0 0 * 0.1
Help/UGen/IO/localIn.help.lhs view
@@ -10,11 +10,11 @@ only be one audio rate and one control rate LocalIn per SynthDef. The audio can be written to the bus using LocalOut. -> import Sound.SC3+> import Sound.SC3.ID -> do { n <- whiteNoise AR-> ; let { a0 = decay (impulse AR 0.3 0) 0.1 * n * 0.2-> ; a1 = localIn 2 AR + mce [a0, 0]-> ; a2 = delayN a1 0.2 0.2 -> ; a3 = mceEdit reverse a2 * 0.8 }-> in audition (mrg [localOut a3, out 0 a2]) }+> let { n = whiteNoise 'a' AR+> ; a0 = decay (impulse AR 0.3 0) 0.1 * n * 0.2+> ; a1 = localIn 2 AR + mce [a0, 0]+> ; a2 = delayN a1 0.2 0.2 +> ; a3 = mceEdit reverse a2 * 0.8 }+> in audition (mrg [localOut a3, out 0 a2])
Help/UGen/IO/localOut.help.lhs view
@@ -17,14 +17,14 @@ 20Hz), or where sample accurate alignment is required. See the resonator example below. -> import Sound.SC3+> import Sound.SC3.ID -> do { n <- whiteNoise AR-> ; let { a0 = decay (impulse AR 0.3 0) 0.1 * n * 0.2-> ; a1 = localIn 2 AR + mce [a0, 0]-> ; a2 = delayN a1 0.2 0.2-> ; a3 = mceEdit reverse a2 * 0.8 }-> in audition (mrg [localOut a3, out 0 a2]) }+> let { n = whiteNoise 'a' AR+> ; a0 = decay (impulse AR 0.3 0) 0.1 * n * 0.2+> ; a1 = localIn 2 AR + mce [a0, 0]+> ; a2 = delayN a1 0.2 0.2+> ; a3 = mceEdit reverse a2 * 0.8 }+> in audition (mrg [localOut a3, out 0 a2]) Resonator, must subtract blockSize for correct tuning
Help/UGen/IO/offsetOut.help.lhs view
@@ -3,6 +3,8 @@ Output signal to a bus, the sample offset within the bus is kept exactly. This ugen is used where sample accurate output is needed. +> import Sound.SC3+ > let { a = offsetOut 0 (impulse AR 5 0) > ; b = out 0 (sinOsc AR 60 0 * 0.1) } > in audition (mrg [a, b])
Help/UGen/IO/out.help.lhs view
@@ -4,4 +4,6 @@ The user is responsible for making sure that the number of channels match and that there are no conflicts. +> import Sound.SC3+ > audition (out 0 (sinOsc AR (mce [330, 331]) 0 * 0.1))
Help/UGen/IO/replaceOut.help.lhs view
@@ -2,6 +2,8 @@ Send signal to a bus, overwrite existing signal. +> import Sound.SC3+ > let { a = out 0 (sinOsc AR (mce [330, 331]) 0 * 0.1) > ; b = replaceOut 0 (sinOsc AR (mce [880, 881]) 0 * 0.1) > ; c = out 0 (sinOsc AR (mce [120, 121]) 0 * 0.1) }
Help/UGen/IO/soundIn.help.lhs view
@@ -5,6 +5,8 @@ channel - input channel number to read, indexed from zero, can be mce. +> import Sound.SC3+ > audition (out 0 (soundIn 0)) > audition (out 0 (soundIn (mce2 0 1)))
Help/UGen/IO/xOut.help.lhs view
@@ -2,6 +2,8 @@ Send signal to a bus, crossfading with existing contents. +> import Sound.SC3+ > let { p a b = sinOsc AR (mce [a, b]) 0 * 0.1 > ; x = mouseX KR 0 1 Linear 0.1 > ; y = mouseY KR 0 1 Linear 0.1 }
Help/UGen/MachineListening/beatTrack.help.lhs view
@@ -34,13 +34,16 @@ basis of computer processing that is decidedly faster than human. +> import Sound.SC3+ > let { i = soundIn 0 > ; x = mouseX KR (-1) 1 Linear 0.2 > ; MCE [b, h, q, t] = beatTrack (fft' 10 i) x > ; f = mce [440, 660, 880]-> ; s = mix (sinOsc AR f 0 * 0.1 * decay (mce [b, h, q]) 0.05) }+> ; a = mce [0.4, 0.2, 0.1]+> ; s = mix (sinOsc AR f 0 * a * decay (mce [b, h, q]) 0.05) } > in withSC3 (\fd -> do { async fd (b_alloc 10 1024 1)-> ; play fd (out 0 s) })+> ; play fd (out 0 (i + s)) }) Davies, M. E. P. and Plumbley, M. D. Beat Tracking With A Two State Model. Proceedings of the IEEE International
Help/UGen/MachineListening/loudness.help.lhs view
@@ -2,16 +2,17 @@ Extraction of instantaneous loudness in sones. - chain [fft] - Audio input to track, which has been pre-analysed by the- FFT UGen; see examples below for the expected FFT size+ chain [fft] - Audio input to track, which has been pre-analysed by+ the FFT UGen; see examples below for the expected FFT+ size - smask [sk] - Spectral masking param: lower bins mask higher bin power- within ERB bands, with a power falloff (leaky+ smask [sk] - Spectral masking param: lower bins mask higher bin+ power within ERB bands, with a power falloff (leaky integration multiplier) of smask per bin. (=0.25) - tmask [sk] - Temporal masking param: the phon level let through in an- ERB band is the maximum of the new measurement, and the- previous minus tmask phons (=6)+ tmask [sk] - Temporal masking param: the phon level let through in+ an ERB band is the maximum of the new measurement, and+ the previous minus tmask phons (=6) A perceptual loudness function which outputs loudness in sones; this is a variant of an MP3 perceptual model, summing excitation in ERB@@ -27,6 +28,8 @@ gain 1.000 => loudness 64 sone Assume hop of half fftsize.++> import Sound.SC3 > let { b = 10 > ; x = mouseX KR 0.001 0.1 Exponential 0.2
Help/UGen/MachineListening/onsets.help.lhs view
@@ -48,6 +48,8 @@ is purely based on signal analysis and does not make use of any "top-down" inferences such as tempo. +> import Sound.SC3+ > let { x = mouseX KR 0 1 Linear 0.2 > ; i = soundIn 0 > ; c = fft' 10 i
Help/UGen/Math/add.help.lhs view
@@ -1,10 +1,10 @@ a + b -> import Sound.SC3+> import Sound.SC3.ID -> let o = fSinOsc AR 800 0-> in do { n <- pinkNoise AR-> ; audition (out 0 ((o + n) * 0.1)) }+> let { o = fSinOsc AR 800 0+> ; n = pinkNoise 'a' AR }+> in audition (out 0 ((o + n) * 0.1)) DC offset.
Help/UGen/Math/amClip.help.lhs view
@@ -2,7 +2,7 @@ 0 when b <= 0, a*b when b > 0 -> import Sound.SC3+> import Sound.SC3.ID -> do { n <- whiteNoise AR-> ; audition (out 0 (amClip n (fSinOsc KR 1 0 * 0.2))) }+> let n = whiteNoise 'a' AR+> in audition (out 0 (amClip n (fSinOsc KR 1 0 * 0.2)))
Help/UGen/Math/distort.help.lhs view
@@ -2,6 +2,8 @@ Nonlinear distortion. +> import Sound.SC3+ > let { e = xLine KR 0.1 10 10 DoNothing > ; o = fSinOsc AR 500 0.0 } > in audition (out 0 (distort (o * e) * 0.25))
Help/UGen/Math/fdiv.help.lhs view
@@ -4,8 +4,8 @@ Division can be tricky with signals because of division by zero. -> import Sound.SC3+> import Sound.SC3.ID -> let o = fSinOsc KR 10 0.5-> in do { n <- pinkNoise AR-> ; audition (out 0 ((n * 0.1) / (o * 0.75))) }+> let { o = fSinOsc KR 10 0.5+> ; n = pinkNoise 'a' AR }+> in audition (out 0 ((n * 0.1) / (o * 0.75)))
Help/UGen/Math/mul.help.lhs view
@@ -8,8 +8,10 @@ Creates a beating effect (subaudio rate). -> do { n <- pinkNoise AR-> ; audition (out 0 (fSinOsc kr 10 0 * n * 0.5)) }+> import Sound.SC3.ID++> let n = pinkNoise 'a' AR+> in audition (out 0 (fSinOsc kr 10 0 * n * 0.5)) Ring modulation.
Help/UGen/Math/pow.help.lhs view
@@ -5,10 +5,14 @@ allows exponentiation of negative signal values by noninteger exponents. +> import Sound.SC3+ > let a = fSinOsc AR 100 0 * 0.1 > in audition (out 0 (mce2 a (a ** 10))) http://create.ucsb.edu/pipermail/sc-users/2006-December/029998.html++> import Sound.SC3.Monadic > do { n0 <- lfNoise2 KR 8 > ; n1 <- lfNoise2 KR 3
Help/UGen/Math/ring1.help.lhs view
@@ -11,3 +11,9 @@ > let { a = fSinOsc AR 800 0 > ; b = fSinOsc AR (xLine KR 200 500 5 DoNothing) 0 } > in audition (out 0 (ring1 a b * 0.125))++is equivalent to:++> let { a = fSinOsc AR 800 0+> ; b = fSinOsc AR (xLine KR 200 500 5 DoNothing) 0 }+> in audition (out 0 (((a * b) + a) * 0.125))
Help/UGen/Math/thresh.help.lhs view
@@ -2,7 +2,7 @@ Signal thresholding. 0 when a < b, otherwise a. -> import Sound.SC3+> import Sound.SC3.ID -> do { n <- lfNoise0 AR 50-> ; audition (out 0 (thresh (n * 0.5) 0.45)) }+> let n = lfNoise0 'a' AR 50+> in audition (out 0 (thresh (n * 0.5) 0.45))
Help/UGen/Noise/brownNoise.help.lhs view
@@ -3,11 +3,12 @@ Generates noise whose spectrum falls off in power by 6 dB per octave. -> do { n <- brownNoise AR-> ; audition (out 0 (n * 0.1)) }+> import Sound.SC3.ID -> audition . (out 0) . (* 0.1) =<< whiteNoise AR+> let n = brownNoise 'a' AR+> in audition (out 0 (n * 0.1)) -> do { n <- brownNoise KR-> ; let o = sinOsc AR (linExp n (-1) 1 64 9600) 0 * 0.1-> in audition (out 0 o) }+> let { n = brownNoise 'a' KR+> ; o = sinOsc AR (linExp n (-1) 1 64 9600) 0 * 0.1 }+> in audition (out 0 o)+
Help/UGen/Noise/clipNoise.help.lhs view
@@ -3,6 +3,8 @@ Generates noise whose values are either -1 or 1. This produces the maximum energy for the least peak to peak amplitude. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.1) =<< clipNoise AR > audition . (out 0) . (* 0.1) =<< whiteNoise AR
Help/UGen/Noise/coinGate.help.lhs view
@@ -3,6 +3,8 @@ When it receives a trigger, it tosses a coin, and either passes the trigger or doesn't. +> import Sound.SC3.Monadic+ > do { g <- coinGate 0.2 (impulse KR 10 0) > ; f <- tRand 300.0 400.0 g > ; audition (out 0 (sinOsc AR f 0 * 0.1)) }
Help/UGen/Noise/dust.help.lhs view
@@ -3,6 +3,8 @@ Generates random impulses from 0 to +1 at a rate determined by the density argument. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.25) =<< dust AR 200 > let d = xLine KR 20000 2 10 RemoveSynth
Help/UGen/Noise/dust2.help.lhs view
@@ -3,6 +3,8 @@ Generates random impulses from -1 to +1. The `density' is in impulses per second. +> import Sound.SC3.Monadic+ > do { n <- dust2 AR 200 > ; audition (out 0 (n * 0.5)) }
Help/UGen/Noise/expRand.help.lhs view
@@ -3,6 +3,8 @@ Generates a single random float value in an exponential distributions from `lo' to `hi'. -> let a = line KR 0.5 0 0.01 RemoveSynth-> in do { f <- expRand 100.0 8000.0-> ; audition (out 0 (fSinOsc AR f 0 * a)) }+> import Sound.SC3.ID++> let { a = line KR 0.5 0 0.01 RemoveSynth+> ; f = expRand 'a' 100.0 8000.0 }+> in audition (out 0 (fSinOsc AR f 0 * a))
Help/UGen/Noise/grayNoise.help.lhs view
@@ -4,4 +4,6 @@ This type of noise has a high RMS level relative to its peak to peak level. The spectrum is emphasized towards lower frequencies. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.1) =<< grayNoise AR
Help/UGen/Noise/iRand.help.lhs view
@@ -3,6 +3,8 @@ Generates a single random integer value in uniform distribution from `lo' to `hi'. -> do { f <- iRand 200 1200-> ; let e = line KR 0.2 0 0.1 RemoveSynth-> in audition (out 0 (fSinOsc AR f 0 * e)) }+> import Sound.SC3.ID++> let { f = iRand 'a' 200 1200+> ; e = line KR 0.2 0 0.1 RemoveSynth }+> in audition (out 0 (fSinOsc AR f 0 * e))
Help/UGen/Noise/lfClipNoise.help.lhs view
@@ -5,6 +5,8 @@ It is probably pretty hard on your speakers. The freq argument is the approximate rate at which to generate random values. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.05) =<< lfClipNoise AR 1000 Modulate frequency
Help/UGen/Noise/lfNoise0.help.lhs view
@@ -3,6 +3,8 @@ Step noise. Generates random values at a rate given by the nearest integer division of the sample rate by the freq argument. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.05) =<< lfNoise0 AR 1000 Modulate frequency.@@ -13,5 +15,5 @@ Use as frequency control. -> f <- lfNoise0 KR 4-> audition (out 0 (sinOsc AR (f * 400 + 450) 0 * 0.1))+> do { f <- lfNoise0 KR 4+> ; audition (out 0 (sinOsc AR (f * 400 + 450) 0 * 0.1)) }
Help/UGen/Noise/lfNoise1.help.lhs view
@@ -6,6 +6,8 @@ freq - approximate rate at which to generate random values. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.05) =<< lfNoise1 AR 1000 Modulate frequency.
Help/UGen/Noise/lfNoise2.help.lhs view
@@ -4,6 +4,8 @@ values at a rate given by the nearest integer division of the sample rate by the freq argument. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.05) =<< lfNoise2 AR 1000 Modulate frequency.
Help/UGen/Noise/lfdClipNoise.help.lhs view
@@ -15,6 +15,8 @@ Try wiggling mouse quickly; lfClipNoise frequently seems stuck, lfdClipNoise changes smoothly. +> import Sound.SC3.Monadic+ > let x = mouseX KR 0.1 1000 Exponential 0.2 > in do { n <- lfdClipNoise AR x > ; audition (out 0 (sinOsc AR (n * 200 + 500) 0 * 0.05)) }
Help/UGen/Noise/lfdNoise0.help.lhs view
@@ -14,6 +14,8 @@ Try wiggling mouse quickly; LFNoise frequently seems stuck, LFDNoise changes smoothly. +> import Sound.SC3.Monadic+ > let x = mouseX KR 0.1 1000 Exponential 0.2 > in audition . (out 0) . (* 0.1) =<< lfdNoise0 AR x
Help/UGen/Noise/linRand.help.lhs view
@@ -4,6 +4,8 @@ lo to hi, skewed towards lo if minmax < 0, otherwise skewed towards hi. +> import Sound.SC3.Monadic+ > do { f <- linRand 200.0 10000.0 (mce [-1, 1]) > ; let e = line KR 0.4 0 0.01 RemoveSynth > in audition (out 0 (fSinOsc AR f 0 * e)) }
Help/UGen/Noise/nRand.help.lhs view
@@ -8,6 +8,8 @@ n = 3 : smooth hump as n increases, distribution converges towards gaussian +> import Sound.SC3.Monadic+ > do { n <- nRand 1200.0 4000.0 (mce [2, 5]) > ; let e = line KR 0.2 0 0.01 RemoveSynth > in audition (out 0 (fSinOsc AR n 0 * e)) }
Help/UGen/Noise/pinkNoise.help.lhs view
@@ -4,6 +4,8 @@ octave. This gives equal power over the span of each octave. This version gives 8 octaves of pink noise. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.05) =<< pinkNoise AR > audition . (out 0) . (* 0.05) =<< whiteNoise AR
Help/UGen/Noise/rand.help.lhs view
@@ -4,6 +4,8 @@ hi. It generates this when the SynthDef first starts playing, and remains fixed for the duration of the synth's existence. +> import Sound.SC3.Monadic+ > do { f <- rand 200 1200 > ; l <- rand (-1) 1 > ; let { e = line KR 0.2 0 0.1 RemoveSynth
Help/UGen/Noise/tExpRand.help.lhs view
@@ -5,5 +5,7 @@ positive values lo and hi must both have the same sign and be non-zero. +> import Sound.SC3.Monadic+ > do { f <- tExpRand 300.0 3000.0 =<< dust KR 10 > ; audition (out 0 (sinOsc AR f 0 * 0.1)) }
Help/UGen/Noise/tRand.help.lhs view
@@ -3,6 +3,8 @@ Generates a random float value in uniform distribution from lo each time the trig signal changes from nonpositive to positive values +> import Sound.SC3.Monadic+ > do { t <- dust KR (mce [5, 12]) > ; f <- tRand (mce [200, 1600]) (mce [500, 3000]) t > ; audition (out 0 (sinOsc AR f 0 * 0.2)) }
Help/UGen/Noise/tiRand.help.lhs view
@@ -4,6 +4,8 @@ hi each time the trig signal changes from nonpositive to positive values +> import Sound.SC3.Monadic+ > do { l <- tiRand (-1) 1 =<< dust KR 10 > ; n <- pinkNoise AR > ; audition (out 0 (pan2 (n * 0.1) l 1)) }
Help/UGen/Noise/whiteNoise.help.lhs view
@@ -2,6 +2,8 @@ Generates noise whose spectrum has equal power at all frequencies. +> import Sound.SC3.Monadic+ > audition . (out 0) . (* 0.05) =<< whiteNoise AR Random filtered noise bursts.
Help/UGen/Oscillator/fSinOsc.help.lhs view
@@ -14,6 +14,8 @@ Note the phase argument, which was not in the SC2 variant. +> import Sound.SC3+ > audition (out 0 (fSinOsc AR (mce [440, 550]) 0 * 0.05)) > audition (out 0 (fSinOsc AR (xLine KR 200 4000 1 RemoveSynth) 0 * 0.1))
Help/UGen/Oscillator/gendy1.help.lhs view
@@ -66,6 +66,8 @@ minfreq=440, maxfreq=660, ampscale= 0.5, durscale=0.5, initCPs= 12, knum=12. +> import Sound.SC3+ > let g = gendy1 AR 1 1 1 1 440 660 0.5 0.5 12 12 > in audition (out 0 (pan2 g 0 0.15)) @@ -150,6 +152,9 @@ > in audition (out 0 (pan2 g 0 0.2)) Texture++> import Sound.SC3.Monadic+> import Control.Monad > let node = do { f <- rand 130 160.3 > ; r0 <- rand 0 6
Help/UGen/Oscillator/impulse.help.lhs view
@@ -5,10 +5,13 @@ freq - frequency in Hertz phase - phase offset in cycles (0..1) +> import Sound.SC3+ > audition (out 0 (impulse AR 800 0 * 0.1)) > let f = xLine KR 800 10 5 RemoveSynth > in audition (out 0 (impulse AR f 0.0 * 0.1)) -> let f = mouseY KR 4 8 Linear 0.1-> in audition (out 0 (impulse AR f (mce [0, mouseX KR 0 1 Linear 0.1]) * 0.1))+> let { f = mouseY KR 4 8 Linear 0.1+ ; x = mouseX KR 0 1 Linear 0.1 }+> in audition (out 0 (impulse AR f (mce [0, x]) * 0.1))
Help/UGen/Oscillator/klang.help.lhs view
@@ -3,6 +3,8 @@ Bank of fixed oscillators. spec is constructed using klangSpec, which takes lists of frequency, amplitude and phase. +> import Sound.SC3+ > let { f = [440,550..1100] > ; a = take 7 (cycle [0.05, 0.02]) > ; p = replicate 7 0 }
Help/UGen/Oscillator/lfCub.help.lhs view
@@ -2,6 +2,8 @@ A sine like shape made of two cubic pieces. Smoother than lfPar. +> import Sound.SC3+ > audition (out 0 (lfCub AR (lfCub KR (lfCub KR 0.2 0 * 8 + 10) 0 * 400 + 800) 0 * 0.1)) > audition (out 0 (lfCub AR (lfCub KR 0.2 0 * 400 + 800) 0 * 0.1)) > audition (out 0 (lfCub AR 800 0 * 0.1))
Help/UGen/Oscillator/lfPulse.help.lhs view
@@ -8,6 +8,10 @@ iphase - initial phase offset in cycles ( 0..1 ) width - pulse width duty cycle from zero to one. -> audition (out 0 (lfPulse AR (lfPulse KR 3 0 0.3 * 200 + 200) 0 0.2 * 0.1))+> import Sound.SC3 -> audition (out 0 (lfPulse AR 220 0 (mouseX KR 0 1 Linear 0.2) * 0.1))+> let f = lfPulse KR 3 0 0.3 * 200 + 200+> in audition (out 0 (lfPulse AR f 0 0.2 * 0.1))++> let x = mouseX KR 0 1 Linear 0.2+> in audition (out 0 (lfPulse AR 220 0 x * 0.1))
Help/UGen/Oscillator/lfSaw.help.lhs view
@@ -6,6 +6,8 @@ freq - frequency in Hertz iphase - initial phase [0,2] +> import Sound.SC3+ > audition (out 0 (lfSaw AR 500 1 * 0.1)) Used as both Oscillator and LFO.
Help/UGen/Oscillator/lfTri.help.lhs view
@@ -3,6 +3,8 @@ A non-band-limited triangular waveform oscillator. Output ranges from -1 to +1. +> import Sound.SC3+ > audition (out 0 (lfTri AR 500 1 * 0.1)) Used as both Oscillator and LFO.
+ Help/UGen/Oscillator/pmOsc.help.lhs view
@@ -0,0 +1,23 @@+pmOsc rate cf mf pm mp++phase modulation oscillator (composite UGen)++ cf = carrier frequency+ mf = modulation frequency+ pm = modulator amplitude+ mp = modulator phase++The definition is:++ pmOsc r cf mf pm mp = sinOsc r cf (sinOsc r mf mp * pm)++> import Sound.SC3.Monadic++> do { cf <- rand 0 2000+> ; mf <- rand 0 800+> ; pm' <- rand 0 12+> ; l <- rand (-1) 1+> ; let { t = envLinen' 2 5 2 1 (EnvLin, EnvLin, EnvLin)+> ; e = envGen KR 1 0.1 0 1 RemoveSynth t+> ; pm = line KR 0 pm' 9 DoNothing }+> in audition (out 0 (linPan2 (pmOsc AR cf mf pm 0) l e)) }
Help/UGen/Oscillator/silent.help.lhs view
@@ -2,4 +2,6 @@ Generate a silent (zero) signal. +> import Sound.SC3+ > audition (out 0 (silent 1))
Help/UGen/Oscillator/sinOsc.help.lhs view
@@ -6,6 +6,8 @@ freq - frequency in Hertz phase - phase offset or modulator in radians +> import Sound.SC3+ > audition (out 0 (sinOsc AR 440 0 * 0.25)) Modulate freq@@ -21,3 +23,11 @@ > let p = sinOsc AR (xLine KR 20 8000 10 RemoveSynth) 0 * 2 * pi > in audition (out 0 (sinOsc AR 800 p * 0.1))++Simple bell-like tone.++> let { f = mce [0.5, 1, 1.19, 1.56, 2, 2.51, 2.66, 3.01, 4.1]+> ; a = mce [0.25, 1, 0.8, 0.5, 0.9, 0.4, 0.3, 0.6, 0.1]+> ; o = sinOsc AR (500 * f) 0 * a+> ; e = envGen KR 1 0.1 0 1 RemoveSynth (envPerc 0.01 10) }+> in audition (out 0 (mix o * e))
Help/UGen/Oscillator/syncSaw.help.lhs view
@@ -9,4 +9,6 @@ The frequency of the slave synched sawtooth wave should always be greater than the syncFreq. +> import Sound.SC3+ > audition (out 0 (syncSaw AR 100 (line KR 100 800 12 RemoveSynth) * 0.1))
Help/UGen/Oscillator/tChoose.help.lhs view
@@ -3,6 +3,9 @@ The output is selected randomly on recieving a trigger from an array of inputs. tChoose is a composite of tiRand and select. +> import Control.Monad+> import Sound.SC3.Monadic+ > let x = mouseX kr 1 1000 Exponential 0.1 > in do { t <- dust AR x > ; f <- liftM midiCPS (tiRand 48 60 t)
Help/UGen/Oscillator/tGrains.help.lhs view
@@ -34,12 +34,17 @@ interpolation, (2) linear interpolation, or (4) cubic interpolation. -> withSC3 (\fd -> async fd (b_allocRead 10 "/home/rohan/audio/metal.wav" 0 0))+> import Sound.SC3 +> let fn = "/home/rohan/audio/metal.wav"+> in withSC3 (\fd -> async fd (b_allocRead 10 fn 0 0))+ > let { tRate = mouseY KR 2 200 Exponential 0.1 > ; ctr = mouseX KR 0 (bufDur KR 10) Linear 0.1 > ; tr = impulse AR tRate 0 } > in audition (out 0 (tGrains 2 tr 10 1 ctr (4 / tRate) 0 0.1 2))++> import Sound.SC3.Monadic > let { b = 10 > ; trate = mouseY KR 8 120 Exponential 0.1
Help/UGen/Oscillator/twChoose.help.lhs view
@@ -8,6 +8,8 @@ normalize the values. TWChoose is a composite of TWindex and Select +> import Sound.SC3.Monadic+ > let x = mouseX KR 1 1000 Exponential 0.1 > in do { d <- dust AR x > ; let { a = mce [ sinOsc AR 220 0
Help/UGen/Oscillator/twindex.help.lhs view
@@ -6,6 +6,8 @@ the values get normalized by the ugen (less efficient) Assuming normalized values +> import Sound.SC3.Monadic+ > let { p = mce [1/5, 2/5, 2/5] > ; a = mce [400, 500, 600] > ; t = impulse KR 6 0 }@@ -16,6 +18,6 @@ > let { p = mce [1/4, 1/2, sinOsc KR 0.3 0 * 0.5 + 0.5] > ; a = mce [400, 500, 600]-> ; t = impulse KR 6 0-> ; f = select (twindex t 1 p) a }-> in audition (out 0 (sinOsc AR f 0 * 0.1))+> ; t = impulse KR 6 0 }+> in do { i <- twindex t 1 p+> ; audition (out 0 (sinOsc AR (select i a) 0 * 0.1)) }
Help/UGen/Panner/linPan2.help.lhs view
@@ -2,7 +2,9 @@ Two channel linear pan. See Pan2. -> do { n <- pinkNoise AR-> ; audition (out 0 (linPan2 n (fSinOsc KR 2 0) 0.1)) }+> import Sound.SC3.ID++> let n = pinkNoise 'a' AR+> in audition (out 0 (linPan2 n (fSinOsc KR 2 0) 0.1)) > audition (out 0 (linPan2 (fSinOsc AR 800 0) (fSinOsc KR 3 0) 0.1))
Help/UGen/Panner/pan2.help.lhs view
@@ -3,10 +3,12 @@ Two channel equal power panner. The pan position is bipolar, -1 is left, +1 is right. The level is a control rate input. -> do { n <- pinkNoise AR-> ; audition (out 0 (pan2 n (fSinOsc KR 2 0) 0.3)) }+> import Sound.SC3.ID -> do { n <- pinkNoise AR-> ; let { x = mouseX KR (-1) 1 Linear 0.2-> ; y = mouseY KR 0 1 Linear 0.2 }-> in audition (out 0 (pan2 n x y)) }+> let n = pinkNoise 'a' AR+> in audition (out 0 (pan2 n (fSinOsc KR 2 0) 0.3))++> let { n = pinkNoise 'a' AR+> ; x = mouseX KR (-1) 1 Linear 0.2+> ; y = mouseY KR 0 1 Linear 0.2 }+> in audition (out 0 (pan2 n x y))
Help/UGen/Panner/rotate2.help.lhs view
@@ -21,13 +21,15 @@ Rotation of stereo sound, via LFO. -> do { x <- pinkNoise AR-> ; let y = lfTri AR 800 0 * lfPulse KR 3 0 0.3 * 0.2-> in audition (out 0 (rotate2 x y (lfSaw KR 0.1 0))) }+> import Sound.SC3.ID +> let { x = pinkNoise 'a' AR+> ; y = lfTri AR 800 0 * lfPulse KR 3 0 0.3 * 0.2 }+> in audition (out 0 (rotate2 x y (lfSaw KR 0.1 0)))+ Rotation of stereo sound, via mouse. -> let { x = mix $ lfSaw AR (mce [198..201]) 0 * 0.1+> let { x = mix (lfSaw AR (mce [198..201]) 0 * 0.1) > ; y = sinOsc AR 900 0 * lfPulse KR 3 0 0.3 * 0.2 > ; p = mouseX KR 0 2 Linear 0.2 } > in audition (out 0 (rotate2 x y p))
Help/UGen/Panner/splay.help.lhs view
@@ -2,9 +2,12 @@ splay spreads an array of channels across the stereo field. -spread - 0 = mono, 1 = stereo-level - 0 = silent, 1 = unit gain (equal power level compensated)-center - -1 = left, 1 = right+ spread - 0 = mono, 1 = stereo+ level - 0 = silent, 1 = unit gain (equal power level compensated)+ center - negate 1 = left, 1 = right++> import Sound.SC3.Monadic+> import Control.Monad > do { i <- return 6 > ; r <- replicateM i (rand 10 20)
Help/UGen/Trigger/gate.help.lhs view
@@ -2,5 +2,7 @@ The signal at `in' is passed while `trig' is greater than zero. +> import Sound.SC3+ > let t = lfPulse AR 1 0 0.1 > in audition (out 0 (gate (fSinOsc AR 500 0 * 0.25) t))
Help/UGen/Trigger/inRange.help.lhs view
@@ -9,7 +9,9 @@ lo - low threshold hi - high threshold -> do { n <- brownNoise AR-> ; let { x = mouseX KR 1 2 Linear 0.1 -> ; o = sinOsc KR x 0 * 0.2 }-> in audition (out 0 (inRange o (-0.15) 0.15 * n * 0.1)) }+> import Sound.SC3.ID++> let { n = brownNoise 'α' AR+> ; x = mouseX KR 1 2 Linear 0.1 +> ; o = sinOsc KR x 0 * 0.2 }+> in audition (out 0 (inRange o (-0.15) 0.15 * n * 0.1))
Help/UGen/Trigger/lastValue.help.lhs view
@@ -2,6 +2,8 @@ Output the last value before the input changed more than a threshhold. +> import Sound.SC3+ > let x = mouseX KR 100 400 Linear 0.1 > in audition (out 0 (sinOsc AR (lastValue x 40) 0 * 0.1))
Help/UGen/Trigger/mostChange.help.lhs view
@@ -2,7 +2,9 @@ Output the input that changed most. -> do { n <- lfNoise0 KR 1-> ; let { x = mouseX KR 200 300 Linear 0.1-> ; f = mostChange (n * 400 + 900) x }-> in audition (out 0 (sinOsc AR f 0 * 0.1)) }+> import Sound.SC3.ID++> let { n = lfNoise0 'α' KR 1+> ; x = mouseX KR 200 300 Linear 0.1+> ; f = mostChange (n * 400 + 900) x }+> in audition (out 0 (sinOsc AR f 0 * 0.1))
Help/UGen/Trigger/peak.help.lhs view
@@ -3,7 +3,9 @@ Outputs the maximum value read at the `trig' input until `reset' is triggered. -> do { t <- dust AR 20-> ; let { r = impulse AR 0.4 0-> ; f = peak t r * 500 + 200 }-> in audition (out 0 (sinOsc AR f 0 * 0.2)) }+> import Sound.SC3.ID++> let { t = dust 'α' AR 20+> ; r = impulse AR 0.4 0+> ; f = peak t r * 500 + 200 }+> in audition (out 0 (sinOsc AR f 0 * 0.2))
Help/UGen/Trigger/phasor.help.lhs view
@@ -13,6 +13,8 @@ phasor controls sine frequency: end frequency matches a second sine wave. +> import Sound.SC3+ > let { rate = mouseX KR 0.2 2 Exponential 0.1 > ; tr = impulse AR rate 0 > ; sr = sampleRate
Help/UGen/Trigger/pulseCount.help.lhs view
@@ -3,5 +3,7 @@ This outputs the number of pulses received at `trig' and outputs that value until `reset' is triggered. +> import Sound.SC3+ > let c = pulseCount (impulse AR 10 0) (impulse AR 0.4 0)-> audition (out 0 (sinOsc AR (c * 200) 0 * 0.05))+> in audition (out 0 (sinOsc AR (c * 200) 0 * 0.05))
Help/UGen/Trigger/pulseDivider.help.lhs view
@@ -4,6 +4,8 @@ at its input. A trigger happens when the signal changes from non-positive to positive. +> import Sound.SC3+ > let { p = impulse AR 8 0 > ; d = pulseDivider p (mce [4,7]) 0 > ; a = sinOsc AR 1200 0 * decay2 p 0.005 0.1
Help/UGen/Trigger/runningMax.help.lhs view
@@ -7,7 +7,9 @@ in - input signal trig - reset the output value to the current input value -> do { n <- dust AR 20-> ; let { t = impulse AR 0.4 0-> ; f = runningMax n t * 500 + 200 }-> in audition (out 0 (sinOsc AR f 0 * 0.2)) }+> import Sound.SC3.ID++> let { n = dust 'α' AR 20+> ; t = impulse AR 0.4 0+> ; f = runningMax n t * 500 + 200 }+> in audition (out 0 (sinOsc AR f 0 * 0.2))
Help/UGen/Trigger/runningMin.help.lhs view
@@ -7,13 +7,17 @@ in - input signal trig - reset the output value to the current input value -> do { n <- dust AR 20-> ; let { t = impulse AR 0.4 0-> ; f = runningMin n t * 500 + 200 }-> in audition (out 0 (sinOsc AR f 0 * 0.2)) }+> import Sound.SC3 > let { o = sinOsc KR 2 0 > ; x = mouseX KR 0.01 10 Exponential 0.1 > ; t = impulse AR x 0 > ; f = runningMin o t * 500 + 200 }+> in audition (out 0 (sinOsc AR f 0 * 0.2))++> import Sound.SC3.ID++> let { n = dust 'α' AR 20+> ; t = impulse AR 0.4 0+> ; f = runningMin n t * 500 + 200 } > in audition (out 0 (sinOsc AR f 0 * 0.2))
Help/UGen/Trigger/sendTrig.help.lhs view
@@ -12,13 +12,15 @@ value - a UGen or float that will be polled at the time of trigger, and its value passed with the trigger message -> withSC3 (\fd -> async fd (notify True))+> import Sound.SC3.ID -> do { s <- lfNoise0 KR 10-> ; let o = sinOsc AR (s * 200 + 500) 0 * 0.1-> in audition (mrg [sendTrig s 0 s, out 0 o]) }+> let { s = lfNoise0 'α' KR 5+> ; o = sinOsc AR (s * 200 + 500) 0 * 0.1 }+> in audition (mrg [sendTrig s 0 s, out 0 o]) -> withSC3 (\fd -> do { tr <- wait fd "/tr"-> ; putStrLn (show tr) })+> import Sound.OpenSoundControl -> withSC3 (\fd -> async fd (notify False))+> withSC3 (\fd -> do { async fd (notify True)+> ; tr <- wait fd "/tr"+> ; putStrLn (show tr)+> ; async fd (notify False) })
Help/UGen/Trigger/setResetFF.help.lhs view
@@ -9,7 +9,9 @@ trig - trigger sets output to one reset - trigger resets output to zero -> do { n <- brownNoise AR-> ; d0 <- dust AR 5-> ; d1 <- dust AR 5-> ; audition (out 0 (setResetFF d0 d1 * n * 0.2)) }+> import Sound.SC3.ID++> let { n = brownNoise 'α' AR+> ; d0 = dust 'α' AR 5+> ; d1 = dust 'β' AR 5 }+> in audition (out 0 (setResetFF d0 d1 * n * 0.2))
Help/UGen/Trigger/stepper.help.lhs view
@@ -3,16 +3,16 @@ Stepper pulse counter. Each trigger increments a counter which is output as a signal. The counter wraps between min and max. -trig - trigger. Trigger can be any signal. A trigger happens when the- signal changes from non-positive to positive.+ trig - trigger. Trigger can be any signal. A trigger happens when+ the signal changes from non-positive to positive. -reset - resets the counter to resetval when triggered.+ reset - resets the counter to resetval when triggered. -min - minimum value of the counter.+ min - minimum value of the counter. -max - maximum value of the counter.+ max - maximum value of the counter. -step - step value each trigger. May be negative.+ step - step value each trigger. May be negative. resetval - value to which the counter is reset when it receives a reset trigger. If nil, then this is patched to min.
Help/UGen/Trigger/sweep.help.lhs view
@@ -5,6 +5,8 @@ Using sweep to modulate sine frequency +> import Sound.SC3+ > let { x = mouseX KR 0.5 20 Exponential 0.1 > ; t = impulse KR x 0 > ; f = sweep t 700 + 500 }@@ -12,7 +14,8 @@ Using sweep to index into a buffer -> withSC3 (\fd -> send fd (b_allocRead 0 "/home/rohan/audio/metal.wav" 0 0))+> let fn = "/home/rohan/audio/metal.wav"+> in withSC3 (\fd -> send fd (b_allocRead 0 fn 0 0)) > let { x = mouseX KR 0.5 20 Exponential 0.1 > ; t = impulse AR x 0@@ -21,12 +24,14 @@ Backwards, variable offset -> do { n <- lfNoise0 KR 15-> ; let { x = mouseX KR 0.5 10 Exponential 0.1-> ; t = impulse AR x 0-> ; r = bufSampleRate KR 0-> ; p = sweep t (negate r) + (bufFrames KR 0 * n) }-> in audition (out 0 (bufRdL 1 AR 0 p NoLoop)) }+> import Sound.SC3.ID++> let { n = lfNoise0 'a' KR 15+> ; x = mouseX KR 0.5 10 Exponential 0.1+> ; t = impulse AR x 0+> ; r = bufSampleRate KR 0+> ; p = sweep t (negate r) + (bufFrames KR 0 * n) }+> in audition (out 0 (bufRdL 1 AR 0 p NoLoop)) Raising rate
Help/UGen/Trigger/tDelay.help.lhs view
@@ -6,6 +6,8 @@ trigger - input trigger signal. delayTime - delay time in seconds. +> import Sound.SC3+ > let { z = impulse AR 2 0 > ; z' = tDelay z 0.5 > ; o = sinOsc AR 440 0 * 0.1 }
Help/UGen/Trigger/timer.help.lhs view
@@ -5,5 +5,7 @@ Using timer to modulate sine frequency: the slower the trigger is the higher the frequency +> import Sound.SC3+ > let t = impulse KR (mouseX KR 0.5 20 Exponential 0.1) 0 > in audition (out 0 (sinOsc AR (timer t * 500 + 500) 0 * 0.2))
Help/UGen/Trigger/toggleFF.help.lhs view
@@ -1,8 +1,12 @@ toggleFF trig -Toggle flip flop. Toggles between zero and one upon receiving a trigger.+Toggle flip flop. Toggles between zero and one upon receiving a+trigger. trig - trigger input -> do { t <- dust AR (xLine KR 1 1000 60 DoNothing)-> ; audition (out 0 (sinOsc AR (toggleFF t * 400 + 800) 0 * 0.1)) }+> import Sound.SC3.ID++> let { t = dust 'a' AR (xLine KR 1 1000 60 DoNothing)+> ; t' = toggleFF t * 400 + 800 }+> in audition (out 0 (sinOsc AR t' 0 * 0.1))
Help/UGen/Trigger/trig.help.lhs view
@@ -2,6 +2,8 @@ When `in' is trigerred output the trigger value for `dur' seconds. -> do { d <- dust AR 1-> ; let o = fSinOsc AR 800 0 * 0.5-> in audition (out 0 (trig d 0.2 * o)) }+> import Sound.SC3.ID++> let { d = dust 'a' AR 1+> ; o = fSinOsc AR 800 0 * 0.5 }+> in audition (out 0 (trig d 0.2 * o))
Help/UGen/Trigger/trig1.help.lhs view
@@ -2,5 +2,7 @@ When `in' is trigered output a unit signal for `dur' seconds. -> do { d <- dust AR 1-> ; audition (out 0 (trig1 d 0.2 * fSinOsc AR 800 0 * 0.2)) }+> import Sound.SC3.ID++> let d = dust 'a' AR 1+> in audition (out 0 (trig1 d 0.2 * fSinOsc AR 800 0 * 0.2))
Help/hsc3.help.lhs view
@@ -231,6 +231,7 @@ the clone function: > import Control.Monad+> import Sound.SC3.Monadic > let f = liftM (* mce [0.1, 0.05]) > in do { a <- f (clone 2 (whiteNoise AR))@@ -409,8 +410,8 @@ value. Therefore the graph given by the haskell expression: -> let { z = uid 0-> ; n = Sound.SC3.UGen.Base.whiteNoise z+> let { z = 'α'+> ; n = Sound.SC3.UGen.Noise.ID.whiteNoise z > ; a = n AR > ; b = n AR > ; c = a - b }@@ -500,7 +501,7 @@ > ; a >>=* b = a >>= b |> return > ; u1 = sinOsc ar 440 0 * 0.1 > ; u2 = pinkNoise ar >>=* (* 0.1)-> ; u3 = B.pinkNoise (uid 0) ar * 1+> ; u3 = Sound.SC3.UGen.Noise.ID.pinkNoise 'α' ar * 1 > ; u4 = resonz u3 (440 * 4) 0.1 > ; g = u2 >>=* (+ (u1 + u4)) } > in g >>= out 0 |> audition@@ -524,7 +525,9 @@ This is hardly more convenient than do notation, however we can also insert non-determinstic nodes-directly into function arguments.+directly into function arguments. The package+hsc3-unsafe provides unsafe variant unnit generator+constructors. > let { n = Sound.SC3.UGen.Unsafe.whiteNoise > ; x = n AR - n AR }@@ -534,6 +537,9 @@ provided at Sound.SC3.UGen.Unsafe, and avoids the lifting operations which, for functions of many arguments, can be cumbersome.++> import Control.Monad+> import Sound.SC3.Monadic > let n = whiteNoise > in do { x <- liftM2 (-) (n AR) (n AR)
+ Help/tutorial.lhs view
@@ -0,0 +1,313 @@+* Haskell SuperCollider, a Tutorial.++* Prerequisites++Haskell SuperCollider requires that SuperCollider [1], GHC [2],+Emacs [4] and the standard Haskell Emacs mode [5] are all+installed and working properly.++* Setting up Haskell SuperCollider++Haskell SuperCollider is available through the haskell community+library system Hackage [6]. To install type:++ $ cabal install hsc3++Haskell SuperCollider is also available as a set of darcs [7]+repositories, the first implementing the Sound.OpenSoundControl+module, the second the Sound.SC3 module.++ $ darcs get http://slavepianos.org/rd/sw/hosc+ $ darcs get http://slavepianos.org/rd/sw/hsc3++To build use the standard Cabal process in each repository in+sequence. To install to the user package database type:++ $ cabal install++* Setting up the Haskell SuperCollider Emacs mode++Add an appropriately modified variant of the following to+~/.emacs++ (push "~/sw/hsc3/emacs" load-path)+ (setq hsc3-help-directory "~/sw/hsc3/Help/")+ (require 'hsc3)++The hsc3 emacs mode associates itself with files having the+extension '.lhs'. When the hsc3 emacs mode is active there is a+'Haskell SuperCollider' menu available.++* Literate Haskell++The documentation for Haskell SuperCollider, including this+tutorial, is written in 'Bird' notation, a form of 'literate+Haskell' where lines starting with '>' are Haskell code and+everything else is commentary.++Unlike ordinary literate programs the Haskell SuperCollider help+files cannot be compiled to executables. Each help file contains+multiple independant examples that can be evaluated using editor+commands, either by selecting from the 'Haskell SuperCollider'+menu or using the associated keybinding.++* Interpreter Interaction & User Configuration++To start ghci and load the file at 'hsc3-run-control' file use+C-cC-s (Haskell SuperCollider -> Haskell -> Start haskell).++If there is no file at 'hsc3-run-control' one will be created and+the modules at 'hsc3-modules' will be imported. By default this+list contains the hosc and hsc3 modules as well as+Control.Concurrent, Control.Monad, Data.List, and System.Random.++Starting the interpreter splits the current window into two+windows. If the ghci output window becomes obscured during a+session you can see it again by typing C-cC-g (Haskell+SuperCollider -> Haskell -> See output).++To interrupt ghci type C-cC-i (Haskell SuperCollider -> Haskell+-> Interrupt haskell).++To stop ghci type C-cC-x (Haskell SuperCollider -> Haskell ->+Quit haskell).++* Starting the SuperCollider server++The SuperCollider server can be started from the command line.+The help files assume that scsynth is listening for UDP+connections at the standard port on the local machine.++ $ scsynth -u 57110++* Basic SuperCollider Interaction++The SuperCollider server manages a graph of nodes with integer+identifiers. The root node has ID zero. By convention ordinary+graph nodes are placed in a group with identifier 1, however this+node is not created when scsynth starts.++To create this node we need to send an OSC message to the server,+the expression to do this is written below. To run single line+expressions move the cursor to the line and type C-cC-c (Haskell+SuperCollider -> Expression -> Run line).++> import Sound.SC3++> withSC3 (\fd -> send fd (g_new [(1, AddToTail, 0)]))++We can then audition a quiet sine oscillator at A440.++> audition (out 0 (sinOsc AR 440 0 * 0.1))++To stop the sound we can delete the group it is a part of, the+audition function places the synthesis node into the group node+with ID 1, the expression below deletes that group.++> withSC3 (\fd -> send fd (n_free [1]))++In order to audition another graph we need to re-create a group+with ID 1. Sound.SC3 includes a function 'reset' that sequences+these two actions, first deleting the group node, then+re-creating a new empty group.++> withSC3 reset++Using this command is so common there is a keybinding for it,+C-cC-k (Haskell SuperCollider -> SCSynth -> Reset scsynth).+After a reset we can audition a new graph.++> audition (out 0 (sinOsc AR 220 0 * 0.1))++To see the server status type C-cC-w (Haskell SuperCollider ->+SCSynth -> Display status). This prints a table indicating+server activity to the ghci output window.++ ***** SuperCollider Server Status *****+ # UGens Int 3+ # Synths Int 1+ # Groups Int 2+ # Instruments Int 1+ % CPU (Average) Float 2.6957032680511475+ % CPU (Peak) Float 2.7786526679992676+ Sample Rate (Nominal) Double 44100.0+ Sample Rate (Actual) Double 44099.958404246536++* Completion messages++To send a completion message add one to an existing+asynchronous message using withCM.++> let { g = out 0 (sinOsc AR 660 0 * 0.15)+> ; m = d_recv (synthdef "sin" g)+> ; cm = s_new "sin" 100 AddToTail 1 [] }+> in withSC3 (\fd -> send fd (withCM m cm))++Alternately use variant constructors for the+asynchronous commands.++> import Sound.SC3.Server.Command.Completion++> let { g = out 0 (sinOsc AR 660 0 * 0.15)+> ; cm = s_new "sin" 100 AddToTail 1 []+> ; m = d_recv' cm (synthdef "sin" g) }+> in withSC3 (\fd -> send fd m)++* Controls++In hsc3 control parameters must be indexed by name.++There are four types of control parameters,+initialisation-rate (ir), control-rate (kr),+triggered-control-rate (tr) and audio-rate.++The graph below illustrates the first three of these.+Note the specialised constructor for triggered+controls. ++> let { b1 = control IR "b1" 0+> ; b2 = control IR "b2" 1+> ; f1 = control KR "f1" 450+> ; f2 = control KR "f2" 900+> ; a1 = tr_control "a1" 0+> ; a2 = tr_control "a2" 0+> ; m = impulse KR 1 0 * 0.1+> ; d x = decay2 (m + x) 0.01 0.2+> ; o1 = sinOsc AR f1 0 * d a1+> ; o2 = saw AR f2 * d a2+> ; g = mrg2 (out b1 o1) (out b2 o2)+> ; i fd = do { async fd (d_recv (synthdef "g" g))+> ; send fd (s_new "g" 100 AddToTail 1 []) } }+> in withSC3 i++The output buses cannot be set, since they are+initialisation rate only.++> withSC3 (\fd -> send fd (n_set1 100 "b1" 1))+> withSC3 (\fd -> send fd (n_set1 100 "b2" 0))++The frequency controls can be set since they are+control rate.++> withSC3 (\fd -> send fd (n_set1 100 "f1" 200))+> withSC3 (\fd -> send fd (n_set1 100 "f2" 300))++The audio controls can be set, however they are+immediately reset to zero at the next control cycle.++> withSC3 (\fd -> send fd (n_set1 100 "a1" 1))+> withSC3 (\fd -> send fd (n_set1 100 "a2" 1))++* Multiple line expressions++There are two variants for expressions that are written over+multiple lines.++To evaluate an expression that is written without using the+Haskell layout rules select the region and type C-cC-e (Haskell+SuperCollider -> Expression -> Run multiple lines). To select a+region use the mouse or place the cursor at one end, type+C-[Space] then move the cursor to the other end.++> let { f0 = xLine KR 1 1000 9 RemoveSynth+> ; f1 = sinOsc AR f0 0 * 200 + 800 }+> in audition (out 0 (sinOsc AR f1 0 * 0.1))++To evaluate a multiple line expression written using the layout+rules as applicable within a do block, select the region and type+C-cC-r (Haskell SuperCollider -> Expression -> Run region).++> let f0 = xLine KR 1 1000 9 RemoveSynth+> f1 = sinOsc AR f0 0 * 200 + 800+> audition (out 0 (sinOsc AR f1 0 * 0.1))++This writes the region in a do block in a procedure to a+temporary file, /tmp/hsc3.lhs, loads the file and then runs the+procedure. The preamble imports the modules listed at the emacs+variable hsc3-modules.++ghci understands import expressions, so to add a module to the+current scope it is enough to type C-cC-c at an appropriate+location. If hsc3-dot is installed, the following two+expressions will load the module and make a drawing.++> import Sound.SC3+> import Sound.SC3.UGen.Dot++> let { o = control KR "bus" 0+> ; f = mouseX KR 440 880 Exponential 0.1 }+> in draw (out o (sinOsc AR f 0))++* Help Files++To find help on a unit generator or on a SuperCollider server+command place the cursor over the identifier and type C-cC-h+(Haskell SuperCollider -> Help -> Haskell SuperCollider help).+This opens the help file, which ought to have working examples in+it, the above graph is in the sinOsc help file, the s_new help+file explains what arguments are required and what they mean.++The Haskell SuperCollider help files are derived from the help+files distributed with SuperCollider, the text is re-formatted to+read well as plain text and examples are translated into Haskell.++There is also partial haddock documentation for the Sound.SC3 and+Sound.OpenSoundControl modules, to build type:++ $ runhaskell Setup.lhs haddock++* Identifier lookup & hasktags++The emacs command M-. (find-tag) looks up an identifier in a+'tags' table. The hasktags utility can generate tags files from+haskell source files that are usable with emacs.++To generate a tags file for hsc3, visit the hsc3 directory and+type:++ $ find Sound -name '*.*hs' | xargs hasktags -e++To use the hsc3 tags table type `M-x visit-tags-table', or add an+entry to ~/.emacs:++ (setq tags-table-list '("~/sw/hsc3"))++* External Unit Generators++hsc3 includes bindings and help files for some unit generators+not in the standard supercollider distribution. In order to use+these unit generators they must be installed, see:++ http://sf.net/projects/sc3-plugins/++* Example Unit Generator Graphs++The Help/ directory contains example unit generator+graphs. To audition a graph from Emacs type C-cC-l+C-cC-m. Many of the graphs are self contained,+selecting the graph (excluding the 'main =' line) and+typing C-cC-e will audition it. In many cases both+supercollider language and haskell versions are given,+switch the emacs buffer to sclang-mode to run the+supercollider language versions.++* Monitoring incoming server messages++To monitor what OSC messages scsynth is receiving use the+'dumpOSC' server command to request that scsynth print text+traces of incoming messages to its standard output.++> withSC3 ((flip send) (dumpOSC TextPrinter))++To end printing send:++> withSC3 ((flip send) (dumpOSC NoPrinter))++* References++[1] http://audiosynth.com/+[2] http://haskell.org/ghc/+[4] http://gnu.org/software/emacs/+[5] http://haskell.org/haskell-mode/+[6] http://hackage.haskell.org/+[7] http://darcs.net/
README view
@@ -4,16 +4,16 @@ Haskell as a client to the SuperCollider synthesis server. For installation and configuration information please consult the-tutorial file at Help/Tutorial.+tutorial file at Help/tutorial.lhs The hsc3 interaction environment is written for GNU Emacs. - http://slavepianos.org/rd/f/207949/+ http://slavepianos.org/rd/?t=hsc3 http://haskell.org/ http://audiosynth.com/ http://gnu.org/software/emacs/ -(c) rohan drape and others, 2006-2009+(c) rohan drape and others, 2006-2010 gpl, http://gnu.org/copyleft/ with contributions by henning thielemann & stefan kersten
Sound/SC3.hs view
@@ -1,18 +1,16 @@-module Sound.SC3 (- -- $help-- module Sound.SC3.UGen,- module Sound.SC3.Server) where+module Sound.SC3 (-- $help+ module Sound.SC3.Server+ ,module Sound.SC3.UGen) where -import Sound.SC3.UGen import Sound.SC3.Server+import Sound.SC3.UGen -- $help -- Once the hsc3 library has been installed, you will find help files -- installed in @$PREFIX\/share\/hsc3-VERSION\/Help\/@. -- -- For installation and configuration information please consult the--- tutorial file at @Help\/Tutorial\/Tutorial.lhs@.+-- tutorial file at @Help\/tutorial.lhs@. -- -- For general information on supercollider and the overall design of -- the hsc3 bindings, see @Help\/hsc3.help.lhs@.
+ Sound/SC3/ID.hs view
@@ -0,0 +1,11 @@+module Sound.SC3.ID (module Sound.SC3.UGen+ ,module Sound.SC3.UGen.Demand.ID+ ,module Sound.SC3.UGen.FFT.ID+ ,module Sound.SC3.UGen.Noise.ID+ ,module Sound.SC3.Server) where++import Sound.SC3.UGen+import Sound.SC3.UGen.Demand.ID+import Sound.SC3.UGen.FFT.ID+import Sound.SC3.UGen.Noise.ID+import Sound.SC3.Server
+ Sound/SC3/Monadic.hs view
@@ -0,0 +1,14 @@+module Sound.SC3.Monadic (module Sound.SC3.UGen+ ,module Sound.SC3.UGen.Composite.Monadic+ ,module Sound.SC3.UGen.Demand.Monadic+ ,module Sound.SC3.UGen.FFT.Monadic+ ,module Sound.SC3.UGen.Noise.Monadic+ ,module Sound.SC3.Server) where++import Sound.SC3.UGen+import Sound.SC3.UGen.Composite.Monadic+import Sound.SC3.UGen.Demand.Monadic+import Sound.SC3.UGen.FFT.Monadic+import Sound.SC3.UGen.Noise.Monadic+import Sound.SC3.Server+
Sound/SC3/Server/Command.hs view
@@ -2,6 +2,7 @@ -- synthesis server. module Sound.SC3.Server.Command where +import qualified Data.ByteString.Lazy as B import Data.Word import Sound.OpenSoundControl import Sound.SC3.Server.Utilities@@ -135,11 +136,15 @@ b_alloc :: Int -> Int -> Int -> OSC b_alloc nid frames channels = Message "/b_alloc" [Int nid, Int frames, Int channels] --- | Allocate buffer space and read a sound file.+-- | Allocate buffer space and read a sound file. (Asynchronous) b_allocRead :: Int -> String -> Int -> Int -> OSC b_allocRead nid p f n = Message "/b_allocRead" [Int nid, String p, Int f, Int n] --- | Close attached soundfile and write header information.+-- | Allocate buffer space and read a sound file, picking specific channels. (Asynchronous)+b_allocReadChannel :: Int -> String -> Int -> Int -> [Int] -> OSC+b_allocReadChannel nid p f n cs = Message "/b_allocReadChannel" ([Int nid, String p, Int f, Int n] ++ map Int cs)++-- | Close attached soundfile and write header information. (Asynchronous) b_close :: Int -> OSC b_close nid = Message "/b_close" [Int nid] @@ -147,11 +152,11 @@ b_fill :: Int -> [(Int, Int, Double)] -> OSC b_fill nid l = Message "/b_fill" (Int nid : mk_triples Int Int Float l) --- | Free buffer data.+-- | Free buffer data. (Asynchronous) b_free :: Int -> OSC b_free nid = Message "/b_free" [Int nid] --- | Call a command to fill a buffer.+-- | Call a command to fill a buffer. (Asynchronous) b_gen :: Int -> String -> [Double] -> OSC b_gen bid cmd arg = Message "/b_gen" (Int bid : String cmd : map Float arg) @@ -167,10 +172,14 @@ b_query :: [Int] -> OSC b_query = Message "/b_query" . map Int --- | Read sound file data into an existing buffer.+-- | Read sound file data into an existing buffer. (Asynchronous) b_read :: Int -> String -> Int -> Int -> Int -> Int -> OSC b_read nid p f n f' z = Message "/b_read" [Int nid, String p, Int f, Int n, Int f', Int z] +-- | Read sound file data into an existing buffer, picking specific channels. (Asynchronous)+b_readChannel :: Int -> String -> Int -> Int -> Int -> Int -> [Int] -> OSC+b_readChannel nid p f n f' z cs = Message "/b_readChannel" ([Int nid, String p, Int f, Int n, Int f', Int z] ++ map Int cs)+ -- | Set sample values. b_set :: Int -> [(Int, Double)] -> OSC b_set nid l = Message "/b_set" (Int nid : mk_duples Int Float l)@@ -180,11 +189,11 @@ b_setn nid l = Message "/b_setn" (Int nid : concatMap f l) where f (i,d) = Int i : Int (length d) : map Float d --- | Write sound file data.+-- | Write sound file data. (Asynchronous) b_write :: Int -> String -> Int -> Int -> Int -> Int -> Int -> OSC b_write nid p h t f s z = Message "/b_write" [Int nid, String p, Int h, Int t, Int f, Int s, Int z] --- | Zero sample data.+-- | Zero sample data. (Asynchronous) b_zero :: Int -> OSC b_zero nid = Message "/b_zero" [Int nid] @@ -261,6 +270,25 @@ -- | Set a signle node control value. n_set1 :: Int -> String -> Double -> OSC n_set1 nid k n = n_set nid [(k, n)]++-- * Modify existing message to include completion message++-- List of asynchronous server commands.+async_cmds :: [String]+async_cmds = ["/d_recv", "/d_load", "/d_loadDir"+ ,"/b_alloc", "/b_allocRead", "/b_allocReadChannel"+ ,"/b_free", "/b_close"+ ,"/b_read", "/b_readChannel"+ ,"/b_write", "/b_zero"]++-- | Add a completion message to an existing asynchronous command.+withCM :: OSC -> OSC -> OSC+withCM (Message c xs) cm =+ if c `elem` async_cmds+ then let xs' = xs ++ [Blob (B.unpack (encodeOSC cm))]+ in Message c xs'+ else error ("withCM: not async: " ++ c)+withCM _ _ = error "withCM: not message" -- Local Variables: -- truncate-lines:t
+ Sound/SC3/Server/Command/Completion.hs view
@@ -0,0 +1,82 @@+-- | 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 (+ -- *Synthdef handling+ d_recv'+ , d_load'+ , d_loadDir'+ -- *Buffer allocation+ , b_alloc'+ , b_allocRead'+ , b_allocReadChannel'+ , b_free'+ , b_close'+ -- *Buffer reading+ , b_read'+ , b_readChannel'+ -- *Buffer writing+ , b_write'+ -- *Buffer operations+ , b_zero'+) where++import Data.Word (Word8)+import qualified Data.ByteString.Lazy as B+import Sound.OpenSoundControl++-- Encode an OSC packet as an OSC blob.+encode_osc_blob :: OSC -> Datum+encode_osc_blob = Blob . B.unpack . encodeOSC++-- | Install a bytecode instrument definition. (Asynchronous)+d_recv' :: OSC -> [Word8] -> OSC+d_recv' osc b = Message "/d_recv" [Blob b, encode_osc_blob osc]++-- | Load an instrument definition from a named file. (Asynchronous)+d_load' :: OSC -> String -> OSC+d_load' osc p = Message "/d_load" [String p, encode_osc_blob osc]++-- | Load a directory of instrument definitions files. (Asynchronous)+d_loadDir' :: OSC -> String -> OSC+d_loadDir' osc p = Message "/d_loadDir" [String p, encode_osc_blob osc]++-- | Allocates zero filled buffer to number of channels and samples. (Asynchronous)+b_alloc' :: OSC -> Int -> Int -> Int -> OSC+b_alloc' osc nid frames channels = Message "/b_alloc" [Int nid, Int frames, Int channels, encode_osc_blob osc]++-- | Allocate buffer space and read a sound file. (Asynchronous)+b_allocRead' :: OSC -> Int -> String -> Int -> Int -> OSC+b_allocRead' osc nid p f n = Message "/b_allocRead" [Int nid, String p, Int f, Int n, encode_osc_blob osc]++-- | Allocate buffer space and read a sound file, picking specific channels. (Asynchronous)+b_allocReadChannel' :: OSC -> Int -> String -> Int -> Int -> [Int] -> OSC+b_allocReadChannel' osc nid p f n cs = Message "/b_allocReadChannel" ([Int nid, String p, Int f, Int n] ++ map Int cs ++ [encode_osc_blob osc])++-- | Free buffer data. (Asynchronous)+b_free' :: OSC -> Int -> OSC+b_free' osc nid = Message "/b_free" [Int nid, encode_osc_blob osc]++-- | Close attached soundfile and write header information. (Asynchronous)+b_close' :: OSC -> Int -> OSC+b_close' osc nid = Message "/b_close" [Int nid, encode_osc_blob osc]++-- | Read sound file data into an existing buffer. (Asynchronous)+b_read' :: OSC -> Int -> String -> Int -> Int -> Int -> Int -> OSC+b_read' osc nid p f n f' z = Message "/b_read" [Int nid, String p, Int f, Int n, Int f', Int z, encode_osc_blob osc]++-- | Read sound file data into an existing buffer. (Asynchronous)+b_readChannel' :: OSC -> Int -> String -> Int -> Int -> Int -> Int -> [Int] -> OSC+b_readChannel' osc nid p f n f' z cs = Message "/b_readChannel" ([Int nid, String p, Int f, Int n, Int f', Int z] ++ map Int cs ++ [encode_osc_blob osc])++-- | Write sound file data. (Asynchronous)+b_write' :: OSC -> Int -> String -> Int -> Int -> Int -> Int -> Int -> OSC+b_write' osc nid p h t f s z = Message "/b_write" [Int nid, String p, Int h, Int t, Int f, Int s, Int z, encode_osc_blob osc]++-- | Zero sample data. (Asynchronous)+b_zero' :: OSC -> Int -> OSC+b_zero' osc nid = Message "/b_zero" [Int nid, encode_osc_blob osc]+
Sound/SC3/Server/Synthdef.hs view
@@ -31,23 +31,44 @@ | NodeK { node_id :: NodeId , node_k_rate :: Rate , node_k_name :: String- , node_k_default :: Double }+ , node_k_default :: Double+ , node_k_type :: KType } | NodeU { node_id :: NodeId , node_u_rate :: Rate , node_u_name :: String , node_u_inputs :: [FromPort] , node_u_outputs :: [Output] , node_u_special :: Special- , node_u_ugenid :: Maybe UGenId }+ , node_u_ugenid :: Int } | NodeP { node_id :: NodeId , node_p_node :: Node , node_p_index :: PortIndex } deriving (Eq, Show) +-- There are four classes of controls.+data KType = K_IR | K_KR | K_TR | K_AR+ deriving (Eq, Show, Ord)++node_k_cmp :: Node -> Node -> Ordering+node_k_cmp p q = compare (node_k_type p) (node_k_type q)++-- Determine class of control given rate and name.+ktype :: Rate -> Bool -> KType+ktype r tr =+ if tr+ then case r of+ KR -> K_TR+ _ -> error "ktype"+ else case r of+ IR -> K_IR+ KR -> K_KR+ AR -> K_AR+ DR -> error "ktype"+ -- | Type to represent the left hand side of an edge in a unit -- generator graph. data FromPort = C NodeId- | K NodeId+ | K NodeId KType | U NodeId PortIndex deriving (Eq, Show) @@ -55,10 +76,11 @@ synth :: UGen -> Graph synth u = let (_, g) = mk_node (prepare_root u) empty_graph (Graph _ cs ks us) = g- us' = if null ks+ ks' = sortBy node_k_cmp ks+ us' = if null ks' then reverse us- else implicit ks : reverse us- in Graph (-1) cs ks us'+ else implicit ks' ++ reverse us+ in Graph (-1) cs ks' us' -- | Transform a unit generator into bytecode. synthdef :: String -> UGen -> [Word8]@@ -82,7 +104,7 @@ as_from_port :: Node -> FromPort as_from_port (NodeC n _) = C n-as_from_port (NodeK n _ _ _) = K n+as_from_port (NodeK n _ _ _ t) = K n t as_from_port (NodeU n _ _ _ _ _ _) = U n 0 as_from_port (NodeP _ u p) = U (node_id u) p @@ -110,21 +132,21 @@ -- Predicate to locate control, names must be unique. find_k_p :: String -> Node -> Bool-find_k_p x (NodeK _ _ y _) = x == y+find_k_p x (NodeK _ _ y _ _) = x == y find_k_p _ _ = error "find_k_p" -- Insert a control node into the graph.-push_k :: (Rate, String, Double) -> Graph -> (Node, Graph)-push_k (r, nm, d) g =- let n = NodeK (nextId g) r nm d+push_k :: (Rate, String, Double, Bool) -> Graph -> (Node, Graph)+push_k (r, nm, d, tr) g =+ let n = NodeK (nextId g) r nm d (ktype r tr) in (n, g { controls = n : controls g , nextId = nextId g + 1 }) -- Either find existing control node, or insert a new node. mk_node_k :: UGen -> Graph -> (Node, Graph)-mk_node_k (Control r nm d) g =+mk_node_k (Control r nm d tr) g = let y = find (find_k_p nm) (controls g)- in maybe (push_k (r, nm, d) g) (\y' -> (y', g)) y+ in maybe (push_k (r, nm, d, tr) g) (\y' -> (y', g)) y mk_node_k _ _ = error "mk_node_k" acc :: [UGen] -> [Node] -> Graph -> ([Node], Graph)@@ -132,7 +154,7 @@ acc (x:xs) ys g = let (y, g') = mk_node x g in acc xs (y:ys) g' -type UGenParts = (Rate, String, [FromPort], [Output], Special, Maybe UGenId)+type UGenParts = (Rate, String, [FromPort], [Output], Special, Int) -- Predicate to locate primitive, names must be unique. find_u_p :: UGenParts -> Node -> Bool@@ -175,27 +197,47 @@ | otherwise = error "mk_node" type Map = M.IntMap Int-type Maps = (Map, Map, Map)+type Maps = (Map, [Node], Map, Map) -- Generate maps from node identifiers to synthdef indexes. mk_maps :: Graph -> Maps mk_maps (Graph _ cs ks us) = ( M.fromList (zip (map node_id cs) [0..])+ , ks , M.fromList (zip (map node_id ks) [0..]) , M.fromList (zip (map node_id us) [0..]) ) --- Locate index in map give node identifer.+-- Locate index in map given node identifer. fetch :: NodeId -> Map -> Int fetch = M.findWithDefault (error "fetch") data Input = Input Int Int deriving (Eq, Show) +-- For controls we need to know not the overall index+-- but in relation to controls of the same type.+fetch_k :: NodeId -> KType -> [Node] -> Int+fetch_k n t ks =+ let f _ [] = error "fetch_k"+ f i (x:xs) =+ if n == node_id x+ then i+ else if t == node_k_type x+ then f (i + 1) xs+ else f i xs+ in f 0 ks+ -- Construct input form required by byte-code generator. make_input :: Maps -> FromPort -> Input-make_input (cs, _, _) (C n) = Input (-1) (fetch n cs)-make_input (_, ks, _) (K n) = Input 0 (fetch n ks)-make_input (_, _, us) (U n p) = Input (fetch n us) p+make_input (cs, _, _, _) (C n) = Input (-1) (fetch n cs)+make_input (_, ks, _, _) (K n t) =+ let i = case t of+ K_IR -> 0+ K_KR -> 1+ K_TR -> 2+ K_AR -> 3+ in Input i (fetch_k n t ks)+make_input (_, _, _, us) (U n p) = Input (fetch n us) p -- Byte-encode input value. encode_input :: Input -> B.ByteString@@ -203,7 +245,7 @@ -- Byte-encode control node. encode_node_k :: Maps -> Node -> B.ByteString-encode_node_k (_, ks, _) (NodeK n _ nm _) =+encode_node_k (_, _, ks, _) (NodeK n _ nm _ _) = B.concat [ B.pack (str_pstr nm) , encode_i16 (fetch n ks) ] encode_node_k _ _ = error "encode_node_k"@@ -211,42 +253,66 @@ -- Byte-encode primitive node. encode_node_u :: Maps -> Node -> B.ByteString encode_node_u m (NodeU _ r nm i o s _) =- B.concat [ B.pack (str_pstr nm)- , encode_i8 (rateId r)- , encode_i16 (length i)- , encode_i16 (length o)- , encode_i16 s'- , B.concat i'- , B.concat o' ]- where i' = map (encode_input . make_input m) i- o' = map (encode_i8 . rateId) o- (Special s') = s+ let i' = map (encode_input . make_input m) i+ o' = map (encode_i8 . rateId) o+ (Special s') = s+ in B.concat [ B.pack (str_pstr nm)+ , encode_i8 (rateId r)+ , encode_i16 (length i)+ , encode_i16 (length o)+ , encode_i16 s'+ , B.concat i'+ , B.concat o' ] encode_node_u _ _ = error "encode_ugen: illegal input" -- Construct instrument definition bytecode. encode_graphdef :: String -> Graph -> B.ByteString encode_graphdef s g =- B.concat [ encode_str "SCgf"- , encode_i32 0- , encode_i16 1- , B.pack (str_pstr s)- , encode_i16 (length cs)- , B.concat (map (encode_f32 . node_c_value) cs)- , encode_i16 (length ks)- , B.concat (map (encode_f32 . node_k_default) ks)- , encode_i16 (length ks)- , B.concat (map (encode_node_k mm) ks)- , encode_i16 (length us)- , B.concat (map (encode_node_u mm) us) ]- where (Graph _ cs ks us) = g- mm = mk_maps g+ let (Graph _ cs ks us) = g+ mm = mk_maps g+ in B.concat [ encode_str "SCgf"+ , encode_i32 0+ , encode_i16 1+ , B.pack (str_pstr s)+ , encode_i16 (length cs)+ , B.concat (map (encode_f32 . node_c_value) cs)+ , encode_i16 (length ks)+ , B.concat (map (encode_f32 . node_k_default) ks)+ , encode_i16 (length ks)+ , B.concat (map (encode_node_k mm) ks)+ , encode_i16 (length us)+ , B.concat (map (encode_node_u mm) us) ] --- Construct implicit control unit generator node (i|k-rate only).-implicit :: [Node] -> Node+type KS_COUNT = (Int,Int,Int,Int)++ks_count :: [Node] -> KS_COUNT+ks_count ks =+ let f r [] = r+ f (i,k,t,a) (x:xs) =+ let r' = case node_k_type x of+ K_IR -> (i+1,k,t,a)+ K_KR -> (i,k+1,t,a)+ K_TR -> (i,k,t+1,a)+ K_AR -> (i,k,t,a+1)+ in f r' xs+ in f (0,0,0,0) ks++-- Construct implicit control unit generator nodes.+implicit :: [Node] -> [Node] implicit ks =- let n = length ks- r = if all (== IR) (map node_k_rate ks) then IR else KR- in NodeU (-1) r "Control" [] (replicate n r) (Special 0) Nothing+ let (ni,nk,nt,na) = ks_count ks+ mk_n t n o =+ let (nm, r) = case t of+ K_IR -> ("Control", IR)+ K_KR -> ("Control", KR)+ K_TR -> ("TrigControl", KR)+ K_AR -> ("AudioControl", AR)+ i = replicate n r+ in NodeU (-1) r nm [] i (Special o) defaultID+ in [mk_n K_IR ni 0+ ,mk_n K_KR nk ni+ ,mk_n K_TR nt (ni + nk)+ ,mk_n K_AR na (ni + nk + nt)] -- Transform mce nodes to mrg nodes prepare_root :: UGen -> UGen
Sound/SC3/UGen.hs view
@@ -3,9 +3,9 @@ module Sound.SC3.UGen.Buffer, module Sound.SC3.UGen.Chaos, module Sound.SC3.UGen.Composite,- module Sound.SC3.UGen.Composite.Monadic,+-- module Sound.SC3.UGen.Composite.Monadic, module Sound.SC3.UGen.Demand,- module Sound.SC3.UGen.Demand.Monadic,+-- module Sound.SC3.UGen.Demand.Monadic, module Sound.SC3.UGen.DiskIO, module Sound.SC3.UGen.Envelope, module Sound.SC3.UGen.Envelope.Construct,@@ -14,14 +14,14 @@ module Sound.SC3.UGen.External.ATS, module Sound.SC3.UGen.External.LPC, module Sound.SC3.UGen.FFT,- module Sound.SC3.UGen.FFT.Monadic,+-- module Sound.SC3.UGen.FFT.Monadic, module Sound.SC3.UGen.Filter, module Sound.SC3.UGen.Granular, module Sound.SC3.UGen.Information, module Sound.SC3.UGen.IO, module Sound.SC3.UGen.MachineListening, module Sound.SC3.UGen.Math,- module Sound.SC3.UGen.Noise.Monadic,+-- module Sound.SC3.UGen.Noise.Monadic, module Sound.SC3.UGen.Operator, module Sound.SC3.UGen.Oscillator, module Sound.SC3.UGen.Panner,@@ -33,9 +33,9 @@ import Sound.SC3.UGen.Buffer import Sound.SC3.UGen.Chaos import Sound.SC3.UGen.Composite-import Sound.SC3.UGen.Composite.Monadic+--import Sound.SC3.UGen.Composite.Monadic import Sound.SC3.UGen.Demand-import Sound.SC3.UGen.Demand.Monadic+--import Sound.SC3.UGen.Demand.Monadic import Sound.SC3.UGen.DiskIO import Sound.SC3.UGen.Envelope import Sound.SC3.UGen.Envelope.Construct@@ -44,14 +44,14 @@ import Sound.SC3.UGen.External.ATS import Sound.SC3.UGen.External.LPC import Sound.SC3.UGen.FFT-import Sound.SC3.UGen.FFT.Monadic+--import Sound.SC3.UGen.FFT.Monadic import Sound.SC3.UGen.Filter import Sound.SC3.UGen.Granular import Sound.SC3.UGen.Information import Sound.SC3.UGen.IO import Sound.SC3.UGen.Math import Sound.SC3.UGen.MachineListening-import Sound.SC3.UGen.Noise.Monadic+--import Sound.SC3.UGen.Noise.Monadic import Sound.SC3.UGen.Operator import Sound.SC3.UGen.Oscillator import Sound.SC3.UGen.Panner
− Sound/SC3/UGen/Base.hs
@@ -1,7 +0,0 @@-module Sound.SC3.UGen.Base (module Sound.SC3.UGen.Demand.Base,- module Sound.SC3.UGen.FFT.Base,- module Sound.SC3.UGen.Noise.Base) where--import Sound.SC3.UGen.Demand.Base-import Sound.SC3.UGen.FFT.Base-import Sound.SC3.UGen.Noise.Base
Sound/SC3/UGen/Buffer.hs view
@@ -1,4 +1,4 @@--- | Unit generators to query, read and write audio buffers. +-- | Unit generators to query, read and write audio buffers. module Sound.SC3.UGen.Buffer where import Sound.SC3.UGen.Enum@@ -117,8 +117,8 @@ playBuf n b r t s l a = mkOsc AR "PlayBuf" [b, r, t, s, from_loop l, from_done_action a] n -- | Buffer recording.-recordBuf :: UGen -> UGen -> UGen -> UGen -> UGen -> Loop -> UGen -> UGen -> UGen-recordBuf b o rl pl r l t i = mkOscMCE AR "RecordBuf" [b, o, rl, pl, r, from_loop l, t] i 0+recordBuf :: UGen -> UGen -> UGen -> UGen -> UGen -> Loop -> UGen -> DoneAction -> UGen -> UGen+recordBuf b o rl pl r l t a i = mkOscMCE AR "RecordBuf" [b, o, rl, pl, r, from_loop l, t, from_done_action a] i 0 -- | Triggered buffer shuffler (grain generator). tGrains :: Int -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen@@ -135,7 +135,7 @@ -- * Local buffers -- | Allocate a buffer local to the synth.-localBuf :: UGenId -> UGen -> UGen -> UGen+localBuf :: ID i => i -> UGen -> UGen -> UGen localBuf z nf nc = mkOscId z IR "LocalBuf" [nc, nf] 1 -- note that nf & nc are swapped at actual ugen @@ -148,7 +148,7 @@ setBuf b xs o = mkOsc IR "SetBuf" ([b, o, fromIntegral (length xs)] ++ xs) 1 -- | Generate a localBuf and use setBuf to initialise it.-asLocalBuf :: UGenId -> [UGen] -> UGen+asLocalBuf :: ID i => i -> [UGen] -> UGen asLocalBuf i xs = let m = maxLocalBufs 8 b = mrg2 (localBuf i (fromIntegral (length xs)) 1) m
Sound/SC3/UGen/Composite.hs view
@@ -2,6 +2,8 @@ module Sound.SC3.UGen.Composite where import Control.Monad+import Data.List+import Data.List.Split import Sound.SC3.UGen.Buffer import Sound.SC3.UGen.Filter import Sound.SC3.UGen.Information@@ -31,10 +33,15 @@ y = index b (i + 1) in linLin (frac i) 0 1 x y --- | Collapse multiple channel expansion by summing.+-- | Collapse possible mce by summing. mix :: UGen -> UGen-mix u | isMCE u = sum (mceProxies u)- | otherwise = u+mix = foldl1 (+) . mceChannels++-- | Mix variant, sum to n channels.+mixN :: Int -> UGen -> UGen+mixN n u =+ let xs = transpose (splitEvery n (mceChannels u))+ in mce (map (foldl1 (+)) xs) -- | Construct and sum a set of UGens. mixFill :: Int -> (Int -> UGen) -> UGen
− Sound/SC3/UGen/Demand/Base.hs
@@ -1,66 +0,0 @@-module Sound.SC3.UGen.Demand.Base where--import Sound.SC3.UGen.Enum-import Sound.SC3.UGen.Rate-import Sound.SC3.UGen.UGen-import Sound.SC3.UGen.Utilities---- | Buffer demand ugen.-dbufrd :: UGenId -> UGen -> UGen -> Loop -> UGen-dbufrd z b p l = mkOscId z DR "Dbufrd" [b, p, from_loop l] 1---- | Buffer write on demand unit generator.-dbufwr :: UGenId -> UGen -> UGen -> UGen -> Loop -> UGen-dbufwr z b p i l = mkOscId z DR "Dbufwr" [b, p, i, from_loop l] 1---- | Demand rate white noise.-dwhite :: UGenId -> UGen -> UGen -> UGen -> UGen-dwhite z l lo hi = mkOscId z DR "Dwhite" [l, lo, hi] 1---- | Demand rate integer white noise.-diwhite :: UGenId -> UGen -> UGen -> UGen -> UGen-diwhite z l lo hi = mkOscId z DR "Diwhite" [l, lo, hi] 1---- | Demand rate brown noise.-dbrown :: UGenId -> UGen -> UGen -> UGen -> UGen -> UGen-dbrown z l lo hi step = mkOscId z DR "Dbrown" [l, lo, hi, step] 1---- | Demand rate integer brown noise.-dibrown :: UGenId -> UGen -> UGen -> UGen -> UGen -> UGen-dibrown z l lo hi step = mkOscId z DR "Dibrown" [l, lo, hi, step] 1---- | Demand rate random selection.-drand :: UGenId -> UGen -> UGen -> UGen-drand z l array = mkOscMCEId z DR "Drand" [l] array 1---- | Demand rate random selection with no immediate repetition.-dxrand :: UGenId -> UGen -> UGen -> UGen-dxrand z l array = mkOscMCEId z DR "Dxrand" [l] array 1---- | Demand rate arithmetic series.-dseries :: UGenId -> UGen -> UGen -> UGen -> UGen-dseries z l i n = mkOscId z DR "Dseries" [l, i, n] 1---- | Demand rate geometric series.-dgeom :: UGenId -> UGen -> UGen -> UGen -> UGen-dgeom z l i n = mkOscId z DR "Dgeom" [l, i, n] 1---- | Demand rate sequence generator.-dseq :: UGenId -> UGen -> UGen -> UGen-dseq z l array = mkOscMCEId z DR "Dseq" [l] array 1---- | Demand rate series generator.-dser :: UGenId -> UGen -> UGen -> UGen-dser z l array = mkOscMCEId z DR "Dser" [l] array 1---- | Demand input replication-dstutter :: UGenId -> UGen -> UGen -> UGen-dstutter z n i = mkOscId z DR "Dstutter" [n,i] 1---- | Demand rate input switching.-dswitch1 :: UGenId -> UGen -> UGen -> UGen-dswitch1 z l array = mkOscMCEId z DR "Dswitch1" [l] array 1---- | Demand rate input switching.-dswitch :: UGenId -> UGen -> UGen -> UGen-dswitch z l array = mkOscMCEId z DR "Dswitch" [l] array 1
+ Sound/SC3/UGen/Demand/ID.hs view
@@ -0,0 +1,66 @@+module Sound.SC3.UGen.Demand.ID where++import Sound.SC3.UGen.Enum+import Sound.SC3.UGen.Rate+import Sound.SC3.UGen.UGen+import Sound.SC3.UGen.Utilities++-- | Buffer demand ugen.+dbufrd :: ID i => i -> UGen -> UGen -> Loop -> UGen+dbufrd z b p l = mkOscId z DR "Dbufrd" [b, p, from_loop l] 1++-- | Buffer write on demand unit generator.+dbufwr :: ID i => i -> UGen -> UGen -> UGen -> Loop -> UGen+dbufwr z b p i l = mkOscId z DR "Dbufwr" [b, p, i, from_loop l] 1++-- | Demand rate white noise.+dwhite :: ID i => i -> UGen -> UGen -> UGen -> UGen+dwhite z l lo hi = mkOscId z DR "Dwhite" [l, lo, hi] 1++-- | Demand rate integer white noise.+diwhite :: ID i => i -> UGen -> UGen -> UGen -> UGen+diwhite z l lo hi = mkOscId z DR "Diwhite" [l, lo, hi] 1++-- | Demand rate brown noise.+dbrown :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen+dbrown z l lo hi step = mkOscId z DR "Dbrown" [l, lo, hi, step] 1++-- | Demand rate integer brown noise.+dibrown :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen+dibrown z l lo hi step = mkOscId z DR "Dibrown" [l, lo, hi, step] 1++-- | Demand rate random selection.+drand :: ID i => i -> UGen -> UGen -> UGen+drand z l array = mkOscMCEId z DR "Drand" [l] array 1++-- | Demand rate random selection with no immediate repetition.+dxrand :: ID i => i -> UGen -> UGen -> UGen+dxrand z l array = mkOscMCEId z DR "Dxrand" [l] array 1++-- | Demand rate arithmetic series.+dseries :: ID i => i -> UGen -> UGen -> UGen -> UGen+dseries z l i n = mkOscId z DR "Dseries" [l, i, n] 1++-- | Demand rate geometric series.+dgeom :: ID i => i -> UGen -> UGen -> UGen -> UGen+dgeom z l i n = mkOscId z DR "Dgeom" [l, i, n] 1++-- | Demand rate sequence generator.+dseq :: ID i => i -> UGen -> UGen -> UGen+dseq z l array = mkOscMCEId z DR "Dseq" [l] array 1++-- | Demand rate series generator.+dser :: ID i => i -> UGen -> UGen -> UGen+dser z l array = mkOscMCEId z DR "Dser" [l] array 1++-- | Demand input replication+dstutter :: ID i => i -> UGen -> UGen -> UGen+dstutter z n i = mkOscId z DR "Dstutter" [n,i] 1++-- | Demand rate input switching.+dswitch1 :: ID i => i -> UGen -> UGen -> UGen+dswitch1 z l array = mkOscMCEId z DR "Dswitch1" [l] array 1++-- | Demand rate input switching.+dswitch :: ID i => i -> UGen -> UGen -> UGen+dswitch z l array = mkOscMCEId z DR "Dswitch" [l] array 1
Sound/SC3/UGen/Demand/Monadic.hs view
@@ -2,7 +2,7 @@ import Sound.SC3.UGen.UGen import Sound.SC3.UGen.UGen.Lift-import qualified Sound.SC3.UGen.Demand.Base as D+import qualified Sound.SC3.UGen.Demand.ID as D import Sound.SC3.UGen.UId import Sound.SC3.UGen.Enum
Sound/SC3/UGen/Envelope/Construct.hs view
@@ -1,25 +1,34 @@--- | Functions to generate break point data for standard envelope types.-module Sound.SC3.UGen.Envelope.Construct where+-- | Functions to generate break point data for standard envelope+-- types.+module Sound.SC3.UGen.Envelope.Construct (env+ ,envCoord+ ,envTrapezoid+ ,envPerc', envPerc+ ,envTriangle+ ,envSine+ ,envLinen', envLinen) where import Sound.SC3.UGen.UGen import Sound.SC3.UGen.Math import Sound.SC3.UGen.Enum-import Sound.SC3.UGen.Utilities --- | Basic envelope data constructor.+-- | Basic envelope data constructor. The curve argument are cycled+-- if required. env :: [UGen] -> [UGen] -> [EnvCurve] -> UGen -> UGen -> [UGen]-env [] _ _ _ _ = error "env: illegal specification"-env (l:vl) tms crv rls lp =- [l, n', rls, lp] ++ concat (zipWith3 f vl tms (take n $ cycle crv))- where f l' t c = [l', t, env_curve c, env_value c]- n = length tms- n' = fromIntegral n+env [] _ _ _ _ = error "env: illegal specification"+env (l:ls) tms crv rls lp =+ let f l' t c = [l', t, env_curve c, env_value c]+ n = length tms+ n' = fromIntegral n+ crv' = take n (cycle crv)+ in [l, n', rls, lp] ++ concat (zipWith3 f ls tms crv') -- | Co-ordinate based static envelope generator. envCoord :: [(UGen, UGen)] -> UGen -> UGen -> EnvCurve -> [UGen]-envCoord bp dur amp c = env l t (repeat c) (-1) (-1)- where l = map ((* amp) . snd) bp- t = map (* dur) (d_dx (map fst bp))+envCoord bp dur amp c = + let l = map ((* amp) . snd) bp+ t = map (* dur) (d_dx (map fst bp))+ in env l t (repeat c) (-1) (-1) {- | Trapezoidal envelope generator. The arguments are: 1. @shape@ determines the sustain time as a proportion of @dur@, zero is a@@ -28,30 +37,66 @@ one a slow attack and an immediate decay; 3. @duration@ in seconds; 4. @amplitude@ as linear gain. -} envTrapezoid :: UGen -> UGen -> UGen -> UGen -> [UGen]-envTrapezoid shape skew dur amp = envCoord bp dur amp EnvLin- where x1 = skew * (1 - shape)- bp = [ (0, skew <=* 0)- , (x1, 1)- , (shape + x1, 1)- , (1, skew >=* 1) ]+envTrapezoid shape skew dur amp =+ let x1 = skew * (1 - shape)+ bp = [ (0, skew <=* 0)+ , (x1, 1)+ , (shape + x1, 1)+ , (1, skew >=* 1) ]+ in envCoord bp dur amp EnvLin -envPerc' :: UGen -> UGen -> UGen -> [EnvCurve] -> [UGen]-envPerc' atk rls lvl crv = env [0.0, lvl, 0.0] [atk, rls] crv (-1.0) (-1.0)+envPerc' :: UGen -> UGen -> UGen -> (EnvCurve, EnvCurve) -> [UGen]+envPerc' atk rls lvl (c0, c1) =+ let c = [c0, c1]+ in env [0.0, lvl, 0.0] [atk, rls] c (-1.0) (-1.0) --- | Percussive envelope, with attack, release, level and curve inputs.+-- | Percussive envelope, with attack, release, level and curve+-- inputs. envPerc :: UGen -> UGen -> [UGen]-envPerc atk rls = envPerc' atk rls 1.0 (dbl (EnvNum (-4.0)))+envPerc atk rls =+ let cn = EnvNum (-4.0)+ in envPerc' atk rls 1.0 (cn, cn) -- | Triangular envelope, with duration and level inputs. envTriangle :: UGen -> UGen -> [UGen] envTriangle dur lvl =- env [0.0, lvl, 0.0] (dbl (dur / 2.0)) (dbl EnvLin) (-1.0) (-1.0)+ let c = replicate 2 EnvLin+ d = replicate 2 (dur / 2.0)+ in env [0.0, lvl, 0.0] d c (-1.0) (-1.0) -- | Sine envelope, with duration and level inputs. envSine :: UGen -> UGen -> [UGen] envSine dur lvl =- env [0.0, lvl, 0.0] (dbl (dur / 2.0)) (dbl EnvSin) (-1.0) (-1.0)+ let c = replicate 2 EnvSin+ d = replicate 2 (dur / 2.0)+ in env [0.0, lvl, 0.0] d c (-1.0) (-1.0) +envLinen' :: UGen -> UGen -> UGen -> UGen -> (EnvCurve, EnvCurve, EnvCurve) -> [UGen]+envLinen' aT sT rT l (c0, c1, c2) =+ env [0, l, l, 0] [aT, sT, rT] [c0, c1, c2] (-1) (-1)+ -- | Linear envelope parameter constructor.-envLinen :: UGen -> UGen -> UGen -> UGen -> [EnvCurve] -> [UGen]-envLinen aT sT rT l c = env [0, l, l, 0] [aT, sT, rT] c (-1) (-1)+envLinen :: UGen -> UGen -> UGen -> UGen -> [UGen]+envLinen aT sT rT l =+ let c = (EnvLin, EnvLin, EnvLin)+ in envLinen' aT sT rT l c++d_dx :: (Num a) => [a] -> [a]+d_dx [] = []+d_dx [_] = []+d_dx [x,y] = [y - x]+d_dx (x:y:r) = y - x : d_dx (y:r)++env_curve :: EnvCurve -> UGen+env_curve EnvStep = Constant 0.0+env_curve EnvLin = Constant 1.0+env_curve EnvExp = Constant 2.0 +env_curve EnvSin = Constant 3.0+env_curve EnvCos = Constant 4.0+env_curve (EnvNum _) = Constant 5.0+env_curve EnvSqr = Constant 6.0+env_curve EnvCub = Constant 7.0++env_value :: EnvCurve -> UGen+env_value (EnvNum u) = u+env_value _ = Constant 0.0
− Sound/SC3/UGen/FFT/Base.hs
@@ -1,20 +0,0 @@-module Sound.SC3.UGen.FFT.Base where--import Sound.SC3.UGen.Rate-import Sound.SC3.UGen.UGen---- | Randomize order of bins.-pv_BinScramble :: UGenId -> UGen -> UGen -> UGen -> UGen -> UGen-pv_BinScramble z buf wp width trg = mkOscId z KR "PV_BinScramble" [buf,wp,width,trg] 1---- | Randomly clear bins.-pv_RandComb :: UGenId -> UGen -> UGen -> UGen -> UGen-pv_RandComb z buf wp trg = mkOscId z KR "PV_RandComb" [buf,wp,trg] 1---- | Cross fade, copying bins in random order.-pv_RandWipe :: UGenId -> UGen -> UGen -> UGen -> UGen -> UGen-pv_RandWipe z ba bb wp trg = mkOscId z KR "PV_RandWipe" [ba,bb,wp,trg] 1---- Local Variables:--- truncate-lines:t--- End:
+ Sound/SC3/UGen/FFT/ID.hs view
@@ -0,0 +1,20 @@+module Sound.SC3.UGen.FFT.ID where++import Sound.SC3.UGen.Rate+import Sound.SC3.UGen.UGen++-- | Randomize order of bins.+pv_BinScramble :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen+pv_BinScramble z buf wp width trg = mkOscId z KR "PV_BinScramble" [buf,wp,width,trg] 1++-- | Randomly clear bins.+pv_RandComb :: ID i => i -> UGen -> UGen -> UGen -> UGen+pv_RandComb z buf wp trg = mkOscId z KR "PV_RandComb" [buf,wp,trg] 1++-- | Cross fade, copying bins in random order.+pv_RandWipe :: ID i => i -> UGen -> UGen -> UGen -> UGen -> UGen+pv_RandWipe z ba bb wp trg = mkOscId z KR "PV_RandWipe" [ba,bb,wp,trg] 1++-- Local Variables:+-- truncate-lines:t+-- End:
Sound/SC3/UGen/FFT/Monadic.hs view
@@ -2,7 +2,7 @@ import Sound.SC3.UGen.UGen import Sound.SC3.UGen.UGen.Lift-import qualified Sound.SC3.UGen.FFT.Base as F+import qualified Sound.SC3.UGen.FFT.ID as F import Sound.SC3.UGen.UId -- | Randomize order of bins.
Sound/SC3/UGen/Filter.hs view
@@ -358,3 +358,16 @@ bHiShelf :: UGen -> UGen -> UGen -> UGen -> UGen bHiShelf i f rs db = mkFilter "BHiShelf" [i, f, rs, db] 1++bLowPassCoef :: Floating a => a -> a -> a -> (a, a, a, a, a)+bLowPassCoef sr freq rq =+ let w0 = pi * 2 * freq * (1 / sr)+ cos_w0 = cos w0+ i = 1 - cos_w0+ alpha = sin w0 * 0.5 * rq+ b0rz = recip (1 + alpha)+ a0 = i * 0.5 * b0rz+ a1 = i * b0rz+ b1 = cos_w0 * 2 * b0rz+ b2 = (1 - alpha) * negate b0rz+ in (a0, a1, a0, b1, b2)
Sound/SC3/UGen/MachineListening.hs view
@@ -19,7 +19,7 @@ loudness fft smask tmask = mkOsc KR "Loudness" [fft, smask, tmask] 1 -- | Translate onset type string to constant UGen value.-onsetType :: String -> UGen+onsetType :: Num a => String -> a onsetType s = fromIntegral (fromMaybe 3 (findIndex (== s) t)) where t = ["power", "magsum", "complex", "rcomplex", "phase", "wphase", "mkl"] @@ -46,7 +46,7 @@ specPcile b f i = mkOsc KR "SpecPcile" [b, f, i] 1 specCentroid :: UGen -> UGen-specCentroid b = mkOsc KR "SpecFlatness" [b] 1+specCentroid b = mkOsc KR "SpecCentroid" [b] 1 -- Local Variables: -- truncate-lines:t
− Sound/SC3/UGen/Monadic.hs
@@ -1,9 +0,0 @@-module Sound.SC3.UGen.Monadic ( module Sound.SC3.UGen.Demand.Monadic- , module Sound.SC3.UGen.Composite.Monadic- , module Sound.SC3.UGen.FFT.Monadic- , module Sound.SC3.UGen.Noise.Monadic ) where--import Sound.SC3.UGen.Composite.Monadic-import Sound.SC3.UGen.Demand.Monadic-import Sound.SC3.UGen.FFT.Monadic-import Sound.SC3.UGen.Noise.Monadic
− Sound/SC3/UGen/Noise/Base.hs
@@ -1,108 +0,0 @@-module Sound.SC3.UGen.Noise.Base where--import Sound.SC3.UGen.Rate-import Sound.SC3.UGen.UGen---- | Brown noise.-brownNoise :: UGenId -> Rate -> UGen-brownNoise z r = mkOscId z r "BrownNoise" [] 1---- | Clip noise.-clipNoise :: UGenId -> Rate -> UGen-clipNoise z r = mkOscId z r "ClipNoise" [] 1---- | Randomly pass or block triggers.-coinGate :: UGenId -> UGen -> UGen -> UGen-coinGate z prob i = mkFilterId z "CoinGate" [prob, i] 1---- | Random impulses in (-1, 1).-dust2 :: UGenId -> Rate -> UGen -> UGen-dust2 z r density = mkOscId z r "Dust2" [density] 1---- | Random impulse in (0,1).-dust :: UGenId -> Rate -> UGen -> UGen-dust z r density = mkOscId z r "Dust" [density] 1---- | Random value in exponential distribution.-expRand :: UGenId -> UGen -> UGen -> UGen-expRand z lo hi = mkOscId z IR "ExpRand" [lo, hi] 1---- | Gray noise.-grayNoise :: UGenId -> Rate -> UGen-grayNoise z r = mkOscId z r "GrayNoise" [] 1---- | Random integer in uniform distribution.-iRand :: UGenId -> UGen -> UGen -> UGen-iRand z lo hi = mkOscId z IR "IRand" [lo, hi] 1---- | Clip noise.-lfClipNoise :: UGenId -> Rate -> UGen -> UGen-lfClipNoise z r freq = mkOscId z r "LFClipNoise" [freq] 1---- | Dynamic clip noise.-lfdClipNoise :: UGenId -> Rate -> UGen -> UGen-lfdClipNoise z r freq = mkOscId z r "LFDClipNoise" [freq] 1---- | Dynamic step noise.-lfdNoise0 :: UGenId -> Rate -> UGen -> UGen-lfdNoise0 z r freq = mkOscId z r "LFDNoise0" [freq] 1---- | Dynamic ramp noise.-lfdNoise1 :: UGenId -> Rate -> UGen -> UGen-lfdNoise1 z r freq = mkOscId z r "LFDNoise1" [freq] 1---- | Dynamic quadratic noise-lfdNoise2 :: UGenId -> Rate -> UGen -> UGen-lfdNoise2 z r freq = mkOscId z r "LFDNoise2" [freq] 1---- | Dynamic cubic noise-lfdNoise3 :: UGenId -> Rate -> UGen -> UGen-lfdNoise3 z r freq = mkOscId z r "LFDNoise3" [freq] 1---- | Step noise.-lfNoise0 :: UGenId -> Rate -> UGen -> UGen-lfNoise0 z r freq = mkOscId z r "LFNoise0" [freq] 1---- | Ramp noise.-lfNoise1 :: UGenId -> Rate -> UGen -> UGen-lfNoise1 z r freq = mkOscId z r "LFNoise1" [freq] 1---- | Quadratic noise.-lfNoise2 :: UGenId -> Rate -> UGen -> UGen-lfNoise2 z r freq = mkOscId z r "LFNoise2" [freq] 1---- | Random value in skewed linear distribution.-linRand :: UGenId -> UGen -> UGen -> UGen -> UGen-linRand z lo hi m = mkOscId z IR "LinRand" [lo, hi, m] 1---- | Random value in sum of n linear distribution.-nRand :: UGenId -> UGen -> UGen -> UGen -> UGen-nRand z lo hi n = mkOscId z IR "NRand" [lo, hi, n] 1---- | Pink noise.-pinkNoise :: UGenId -> Rate -> UGen-pinkNoise z r = mkOscId z r "PinkNoise" [] 1---- | Random value in uniform distribution.-rand :: UGenId -> UGen -> UGen -> UGen-rand z lo hi = mkOscId z IR "Rand" [lo, hi] 1---- | Random value in exponential distribution on trigger.-tExpRand :: UGenId -> UGen -> UGen -> UGen -> UGen-tExpRand z lo hi trig = mkFilterId z "TExpRand" [lo, hi, trig] 1---- | Random integer in uniform distribution on trigger.-tiRand :: UGenId -> UGen -> UGen -> UGen -> UGen-tiRand z lo hi trig = mkFilterId z "TIRand" [lo, hi, trig] 1---- | Random value in uniform distribution on trigger.-tRand :: UGenId -> UGen -> UGen -> UGen -> UGen-tRand z lo hi trig = mkFilterId z "TRand" [lo, hi, trig] 1---- | Triggered windex.-twindex :: UGenId -> UGen -> UGen -> UGen -> UGen-twindex z i n a = mkFilterMCEId z "TWindex" [i, n] a 1---- | White noise.-whiteNoise :: UGenId -> Rate -> UGen-whiteNoise z r = mkOscId z r "WhiteNoise" [] 1
+ Sound/SC3/UGen/Noise/ID.hs view
@@ -0,0 +1,108 @@+module Sound.SC3.UGen.Noise.ID where++import Sound.SC3.UGen.Rate+import Sound.SC3.UGen.UGen++-- | Brown noise.+brownNoise :: ID a => a -> Rate -> UGen+brownNoise z r = mkOscId z r "BrownNoise" [] 1++-- | Clip noise.+clipNoise :: ID a => a -> Rate -> UGen+clipNoise z r = mkOscId z r "ClipNoise" [] 1++-- | Randomly pass or block triggers.+coinGate :: ID a => a -> UGen -> UGen -> UGen+coinGate z prob i = mkFilterId z "CoinGate" [prob, i] 1++-- | Random impulses in (-1, 1).+dust2 :: ID a => a -> Rate -> UGen -> UGen+dust2 z r density = mkOscId z r "Dust2" [density] 1++-- | Random impulse in (0,1).+dust :: ID a => a -> Rate -> UGen -> UGen+dust z r density = mkOscId z r "Dust" [density] 1++-- | Random value in exponential distribution.+expRand :: ID a => a -> UGen -> UGen -> UGen+expRand z lo hi = mkOscId z IR "ExpRand" [lo, hi] 1++-- | Gray noise.+grayNoise :: ID a => a -> Rate -> UGen+grayNoise z r = mkOscId z r "GrayNoise" [] 1++-- | Random integer in uniform distribution.+iRand :: ID a => a -> UGen -> UGen -> UGen+iRand z lo hi = mkOscId z IR "IRand" [lo, hi] 1++-- | Clip noise.+lfClipNoise :: ID a => a -> Rate -> UGen -> UGen+lfClipNoise z r freq = mkOscId z r "LFClipNoise" [freq] 1++-- | Dynamic clip noise.+lfdClipNoise :: ID a => a -> Rate -> UGen -> UGen+lfdClipNoise z r freq = mkOscId z r "LFDClipNoise" [freq] 1++-- | Dynamic step noise.+lfdNoise0 :: ID a => a -> Rate -> UGen -> UGen+lfdNoise0 z r freq = mkOscId z r "LFDNoise0" [freq] 1++-- | Dynamic ramp noise.+lfdNoise1 :: ID a => a -> Rate -> UGen -> UGen+lfdNoise1 z r freq = mkOscId z r "LFDNoise1" [freq] 1++-- | Dynamic quadratic noise+lfdNoise2 :: ID a => a -> Rate -> UGen -> UGen+lfdNoise2 z r freq = mkOscId z r "LFDNoise2" [freq] 1++-- | Dynamic cubic noise+lfdNoise3 :: ID a => a -> Rate -> UGen -> UGen+lfdNoise3 z r freq = mkOscId z r "LFDNoise3" [freq] 1++-- | Step noise.+lfNoise0 :: ID a => a -> Rate -> UGen -> UGen+lfNoise0 z r freq = mkOscId z r "LFNoise0" [freq] 1++-- | Ramp noise.+lfNoise1 :: ID a => a -> Rate -> UGen -> UGen+lfNoise1 z r freq = mkOscId z r "LFNoise1" [freq] 1++-- | Quadratic noise.+lfNoise2 :: ID a => a -> Rate -> UGen -> UGen+lfNoise2 z r freq = mkOscId z r "LFNoise2" [freq] 1++-- | Random value in skewed linear distribution.+linRand :: ID a => a -> UGen -> UGen -> UGen -> UGen+linRand z lo hi m = mkOscId z IR "LinRand" [lo, hi, m] 1++-- | Random value in sum of n linear distribution.+nRand :: ID a => a -> UGen -> UGen -> UGen -> UGen+nRand z lo hi n = mkOscId z IR "NRand" [lo, hi, n] 1++-- | Pink noise.+pinkNoise :: ID a => a -> Rate -> UGen+pinkNoise z r = mkOscId z r "PinkNoise" [] 1++-- | Random value in uniform distribution.+rand :: ID a => a -> UGen -> UGen -> UGen+rand z lo hi = mkOscId z IR "Rand" [lo, hi] 1++-- | Random value in exponential distribution on trigger.+tExpRand :: ID a => a -> UGen -> UGen -> UGen -> UGen+tExpRand z lo hi trig = mkFilterId z "TExpRand" [lo, hi, trig] 1++-- | Random integer in uniform distribution on trigger.+tiRand :: ID a => a -> UGen -> UGen -> UGen -> UGen+tiRand z lo hi trig = mkFilterId z "TIRand" [lo, hi, trig] 1++-- | Random value in uniform distribution on trigger.+tRand :: ID a => a -> UGen -> UGen -> UGen -> UGen+tRand z lo hi trig = mkFilterId z "TRand" [lo, hi, trig] 1++-- | Triggered windex.+twindex :: ID a => a -> UGen -> UGen -> UGen -> UGen+twindex z i n a = mkFilterMCEId z "TWindex" [i, n] a 1++-- | White noise.+whiteNoise :: ID a => a -> Rate -> UGen+whiteNoise z r = mkOscId z r "WhiteNoise" [] 1
Sound/SC3/UGen/Noise/Monadic.hs view
@@ -3,7 +3,7 @@ import Sound.SC3.UGen.Rate import Sound.SC3.UGen.UGen import Sound.SC3.UGen.UGen.Lift-import qualified Sound.SC3.UGen.Noise.Base as N+import qualified Sound.SC3.UGen.Noise.ID as N import Sound.SC3.UGen.UId -- | Brown noise.
Sound/SC3/UGen/UGen.hs view
@@ -1,27 +1,43 @@ module Sound.SC3.UGen.UGen where import Control.Monad+import qualified Data.Char as C+import qualified Data.HashTable as H import Data.List import Sound.SC3.UGen.Operator import Sound.SC3.UGen.Rate import Sound.SC3.UGen.UId import System.Random +-- | Typeclass to constrain UGen identifiers.+class ID a where+ resolveID :: a -> Int++instance ID Int where+ resolveID = id++instance ID Char where+ resolveID = C.ord++instance ID UGen where+ resolveID = hashUGen+ -- | Unit generator. data UGen = Constant { constantValue :: Double } | Control { controlOperatingRate :: Rate , controlName :: String- , controlDefault :: Double }+ , controlDefault :: Double+ , controlTriggered :: Bool } | Primitive { ugenRate :: Rate , ugenName :: String , ugenInputs :: [UGen] , ugenOutputs :: [Output] , ugenSpecial :: Special- , ugenId :: Maybe UGenId }+ , ugenId :: Int } | Proxy { proxySource :: UGen , proxyIndex :: Int } | MCE { mceProxies :: [UGen] }- | MRG { mrgLeft :: UGen + | MRG { mrgLeft :: UGen , mrgRight :: UGen } deriving (Eq, Show) @@ -29,27 +45,33 @@ type Output = Rate -- | Operating mode of unary and binary operators.-newtype Special = Special Int - deriving (Eq, Show)---- | Identifier for non-functional unit generators.-newtype UGenId = UGenId Int +newtype Special = Special Int deriving (Eq, Show) -- * Unit generator node constructors --- | Unit generator identifier constructor.-uid :: Int -> UGenId-uid = UGenId+defaultID :: Int+defaultID = (-1) +-- | Hash function for unit generators.+hashUGen :: UGen -> Int+hashUGen = fromIntegral . H.hashString . show+ -- | Constant value node constructor. constant :: (Real a) => a -> UGen constant = Constant . realToFrac -- | 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-control = Control+control r n d = Control r n d False +-- | Triggered (kr) control input node constructor.+tr_control :: String -> Double -> UGen+tr_control n d = Control KR n d True+ -- | Multiple channel expansion node constructor. mce :: [UGen] -> UGen mce [] = error "mce: empty list"@@ -68,12 +90,12 @@ -- | Constant node predicate. isConstant :: UGen -> Bool isConstant (Constant _) = True-isConstant _ = False+isConstant _ = False -- | Control node predicate. isControl :: UGen -> Bool-isControl (Control _ _ _) = True-isControl _ = False+isControl (Control _ _ _ _) = True+isControl _ = False -- | Unit generator primitive node predicate. isUGen :: UGen -> Bool@@ -83,12 +105,12 @@ -- | Proxy node predicate. isProxy :: UGen -> Bool isProxy (Proxy _ _) = True-isProxy _ = False+isProxy _ = False -- | Multiple channel expansion node predicate. isMCE :: UGen -> Bool isMCE (MCE _) = True-isMCE _ = False+isMCE _ = False -- | MRG predicate. isMRG :: UGen -> Bool@@ -114,25 +136,35 @@ -- | Extend UGen to specified degree. mceExtend :: Int -> UGen -> [UGen] mceExtend n (MCE l) = take n (cycle l)-mceExtend n (MRG x y) = (MRG r y : rs) where (r:rs) = mceExtend n x+mceExtend n (MRG x y) =+ let (r:rs) = mceExtend n x+ in MRG r y : rs mceExtend n u = replicate n u -- | Apply MCE transformation. mceTransform :: UGen -> UGen-mceTransform (Primitive r n i o s d) = MCE (map f i')- where f j = Primitive r n j o s d- upr = maximum (map mceDegree (filter isMCE i))- i' = transpose (map (mceExtend upr) i)+mceTransform (Primitive r n i o s d) =+ let f j = Primitive r n j o s d+ upr = maximum (map mceDegree (filter isMCE i))+ i' = transpose (map (mceExtend upr) i)+ in MCE (map f i') mceTransform _ = error "mceTransform: illegal ugen" -- | Apply MCE transformation if required. mceExpand :: UGen -> UGen mceExpand (MCE l) = MCE (map mceExpand l) mceExpand (MRG x y) = MRG (mceExpand x) y-mceExpand u = if required u then mceExpand (mceTransform u) else u- where required (Primitive _ _ i _ _ _) = not (null (filter isMCE i))- required _ = False+mceExpand u =+ let required (Primitive _ _ i _ _ _) = not (null (filter isMCE i))+ required _ = False+ in if required u+ then mceExpand (mceTransform u)+ else u +-- | Apply a function to each channel at a unit generator.+mceMap :: (UGen -> UGen) -> UGen -> UGen+mceMap f u = mce (map f (mceChannels u))+ -- | Apply UGen list operation on MCE contents. mceEdit :: ([UGen] -> [UGen]) -> UGen -> UGen mceEdit f (MCE l) = MCE (f l)@@ -150,13 +182,18 @@ -- | Output channels of UGen as a list. mceChannels :: UGen -> [UGen] mceChannels (MCE l) = l-mceChannels (MRG x y) = let (r:rs) = mceChannels x in MRG r y : rs +mceChannels (MRG x y) = let (r:rs) = mceChannels x in MRG r y : rs mceChannels u = [u] -- | Transpose rows and columns, ie. {{a,b},{c,d}} to {{a,c},{b,d}}. mceTranspose :: UGen -> UGen-mceTranspose = mce . map mce . transpose . map mceChannels . mceChannels+mceTranspose =+ mce . map mce . transpose . map mceChannels . mceChannels +-- | Collapse mce by summing (see also mix and mixN).+mceSum :: UGen -> UGen+mceSum = sum . mceChannels+ -- * Multiple root graphs -- | Multiple root graph constructor.@@ -169,13 +206,14 @@ -- | Apply proxy transformation if required. proxify :: UGen -> UGen-proxify u +proxify u | isMCE u = mce (map proxify (mceProxies u)) | isMRG u = mrg [proxify (mrgLeft u), mrgRight u]- | isUGen u = let o = ugenOutputs u- in case o of- (_:_:_) -> mce (map (proxy u) [0..(length o - 1)])- _ -> u+ | isUGen u =+ let o = ugenOutputs u+ in case o of+ (_:_:_) -> mce (map (proxy u) [0..(length o - 1)])+ _ -> u | otherwise = error "proxify: illegal ugen" -- | Determine the rate of a UGen.@@ -199,65 +237,77 @@ -- Ensure input UGen is valid, ie. not a sink. check_input :: UGen -> UGen-check_input u = if is_sink u - then error ("illegal input: " ++ show u) +check_input u = if is_sink u+ then error ("illegal input: " ++ show u) else u -- | Construct proxied and multiple channel expanded UGen.-mkUGen :: Rate -> String -> [UGen] -> [Output] -> Special -> Maybe UGenId -> UGen-mkUGen r n i o s z = proxify (mceExpand u)- where u = Primitive r n (map check_input i) o s z+mkUGen :: (ID a) =>+ Rate -> String -> [UGen] -> [Output] -> Special -> a -> UGen+mkUGen r n i o s z =+ let u = Primitive r n (map check_input i) o s (resolveID z)+ in proxify (mceExpand u) -- | Operator UGen constructor. mkOperator :: String -> [UGen] -> Int -> UGen-mkOperator c i s = mkUGen r c i [r] (Special s) Nothing- where r = maximum (map rateOf i)+mkOperator c i s =+ let r = maximum (map rateOf i)+ in mkUGen r c i [r] (Special s) defaultID -- | Unary math constructor with constant optimization. mkUnaryOperator :: Unary -> (Double -> Double) -> UGen -> UGen-mkUnaryOperator i f a +mkUnaryOperator i f a | isConstant a = constant (f (constantValue a)) | otherwise = mkOperator "UnaryOpUGen" [a] (fromEnum i) -- | Binary math constructor with constant optimization.-mkBinaryOperator :: Binary -> (Double -> Double -> Double) -> +mkBinaryOperator :: Binary -> (Double -> Double -> Double) -> UGen -> UGen -> UGen-mkBinaryOperator i f a b - | isConstant a && isConstant b = let a' = constantValue a- b' = constantValue b- in constant (f a' b')- | otherwise = mkOperator "BinaryOpUGen" [a, b] (fromEnum i)+mkBinaryOperator i f a b =+ if isConstant a && isConstant b+ then let a' = constantValue a+ b' = constantValue b+ in constant (f a' b')+ else mkOperator "BinaryOpUGen" [a, b] (fromEnum i) -mk_osc :: [Rate] -> Maybe UGenId -> +mk_osc :: (ID a) =>+ [Rate] -> a -> Rate -> String -> [UGen] -> Int -> UGen-mk_osc rs z r c i o- | r `elem` rs = mkUGen r c i (replicate o r) (Special 0) z- | otherwise = error ("mk_osc: rate restricted: " ++ show (r, rs, c))+mk_osc rs z r c i o =+ if r `elem` rs+ then mkUGen r c i (replicate o r) (Special 0) z+ else error ("mk_osc: rate restricted: " ++ show (r, rs, c)) -- | Oscillator constructor. mkOsc :: Rate -> String -> [UGen] -> Int -> UGen-mkOsc = mk_osc [minBound .. maxBound] Nothing+mkOsc = mk_osc [minBound .. maxBound] defaultID -- | Oscillator constructor, rate restricted variant. mkOscR :: [Rate] -> Rate -> String -> [UGen] -> Int -> UGen-mkOscR rs = mk_osc rs Nothing+mkOscR rs = mk_osc rs defaultID -- | Oscillator constructor, setting identifier.-mkOscId :: UGenId -> Rate -> String -> [UGen] -> Int -> UGen-mkOscId = mk_osc [minBound .. maxBound] . Just+mkOscId :: (ID a) =>+ a -> Rate -> String -> [UGen] -> Int -> UGen+mkOscId = mk_osc [minBound .. maxBound] -mk_osc_mce :: Maybe UGenId -> Rate -> String -> [UGen] -> UGen -> Int -> UGen-mk_osc_mce z r c i j = mk_osc [minBound .. maxBound] z r c (i ++ mceChannels j)+mk_osc_mce :: (ID a) =>+ a -> Rate -> String -> [UGen] -> UGen -> Int -> UGen+mk_osc_mce z r c i j =+ let i' = i ++ mceChannels j+ in mk_osc [minBound .. maxBound] z r c i' -- | Variant oscillator constructor with MCE collapsing input. mkOscMCE :: Rate -> String -> [UGen] -> UGen -> Int -> UGen-mkOscMCE = mk_osc_mce Nothing+mkOscMCE = mk_osc_mce defaultID -- | Variant oscillator constructor with MCE collapsing input.-mkOscMCEId :: UGenId -> Rate -> String -> [UGen] -> UGen -> Int -> UGen-mkOscMCEId = mk_osc_mce . Just+mkOscMCEId :: (ID a) =>+ a -> Rate -> String -> [UGen] -> UGen -> Int -> UGen+mkOscMCEId = mk_osc_mce -mk_filter :: [Rate] -> Maybe UGenId -> String -> [UGen] -> Int -> UGen+mk_filter :: (ID a) =>+ [Rate] -> a -> String -> [UGen] -> Int -> UGen mk_filter rs z c i o = let r = maximum (map rateOf i) o'= replicate o r@@ -270,37 +320,39 @@ -- | Filter UGen constructor. mkFilter :: String -> [UGen] -> Int -> UGen-mkFilter = mk_filter all_rates Nothing+mkFilter = mk_filter all_rates defaultID -- | Filter UGen constructor. mkFilterR :: [Rate] -> String -> [UGen] -> Int -> UGen-mkFilterR rs = mk_filter rs Nothing+mkFilterR rs = mk_filter rs defaultID -- | Filter UGen constructor.-mkFilterId :: UGenId -> String -> [UGen] -> Int -> UGen-mkFilterId = mk_filter all_rates . Just+mkFilterId :: (ID a) => a -> String -> [UGen] -> Int -> UGen+mkFilterId = mk_filter all_rates -- | Variant filter with rate derived from keyed input. mkFilterKeyed :: String -> Int -> [UGen] -> Int -> UGen-mkFilterKeyed c k i o = mkUGen r c i o' (Special 0) Nothing- where r = rateOf (i !! k)- o' = replicate o r+mkFilterKeyed c k i o =+ let r = rateOf (i !! k)+ o' = replicate o r+ in mkUGen r c i o' (Special 0) defaultID -mk_filter_mce :: [Rate] -> Maybe UGenId -> +mk_filter_mce :: (ID a) => [Rate] -> a -> String -> [UGen] -> UGen -> Int -> UGen mk_filter_mce rs z c i j = mk_filter rs z c (i ++ mceChannels j) -- | Variant filter constructor with MCE collapsing input. mkFilterMCER :: [Rate] -> String -> [UGen] -> UGen -> Int -> UGen-mkFilterMCER rs = mk_filter_mce rs Nothing+mkFilterMCER rs = mk_filter_mce rs defaultID -- | Variant filter constructor with MCE collapsing input. mkFilterMCE :: String -> [UGen] -> UGen -> Int -> UGen-mkFilterMCE = mk_filter_mce all_rates Nothing+mkFilterMCE = mk_filter_mce all_rates defaultID -- | Variant filter constructor with MCE collapsing input.-mkFilterMCEId :: UGenId -> String -> [UGen] -> UGen -> Int -> UGen-mkFilterMCEId = mk_filter_mce all_rates . Just+mkFilterMCEId :: (ID a) =>+ a -> String -> [UGen] -> UGen -> Int -> UGen+mkFilterMCEId = mk_filter_mce all_rates -- | Information unit generators are very specialized. mkInfo :: String -> UGen@@ -308,40 +360,40 @@ -- Unit generators are numbers. instance Num UGen where- negate = mkUnaryOperator Neg negate- (+) = mkBinaryOperator Add (+)- (-) = mkBinaryOperator Sub (-)- (*) = mkBinaryOperator Mul (*)- abs = mkUnaryOperator Abs abs- signum = mkUnaryOperator Sign signum- fromInteger = Constant . fromInteger+ negate = mkUnaryOperator Neg negate+ (+) = mkBinaryOperator Add (+)+ (-) = mkBinaryOperator Sub (-)+ (*) = mkBinaryOperator Mul (*)+ abs = mkUnaryOperator Abs abs+ signum = mkUnaryOperator Sign signum+ fromInteger = Constant . fromInteger -- Unit generators are fractional. instance Fractional UGen where- recip = mkUnaryOperator Recip recip- (/) = mkBinaryOperator FDiv (/)- fromRational = Constant . fromRational+ recip = mkUnaryOperator Recip recip+ (/) = mkBinaryOperator FDiv (/)+ fromRational = Constant . fromRational -- Unit generators are floating point. instance Floating UGen where- pi = Constant pi- exp = mkUnaryOperator Exp exp- log = mkUnaryOperator Log log- sqrt = mkUnaryOperator Sqrt sqrt- (**) = mkBinaryOperator Pow (**)- logBase a b = log b / log a- sin = mkUnaryOperator Sin sin- cos = mkUnaryOperator Cos cos- tan = mkUnaryOperator Tan tan- asin = mkUnaryOperator ArcSin asin- acos = mkUnaryOperator ArcCos acos- atan = mkUnaryOperator ArcTan atan- sinh = mkUnaryOperator SinH sinh- cosh = mkUnaryOperator CosH cosh- tanh = mkUnaryOperator TanH tanh- asinh x = log (sqrt (x*x+1) + x)- acosh x = log (sqrt (x*x-1) + x)- atanh x = (log (1+x) - log (1-x)) / 2+ pi = Constant pi+ exp = mkUnaryOperator Exp exp+ log = mkUnaryOperator Log log+ sqrt = mkUnaryOperator Sqrt sqrt+ (**) = mkBinaryOperator Pow (**)+ logBase a b = log b / log a+ sin = mkUnaryOperator Sin sin+ cos = mkUnaryOperator Cos cos+ tan = mkUnaryOperator Tan tan+ asin = mkUnaryOperator ArcSin asin+ acos = mkUnaryOperator ArcCos acos+ atan = mkUnaryOperator ArcTan atan+ sinh = mkUnaryOperator SinH sinh+ cosh = mkUnaryOperator CosH cosh+ tanh = mkUnaryOperator TanH tanh+ asinh x = log (sqrt (x*x+1) + x)+ acosh x = log (sqrt (x*x-1) + x)+ atanh x = (log (1+x) - log (1-x)) / 2 -- Unit generators are real. instance Real UGen where@@ -360,33 +412,35 @@ -- Unit generators are orderable. instance Ord UGen where- (Constant a) < (Constant b) = a < b- _ < _ = error "< at UGen is partial, see <*"+ (Constant a) < (Constant b) = a < b+ _ < _ = error "< at UGen is partial, see <*" (Constant a) <= (Constant b) = a <= b- _ <= _ = error "<= at UGen is partial, see <=*"- (Constant a) > (Constant b) = a < b- _ > _ = error "> at UGen is partial, see >*"+ _ <= _ = error "<= at UGen is partial, see <=*"+ (Constant a) > (Constant b) = a < b+ _ > _ = error "> at UGen is partial, see >*" (Constant a) >= (Constant b) = a >= b- _ >= _ = error ">= at UGen is partial, see >=*"+ _ >= _ = error ">= at UGen is partial, see >=*" min = mkBinaryOperator Min min max = mkBinaryOperator Max max -- Unit generators are enumerable. instance Enum UGen where- succ u = u + 1- pred u = u - 1- toEnum = constant+ succ u = u + 1+ pred u = u - 1+ toEnum = constant fromEnum (Constant n) = truncate n- fromEnum _ = error "cannot enumerate non-constant UGens"- enumFrom = iterate (+1)- enumFromThen n m = iterate (+(m-n)) n- enumFromTo n m = takeWhile (<= m+1/2) (enumFrom n)- enumFromThenTo n n' m = takeWhile (p (m + (n'-n)/2)) (enumFromThen n n')- where p = if n' >= n then (>=) else (<=)+ fromEnum _ = error "cannot enumerate non-constant UGens"+ enumFrom = iterate (+1)+ enumFromThen n m = iterate (+(m-n)) n+ enumFromTo n m = takeWhile (<= m+1/2) (enumFrom n)+ enumFromThenTo n n' m =+ let p = if n' >= n then (>=) else (<=)+ in takeWhile (p (m + (n'-n)/2)) (enumFromThen n n') -- Unit generators are stochastic. instance Random UGen where- randomR (Constant l, Constant r) g = let (n, g') = randomR (l,r) g- in (Constant n, g')+ randomR (Constant l, Constant r) g =+ let (n, g') = randomR (l,r) g+ in (Constant n, g') randomR _ _ = error "randomR: non constant (l,r)" random = randomR (-1.0, 1.0)
Sound/SC3/UGen/UGen/Lift.hs view
@@ -4,21 +4,33 @@ import Sound.SC3.UGen.UId -- | Lift base UGen to monadic form.-liftU :: (UId m) => (UGenId -> a -> UGen) -> (a -> m UGen)-liftU f a = do n <- generateUId- return (f (UGenId n) a)+liftU :: (UId m) =>+ (Int -> a -> UGen) ->+ (a -> m UGen)+liftU f a = do+ n <- generateUId+ return (f n a) -- | Lift base UGen to monadic form.-liftU2 :: (UId m) => (UGenId -> a -> b -> UGen) -> (a -> b -> m UGen)-liftU2 f a b = do n <- generateUId- return (f (UGenId n) a b)+liftU2 :: (UId m) =>+ (Int -> a -> b -> UGen) ->+ (a -> b -> m UGen)+liftU2 f a b = do+ n <- generateUId+ return (f n a b) -- | Lift base UGen to monadic form.-liftU3 :: (UId m) => (UGenId -> a -> b -> c -> UGen) -> (a -> b -> c -> m UGen)-liftU3 f a b c = do n <- generateUId- return (f (UGenId n) a b c)+liftU3 :: (UId m) =>+ (Int -> a -> b -> c -> UGen) ->+ (a -> b -> c -> m UGen)+liftU3 f a b c = do+ n <- generateUId+ return (f n a b c) -- | Lift base UGen to monadic form.-liftU4 :: (UId m) => (UGenId -> a -> b -> c -> d -> UGen) -> (a -> b -> c -> d -> m UGen)-liftU4 f a b c d = do n <- generateUId- return (f (UGenId n) a b c d)+liftU4 :: (UId m) =>+ (Int -> a -> b -> c -> d -> UGen) ->+ (a -> b -> c -> d -> m UGen)+liftU4 f a b c d = do+ n <- generateUId+ return (f n a b c d)
Sound/SC3/UGen/Utilities.hs view
@@ -24,26 +24,3 @@ from_warp Linear = Constant 0 from_warp Exponential = Constant 1 from_warp (Warp u) = u--env_curve :: EnvCurve -> UGen-env_curve EnvStep = Constant 0.0-env_curve EnvLin = Constant 1.0-env_curve EnvExp = Constant 2.0 -env_curve EnvSin = Constant 3.0-env_curve EnvCos = Constant 4.0-env_curve (EnvNum _) = Constant 5.0-env_curve EnvSqr = Constant 6.0-env_curve EnvCub = Constant 7.0--env_value :: EnvCurve -> UGen-env_value (EnvNum u) = u-env_value _ = Constant 0.0--d_dx :: (Num a) => [a] -> [a]-d_dx [] = []-d_dx [_] = []-d_dx [x,y] = [y - x]-d_dx (x:y:r) = y - x : d_dx (y:r)--dbl :: a -> [a]-dbl x = [x, x]
hsc3.cabal view
@@ -1,513 +1,74 @@ Name: hsc3-Version: 0.7+Version: 0.8 Synopsis: Haskell SuperCollider Description: hsc3 provides Sound.SC3, a haskell module that facilitates using haskell as a client to the SuperCollider synthesis server. License: GPL Category: Sound-Copyright: (c) Rohan Drape and others, 2006-2009+Copyright: (c) Rohan Drape and others, 2006-2010 Author: Rohan Drape Maintainer: rd@slavepianos.org Stability: Experimental-Homepage: http://slavepianos.org/rd/f/207949/-Tested-With: GHC == 6.8.2+Homepage: http://slavepianos.org/rd/?t=hsc3+Tested-With: GHC == 6.10.3 Build-Type: Simple Cabal-Version: >= 1.6 Data-files: README emacs/hsc3.el- -- The below is appended by:- -- find Help -name "*.*hs" | sort | \- -- sed "s/^/ /" >> hsc3.cabal- Help/Graphs/adso.lhs- Help/Graphs/aleatoric-quartet.lhs- Help/Graphs/analog-bubbles.lhs- Help/Graphs/babbling-brook.lhs- Help/Graphs/birds.lhs- Help/Graphs/bit-reduction.lhs- Help/Graphs/bottle.lhs- Help/Graphs/bowed-string.lhs- Help/Graphs/ccomb.lhs- Help/Graphs/chain-saw.lhs- Help/Graphs/chrd.lhs- Help/Graphs/cricket.lhs- Help/Graphs/crotale.lhs- Help/Graphs/cut-outs.lhs- Help/Graphs/cymbalism.lhs- Help/Graphs/deep-sea.lhs- Help/Graphs/default.lhs- Help/Graphs/demanding-studies.lhs- Help/Graphs/dial-history.lhs- Help/Graphs/diffraction.lhs- Help/Graphs/discretion.lhs- Help/Graphs/drummer.lhs- Help/Graphs/eggcrate.lhs- Help/Graphs/e-lamell.lhs- Help/Graphs/fbl-fbf.lhs- Help/Graphs/feedr.lhs- Help/Graphs/f-lets.lhs- Help/Graphs/fm-iter.lhs- Help/Graphs/fm-kltr.lhs- Help/Graphs/forest-sounds.lhs- Help/Graphs/fwalk.lhs- Help/Graphs/half-life.lhs- Help/Graphs/harmonic-swimming.lhs- Help/Graphs/harmonic-tumbling.lhs- Help/Graphs/h-chatter.lhs- Help/Graphs/hh-808.lhs- Help/Graphs/implosion.lhs- Help/Graphs/insects.lhs- Help/Graphs/karplus-strong.lhs- Help/Graphs/klink.lhs- Help/Graphs/k-ppr.lhs- Help/Graphs/lfo-modulation.lhs- Help/Graphs/lf-pulses.lhs- Help/Graphs/lg-timed.lhs- Help/Graphs/lin-sosc.lhs- Help/Graphs/lucier.hs- Help/Graphs/modal-space.lhs- Help/Graphs/moto-rev.lhs- Help/Graphs/mouse-clatter.lhs- Help/Graphs/nharm.lhs- Help/Graphs/noise-burst-sweep.lhs- Help/Graphs/one-line.lhs- Help/Graphs/oscillator-cluster.lhs- Help/Graphs/overlap-add.lhs- Help/Graphs/pattern-buffer.lhs- Help/Graphs/plucked-strings.lhs- Help/Graphs/police-state.lhs- Help/Graphs/pulsing-bottles.lhs- Help/Graphs/record-scratcher.lhs- Help/Graphs/red-frik.lhs- Help/Graphs/reverberated-sine-percussion.lhs- Help/Graphs/rm-octaver.lhs- Help/Graphs/sample-and-hold-liquidities.lhs- Help/Graphs/s-chirp.lhs- Help/Graphs/scratchy.lhs- Help/Graphs/scritto.lhs- Help/Graphs/shepard-tones.lhs- Help/Graphs/shifting-pulses.lhs- Help/Graphs/snare-909.lhs- Help/Graphs/sosc-lp.lhs- Help/Graphs/spe.lhs- Help/Graphs/sprinkler.lhs- Help/Graphs/strummable-guitar.lhs- Help/Graphs/sweepy-noise.lhs- Help/Graphs/synthetic-piano.lhs- Help/Graphs/tank.lhs- Help/Graphs/tgb.lhs- Help/Graphs/tgrn.lhs- Help/Graphs/tgr-rpr.lhs- Help/Graphs/theremin.lhs- Help/Graphs/three-cpsw.lhs- Help/Graphs/thx.lhs- Help/Graphs/tipnso.lhs- Help/Graphs/train.lhs- Help/Graphs/trkl.lhs- Help/Graphs/tr-out.lhs- Help/Graphs/tsort.lhs- Help/Graphs/vlc-distrtn.lhs- Help/Graphs/what-was-i-thinking.lhs- Help/Graphs/wial.lhs- Help/Graphs/wind-metals.lhs- Help/Graphs/xy-interference.lhs Help/hsc3.help.lhs- Help/Server/b_alloc.help.lhs- Help/Server/b_allocRead.help.lhs- Help/Server/b_close.help.lhs- Help/Server/b_fill.help.lhs- Help/Server/b_free.help.lhs- Help/Server/b_gen.help.lhs- Help/Server/b_get.help.lhs- Help/Server/b_getn.help.lhs- Help/Server/b_query.help.lhs- Help/Server/b_read.help.lhs- Help/Server/b_set.help.lhs- Help/Server/b_setn.help.lhs- Help/Server/b_write.help.lhs- Help/Server/b_zero.help.lhs- Help/Server/c_fill.help.lhs- Help/Server/c_get.help.lhs- Help/Server/c_getn.help.lhs- Help/Server/clearSched.help.lhs- Help/Server/c_set.help.lhs- Help/Server/c_setn.help.lhs- Help/Server/d_free.help.lhs- Help/Server/d_loadDir.help.lhs- Help/Server/d_load.help.lhs- Help/Server/d_recv.help.lhs- Help/Server/dumpOSC.help.lhs- Help/Server/g_deepFree.help.lhs- Help/Server/g_freeAll.help.lhs- Help/Server/g_head.help.lhs- Help/Server/g_new.help.lhs- Help/Server/g_tail.help.lhs- Help/Server/n_after.help.lhs- Help/Server/n_before.help.lhs- Help/Server/n_fill.help.lhs- Help/Server/n_free.help.lhs- Help/Server/n_map.help.lhs- Help/Server/n_mapn.help.lhs- Help/Server/notify.help.lhs- Help/Server/n_query.help.lhs- Help/Server/n_run.help.lhs- Help/Server/n_set.help.lhs- Help/Server/n_setn.help.lhs- Help/Server/n_trace.help.lhs- Help/Server/quit.help.lhs- Help/Server/s_get.help.lhs- Help/Server/s_getn.help.lhs- Help/Server/s_newargs.help.lhs- Help/Server/s_new.help.lhs- Help/Server/s_noid.help.lhs- Help/Server/status.help.lhs- Help/Server/sync.help.lhs- Help/Server/tr.help.lhs- Help/Server/u_cmd.help.lhs- Help/Tutorial/non-real-time.hs- Help/Tutorial/Tutorial.lhs- Help/Tutorial/Waveset.hs- Help/UGen/Analysis/amplitude.help.lhs- Help/UGen/Analysis/compander.help.lhs- Help/UGen/Analysis/pitch.help.lhs- Help/UGen/Analysis/runningSum.help.lhs- Help/UGen/Analysis/slope.help.lhs- Help/UGen/Analysis/zeroCrossing.help.lhs- Help/UGen/Buffer/bufAllpassC.help.lhs- Help/UGen/Buffer/bufAllpassL.help.lhs- Help/UGen/Buffer/bufAllpassN.help.lhs- Help/UGen/Buffer/bufChannels.help.lhs- Help/UGen/Buffer/bufCombC.help.lhs- Help/UGen/Buffer/bufCombL.help.lhs- Help/UGen/Buffer/bufCombN.help.lhs- Help/UGen/Buffer/bufDelayC.help.lhs- Help/UGen/Buffer/bufDelayL.help.lhs- Help/UGen/Buffer/bufDelayN.help.lhs- Help/UGen/Buffer/bufDur.help.lhs- Help/UGen/Buffer/bufFrames.help.lhs- Help/UGen/Buffer/bufRateScale.help.lhs- Help/UGen/Buffer/bufRd.help.lhs- Help/UGen/Buffer/bufSampleRate.help.lhs- Help/UGen/Buffer/detectIndex.help.lhs- Help/UGen/Buffer/index.help.lhs- Help/UGen/Buffer/indexInBetween.help.lhs- Help/UGen/Buffer/osc.help.lhs- Help/UGen/Buffer/playBuf.help.lhs- Help/UGen/Buffer/recordBuf.help.lhs- Help/UGen/Buffer/vOsc.help.lhs- Help/UGen/Chaos/crackle.help.lhs- Help/UGen/Chaos/cuspL.help.lhs- Help/UGen/Chaos/cuspN.help.lhs- Help/UGen/Chaos/fbSineC.help.lhs- Help/UGen/Chaos/fbSineL.help.lhs- Help/UGen/Chaos/fbSineN.help.lhs- Help/UGen/Chaos/henonC.help.lhs- Help/UGen/Chaos/henonL.help.lhs- Help/UGen/Chaos/henonN.help.lhs- Help/UGen/Chaos/latoocarfianC.help.lhs- Help/UGen/Chaos/linCongC.help.lhs- Help/UGen/Chaos/linCongL.help.lhs- Help/UGen/Chaos/linCongN.help.lhs- Help/UGen/Chaos/logistic.help.lhs- Help/UGen/Chaos/lorenzL.help.lhs- Help/UGen/Chaos/quadC.help.lhs- Help/UGen/Chaos/quadL.help.lhs- Help/UGen/Chaos/quadN.help.lhs- Help/UGen/Chaos/rossler.help.lhs- Help/UGen/Control/mrg2.help.lhs- Help/UGen/Demand/dbrown.help.lhs- Help/UGen/Demand/dbufrd.help.lhs- Help/UGen/Demand/dbufwr.help.lhs- Help/UGen/Demand/demandEnvGen.help.lhs- Help/UGen/Demand/demand.help.lhs- Help/UGen/Demand/dgeom.help.lhs- Help/UGen/Demand/dibrown.help.lhs- Help/UGen/Demand/diwhite.help.lhs- Help/UGen/Demand/drand.help.lhs- Help/UGen/Demand/dseq.help.lhs- Help/UGen/Demand/dser.help.lhs- Help/UGen/Demand/dseries.help.lhs- Help/UGen/Demand/dstutter.help.lhs- Help/UGen/Demand/dswitch1.help.lhs- Help/UGen/Demand/dswitch.help.lhs- Help/UGen/Demand/duty.help.lhs- Help/UGen/Demand/dwhite.help.lhs- Help/UGen/Demand/dxrand.help.lhs- Help/UGen/Demand/tDuty.help.lhs- Help/UGen/DiskIO/diskIn.help.lhs- Help/UGen/DiskIO/vDiskIn.help.lhs- Help/UGen/Envelope/detectSilence.help.lhs- Help/UGen/Envelope/done.help.lhs- Help/UGen/Envelope/envGen.help.lhs- Help/UGen/Envelope/free.help.lhs- Help/UGen/Envelope/freeSelf.help.lhs- Help/UGen/Envelope/freeSelfWhenDone.help.lhs- Help/UGen/Envelope/line.help.lhs- Help/UGen/Envelope/linen.help.lhs- Help/UGen/Envelope/pause.help.lhs- Help/UGen/Envelope/pauseSelf.help.lhs- Help/UGen/Envelope/pauseSelfWhenDone.help.lhs- Help/UGen/Envelope/xLine.help.lhs- Help/UGen/External/atsNoiSynth.help.lhs- Help/UGen/External/atsSynth.help.lhs- Help/UGen/External/ay.help.lhs- Help/UGen/External/fm7.help.lhs- Help/UGen/External/lpcSynth.help.lhs- Help/UGen/External/lpcVals.help.lhs- Help/UGen/External/membraneCircle.help.lhs- Help/UGen/External/membraneHexagon.help.lhs- Help/UGen/External/pv_Invert.help.lhs- Help/UGen/External/stkBowed.help.lhs- Help/UGen/External/stkFlute.help.lhs- Help/UGen/External/stkMandolin.help.lhs- Help/UGen/External/stkModalBar.help.lhs- Help/UGen/External/stkShakers.help.lhs- Help/UGen/External/vosim.help.lhs- Help/UGen/FFT/convolution.help.lhs- Help/UGen/FFT/fft.help.lhs- Help/UGen/FFT/ifft.help.lhs- Help/UGen/FFT/packFFT.help.lhs- Help/UGen/FFT/partConv.help.lhs- Help/UGen/FFT/pv_BinScramble.help.lhs- Help/UGen/FFT/pv_BinShift.help.lhs- Help/UGen/FFT/pv_BinWipe.help.lhs- Help/UGen/FFT/pv_BrickWall.help.lhs- Help/UGen/FFT/pvcollect.help.lhs- Help/UGen/FFT/pv_ConformalMap.help.lhs- Help/UGen/FFT/pv_Copy.help.lhs- Help/UGen/FFT/pv_Diffuser.help.lhs- Help/UGen/FFT/pv_LocalMax.help.lhs- Help/UGen/FFT/pv_MagAbove.help.lhs- Help/UGen/FFT/pv_MagBelow.help.lhs- Help/UGen/FFT/pv_MagClip.help.lhs- Help/UGen/FFT/pv_MagFreeze.help.lhs- Help/UGen/FFT/pv_RandComb.help.lhs- Help/UGen/FFT/pv_RandWipe.help.lhs- Help/UGen/FFT/pv_RectComb.help.lhs- Help/UGen/Filter/allpassC.help.lhs- Help/UGen/Filter/allpassL.help.lhs- Help/UGen/Filter/allpassN.help.lhs- Help/UGen/Filter/bBandPass.help.lhs- Help/UGen/Filter/bBandStop.help.lhs- Help/UGen/Filter/bHiPass.help.lhs- Help/UGen/Filter/bHiShelf.help.lhs- Help/UGen/Filter/bLowPass.help.lhs- Help/UGen/Filter/bLowShelf.help.lhs- Help/UGen/Filter/bPeakEQ.help.lhs- Help/UGen/Filter/bpf.help.lhs- Help/UGen/Filter/bpz2.help.lhs- Help/UGen/Filter/brf.help.lhs- Help/UGen/Filter/clip.help.lhs- Help/UGen/Filter/combC.help.lhs- Help/UGen/Filter/combL.help.lhs- Help/UGen/Filter/combN.help.lhs- Help/UGen/Filter/decay2.help.lhs- Help/UGen/Filter/decay.help.lhs- Help/UGen/Filter/degreeToKey.help.lhs- Help/UGen/Filter/delay1.help.lhs- Help/UGen/Filter/delay2.help.lhs- Help/UGen/Filter/delayC.help.lhs- Help/UGen/Filter/delayL.help.lhs- Help/UGen/Filter/delayN.help.lhs- Help/UGen/Filter/formlet.help.lhs- Help/UGen/Filter/fos.help.lhs- Help/UGen/Filter/freeVerb.help.lhs- Help/UGen/Filter/freqShift.help.lhs- Help/UGen/Filter/hasher.help.lhs- Help/UGen/Filter/hpf.help.lhs- Help/UGen/Filter/hpz1.help.lhs- Help/UGen/Filter/hpz2.help.lhs- Help/UGen/Filter/klank.help.lhs- Help/UGen/Filter/lag2.help.lhs- Help/UGen/Filter/lag3.help.lhs- Help/UGen/Filter/lag.help.lhs- Help/UGen/Filter/latch.help.lhs- Help/UGen/Filter/leakDC.help.lhs- Help/UGen/Filter/limiter.help.lhs- Help/UGen/Filter/linExp.help.lhs- Help/UGen/Filter/linLin.help.lhs- Help/UGen/Filter/lpf.help.lhs- Help/UGen/Filter/lpz1.help.lhs- Help/UGen/Filter/lpz2.help.lhs- Help/UGen/Filter/mantissaMask.help.lhs- Help/UGen/Filter/median.help.lhs- Help/UGen/Filter/moogFF.help.lhs- Help/UGen/Filter/normalizer.help.lhs- Help/UGen/Filter/onePole.help.lhs- Help/UGen/Filter/oneZero.help.lhs- Help/UGen/Filter/pitchShift.help.lhs- Help/UGen/Filter/pluck.help.lhs- Help/UGen/Filter/ramp.help.lhs- Help/UGen/Filter/resonz.help.lhs- Help/UGen/Filter/rhpf.help.lhs- Help/UGen/Filter/ringz.help.lhs- Help/UGen/Filter/rlpf.help.lhs- Help/UGen/Filter/select.help.lhs- Help/UGen/Filter/shaper.help.lhs- Help/UGen/Filter/slew.help.lhs- Help/UGen/Filter/sos.help.lhs- Help/UGen/Filter/twoPole.help.lhs- Help/UGen/Filter/twoZero.help.lhs- Help/UGen/Filter/wrapIndex.help.lhs- Help/UGen/Granular/grainBuf.help.lhs- Help/UGen/Granular/grainFM.help.lhs- Help/UGen/Granular/grainIn.help.lhs- Help/UGen/Granular/grainSin.help.lhs- Help/UGen/Granular/warp1.help.lhs- Help/UGen/Information/controlRate.help.lhs- Help/UGen/Information/numAudioBuses.help.lhs- Help/UGen/Information/numBuffers.help.lhs- Help/UGen/Information/numControlBuses.help.lhs- Help/UGen/Information/numInputBuses.help.lhs- Help/UGen/Information/numOutputBuses.help.lhs- Help/UGen/Information/numRunningSynths.help.lhs- Help/UGen/Information/radiansPerSample.help.lhs- Help/UGen/Information/sampleDur.help.lhs- Help/UGen/Information/sampleRate.help.lhs- Help/UGen/Information/subsampleOffset.help.lhs- Help/UGen/IO/inFeedback.help.lhs- Help/UGen/IO/in.help.lhs- Help/UGen/IO/inTrig.help.lhs- Help/UGen/IO/keyState.help.lhs- Help/UGen/IO/lagIn.help.lhs- Help/UGen/IO/localBuf.help.lhs- Help/UGen/IO/localIn.help.lhs- Help/UGen/IO/localOut.help.lhs- Help/UGen/IO/mouseButton.help.lhs- Help/UGen/IO/mouseX.help.lhs- Help/UGen/IO/mouseY.help.lhs- Help/UGen/IO/offsetOut.help.lhs- Help/UGen/IO/out.help.lhs- Help/UGen/IO/replaceOut.help.lhs- Help/UGen/IO/soundIn.help.lhs- Help/UGen/IO/xOut.help.lhs- Help/UGen/MachineListening/beatTrack.help.lhs- Help/UGen/MachineListening/loudness.help.lhs- Help/UGen/MachineListening/onsets.help.lhs- Help/UGen/Math/absDif.help.lhs- Help/UGen/Math/abs.help.lhs- Help/UGen/Math/add.help.lhs- Help/UGen/Math/amClip.help.lhs- Help/UGen/Math/atan2.help.lhs- Help/UGen/Math/clip2.help.lhs- Help/UGen/Math/dbAmp.help.lhs- Help/UGen/Math/difSqr.help.lhs- Help/UGen/Math/distort.help.lhs- Help/UGen/Math/eq.help.lhs- Help/UGen/Math/excess.help.lhs- Help/UGen/Math/fdiv.help.lhs- Help/UGen/Math/fold2.help.lhs- Help/UGen/Math/gt.help.lhs- Help/UGen/Math/hypot.help.lhs- Help/UGen/Math/max.help.lhs- Help/UGen/Math/mod.help.lhs- Help/UGen/Math/mul.help.lhs- Help/UGen/Math/pow.help.lhs- Help/UGen/Math/ring1.help.lhs- Help/UGen/Math/roundUp.help.lhs- Help/UGen/Math/scaleNeg.help.lhs- Help/UGen/Math/softClip.help.lhs- Help/UGen/Math/sumSqr.help.lhs- Help/UGen/Math/thresh.help.lhs- Help/UGen/Noise/brownNoise.help.lhs- Help/UGen/Noise/clipNoise.help.lhs- Help/UGen/Noise/coinGate.help.lhs- Help/UGen/Noise/dust2.help.lhs- Help/UGen/Noise/dust.help.lhs- Help/UGen/Noise/expRand.help.lhs- Help/UGen/Noise/grayNoise.help.lhs- Help/UGen/Noise/iRand.help.lhs- Help/UGen/Noise/lfClipNoise.help.lhs- Help/UGen/Noise/lfdClipNoise.help.lhs- Help/UGen/Noise/lfdNoise0.help.lhs- Help/UGen/Noise/lfdNoise1.help.lhs- Help/UGen/Noise/lfdNoise3.help.lhs- Help/UGen/Noise/lfNoise0.help.lhs- Help/UGen/Noise/lfNoise1.help.lhs- Help/UGen/Noise/lfNoise2.help.lhs- Help/UGen/Noise/linRand.help.lhs- Help/UGen/Noise/nRand.help.lhs- Help/UGen/Noise/pinkNoise.help.lhs- Help/UGen/Noise/rand.help.lhs- Help/UGen/Noise/randID.help.lhs- Help/UGen/Noise/randSeed.help.lhs- Help/UGen/Noise/tExpRand.help.lhs- Help/UGen/Noise/tiRand.help.lhs- Help/UGen/Noise/tRand.help.lhs- Help/UGen/Noise/whiteNoise.help.lhs- Help/UGen/Oscillator/blip.help.lhs- Help/UGen/Oscillator/formant.help.lhs- Help/UGen/Oscillator/fSinOsc.help.lhs- Help/UGen/Oscillator/gendy1.help.lhs- Help/UGen/Oscillator/impulse.help.lhs- Help/UGen/Oscillator/klang.help.lhs- Help/UGen/Oscillator/lfCub.help.lhs- Help/UGen/Oscillator/lfPar.help.lhs- Help/UGen/Oscillator/lfPulse.help.lhs- Help/UGen/Oscillator/lfSaw.help.lhs- Help/UGen/Oscillator/lfTri.help.lhs- Help/UGen/Oscillator/oscN.help.lhs- Help/UGen/Oscillator/pulse.help.lhs- Help/UGen/Oscillator/saw.help.lhs- Help/UGen/Oscillator/silent.help.lhs- Help/UGen/Oscillator/sinOsc.help.lhs- Help/UGen/Oscillator/syncSaw.help.lhs- Help/UGen/Oscillator/tChoose.help.lhs- Help/UGen/Oscillator/tGrains.help.lhs- Help/UGen/Oscillator/twChoose.help.lhs- Help/UGen/Oscillator/twindex.help.lhs- Help/UGen/Oscillator/varSaw.help.lhs- Help/UGen/Panner/linPan2.help.lhs- Help/UGen/Panner/pan2.help.lhs- Help/UGen/Panner/rotate2.help.lhs- Help/UGen/Panner/splay.help.lhs- Help/UGen/Trigger/gate.help.lhs- Help/UGen/Trigger/inRange.help.lhs- Help/UGen/Trigger/lastValue.help.lhs- Help/UGen/Trigger/mostChange.help.lhs- Help/UGen/Trigger/peak.help.lhs- Help/UGen/Trigger/phasor.help.lhs- Help/UGen/Trigger/pulseCount.help.lhs- Help/UGen/Trigger/pulseDivider.help.lhs- Help/UGen/Trigger/runningMax.help.lhs- Help/UGen/Trigger/runningMin.help.lhs- Help/UGen/Trigger/sendTrig.help.lhs- Help/UGen/Trigger/setResetFF.help.lhs- Help/UGen/Trigger/stepper.help.lhs- Help/UGen/Trigger/sweep.help.lhs- Help/UGen/Trigger/tDelay.help.lhs- Help/UGen/Trigger/timer.help.lhs- Help/UGen/Trigger/toggleFF.help.lhs- Help/UGen/Trigger/trig1.help.lhs- Help/UGen/Trigger/trig.help.lhs+ Help/tutorial.lhs+ Help/Server/*.help.lhs+ Help/UGen/Analysis/*.help.lhs+ Help/UGen/Buffer/*.help.lhs+ Help/UGen/Chaos/*.help.lhs+ Help/UGen/Control/*.help.lhs+ Help/UGen/Demand/*.help.lhs+ Help/UGen/DiskIO/*.help.lhs+ Help/UGen/Envelope/*.help.lhs+ Help/UGen/External/*.help.lhs+ Help/UGen/FFT/*.help.lhs+ Help/UGen/Filter/*.help.lhs+ Help/UGen/Granular/*.help.lhs+ Help/UGen/Information/*.help.lhs+ Help/UGen/IO/*.help.lhs+ Help/UGen/MachineListening/*.help.lhs+ Help/UGen/Math/*.help.lhs+ Help/UGen/Noise/*.help.lhs+ Help/UGen/Oscillator/*.help.lhs+ Help/UGen/Panner/*.help.lhs+ Help/UGen/Trigger/*.help.lhs Library- Build-Depends: base == 3.*,+ Build-Depends: base == 4.*, binary, bytestring, containers,- hosc == 0.7,+ hosc == 0.8, network, process,- random+ random,+ split GHC-Options: -Wall -fwarn-tabs Exposed-modules: Sound.SC3+ Sound.SC3.ID+ Sound.SC3.Monadic Sound.SC3.Server Sound.SC3.Server.Command+ Sound.SC3.Server.Command.Completion Sound.SC3.Server.NRT Sound.SC3.Server.Play Sound.SC3.Server.Status Sound.SC3.Server.Synthdef Sound.SC3.UGen Sound.SC3.UGen.Analysis- Sound.SC3.UGen.Base Sound.SC3.UGen.Buffer Sound.SC3.UGen.Chaos Sound.SC3.UGen.Composite Sound.SC3.UGen.Composite.Monadic Sound.SC3.UGen.Demand- Sound.SC3.UGen.Demand.Base+ Sound.SC3.UGen.Demand.ID Sound.SC3.UGen.Demand.Monadic Sound.SC3.UGen.DiskIO Sound.SC3.UGen.Enum@@ -517,7 +78,7 @@ Sound.SC3.UGen.External.ATS Sound.SC3.UGen.External.LPC Sound.SC3.UGen.FFT- Sound.SC3.UGen.FFT.Base+ Sound.SC3.UGen.FFT.ID Sound.SC3.UGen.FFT.Monadic Sound.SC3.UGen.Filter Sound.SC3.UGen.Granular@@ -525,8 +86,7 @@ Sound.SC3.UGen.Information Sound.SC3.UGen.MachineListening Sound.SC3.UGen.Math- Sound.SC3.UGen.Monadic- Sound.SC3.UGen.Noise.Base+ Sound.SC3.UGen.Noise.ID Sound.SC3.UGen.Noise.Monadic Sound.SC3.UGen.Operator Sound.SC3.UGen.Oscillator@@ -537,3 +97,7 @@ Sound.SC3.UGen.UId Other-modules: Sound.SC3.Server.Utilities Sound.SC3.UGen.Utilities++Source-Repository head+ Type: darcs+ Location: http://slavepianos.org/~rd/sw/hsc3/