hsc3 0.4 → 0.5
raw patch · 163 files changed
+1598/−568 lines, 163 filesdep ~hoscPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hosc
API changes (from Hackage documentation)
- Sound.SC3.UGen.Demand.Unsafe: dbrown :: UGen -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dbufrd :: UGen -> UGen -> Loop -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dbufwr :: UGen -> UGen -> UGen -> Loop -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dgeom :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dibrown :: UGen -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: diwhite :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: drand :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dseq :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dser :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dseries :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dswitch :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dswitch1 :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dwhite :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Demand.Unsafe: dxrand :: UGen -> UGen -> UGen
- Sound.SC3.UGen.FFT.Unsafe: pv_BinScramble :: UGen -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.FFT.Unsafe: pv_RandComb :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.FFT.Unsafe: pv_RandWipe :: UGen -> UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: brownNoise :: Rate -> UGen
- Sound.SC3.UGen.Noise.Unsafe: clipNoise :: Rate -> UGen
- Sound.SC3.UGen.Noise.Unsafe: coinGate :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: dust :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: dust2 :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: expRand :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: grayNoise :: Rate -> UGen
- Sound.SC3.UGen.Noise.Unsafe: iRand :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfClipNoise :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfNoise0 :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfNoise1 :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfNoise2 :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfdClipNoise :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfdNoise0 :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfdNoise1 :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfdNoise2 :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: lfdNoise3 :: Rate -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: linRand :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: nRand :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: pinkNoise :: Rate -> UGen
- Sound.SC3.UGen.Noise.Unsafe: rand :: UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: tExpRand :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: tRand :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: tiRand :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: twindex :: UGen -> UGen -> UGen -> UGen
- Sound.SC3.UGen.Noise.Unsafe: whiteNoise :: Rate -> UGen
+ Sound.SC3.Server.Command: s_newargs :: String -> Int -> AddAction -> Int -> [(String, [Double])] -> OSC
+ Sound.SC3.Server.Play: send :: (Transport t) => t -> OSC -> IO ()
+ Sound.SC3.UGen.Buffer: asLocalBuf :: UGenId -> [UGen] -> UGen
+ Sound.SC3.UGen.Buffer: localBuf :: UGenId -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Buffer: setBuf :: UGen -> [UGen] -> UGen -> UGen
+ Sound.SC3.UGen.Composite: indexL :: UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.Base: dstutter :: UGenId -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Demand.Monadic: dstutter :: (UId m) => UGen -> UGen -> m UGen
+ Sound.SC3.UGen.External: fm7 :: [[UGen]] -> [[UGen]] -> UGen
+ Sound.SC3.UGen.FFT: partConv :: UGen -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.FFT: pc_calcAccumSize :: Int -> Int -> Int
+ Sound.SC3.UGen.FFT: pc_preparePartConv :: Int -> Int -> Int -> OSC
+ Sound.SC3.UGen.Filter: bAllPass :: UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Filter: bBandPass :: UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Filter: bBandStop :: UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Filter: bHiPass :: UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Filter: bHiShelf :: UGen -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Filter: bLowPass :: UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Filter: bLowShelf :: UGen -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.Filter: bPeakEQ :: UGen -> UGen -> UGen -> UGen -> UGen
+ Sound.SC3.UGen.UGen.Lift: liftP :: (a -> IO UGen) -> (a -> UGen)
+ Sound.SC3.UGen.UGen.Lift: liftP2 :: (a -> b -> IO UGen) -> (a -> b -> UGen)
+ Sound.SC3.UGen.UGen.Lift: liftP3 :: (a -> b -> c -> IO UGen) -> (a -> b -> c -> UGen)
+ Sound.SC3.UGen.UGen.Lift: liftP4 :: (a -> b -> c -> d -> IO UGen) -> (a -> b -> c -> d -> UGen)
+ Sound.SC3.UGen.UGen.Lift: liftU :: (UId m) => (UGenId -> 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: liftU3 :: (UId m) => (UGenId -> 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)
Files
- Help/Graphs/adso.lhs +7/−5
- Help/Graphs/aleatoric-quartet.lhs +12/−9
- Help/Graphs/analog-bubbles.lhs +2/−0
- Help/Graphs/babbling-brook.lhs +4/−2
- Help/Graphs/birds.lhs +27/−0
- Help/Graphs/bit-reduction.lhs +6/−4
- Help/Graphs/bottle.lhs +8/−5
- Help/Graphs/bowed-string.lhs +7/−2
- Help/Graphs/ccomb.lhs +8/−6
- Help/Graphs/chain-saw.lhs +6/−1
- Help/Graphs/chrd.lhs +6/−4
- Help/Graphs/cricket.lhs +6/−4
- Help/Graphs/crotale.lhs +3/−0
- Help/Graphs/cut-outs.lhs +7/−5
- Help/Graphs/cymbalism.lhs +8/−6
- Help/Graphs/deep-sea.lhs +3/−0
- Help/Graphs/default.lhs +35/−0
- Help/Graphs/demanding-studies.lhs +5/−3
- Help/Graphs/dial-history.lhs +11/−8
- Help/Graphs/diffraction.lhs +10/−7
- Help/Graphs/discretion.lhs +6/−4
- Help/Graphs/drummer.lhs +3/−1
- Help/Graphs/e-lamell.lhs +10/−6
- Help/Graphs/eggcrate.lhs +5/−3
- Help/Graphs/f-lets.lhs +11/−9
- Help/Graphs/fbl-fbf.lhs +26/−0
- Help/Graphs/feedr.lhs +5/−3
- Help/Graphs/fm-iter.lhs +5/−3
- Help/Graphs/fm-kltr.lhs +6/−4
- Help/Graphs/forest-sounds.lhs +4/−2
- Help/Graphs/fwalk.lhs +5/−3
- Help/Graphs/h-chatter.lhs +8/−5
- Help/Graphs/half-life.lhs +3/−1
- Help/Graphs/harmonic-swimming.lhs +4/−2
- Help/Graphs/harmonic-tumbling.lhs +4/−2
- Help/Graphs/hh-808.lhs +2/−0
- Help/Graphs/implosion.lhs +8/−6
- Help/Graphs/insects.lhs +14/−0
- Help/Graphs/k-ppr.lhs +6/−3
- Help/Graphs/karplus-strong.lhs +4/−2
- Help/Graphs/klink.lhs +5/−3
- Help/Graphs/lf-pulses.lhs +4/−2
- Help/Graphs/lfo-modulation.lhs +2/−0
- Help/Graphs/lg-timed.lhs +5/−3
- Help/Graphs/lin-sosc.lhs +7/−2
- Help/Graphs/modal-space.lhs +3/−19
- Help/Graphs/moto-rev.lhs +2/−0
- Help/Graphs/mouse-clatter.lhs +9/−7
- Help/Graphs/nharm.lhs +6/−1
- Help/Graphs/noise-burst-sweep.lhs +3/−1
- Help/Graphs/one-line.lhs +2/−0
- Help/Graphs/oscillator-cluster.lhs +9/−7
- Help/Graphs/overlap-add.lhs +39/−0
- Help/Graphs/pattern-buffer.lhs +7/−4
- Help/Graphs/plucked-strings.lhs +11/−9
- Help/Graphs/police-state.lhs +12/−10
- Help/Graphs/pulsing-bottles.lhs +10/−7
- Help/Graphs/record-scratcher.lhs +2/−0
- Help/Graphs/red-frik.lhs +9/−7
- Help/Graphs/reverberated-sine-percussion.lhs +9/−6
- Help/Graphs/rm-octaver.lhs +2/−0
- Help/Graphs/rzblp.lhs +3/−0
- Help/Graphs/s-chirp.lhs +9/−7
- Help/Graphs/sample-and-hold-liquidities.lhs +3/−0
- Help/Graphs/scratchy.lhs +6/−2
- Help/Graphs/scritto.lhs +6/−4
- Help/Graphs/shepard-tones.lhs +2/−0
- Help/Graphs/shifting-pulses.lhs +4/−2
- Help/Graphs/snare-909.lhs +4/−2
- Help/Graphs/sosc-lp.lhs +7/−5
- Help/Graphs/spe.lhs +7/−4
- Help/Graphs/sprinkler.lhs +9/−5
- Help/Graphs/strummable-guitar.lhs +3/−0
- Help/Graphs/sweepy-noise.lhs +3/−1
- Help/Graphs/synthetic-piano.lhs +6/−4
- Help/Graphs/tank.lhs +4/−0
- Help/Graphs/tgb.lhs +5/−2
- Help/Graphs/tgr-rpr.lhs +11/−7
- Help/Graphs/tgrn.lhs +16/−0
- Help/Graphs/theremin.lhs +2/−0
- Help/Graphs/three-cpsw.lhs +8/−6
- Help/Graphs/thx.lhs +37/−0
- Help/Graphs/tipnso.lhs +5/−3
- Help/Graphs/tr-out.lhs +6/−4
- Help/Graphs/train.lhs +24/−0
- Help/Graphs/trkl.lhs +13/−11
- Help/Graphs/trmlo.lhs +3/−0
- Help/Graphs/tsort.lhs +2/−0
- Help/Graphs/vlc-distrtn.lhs +8/−6
- Help/Graphs/voscil.lhs +6/−2
- Help/Graphs/what-was-i-thinking.lhs +6/−4
- Help/Graphs/wial.lhs +13/−11
- Help/Graphs/wind-metals.lhs +9/−7
- Help/Graphs/xy-interference.lhs +8/−2
- Help/Server/s_newargs.help.lhs +30/−0
- Help/Tutorial/Tutorial.lhs +12/−5
- Help/Tutorial/Waveset.hs +170/−0
- Help/Tutorial/non-real-time.hs +23/−0
- Help/UGen/Buffer/detectIndex.help.lhs +2/−0
- Help/UGen/Demand/dbufrd.help.lhs +3/−0
- Help/UGen/Demand/dstutter.help.lhs +13/−0
- Help/UGen/External/fm7.help.lhs +107/−0
- Help/UGen/External/lpcSynth.help.lhs +1/−1
- Help/UGen/FFT/partConv.help.lhs +64/−0
- Help/UGen/Filter/bBandPass.help.lhs +13/−0
- Help/UGen/Filter/bBandStop.help.lhs +13/−0
- Help/UGen/Filter/bHiPass.help.lhs +14/−0
- Help/UGen/Filter/bHiShelf.help.lhs +22/−0
- Help/UGen/Filter/bLowPass.help.lhs +14/−0
- Help/UGen/Filter/bLowShelf.help.lhs +24/−0
- Help/UGen/Filter/bPeakEQ.help.lhs +20/−0
- Help/UGen/Filter/freeVerb.help.lhs +6/−6
- Help/UGen/Filter/rlpf.help.lhs +5/−0
- Help/UGen/IO/localBuf.help.lhs +69/−0
- Help/UGen/IO/localIn.help.lhs +2/−0
- Help/UGen/IO/localOut.help.lhs +2/−0
- Help/UGen/Information/sampleRate.help.lhs +1/−1
- Help/UGen/Information/subsampleOffset.help.lhs +4/−5
- Help/UGen/MachineListening/loudness.help.lhs +41/−0
- Help/UGen/Noise/lfNoise0.help.lhs +1/−1
- Help/UGen/Oscillator/lfPulse.help.lhs +2/−0
- Help/UGen/Oscillator/lfSaw.help.lhs +1/−1
- Help/UGen/Oscillator/tChoose.help.lhs +4/−4
- Help/hsc3.help.lhs +4/−0
- Sound/SC3/Server.hs +2/−0
- Sound/SC3/Server/Command.hs +15/−9
- Sound/SC3/Server/NRT.hs +2/−1
- Sound/SC3/Server/Play.hs +2/−1
- Sound/SC3/Server/Status.hs +1/−0
- Sound/SC3/Server/Synthdef.hs +2/−0
- Sound/SC3/Server/Utilities.hs +3/−0
- Sound/SC3/UGen.hs +1/−0
- Sound/SC3/UGen/Analysis.hs +1/−0
- Sound/SC3/UGen/Buffer.hs +22/−3
- Sound/SC3/UGen/Chaos.hs +1/−0
- Sound/SC3/UGen/Composite.hs +10/−0
- Sound/SC3/UGen/Demand.hs +1/−0
- Sound/SC3/UGen/Demand/Base.hs +4/−0
- Sound/SC3/UGen/Demand/Monadic.hs +4/−0
- Sound/SC3/UGen/Demand/Unsafe.hs +0/−62
- Sound/SC3/UGen/Enum.hs +1/−0
- Sound/SC3/UGen/Envelope.hs +1/−0
- Sound/SC3/UGen/Envelope/Construct.hs +1/−0
- Sound/SC3/UGen/External.hs +6/−0
- Sound/SC3/UGen/External/ATS.hs +1/−0
- Sound/SC3/UGen/External/LPC.hs +1/−0
- Sound/SC3/UGen/FFT.hs +21/−0
- Sound/SC3/UGen/FFT/Unsafe.hs +0/−17
- Sound/SC3/UGen/Filter.hs +26/−0
- Sound/SC3/UGen/Granular.hs +1/−0
- Sound/SC3/UGen/IO.hs +1/−0
- Sound/SC3/UGen/Information.hs +2/−0
- Sound/SC3/UGen/MachineListening.hs +1/−0
- Sound/SC3/UGen/Math.hs +1/−0
- Sound/SC3/UGen/Noise/Unsafe.hs +0/−110
- Sound/SC3/UGen/Operator.hs +1/−0
- Sound/SC3/UGen/Oscillator.hs +1/−0
- Sound/SC3/UGen/Panner.hs +1/−0
- Sound/SC3/UGen/Rate.hs +3/−1
- Sound/SC3/UGen/Record/Pitch.hs +1/−0
- Sound/SC3/UGen/UGen.hs +6/−6
- Sound/SC3/UGen/Unsafe.hs +0/−7
- hsc3.cabal +27/−8
Help/Graphs/adso.lhs view
@@ -1,9 +1,11 @@ adso (rd) +> import Sound.OpenSoundControl+> import Sound.SC3+> import System.Random+ > let { rrand l r = getStdRandom (randomR (l, r))-> ; rrand_l j l r = replicateM j (rrand l r)-> ; threadPause :: Double -> IO ()-> ; threadPause t = when (t>0) (threadDelay (floor (t * 1e6)))+> ; 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@@ -14,7 +16,7 @@ > 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-> ; replicateM n (rrand l r) }+> ; 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) }@@ -24,7 +26,7 @@ > ; rn 4 0.001 0.0075 > ; rn 5 1 24 > ; rn 6 0.05 2.4 }-> ; threadPause t } }+> ; 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
Help/Graphs/aleatoric-quartet.lhs view
@@ -1,25 +1,28 @@ aleatoric quartet (jmcc) +> import Sound.SC3+ > let { amp = 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 (M.rand 0 0.05)+> ; rapf i = do { r <- clone 2 (rand 0 0.05) > ; return (allpassN i 0.05 r 1) }-> ; mk_f = do { i0 <- M.iRand 0 2+> ; mk_f = do { i0 <- iRand 0 2 > ; let r0 = select i0 (mce [1, 0.5, 0.25])-> in do { r1 <- M.rand (-30) 30-> ; n0 <- M.lfNoise0 kr r0+> in do { r1 <- rand (-30) 30+> ; n0 <- lfNoise0 kr r0 > ; let m = lag (roundE (n0 * 7 + 66 + r1) 1) 0.2 > in return (midiCPS m) } }-> ; mk_s = do { f <- liftM recip mk_f-> ; r <- M.rand (-1) 1-> ; x <- do { n0 <- M.pinkNoise ar-> ; n1 <- M.lfNoise1 kr 8+> ; 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 (replicateM 4 mk_s)+> in do { g <- chain 5 rapf =<< fmap sum (sequence (replicate 4 mk_s)) > ; audition (out 0 (leakDC g 0.995)) } { var amp = 0.07
Help/Graphs/analog-bubbles.lhs view
@@ -1,5 +1,7 @@ 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 }
Help/Graphs/babbling-brook.lhs view
@@ -1,7 +1,9 @@ babbling brook (jmcc) -> let b f m a g = do { n1 <- M.brownNoise ar-> ; n2 <- M.brownNoise ar+> 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)
+ Help/Graphs/birds.lhs view
@@ -0,0 +1,27 @@+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 view
@@ -2,8 +2,10 @@ sample rate decrease -> do { f <- M.lfNoise2 kr 8-> ; nh <- M.lfNoise2 kr 3+> 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))) }@@ -16,8 +18,8 @@ bit rate decrease -> do { f <- M.lfNoise2 kr 8-> ; nh <- M.lfNoise2 kr 3+> 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
Help/Graphs/bottle.lhs view
@@ -1,15 +1,18 @@ bottle (sc) -> do { freq <- M.rand 220 880-> ; wn <- M.whiteNoise ar-> ; pn <- M.pinkNoise ar-> ; let { chain n f = foldl (>=>) return (replicate n f)+> 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 <- M.linRand 0.001 0.1 (-1)+> ; 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
Help/Graphs/bowed-string.lhs view
@@ -1,5 +1,10 @@ bowed string (jmcc) +> import Control.Monad+> import Sound.SC3+> import qualified Sound.SC3.UGen.Monadic as M+> import System.Random+ > let { rrand l r = getStdRandom (randomR (l, r)) > ; choose l = fmap (l !!) (rrand 0 (length l - 1)) > ; root = 5@@ -8,8 +13,8 @@ > in do { n0 <- clone 2 (M.brownNoise ar) > ; r0 <- M.expRand 0.125 0.5 > ; r1 <- M.rand 0.7 0.9-> ; r2 <- replicateM 12 (M.rand 1.0 3.0)-> ; f <- liftM midiCPS (liftM2 (+) (choose scale) (choose oct))+> ; 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)
Help/Graphs/ccomb.lhs view
@@ -1,16 +1,18 @@ 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 <- liftM (rng lwr 72.0) (M.lfNoise2 kr 0.1)-> ; e <- liftM (decay2 t 0.01) (M.tRand 0.05 0.75 t)-> ; x <- liftM (* e) (M.whiteNoise ar)-> ; m <- M.lfNoise2 kr 0.1+> ; 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 <- M.dust kr (mce2 0.75 0.35)-> ; audition . (out 0) . (* 0.1) . sum =<< replicateM 12 (spart t) }+> 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
Help/Graphs/chain-saw.lhs view
@@ -3,6 +3,11 @@ [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+ > 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) }@@ -11,7 +16,7 @@ > ; mceProduct = mceEdit (\l -> [product l]) > ; clipu s = clip2 s 1 > ; dup a = mce2 a a-> ; f s1 = do { xr <- liftM dup (M.expRand 0.1 2)+> ; 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
Help/Graphs/chrd.lhs view
@@ -1,9 +1,11 @@ chrd (rd) -> let chrd = do { r0 <- M.rand 0.05 0.5-> ; [r1, r2] <- replicateM 2 (M.rand (-1) 1)-> ; r3 <- M.rand 0.15 0.35-> ; r4 <- M.rand 0.005 0.01+> 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])
Help/Graphs/cricket.lhs view
@@ -1,12 +1,14 @@ cricket (rd) -> do { r1 <- clone 2 (M.rand 10 13)-> ; r2 <- clone 2 (M.rand 10 13)-> ; r3 <- clone 2 (M.rand 4 7)+> 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 (M.tRand 2220 2227 t)+> 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) })
Help/Graphs/crotale.lhs view
@@ -1,5 +1,8 @@ crotale (rd) +> import Sound.SC3+> import qualified Sound.SC3.UGen.Base as B+ > let { crotale = ( [ 35.45676040649414 > , 128.59849548339844 > , 346.9721984863281
Help/Graphs/cut-outs.lhs view
@@ -1,14 +1,16 @@ 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 <- M.lfNoise0 kr 2-> ; n2 <- M.coinGate (0.05 + n1 + y * 0.4 + t * 0.5) (t * 0.5)-> ; n3 <- M.tExpRand (mce2 500 900) 1600 t+> ; 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 <- liftM sum (replicateM 3 n)-> ; b <- M.tRand 0 1 =<< dust kr 8+> 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)
Help/Graphs/cymbalism.lhs view
@@ -1,14 +1,16 @@ cymbalism (jmcc) +> import Sound.SC3+ > let p = 15-> in do { f1 <- M.rand 500 2500-> ; f2 <- M.rand 0 8000-> ; let y = do { f <- replicateM p (M.rand f1 (f1 + f2))-> ; rt <- replicateM p (M.rand 1 5)+> 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 <- liftM (* 0.03) (M.whiteNoise ar)-> ; tf <- M.rand 0.5 3.5+> ; 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) }
Help/Graphs/deep-sea.lhs view
@@ -1,5 +1,8 @@ deep sea (jrhb) +> import Sound.SC3+> import qualified Sound.SC3.UGen.Base as B+ > let { range s l r = let m = (r - l) * 0.5 in mulAdd s m (m + l) > ; amp = 1 > ; pan = 0
+ Help/Graphs/default.lhs view
@@ -0,0 +1,35 @@+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 view
@@ -1,8 +1,10 @@ demanding studies (jmcc) -> do { s1 <- M.drand dinf (mce [72, 75, 79, 82])-> ; s2 <- M.drand 1 (mce [82, 84, 86])-> ; s3 <- M.dseq dinf (mce [72, 75, 79, s2])+> 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])
Help/Graphs/dial-history.lhs view
@@ -1,18 +1,21 @@ 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 <- M.dwhite dinf 7 12-> ; w <- M.dwhite 1 2 7-> ; b <- M.dbrown n 0.1 0.2 0.01-> ; rate <- M.dseq dinf (mce2 w b)-> ; q <- M.dseq dinf (mce [1..10])-> ; g1 <- M.grayNoise ar-> ; g2 <- M.grayNoise ar-> ; d <- M.lfdNoise3 kr 0.5+> 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
Help/Graphs/diffraction.lhs view
@@ -1,20 +1,23 @@ 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 <- liftM (* mce2 32 64) (M.lfNoise0 kr 4)-> ; w <- liftM (* x) (M.lfNoise0 kr 32)-> ; z <- liftM (* 0.1) (M.lfNoise0 kr 2)-> ; m <- M.lfNoise0 kr 6+> 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 <- M.lfNoise0 kr 128+> ; 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 <- liftM (* x) (M.rand 50 59)-> ; am <- liftM (* y) (M.rand 0.04 0.16)+> ; 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]
Help/Graphs/discretion.lhs view
@@ -1,10 +1,12 @@ 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 (M.rand 50 55)-> ; f2 <- clone 2 (M.rand 50 65)-> ; f3 <- clone 2 (M.rand 50 55)-> ; a <- clone 2 (M.rand 0.01 0.035)+> ; 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 }
Help/Graphs/drummer.lhs view
@@ -1,6 +1,8 @@ drummer (thor magnusson) -> do { n <- M.whiteNoise ar+> import Sound.SC3++> do { n <- whiteNoise ar > ; let { tempo = 4 > ; dup a = mce2 a a > ; tr = impulse ar tempo 0
Help/Graphs/e-lamell.lhs view
@@ -1,13 +1,17 @@ e-lamell (rd) -> let { rrand l r = getStdRandom (randomR (l, r))+> 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)-> ; threadPause :: Double -> IO ()-> ; threadPause t = when (t>0) (threadDelay (floor (t * 1e6))) > ; 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@@ -15,7 +19,7 @@ > ; d = ctl "d" 0.1 > ; l = ctl "l" 0 > ; a = ctl "a" 1 }-> in do { t <- M.tChoose 1 (mce2 1 32)+> 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@@ -44,7 +48,7 @@ > ; a <- choose [0, 0.25, 0.5, 1] > ; l <- rrand (-1) 1 > ; return (mk_s_new f n d a l) }-> ; send fd (Bundle (-1) [p, q]) -> ; threadPause 0.1 } }+> ; 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 view
@@ -1,12 +1,14 @@ 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] <- replicateM 2 (M.brownNoise kr)-> ; t <- M.dust kr 2.4-> ; [f0, f1] <- replicateM 2 (M.tChoose t p)+> 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)) }
Help/Graphs/f-lets.lhs view
@@ -1,16 +1,18 @@ f-lets (rd) +> import Sound.SC3+ > let { f_let t g j n f = > let pd = pulseDivider t j 0-> in do { r0 <- M.tiRand (mce2 2 1) n pd-> ; r1 <- M.tRand 0.01 0.04 pd-> ; r2 <- M.tRand 0.05 0.10 pd+> 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 <- M.tRand 0 1 t-> ; r1 <- M.tRand 0 1 t-> ; r2 <- M.tRand 0 1 t-> ; r3 <- M.tRand 0 1 t-> ; r4 <- M.coinGate 0.2 t+> ; 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))@@ -19,5 +21,5 @@ > , 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 <- M.lfNoise0 kr 2+> in do { n <- lfNoise0 kr 2 > ; audition . out 0 . (* (n * 0.25 + 0.25)) . sum =<< mk_n tr }
+ Help/Graphs/fbl-fbf.lhs view
@@ -0,0 +1,26 @@+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 view
@@ -1,12 +1,14 @@ 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 > ; dl = 6-> ; feedr n = do { t <- replicateM n (M.rand 0.0 (constant dl))-> ; g <- replicateM n (M.rand 0.4 1.0)-> ; f <- replicateM n (M.rand 0.9 0.95)+> ; 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
Help/Graphs/fm-iter.lhs view
@@ -1,11 +1,13 @@ 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 <- M.tRand 56 57 t-> ; i <- M.tRand 40 480 t-> ; j <- M.tRand (-1) 1 t+> 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
Help/Graphs/fm-kltr.lhs view
@@ -1,8 +1,10 @@ fm-kltr (rd) +> import Sound.OpenSoundControl+> import Sound.SC3+> import System.Random+ > let { rrand l r = getStdRandom (randomR (l, r))-> ; threadPause :: Double -> IO ()-> ; threadPause t = when (t>0) (threadDelay (floor (t * 1e6))) > ; gr = > do { r1 <- rand 0.975 1.025 > ; r2 <- rand 0.5 1.5@@ -40,7 +42,7 @@ > ; i <- rrand 240 1480 > ; t <- rrand 0.15 1.25 > ; fm fd 53 ff a d i-> ; threadPause t } }+> ; pauseThread t } } > in withSC3 (\fd -> do { u <- gr > ; async fd (d_recv (synthdef "fm" u))-> ; replicateM 32 (nd fd) })+> ; sequence (replicate 32 (nd fd)) })
Help/Graphs/forest-sounds.lhs view
@@ -1,7 +1,9 @@ forest sounds (paul jones) -> let insects = do { n1 <- M.brownNoise ar-> ; n2 <- M.lfNoise2 kr 50+> 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
Help/Graphs/fwalk.lhs view
@@ -1,5 +1,7 @@ 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@@ -10,9 +12,9 @@ > , 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 <- M.dust kr 3-> ; r1 <- M.tiRand 0 6 t-> ; r2 <- M.tRand (-0.0001) 0.0001 t+> ; 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
Help/Graphs/h-chatter.lhs view
@@ -1,15 +1,18 @@ 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 =<< M.lfNoise0 kr 1-> ; a <- mma 0.2 1.2 =<< M.lfNoise2 kr n-> ; b <- mma 0.15 0.15 =<< M.lfNoise2 kr n+> ; 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 <- M.lfNoise0 kr 32-> ; n1 <- M.lfNoise0 kr 2+> ; 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
Help/Graphs/half-life.lhs view
@@ -1,9 +1,11 @@ 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 <- M.dust ar (n * log 2 / t_half)+> in do { activity <- dust ar (n * log 2 / t_half) > ; audition (mrg [ localOut activity > , out 0 activity ]) }
Help/Graphs/harmonic-swimming.lhs view
@@ -1,11 +1,13 @@ 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 (M.rand 2 8)-> ; n <- M.lfNoise1 kr r+> ; 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]
Help/Graphs/harmonic-tumbling.lhs view
@@ -1,10 +1,12 @@ 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 <- M.dust kr t-> ; r <- M.rand 0 0.5+> ; 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]
Help/Graphs/hh-808.lhs view
@@ -1,5 +1,7 @@ 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
Help/Graphs/implosion.lhs view
@@ -1,18 +1,20 @@ 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 <- M.whiteNoise rt+> in do { n <- whiteNoise rt > ; return (wrp n le re) } }-> in do { n0 <- M.rand (-1) 0-> ; n1 <- M.rand 0 1-> ; d <- M.rand 7.5 13.5-> ; f0 <- M.rand 10990 16220-> ; f1 <- M.rand 9440 19550+> 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
+ Help/Graphs/insects.lhs view
@@ -0,0 +1,14 @@+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 view
@@ -1,5 +1,8 @@ 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@@ -7,10 +10,10 @@ > ; tf = wrp ti 100 200 > ; t = impulse ar tf 0 > ; stream lf rf ld rd g = -> do { r1 <- M.rand 9 18+> do { r1 <- rand 9 18 > ; let t' = pulseDivider t r1 0-> in do { r2 <- M.tRand lf (wrp ti lf rf) t'-> ; r3 <- M.tRand ld rd t'+> 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 }
Help/Graphs/karplus-strong.lhs view
@@ -1,5 +1,7 @@ karplus strong (alex mclean) +> import Sound.SC3+ > let { aA = ( "aA" > , [800, 1150, 2800, 3500, 4950] > , [0, -4 , -20, -36 , -60]@@ -30,8 +32,8 @@ > ; 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 <- M.whiteNoise ar-> ; d <- M.dust kr 4+> ; 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 view
@@ -1,6 +1,8 @@ klink (rd) -> do { n1 <- M.lfNoise0 kr (mce2 0.5 1.5)+> 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@@ -8,8 +10,8 @@ > ; 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 <- M.tRand x 3940 t-> ; n3 <- M.tRand 0.005 0.275 t+> 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])
Help/Graphs/lf-pulses.lhs view
@@ -1,7 +1,9 @@ lf pulses (rd) -> do { n0 <- M.lfNoise0 ar (mce2 20 40)-> ; n1 <- M.lfNoise0 ar (mce2 5 10)+> 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 }
Help/Graphs/lfo-modulation.lhs view
@@ -1,5 +1,7 @@ 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 }
Help/Graphs/lg-timed.lhs view
@@ -1,9 +1,11 @@ lg-timed (rd) +> import Sound.SC3+ > let { timed r y p =-> do { d0 <- M.dser r p-> ; d1 <- M.dcons 0 d0-> ; d2 <- M.dser r y+> 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)
Help/Graphs/lin-sosc.lhs view
@@ -1,5 +1,11 @@ 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@@ -7,8 +13,7 @@ > ; 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 = liftM (l !!) (rrand (0, length l - 1))-> ; pauseThread n = when (n > 1e-3) (threadDelay (floor (n * 1e6)))+> ; choose l = fmap (l !!) (rrand (0, length l - 1)) > ; iota 0 _ _ = [] > ; iota n l s = l : iota (n - 1) (l + s) s > ; geom 0 _ _ = []
Help/Graphs/modal-space.lhs view
@@ -1,5 +1,7 @@ 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@@ -12,7 +14,7 @@ > 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 (M.lfNoise1 kr 3)+> ; n <- clone 2 (lfNoise1 kr 3) > ; play fd (out 0 ((c n 48 + c n 72) * 0.25)) }) { var s = Server.default@@ -32,21 +34,3 @@ ; ["/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--(let* ((b 0)- (p (list 0 2 3.2 5 7 9 10))- (x (MouseX kr 0 15 0 0.1))- (k (DegreeToKey 0 x 12))- (c (lambda (n r)- (let* ((o (Mul (SinOsc ar (MIDICPS (Add3 r k n)) 0) 0.1))- (t (LFPulse ar (MIDICPS (mce2 48 55)) 0.15 0.5))- (f (MIDICPS (MulAdd (SinOsc kr 0.1 0) 10 r)))- (d (Mul (RLPF t f 0.1) 0.1))- (m (Add o d)))- (Add (CombN m 0.31 0.31 2) m)))))- (with-sc3- (lambda (fd)- (async fd (/b_alloc 0 7 1))- (send fd (/b_setn1 0 0 p))- (let ((n (Mul (LFNoise1 kr (mce2 3 3.05)) 0.04)))- (play fd (Out 0 (Mul (Add (c n 48) (c n 72)) 0.25)))))))
Help/Graphs/moto-rev.lhs view
@@ -1,5 +1,7 @@ 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))
Help/Graphs/mouse-clatter.lhs view
@@ -1,17 +1,19 @@ 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 <- M.lfNoise0 kr (mce [3, 3.25])+> in do { n1 <- lfNoise0 kr (mce [3, 3.25]) > ; let { t = impulse kr (n1 * 16 + 18) 0-> ; s = do { n2 <- M.tRand 0.005 y t-> ; n3 <- M.whiteNoise ar-> ; n4 <- M.tRand 10 x t-> ; n5 <- M.tRand 0 1 t-> ; n6 <- M.tExpRand 0.15 1 t+> ; 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 <- M.pv_RandComb (fft' 10 o) n6 t+> ; 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 }) }
Help/Graphs/nharm.lhs view
@@ -1,12 +1,17 @@ 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 <- replicateM n (rrand 0.01 0.02)+> ; 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)
Help/Graphs/noise-burst-sweep.lhs view
@@ -1,6 +1,8 @@ noise burst sweep (jmcc) -> do { n <- clone 2 (M.whiteNoise ar)+> 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
Help/Graphs/one-line.lhs view
@@ -1,5 +1,7 @@ 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 }
Help/Graphs/oscillator-cluster.lhs view
@@ -1,22 +1,24 @@ 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 = liftM (\n -> ln (a + n) b d) (M.rand 0 r)-> ; rxln r a b d = liftM (\n -> xln (a + n) b d) (M.rand 0 r)-> ; prt d a cf = do { r1 <- M.rand cf (cf + 2)+> ; 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 <- M.rand 0.1 0.2+> ; 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 = replicateM np (rand 220 660) }-> in do { d <- M.rand 4 7-> ; a <- M.rand 0.01 0.05+> ; 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
+ Help/Graphs/overlap-add.lhs view
@@ -0,0 +1,39 @@+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 view
@@ -1,5 +1,8 @@ pattern buffer (rd) +> import Sound.SC3+> import System.Random+ > let { nf = 2 * 48000 > ; c = 24 > ; tseq l = let n = fromIntegral (length l) / 2.0@@ -10,14 +13,14 @@ > ; rs h = do { r0 <- rrand 0 nf > ; r1 <- rrand 0.0 1.0 > ; send h (b_set1 10 r0 r1) } }-> in do { r1 <- replicateM c (rrand 36 96)-> ; r2 <- replicateM c (rrand (-1.0) 1.0)+> in do { r1 <- sequence (replicate c (rrand 36 96))+> ; r2 <- sequence (replicate c (rrand (-1.0) 1.0)) > ; r3 <- rrand 0 1-> ; n1 <- M.tRand 0.02 0.08 t+> ; 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)-> ; replicateM_ c (rs fd)+> ; sequence (replicate c (rs fd)) > ; play fd (out 0 (pan2 o l e)) }) }
Help/Graphs/plucked-strings.lhs view
@@ -1,20 +1,22 @@ plucked strings (jmcc) -> let { s = do { n0 <- M.pinkNoise ar-> ; r1 <- M.rand (-1) 1+> 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 <- M.rand 2 2.2-> ; n0 <- M.dust ar 0.5-> ; r1 <- M.rand 0.05 0.15-> ; r2 <- M.rand 0 (pi * 2)-> ; r3 <- M.iRand 0 2+> ; 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 <- M.rand 60 90+> ; dt = do { r0 <- rand 60 90 > ; return (1 / (midiCPS (floorE r0))) } }-> in audition . out 0 . sum =<< replicateM 5 s+> in audition . out 0 . sum =<< sequence (replicate 5 s)
Help/Graphs/police-state.lhs view
@@ -1,18 +1,20 @@ police state (jmcc) -> let node = do { r0 <- M.rand 0.02 0.12-> ; r1 <- M.rand 0 (pi*2)-> ; r2 <- M.rand 0 600-> ; r3 <- M.rand 700 1300-> ; r4 <- M.rand (-1) 1-> ; r5 <- M.rand 80 120-> ; n0 <- M.lfNoise2 ar r5+> 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 (M.lfNoise2 kr 0.4)-> ; n1 <- M.lfNoise2 ar (n0 * 90 + 620)-> ; n2 <- M.lfNoise2 kr (mce2 0.3 0.301)+> ; 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)) }
Help/Graphs/pulsing-bottles.lhs view
@@ -1,12 +1,15 @@ pulsing bottles (jmcc) -> let { r = do { n <- M.whiteNoise ar-> ; r0 <- M.rand 4 14-> ; r1 <- M.rand 0 0.7-> ; r2 <- M.rand 400 7400+> 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 <- M.rand 0.1 0.5-> ; p <- M.rand 0 (pi * 2)+> ; 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 =<< replicateM 6 u+> in audition . out 0 . sum =<< sequence (replicate 6 u)
Help/Graphs/record-scratcher.lhs view
@@ -1,5 +1,7 @@ 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
Help/Graphs/red-frik.lhs view
@@ -1,16 +1,18 @@ red frik (f0) +> import Sound.SC3+ > let red tr n = -> do { r1 <- M.tRand 0.3 3 tr-> ; r2 <- M.tRand 0.3 5 tr-> ; r3 <- M.tRand 0 0.5 tr-> ; r4 <- M.tRand 0.49 0.56 tr-> ; r5 <- M.tRand 0.3 0.6 tr-> ; r6 <- M.tRand 0.3 0.5 tr+> 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 (M.brownNoise ar)+> in do { n <- clone 2 (brownNoise ar) > ; let tr = impulse kr 0.1 0 > in audition . out 0 =<< red tr n }
Help/Graphs/reverberated-sine-percussion.lhs view
@@ -1,18 +1,21 @@ reverberated sine percussion (jmcc) +> import Sound.SC3+ > let { d = 6 > ; c = 5 > ; a = 4-> ; s_ = do { n <- M.dust ar (2 / constant d)-> ; r <- M.rand 0 3000+> ; 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 (M.rand 0 0.05)+> ; 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 <- liftM sum (replicateM d s_)+> in do { s <- fmap sum (sequence (replicate d s_)) > ; y <- let z = delayN s 0.048 0.48-> in do { r <- clone c (M.rand 0 0.1)-> ; n <- M.lfNoise1 kr r+> 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)) }
Help/Graphs/rm-octaver.lhs view
@@ -1,5 +1,7 @@ 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
Help/Graphs/rzblp.lhs view
@@ -1,5 +1,8 @@ rzblp (rd) +> import Sound.SC3+> import qualified Sound.SC3.UGen.Unsafe as U+ > let { wrp i l r = let m = (r - l) / 2 > in i * m + l + m > ; lfn f l r = wrp (U.lfNoise0 kr f) l r
Help/Graphs/s-chirp.lhs view
@@ -1,19 +1,21 @@ 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 <- M.dust kr 9-> ; b <- M.tChoose t (mce [36, 48, 60, 72])-> ; n <- liftM (* 0.04) (M.lfNoise1 kr (mce2 3 3.05))-> ; d <- M.tiRand x y t-> ; e <- liftM (decay2 t 0.005) (M.tRand 0.02 0.15 t)+> 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 <- M.tRand 0.0075 0.125 u-> ; r1 <- M.tRand 0.05 0.15 u+> 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)
Help/Graphs/sample-and-hold-liquidities.lhs view
@@ -1,5 +1,8 @@ sample and hold liquidities (jmcc) +> import Sound.SC3+> import qualified Sound.SC3.UGen.Base as B+ > let { r = mouseX kr 1 200 Exponential 0.1 > ; t = recip r > ; c = impulse kr r 0.4
Help/Graphs/scratchy.lhs view
@@ -1,6 +1,8 @@ scratchy (jmcc) -> do { n <- clone 2 (M.brownNoise ar)+> 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)) } @@ -8,7 +10,9 @@ ; var f = (n - 0.49).max(0) * 20 ; Out.ar(0, RHPF.ar(f, 5000, 1)) }.play -with non-monadic noise+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] }
Help/Graphs/scritto.lhs view
@@ -1,5 +1,7 @@ scritto (rd) +> import Sound.SC3+ > let { scritto = [ ( "sA" > , [800, 1150, 2900, 3900, 4950] > , [0, -6, -32, -20, -50]@@ -107,11 +109,11 @@ > ; 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 <- M.lfNoise2 kr 3+> { n <- lfNoise2 kr 3 > ; let { t = impulse ar (n * 9 + 9) 0-> ; i d = do { n1 <- M.tRand 0.02 0.06 t-> ; n2 <- M.tiRand 30 52 t-> ; n3 <- M.tiRand 16 32 t+> ; 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) }
Help/Graphs/shepard-tones.lhs view
@@ -1,5 +1,7 @@ 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 =
Help/Graphs/shifting-pulses.lhs view
@@ -1,7 +1,9 @@ shifting pulses (rd) -> do { [n0, n1, n2] <- replicateM 3 (clone 2 (M.brownNoise kr))-> ; t <- M.dust kr 0.75+> 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
Help/Graphs/snare-909.lhs view
@@ -1,5 +1,7 @@ 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@@ -16,8 +18,8 @@ > ; 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 <- M.whiteNoise ar-> ; v <- M.tRand 0.25 1.0 t+> in do { n <- whiteNoise ar+> ; v <- tRand 0.25 1.0 t > ; audition (out 0 (pan2 (snr t n v) 0 y)) } { var snr =
Help/Graphs/sosc-lp.lhs view
@@ -1,8 +1,10 @@ sosc-lp (rd) -> let { dustR r lo hi = do { n1 <- M.dwhite 1 lo hi-> ; n2 <- M.whiteNoise r-> ; d <- M.dseq dinf n1+> 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]@@ -14,13 +16,13 @@ > ; 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)+> 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 <- M.lfNoise0 kr (mce2 1 3)+> ; n <- lfNoise0 kr (mce2 1 3) > ; audition (sosc_lp clk n) } > let { a = [71, 60, 65, 89, 36, 57, 95, 97, 92, 97]
Help/Graphs/spe.lhs view
@@ -1,15 +1,18 @@ spe (jmcc) -> let { chain n f = foldl (>=>) return (replicate n f)-> ; rapf i = do { r <- clone 2 (M.rand 0 0.05)+> 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 <- M.lfNoise1 kr 1-> ; m <- M.dseq dinf s+> 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) }
Help/Graphs/sprinkler.lhs view
@@ -1,15 +1,19 @@ sprinkler (jmcc) -> do { n <- M.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))) }+> 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 -with non-monadic noise+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
Help/Graphs/strummable-guitar.lhs view
@@ -1,5 +1,8 @@ strummable guitar (jmcc) +> import Sound.SC3+> import qualified Sound.SC3.UGen.Base as B+ > 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)))
Help/Graphs/sweepy-noise.lhs view
@@ -1,6 +1,8 @@ sweepy noise (jmcc) -> do { n <- clone 2 (M.whiteNoise ar)+> 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)
Help/Graphs/synthetic-piano.lhs view
@@ -1,11 +1,13 @@ synthetic piano (jmcc) -> let p = do { n <- M.iRand 36 90-> ; f <- M.rand 0.1 0.5-> ; ph <- M.rand 0 (pi * 2)+> 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 <- M.lfNoise2 ar 3000+> ; 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) }
Help/Graphs/tank.lhs view
@@ -1,5 +1,9 @@ tank (jmcc) +> import Control.Monad+> import Sound.SC3+> import qualified Sound.SC3.UGen.Monadic as M+ > 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)
Help/Graphs/tgb.lhs view
@@ -1,13 +1,16 @@ 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 M.tRand le re t+> 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 <- M.whiteNoise rt+> 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
Help/Graphs/tgr-rpr.lhs view
@@ -1,5 +1,9 @@ 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@@ -7,9 +11,9 @@ > , 0.2, 0.3 > , 0.7, 0.9 > , -1.0, 1.0 ]-> ; dustR r lo hi = do { n1 <- M.dwhite 1 lo hi-> ; n2 <- M.whiteNoise r-> ; d <- M.dseq dinf n1+> ; 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))@@ -21,17 +25,17 @@ > , (-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)])-> ; threadDelay 350000 } }+> ; 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 <- liftM (* (bufDur kr 10)) (rpr 8 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)-> ; threadDelay 3000000-> ; replicateM_ 16 (edit fd)+> ; pauseThread 0.3+> ; sequence (replicate 16 (edit fd)) > ; reset fd }) }
+ Help/Graphs/tgrn.lhs view
@@ -0,0 +1,16 @@+tgrn (rd)++> import Sound.SC3+> import qualified Sound.SC3.UGen.Base as B++> let { fn = "/home/rohan/audio/text.snd"+> ; 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 }+> in withSC3 (\fd -> do { async fd (b_allocRead 10 fn 0 0)+> ; audition (out 0 (tgrn 10)) })
Help/Graphs/theremin.lhs view
@@ -1,5 +1,7 @@ theremin (jmcc) +> import Sound.SC3+ > let { m = 7 > ; detune = 0 > ; x = mouseX kr 0 0.9 Linear 0.2
Help/Graphs/three-cpsw.lhs view
@@ -1,11 +1,13 @@ three-cpsw (rd) -> do { t <- M.dust kr (mce2 12 18)-> ; f0 <- M.tRand 1 64 t-> ; f1 <- M.lfNoise0 kr f0-> ; a <- M.tRand 0.0 0.5 t-> ; dt <- M.tRand 0.975 1.025 t-> ; dh <- M.tRand 0.750 0.7505 t+> 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)) }
+ Help/Graphs/thx.lhs view
@@ -0,0 +1,37 @@+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 view
@@ -1,10 +1,12 @@ tipnso (rd) +> import Sound.SC3+ > let { x = mouseX kr 1 32 Linear 0.1 > ; t = impulse ar x 0 }-> in do { n1 <- M.tiRand 16 72 t-> ; n2 <- M.tiRand 0 1 t-> ; n3 <- M.pinkNoise ar+> 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
Help/Graphs/tr-out.lhs view
@@ -1,9 +1,11 @@ tr-out (rd) -> let node n = do { t <- M.dust kr 1.6-> ; r1 <- M.tRand 0 6 t-> ; r2 <- M.tRand 0 6 t-> ; r3 <- M.tRand 0 6 t+> 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 }
+ Help/Graphs/train.lhs view
@@ -0,0 +1,24 @@+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 view
@@ -1,24 +1,26 @@ 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 <- M.rand (-1) 1-> ; r1 <- M.rand (-1) 1-> ; r2 <- M.tRand 0.05 1.0 t-> ; r3 <- M.tExpRand 0.0 0.25 st -> ; fh <- M.tRand 1.75 2.25 t +> 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 <- M.rand 0.5 16-> ; ul <- M.rand 16 64-> ; fu <- M.rand 1200 9000-> ; dy <- M.rand 0.005 0.175-> ; la <- M.rand (-60) (-25)-> ; fy <- M.rand 0.015 0.125+> 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/trmlo.lhs view
@@ -1,5 +1,8 @@ trmlo (rd) +> import Sound.SC3+> import qualified Sound.SC3.UGen.Unsafe as U+ > let { mWrp i l r = linLin i (-1) 1 (midiCPS l) (midiCPS r) > ; mWrp1 i m = mWrp i m (m + 1) > ; mWrpN i m n = mWrp i m (m + n)
Help/Graphs/tsort.lhs view
@@ -9,6 +9,8 @@ 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
Help/Graphs/vlc-distrtn.lhs view
@@ -1,10 +1,12 @@ 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)-> ; threadPause :: Double -> IO ()-> ; threadPause t = when (t>0) (threadDelay (floor (t * 1e6))) > ; prep (ampl, phase) = [dbAmp ampl, phase] > ; vlc = [ (0.00000, 1.85550) > , (-9.92383, -0.65147)@@ -82,8 +84,8 @@ > , (-67.32140, -2.79905) > , (-68.22010, -2.33831) ] > ; partial i freq detune fall n =-> do { n0 <- M.lfNoise1 kr 1-> ; n1 <- M.rand 0.75 1.25+> 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) }@@ -122,9 +124,9 @@ > ,("ampl", a) > ,("detune", d) > ,("fall", fl)])-> ; threadPause =<< choose [0.25, 0.5, 0.75, 1.5] } }+> ; 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 [])-> ; replicateM 32 (pattern fd) })+> ; sequence (replicate 32 (pattern fd)) })
Help/Graphs/voscil.lhs view
@@ -1,5 +1,9 @@ voscil (rd) +> import Sound.SC3+> import qualified Sound.SC3.UGen.Unsafe as U+> import System.Random+ > let { rrand l r = getStdRandom (randomR (l, r)) > ; lfn r = U.lfNoise0 kr r > ; b = 32@@ -17,8 +21,8 @@ > in p + q > ; run fd = let r_set i = > do { m <- rrand 2 512-> ; j <- replicateM m (rrand 0 bn)-> ; k <- replicateM m (rrand (-1) 1)+> ; j <- sequence (replicate m (rrand 0 bn))+> ; k <- sequence (replicate m (rrand (-1) 1)) > ; async fd (b_alloc i bn 1) > ; send fd (b_set i (zip j k)) } > in do { mapM_ r_set [0 .. (b - 1)]
Help/Graphs/what-was-i-thinking.lhs view
@@ -1,14 +1,16 @@ what was i thinking? (jmcc) -> do { n0 <- M.lfNoise1 kr 0.2-> ; n1 <- M.lfNoise1 kr 0.157+> 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 <- M.rand 0 0.3-> ; n <- M.lfNoise1 kr r+> ; 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)
Help/Graphs/wial.lhs view
@@ -1,19 +1,21 @@ 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 <- M.tiRand 0 1 t+> 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) = liftM (* a) (pls c (mce2 d0 d1) f)+> ; 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 <- M.dust kr 2-> ; f <- M.twChoose n0 (mce2 (20 * 0.66) 20) (mce2 0.25 0.75) 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 view
@@ -1,13 +1,15 @@ wind metals (jmcc) +> import Sound.SC3+ > let n = 6-> in do { base <- M.expRand 60 4000-> ; range <- M.rand 500 8000-> ; n0 <- clone 2 (M.brownNoise ar)-> ; r0 <- M.expRand 0.125 0.5-> ; n1 <- M.lfNoise1 kr r0-> ; f <- replicateM n (M.rand base (base + range))-> ; dt <- replicateM n (M.rand 0.1 2)+> 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 }
Help/Graphs/xy-interference.lhs view
@@ -1,12 +1,18 @@ 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 <- M.lfNoise0 kr (mce2 5 9)+> ; 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 =<< replicateM 3 nd+> 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)
+ Help/Server/s_newargs.help.lhs view
@@ -0,0 +1,30 @@+/s_newargs create a new synth++string - synth definition name+int - synth ID+int - add action (0,1,2, 3 or 4 see below)+int - add target ID+[+ int|string - a control index or name+ int - number of sequential controls to change (M)+ [+ float - a control value+ ] * M+] * N++Note: this command is inherently problematic when used with +graphs generated by hsc3 since, as a rule, it is not possible+to fix the ordering of control variables.++> let { ks n is = let { js = (Nothing : map Just [1..])+> ; 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))+> ; fs = [440, 450, 600, 700]+> ; a fd = do { async fd (d_recv (synthdef "g" g))+> ; send fd (s_newargs "g" (-1) AddToTail 1 [("f", fs)]) } }+> in do { print g+> ; withSC3 a }++> s_newargs "g" (-1) AddToTail 1 [("f", [440, 450, 600, 700])]
Help/Tutorial/Tutorial.lhs view
@@ -8,7 +8,12 @@ * Setting up Haskell SuperCollider -Haskell SuperCollider is currently only available as a set of darcs+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. @@ -230,8 +235,10 @@ * References -[1] http://www.audiosynth.com/-[2] http://www.haskell.org/ghc/+[1] http://audiosynth.com/+[2] http://haskell.org/ghc/ [3] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/binary-0.3-[4] http://www.gnu.org/software/emacs/-[5] http://www.haskell.org/haskell-mode/+[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 view
@@ -0,0 +1,170 @@+{- 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 view
@@ -0,0 +1,23 @@+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/detectIndex.help.lhs view
@@ -5,6 +5,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, [2, 3, 4, 0, 1, 5])]) })
Help/UGen/Demand/dbufrd.help.lhs view
@@ -6,6 +6,9 @@ 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 System.Random+ > let n = randomRs (200.0, 500.0) (mkStdGen 0) > in do { withSC3 (\fd -> do { async fd (b_alloc 10 24 1) > ; send fd (b_setn 10 [(0, take 24 n)]) })
+ Help/UGen/Demand/dstutter.help.lhs view
@@ -0,0 +1,13 @@+dstutter n in++Demand rate input replicator.++n - number of repeats (can be a demand ugen)+in - input ugen++> do { inp <- dseq dinf (mce [1, 2, 3])+> ; nse <- diwhite dinf 2 8+> ; rep <- dstutter nse inp+> ; let { trg = impulse KR (mouseX KR 1 40 Exponential 0.2) 0+> ; frq = demand trg 0 rep * 30 + 340 }+> in audition (out 0 (sinOsc AR frq 0 * 0.1)) }
+ Help/UGen/External/fm7.help.lhs view
@@ -0,0 +1,107 @@+fm7 ctl mod++ fm7, stefan kersten, phase modulation oscillator matrix.+ http://darcs.k-hornz.de/repos/skUG/++fm7 implements a 6x6 oscillator matrix, where each+oscillator's phase can be modulated by any of the+other oscillators' output.++The UGen expects two (flattened) matrices: one for+specifying the oscillator parameters frequency+(control rate), phase (initialization only) and+amplitude (control rate):++[ [ 300, 0, 1 ],+ [ 400, pi/2, 1 ],+ [ 730, 0, 0.5 ],+ [ 0, 0, 0 ],+ [ 0, 0, 0 ],+ [ 0, 0, 0 ] ]++The modulation matrix specifies the amount of+modulation each oscillator output has on another+oscillator's phase. Row i in the matrix refer to+oscillator i's phase input and the columns denote+the amount of phase modulation in radians.++The UGen outputs the six individual oscillator+signals.++> let { c = [ [xLine KR 300 310 4 DoNothing, 0, 1]+> , [xLine KR 300 310 8 DoNothing, 0, 1]+> , [0, 0, 1]+> , [0, 0, 1]+> , [0, 0, 1]+> , [0, 0, 1] ]+> ; m = [ [line KR 0 0.001 2 DoNothing, line KR 0.1 0 4 DoNothing, 0, 0, 0, 0]+> , [line KR 0 6 1 DoNothing, 0, 0, 0, 0, 0]+> , [0, 0, 0, 0, 0, 0]+> , [0, 0, 0, 0, 0, 0]+> , [0, 0, 0, 0, 0, 0]+> , [0, 0, 0, 0, 0, 0] ]+> ; MCE [l, r, _, _, _, _] = fm7 c m }+> in audition (out 0 (mce2 l r * 0.1))++An algorithmically generated graph courtesy f0.++> let { x = [ [ [ 0.0, -0.33333333333333, -1.0, 0.0 ]+> , [ 0.75, 0.75, 0.0, -0.5 ]+> , [ -0.5, -0.25, 0.25, -0.75 ]+> , [ -0.5, 1.0, 1.0, 1.0 ]+> , [ 0.0, 0.16666666666667, -0.75, -1.0 ]+> , [ 0.5, 0.5, -0.5, 0.33333333333333 ] ]+> , [ [ -0.33333333333333, 0.5, -0.5, -0.5 ]+> , [ 0.5, 0.75, 0.25, 0.75 ]+> , [ -0.83333333333333, 0.25, -1.0, 0.5 ]+> , [ 1.5, 0.25, 0.25, -0.25 ]+> , [ -0.66666666666667, -0.66666666666667, -1.0, -0.5 ]+> , [ -1.0, 0.0, -0.83333333333333, -0.33333333333333 ] ]+> , [ [ 0.25, -0.5, -0.5, -1.0 ]+> , [ -0.5, 1.0, -1.5, 0.0 ]+> , [ -1.0, -1.5, -0.5, 0.0 ]+> , [ 0.5, -1.0, 1.1666666666667, -0.5 ]+> , [ 0.83333333333333, -0.75, -1.5, 0.5 ]+> , [ 0.25, -1.0, 0.5, 1.0 ] ]+> , [ [ 1.0, 0.33333333333333, 0.0, -0.75 ]+> , [ -0.25, 0.0, 0.0, -0.5 ]+> , [ -0.5, -0.5, 0.0, 0.5 ]+> , [ 1.0, 0.75, 0.5, 0.5 ]+> , [ 0.0, 1.5, -0.5, 0.0 ]+> , [ 1.0, 0.0, -0.25, -0.5 ] ]+> , [ [ 0.5, -0.25, 0.0, 0.33333333333333 ]+> , [ 0.25, -0.75, 0.33333333333333, -1.0 ]+> , [ -0.25, -0.5, 0.25, -1.1666666666667 ]+> , [ 0.0, 0.25, 0.5, 0.16666666666667 ]+> , [ -1.0, -0.5, 0.83333333333333, -0.5 ]+> , [ 0.83333333333333, -0.75, -0.5, 0.0 ] ]+> , [ [ 0.0, -0.75, -0.16666666666667, 0.0 ]+> , [ 1.0, 0.5, 0.5, 0.0 ]+> , [ -0.5, 0.0, -0.5, 0.0 ]+> , [ -0.5, -0.16666666666667, 0.0, 0.5 ]+> , [ -0.25, 0.16666666666667, -0.75, 0.25 ]+> , [ -1.1666666666667, -1.3333333333333, -0.16666666666667, 1.5 ] ] ]+> ; y = [ [ [ 0.0, -0.5, 1.0, 0.0 ]+> , [ -0.5, 1.0, 0.5, -0.5 ]+> , [ 0.0, 0.33333333333333, 1.0, 1.0 ] ]+> , [ [ -0.5, 0.5, 1.0, 1.0 ]+> , [ 0.0, 0.33333333333333, 0.0, 1.5 ]+> , [ -0.5, 0.83333333333333, 1.0, 0.0 ] ]+> , [ [ 0.25, -0.66666666666667, 0.25, 0.0 ]+> , [ 0.5, -0.5, -0.5, -0.5 ]+> , [ 0.5, -0.5, -0.75, 0.83333333333333 ] ]+> , [ [ -0.25, 1.0, 0.0, 0.33333333333333 ]+> , [ -1.25, -0.25, 0.5, 0.0 ]+> , [ 0.0, -1.25, -0.25, -0.5 ] ]+> , [ [ 0.75, -0.25, 1.5, 0.0 ]+> , [ 0.25, -1.5, 0.5, 0.5 ]+> , [ -0.5, -0.5, -0.5, -0.25 ] ]+> , [ [ 0.0, 0.5, -0.5, 0.25 ]+> , [ 0.25, 0.5, -0.33333333333333, 0.0 ]+> , [ 1.0, 0.5, -0.16666666666667, 0.5 ] ] ]+> ; cs = map (map (\[f, p, m, a] -> sinOsc AR f p * m + a)) x+> ; ms = map (map (\[f, w, m, a] -> pulse AR f w * m + a)) y+> ; MCE [c1, c2, c3, _, c4, c5] = fm7 cs ms +> ; g3 = linLin (lfSaw KR 0.1 0) (-1) 1 0 (dbAmp (-12))+> ; g5 = dbAmp (-3) }+> in audition (out 0 (mce [c1 + c3 * g3 + c5 * g5, c2 + c4 + c5 * g5]))
Help/UGen/External/lpcSynth.help.lhs view
@@ -30,7 +30,7 @@ > ; y = mouseY KR 0.25 2.0 Linear 0.2 > ; f = x / constant (lpcAnalysisDuration (lpcHeader lpc)) > ; ptr = lfSaw AR f 1 * 0.5 + 0.5-> ; MCE [cps, rms, err] = lpcVals ar b ptr+> ; MCE [cps, rms, err] = lpcVals AR b ptr > ; nh = floorE (22000 / cps) > ; voc = blip AR (cps * y) nh * (1 - err) > ; s = lpcSynth b (voc + (n * err * 20)) ptr }
+ Help/UGen/FFT/partConv.help.lhs view
@@ -0,0 +1,64 @@+partConv in fft_size ir_bufnum accum_bufnum++Partitioned convolution. Various additional buffers+must be supplied.++Mono impulse response only! If inputting multiple+channels, you'll need independent accumulation+buffers for each channel.++But the charm is: impulse response can be as large+as you like (CPU load increases with IR+size. Various tradeoffs based on fftsize choice,+due to rarer but larger FFTs. This plug-in uses+amortisation to spread processing and avoid+spikes).++Normalisation factors difficult to anticipate;+convolution piles up multiple copies of the input+on top of itself, so can easily overload.++ in - processing target++ fftsize - spectral convolution partition size+ (twice partition size). You must+ ensure that the blocksize divides the+ partition size and there are at least+ two blocks per partition (to allow+ for amortisation)++ irbufnum - Prepared buffer of spectra for each + partition of the impulse response++accumbufnum - Accumulation buffer is a storage+ space for spectral accumulation of+ fft data from partitions; must be+ same saize as irbuffer++preparation; essentially, allocate an impulse+response buffer, then follow some special buffer+preparation steps below to set up the data the+plugin needs. Different options are provided+commented out for loading impulse responses from+soundfiles.++> let { fft_size = 2048+> ; ir_file = "/home/rohan/audio/church.ir.wav"+> ; ir_length = 82756+> ; accum_size = pc_calcAccumSize fft_size ir_length+> ; ir_td_b = 10 {- time domain -}+> ; ir_fd_b = 11 {- frequency domain -}+> ; accum_b = 12 {- internal accumulator -}+> ; target_b = 13 {- source signal -}+> ; target_file = "/home/rohan/audio/text.snd"+> ; c = constant+> ; g = let { i = playBuf 1 (c target_b) 1 0 0 Loop+> ; pc = partConv i (c fft_size) (c ir_fd_b) (c accum_b) }+> in out 0 (pc / constant accum_size) }+> in withSC3 (\fd -> do +> { async fd (b_allocRead ir_td_b ir_file 0 ir_length)+> ; async fd (b_alloc ir_fd_b accum_size 1)+> ; async fd (b_alloc accum_b accum_size 1)+> ; send fd (pc_preparePartConv ir_fd_b ir_td_b fft_size)+> ; async fd (b_allocRead target_b target_file 0 0)+> ; play fd g })
+ Help/UGen/Filter/bBandPass.help.lhs view
@@ -0,0 +1,13 @@+bBandPass i f bw+++ i - input signal to be processed+ f - center frequency+ bw - the bandwidth in octaves between -3 dB frequencies++> import Sound.SC3++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 20 20000 Exponential 0.2 +> ; bw = mouseY KR 0 10 Linear 0.2 }+> in audition (out 0 (bBandPass i f bw))
+ Help/UGen/Filter/bBandStop.help.lhs view
@@ -0,0 +1,13 @@+bBandStop i f bw+++ i - input signal to be processed+ f - center frequency+ bw - the bandwidth in octaves between -3 dB frequencies++> import Sound.SC3++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 20 20000 Exponential 0.2 +> ; bw = mouseY KR 0 10 Linear 0.2 }+> in audition (out 0 (bBandStop i f bw))
+ Help/UGen/Filter/bHiPass.help.lhs view
@@ -0,0 +1,14 @@+bHiPass i f rq++ i - input signal to be processed+ f - cutoff frequency+ rq - the reciprocal of Q, ie. bandwidth / cutoffFreq++12db/oct rolloff - 2nd order resonant high pass filter.++> import Sound.SC3++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 10 20000 Exponential 0.2 +> ; rq = mouseY KR 0 1 Linear 0.2 }+> in audition (out 0 (bHiPass i f rq))
+ Help/UGen/Filter/bHiShelf.help.lhs view
@@ -0,0 +1,22 @@+bHiShelf i f rs db++ i - input signal to be processed+ f - center frequency+ rs - the reciprocal of S. Shell boost/cut slope. When S = 1, the+ shelf slope is as steep as it can be and remain monotonically+ increasing or decreasing gain with frequency. The shelf slope,+ in dB/octave, remains proportional to S for all other values+ for a fixed freq/SampleRate.ir and db.+ db - gain. boost/cut the center frequency in decibels.++> import Sound.SC3++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 2200 18000 Exponential 0.2 +> ; db = mouseY KR 18 (-18) Linear 0.2 }+> in audition (out 0 (bHiShelf i f 1 db))++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 2200 18000 Exponential 0.2 +> ; rs = mouseY KR 0.1 1 Linear 0.2 }+> in audition (out 0 (bHiShelf i f rs 6))
+ Help/UGen/Filter/bLowPass.help.lhs view
@@ -0,0 +1,14 @@+bLowPass i f rq++ i - input signal to be processed+ f - cutoff frequency+ rq - the reciprocal of Q, ie. bandwidth / cutoffFreq++12db/oct rolloff - 2nd order resonant low pass filter.++> import Sound.SC3++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 10 20000 Exponential 0.2 +> ; rq = mouseY KR 0 1 Linear 0.2 }+> in audition (out 0 (bLowPass i f rq))
+ Help/UGen/Filter/bLowShelf.help.lhs view
@@ -0,0 +1,24 @@+bLowShelf i f rs db++ i - input signal to be processed+ f - center frequency+ rs - the reciprocal of S. Shelf boost/cut slope. When S = 1, the+ shelf slope is as steep as it can be and remain monotonically+ increasing or decreasing gain with frequency. The shelf slope,+ in dB/octave, remains proportional to S for all other values+ for a fixed freq/SampleRate.ir and db.+ db - gain. boost/cut the center frequency in decibels.++> import Sound.SC3++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 40 6000 Exponential 0.2+> ; rs = 1+> ; db = mouseY KR 24 (-24) Linear 0.2 }+> in audition (out 0 (bLowShelf i f rs db))++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 20 6000 Exponential 0.2 +> ; rs = mouseY KR 0.1 1 Linear 0.2 +> ; db = 6}+> in audition (out 0 (bLowShelf i f rs db))
+ Help/UGen/Filter/bPeakEQ.help.lhs view
@@ -0,0 +1,20 @@+bPeakEQ i f rq db++ i - input signal to be processed+ f - center frequency+ rq - the reciprocal of Q, ie. bandwidth / cutoffFreq+ db - boost/cut the center frequency (in dBs)++Parametric equalizer.++> import Sound.SC3++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 2200 18000 Exponential 0.2 +> ; db = mouseY KR 12 (-12) Linear 0.2 }+> in audition (out 0 (bPeakEQ i f 0.8 db))++> let { i = soundIn (mce2 0 1)+> ; f = mouseX KR 2200 18000 Exponential 0.2 +> ; rq = mouseY KR 10 0.4 Linear 0.2 }+> in audition (out 0 (bPeakEQ i f rq 6))
Help/UGen/Filter/freeVerb.help.lhs view
@@ -8,17 +8,17 @@ room - room size (0,1) damp - reverb high frequency damping (0,1) -> let { i = impulse ar 1 0-> ; c = lfCub ar 1200 0+> let { i = impulse AR 1 0+> ; c = lfCub AR 1200 0 > ; s = decay i 0.25 * c * 0.1-> ; x = mouseX kr 0 1 Linear 0.1-> ; y = mouseY kr 0 1 Linear 0.1+> ; x = mouseX KR 0 1 Linear 0.1+> ; y = mouseY KR 0 1 Linear 0.1 > ; r = freeVerb s y x 0.5 } > in audition (out 0 r) > let { i = soundIn (mce2 0 1) > ; c = mceChannel-> ; x = mouseX kr 0 1 Linear 0.1-> ; y = mouseY kr 0 1 Linear 0.1+> ; x = mouseX KR 0 1 Linear 0.1+> ; y = mouseY KR 0 1 Linear 0.1 > ; r = freeVerb2 (c 0 i) (c 1 i) y x 0.5 } > in audition (out 0 r)
Help/UGen/Filter/rlpf.help.lhs view
@@ -2,5 +2,10 @@ 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) }+ > 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/IO/localBuf.help.lhs view
@@ -0,0 +1,69 @@+localBuf id nf nc m++ nf - number of frames (default: 1)+ nc - number of channels for multiple channel buffers (default: 1)+ m - the first LocalBuf in a SynthDef may define the maximum buffers+ used (default 8)++Allocate a buffer local to the synthesis graph.++> import Sound.SC3++> do { n <- whiteNoise AR+> ; let { b = localBuf (uid 0) 2048 1 8+> ; 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 { b = mce (map (\i -> localBuf (uid i) 2048 1 8) [0, 1])+> ; 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)) }++not clearing the buffer accesses old data:+slowly overwrite data with noise++> let { b = localBuf (uid 0) 2048 2 8+> ; nf = bufFrames KR b+> ; x = mouseX KR 1 2 Linear 0.2+> ; r = playBuf 2 b x 1 0 Loop * 0.1+> ; wr ph i = bufWr b (linLin ph (-1) 1 0 nf) Loop i }+> in do { n <- clone 2 (whiteNoise AR)+> ; ph <- lfNoise0 AR 530+> ; audition (mrg2 (out 0 r) (wr ph n)) }++bufCombC needs no clearing, because the delay line is filled by the ugen++> do { d <- clone 2 (dust AR 1)+> ; n <- whiteNoise AR+> ; let { z = decay d 0.3 * n+> ; l = xLine KR 0.0001 0.01 20 DoNothing+> ; sr = sampleRate+> ; b = mce (map (\i -> localBuf (uid i) sr 2 8) [0, 1]) }+> 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]+> ; 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]+> ; n = bufFrames KR b+> ; x = floorE (mouseX KR 0 n Linear 0.1)+> ; i = detectIndex b x }+> in audition (out 0 (sinOsc AR (linExp i 0 n 200 700) 0 * 0.1))++> 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]+> ; k = degreeToKey b x 12+> ; f b = let { o = sinOsc AR (midiCPS (b + k + n * 0.04)) 0 * 0.1+> ; t = lfPulse AR (midiCPS (mce [48, 55])) 0.15 0.5+> ; d = rlpf t (midiCPS (sinOsc KR 0.1 0 * 10 + b)) 0.1 * 0.1+> ; m = o + d }+> in combN m 0.31 0.31 2 + m }+> in audition (out 0 ((f 48 + f 72) * 0.25)) }
Help/UGen/IO/localIn.help.lhs view
@@ -10,6 +10,8 @@ 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+ > do { n <- whiteNoise AR > ; let { a0 = decay (impulse AR 0.3 0) 0.1 * n * 0.2 > ; a1 = localIn 2 AR + mce [a0, 0]
Help/UGen/IO/localOut.help.lhs view
@@ -17,6 +17,8 @@ 20Hz), or where sample accurate alignment is required. See the resonator example below. +> import Sound.SC3+ > do { n <- whiteNoise AR > ; let { a0 = decay (impulse AR 0.3 0) 0.1 * n * 0.2 > ; a1 = localIn 2 AR + mce [a0, 0]
Help/UGen/Information/sampleRate.help.lhs view
@@ -11,5 +11,5 @@ actual sample rates from a running server. > withSC3 (\fd -> liftM2 (,)-> (serverSampleRateNominal fd) +> (serverSampleRateNominal fd) > (serverSampleRateActual fd))
Help/UGen/Information/subsampleOffset.help.lhs view
@@ -25,11 +25,10 @@ > ; o = (1 - subsampleOffset) + mouseX KR 0 a Linear 0.1 > ; r = delayC i (d * (1 + x)) (d * (o + x)) > ; g = offsetOut 0 r }-> in withSC3 (\fd -> do { async fd (d_recv (graphdef "s" (graph g)))-> ; t <- utc+> in withSC3 (\fd -> do { async fd (d_recv (synthdef "s" g))+> ; t <- utcr > ; let { t' = t + 0.2 > ; dt = 1 / 44100.0 > ; m n = s_new "s" (-1) AddToTail 1 [("a", n)] }-> in do { send fd (Bundle t' [m 3])-> ; send fd (Bundle (t' + dt) [m 0]) } })-+> in do { send fd (Bundle (UTCr t') [m 3])+> ; send fd (Bundle (UTCr (t' + dt)) [m 0]) } })
+ Help/UGen/MachineListening/loudness.help.lhs view
@@ -0,0 +1,41 @@+loudness chain smask tmask++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++ 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)++A perceptual loudness function which outputs loudness in sones; this+is a variant of an MP3 perceptual model, summing excitation in ERB+bands. It models simple spectral and temporal masking, with equal+loudness contour correction in ERB bands to obtain phons (relative+dB), then a phon to sone transform. The final output is typically in+the range of 0 to 64 sones, though higher values can occur with+specific synthesised stimuli++ given a sinOsc at 1000hz: gain 0.001 => loudness 1 sone+ gain 0.010 => loudness 4 sone+ gain 0.100 => loudness 16 sone+ gain 1.000 => loudness 64 sone++Assume hop of half fftsize.++> let { b = 10+> ; x = mouseX KR 0.001 0.1 Exponential 0.2+> ; i = sinOsc AR 1000 0 * x+> ; f = fft' (constant b) i+> ; l = loudness f 0.25 6+> ; o = sinOsc AR (mce2 900 (l * 300 + 600)) 0 * 0.1 }+> in withSC3 (\fd -> do { async fd (b_alloc b 1024 1)+> ; audition (out 0 o) })++Research note: This UGen is an informal juxtaposition of perceptual+coding, and a Zwicker and Glasberg/Moore/Stone loudness model.
Help/UGen/Noise/lfNoise0.help.lhs view
@@ -13,5 +13,5 @@ Use as frequency control. -> f <- lfNoise0 KR 4 +> f <- lfNoise0 KR 4 > audition (out 0 (sinOsc AR (f * 400 + 450) 0 * 0.1))
Help/UGen/Oscillator/lfPulse.help.lhs view
@@ -9,3 +9,5 @@ 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))++> audition (out 0 (lfPulse AR 220 0 (mouseX KR 0 1 Linear 0.2) * 0.1))
Help/UGen/Oscillator/lfSaw.help.lhs view
@@ -4,7 +4,7 @@ oscillator. Output ranges from -1 to +1. freq - frequency in Hertz-iphase - phase in radians+iphase - initial phase [0,2] > audition (out 0 (lfSaw AR 500 1 * 0.1))
Help/UGen/Oscillator/tChoose.help.lhs view
@@ -4,11 +4,11 @@ array of inputs. tChoose is a composite of tiRand and select. > let x = mouseX kr 1 1000 Exponential 0.1-> in do { t <- dust ar x+> in do { t <- dust AR x > ; f <- liftM midiCPS (tiRand 48 60 t)-> ; o <- let a = mce [ sinOsc ar f 0-> , saw ar (f * 2)-> , pulse ar (f * 0.5) 0.1 ]+> ; o <- let a = mce [ sinOsc AR f 0+> , saw AR (f * 2)+> , pulse AR (f * 0.5) 0.1 ] > in tChoose t a > ; audition (out 0 (o * 0.1)) }
Help/hsc3.help.lhs view
@@ -157,6 +157,8 @@ In the expression below, the frequency input causes two sinOsc unit generators to be created. +> import Sound.SC3+ > let { x = mouseX KR (-1) 1 Linear 0.1 > ; o1 = pulse AR 440 0.1 > ; o2 = sinOsc AR (mce [110, 2300]) 0 * 0.1 }@@ -227,6 +229,8 @@ To write this simple graph in haskell we can use the clone function:++> import Control.Monad > let f = liftM (* mce [0.1, 0.05]) > in do { a <- f (clone 2 (whiteNoise AR))
Sound/SC3/Server.hs view
@@ -1,3 +1,5 @@+-- | Collection of modules for communicating with the SuperCollider+-- synthesis server. module Sound.SC3.Server ( module Sound.SC3.Server.Command , module Sound.SC3.Server.Synthdef , module Sound.SC3.Server.Play
Sound/SC3/Server/Command.hs view
@@ -1,10 +1,12 @@+-- | Constructors for the command set implemented by the SuperCollider+-- synthesis server. module Sound.SC3.Server.Command where import Data.Word import Sound.OpenSoundControl import Sound.SC3.Server.Utilities --- * Instrument definition commands.+-- * Instrument definition commands -- | Install a bytecode instrument definition. (Asynchronous) d_recv :: [Word8] -> OSC@@ -22,7 +24,7 @@ d_free :: [String] -> OSC d_free n = Message "/d_free" (map String n) --- * Node commands.+-- * Node commands -- | Place a node after another. n_after :: [(Int, Int)] -> OSC@@ -69,7 +71,7 @@ n_trace :: [Int] -> OSC n_trace nid = Message "/n_trace" (map Int nid) --- * Synthesis node commands.+-- * Synthesis node commands -- | Get control values. s_get :: Int -> [String] -> OSC@@ -91,11 +93,15 @@ s_new :: String -> Int -> AddAction -> Int -> [(String, Double)] -> OSC s_new n i a t c = Message "/s_new" (String n : Int i : Int (fromEnum a) : Int t : mk_duples String Float c) +-- | Create a new synth.+s_newargs :: String -> Int -> AddAction -> Int -> [(String, [Double])] -> OSC+s_newargs n i a t c = Message "/s_newargs" (String n : Int i : Int (fromEnum a) : Int t : mk_duples_l Int String Float c)+ -- | Auto-reassign synth's ID to a reserved value. s_noid :: [Int] -> OSC s_noid nid = Message "/s_noid" (map Int nid) --- * Group node commands.+-- * Group node commands -- | Free all synths in this group and all its sub-groups. g_deepFree :: [Int] -> OSC@@ -117,13 +123,13 @@ g_tail :: [(Int, Int)] -> OSC g_tail l = Message "/g_tail" (mk_duples Int Int l) --- * Unit Generator commands.+-- * Unit Generator commands -- | Send a command to a unit generator. u_cmd :: Int -> Int -> String -> [Datum] -> OSC u_cmd nid uid cmd arg = Message "/u_cmd" ([Int nid, Int uid, String cmd] ++ arg) --- * Buffer commands.+-- * Buffer commands -- | Allocates zero filled buffer to number of channels and samples. (Asynchronous) b_alloc :: Int -> Int -> Int -> OSC@@ -182,7 +188,7 @@ b_zero :: Int -> OSC b_zero nid = Message "/b_zero" [Int nid] --- * Control bus commands.+-- * Control bus commands -- | Fill ranges of bus values. c_fill :: [(Int, Int, Double)] -> OSC@@ -205,7 +211,7 @@ c_setn l = Message "/c_setn" (concatMap f l) where f (i,d) = Int i : Int (length d) : map Float d --- * Server operation commands.+-- * Server operation commands -- | Remove all bundles from the scheduling queue. clearSched :: OSC@@ -238,7 +244,7 @@ sync :: Int -> OSC sync sid = Message "/sync" [Int sid] --- * Variants to simplify common cases.+-- * Variants to simplify common cases -- | Set single sample value. b_set1 :: Int -> Int -> Double -> OSC
Sound/SC3/Server/NRT.hs view
@@ -1,3 +1,4 @@+-- | Non-realtime score generation. module Sound.SC3.Server.NRT ( encodeNRT , writeNRT , putNRT ) where@@ -9,7 +10,7 @@ -- | Encode and prefix with encoded length. oscWithSize :: OSC -> B.ByteString oscWithSize o = B.append l b- where b = encodeOSCNTP o+ where b = encodeOSC o l = encode_i32 (fromIntegral (B.length b)) -- | Encode a list of OSC bundles as an NRT score.
Sound/SC3/Server/Play.hs view
@@ -1,4 +1,5 @@-module Sound.SC3.Server.Play ( play, stop, reset, async+-- | Basic user interaction with the scsynth server.+module Sound.SC3.Server.Play ( play, stop, reset, send, async , withSC3, audition ) where import Sound.OpenSoundControl
Sound/SC3/Server/Status.hs view
@@ -1,3 +1,4 @@+-- | Request and display status information from the synthesis server. module Sound.SC3.Server.Status ( serverStatus , serverSampleRateNominal , serverSampleRateActual ) where
Sound/SC3/Server/Synthdef.hs view
@@ -1,3 +1,5 @@+-- | The unit-generator graph structure implemented by the+-- SuperCollider synthesis server. module Sound.SC3.Server.Synthdef ( Node(..), FromPort(..), Graph(..) , synth, synthdef ) where
Sound/SC3/Server/Utilities.hs view
@@ -3,6 +3,9 @@ mk_duples :: (a -> c) -> (b -> c) -> [(a, b)] -> [c] mk_duples a b = concatMap (\(x,y) -> [a x, b y]) +mk_duples_l :: (Int -> c) -> (a -> c) -> (b -> c) -> [(a, [b])] -> [c]+mk_duples_l i a b = concatMap (\(x,y) -> a x : i (length y) : map b y)+ mk_triples :: (a -> d) -> (b -> d) -> (c -> d) -> [(a, b, c)] -> [d] mk_triples a b c = concatMap (\(x,y,z) -> [a x, b y, c z])
Sound/SC3/UGen.hs view
@@ -1,3 +1,4 @@+-- | Collection of modules for writing unit-generator graphs. module Sound.SC3.UGen (module Sound.SC3.UGen.Analysis, module Sound.SC3.UGen.Buffer, module Sound.SC3.UGen.Chaos,
Sound/SC3/UGen/Analysis.hs view
@@ -1,3 +1,4 @@+-- | Signal analysis unit generators. module Sound.SC3.UGen.Analysis where import Sound.SC3.UGen.Rate
Sound/SC3/UGen/Buffer.hs view
@@ -1,3 +1,4 @@+-- | Unit generators to query, read and write audio buffers. module Sound.SC3.UGen.Buffer where import Sound.SC3.UGen.Enum@@ -5,7 +6,7 @@ import Sound.SC3.UGen.UGen import Sound.SC3.UGen.Utilities --- * Buffer query UGens.+-- * Buffer query unit generators -- | Buffer channel count. bufChannels :: Rate -> UGen -> UGen@@ -31,7 +32,7 @@ bufSamples :: Rate -> UGen -> UGen bufSamples r buf = mkOsc r "BufSamples" [buf] 1 --- * Buffer filters and delays.+-- * Buffer filters and delays -- | Allpass filter (cubic interpolation). bufAllpassC :: UGen -> UGen -> UGen -> UGen -> UGen@@ -69,7 +70,7 @@ bufDelayN :: UGen -> UGen -> UGen -> UGen bufDelayN buf i dly = mkFilter "BufDelayN" [buf, i, dly] 1 --- * Buffer I\/O.+-- * Buffer I\/O -- | Buffer reader. bufRd :: Int -> Rate -> UGen -> UGen -> Loop -> Interpolation -> UGen@@ -126,6 +127,24 @@ -- | Variable wavetable oscillator. vOsc :: Rate -> UGen -> UGen -> UGen -> UGen vOsc r b f phase = mkOsc r "VOsc" [b, f, phase] 1++-- * Local buffers++-- | Allocate a buffer local to the synth.+localBuf :: UGenId -> UGen -> UGen -> UGen -> UGen+localBuf z nf nc mx = mkOscId z IR "LocalBuf" [nc, nf, mx] 1+-- note that nf & nc are swapped at actual ugen++-- | Set local buffer values.+setBuf :: UGen -> [UGen] -> UGen -> UGen+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 i xs =+ let b = localBuf i (fromIntegral (length xs)) 1 8+ s = setBuf b xs 0+ in mrg2 b s -- Local Variables: -- truncate-lines:t
Sound/SC3/UGen/Chaos.hs view
@@ -1,3 +1,4 @@+-- | Chaotic functions. module Sound.SC3.UGen.Chaos where import Sound.SC3.UGen.Rate
Sound/SC3/UGen/Composite.hs view
@@ -1,8 +1,11 @@+-- | Common unit generator graphs. module Sound.SC3.UGen.Composite where +import Sound.SC3.UGen.Buffer import Sound.SC3.UGen.Filter import Sound.SC3.UGen.Information import Sound.SC3.UGen.IO+import Sound.SC3.UGen.Math import Sound.SC3.UGen.Oscillator import Sound.SC3.UGen.Panner import Sound.SC3.UGen.Rate@@ -19,6 +22,13 @@ freqShift i f p = mix (h * o) where o = sinOsc AR f (mce [p + 0.5 * pi, p]) h = hilbert i++-- | Linear interpolating variant on index.+indexL :: UGen -> UGen -> UGen+indexL b i =+ let x = index b i+ y = index b (i + 1)+ in linLin (frac i) 0 1 x y -- | Collapse multiple channel expansion by summing. mix :: UGen -> UGen
Sound/SC3/UGen/Demand.hs view
@@ -1,3 +1,4 @@+-- | Demand rate unit generators. module Sound.SC3.UGen.Demand where import Sound.SC3.UGen.Enum
Sound/SC3/UGen/Demand/Base.hs view
@@ -53,6 +53,10 @@ 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
Sound/SC3/UGen/Demand/Monadic.hs view
@@ -54,6 +54,10 @@ dser :: (UId m) => UGen -> UGen -> m UGen dser = liftU2 D.dser +-- | Demand input replication+dstutter :: (UId m) => UGen -> UGen -> m UGen+dstutter = liftU2 D.dstutter+ -- | Demand rate input switching. dswitch1 :: (UId m) => UGen -> UGen -> m UGen dswitch1 = liftU2 D.dswitch1
− Sound/SC3/UGen/Demand/Unsafe.hs
@@ -1,62 +0,0 @@-module Sound.SC3.UGen.Demand.Unsafe where--import Sound.SC3.UGen.UGen-import Sound.SC3.UGen.UGen.Lift-import qualified Sound.SC3.UGen.Demand.Monadic as D-import Sound.SC3.UGen.Enum---- | Buffer demand ugen.-dbufrd :: UGen -> UGen -> Loop -> UGen-dbufrd = liftP3 D.dbufrd---- | Buffer write on demand unit generator.-dbufwr :: UGen -> UGen -> UGen -> Loop -> UGen-dbufwr = liftP4 D.dbufwr---- | Demand rate white noise.-dwhite :: UGen -> UGen -> UGen -> UGen-dwhite = liftP3 D.dwhite---- | Demand rate integer white noise.-diwhite :: UGen -> UGen -> UGen -> UGen-diwhite = liftP3 D.diwhite---- | Demand rate brown noise.-dbrown :: UGen -> UGen -> UGen -> UGen -> UGen-dbrown = liftP4 D.dbrown---- | Demand rate integer brown noise.-dibrown :: UGen -> UGen -> UGen -> UGen -> UGen-dibrown = liftP4 D.dibrown---- | Demand rate random selection.-drand :: UGen -> UGen -> UGen-drand = liftP2 D.drand---- | Demand rate random selection with no immediate repetition.-dxrand :: UGen -> UGen -> UGen-dxrand = liftP2 D.dxrand---- | Demand rate arithmetic series.-dseries :: UGen -> UGen -> UGen -> UGen-dseries = liftP3 D.dseries---- | Demand rate geometric series.-dgeom :: UGen -> UGen -> UGen -> UGen-dgeom = liftP3 D.dgeom---- | Demand rate sequence generator.-dseq :: UGen -> UGen -> UGen-dseq = liftP2 D.dseq---- | Demand rate series generator.-dser :: UGen -> UGen -> UGen-dser = liftP2 D.dser---- | Demand rate input switching.-dswitch1 :: UGen -> UGen -> UGen-dswitch1 = liftP2 D.dswitch1---- | Demand rate input switching.-dswitch :: UGen -> UGen -> UGen-dswitch = liftP2 D.dswitch
Sound/SC3/UGen/Enum.hs view
@@ -1,3 +1,4 @@+-- | Data types for enumerated and non signal unit generator inputs. module Sound.SC3.UGen.Enum where import Sound.SC3.UGen.UGen
Sound/SC3/UGen/Envelope.hs view
@@ -1,3 +1,4 @@+-- | Envelope generators. module Sound.SC3.UGen.Envelope where import Sound.SC3.UGen.Enum
Sound/SC3/UGen/Envelope/Construct.hs view
@@ -1,3 +1,4 @@+-- | Functions to generate break point data for standard envelope types. module Sound.SC3.UGen.Envelope.Construct where import Sound.SC3.UGen.UGen
Sound/SC3/UGen/External.hs view
@@ -1,3 +1,5 @@+-- | Bindings to unit generators not distributed with SuperCollider+-- proper. module Sound.SC3.UGen.External where import Sound.SC3.UGen.Rate@@ -18,6 +20,10 @@ -- | Convert frequency value to value appropriate for AY tone inputs. ayFreqToTone :: Fractional a => a -> a ayFreqToTone f = 110300 / (f - 0.5)++-- | Phase modulation oscillator matrix.+fm7 :: [[UGen]] -> [[UGen]] -> UGen+fm7 ctl m0d = mkOsc AR "FM7" (concat ctl ++ concat m0d) 6 -- | Triangular waveguide mesh of a drum-like membrane. membraneCircle :: UGen -> UGen -> UGen -> UGen
Sound/SC3/UGen/External/ATS.hs view
@@ -1,3 +1,4 @@+-- | Reader for ATS analyis data files. module Sound.SC3.UGen.External.ATS ( ATS(..) , ATSHeader(..) , ATSFrame
Sound/SC3/UGen/External/LPC.hs view
@@ -1,3 +1,4 @@+-- | Reader for LPC analysis data files. module Sound.SC3.UGen.External.LPC ( LPC(..) , LPCHeader(..) , LPCFrame
Sound/SC3/UGen/FFT.hs view
@@ -1,5 +1,8 @@+-- | Frequency domain unit generators. module Sound.SC3.UGen.FFT where +import Sound.OpenSoundControl (OSC)+import Sound.SC3.Server.Command (b_gen) import Sound.SC3.UGen.Rate import Sound.SC3.UGen.UGen @@ -135,6 +138,24 @@ unpackFFT :: UGen -> UGen -> UGen -> UGen -> UGen -> [UGen] unpackFFT c nf from to w = map (\i -> unpack1FFT c nf i w) [from .. to]++-- * Partitioned convolution++-- | Calculate size of accumulation buffer given FFT and IR sizes.+pc_calcAccumSize :: Int -> Int -> Int+pc_calcAccumSize fft_size ir_length =+ let partition_size = fft_size `div` 2+ num_partitions = (ir_length `div` partition_size) + 1+ in fft_size * num_partitions++-- | Generate accumulation buffer given time-domain IR buffer and FFT size.+pc_preparePartConv :: Int -> Int -> Int -> OSC+pc_preparePartConv b irb fft_size =+ b_gen b "PreparePartConv" (map fromIntegral [irb, fft_size])++-- | Partitioned convolution.+partConv :: UGen -> UGen -> UGen -> UGen -> UGen+partConv i sz ib ab = mkOsc AR "PartConv" [i,sz,ib,ab] 1 -- Local Variables: -- truncate-lines:t
− Sound/SC3/UGen/FFT/Unsafe.hs
@@ -1,17 +0,0 @@-module Sound.SC3.UGen.FFT.Unsafe where--import Sound.SC3.UGen.UGen-import Sound.SC3.UGen.UGen.Lift-import qualified Sound.SC3.UGen.FFT.Monadic as F---- | Randomize order of bins.-pv_BinScramble :: UGen -> UGen -> UGen -> UGen -> UGen-pv_BinScramble = liftP4 F.pv_BinScramble---- | Randomly clear bins.-pv_RandComb :: UGen -> UGen -> UGen -> UGen-pv_RandComb = liftP3 F.pv_RandComb---- | Cross fade, copying bins in random order.-pv_RandWipe :: UGen -> UGen -> UGen -> UGen -> UGen-pv_RandWipe = liftP4 F.pv_RandWipe
Sound/SC3/UGen/Filter.hs view
@@ -1,3 +1,4 @@+-- | Time-domain filter unit generators. module Sound.SC3.UGen.Filter where import Data.List@@ -327,3 +328,28 @@ wrapIndex :: UGen -> UGen -> UGen wrapIndex b i = mkFilter "WrapIndex" [b, i] 1 +-- * BEQ filters++bLowPass :: UGen -> UGen -> UGen -> UGen+bLowPass i f rq = mkFilter "BLowPass" [i, f, rq] 1++bHiPass :: UGen -> UGen -> UGen -> UGen+bHiPass i f rq = mkFilter "BHiPass" [i, f, rq] 1++bAllPass :: UGen -> UGen -> UGen -> UGen+bAllPass i f rq = mkFilter "BAllPass" [i, f, rq] 1++bBandPass :: UGen -> UGen -> UGen -> UGen+bBandPass i f bw = mkFilter "BBandPass" [i, f, bw] 1++bBandStop :: UGen -> UGen -> UGen -> UGen+bBandStop i f bw = mkFilter "BBandStop" [i, f, bw] 1++bPeakEQ :: UGen -> UGen -> UGen -> UGen -> UGen+bPeakEQ i f rq db = mkFilter "BPeakEQ" [i, f, rq, db] 1++bLowShelf :: UGen -> UGen -> UGen -> UGen -> UGen+bLowShelf i f rs db = mkFilter "BLowShelf" [i, f, rs, db] 1++bHiShelf :: UGen -> UGen -> UGen -> UGen -> UGen+bHiShelf i f rs db = mkFilter "BHiShelf" [i, f, rs, db] 1
Sound/SC3/UGen/Granular.hs view
@@ -1,3 +1,4 @@+-- | Granular synthesis unit generators. module Sound.SC3.UGen.Granular where import Sound.SC3.UGen.Rate
Sound/SC3/UGen/IO.hs view
@@ -1,3 +1,4 @@+-- | Audio bus, control bus and input device unit generators. module Sound.SC3.UGen.IO where import Sound.SC3.UGen.Enum
Sound/SC3/UGen/Information.hs view
@@ -1,3 +1,5 @@+-- | Unit generators to access information related to the synthesis+-- environment. module Sound.SC3.UGen.Information where import Sound.SC3.UGen.UGen
Sound/SC3/UGen/MachineListening.hs view
@@ -1,3 +1,4 @@+-- | Machine listening & feature extraction analysis unit generators. module Sound.SC3.UGen.MachineListening where import Data.List
Sound/SC3/UGen/Math.hs view
@@ -1,3 +1,4 @@+-- | Non-standard mathematical classes and class instances. module Sound.SC3.UGen.Math where import Sound.SC3.UGen.Operator
− Sound/SC3/UGen/Noise/Unsafe.hs
@@ -1,110 +0,0 @@-module Sound.SC3.UGen.Noise.Unsafe where--import Sound.SC3.UGen.Rate-import Sound.SC3.UGen.UGen-import Sound.SC3.UGen.UGen.Lift-import qualified Sound.SC3.UGen.Noise.Monadic as N---- | Brown noise.-brownNoise :: Rate -> UGen-brownNoise = liftP N.brownNoise---- | Clip noise.-clipNoise :: Rate -> UGen-clipNoise = liftP N.clipNoise---- | Randomly pass or block triggers.-coinGate :: UGen -> UGen -> UGen-coinGate = liftP2 N.coinGate---- | Random impulses in (-1, 1).-dust2 :: Rate -> UGen -> UGen-dust2 = liftP2 N.dust2---- | Random impulse in (0,1).-dust :: Rate -> UGen -> UGen-dust = liftP2 N.dust---- | Random value in exponential distribution.-expRand :: UGen -> UGen -> UGen-expRand = liftP2 N.expRand---- | Gray noise.-grayNoise :: Rate -> UGen-grayNoise = liftP N.grayNoise---- | Random integer in uniform distribution.-iRand :: UGen -> UGen -> UGen-iRand = liftP2 N.iRand---- | Clip noise.-lfClipNoise :: Rate -> UGen -> UGen-lfClipNoise = liftP2 N.lfClipNoise---- | Dynamic clip noise.-lfdClipNoise :: Rate -> UGen -> UGen-lfdClipNoise = liftP2 N.lfdClipNoise---- | Dynamic step noise.-lfdNoise0 :: Rate -> UGen -> UGen-lfdNoise0 = liftP2 N.lfdNoise0---- | Dynamic ramp noise.-lfdNoise1 :: Rate -> UGen -> UGen-lfdNoise1 = liftP2 N.lfdNoise1---- | Dynamic quadratic noise-lfdNoise2 :: Rate -> UGen -> UGen-lfdNoise2 = liftP2 N.lfdNoise2---- | Dynamic cubic noise-lfdNoise3 :: Rate -> UGen -> UGen-lfdNoise3 = liftP2 N.lfdNoise3---- | Step noise.-lfNoise0 :: Rate -> UGen -> UGen-lfNoise0 = liftP2 N.lfNoise0---- | Ramp noise.-lfNoise1 :: Rate -> UGen -> UGen-lfNoise1 = liftP2 N.lfNoise1---- | Quadratic noise.-lfNoise2 :: Rate -> UGen -> UGen-lfNoise2 = liftP2 N.lfNoise2---- | Random value in skewed linear distribution.-linRand :: UGen -> UGen -> UGen -> UGen-linRand = liftP3 N.linRand---- | Random value in sum of n linear distribution.-nRand :: UGen -> UGen -> UGen -> UGen-nRand = liftP3 N.nRand---- | Pink noise.-pinkNoise :: Rate -> UGen-pinkNoise = liftP N.pinkNoise---- | Random value in uniform distribution.-rand :: UGen -> UGen -> UGen-rand = liftP2 N.rand---- | Random value in exponential distribution on trigger.-tExpRand :: UGen -> UGen -> UGen -> UGen-tExpRand = liftP3 N.tExpRand---- | Random integer in uniform distribution on trigger.-tiRand :: UGen -> UGen -> UGen -> UGen-tiRand = liftP3 N.tiRand---- | Random value in uniform distribution on trigger.-tRand :: UGen -> UGen -> UGen -> UGen-tRand = liftP3 N.tRand---- | Triggered windex.-twindex :: UGen -> UGen -> UGen -> UGen-twindex = liftP3 N.twindex---- | White noise.-whiteNoise :: Rate -> UGen-whiteNoise = liftP N.whiteNoise
Sound/SC3/UGen/Operator.hs view
@@ -1,3 +1,4 @@+-- | Enumerations of the unary and binary math unit generators. module Sound.SC3.UGen.Operator (Unary(..), unaryName, Binary(..), binaryName) where
Sound/SC3/UGen/Oscillator.hs view
@@ -1,3 +1,4 @@+-- | Oscillators. module Sound.SC3.UGen.Oscillator where import Data.List
Sound/SC3/UGen/Panner.hs view
@@ -1,3 +1,4 @@+-- | Sound field location and analysis unit generators. module Sound.SC3.UGen.Panner where import Sound.SC3.UGen.UGen
Sound/SC3/UGen/Rate.hs view
@@ -1,3 +1,4 @@+-- | Operating rate definitions and utilities. module Sound.SC3.UGen.Rate ( Rate(..) , rateId , ar, kr, ir, dr ) where@@ -9,7 +10,8 @@ instance Ord Rate where compare a b = compare (rate_ord a) (rate_ord b) --- | Rate constructors.+-- | Rate constructors (lower case aliases of upper case data+-- constructors). ar, kr, ir, dr :: Rate ar = AR kr = KR
Sound/SC3/UGen/Record/Pitch.hs view
@@ -1,3 +1,4 @@+-- | A record based interface to the pitch unit generator. module Sound.SC3.UGen.Record.Pitch ( Args(..), defaults,
Sound/SC3/UGen/UGen.hs view
@@ -36,7 +36,7 @@ newtype UGenId = UGenId Int deriving (Eq, Show) --- * Unit generator node constructors.+-- * Unit generator node constructors -- | Unit generator identifier constructor. uid :: Int -> UGenId@@ -63,7 +63,7 @@ proxy :: UGen -> Int -> UGen proxy = Proxy --- * Unit generator node predicates.+-- * Unit generator node predicates -- | Constant node predicate. isConstant :: UGen -> Bool@@ -95,7 +95,7 @@ isMRG (MRG _ _) = True isMRG _ = False --- * Multiple channel expansion.+-- * Multiple channel expansion -- | Multiple channel expansion for two inputs. mce2 :: UGen -> UGen -> UGen@@ -157,7 +157,7 @@ mceTranspose :: UGen -> UGen mceTranspose u = mce (map mce (transpose (map mceChannels (mceChannels u)))) --- * Multiple root graphs.+-- * Multiple root graphs -- | Multiple root graph constructor. mrg :: [UGen] -> UGen@@ -165,7 +165,7 @@ mrg [x] = x mrg (x:xs) = MRG x (mrg xs) --- * Unit generator function builders.+-- * Unit generator function builders -- | Apply proxy transformation if required. proxify :: UGen -> UGen@@ -200,7 +200,7 @@ -- 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) + then error ("illegal input: " ++ show u) else u -- | Construct proxied and multiple channel expanded UGen.
− Sound/SC3/UGen/Unsafe.hs
@@ -1,7 +0,0 @@-module Sound.SC3.UGen.Unsafe (module Sound.SC3.UGen.Demand.Unsafe,- module Sound.SC3.UGen.FFT.Unsafe,- module Sound.SC3.UGen.Noise.Unsafe) where--import Sound.SC3.UGen.Demand.Unsafe-import Sound.SC3.UGen.FFT.Unsafe-import Sound.SC3.UGen.Noise.Unsafe
hsc3.cabal view
@@ -1,5 +1,5 @@ Name: hsc3-Version: 0.4+Version: 0.5 Synopsis: Haskell SuperCollider Description: hsc3 provides Sound.SC3, a haskell module that facilitates using haskell as a client to the @@ -11,7 +11,7 @@ Maintainer: rd@slavepianos.org Stability: Experimental Homepage: http://slavepianos.org/rd/f/207949/-Tested-With: GHC==6.8.2+Tested-With: GHC==6.10.1 Build-Type: Simple Cabal-Version: >= 1.2 @@ -24,6 +24,7 @@ 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@@ -35,6 +36,7 @@ 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@@ -42,6 +44,7 @@ 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@@ -54,6 +57,7 @@ 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@@ -68,6 +72,7 @@ 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@@ -92,10 +97,13 @@ 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/trmlo.lhs Help/Graphs/tr-out.lhs@@ -152,13 +160,16 @@ 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@@ -219,6 +230,7 @@ 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@@ -240,6 +252,7 @@ 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@@ -255,6 +268,7 @@ 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@@ -274,6 +288,13 @@ 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@@ -349,6 +370,7 @@ 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@@ -360,6 +382,7 @@ 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@@ -447,7 +470,7 @@ Help/UGen/Trigger/trig.help.lhs Library- Build-Depends: base, binary, bytestring, containers, hosc == 0.4,+ Build-Depends: base, binary, bytestring, containers, hosc == 0.5, network, process, random GHC-Options: -Wall -fwarn-tabs Exposed-modules: Sound.SC3@@ -468,7 +491,6 @@ Sound.SC3.UGen.Demand Sound.SC3.UGen.Demand.Base Sound.SC3.UGen.Demand.Monadic- Sound.SC3.UGen.Demand.Unsafe Sound.SC3.UGen.Enum Sound.SC3.UGen.Envelope Sound.SC3.UGen.Envelope.Construct@@ -478,7 +500,6 @@ Sound.SC3.UGen.FFT Sound.SC3.UGen.FFT.Base Sound.SC3.UGen.FFT.Monadic- Sound.SC3.UGen.FFT.Unsafe Sound.SC3.UGen.Filter Sound.SC3.UGen.Granular Sound.SC3.UGen.IO@@ -488,15 +509,13 @@ Sound.SC3.UGen.Monadic Sound.SC3.UGen.Noise.Base Sound.SC3.UGen.Noise.Monadic- Sound.SC3.UGen.Noise.Unsafe Sound.SC3.UGen.Operator Sound.SC3.UGen.Oscillator Sound.SC3.UGen.Panner Sound.SC3.UGen.Rate Sound.SC3.UGen.Record.Pitch Sound.SC3.UGen.UGen+ Sound.SC3.UGen.UGen.Lift Sound.SC3.UGen.UId- Sound.SC3.UGen.Unsafe Other-modules: Sound.SC3.Server.Utilities Sound.SC3.UGen.Utilities- Sound.SC3.UGen.UGen.Lift