packages feed

hsc3-graphs 0.14.1 → 0.15

raw patch · 676 files changed

+8632/−3458 lines, 676 filesdep +binarydep +hashabledep +hsc3-utilsdep −cmathdep ~basedep ~hlsdep ~hmtnew-component:exe:hsc3-1-4Twnew-component:exe:hsc3-1-4VLnew-component:exe:hsc3-1-9new-component:exe:hsc3-adc-16-6-2new-component:exe:hsc3-alien-froggies-recnew-component:exe:hsc3-analog-bubbles-mousenew-component:exe:hsc3-analogue-dazenew-component:exe:hsc3-babbling-brooknew-component:exe:hsc3-berlin-1977new-component:exe:hsc3-birdiesnew-component:exe:hsc3-birdsnew-component:exe:hsc3-birds-am-fmnew-component:exe:hsc3-blips-001new-component:exe:hsc3-blips-001-hpnew-component:exe:hsc3-blips-001-unew-component:exe:hsc3-bouncing-objectsnew-component:exe:hsc3-distort-inputnew-component:exe:hsc3-drone-plus-rhythmnew-component:exe:hsc3-f0-454598285861617665new-component:exe:hsc3-f0-456384156159574016new-component:exe:hsc3-f0-tw0026new-component:exe:hsc3-f0-tw0041new-component:exe:hsc3-f0-tw0120new-component:exe:hsc3-f0-tw0121new-component:exe:hsc3-f0-tw0125new-component:exe:hsc3-f0-tw0134new-component:exe:hsc3-f0-tw0220new-component:exe:hsc3-f0-tw0224new-component:exe:hsc3-f0-tw0225new-component:exe:hsc3-filter-inputnew-component:exe:hsc3-hard-sync-sawtooth-with-lfonew-component:exe:hsc3-harmonic-tumblingnew-component:exe:hsc3-impulse-sequencernew-component:exe:hsc3-jr-100515new-component:exe:hsc3-landon-rosenew-component:exe:hsc3-lpnew-component:exe:hsc3-lz-bfnew-component:exe:hsc3-metal-platenew-component:exe:hsc3-modal-space-bufnew-component:exe:hsc3-mousenew-component:exe:hsc3-mridangam-drnew-component:exe:hsc3-narrow-band-filtered-crackle-noisenew-component:exe:hsc3-noise-modulated-sawtoothsnew-component:exe:hsc3-nv-ml-2014-06-03new-component:exe:hsc3-nv-tw-2013-01-11new-component:exe:hsc3-nv-tw-2013-12-04new-component:exe:hsc3-nv-tw-2014-02-21new-component:exe:hsc3-nv-tw-2014-06-03new-component:exe:hsc3-phase-modulationnew-component:exe:hsc3-pkt-00new-component:exe:hsc3-pkt-07new-component:exe:hsc3-pond-life-hanew-component:exe:hsc3-reso-pulsenew-component:exe:hsc3-resonators-harmonic-seriesnew-component:exe:hsc3-reverberated-noise-burstsnew-component:exe:hsc3-ring-modulate-inputnew-component:exe:hsc3-seqr-nnew-component:exe:hsc3-swept-resonant-noisenew-component:exe:hsc3-tapping-toolsnew-component:exe:hsc3-three-cpswnew-component:exe:hsc3-tw-463992770596577280new-component:exe:hsc3-tw-98315246548172800new-component:exe:hsc3-zizlenew-component:exe:hsc3-zizle-hp

Dependencies added: binary, hashable, hsc3-utils, she

Dependencies removed: cmath

Dependency ranges changed: base, hls, hmt, hosc, hps, hsc3, hsc3-cairo, hsc3-lang, hsc3-sf, hsc3-unsafe, hsharc, sc3-rdu

This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.

Files

Makefile view
@@ -1,7 +1,7 @@ mk-html: 	mkdir -p html 	cp -f css/emacs.css html/hscolour.css-	(cd gr ; sh ../sh/mk-html.sh)+	sh sh/mk-html.sh  mk-pdf: 	mkdir -p pdf@@ -29,6 +29,12 @@ 	rm -f svg/*.svg 	rm -R Sound 	rm -f hs/hsc3-graphs.hs++push-sp:+	darcs push -a rd@slavepianos.org:sw/hsc3-graphs++pull-sp:+	darcs pull -a http://rd.slavepianos.org/sw/hsc3-graphs  remote-update: 	ssh rd@slavepianos.org "(cd sw/hsc3-graphs; make all)"
README view
@@ -8,14 +8,14 @@  Graphs credits are on the first line of each file, and are courtesy: -- James McCartney ([jmcc][sc3], 70)-- Rohan Drape ([rd][rd], 61)-- Fredrik Olofsson ([f0][f0], 19)+- James McCartney ([jmcc][sc3], 92)+- Rohan Drape ([rd][rd], 70)+- Fredrik Olofsson ([f0][f0], 25) - Julian Rohrhuber ([jrhb][jrhb], 7)-- Jonatan Liljedahl ([jl][jl], 5)+- Jonatan Liljedahl ([jl][jl], 6)+- Nathaniel Virgo ([nv][nv], 4) - Alberto De Campo ([adc][adc], 3) - Nick Collins ([nc][nc], 3)-- Nathaniel Virgo ([nv][nv], 3) - Alex McLean ([am][am], 1) - Andrea Valle ([av][av], 1) - Jacob Joaquin ([jj][jj], 1)@@ -24,6 +24,7 @@ - Lance J. Putnam ([ljp][ljp], 1) - Ryan Brown ([rb][rb], 1) - Sam Pluta ([sp][sp], 1)+- Till Bovermann ([tb][tb], 1) - Thor Magnusson ([tm][tm], 1)  In most cases the `sclang` variants have been re-written prior to@@ -34,11 +35,16 @@  There is a `Makefile` at `gr`, type `make dep; make all`. +Requires:++- cabal install hscolour+- cabal install she+ [hs]: http://haskell.org/ [sc3]: http://audiosynth.com/ [hsc3]: http://rd.slavepianos.org/?t=hsc3 [gr]: http://rd.slavepianos.org/?t=hsc3-graphs-[gr-ix]: ?t=hsc3-graphs&m=md/ix.md+[gr-ix]: ?t=hsc3-graphs&e=md/ix.md  [adc]: http://medienhaus.udk-berlin.de/pages/Dr._Alberto_De_Campo [am]: http://yaxu.org/@@ -54,9 +60,10 @@ [nv]: http://nathanielvirgo.com/ [rb]: http://www.wabdo.com/ [sp]: http://www.sampluta.com/+[tb]: http://www.lfsaw.de/ [tm]: http://www.sussex.ac.uk/Users/thm21/ -© [rohan drape][rd] and others, 2006-2013, [gpl]+© [rohan drape][rd] and others, 2006-2014, [gpl]  [rd]: http://rd.slavepianos.org/ [gpl]: http://gnu.org/copyleft/
+ Sound/SC3/Graph/ADC_adc_16_6_2.hs view
@@ -0,0 +1,51 @@+-- adc-16-6-2 (adc) #p.489+{-# OPTIONS_GHC -F -pgmF hsc3-uparam #-}+module Sound.SC3.Graph.ADC_adc_16_6_2 where++import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.List as L {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}++constQ :: Synthdef+constQ =+    let uparam = {bus=0,bufnum=0,amp=0.1,pan=0,centerPos=0.5,sustain=0.1,rate=1,freq=400,rq=0.3}+        ringtime = min ((2.4 / (freq * rq)) * 0.66) 0.5 -- estimated+        ampcomp = (rq ** (-1)) * ((400 / freq) ** 0.5)+        envSig = let env = envelope [0,amp,0] (map (* sustain) [0.5,0.5]) [EnvWelch]+                 in envGen AR 1 1 0 1 DoNothing env+        cutoffEnv = let env = envelope [1,1,0] [sustain + ringtime,0.01] [EnvLin]+                    in envGen KR 1 1 0 1 RemoveSynth env+        startPos = (centerPos - (sustain * rate * 0.5)) * bufSampleRate IR bufnum+        grain = playBuf 1 AR bufnum rate 0 startPos Loop DoNothing * envSig+        filtered = bpf grain freq rq * ampcomp+    in synthdef "constQ" (offsetOut bus (pan2 filtered pan cutoffEnv))++p :: Double -> P.Param+p b =+    [("bufnum",repeat b)+    ,("sustain",P.white 'α' 0.02 0.04)+    ,("amp",P.white 'β' 0.05 0.25)+    ,("centerPos",cycle [0,0.01 .. 2])+    ,("dur",L.brown 'γ' 0.01 0.09 5)+    ,("rate",P.white 'δ' 0.95 1.05)+    ,("freq",map midiCPS (L.brown 'ε' 64 120 8))+    ,("pan",P.white 'ζ' (-1) 1)+    ,("rq",P.white 'η' 0.03 0.15)]++p' :: Double -> P.Param+p' b =+    [("bufnum",repeat b)+    ,("sustain",P.white 'θ' 0.02 0.04)+    ,("amp",repeat 0.3)+    ,("centerPos",cycle [0,0.01 .. 2])+    ,("dur",P.white 'ι' 0.01 0.03)+    ,("rate",P.white 'κ' 0.95 1.05)+    ,("freq",map midiCPS (L.brown 'λ' 80 82 8))+    ,("pan",P.white 'μ' (-1) 1)+    ,("rq",repeat 0.05)]++main :: IO ()+main = withSC3$do+  let fn = "/usr/local/share/SuperCollider/sounds/a11wlk01-44_1.aiff"+  _ <- async (b_allocRead 0 fn 0 0)+  play (P.sbind [(constQ,p 0),(constQ,p' 0)])
Sound/SC3/Graph/ADC_bit_reduction.hs view
@@ -1,7 +1,7 @@ -- bit reduction (adc) module Sound.SC3.Graph.ADC_bit_reduction where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  sample_rate_decrease :: UGen sample_rate_decrease =
Sound/SC3/Graph/ADC_kabelscahden.hs view
@@ -1,7 +1,7 @@ -- march 2003 (adc) / (jrhb) module Sound.SC3.Graph.ADC_kabelscahden where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  kabelScahden :: UGen kabelScahden =
+ Sound/SC3/Graph/ADC_waveset.hs view
@@ -0,0 +1,163 @@+-- A simple waveset synthesiser (adc)+{-# OPTIONS_GHC -F -pgmF hsc3-uparam #-}+module Sound.SC3.Graph.ADC_waveset where++import qualified Data.Array as A {- array -}+import Data.List {- base -}+import qualified Sound.File.NeXT as F {- hsc3-sf -}+import Sound.OSC {- hosc -}+import Sound.SC3 {- hsc3 -}+import System.Environment {- base -}+import System.Random {- random -}++-- * 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 0 [-1,1,-1,3] == [0.5,2.25]+fzc :: (Ord a, Fractional a) => a -> [a] -> [a]+fzc n =+    let rec k s = case s of+                    x:y:s' -> if is_zc x y+                              then (k + locate_fzc x y) : rec (k + 2.0) s'+                              else rec (k + 1.0) (y : s')+                    _ -> []+    in rec n++-- | Remove zero crossings so that no waveset has length less than m.+prune :: (Ord a, Num a) => a -> [a] -> [a]+prune m =+    let rec n zc =+            case zc of+              [] -> [n]+              x:zc' -> if (x - n) < m+                       then rec n zc'+                       else x : rec x zc'+    in rec 0++-- | Zero crossings to waveset bounds.+--+-- zc_to_ws [1,7,15] == [(1,7),(7,15)]+zc_to_ws :: [a] -> [(a,a)]+zc_to_ws =+    let rec zc =+            case zc of+              x:y:zc' -> (x,y) : rec (y : zc')+              _ -> []+    in rec++-- * Waveset instrument++-- | A trivial waveset instrument with unit envelope.+waveset :: UGen+waveset =+    let uparam = {bus=0,bufnum=0,start=0,end=0,rate=1,sustain=1,amp=0.2}+        rs = bufRateScale KR bufnum * rate+        ph = phasor AR 0 rs 0 (end - start) 0 + start -- see adc for rationale+        e_data = Envelope [amp, amp, 0] [sustain, 0] [EnvLin] Nothing Nothing+        e_ugen = envGen AR 1 1 0 1 RemoveSynth e_data+    in offsetOut bus (bufRdL 1 AR bufnum ph Loop * e_ugen)++-- * Waveset synthesizer++-- | Construct s_new message for synthesiser.+mk_msg :: Double -> Double -> Double -> Double -> Message+mk_msg b sf ef d =+    let a = [("bufnum", b), ("start", sf), ("end", ef), ("sustain", d)]+    in s_new "waveset" (-1) AddToTail 1 a++-- | 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)] -> [Bundle]+mk_score sr repeats w =+    let durations = zipWith (\(s, e) r -> (e - s) * r / sr) w repeats+        start_times = scanl (+) 0 durations+        mk_elem (s,e) t d = Bundle t [mk_msg 10 s e d]+    in zipWith3 mk_elem w start_times durations++-- | n randomly chosen elements of w.+rchoose :: Int -> [a] -> [a]+rchoose n w =+    let (l, r) = (1, length w)+        a = A.listArray (l,r) w+    in take n (map (a A.!) (randomRs (l,r) (mkStdGen 1)))++-- | Load waveset instrument, allocate sound file buffer, do waveset+--   analysis, generate & play scores.+--+-- > withSC3 (run_waveset 64 "/home/rohan/data/audio/pf-c5.snd")+run_waveset :: Transport m => Double -> String -> m ()+run_waveset pr fn = do+  _ <- async (d_recv (synthdef "waveset" waveset))+  _ <- async (b_allocRead 10 fn 0 0)+  (hdr, cs) <- liftIO (F.read fn)+  let nc = F.channelCount hdr+      nf = F.frameCount hdr+      sr = fromIntegral (F.sampleRate hdr)+      b = cs !! 0+      w = zc_to_ws (prune pr (fzc 0 b))+      pl s = play (NRT s) >> wait 1+      post = liftIO . putStrLn+  post ("#f: " ++ show (nc, nf, sr))+  post ("#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)) (rchoose 512 w))+  return ()++main :: IO ()+main = do+  a <- getArgs+  case a of+    [fn] -> withSC3 (run_waveset 64 fn)+    _ -> error "audio file?"++{-+-- * Score model++-- | Interval to schedule in advance.+latency :: Double+latency = 0.15++-- | Add t to timestamp.+offset :: Time -> Bundle -> Bundle+offset t (Bundle t0 m) = Bundle (t + t0) m++-- | Play non-empty set of osc bundles.+play_set :: Transport m => [Bundle] -> m ()+play_set [] = error "play_set:empty"+play_set (x:xs) = do+  let (Bundle t _) = x+  pauseThreadUntil (t - latency)+  mapM_ sendBundle (x:xs)++-- | Play grouped score.+play_sets :: Transport m => [[Bundle]] -> m ()+play_sets [] = return ()+play_sets s = do+  t <- time+  mapM_ (play_set . map (offset t)) 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 m => Int -> [Bundle] -> m ()+play_score n s = play_sets (form_sets n s)+-}
+ Sound/SC3/Graph/AF_birds_am_fm.hs view
@@ -0,0 +1,152 @@+-- birds-am-fm (af)+-- http://www.obiwannabe.co.uk/tutorials/html/tutorial_birds.html+-- perhaps some mis-translations...+module Sound.SC3.Graph.AF_birds_am_fm where++-- import Debug.Trace {- base -}+import System.Random {- random -}++import Sound.SC3 hiding (sweep) {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}+import qualified Sound.SC3.Lang.Random.Gen as R++-- > audition (out 0 (pd_noise 'a' * 0.1))+pd_noise :: ID a => a -> UGen+pd_noise e = whiteNoise e AR++-- > audition (out 0 (pd_lop (pd_noise 'a') 500 * 0.1))+pd_lop :: UGen -> UGen -> UGen+pd_lop = lpf -- actually lop is one-pole, lpf is two pole...++-- > audition (out 0 (pd_osc 440 * 0.1))+pd_osc :: UGen -> UGen+pd_osc f = sinOsc AR f pi++-- > audition (out 0 (pd_phasor 440 * 0.1))+pd_phasor :: UGen -> UGen+pd_phasor f = linLin_b (lfSaw AR f 0) 0 1++-- | Ramp doesn't make sense with a constant input signal.+--+-- > audition (out 0 (pd_osc (pd_line (lfNoise0 'a' AR 0.5) 300 * 500 + 300) * 0.1))+pd_line :: UGen -> UGen -> UGen+pd_line x msec = if isConstant x then x else ramp x (msec / 1000)++-- > audition (out 0 (pd_clip (pd_osc 220) (-0.05) 0.05))+pd_clip :: UGen -> UGen -> UGen -> UGen+pd_clip = clip++-- > audition (out 0 (pd_cos (pd_phasor 440) * 0.1))+pd_cos :: Floating a => a -> a+pd_cos i = cos (i * 2 * pi)++-- > audition (out 0 (pd_vcf (pd_noise 'a') (pd_phasor 0.1 * 500 + 200) 6 * 0.1))+pd_vcf :: UGen -> UGen -> UGen -> UGen+pd_vcf i cf q = bpf i cf (1 / q)++data B n = B {artic :: n+             ,tweet :: n+             ,syr1a :: n+             ,syr1m :: n+             ,syr2a :: n+             ,syr2m :: n+             ,basef :: n+             ,sweep :: n+             ,moda :: n+             ,modb :: n+             ,tf1 :: n+             ,tb1 :: n+             ,tf2 :: n+             ,tb2 :: n+             ,reson :: n+             ,vol :: n}+         deriving (Show)++square :: Num a => a -> a+square n = n * n++-- > let (_,o) = autotweet (presets !! 0)+-- > Sound.SC3.UGen.Dot.draw o+-- > audition (out 0 (sinOsc AR (sqrt o * 1000) 0 * 0.1))+autotweet :: B UGen -> (UGen,UGen)+autotweet b_data =+    let artic' = pd_line (artic b_data) 300+        tweet' = tweet b_data * 3+        ph = let x = abs (pd_lop (pd_noise 'a') 0.01) * (tweet' * 1000)+                 y = pd_osc x * (x * tweet')+             in pd_lop (pd_phasor y) 2+    in (ph,square (pd_cos (pd_clip (artic' - ph) (-0.25) 0.25)))++type TW = (UGen, UGen, UGen, UGen, UGen, UGen, UGen)++-- > Sound.SC3.UGen.Dot.draw (tweetypie (1,2,3,4,5,6,7))+tweetypie :: TW -> UGen+tweetypie (a,b,c,d,e,f,g) =+    let m = pd_osc (pd_osc a * pd_osc b * c + d)+    in pd_lop ((pd_vcf m e g + pd_vcf m f g) * 0.5) 5000++modmatrix :: UGen -> B UGen -> TW+modmatrix modall b_data =+    let get var mul tm = pd_line (var b_data * mul) tm+        syr1a' = get syr1a 3000 300+        syr1m' = get syr1m 200 500+        syr2a' = get syr2a 3000 300+        syr2m' = get syr2m 200 500+        basef' = get basef 5000 300+        sweep' = get sweep 3000 300+        moda' = get moda 2000 300+        modb' = get modb 50 300+        tf1' = get tf1 3000 300+        tb1' = get tb1 3000 300+        tf2' = get tf2 3000 300+        tb2' = get tb2 3000 300+        reson' = reson b_data * 20 + 2+        a = (syr1a' * modall) + syr2a'+        b = let p = syr1a' + syr1m'+                q = p * modall+                r = syr2a' + syr2m'+            in q + r+        c = modall * moda' * modb'+        d = (modall * sweep') + basef'+        e = (modall * tf1') + tb1'+        f = (modall * tf2') + tb2'+    in (a,b,c,d,e,f,reson')++-- > Sound.SC3.UGen.Dot.draw (birdbox (presets !! 0))+birdbox :: B UGen -> UGen+birdbox b_data =+    let (modall,a) = autotweet b_data+        tw = tweetypie (modmatrix modall b_data)+        a' = sqrt a * 1000+    in pd_vcf tw a' 0.1 * vol b_data++presets :: Fractional n => [B n]+presets =+    [B 0.683544 0.658228 0.177215 0.0886076 0.911392 0.0126582 0.291139 0.772152 0.0886076 0.632911 0.316456 0.860759 0.227848 0.620253 0.417722 0.199808+    ,B 0.683544 0.582278 0.405063 0.78481 0.911392 0.0126582 0.848101 0.0506329 0.0886076 0.632911 0.316456 0.240506 0.113924 0.620253 0.417722 0.199808+    ,B 0.924051 0.936709 0.886076 0.78481 0 0.291139 0.126582 0.721519 0.0253165 0.189873 0.0759494 0.810127 0.329114 0.139241 0.0759494 0.243502+    ,B 0.455696 0.620253 0 0.0506329 0.0126582 0.0126582 0.56962 1 0.0506329 0.620253 0.949367 0.810127 0.848101 0.683544 0.0886076 0.127144+    ,B 0.21519 0.518987 0.379747 1 0.0126582 0.0126582 0.405063 1 0.0506329 0.620253 0.949367 0.164557 0.848101 0.164557 0.746835 0.372008+    ,B 0.886076 0.518987 0 0.0632911 0.0126582 0.0126582 0.278481 0.417722 0.0506329 0.278481 0.443038 0.164557 0.544304 0.164557 0.746835 0.372008+    ,B 0.962025 0.898734 0 0.278481 0.164557 0.822785 0.0759494 0.417722 0.556962 0.113924 0.291139 0.126582 0.544304 0.151899 0.911392 0.372008+    ,B 0.164557 0.974684 0.734177 0.670886 0.240506 0.202532 0.227848 0.392405 0.0253165 0.392405 0.291139 0.126582 0.544304 0.734177 0.379747 0.868261+    ,B 0.708861 0.721519 0.253165 0.0759494 0.658228 0.177215 0.746835 0.202532 0.329114 0.202532 0.417722 0.177215 0.392405 0.405063 1 0.314002+    ,B 0.392405 0.721519 0.0759494 0.316456 0.658228 0.177215 0.177215 0.848101 0.0886076 0.202532 0.417722 0.177215 0.392405 0.405063 1 0.314002+    ,B 0.379747 0.962025 0.265823 0.0126582 0.0886076 0.177215 0.721519 0.139241 0.113924 0.139241 0.0759494 0.759494 0.936709 0.911392 0.848101 0.314002+    ,B 0.291139 0.556962 0.0632911 0.0253165 0.0506329 0.0379747 0.0759494 0 0.177215 0.227848 0.0759494 0.240506 0.0379747 0.506329 0.924051 0.314002+    ,B 0.848101 0.772152 0.367089 0.189873 0.35443 0.0506329 0.0126582 0.177215 0.101266 0.0253165 0.924051 0.0886076 1 0.0886076 0.455696 0.732876]++-- B 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0++-- > hearb (presets !! 4)+hearb :: B UGen -> IO ()+hearb = audition . out 0 . birdbox++main :: IO ()+main = do+  let f g = let (p,g') = R.choose presets g in (birdbox p,g')+  overlapTextureS (20,4,5,maxBound) f =<< getStdGen++-- Local Variables:+-- truncate-lines:t+-- End:
Sound/SC3/Graph/AM_karplus_strong.hs view
@@ -2,7 +2,7 @@ module Sound.SC3.Graph.AM_karplus_strong where  import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  -- x = delay, y = blend / gain karplus_strong :: UGen@@ -21,7 +21,7 @@         laggedDelay = lag x 0.01         o = sinOsc AR 200 0         a0 = decay d 0.025 * o-        a1 = localIn 1 AR + (a0 * (y - 0.25))+        a1 = localIn' 1 AR + (a0 * (y - 0.25))         a2 = delayN a1 0.01 laggedDelay         a3 = delay1 a2         a4 = (a2 + a3) * 0.5
Sound/SC3/Graph/AV_rm_octaver.hs view
@@ -1,16 +1,19 @@ -- rm-octaver (av), courtesy miller puckette+-- http://crca.ucsd.edu/~msp/techniques/latest/book-html/node77.html module Sound.SC3.Graph.AV_rm_octaver where + import Sound.SC3 {- hsc3 -}  defaultPitch :: UGen -> UGen-defaultPitch x = pitch x 440 60 4000 100 16 1 0.01 0.5 1+defaultPitch x = pitch x 440 60 4000 100 16 1 0.01 0.5 1 0  rm_octaver :: UGen -> UGen rm_octaver i =     let p = defaultPitch i-        f = mceChannel 0 p-    in sinOsc AR (f * 0.5) 0 * i + i+        [f,tr] = mceChannels p+    in lag3 tr 0.1 * sinOsc AR (f * 0.5) 0 * i + i +-- > audition (out 0 (soundIn 4)) main :: IO () main = audition (out 0 (rm_octaver (soundIn 4)))
Sound/SC3/Graph/F0_1_4Q6.hs view
@@ -2,15 +2,15 @@ module Sound.SC3.Graph.F0_1_4Q6 where  import Sound.SC3 {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  -- > audition risset ----- let set p = withSC3 (\fd -> send fd (n_set (-1) p))--- set [("trig",1)]--- set [("freq",midiCPS 100),("sustain",3),("trig",1)]--- set [("freq",midiCPS 60),("sustain",9),("trig",1)]--- set [("freq",midiCPS 40),("sustain",15),("trig",1)]+-- > let set p = withSC3 (send (n_set (-1) p))+-- > set [("trig",1)]+-- > set [("freq",midiCPS 100),("sustain",3),("trig",1)]+-- > set [("freq",midiCPS 60),("sustain",9),("trig",1)]+-- > set [("freq",midiCPS 40),("sustain",15),("trig",1)] risset :: Synthdef risset =     let k = control KR@@ -31,16 +31,19 @@         src = mixFill 11 fn     in synthdef "risset" (out 0 (pan2 src pan 1)) -pattern :: [P_Bind]+pattern :: (Synthdef,Int,P.Param) pattern =-  [(K_instr,pinstr' (Instr_Def risset False))-  ,(K_id,1000)-  ,(K_note,prand 'α' [0,2,5,7,11] inf)-  ,(K_octave,prand 'β' [4,5,6,7,9] inf)-  ,(K_legato,1)-  ,(K_dur,prand 'γ' [2,3,5,7] inf)-  ,(K_amp,pwhite 'δ' 0.025 0.15 inf)-  ,(K_param "trig",1)]+    let fr = let d = P.rand 'α' [0,2,5,7,11]+                 o = P.rand 'β' [4,5,6,7,9]+                 sc = [0,2,4,5,7,9,11]+             in P.degree_to_cps' sc 12 d o+        du = P.rand 'γ' [2,3,5,7]+    in (risset,1000+       ,[("freq",fr)+        ,("dur",du)+        ,("sustain",map (* 1.25) du)+        ,("amp",P.white 'δ' 0.025 0.15)+        ,("trig",repeat 1)])  main :: IO ()-main = audition (pmono pattern)+main = audition (P.nbind1 pattern)
Sound/SC3/Graph/F0_buffer_display.hs view
@@ -3,7 +3,7 @@  import Control.Concurrent {- base -} import qualified Graphics.Rendering.Cairo as C {- cairo -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Cairo.Scope.Shell {- hsc3-cairo -}  -- * Type@@ -119,7 +119,7 @@  {- -import Sound.SC3.ID+import Sound.SC3  let s = saw AR (mouseX KR 20 800 Exponential 0.2) in audition (out 0 s)
+ Sound/SC3/Graph/F0_f0_454598285861617665.hs view
@@ -0,0 +1,16 @@+-- https://twitter.com/redFrik/status/454598285861617665 (f0)+module Sound.SC3.Graph.F0_f0_454598285861617665 where++import Sound.SC3 {- hsc3 -}++f0_454598285861617665 :: UGen+f0_454598285861617665 =+    let b = mce [9,8 .. 1]+        c = lfTri AR (3 ** lfTri AR (1 / b) (b / 9)) 0+        d = lfTri AR (1 / b) 0 `modE` 1 / 9 + 0.01+        f = 2 ** roundE (lfTri AR (b / 99) 0) * 99 * b+        o = grainSin 2 c d f 0 (-1) 512+    in splay (tanh o) 1 1 0 True / 2++main :: IO ()+main = audition (out 0 f0_454598285861617665)
+ Sound/SC3/Graph/F0_f0_456384156159574016.hs view
@@ -0,0 +1,14 @@+-- https://twitter.com/redFrik/status/456384156159574016 (f0)+module Sound.SC3.Graph.F0_f0_456384156159574016 where++import Sound.SC3 {- hsc3 -}++f0_456384156159574016 :: UGen+f0_456384156159574016 =+    let a = 1 / mce [3,12,4,1,6,2]+        s = lag3 (sinOsc AR a 0) (abs (sinOsc AR (2.67 ** a) 0)) * 99+        f = ((sinOsc AR ((1 / a) / 9) a >* 0) * 20 + 99) / a+    in splay (sinOsc AR (hpf (ringz s f 1) 440) 0) 1 1 0 True * 0.25++main :: IO ()+main = audition (out 0 f0_456384156159574016)
+ Sound/SC3/Graph/F0_f0_tw0026.hs view
@@ -0,0 +1,34 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0)+module Sound.SC3.Graph.F0_f0_tw0026 where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Collection.Extension {- hsc3-lang -}+import Sound.SC3.Lang.Math {- hsc3-lang -}+import Sound.SC3.Lang.Pattern.Plain {- hsc3-lang -}++fibs :: Num n => [n]+fibs = 0 : scanl (+) 1 fibs++-- | In SC3, List.fibs begins at 1.+nfibs :: Num a => Int -> [a]+nfibs n = take n (tail fibs)++-- | In SC3, % of zero is zero.+mod0 :: (Extending f, Integral c) => f c -> f c -> f c+mod0 l = let f p q = if q == 0 then 0 else p `mod` q in zipWith_c f l++post_proc :: UGen+post_proc = let s = combL (tanh (in' 1 AR 8) / 8) 1 1 8 in mce2 s s * 0.1++pattern :: NRT+pattern =+    let d = nfibs 32 `mod0` (nfibs 64  `mod0` [12])+        f = map (\x -> degree_to_cps [0,2,4,5,7,9,11] 12 (fromIntegral x) 4) d+    in sbind1 (defaultSynthdef+              ,[("amp",repeat 8)+               ,("dur",repeat 0.25)+               ,("freq",cycle f)+               ,("out",repeat 8)])++main :: IO ()+main = audition (out 0 post_proc) >> audition pattern
Sound/SC3/Graph/F0_f0_tw0028.hs view
@@ -1,7 +1,7 @@ -- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0) module Sound.SC3.Graph.F0_f0_tw0028 where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  fib :: Integral i => [i] fib = 0 : scanl (+) 1 fib
Sound/SC3/Graph/F0_f0_tw0030.hs view
@@ -1,7 +1,7 @@ -- www.fredrikolofsson.com/f0blog/?q=node/537 (f0) module Sound.SC3.Graph.F0_f0_tw0030 where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  f0_0030 :: UGen f0_0030 =@@ -9,7 +9,7 @@         f = a 1 0 5 (a (mce2 0.05 0.04) 0 50 160 `roundTo` 50)         w = a 0.2 0 0.5 (a 3 0 0.2 0.5)         o = varSaw AR f 0 w / 8-    in out 0 (gVerb o 80 3 0.5 0.5 15 1 0.7 0.5 300)+    in out 0 (gVerb o 80 3 0.5 0.5 15 1 0.7 0.5 300 * 0.1)  main :: IO () main = audition f0_0030
Sound/SC3/Graph/F0_f0_tw0033.hs view
@@ -1,8 +1,7 @@ -- www.fredrikolofsson.com/f0blog/?q=node/537 (f0) module Sound.SC3.Graph.F0_f0_tw0033 where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -}  f0_0033 :: UGen f0_0033 =@@ -11,7 +10,7 @@         n = uclone 'α' 4 (brownNoise 'α' AR) * a         z i = mce2 (i + 1 * f) (i * f + (i + 1 / 3))         o = lfPar AR (mce (map z [0..3])) 0-    in out 0 (splay ((o >* n) / 3) 1 1 0 True)+    in out 0 (splay ((o >* n) / 3) 1 1 0 True * 0.1)  main :: IO () main = audition f0_0033
+ Sound/SC3/Graph/F0_f0_tw0041.hs view
@@ -0,0 +1,16 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0)+module Sound.SC3.Graph.F0_f0_tw0041 where++import Sound.SC3 {- hsc3 -}++f0_tw0041 :: UGen+f0_tw0041 =+    let s = sweep (localIn' 6 AR) 1+        i = impulse AR (mce [1,0.749,6,12,3,4]) 0+        o = sinOsc AR (1 / runningMax s i) 0+    in mrg [tanh (splay o 1 1 0 True) / 2 * 0.1+           ,localOut o]++main :: IO ()+main = audition (out 0 f0_tw0041)+
Sound/SC3/Graph/F0_f0_tw0045.hs view
@@ -9,7 +9,7 @@         f = a (a 0.11 0 1 0) 0 1 0         p_f = a (95 * a 0.01 0 1 1) 0 (a 5e-3 0 50 0) 100         p = a p_f (a (mce2 98 97) 0 1 0) (pi + a 5e-4 0 1 0) 0-    in out 0 (tanh (a f p 1 0))+    in tanh (a f p 1 0) * 0.1  main :: IO ()-main = audition f0_0045+main = audition (out 0 f0_0045)
+ Sound/SC3/Graph/F0_f0_tw0120.hs view
@@ -0,0 +1,17 @@+-- http://sccode.org/1-4Qy (f0)+module Sound.SC3.Graph.F0_f0_tw0120 where++import Sound.SC3 {- hsc3 -}++f0_tw0120 :: UGen+f0_tw0120 =+    let a = lfTri+        z = a KR (1 / mce2 7 8) 0 * a KR (1 / 9) 0 * 99+        l = midiCPS (mce [60 .. 79])+        f = select z l+        w = a KR (1 / mce2 3 4) 0 `modE` 1+        o = varSaw AR f 0 w+    in combN o 1 (1 / mce2 5 6) 8 / 4++main :: IO ()+main = audition (out 0 f0_tw0120)
+ Sound/SC3/Graph/F0_f0_tw0121.hs view
@@ -0,0 +1,16 @@+-- http://sccode.org/1-4Qy (f0)+module Sound.SC3.Graph.F0_f0_tw0121 where++import Sound.SC3 {- hsc3 -}++f0_tw0121 :: UGen+f0_tw0121 =+    let a = sinOsc+        z = a KR (1 / mce2 8 7) 0 * a KR (1 / 30) 0 * 9+        l = midiCPS (mce [56,62 .. 98])+        m = a AR (1 / mce2 4 3) 0+        o = a AR (select z l) 0 * m+    in tanh (combN o 1 (1 / mce2 6 5) 9)++main :: IO ()+main = audition (out 0 f0_tw0121)
+ Sound/SC3/Graph/F0_f0_tw0125.hs view
@@ -0,0 +1,17 @@+-- http://sccode.org/1-4Qy (f0)+module Sound.SC3.Graph.F0_f0_tw0125 where++import Sound.SC3 {- hsc3 -}++f0_tw0125 :: UGen+f0_tw0125 =+    let a = sinOsc AR+        f = a (1 / mce [8,9]) 0 * 4 + mce [400,202]+        u = (a (1/9) 0 + 1) / 88+        d = (a (1/8) 0 + 1) / 99+        i = inFeedback 1 (mce [1,0])+        p = combC (lagUD i u d) 1 0.08 9+    in a f p++main :: IO ()+main = audition (out 0 f0_tw0125)
+ Sound/SC3/Graph/F0_f0_tw0134.hs view
@@ -0,0 +1,24 @@+-- http://sccode.org/1-4Qy (f0)+-- scsynth -u 57110 -w 512+module Sound.SC3.Graph.F0_f0_tw0134 where++import Sound.SC3 {- hsc3 -}++mean :: Fractional a => [a] -> a+mean l = sum l / fromIntegral (length l)++f0_tw0134 :: UGen+f0_tw0134 =+    let a = lfSaw AR+        n' = 50+        n = constant n'+        z i = let o1 = a ((i + 1) / mce [3,4]) 0+                  o2 = a ((i + 1) / 8) 0 + 1+                  f0 = o1 >* o2 * (n / 2) + n+                  m = a ((i + 1) / n) (i / (n / 2))+                  o3 = blip AR f0 (i + mce [2,3]) * m+              in ringz o3 ((i + 1) * (n * 2 - 1)) 0.1+    in mean (map z [0 .. n'])  / 5++main :: IO ()+main = audition (out 0 f0_tw0134)
+ Sound/SC3/Graph/F0_f0_tw0220.hs view
@@ -0,0 +1,21 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0)+module Sound.SC3.Graph.F0_f0_tw0220 where++import Sound.SC3 {- hsc3 -}++f0_tw0220 :: UGen+f0_tw0220 =+    let c = inFeedback 1 0+        b = clearBuf (localBuf 'α' 1 90000)+        g = tGrains 2 (sinOsc AR 3 0) b (c + 3) 2 12 0 0.1 4+        r = recordBuf AR b 0 1 0 1 Loop 1 DoNothing c+    in mrg2 (hpf (sinOsc AR 99 (c * 6) / 9 + g) 9) r++main :: IO ()+main = withSC3 (play (out 0 f0_tw0220))++{-+2014-10-11: tgrains needs a patch to work with localbuf+http://article.gmane.org/gmane.comp.audio.supercollider.user/110110+main = withSC3 (async (b_alloc bufnum 90000 1) >> play (out 0 f0_tw0220))+-}
+ Sound/SC3/Graph/F0_f0_tw0224.hs view
@@ -0,0 +1,15 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0)+module Sound.SC3.Graph.F0_f0_tw0224 where++import Sound.SC3 {- hsc3 -}++f0_tw0224 :: UGen+f0_tw0224 =+    let c = 200000+        b = clearBuf (localBuf 'α' 2 c)+        d = bufRd 2 AR b (sinOsc AR (mce2 2 3 * 9) 0 * c) NoLoop LinearInterpolation+        w = bufWr b (abs (sinOsc AR (mce2 99 145) 0) * c) Loop (sinOsc AR (3 / mce2 2 3) 0 / 3)+    in mrg2 d w++main :: IO ()+main = audition (out 0 f0_tw0224)
+ Sound/SC3/Graph/F0_f0_tw0225.hs view
@@ -0,0 +1,13 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0)+module Sound.SC3.Graph.F0_f0_tw0225 where++import Sound.SC3 {- hsc3 -}++f0_tw0225 :: UGen+f0_tw0225 =+    let b = mce [1..8] * 99+        o = blip AR (b / 2 + lfSaw KR ((-8) / b) 1 * 99) (b / 4 + (lfSaw KR (1 / b) 1 * 99))+    in sin (splay (combN (o * sinOsc AR (8 / b) (lfSaw AR (99 / b) 0)) 0.2 0.2 1) 1 1 0 True)++main :: IO ()+main = audition (out 0 f0_tw0225)
Sound/SC3/Graph/F0_hansm.hs view
@@ -1,4 +1,4 @@--- http://www.fredrikolofsson.com/f0blog/?q=node/457 (f0)+-- http://www.fredrikolofsson.com/f0blog/?q=node/457 (f0) (af) -- http://obiwannabe.co.uk/tutorials/html/tutorial_birds.html module Sound.SC3.Graph.F0_hansm where 
Sound/SC3/Graph/F0_red_frik_m.hs view
@@ -1,23 +1,23 @@ -- red_frik (f0) module Sound.SC3.Graph.F0_red_frik_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  red :: UId m => UGen -> UGen -> m UGen red tr n = do-  r1 <- tRand 0.3 3 tr-  r2 <- tRand 0.3 5 tr-  r3 <- tRand 0 0.5 tr-  r4 <- tRand 0.49 0.56 tr-  r5 <- tRand 0.3 0.6 tr-  r6 <- tRand 0.3 0.5 tr+  r1 <- tRandM 0.3 3 tr+  r2 <- tRandM 0.3 5 tr+  r3 <- tRandM 0 0.5 tr+  r4 <- tRandM 0.49 0.56 tr+  r5 <- tRandM 0.3 0.6 tr+  r6 <- tRandM 0.3 0.5 tr   let o1 = fSinOsc KR r2 0 * r3 + r4-      o2 = fSinOsc KR o1 r5 * r6+      o2 = fSinOsc KR o1 0 * r5 + r6   return (rhpf n r1 o2)  red_frik :: UId m => m UGen red_frik = do-  n <- clone 2 (brownNoise AR)+  n <- clone 2 (brownNoiseM AR)   let tr = impulse KR 0.1 0   red tr n 
Sound/SC3/Graph/F0_sinusdeklinationen.hs view
@@ -1,41 +1,34 @@ -- http://www.fredrikolofsson.com/f0blog/?q=node/488 (f0)+{-# OPTIONS_GHC -F -pgmF hsc3-psynth #-} module Sound.SC3.Graph.F0_sinusdeklinationen where  import Data.List.Split {- split -} import Sound.SC3 {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3.Lang.Collection.Numerical.Truncating () {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -} -sinuscell :: UGen-sinuscell =-    let ctl = control KR-        b = ctl "out" 0-        p = ctl "pan" 0-        a = ctl "amp" 0.5-        fre = ctl "fre" 400-        atk = ctl "atk" 1-        sus = ctl "sus" 0.2-        rel = ctl "rel" 1-        e_d = envLinen atk sus rel a+sinuscell :: Synthdef+sinuscell = psynth {bus=0,pan=0,amp=0.5,freq=400,atk=1,sus=0.2,rel=1} where+    let e_d = envLinen atk sus rel amp         e = envGen KR 1 0.1 0 1 RemoveSynth e_d-        s = sinOsc AR fre 0-    in out b (pan2 s p e)+        s = sinOsc AR freq 0+    in out bus (pan2 s pan e) -pattern :: Enum e => (Field,[e]) -> [P_Bind]+pattern :: Enum e => (Double,[e]) -> (Synthdef,P.Param) pattern (c,z) =     case z of       [z0,z1,z2,z3] ->-          let a = pwhite z0 0 1 inf-              s = 0.2-              r = pwhite z1 0 1 inf-              i = psynth (synthdef "sinuscell" sinuscell)-          in [(K_instr,i)-             ,(K_dur,a+s+r)-             ,(K_amp,pwhite z3 0 1 inf)-             ,(K_param "fre",pwhite z2 0 1100 inf)-             ,(K_param "atk",a)-             ,(K_param "sus",s)-             ,(K_param "rel",r)-             ,(K_param "pan",prepeat c)]+          let a = P.white z0 0 1+              s = repeat 0.2+              r = P.white z1 0 1+          in (sinuscell+             ,[("dur",a + s + r)+              ,("amp",P.white z3 0 1)+              ,("freq",P.white z2 0 1100)+              ,("atk",a)+              ,("sus",s)+              ,("rel",r)+              ,("pan",repeat c)])       _ -> undefined  cells :: Fractional n => [n]@@ -44,4 +37,4 @@ main :: IO () main =     let c = zip cells (chunksOf 4 ['α'..])-    in audition (ppar (map (pbind . pattern) c))+    in audition (P.sbind (map pattern c))
Sound/SC3/Graph/JJ_bohlen_pierce_140.hs view
@@ -1,8 +1,8 @@ -- http://sccode.org/1-W (jj) module Sound.SC3.Graph.JJ_bohlen_pierce_140 where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  bp140u :: UGen bp140u =@@ -15,6 +15,4 @@ bp140 = synthdef "bp140" (out 0 bp140u)  main :: IO ()-main = do-  let p = pbind [(K_instr,psynth bp140),(K_dur,prand 'δ' [1/6,1/3] inf)]-  audition p+main = audition (P.sbind1 (bp140,[("dur",P.rand 'δ' [1/6,1/3])]))
Sound/SC3/Graph/JL_bitwise.hs view
@@ -14,7 +14,7 @@               ((t *  5) .&. (t .>>. (mce2 3 4))) .|.               ((t *  2) .&. (t .>>. 9)) .|.               ((t *  8) .&. (t .>>. 11))) - 3) .%. 256-    in tanh (hpf (((s / 127) - 1) * 3) 20)+    in tanh (hpf (((s / 127) - 1) * 3) 20) * 0.02  main :: IO () main = audition (out 0 bitwise_operators)
Sound/SC3/Graph/JL_dark_sea_horns.hs view
@@ -1,14 +1,13 @@ -- http://sccode.org/1-j#c51 (jl) module Sound.SC3.Graph.JL_dark_sea_horns where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  dark_sea_horns :: UGen dark_sea_horns =     let n = lfNoise1-        x = localIn 2 AR+        x = localIn' 2 AR         a = tanh (sinOsc AR 65 (x * n 'α' AR 0.1 * 3) * n 'β' AR 3 * 6)         f i = allpassN i 0.3 (randN 2 'γ' 0.1 0.3) 5         o = tanh (useq 'δ' 9 f a)
Sound/SC3/Graph/JL_dark_sea_horns_hp.hs view
@@ -2,15 +2,15 @@ {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JL_dark_sea_horns_hp where -import Sound.SC3.Monad {- hsc3 -}-import Sound.SC3.UGen.External.RDU.Monad {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  dark_sea_horns :: UId m => m UGen dark_sea_horns = do-  let n = lfNoise1-  let x = localIn 2 AR+  let n = lfNoise1M+  let x = localIn' 2 AR   let a = tanh (sinOsc AR 65 (x * #(n AR 0.1) * 3) * #(n AR 3) * 6)-  let f i = do return (allpassN i 0.3 #(randN 2 0.1 0.3) 5)+  let f i = do return (allpassN i 0.3 #(randNM 2 0.1 0.3) 5)   let o = tanh #(chainM 9 f a)   return (mrg2 o (localOut o)) 
Sound/SC3/Graph/JL_pwm_crossfade.hs view
@@ -1,7 +1,7 @@ -- http://sccode.org/1-L (jl) module Sound.SC3.Graph.JL_pwm_crossfade where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  urangeM :: UGen -> UGen -> UGen urangeM u = let [u0,u1] = mceChannels u in urange u0 u1
Sound/SC3/Graph/JL_rain_thunder.hs view
@@ -1,7 +1,7 @@ -- http://sccode.org/1-e (jl) module Sound.SC3.Graph.JL_rain_thunder where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  rain_thunder :: UGen rain_thunder =
Sound/SC3/Graph/JMCC_aleatoric_quartet_m.hs view
@@ -1,28 +1,29 @@--- aleatoric quartet (jmcc)+-- aleatoric quartet (jmcc) #7 module Sound.SC3.Graph.JMCC_aleatoric_quartet_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -} +-- > g <- aleatoric_quartet aleatoric_quartet :: UId m => m UGen aleatoric_quartet = do-  let base_mn = control KR "note" 66-      amp = control KR "ampl" 0.07+  let base_mn = 66 -- control KR "note" 66+      amp = 0.07 -- control KR "ampl" 0.07       density = mouseX KR 0.01 1 Linear 0.1       dmul = recip density * 0.5 * amp       dadd = amp - dmul-      rapf i = do r <- clone 2 (rand 0 0.05)+      rapf i = do r <- clone 2 (randM 0 0.05)                   return (allpassN i 0.05 r 1)-      mk_f = do i0 <- iRand 0 2-                let r0 = select i0 (mce [1, 0.5, 0.25])-                r1 <- rand (-30) 30-                n0 <- lfNoise0 KR r0+      mk_f = do r0 <- lchooseM [1, 0.5, 0.25]+                r1 <- randM (-30) 30+                n0 <- lfNoise0M KR r0                 let m = n0 * 7 + base_mn + r1                     m' = lag (roundTo m 1) 0.2                 return (midiCPS m')       mk_s = do f <- fmap recip mk_f-                r <- rand (-1) 1-                x <- do n0 <- pinkNoise AR-                        n1 <- lfNoise1 KR 8+                r <- randM (-1) 1+                x <- do n0 <- pinkNoiseM AR+                        n1 <- lfNoise1M KR 8                         return (n0 * max 0 (n1 * dmul + dadd))                 return (pan2 (combL x 0.02 f 3) r 1)   g <- chainM 5 rapf =<< fmap sum (sequence (replicate 4 mk_s))
Sound/SC3/Graph/JMCC_alien_froggies.hs view
@@ -1,14 +1,15 @@--- alien froggies (jmcc)+-- alien froggies (jmcc) #1 module Sound.SC3.Graph.JMCC_alien_froggies where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -} -alien_froggies :: UGen -> (UGen,UGen)+alien_froggies :: UGen -> UGen alien_froggies r =     let r' = fold (r * exp (linRand 'α' (-0.2) 0.2 0)) 1 30         o = formant AR r' (expRand 'β' 200 3000) (rand 'γ' 0 9 * r' + r')-    in (o * 0.05,r')+    in o * 0.05 +-- > let u = alien_froggies 11 main :: IO ()-main = overlapTextureS (0.25,0.5,5,maxBound) alien_froggies 11+main = overlapTextureU (0.25,0.5,5,maxBound) (alien_froggies 11)
+ Sound/SC3/Graph/JMCC_alien_froggies_rec.hs view
@@ -0,0 +1,14 @@+-- alien froggies (jmcc) #1+module Sound.SC3.Graph.JMCC_alien_froggies_rec where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++alien_froggies :: UGen -> (UGen,UGen)+alien_froggies r =+    let r' = fold (r * exp (linRand 'α' (-0.2) 0.2 0)) 1 30+        o = formant AR r' (expRand 'β' 200 3000) (rand 'γ' 0 9 * r' + r')+    in (o * 0.05,r')++main :: IO ()+main = overlapTextureS (0.25,0.5,5,maxBound) alien_froggies 11
Sound/SC3/Graph/JMCC_alien_meadow.hs view
@@ -1,17 +1,14 @@--- alien meadow (jmcc)+-- alien meadow (jmcc) #6 module Sound.SC3.Graph.JMCC_alien_meadow where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  alien_meadow :: UGen alien_meadow =-    let a = rand 'α' 0 20-        b = rand 'α' 0 5000-        c = rand 'α' 0 20-        p = rand 'α' (-1) 1-        f = sinOsc AR a 0 * b * 0.1 + b-    in pan2 (sinOsc AR f 0) p (sinOsc AR c 0 * 0.05 + 0.05)+    let b = rand 'α' 0 5000+        f = sinOsc AR (rand 'β' 0 20) 0 * b * 0.1 + b+    in pan2 (sinOsc AR f 0) (rand 'γ' (-1) 1) (sinOsc AR (rand 'δ' 0 20) 0 * 0.05 + 0.05)  main :: IO () main = overlapTextureU (2,6,6,maxBound) alien_meadow
Sound/SC3/Graph/JMCC_analog_bubbles.hs view
@@ -1,8 +1,12 @@--- analog bubbles (jmcc)+-- analog bubbles (jmcc) #1 module Sound.SC3.Graph.JMCC_analog_bubbles where  import Sound.SC3 {- hsc3 -} +-- > putStrLn$synthstat analog_bubbles+-- > let g = synthdef_to_graphdef (synthdef "analog-bubbles" (out 0 analog_bubbles))+-- > import qualified Sound.SC3.Server.Graphdef as G+-- > putStrLn$G.graphdef_stat g analog_bubbles :: UGen analog_bubbles =   let o = lfSaw KR (mce2 8 7.23) 0 * 3 + 80
+ Sound/SC3/Graph/JMCC_analog_bubbles_mouse.hs view
@@ -0,0 +1,17 @@+-- analog bubbles with mouse control (jmcc) #3+module Sound.SC3.Graph.JMCC_analog_bubbles_mouse where++import Sound.SC3 {- hsc3 -}++analog_bubbles_mouse :: UGen+analog_bubbles_mouse =+  let y = mouseY KR 0.1 10 Exponential 0.2 -- lfo 1 rate+      x = mouseX KR 2 40 Exponential 0.2  -- lfo 2 rate+      o2 = lfSaw KR x 0 * (-3) + 80 -- depth & offset in semitones+      o1 = lfSaw KR y 0 * 24 + o2 -- depth in semitones, offset is lfo_2+      f = midiCPS o1 -- convert to frequency+      s = sinOsc AR f 0 * 0.04+  in combN s 0.2 0.2 4 -- echoing sine wave++main :: IO ()+main = audition (out 0 analog_bubbles_mouse)
+ Sound/SC3/Graph/JMCC_analogue_daze.hs view
@@ -0,0 +1,25 @@+-- analogue daze (jmcc) #3+module Sound.SC3.Graph.JMCC_analogue_daze where++import Sound.SC3 {- hsc3 -}++analogue_daze :: UGen+analogue_daze =+    let pattern = [55,63,60,63,57,65,62,65]+        sequ k s tr = demand tr 0 (dseq k dinf (mce s))+        f k octave clockRate pwmrate fltrate =+            let trg = impulse KR clockRate 0+                pattern' = map (midiCPS .  (+ (12 * octave))) pattern+                sq = sequ 'α' pattern' trg+                pwm = sinOsc KR pwmrate (rand ('β' `joinID` k) 0 (2 * pi)) * 0.4 + 0.5+                cf = sinOsc KR fltrate (rand ('γ' `joinID` k) 0 (2 * pi)) * 1400 + 2000+            in rlpf (lfPulse AR (lag sq 0.05) 0 pwm * 0.1) cf (1/15)+        a = lfNoise0 'δ' AR (lfNoise1 'ε' KR 0.3 * 6000 + 8000) * (mce2 0.07 0.08)+        x = decay (impulse AR 2 0) 0.15 * a+        g = mce [f 'ζ' 1 8 0.31 0.2,f 'η' 0 2 0.13 0.11] + x+        z = 0.4 * (combN g 0.375 0.375 5 + mceReverse g)+        e = envLinen 2 56 2 1+    in z * envGen KR 1 1 0 1 RemoveSynth e++main :: IO ()+main = audition (out 0 analogue_daze)
+ Sound/SC3/Graph/JMCC_babbling_brook.hs view
@@ -0,0 +1,17 @@+-- babbling brook (jmcc) #SC3+-- http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html+module Sound.SC3.Graph.JMCC_babbling_brook where++import Sound.SC3 {- hsc3 -}++babbling_brook :: UGen+babbling_brook =+  let b f m a g = let n3 = lpf (brownNoise 'α' AR) f * m + a+                      n4 = onePole (brownNoise 'β' AR) 0.99+                  in rhpf n4 n3 0.03 * g+      x = uclone 'γ' 2 (b 14 400 500 0.006)+      y = uclone 'δ' 2 (b 20 800 1000 0.010)+  in x + y++main :: IO ()+main = audition (out 0 babbling_brook)
Sound/SC3/Graph/JMCC_babbling_brook_m.hs view
@@ -1,13 +1,13 @@--- babbling brook (jmcc)+-- babbling brook (jmcc) #SC3 -- http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html module Sound.SC3.Graph.JMCC_babbling_brook_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  babbling_brook :: UId m => m UGen babbling_brook = do-  let b f m a g = do n1 <- brownNoise AR-                     n2 <- brownNoise AR+  let b f m a g = do n1 <- brownNoiseM AR+                     n2 <- brownNoiseM AR                      let n3 = lpf n2 f * m + a                          n4 = onePole n1 0.99                      return (rhpf n4 n3 0.03 * g)
+ Sound/SC3/Graph/JMCC_berlin_1977.hs view
@@ -0,0 +1,32 @@+-- berlin 1977 (jmcc) #4+module Sound.SC3.Graph.JMCC_berlin_1977 where++import Sound.SC3 {- hsc3 -}++-- Somewhat akin to SC2 Sequencer.+sequ :: ID a => a -> [UGen] -> UGen -> UGen+sequ e s tr = demand tr 0 (dseq e dinf (mce s))++-- Somewhat akin to SC2 Sequencer with random selection function as input.+sequR :: ID a => a -> [UGen] -> UGen -> UGen+sequR e s tr = demand tr 0 (dshuf e dinf (mce s))++berlin_1977 :: UGen+berlin_1977 =+    let clock_rate = mouseX KR 5 20 Exponential 0.2 -- mouse x controls clock rate+        clock_time = 1 / clock_rate+        clock = impulse KR clock_rate 0 -- sequencer trigger+        patternList = [55,60,63,62,60,67,63,58];+        note = sequ 'α' patternList clock -- midi note pattern sequencer+        clock_16 = pulseDivider clock 16 0 -- divide clock by 16+        note' = sequR 'β' [-12,-7,-5,0,2,5] clock_16 + note -- transpose somewhat randomly+        freq = midiCPS note' -- convert midi note to cycles per second+        env = decay2 clock (0.05 * clock_time) (2 * clock_time)+        amp = env * 0.1 + 0.02 -- amplitude envelope+        filt = env * (fSinOsc KR 0.17 0 * 800)+ 1400 -- filter frequency+        pw = sinOsc KR 0.08 (mce2 0 (0.5 * pi)) * 0.45 + 0.5 -- pulse width LFO(s)+        s = pulse AR freq pw * amp+    in combN (rlpf s filt 0.15) 0.2 (mce2 0.2 0.17) 1.5++main :: IO ()+main = audition (out 0 berlin_1977)
+ Sound/SC3/Graph/JMCC_birdies.hs view
@@ -0,0 +1,21 @@+-- birdies (jmcc) #6+module Sound.SC3.Graph.JMCC_birdies where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: ID a => a -> UGen -> UGen+rand2 e n = rand e (- n) n++birdies :: UGen+birdies =+    let p1 = lfPulse KR (0.4 + rand 'α' 0 1) 0 (rand 'β' 0 0.8 + 0.1) * (rand 'γ' 0 3 + 4) + 2+        p2 = lfPulse KR (0.4 + rand 'δ' 0 1) 0 (rand 'ε' 0 0.8 + 0.1) * (rand 'ζ' 0 3 + 4)+        p3 = lfPulse KR (0.2 + rand 'η' 0 0.5) 0 0.4 * 0.02+        sw = lfSaw KR (p1 + p2) 0 * (- (1000 + rand 'θ' 0 800)) + (4000 + rand2 'ι' 1200)+        freq = lag sw 0.05+        amp = lag p3 0.3+    in pan2 (sinOsc AR freq 0 * amp) (rand2 'κ' 1) 1++main :: IO ()+main = overlapTextureU (7,4,4,maxBound) birdies
+ Sound/SC3/Graph/JMCC_birds.hs view
@@ -0,0 +1,22 @@+-- birds (jmcc)+module Sound.SC3.Graph.JMCC_birds where++import Sound.SC3 {- hsc3 -}++node :: UGen+node =+  let f = lag (lfSaw AR (7 + rand 'α' (-1.5) 1.5) (rand 'β' 0 1) * rand 'γ' 11 15) 0.1 + rand 'δ' 94 102+      a = lfPulse KR (1 / rand 'ε' 12 15.6) (rand 'ζ' 0 1) 0.16 * 0.05+      b = sinOsc AR (midiCPS f) (rand 'η' 0 1) * a+  in rotate2 b (silent 1) (rand 'θ' (-1) 1)++-- > putStrLn$synthstat birds+birds :: UGen+birds =+  let d = mix (uclone 'α' 6 node)+      f i = allpassL i 0.07 (rand 'β' 0 0.06) (rand 'γ' 0.7 2.0)+      w = useq 'δ' 12 f d+  in d * 0.7 + w * 0.3++main :: IO ()+main = audition (out 0 birds)
Sound/SC3/Graph/JMCC_birds_hp.hs view
@@ -3,21 +3,22 @@ {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_birds_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  node :: UId m => m UGen node = do-  let f = lag (lfSaw AR (7 + #(rand (-1.5) 1.5)) #(rand 0 1) * #(rand 11 15)) 0.1 + #(rand 94 102)-  let a = lfPulse KR (1 / #(rand 12 15.6)) #(rand 0 1) 0.16 * 0.05-  let b = sinOsc AR (midiCPS f) #(rand 0 1) * a-  return (rotate2 b (silent 1) #(rand (-1) 1))+  let f = lag (lfSaw AR (7 + #(randM (-1.5) 1.5)) #(randM 0 1) * #(randM 11 15)) 0.1 + #(randM 94 102)+  let a = lfPulse KR (1 / #(randM 12 15.6)) #(randM 0 1) 0.16 * 0.05+  let b = sinOsc AR (midiCPS f) #(randM 0 1) * a+  return (rotate2 b (silent 1) #(randM (-1) 1))  birds :: UId m => m UGen birds = do   d <- return . sum =<< sequence (replicate 6 node)-  let apf i = do return (allpassL i 0.07 #(rand 0 0.06) #(rand 0.7 2.0))-  w <- chainM 12 apf d+  let f i = do return (allpassL i 0.07 #(randM 0 0.06) #(randM 0.7 2.0))+  w <- chainM 12 f d   return (d * 0.7 + w * 0.3) +-- > birds >>= putStrLn . synthstat main :: IO () main = audition . out 0 =<< birds
Sound/SC3/Graph/JMCC_birds_m.hs view
@@ -2,28 +2,29 @@ -- http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html module Sound.SC3.Graph.JMCC_birds_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  birds :: UId m => m UGen birds = do-  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 node = do r1 <- randM 94.0 102.0+                r2 <- randM (-1.5) 1.5+                r3 <- randM 0.0 1.0+                r4 <- randM 11.0 15.0+                r5 <- randM 0.0 1.0+                r6 <- randM 12.0 15.6+                r7 <- randM 0.0 1.0+                r8 <- randM (-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                 return (rotate2 b (silent 1) r8)-      apf i = do r1 <- rand 0.0 0.06-                 r2 <- rand 0.7 2.0+      apf i = do r1 <- randM 0.0 0.06+                 r2 <- randM 0.7 2.0                  return (allpassL i 0.07 r1 r2)   d <- return . sum =<< sequence (replicate 6 node)   w <- chainM 12 apf d   return (d * 0.7 + w * 0.3) +-- > birds >>= putStrLn . synthstat main :: IO () main = audition . out 0 =<< birds
+ Sound/SC3/Graph/JMCC_blips_001.hs view
@@ -0,0 +1,31 @@+-- blips 001 (jmcc) #SC3d1.5+module Sound.SC3.Graph.JMCC_blips_001 where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: ID a => a -> UGen -> UGen+rand2 e n = rand e (-n) n++blip_001 :: ID a => a -> UGen+blip_001 e =+    let f = xLine KR (expRand 'α' 0.25 400) (expRand 'β' 0.25 400) 4 DoNothing+        nh = xLine KR (expRand 'γ' 2 100) (expRand 'δ' 2 100) 4 DoNothing+    in uprotect e (blip AR f nh)++blips_001 :: UGen+blips_001 =+    let c = rand 'ε' 0 1 <* 0.8+        o = blip_001 'ζ' * blip_001 'η'+    in (c * pan2 o (line KR (rand2 'θ' 1) (rand2 'ι' 1) 4 DoNothing) 0.3)++-- > let g = blips_pp blips_001+-- > audition (out 0 (blips_pp blips_001))+blips_pp :: UGen -> UGen+blips_pp z =+    let z' = distort z+        f x = allpassN x 0.05 (mce2 (rand 'κ' 0 0.05) (rand 'λ' 0 0.05)) 4+    in useq 'μ' 6 f z'++main :: IO ()+main = overlapTextureU_pp (2,1,12,maxBound) blips_001 2 blips_pp
+ Sound/SC3/Graph/JMCC_blips_001_hp.hs view
@@ -0,0 +1,34 @@+-- blips 001 (jmcc) #SC3d1.5+{-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-}+module Sound.SC3.Graph.JMCC_blips_001_hp where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: UId m => UGen -> m UGen+rand2 n = randM (-n) n++blips_001 :: UId m => m UGen+blips_001 = do+  let c = #(randM 0 1) <* 0.8+  let b = do+        let f = xLine KR #(expRandM 0.25 400) #(expRandM 0.25 400) 4 DoNothing+        let nh = xLine KR #(expRandM 2 100) #(expRandM 2 100) 4 DoNothing+        return (blip AR f nh)+  return (c * pan2 (#(b) * #(b)) (line KR #(rand2 1) #(rand2 1) 4 DoNothing) 0.3)++{-+iter_m :: (Monad m, Num a, Ord a) => (b -> m b) -> a -> b -> m b+iter_m f n st = if n > 0 then iter_m f (n - 1) =<< f st else return st++postProcess :: UId m => UGen -> m UGen+postProcess z = do+  let z' = distort z+      f x = do+        return (allpassN x 0.05 (mce2 #(rand 0 0.05) #(rand 0 0.05)) 4)+  iter_m f 6 z'+-}++main :: IO ()+main = overlapTextureU (2,1,12,maxBound) =<< blips_001+
+ Sound/SC3/Graph/JMCC_blips_001_u.hs view
@@ -0,0 +1,34 @@+-- blips 001 (jmcc) #SC3d1.5+module Sound.SC3.Graph.JMCC_blips_001_u where++import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.UGen.Unsafe as U {- hsc3-unsafe -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: UGen -> UGen+rand2 n = U.rand (-n) n++-- ghci 7.6.3 doesn't see through this...+blip_001 :: t -> UGen+blip_001 _ =+    let f = xLine KR (U.expRand 0.25 400) (U.expRand 0.25 400) 4 DoNothing+        nh = xLine KR (U.expRand 2 100) (U.expRand 2 100) 4 DoNothing+    in blip AR f nh++blips_001 :: UGen+blips_001 =+    let c = U.rand 0 1 <* 0.8+        o = blip_001 'α' * blip_001 'β'+    in (c * pan2 o (line KR (rand2 1) (rand2 1) 4 DoNothing) 0.3)++iter :: (Num a, Ord a) => (t -> t) -> a -> t -> t+iter f n st = if n > 0 then iter f (n - 1) (f st) else st++postProcess :: UGen -> UGen+postProcess z =+    let z' = distort z+        f x = allpassN x 0.05 (mce2 (U.rand 0 0.05) (U.rand 0 0.05)) 4+    in iter f 6 z'++main :: IO ()+main = overlapTextureU_pp (2,1,12,maxBound) blips_001 2 postProcess
+ Sound/SC3/Graph/JMCC_bouncing_objects.hs view
@@ -0,0 +1,24 @@+-- bouncing objects (jmcc) #2+module Sound.SC3.Graph.JMCC_bouncing_objects where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}+import qualified Sound.SC3.Lang.Random.ID as R {- hsc3-lang -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}++bouncing_objects :: UGen+bouncing_objects =+  let imp_frq = xLine KR (5 + rand 'α' (-2) 2) 600 4 DoNothing+      imp_amp = xLine KR 0.09 0.000009 4 DoNothing+      imp = impulse AR imp_frq 0 * imp_amp+      exc = decay imp 0.001+      flt_frq = randN 4 'β' 400 8400+      flt_amp = randN 4 'γ' 0 1+      flt_rtm = randN 4 'δ' 0.01 0.11+      flt = klank exc 1 0 1 (klankSpec_mce flt_frq flt_amp flt_rtm)+      loc = pan2 flt (rand 'ε' (-1) 1) 1+      e = Envelope [1,1,0] [3,0.001] (replicate 2 EnvLin) Nothing Nothing+  in loc * envGen KR 1 1 0 1 RemoveSynth e++main :: IO ()+main = spawnTextureU (\i -> R.rrand i 0.6 1.6,maxBound) bouncing_objects
Sound/SC3/Graph/JMCC_bowed_string_m.hs view
@@ -1,20 +1,22 @@ -- bowed string (jmcc) module Sound.SC3.Graph.JMCC_bowed_string_m where +import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -} +-- > u <- bowed_string bowed_string :: UId m => m UGen bowed_string = do   let root = 5       scale = map (+ root) [0,2,4,5,7,9,11]       oct = [24,36,48,60,72,84]-  n0 <- clone 2 (brownNoise AR)-  r0 <- expRand 0.125 0.5-  r1 <- rand 0.7 0.9-  r2 <- sequence (replicate 12 (rand 1.0 3.0))-  f <- midiCPS `fmap` (lchoose scale .+. lchoose oct)-  n1 <- lfNoise1 KR r0+  n0 <- clone 2 (brownNoiseM AR)+  r0 <- expRandM 0.125 0.5+  r1 <- randM 0.7 0.9+  r2 <- sequence (replicate 12 (randM 1.0 3.0))+  f <- midiCPS `fmap` (lchooseM scale .+. lchooseM oct)+  n1 <- lfNoise1M KR r0   let x = n0 * 0.007 * max 0 (n1 * 0.6 + 0.4)       geom n i z = take n (iterate (* z) i)       iota n i z = take n (iterate (+ z) i)
Sound/SC3/Graph/JMCC_choip.hs view
@@ -1,9 +1,8 @@--- choip (jmcc)+-- choip (jmcc) #10 module Sound.SC3.Graph.JMCC_choip where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  xl :: ID a => a -> a -> UGen -> UGen -> UGen -> UGen@@ -17,7 +16,7 @@     let t = 12         i = impulse AR (xl 'α' 'β' 1 30 t) 0         f = xl 'γ' 'δ' 600 8000 t-        a = sinOsc AR (decay2 i 0.05 0.5 * (-0.9 * f) + f) 0+        a = sinOsc AR (decay2 i 0.05 0.5 * (-0.9) * f + f) 0         l = line KR (r2 'ε' 1) (r2 'ζ' 1) t DoNothing     in pan2 (decay2 (i * xl 'η' 'θ' 0.01 0.5 t) 0.01 0.2 * a) l 1 @@ -27,4 +26,4 @@     in useq 'κ' 4 f  main :: IO ()-main = overlapTextureU_pp (1,10,8,maxBound) choip 2 choip_pp+main = overlapTextureU_pp (10,1,8,maxBound) choip 2 choip_pp
Sound/SC3/Graph/JMCC_clustered_sines.hs view
@@ -1,8 +1,7 @@--- clustered sines (jmcc)+-- clustered sines (jmcc) #2 module Sound.SC3.Graph.JMCC_clustered_sines where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  -- > synthstat cs@@ -11,9 +10,9 @@     let n = 80         f1 = rand 'α' 100 1100         f2 = 4 * f1-        sp = let y = uclone' 'α' n (f1 + rand 'α' 0 f2)+        sp = let y = uclone' 'β' n (f1 + rand 'γ' 0 f2)              in klangSpec y (map (f1 /) y) (replicate n 0)-    in uclone 'α' 2 (klang AR 1 0 sp * (0.3 / fromIntegral n))+    in uclone 'δ' 2 (klang AR 1 0 sp * (0.3 / fromIntegral n))  main :: IO () main = xfadeTextureU (4,4,maxBound) cs
Sound/SC3/Graph/JMCC_clustered_sines_m.hs view
@@ -1,17 +1,17 @@--- clustered sines (jmcc)+-- clustered sines (jmcc) #2 module Sound.SC3.Graph.JMCC_clustered_sines_m where  import Control.Monad {- base -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  -- > fmap synthstat (clone 2 cs) cs :: UId m => m UGen cs = do   let n = 80-  f1 <- rand 100 1100+  f1 <- randM 100 1100   let f2 = 4 * f1-  y <- replicateM n (f1 +. rand 0 f2)+  y <- replicateM n (f1 +. randM 0 f2)   let sp = klangSpec y (map (f1 /) y) (replicate n 0)   return (klang AR 1 0 sp * (0.3 / fromIntegral n)) 
Sound/SC3/Graph/JMCC_comb_delay_sweeps.hs view
@@ -1,7 +1,7 @@--- comb delay sweeps (jmcc)+-- comb delay sweeps (jmcc) #6 module Sound.SC3.Graph.JMCC_comb_delay_sweeps where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -} import System.Random {- random -} @@ -15,7 +15,6 @@        ,foldToRange 50 120 (e + e')        ,g'') --- > Sound.SC3.UGen.Dot.draw (fst (cds (60,61,mkStdGen 3567824))) cds :: ST -> (UGen,ST) cds st =     let (s,e,g) = wander st@@ -24,7 +23,21 @@         d = 1 / midiCPS l         c = 1 / midiCPS (constant s)         o = combC w 0.01 d (c * 1000)-    in (pan2 o (rand 'α' (-1) 1) 1,(s,e,g))+    in (pan2 o (rand 'β' (-1) 1) 1,(s,e,g))  main :: IO () main = overlapTextureS (4/3,4/3,9,maxBound) cds (60,61,mkStdGen 3567824)++cds' :: UGen+cds' =+    let s = fold (rand 'α' (- 7) 8) 50 120+        e = fold (rand 'β' (- 7) 8) 50 120+        l = line KR s e 4 DoNothing+        w = whiteNoise 'γ' AR * 0.005+        d = 1 / midiCPS l+        c = 1 / midiCPS s+        o = combC w 0.01 d (c * 1000)+    in pan2 o (rand 'δ' (-1) 1) 1++main' :: IO ()+main' = overlapTextureU (4/3,4/3,9,maxBound) cds'
Sound/SC3/Graph/JMCC_contamination_zone.hs view
@@ -1,9 +1,8 @@--- contamination zone (jmcc)+-- contamination zone (jmcc) #9 module Sound.SC3.Graph.JMCC_contamination_zone where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  cz :: UGen@@ -20,6 +19,7 @@         a = lfPulse KR (linRand 'ι' 0 150 0) 0 (rand 'κ' 0.2 0.4)     in pan2 r (lfNoise1 'λ' KR (rand 'μ' 0 1)) a +-- > let g = cz_pp (silent 1) cz_pp :: UGen -> UGen cz_pp =     let f x = allpassN x 0.04 (randN 2 'ν' 0 0.04) 16
Sound/SC3/Graph/JMCC_coolant.hs view
@@ -1,8 +1,7 @@--- coolant (jmcc)+-- coolant (jmcc) #2 module Sound.SC3.Graph.JMCC_coolant where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  coolant :: UGen@@ -15,4 +14,4 @@     in klank s 1 0 1 (mceTranspose sp)  main :: IO ()-main = xfadeTextureU (4,4,maxBound) coolant+main = overlapTextureU (4,4,2,maxBound) coolant
Sound/SC3/Graph/JMCC_cymbalism_accelerando.hs view
@@ -1,7 +1,7 @@--- cymbalism accellerando (jmcc)+-- cymbalism accelerando (jmcc) #2 module Sound.SC3.Graph.JMCC_cymbalism_accelerando where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  enumFromN :: Enum a => a -> Int -> [Int]
Sound/SC3/Graph/JMCC_cymbalism_m.hs view
@@ -1,20 +1,21 @@--- cymbalism (jmcc)+-- cymbalism (jmcc) #2 module Sound.SC3.Graph.JMCC_cymbalism_m where  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} +-- > g <- cymbalism cymbalism :: (Functor m,UId m) => m UGen cymbalism = do   let p = replicate 15-  f1 <- rand 500 2500-  f2 <- rand 0 8000-  let y = do f <- sequence (p (rand f1 (f1 + f2)))-             rt <- sequence (p (rand 1 5))+  f1 <- randM 500 2500+  f2 <- randM 0 8000+  let y = do f <- sequence (p (randM f1 (f1 + f2)))+             rt <- sequence (p (randM 1 5))              return (klankSpec f (p 1) rt)   z <- clone 2 y-  n <- fmap (* 0.03) (whiteNoise AR)-  tf <- rand 0.5 3.5+  n <- fmap (* 0.03) (whiteNoiseM AR)+  tf <- randM 0.5 3.5   let t = impulse AR tf 0       s = decay t 0.004 * n   return (klank s 1 0 1 (mceTranspose z))
Sound/SC3/Graph/JMCC_data_space.hs view
@@ -1,7 +1,7 @@--- data space (jmcc)+-- data space (jmcc) #2 module Sound.SC3.Graph.JMCC_data_space where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  data_space :: UGen
Sound/SC3/Graph/JMCC_data_space_hp.hs view
@@ -1,13 +1,13 @@--- data space (jmcc)+-- data space (jmcc) #2 {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_data_space_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  data_space :: UId m => m UGen data_space = do-    let r = rand 0+    let r = randM 0     let p0 = lfPulse KR #(r 200) 0 #(r 1)     p1 <- lfPulse KR #(r 40) 0 #(r 1) *. r 8000 .+. r 2000     let p2 = lfPulse KR #(r 20) 0 #(r 1)@@ -15,9 +15,9 @@     let p4 = lfPulse KR #(r 20) 0 #(r 1)     p5 <- lfPulse KR #(r 4) 0 #(r 1) *. r 8000 .+. r 2000     let f = p0 * p1 + p2 * p3 + p4 * p5-    dt <- rand 0.15 0.35+    dt <- randM 0.15 0.35     let o = lfPulse AR f 0 0.5 * 0.04-    l <- lfNoise0 KR #(r 3) .* 0.8+    l <- lfNoise0M KR #(r 3) .* 0.8     return (combL (pan2 o l 1) dt dt 3)  main :: IO ()
Sound/SC3/Graph/JMCC_deep_trip.hs view
@@ -1,8 +1,8 @@--- deep trip (jmcc)+-- deep trip (jmcc) #9 module Sound.SC3.Graph.JMCC_deep_trip where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.External.RDU.ID  {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU  {- sc3-rdu -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  deep_trip :: UGen
Sound/SC3/Graph/JMCC_default.hs view
@@ -1,18 +1,18 @@ -- default (jmcc) module Sound.SC3.Graph.JMCC_default where -import Data.Default {- data-default -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.List as L {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -} -pattern :: [P_Bind]+pattern :: (Synthdef,P.Param) pattern =-    [(K_instr,psynth def)-    ,(K_note,pxrand 'α' [0,1,5,7,9] inf)-    ,(K_octave,prand 'β' [3,4,5,6] inf)-    ,(K_dur,pwrand 'γ' [0.1,0.2,0.4] [0.5,0.4,0.1] inf)-    ,(K_amp,pbrown 'δ' 0.01 0.2 0.01 inf)-    ,(K_param "pan",pbrown 'ε' (-1) 1 0.25 inf)]+    let to_cps = P.degree_to_cps' [0,2,4,5,7,9,11] 12+    in (defaultSynthdef+       ,[("freq",to_cps (P.xrand 'α' [0,1,5,7,9]) (P.rand 'β' [2,3,4,5,6]))+        ,("dur",P.wrand 'γ' [0.1,0.2,0.4] [0.5,0.4,0.1])+        ,("amp",L.brown 'δ' 0.01 0.2 0.01)+        ,("pan",L.brown 'ε' (-1) 1 0.25)])  main :: IO ()-main = audition (pbind pattern)+main = audition (P.sbind1 pattern)
Sound/SC3/Graph/JMCC_demanding_studies.hs view
@@ -1,7 +1,7 @@ -- demanding studies (jmcc) module Sound.SC3.Graph.JMCC_demanding_studies where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  demanding_studies :: UGen demanding_studies =
+ Sound/SC3/Graph/JMCC_distort_input.hs view
@@ -0,0 +1,12 @@+-- distort input (jmcc) #5+module Sound.SC3.Graph.JMCC_distort_input where++import Sound.SC3 {- hsc3 -}++distort_input :: UGen+distort_input =+    let gain = mouseX KR 1 100 Exponential 0.2  -- mouse x controls gain into distortion+    in distort (soundIn (mce2 0 1) * gain) * 0.4++main :: IO ()+main = audition (out 0 distort_input)
Sound/SC3/Graph/JMCC_doppler.hs view
@@ -23,9 +23,14 @@     let t = line KR (-pi/2) (pi * 3/2) dt RemoveSynth     in (a * cos t,b * sin t) +src :: UGen+src = rlpf (fSinOsc AR 200 0 * lfPulse AR 31.3 0 0.4) 400 0.3++d1 :: UGen+d1 = doppler (line_x 10 100 6) src++d2 :: UGen+d2 = doppler (ellipse 10 75 12) src+ main :: IO ()-main = do-  let s = rlpf (fSinOsc AR 200 0 * lfPulse AR 31.3 0 0.4) 400 0.3-  withSC3 (do play (out 0 (doppler (line_x 10 100 6) s))-              wait 8-              play (out 0 (doppler (ellipse 10 75 12) s)))+main = withSC3 (play (out 0 d1) >> wait 8 >> play (out 0 d2))
+ Sound/SC3/Graph/JMCC_drone_plus_rhythm.hs view
@@ -0,0 +1,51 @@+-- drone plus rhythm (jmcc) #12+module Sound.SC3.Graph.JMCC_drone_plus_rhythm where++import Control.Concurrent {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++scale :: Num a => [a]+scale = [0, 2, 3, 5, 7, 9, 10]++rand2 :: ID a => a -> UGen -> UGen+rand2 z n = rand z (negate n) n++drone_1 :: UGen+drone_1 =+    let f0 = midiCPS (lchoose 'α' [24,36] + rand2 'β' 0.08)+        f1 = lfSaw AR (mce2 f0 (f0 + 0.2)) 0 * lfNoise2 'γ' KR (f0 * mce2 0.05 0.04) * 0.06+    in lpf f1 (rand 'δ' 1000 3000)++drone_1_txt :: IO ()+drone_1_txt = overlapTextureU (4,4,8,maxBound) drone_1++drone_2 :: UGen+drone_2 =+    let x = rand 'ε' 0 1 >* 0.8+        m = lchoose 'ζ' [60,72] + lchoose 'η' scale + uclone 'θ' 2 (rand2 'ι' 0.05)+    in sinOsc AR (midiCPS m) 0 * x * rand 'κ' 0.04 0.07++drone_2_txt :: IO ()+drone_2_txt = overlapTextureU (4,6,3,maxBound) drone_2++iseqr :: ID a => a -> [UGen] -> UGen -> UGen+iseqr z s tr = tr * demand tr 0 (dxrand z dinf (mce s))++rhy :: UGen+rhy =+    let m = lchoose 'λ' [48, 60, 72, 84] + lchoose 'μ' scale + uclone 'ν' 2 (rand2 'ξ' 0.03)+        sq = iseqr 'ο' [0,1,0,1,1,0] (impulse AR (lchoose 'π' [1.5,3,6]) 0)+        sg = lfPulse AR (midiCPS m) 0 0.4 * rand 'ρ' 0.03 0.08+    in rlpf (decay2 sq 0.004 (rand 'σ' 0.2 0.7) * sg) (expRand 'τ' 800 2000) 0.1++pp :: UGen -> UGen+pp z = combN z 0.5 0.5 6 + mceReverse z++rhy_txt :: IO ()+rhy_txt = overlapTextureU_pp (6,6,6,maxBound) rhy 2 pp++main = do+  forkIO drone_1_txt+  forkIO drone_2_txt+  forkIO rhy_txt
Sound/SC3/Graph/JMCC_early_space_music_lp_side_two.hs view
@@ -1,10 +1,10 @@--- early space music LP, side 2 (jmcc)+-- early space music LP, side 2 (jmcc) #12 module Sound.SC3.Graph.JMCC_early_space_music_lp_side_two where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Random.Gen as R {- hsc3-lang -} import Sound.SC3.Lang.Control.OverlapTexture-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} import qualified System.Random as R {- random -}  m1 :: UGen@@ -29,29 +29,30 @@     let f = midiCPS (rand 'λ' 60 100)     in fSinOsc AR (mce2 f (f + 0.2)) 0 * lfNoise2 'μ' KR (f * mce2 0.15 0.16) * 0.1 +id_seq :: Enum a => a -> Int -> [Int]+id_seq c n = let c' = fromEnum c in [c' .. c' + n - 1]+ -- audition (out 0 m4) m4 :: UGen m4 =     let a = lfPulse KR (expRand 'ν' 0.2 1.2) 0 (rand 'ξ' 0.1 0.2)-        o i = let r = let (p,q) = mce2c (expRandN 2 i 0.1 20)+        o z = let i = constant z+                  r = let (p,q) = mce2c (expRandN 2 z 0.1 20)                       in xLine KR p q 25.6 DoNothing-                  f = midiCPS (rand i 24 96)-                  e = max 0 (sinOsc KR (r * rand i 0.9 1.1) (rand i 0 (2 * pi)) * 0.1 - 0.05)+                  f = midiCPS (rand z 24 96)+                  e = max 0 (sinOsc KR (r * rand z 0.9 1.1) (rand z 0 (2 * pi)) * 0.1 - 0.05)                   s = fSinOsc AR (f * i + f) 0 * e * (1 / (i + 1))-              in pan2 s (rand i (-1) 1) 1-    in sum (map o [0..11]) * a+              in pan2 s (rand z (-1) 1) 1+    in sum (map o (id_seq 0 12)) * a  -- audition (out 0 (m6 * 0.5)) m6 :: UGen m6 =-    let f = midiCPS (lfNoise1 'ο' KR (rand 'π' 0 0.3) * 60 + 70)-        a0 = lfNoise2 'ρ' AR (f * rand 'σ' 0 0.5)-        a1 = max 0 (lfNoise1 'τ' KR (rand 'υ' 0 8) * sinOsc KR (rand 'φ' 0 40) 0 * 0.1)+    let f = midiCPS (lfNoise1 'π' KR (rand 'ρ' 0 0.3) * 60 + 70)+        a0 = lfNoise2 'σ' AR (f * rand 'τ' 0 0.5)+        a1 = max 0 (lfNoise1 'υ' KR (rand 'φ' 0 8) * sinOsc KR (rand 'χ' 0 40) 0 * 0.1)         z = sinOsc AR f 0 * a0 * a1-    in pan2 z (lfNoise1 'χ' KR (rand 'ψ' 0 5)) 1--enumFromN :: Enum a => a -> Int -> [Int]-enumFromN e i = let j = fromEnum e in [j .. j + i]+    in pan2 z (lfNoise1 'ψ' KR (rand 'ω' 0 5)) 1  -- audition (out 0 m7) m7 :: UGen@@ -60,9 +61,9 @@         k = let y z = let fr = mceChannels (expRandN p z 100 6000)                           rt = mceChannels (randN p z 2 6)                       in klankSpec fr (replicate p 1) rt-            in mce2 (y 'ω') (y 'Α')-        f = xLine KR (expRand 'Β' 40 300) (expRand 'Γ' 40 300) 12 DoNothing-        t = lfPulse AR f 0 (rand 'Δ' 0.1 0.9) * 0.002 * max 0 (lfNoise2 'Ε' KR (rand 'Ζ' 0 8))+            in mce2 (y 'Α') (y 'Β')+        f = xLine KR (expRand 'Γ' 40 300) (expRand 'Δ' 40 300) 12 DoNothing+        t = lfPulse AR f 0 (rand 'Ε' 0.1 0.9) * 0.002 * max 0 (lfNoise2 'Ζ' KR (rand 'Η' 0 8))     in distort (klank t 1 0 1 (mceTranspose k)) * 0.3  esmlp2 :: R.RandomGen g => g -> (UGen, g)@@ -72,7 +73,7 @@ esmlp2_pp :: UGen -> UGen esmlp2_pp i =     let c z = combN i 0.3 (mce2 (rand z 0.1 0.3) (rand z 0.12 0.32)) 8-    in sum (map c ['Η'..'Θ']) * 0.3+    in sum (map c (id_seq 'Θ' 5)) * 0.3  main :: IO () main = do
+ Sound/SC3/Graph/JMCC_filter_input.hs view
@@ -0,0 +1,14 @@+-- filter input (jmcc) #5+module Sound.SC3.Graph.JMCC_filter_input where++import Sound.SC3 {- hsc3 -}++filter_input :: UGen+filter_input =+    let rQ = mouseY KR 0.01 1 Exponential 0.2 -- bandwidth ratio = 1/Q+        cf = mouseX KR 100 12000 Exponential 0.2 -- mouse x controls cutoff freq+        sg = soundIn (mce2 0 1) * 0.4 * sqrt rQ -- attenuate to offset resonance+    in rlpf sg cf rQ++main :: IO ()+main = audition (out 0 filter_input)
+ Sound/SC3/Graph/JMCC_hard_sync_sawtooth_with_lfo.hs view
@@ -0,0 +1,17 @@+-- hard sync sawtooth with lfo (jmcc) #6+module Sound.SC3.Graph.JMCC_hard_sync_sawtooth_with_lfo where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++hsswl :: UGen+hsswl =+    let f = midiCPS (30 + iRand 'α' 0 50)+        o = sinOsc KR 0.2 (mce [0, rand 'β' 0 (2 * pi)]) * (2 * f) + (3 * f)+    in syncSaw AR (mce [f, f + 0.2]) o * 0.05++pp :: UGen -> UGen+pp z = combN z 0.3 0.3 4 + mceReverse z++main :: IO ()+main = overlapTextureU_pp (4,4,4,maxBound) hsswl 2 pp
Sound/SC3/Graph/JMCC_harmonic_swimming.hs view
@@ -1,8 +1,8 @@--- harmonic swimming (jmcc)+-- harmonic swimming (jmcc) #1 module Sound.SC3.Graph.JMCC_harmonic_swimming where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  harmonic_swimming :: UGen harmonic_swimming =
Sound/SC3/Graph/JMCC_harmonic_swimming_m.hs view
@@ -1,7 +1,7 @@--- harmonic swimming (jmcc)+-- harmonic swimming (jmcc) #1 module Sound.SC3.Graph.JMCC_harmonic_swimming_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  harmonic_swimming :: UId m => m UGen harmonic_swimming =@@ -9,8 +9,8 @@         f = 50         p = 20         l = line KR 0 (- a) 60 DoNothing-        o h = do r <- clone 2 (rand 2 8)-                 n <- lfNoise1 KR r+        o h = do r <- clone 2 (randM 2 8)+                 n <- lfNoise1M KR r                  let e = max 0 (n * a + l)                  return (fSinOsc AR (f * (h + 1)) 0 * e)     in fmap sum (mapM o [0..p])
+ Sound/SC3/Graph/JMCC_harmonic_tumbling.hs view
@@ -0,0 +1,18 @@+-- harmonic tumbling (jmcc) #1+module Sound.SC3.Graph.JMCC_harmonic_tumbling where++import Sound.SC3 {- hsc3 -}++harmonic_tumbling :: UGen+harmonic_tumbling =+  let f = 80+      p = 10::Int+      t = xLine KR (mce2 10 11) 0.1 60 DoNothing+      o h = let n = dust h KR t+                r = rand h 0.25 0.5+                e = decay2 (n * 0.02) 0.005 r+            in fSinOsc AR (f * (fromIntegral h + 1)) 0 * e+  in sum (map o [0..p])++main :: IO ()+main = audition (out 0 harmonic_tumbling)
Sound/SC3/Graph/JMCC_harmonic_tumbling_m.hs view
@@ -1,15 +1,15 @@--- harmonic tumbling (jmcc)+-- harmonic tumbling (jmcc) #1 module Sound.SC3.Graph.JMCC_harmonic_tumbling_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  harmonic_tumbling :: UId m => m UGen harmonic_tumbling = do   let f = 80       p = 10       t = xLine KR (mce2 10 11) 0.1 60 DoNothing-      o h = do n <- dust KR t-               r <- rand 0 0.5+      o h = do n <- dustM KR t+               r <- randM 0 0.5                let e = decay2 (n * 0.02) 0.005 r                return (fSinOsc AR (f * (h + 1)) 0 * e)   fmap sum (mapM o [0..p])
Sound/SC3/Graph/JMCC_hell_is_busy.hs view
@@ -1,13 +1,13 @@--- hell is busy (jmcc)+-- hell is busy (jmcc) #1 module Sound.SC3.Graph.JMCC_hell_is_busy where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  hib :: UGen hib =     let o = fSinOsc AR (400 + rand 'α' 0 2000) 0-        a = lfPulse KR (1 + rand 'β' 0 10.0) (rand 'γ' 0 0.7) 0.04+        a = lfPulse KR (1 + rand 'β' 0 10.0) 0 (rand 'γ' 0 0.7) * 0.04     in pan2 (o * a) (rand 'δ' (-1) 1) 1  main :: IO ()
+ Sound/SC3/Graph/JMCC_impulse_sequencer.hs view
@@ -0,0 +1,28 @@+-- impulse sequencer (jmcc) SC2+module Sound.SC3.Graph.JMCC_impulse_sequencer where++import Sound.SC3 {- hsc3 -}++isequ :: ID i => i -> [UGen] -> UGen -> UGen+isequ z s tr = tr * demand tr 0 (dseq z dinf (mce s))++impulse_sequencer :: UGen+impulse_sequencer =+    let -- single sample impulse as trigger+        t = impulse AR 8 0+        -- clave rhythm+        c_sq = isequ 'α' [1,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0] t+        c = decay2 c_sq 0.001 0.3 * fSinOsc AR 1700 0 * 0.1+        -- dee dee dee dee dee+        d_sq = isequ 'β' [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0] t+        d = decay2 d_sq 0.001 0.3 * fSinOsc AR 2400 0 * 0.04+        -- noise drum+        n_sq = isequ 'γ' [1.0, 0.1, 0.1, 1.0, 0.1, 1.0, 0.1, 0.1] t+        n = decay2 n_sq 0.001 0.25 * brownNoise 'δ' AR * 0.1+        -- bass drum+        b_sq = isequ 'ε' [1,0,0.2,0,0.2,0,0.2,0] t+        b = decay2 b_sq 0.001 0.5 * fSinOsc AR 100 0 * 0.2+    in c + d + n + b++main :: IO ()+main = audition (out 0 impulse_sequencer)
+ Sound/SC3/Graph/JMCC_landon_rose.hs view
@@ -0,0 +1,28 @@+-- landon rose (jmcc) #8+module Sound.SC3.Graph.JMCC_landon_rose where++import Sound.SC3 {- hsc3 -}++nt :: Num n => [[n]]+nt = [[32,43,54, 89]+     ,[10,34,80,120]+     ,[67,88,90,100]+     ,[76,88,99,124]]++fr :: Floating n => [[n]]+fr = map (map midiCPS') nt++nd :: ID a => a -> UGen -> [UGen] -> UGen+nd z e f =+    let p = klankSpec f (replicate 4 1) (replicate 4 3)+        x = e * pinkNoise z AR * mce2 0.0011 0.0012+    in klank x 1 0 1 p++env :: Real n => n -> UGen+env i = abs (sinOsc AR (1 / 8) ((constant i / 2) * pi))++lr :: UGen+lr = sum (zipWith3 nd "αβγδ" (map env [0 .. 3]) fr)++main :: IO ()+main = audition (out 0 lr)
Sound/SC3/Graph/JMCC_lfo_modulation.hs view
@@ -1,11 +1,14 @@--- lfo modulation (jmcc)+-- lfo modulation (jmcc) #1 module Sound.SC3.Graph.JMCC_lfo_modulation where  import Sound.SC3 {- hsc3 -} -main :: IO ()-main =+lfo_modulation :: UGen+lfo_modulation =   let o = fSinOsc KR 0.05 0 * 80 + 160       p = fSinOsc KR (mce2 0.6 0.7) 0 * 3600 + 4000       s = rlpf (lfPulse AR o 0 0.4 * 0.05) p 0.2-  in audition (out 0 (combL s 0.3 (mce2 0.2 0.25) 2))+  in combL s 0.3 (mce2 0.2 0.25) 2++main :: IO ()+main = audition (out 0 lfo_modulation)
+ Sound/SC3/Graph/JMCC_metal_plate.hs view
@@ -0,0 +1,32 @@+-- metal plate (jmcc) #4+module Sound.SC3.Graph.JMCC_metal_plate where++import Sound.SC3 {- hsc3 -}++mp :: UGen+mp =+    let+        sr = 48000+        -- number of delay lines+        n = 4+        -- maximum delay time+        maxdt = ceiling (sr * 0.03)+        -- allocate buffers for delay lines+        buf = map (\k -> asLocalBuf k (replicate maxdt 0)) [0 .. n - 1]+        -- assign random tap times+        tap_tm = uclone' 'a' n (rand 'a' 0.015 0.03)+        -- excitation+        exc_freq = mouseY KR 10 8000 Linear 0.2+        exc_trig = impulse AR 0.5 0 * 0.2+        exc = decay2 exc_trig 0.01 0.2 * lfNoise2 'a' AR exc_freq+        -- tap the delay lines+        del = zipWith (tap 1) buf tap_tm+        -- filter the taps+        flt_freq = mouseX KR 10 5000 Linear 0.2+        flt = map (\i -> lpf i flt_freq * 0.98) del+        -- write to delay lines+        wr = zipWith (\b f -> recordBuf AR b 0 1 0 1 Loop 1 DoNothing (f + exc)) buf flt+    in mrg (sum flt : wr)++main :: IO ()+main = audition (out 0 mp)
Sound/SC3/Graph/JMCC_modal_space.hs view
@@ -1,31 +1,23 @@--- modal space (jmcc)+-- modal space, using local buffer (jmcc) #8 module Sound.SC3.Graph.JMCC_modal_space where -import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -}  ms :: UGen -> UGen -> UGen ms n r =-    let x = mouseX KR 0 15 Linear 0.1-        k = degreeToKey 0 x 12+    let b = asLocalBuf 'α' [0,2,3.2,5,7,9,10] -- dorian scale+        x = mouseX KR 0 15 Linear 0.1 -- mouse indexes into scale+        k = degreeToKey b x 12 -- 12 notes per octave         o = sinOsc AR (midiCPS (r + k + n * 0.04)) 0 * 0.1-        t = lfPulse AR (midiCPS (mce2 48 55)) 0.15 0.5+        t = lfPulse AR (midiCPS (mce2 48 55)) 0 0.15         f = midiCPS (sinOsc KR 0.1 0 * 10 + r)         d = rlpf t f 0.1 * 0.1         m = o + d     in combN m 0.31 0.31 2 + m  modal_space :: UGen-modal_space =-    let n = uclone 'α' 2 (lfNoise1 'β' KR 3)-    in (ms n 48 + ms n 72) * 0.25--run :: Transport m => m ()-run = do-  let p = [0,2,3.2,5,7,9,10]-  _ <- async (b_alloc_setn1 0 0 p)-  play (out 0 modal_space)+modal_space = (ms (lfNoise1 'β' KR 3) 48 + ms (lfNoise1 'γ' KR 3) 72) * 0.25  main :: IO ()-main = withSC3 run+main = audition (out 0 modal_space)+
+ Sound/SC3/Graph/JMCC_modal_space_buf.hs view
@@ -0,0 +1,30 @@+-- modal space (jmcc) #8+module Sound.SC3.Graph.JMCC_modal_space_buf where++import Sound.OSC {- hosc -}+import Sound.SC3 {- hsc3 -}++ms :: UGen -> UGen -> UGen+ms n r =+    let x = mouseX KR 0 15 Linear 0.1+        k = degreeToKey 0 x 12+        o = sinOsc AR (midiCPS (r + k + n * 0.04)) 0 * 0.1+        t = lfPulse AR (midiCPS (mce2 48 55)) 0 0.15+        f = midiCPS (sinOsc KR 0.1 0 * 10 + r)+        d = rlpf t f 0.1 * 0.1+        m = o + d+    in combN m 0.31 0.31 2 + m++modal_space :: UGen+modal_space =+    let n = uclone 'α' 2 (lfNoise1 'β' KR 3)+    in (ms n 48 + ms n 72) * 0.25++run :: Transport m => m ()+run = do+  let p = [0,2,3.2,5,7,9,10]+  _ <- async (b_alloc_setn1 0 0 p)+  play (out 0 modal_space)++main :: IO ()+main = withSC3 run
Sound/SC3/Graph/JMCC_moto_rev.hs view
@@ -1,4 +1,4 @@--- moto rev (jmcc)+-- moto rev (jmcc) #1 module Sound.SC3.Graph.JMCC_moto_rev where  import Sound.SC3 {- hsc3 -}
Sound/SC3/Graph/JMCC_mridangam.hs view
@@ -1,62 +1,66 @@--- mridangam (jmcc)+-- mridangam (jmcc) #SPE3 module Sound.SC3.Graph.JMCC_mridangam where  import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Bind as P {- hsc3-lang -}+import qualified Sound.SC3.Lang.Random.ID as R {- hsc3-lang -} -spe3_mridangam :: Synthdef-spe3_mridangam =-    let t_amp = tr_control "t_amp" 1+mridangam :: UGen+mridangam =+    let a = tr_control "amp" 1         n = whiteNoise 'α' AR * 70-        e = decay2 t_amp 0.002 0.1-        o = distort (resonz (n * e) (midiCPS 60) 0.02 * 4) * 0.4-    in synthdef "mridangam" (out 0 o)+        e = decay2 a 0.002 0.1+    in distort (resonz (n * e) (midiCPS 60) 0.02 * 4) * 0.4 -spe3_drone :: Synthdef-spe3_drone =+drone :: UGen+drone =     let s1 = saw AR (midiCPS (mce2 60 60.04))         s2 = saw AR (midiCPS (mce2 67 67.04))-        o = lpf (s1 + s2) (midiCPS 108) * 0.007-    in synthdef "drone" (out 0 o)+    in lpf (s1 + s2) (midiCPS 108) * 0.007 -p :: Fractional n => [P n]-p =-    [pseq [0.0] 10+lseq :: [a] -> Int -> [a]+lseq l n = concat (replicate n l)++lrand :: Enum e => e -> [[a]] -> Int -> [a]+lrand e l n = concat (R.nchoose e n l)++a_seq :: Fractional n => Char -> [[n]]+a_seq e =+    [lseq [0.0] 10     -- intro-    ,pseq [0.9,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] 2-    ,pseq [0.9,0.0,0.0,0.2,0.0,0.0,0.0,0.2,0.0,0.0] 2-    ,pseq [0.9,0.0,0.0,0.2,0.0,0.2,0.0,0.2,0.0,0.0] 2-    ,pseq [0.9,0.0,0.0,0.2,0.0,0.0,0.0,0.2,0.0,0.2] 2+    ,lseq [0.9,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] 2+    ,lseq [0.9,0.0,0.0,0.2,0.0,0.0,0.0,0.2,0.0,0.0] 2+    ,lseq [0.9,0.0,0.0,0.2,0.0,0.2,0.0,0.2,0.0,0.0] 2+    ,lseq [0.9,0.0,0.0,0.2,0.0,0.0,0.0,0.2,0.0,0.2] 2     -- solo-    ,prand 'β' [pseq [0.9,0.0,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.0] 1-               ,pseq [0.9,0.2,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.0] 1-               ,pseq [0.9,0.0,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.2] 1-               ,pseq [0.9,0.0,0.0,0.7,0.2,0.2,0.0,0.7,0.0,0.0] 1-               ,pseq [0.9,0.0,0.0,0.7,0.0,0.2,0.2,0.7,0.2,0.0] 1-               ,pseq [0.9,0.2,0.2,0.7,0.2,0.2,0.2,0.7,0.2,0.2] 1-               ,pseq [0.9,0.2,0.2,0.7,0.2,0.2,0.2,0.7,0.0,0.0] 1-               ,pseq [0.9,0.0,0.0,0.7,0.2,0.2,0.2,0.7,0.0,0.0] 1-               ,pseq [0.9,0.0,0.4,0.0,0.4,0.0,0.4,0.0,0.4,0.0] 1-               ,pseq [0.9,0.0,0.0,0.4,0.0,0.0,0.4,0.2,0.4,0.2] 1-               ,pseq [0.9,0.0,0.2,0.7,0.0,0.2,0.0,0.7,0.0,0.0] 1-               ,pseq [0.9,0.0,0.0,0.7,0.0,0.0,0.0,0.7,0.0,0.0] 1-               ,pseq [0.9,0.7,0.7,0.0,0.0,0.2,0.2,0.2,0.0,0.0] 1-               ,pseq [0.9,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] 1] 30+    ,lrand e [[0.9,0.0,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.0]+             ,[0.9,0.2,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.0]+             ,[0.9,0.0,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.2]+             ,[0.9,0.0,0.0,0.7,0.2,0.2,0.0,0.7,0.0,0.0]+             ,[0.9,0.0,0.0,0.7,0.0,0.2,0.2,0.7,0.2,0.0]+             ,[0.9,0.2,0.2,0.7,0.2,0.2,0.2,0.7,0.2,0.2]+             ,[0.9,0.2,0.2,0.7,0.2,0.2,0.2,0.7,0.0,0.0]+             ,[0.9,0.0,0.0,0.7,0.2,0.2,0.2,0.7,0.0,0.0]+             ,[0.9,0.0,0.4,0.0,0.4,0.0,0.4,0.0,0.4,0.0]+             ,[0.9,0.0,0.0,0.4,0.0,0.0,0.4,0.2,0.4,0.2]+             ,[0.9,0.0,0.2,0.7,0.0,0.2,0.0,0.7,0.0,0.0]+             ,[0.9,0.0,0.0,0.7,0.0,0.0,0.0,0.7,0.0,0.0]+             ,[0.9,0.7,0.7,0.0,0.0,0.2,0.2,0.2,0.0,0.0]+             ,[0.9,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]] 30     -- tehai-    ,pseq [2.0,0.0,0.2,0.5,0.0,0.2,0.9+    ,lseq [2.0,0.0,0.2,0.5,0.0,0.2,0.9           ,1.5,0.0,0.2,0.5,0.0,0.2,0.9           ,1.5,0.0,0.2,0.5,0.0,0.2] 3     -- sam-    ,pseq [5] 1]+    ,[5.0]]  act :: Transport m => m () act = do-  play spe3_drone-  _ <- async (d_recv spe3_mridangam)-  let i = Instr_Def spe3_mridangam False-  play (pmono [(K_instr,pinstr' i),(K_id,100)-              ,(K_param "t_amp",pseq p 1),(K_dur,1/8)])+  play (out 0 drone)+  let sy = synthdef "mridangam" (out 0 mridangam)+      a = concat (a_seq 'α')+  play (P.nbind1 (sy,100,[("amp",a),("dur",repeat (1/8))]))  main :: IO () main = withSC3 act
+ Sound/SC3/Graph/JMCC_mridangam_dr.hs view
@@ -0,0 +1,67 @@+-- mridangam (jmcc) #SPE3+module Sound.SC3.Graph.JMCC_mridangam_dr where++import Sound.OSC {- hosc -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Bind as P {- hsc3-lang -}+import qualified Sound.SC3.Lang.Random.ID as R {- hsc3-lang -}++-- > let g = drum (dust 'α' AR 1)+-- > audition (out 0 g)+drum :: UGen -> UGen+drum a =+    let n = whiteNoise 'α' AR * 70+        e = decay2 a 0.002 0.1+    in distort (resonz (n * e) (midiCPS 60) 0.02 * 4) * 0.4++drone :: UGen+drone =+    let s1 = saw AR (midiCPS (mce2 60 60.04))+        s2 = saw AR (midiCPS (mce2 67 67.04))+    in lpf (s1 + s2) (midiCPS 108) * 0.007++lseq :: [Double] -> UGen -> UGen+lseq l n = dseq 'β' n (mce (map constant l))++lrand :: [[Double]] -> UGen -> UGen+lrand l n = drand 'γ' n (mce (map (flip lseq 1) l))++a_solo :: UGen+a_solo =+    lrand [[0.9,0.0,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.0]+          ,[0.9,0.2,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.0]+          ,[0.9,0.0,0.0,0.7,0.0,0.2,0.0,0.7,0.0,0.2]+          ,[0.9,0.0,0.0,0.7,0.2,0.2,0.0,0.7,0.0,0.0]+          ,[0.9,0.0,0.0,0.7,0.0,0.2,0.2,0.7,0.2,0.0]+          ,[0.9,0.2,0.2,0.7,0.2,0.2,0.2,0.7,0.2,0.2]+          ,[0.9,0.2,0.2,0.7,0.2,0.2,0.2,0.7,0.0,0.0]+          ,[0.9,0.0,0.0,0.7,0.2,0.2,0.2,0.7,0.0,0.0]+          ,[0.9,0.0,0.4,0.0,0.4,0.0,0.4,0.0,0.4,0.0]+          ,[0.9,0.0,0.0,0.4,0.0,0.0,0.4,0.2,0.4,0.2]+          ,[0.9,0.0,0.2,0.7,0.0,0.2,0.0,0.7,0.0,0.0]+          ,[0.9,0.0,0.0,0.7,0.0,0.0,0.0,0.7,0.0,0.0]+          ,[0.9,0.7,0.7,0.0,0.0,0.2,0.2,0.2,0.0,0.0]+          ,[0.9,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]] 30++a_seq :: [UGen]+a_seq =+    [lseq [0.0] 10+    -- intro+    ,lseq [0.9,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] 2+    ,lseq [0.9,0.0,0.0,0.2,0.0,0.0,0.0,0.2,0.0,0.0] 2+    ,lseq [0.9,0.0,0.0,0.2,0.0,0.2,0.0,0.2,0.0,0.0] 2+    ,lseq [0.9,0.0,0.0,0.2,0.0,0.0,0.0,0.2,0.0,0.2] 2+    -- solo+    ,a_solo+    -- tehai+    ,lseq [2.0,0.0,0.2,0.5,0.0,0.2,0.9+          ,1.5,0.0,0.2,0.5,0.0,0.2,0.9+          ,1.5,0.0,0.2,0.5,0.0,0.2] 3+    -- sam+    ,lseq [5.0] 1]++mridangam :: UGen+mridangam = drum (tDuty AR (1 / 8) 0 DoNothing (dseq 'δ' 1 (mce a_seq)) 0) + drone++main :: IO ()+main = audition (out 0 mridangam)
+ Sound/SC3/Graph/JMCC_narrow_band_filtered_crackle_noise.hs view
@@ -0,0 +1,20 @@+-- narrow band filtered crackle noise (jmcc) #2+module Sound.SC3.Graph.JMCC_narrow_band_filtered_crackle_noise where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: ID a => a -> UGen -> UGen+rand2 e n = rand e (- n) n++nbfcn :: UGen+nbfcn =+    let e = envLinen 2 5 2 1+        rf1 = rand 'α' 0 2000 + 80+        rf2 = rf1 + (rand2 'β' 0.2 * rf1)+        rf = xLine KR rf1 rf2 9 DoNothing+        c = crackle AR 1.97 + rand 'γ' 0 0.03 * 0.15+    in pan2 (resonz c rf 0.2) (rand2 'δ' 1) (envGen AR 1 1 0 1 RemoveSynth e)++main :: IO ()+main = spawnTextureU (const 2,maxBound) nbfcn
Sound/SC3/Graph/JMCC_noise_burst_sweep.hs view
@@ -1,8 +1,7 @@--- noise burst sweep (jmcc)+-- noise burst sweep (jmcc) #6 module Sound.SC3.Graph.JMCC_noise_burst_sweep where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  nbs :: ID a => a -> UGen@@ -18,5 +17,6 @@ main = overlapTextureU (4,2,4,maxBound) (nbs 'α')  {--audition (out 0 (nbs 'α'))+let g = nbs 'α'+audition (out 0 g) -}
+ Sound/SC3/Graph/JMCC_noise_modulated_sawtooths.hs view
@@ -0,0 +1,18 @@+-- noise modulated sawtooths (jmcc) #6+module Sound.SC3.Graph.JMCC_noise_modulated_sawtooths where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++nms :: UGen+nms =+    let f = midiCPS (rand 'α' 60 100)+        o = lfSaw AR (mce2 f (f + 0.2)) 0+        a = lfNoise2 'β' KR (f * mce2 0.15 0.16) * 0.1+    in o * a++nms_pp :: (UGen -> UGen)+nms_pp i = combN i 0.3 0.3 4 + mceReverse i++main :: IO ()+main = overlapTextureU_pp (4,4,4,maxBound) nms 2 nms_pp
Sound/SC3/Graph/JMCC_noise_modulated_sines.hs view
@@ -1,7 +1,7 @@--- noise modulated sines (jmcc)+-- noise modulated sines (jmcc) #6 module Sound.SC3.Graph.JMCC_noise_modulated_sines where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  nms :: UGen
Sound/SC3/Graph/JMCC_overlap_add.hs view
@@ -1,8 +1,8 @@ -- overlap-add (jmcc) module Sound.SC3.Graph.JMCC_overlap_add where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  sine :: UGen sine =@@ -18,5 +18,5 @@     in pan2 (resonz (n0 * 0.1) r0 0.05) r1 0.25  main :: IO ()-main = audition (ppar [overlapTextureP (4,4,6,maxBound) sine-                      ,overlapTextureP (4,4,6,maxBound) noise])+main = audition (nrt_merge (overlapTexture_nrt (1,0) (4,4,6,maxBound) sine)+                           (overlapTexture_nrt (1,0) (4,4,6,maxBound) noise))
+ Sound/SC3/Graph/JMCC_phase_modulation.hs view
@@ -0,0 +1,24 @@+-- phase modulation with slow beats (jmcc) #6+module Sound.SC3.Graph.JMCC_phase_modulation where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: ID a => a -> UGen -> UGen+rand2 e n = rand e (-n) n++nrec :: (Num a, Ord a) => a -> (t -> t) -> t -> t+nrec n f st = if n > 0 then nrec (n - 1) f (f st) else st++pmwsb :: UGen+pmwsb =+    let x = mouseX KR 100 6000 Exponential 0.2 -- random freq of new events+        y = mouseY KR 0 2 Linear 0.2 -- modulation index+        o (e,a) = let f = rand e 0 x+                  in (succ e,fSinOsc AR (mce [f,f + rand2 'α' 1]) 0 * y + a)+        (_,ph) = nrec 3 o ('β',0)+        freq = rand 'γ' 0 x+    in sinOsc AR (mce [freq, freq + rand2 'δ' 1]) ph * 0.1++main :: IO ()+main = overlapTextureU (4,4,4,maxBound) pmwsb
Sound/SC3/Graph/JMCC_plucked_strings_m.hs view
@@ -1,23 +1,23 @@ -- plucked strings (jmcc) module Sound.SC3.Graph.JMCC_plucked_strings_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  plucked_strings :: UId m => m UGen plucked_strings = do-  let dt = do r0 <- rand 60 90+  let dt = do r0 <- randM 60 90               return (1 / midiCPS (floorE r0))-      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+      i = do r0 <- randM 2 2.2+             n0 <- dustM AR 0.5+             r1 <- randM 0.05 0.15+             r2 <- randM 0 (pi * 2)+             r3 <- iRandM 0 2+             let s0 = impulse AR r0 0 * 0.3                  s1 = n0 * 0.3-                 s2 = impulse AR (sinOsc KR r1 r2 * 5 + 5.2) 0.3+                 s2 = impulse AR (sinOsc KR r1 r2 * 5 + 5.2) 0 * 0.3              return (select r3 (mce [s0,s1,s2]))-      s = do n0 <- pinkNoise AR-             r1 <- rand (-1) 1+      s = do n0 <- pinkNoiseM AR+             r1 <- randM (-1) 1              im <- i              dt' <- dt              let t = decay im 0.1 * n0 * 0.1
Sound/SC3/Graph/JMCC_police_state.hs view
@@ -1,8 +1,7 @@--- police state (jmcc)+-- police state (jmcc) #2 module Sound.SC3.Graph.JMCC_police_state where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect {- hsc3 -}+import Sound.SC3 {- hsc3 -}  nd :: UGen nd =
Sound/SC3/Graph/JMCC_police_state_m.hs view
@@ -1,23 +1,23 @@--- police state (jmcc)+-- police state (jmcc) #2 module Sound.SC3.Graph.JMCC_police_state_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  police_state :: UId m => m UGen police_state = do-  let nd = 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 nd = do r0 <- randM 0.02 0.12+              r1 <- randM 0 (pi * 2)+              r2 <- randM 0 600+              r3 <- randM 700 1300+              r4 <- randM (-1) 1+              r5 <- randM 80 120+              n0 <- lfNoise2M AR r5               let f = sinOsc KR r0 r1 * r2 + r3               return (pan2 (sinOsc AR f 0 * n0 * 0.1) r4 1)   ns <- clone 4 nd-  n0 <- clone 2 (lfNoise2 KR 0.4)-  n1 <- lfNoise2 AR (n0 * 90 + 620)-  n2 <- lfNoise2 KR (mce2 0.3 0.301)+  n0 <- clone 2 (lfNoise2M KR 0.4)+  n1 <- lfNoise2M AR (n0 * 90 + 620)+  n2 <- lfNoise2M KR (mce2 0.3 0.301)   let e = n1 * (n2 * 0.15 + 0.18)   return (combL (mix ns + e) 0.3 0.3 3) 
Sound/SC3/Graph/JMCC_pond_life.hs view
@@ -1,14 +1,14 @@--- pond life (jmcc)+-- pond life (jmcc) #1 module Sound.SC3.Graph.JMCC_pond_life where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  pond_life :: UGen pond_life =     let f0 = 20 + rand 'α' 0 30         f1 = fSinOsc KR f0 0 * rand 'β' 100 400 + linRand 'γ' 500 2500 0-        a = lfPulse KR (3 / rand 'δ' 1 9) (rand 'ε' 0.2 0.5) 0.04+        a = lfPulse KR (3 / rand 'δ' 1 9) 0 (rand 'ε' 0.2 0.5) * 0.04     in pan2 (sinOsc AR f1 0 * a) (rand 'ζ' (-1) 1) 0.5  main :: IO ()
+ Sound/SC3/Graph/JMCC_pond_life_ha.hs view
@@ -0,0 +1,17 @@+-- pond life (jmcc) #1+{-# OPTIONS_GHC -F -pgmF hsc3-hash-at #-}+module Sound.SC3.Graph.JMCC_pond_life_ha where++import Data.Hashable {- hashable -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++pond_life :: UGen+pond_life =+    let f0 = 20 + (rand #@ 0 30)+        f1 = fSinOsc KR f0 0 * (rand #@ 100 400) + (linRand #@ 500 2500 0)+        a = lfPulse KR (3 / (rand #@ 1 9)) 0 (rand #@ 0.2 0.5) * 0.04+    in pan2 (sinOsc AR f1 0 * a) (rand #@ (-1) 1) 0.5++main :: IO ()+main = overlapTextureU (8,8,4,maxBound) pond_life
Sound/SC3/Graph/JMCC_pond_life_hp.hs view
@@ -1,17 +1,17 @@--- pond life (jmcc)+-- pond life (jmcc) #1 {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_pond_life_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  pond_life :: UId m => m UGen pond_life = do-  let f = fSinOsc KR (20 + #(rand 0 30)) 0-          * #(rand 100 400)-          + #(linRand 500 2500 0)-  let a = lfPulse KR (3 / #(rand 1 9)) #(rand 0.2 0.5) 0.04-  return (pan2 (sinOsc AR f 0 * a) #(rand (-1) 1) 0.5)+  let f = fSinOsc KR (20 + #(randM 0 30)) 0+          * #(randM 100 400)+          + #(linRandM 500 2500 0)+  let a = lfPulse KR (3 / #(randM 1 9)) 0 #(randM 0.2 0.5) * 0.04+  return (pan2 (sinOsc AR f 0 * a) #(randM (-1) 1) 0.5)  main :: IO () main = overlapTextureU (8,8,4,maxBound) =<< pond_life
Sound/SC3/Graph/JMCC_pulsing_bottles.hs view
@@ -1,8 +1,7 @@--- pulsing bottles (jmcc)+-- pulsing bottles (jmcc) #2 module Sound.SC3.Graph.JMCC_pulsing_bottles where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  pulsing_bottles :: UGen
Sound/SC3/Graph/JMCC_pulsing_bottles_m.hs view
@@ -1,19 +1,19 @@--- pulsing bottles (jmcc)+-- pulsing bottles (jmcc) #2 module Sound.SC3.Graph.JMCC_pulsing_bottles_m where  import Control.Monad {- base -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  pulsing_bottles :: UId m => m UGen pulsing_bottles = do-  let r = do n <- whiteNoise AR-             r0 <- rand 4 14-             r1 <- rand 0 0.7-             r2 <- rand 400 7400+  let r = do n <- whiteNoiseM AR+             r0 <- randM 4 14+             r1 <- randM 0 0.7+             r2 <- randM 400 7400              return (resonz (n * lfPulse KR r0 0 0.25 * r1) r2 0.01)-      s = do f <- rand 0.1 0.5-             p <- rand 0 (pi * 2)+      s = do f <- randM 0.1 0.5+             p <- randM 0 (pi * 2)              return (sinOsc KR f p)       u = liftM2 (\x y -> pan2 x y 1) r s   fmap sum (sequence (replicate 6 u))
Sound/SC3/Graph/JMCC_rails.hs view
@@ -1,8 +1,7 @@--- rails (jmcc)+-- rails (jmcc) #2 module Sound.SC3.Graph.JMCC_rails where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  rand2 :: ID a => a -> UGen -> UGen
Sound/SC3/Graph/JMCC_random_panning_sines.hs view
@@ -1,8 +1,7 @@--- random panning sines (jmcc)+-- random panning sines (jmcc) #4 module Sound.SC3.Graph.JMCC_random_panning_sines where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  rps :: UGen
Sound/SC3/Graph/JMCC_random_panning_sines_m.hs view
@@ -1,15 +1,15 @@--- random panning sines (jmcc)+-- random panning sines (jmcc) #4 module Sound.SC3.Graph.JMCC_random_panning_sines_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  rps :: UId m => m UGen rps = do-  let nd = do r0 <- linRand 80 2000 0+  let nd = do r0 <- linRandM 80 2000 0               let o = fSinOsc AR r0 0-              l <- lfNoise1 KR =<< rand 0.8 1.2-              a <- lfNoise1 KR =<< rand 0.82 0.98+              l <- lfNoise1M KR =<< randM 0.8 1.2+              a <- lfNoise1M KR =<< randM 0.82 0.98               return (pan2 o l a)   r <- clone 8 nd   return (mix r * (0.4 / 8))
Sound/SC3/Graph/JMCC_random_pulsations.hs view
@@ -1,15 +1,16 @@--- random pulsations (jmcc)+-- random pulsations (jmcc) #1 module Sound.SC3.Graph.JMCC_random_pulsations where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  rp :: UGen rp =-    let o1 = fSinOsc AR (rand 'α' 0 2000) 0 * 0.02-        o2 = sinOsc AR (linRand 'α' 8 88 0) 0-        o3 = sinOsc KR (rand 'α' 0.3 0.8) (rand 'α' 0 (2 * pi)) * 0.7+    let e = envLinen 2 5 2 0.02+        o1 = fSinOsc AR (rand 'α' 0 2000) 0 * envGen KR 1 1 0 1 DoNothing e+        o2 = sinOsc AR (linRand 'β' 8 88 0) 0+        o3 = sinOsc KR (rand 'γ' 0.3 0.8) (rand 'δ' 0 (2 * pi)) * 0.7     in pan2 (o1 `amClip` o2) o3 1  main :: IO ()-main = overlapTextureU (5,2,8,maxBound) rp+main = spawnTextureU (const (9/8),maxBound) rp
Sound/SC3/Graph/JMCC_random_sine_waves.hs view
@@ -1,7 +1,7 @@--- random sine waves (jmcc)+-- random sine waves (jmcc) #1 module Sound.SC3.Graph.JMCC_random_sine_waves where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  rsw :: UGen
Sound/SC3/Graph/JMCC_random_sine_waves_hp.hs view
@@ -1,11 +1,11 @@--- random sine waves (jmcc)+-- random sine waves (jmcc) #1 {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_random_sine_waves_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  main :: IO () main = do-  let rsw = pan2 (fSinOsc AR #(rand 0 2000) 0 * 0.02) #(rand (-1) 1) 1+  let rsw = pan2 (fSinOsc AR #(randM 0 2000) 0 * 0.02) #(randM (-1) 1) 1   overlapTextureU (2,5,12,maxBound) rsw
Sound/SC3/Graph/JMCC_random_sine_waves_she.hs view
@@ -1,12 +1,13 @@--- random sine waves (jmcc)+-- random sine waves (jmcc) #1 {-# OPTIONS_GHC -F -pgmF she #-} module Sound.SC3.Graph.JMCC_random_sine_waves_she where  import Control.Applicative {- base -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  main :: IO () main = do-  s <- (|pan2 ((|fSinOsc ~AR (rand 0 2000) ~0|) .* 0.02) (rand (-1) 1) ~1|)+  s <- (|pan2 ((|fSinOsc ~AR (randM 0 2000) ~0|) .* 0.02) (randM (-1) 1) ~1|)   overlapTextureU (2,5,12,maxBound) s
+ Sound/SC3/Graph/JMCC_reso_pulse.hs view
@@ -0,0 +1,28 @@+-- reso-pulse (jmcc) #1+module Sound.SC3.Graph.JMCC_reso_pulse where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: ID a => a -> UGen -> UGen+rand2 k n = rand k (-n) n++reso_pulse :: UGen+reso_pulse =+    let f = midiCPS (lchoose 'α' [25,30,34,37,41,42,46,49,53,54,58,61,63,66])+        f' = 2 * f + rand2 'β' 0.5+    in (lfPulse AR f 0 0.2 + lfPulse AR f' 0 0.2) * 0.02++-- > let g = reso_pulse_pp (silent 1)+reso_pulse_pp :: UGen -> UGen+reso_pulse_pp z =+    let lfoFreq = 6+        lfo = lfNoise0 'γ' KR lfoFreq * 1000 + 1200+        x = mouseX KR 0.2 0.02 Exponential 0.2+        left = rlpf z lfo x+        delayTime = 2 / lfoFreq+        right = delayN left delayTime delayTime+    in mce2 left right++main :: IO ()+main = overlapTextureU_pp (4,2,4,maxBound) reso_pulse 1 reso_pulse_pp
Sound/SC3/Graph/JMCC_resonant_dust.hs view
@@ -1,7 +1,7 @@--- resonant dust (jmcc)+-- resonant dust (jmcc) #2 module Sound.SC3.Graph.JMCC_resonant_dust where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  resonant_dust :: UGen
Sound/SC3/Graph/JMCC_resonant_dust_hp.hs view
@@ -1,16 +1,16 @@--- resonant dust (jmcc)+-- resonant dust (jmcc) #2 {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_resonant_dust_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  resonant_dust :: UId m => m UGen resonant_dust = do-  st <- rand 80 2080-  let en = st + (st * #(rand (-0.5) 0.5))+  st <- randM 80 2080+  let en = st + (st * #(randM (-0.5) 0.5))       rf = xLine KR st en 9 DoNothing-  return (pan2 (resonz (#(dust AR #(rand 50 850)) * 0.3) rf 0.1) #(rand (-1) 1) 1)+  return (pan2 (resonz (#(dustM AR #(randM 50 850)) * 0.3) rf 0.1) #(randM (-1) 1) 1)  main :: IO () main = overlapTextureU (5,2,9,maxBound) =<< resonant_dust
+ Sound/SC3/Graph/JMCC_resonators_harmonic_series.hs view
@@ -0,0 +1,25 @@+-- resonators harmonic series (jmcc) #2+module Sound.SC3.Graph.JMCC_resonators_harmonic_series where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Collection as C {- hsc3-lang -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: ID a => a -> UGen -> UGen+rand2 z n = rand z (negate n) n++rhs :: UGen+rhs =+    let p = 12+        noise = brownNoise 'α' AR * 0.001+        rat = [1.0,1.125,1.25,1.333,1.5,1.667,1.875,2.0,2.25,2.5,2.667,3.0,3.333,3.75,4.0]+        freq = lchoose 'β' rat * 120+        resFreqs = zipWith (+) (C.series p freq freq) (uclone' 'γ' p (rand2 'δ' 0.5))+        spec = klankSpec+               resFreqs+               (map (\i -> 1 / (constant i + 1)) [0 .. p - 1])+               (uclone' 'ε' p (rand 'ζ' 0.5 4.5))+    in uclone 'η' 2 (klank noise 1 0 1 spec)++main :: IO ()+main = xfadeTextureU (1,7,maxBound) rhs
+ Sound/SC3/Graph/JMCC_reverberated_noise_bursts.hs view
@@ -0,0 +1,15 @@+-- reverberated noise bursts (jmcc) #3+module Sound.SC3.Graph.JMCC_reverberated_noise_bursts where++import Sound.SC3 {- hsc3 -}++rnb :: UGen+rnb =+    let s = decay (dust 'α' AR 0.6 * 0.2) 0.15 * pinkNoise 'β' AR+        z = delayN s 0.048 0.048+        y = mix (combL z 0.1 (lfNoise1 'γ' KR (uclone 'δ' 6 (rand 'ε' 0 0.1)) * 0.04 + 0.05) 15)+        f = useq 'ζ' 4 (\i -> allpassN i 0.050 (uclone 'η' 2 (rand 'θ' 0 0.05)) 1)+    in s + f y++main :: IO ()+main = audition (out 0 rnb)
Sound/SC3/Graph/JMCC_reverberated_sine_percussion_hp.hs view
@@ -1,19 +1,20 @@--- reverberated sine percussion (jmcc)+-- reverberated sine percussion (jmcc) #3 {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_reverberated_sine_percussion_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -}  reverberated_sine_percussion :: (Functor m,UId m) => m UGen reverberated_sine_percussion = do   let d = 6       c = 5       a = 4-      s_ = do return (resonz (#(dust AR (2 / constant d)) * 50) (200 + #(rand 0 3000)) 0.003)-      x_ i = do return (allpassN i 0.05 #(clone 2 (rand 0 0.05)) 1)+      s_ = do return (resonz (#(dustM AR (2 / constant d)) * 50) (200 + #(randM 0 3000)) 0.003)+      x_ i = do return (allpassN i 0.05 #(clone 2 (randM 0 0.05)) 1)   s <- fmap sum (sequence (replicate d s_))   y <- do let z = delayN s 0.048 0.48-          return (mix (combL z 0.1 (#(lfNoise1 KR #(clone c (rand 0 0.1))) * 0.04 + 0.05) 15))+          return (mix (combL z 0.1 (#(lfNoise1M KR #(clone c (randM 0 0.1))) * 0.04 + 0.05) 15))   x <- chainM a x_ y   return (s + x * 0.2) 
Sound/SC3/Graph/JMCC_reverberated_sine_percussion_m.hs view
@@ -1,22 +1,23 @@--- reverberated sine percussion (jmcc)+-- reverberated sine percussion (jmcc) #3 module Sound.SC3.Graph.JMCC_reverberated_sine_percussion_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -}  reverberated_sine_percussion :: (Functor m,UId m) => m UGen reverberated_sine_percussion = do   let d = 6       c = 5       a = 4-      s_ = do n <- dust AR (2 / constant d)-              r <- rand 0 3000+      s_ = do n <- dustM AR (2 / constant d)+              r <- randM 0 3000               return (resonz (n * 50) (200 + r) 0.003)-      x_ i = do r <- clone 2 (rand 0 0.05)+      x_ i = do r <- clone 2 (randM 0 0.05)                 return (allpassN i 0.05 r 1)   s <- fmap sum (sequence (replicate d s_))   y <- do let z = delayN s 0.048 0.48-          r <- clone c (rand 0 0.1)-          n <- lfNoise1 KR r+          r <- clone c (randM 0 0.1)+          n <- lfNoise1M KR r           return (mix (combL z 0.1 (n * 0.04 + 0.05) 15))   x <- chainM a x_ y   return (s + x * 0.2)
+ Sound/SC3/Graph/JMCC_ring_modulate_input.hs view
@@ -0,0 +1,14 @@+-- ring modulate input (jmcc) #5+module Sound.SC3.Graph.JMCC_ring_modulate_input where++import Sound.SC3 {- hsc3 -}++ring_modulate_input :: UGen+ring_modulate_input =+    let input = soundIn (mce2 0 1)+        x = mouseX KR 10 4000 Exponential 0.2 -- mouse x controls ring mod freq+        modulator = sinOsc AR x (mce2 0 (0.5 * pi)) -- offset phase of one osc by 90 degrees+    in input * modulator++main :: IO ()+main = audition (out 0 ring_modulate_input)
Sound/SC3/Graph/JMCC_ring_modulated_klank.hs view
@@ -1,8 +1,8 @@--- ring modulated klank (jmcc)+-- ring modulated klank (jmcc) #2 module Sound.SC3.Graph.JMCC_ring_modulated_klank where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  rmk :: UGen
Sound/SC3/Graph/JMCC_sample_and_hold_liquidities.hs view
@@ -1,13 +1,13 @@--- sample and hold liquidities (jmcc)+-- sample and hold liquidities (jmcc) #4 module Sound.SC3.Graph.JMCC_sample_and_hold_liquidities where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  shl :: UGen shl =     let r = mouseX KR 1 200 Exponential 0.1         t = recip r-        c = impulse KR r 0.4+        c = impulse KR r 0 * 0.4         cf = mouseY KR 100 8000 Exponential 0.1         f = latch (whiteNoise 'α' KR * cf * 0.5 + cf) c         p = latch (whiteNoise 'β' KR) c
Sound/SC3/Graph/JMCC_saucer_base.hs view
@@ -1,7 +1,7 @@--- saucer base (jmcc)+-- saucer base (jmcc) #6 module Sound.SC3.Graph.JMCC_saucer_base where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  saucer_base :: UGen
Sound/SC3/Graph/JMCC_sawed_cymbals.hs view
@@ -1,8 +1,7 @@--- sawed cymbals (jmcc)+-- sawed cymbals (jmcc) #9 module Sound.SC3.Graph.JMCC_sawed_cymbals where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  sawed_cymbals :: UGen
Sound/SC3/Graph/JMCC_scratchy.hs view
@@ -1,13 +1,13 @@--- scratchy (jmcc)+-- scratchy (jmcc) #1 module Sound.SC3.Graph.JMCC_scratchy where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  scratchy :: UGen scratchy =-  let f m = brownNoise m AR * 0.5 - 0.49-      n = mce2 (f 'α') (f 'β')-  in rhpf (max n 0 * 20) 5000 1+  let n = brownNoise 'α' AR * 0.5 - 0.49+      n' = uclone 'β' 2 n+  in rhpf (max n' 0 * 20) 5000 1  main :: IO () main = audition (out 0 scratchy)
Sound/SC3/Graph/JMCC_scratchy_m.hs view
@@ -1,11 +1,11 @@--- scratchy-m (jmcc)+-- scratchy-m (jmcc) #1 module Sound.SC3.Graph.JMCC_scratchy_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  scratchy :: UId m => m UGen scratchy = do-  n <- clone 2 (brownNoise AR)+  n <- clone 2 (brownNoiseM AR)   let f = max (n * 0.5 - 0.49) 0 * 20   return (rhpf f 5000 1) 
Sound/SC3/Graph/JMCC_sidereal_time.hs view
@@ -1,8 +1,7 @@--- sidereal time (jmcc)+-- sidereal time (jmcc) #9 module Sound.SC3.Graph.JMCC_sidereal_time where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  sidereal_time :: UGen
Sound/SC3/Graph/JMCC_sidereal_time_hp.hs view
@@ -1,25 +1,25 @@--- sidereal time (jmcc)+-- sidereal time (jmcc) #9 {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_sidereal_time_hp where  import Control.Monad {- base -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  sidereal_time :: UId m => m UGen sidereal_time = do   let p = 15   z <- let y = do-             fr <- replicateM p (expRand 100 6000)-             rt <- replicateM p (rand 2 6)+             fr <- replicateM p (expRandM 100 6000)+             rt <- replicateM p (randM 2 6)              return (klankSpec fr (replicate p 1) rt)        in clone 2 y-  let f = xLine KR #(expRand 40 300) #(expRand 40 300) 12 DoNothing-  let t = lfPulse AR f 0 #(rand 0.1 0.9)-          * max 0 #(lfNoise2 KR #(rand 0 8))+  let f = xLine KR #(expRandM 40 300) #(expRandM 40 300) 12 DoNothing+  let t = lfPulse AR f 0 #(randM 0.1 0.9)+          * max 0 #(lfNoise2M KR #(randM 0 8))           * 0.002       o = distort (klank t 1 0 1 (mceTranspose z)) * 0.1-  return (combN o 0.6 #(rand 0.1 0.6) 8 + mceReverse o)+  return (combN o 0.6 #(randM 0.1 0.6) 8 + mceReverse o)  main :: IO () main = overlapTextureU (4,4,6,maxBound) =<< sidereal_time
Sound/SC3/Graph/JMCC_slow_beating_harmonic_sines.hs view
@@ -1,11 +1,11 @@--- slow beating harmonic sines (jmcc)+-- slow beating harmonic sines (jmcc) #7 module Sound.SC3.Graph.JMCC_slow_beating_harmonic_sines where  import Control.Monad {- base -} import Control.Monad.Random {- MonadRandom -} import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Lang.Random.Monad+import Sound.SC3.Lang.Random.Monad as L {- hsc3-lang -}  r_freq :: (RandomGen g) => Int -> Int -> Rand g [Double] r_freq k i = do@@ -24,7 +24,7 @@  sbhs :: (RandomGen g) => Int -> Double -> Int -> Rand g UGen sbhs n d m = do-  k' <- rand 12+  k' <- L.rand 12   let k = 24 + k'   f <- r_freq k n   p_fr <- mapM (r_harmonics d m) f
Sound/SC3/Graph/JMCC_slow_beating_sines.hs view
@@ -1,4 +1,4 @@--- slow beating sines (jmcc)+-- slow beating sines (jmcc) #7 module Sound.SC3.Graph.JMCC_slow_beating_sines where  import Control.Monad {- base -}@@ -21,6 +21,7 @@ r_phase :: (RandomGen g) => Int -> Rand g [Double] r_phase m = nrrand m 0 (2 * pi) +-- > g <- fmap (fst . runRand (sbs 3 0.4 3)) getStdGen sbs :: (RandomGen g) => Int -> Double -> Int -> Rand g UGen sbs n d m = do   f <- r_freq n
Sound/SC3/Graph/JMCC_snare_909.hs view
@@ -1,7 +1,7 @@ -- snare-909 (jmcc) module Sound.SC3.Graph.JMCC_snare_909 where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  snare_909 :: UGen -> UGen snare_909 tr =
Sound/SC3/Graph/JMCC_spe_m.hs view
@@ -1,20 +1,21 @@--- spe (jmcc)--- variant of graph in streams & patterns tutorial+-- spe (jmcc)/(rd) module Sound.SC3.Graph.JMCC_spe_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -} +-- fmap (Sound.SC3.UGen.PP.ugen_graph_forth_pp False) spe spe :: UId m => m UGen spe = do-  let rapf i = do r <- clone 2 (rand 0 0.05)+  let rapf i = do r <- clone 2 (randM 0 0.05)                   return (allpassN i 0.05 r 4)       src = do 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]-               n <- lfNoise1 KR 1-               m <- dseq dinf s+               n <- lfNoise1M KR 1+               m <- dseqM dinf s                let f = midiCPS (demand t 0 m + 32)                    o = lfSaw AR f 0 * e                    rq = midiCPS (n * 36 + 110)
Sound/SC3/Graph/JMCC_spe_p.hs view
@@ -1,14 +1,17 @@ -- spe-p (jmcc) module Sound.SC3.Graph.JMCC_spe_p where -import Sound.SC3.Monad {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -}+import qualified Sound.SC3.Lang.Collection as C {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Bind as P {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.List as P {- hsc3-lang -}  spe3_allpass6 :: UId m => m Synthdef spe3_allpass6 = do-  n <- lfNoise1 KR 1+  n <- lfNoise1M KR 1   let fr = control KR "freq" 440-      rapf i = do r <- clone 2 (rand 0 0.05)+      rapf i = do r <- clone 2 (randM 0 0.05)                   return (allpassN i 0.05 r 4)       e = envGen KR 1 0.1 0 1 RemoveSynth (envPerc 0.1 1)       rq = midiCPS (n * 36 + 110)@@ -16,14 +19,20 @@   u <- fmap (out 0) (chainM 4 rapf o)   return (synthdef "spe" u) -notes :: Num n => P n+lseq1 :: [[a]] -> [a]+lseq1 = concat . C.flop++inf :: Int+inf = maxBound++notes :: Num n => [n] notes =-    let n = [prand' 'α' [pempty,toP [24,31,36,43,48,55]] inf-            ,pflop [60,prand 'β' [63,65] inf,67,prand 'γ' [70,72,74] inf]-            ,psplitPlaces (pwhite 'δ' 3 9 inf) (toP [74,75,77,79,81])]-    in pjoin (pseq1 n inf)+    let n = [P.rand' 'α' [[],[24,31,36,43,48,55]] inf+            ,C.flop [[60],P.rand' 'β' [63,65] inf,[67],P.rand' 'γ' [70,72,74] inf]+            ,[P.rand' 'a' [74,75,77,79,81] 3]]+    in concat (lseq1 n)  main :: IO () main = do   i <- spe3_allpass6-  audition (pbind [(K_instr,psynth i),(K_midinote,notes),(K_dur,0.13)])+  audition (P.sbind1 (i,[("freq",map midiCPS notes),("dur",repeat 0.13)]))
Sound/SC3/Graph/JMCC_sprinkler.hs view
@@ -1,14 +1,22 @@--- sprinkler (jmcc)+-- sprinkler (jmcc) #1 module Sound.SC3.Graph.JMCC_sprinkler where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  sprinkler :: UGen sprinkler =-  let n = whiteNoise 'α' AR-      f = lfPulse KR 0.09 0 0.16 * 10 + 7+  let f = lfPulse KR 0.09 0 0.16 * 10 + 7       t = lfPulse KR f 0 0.25 * 0.1+      n = whiteNoise 'α' AR   in bpz2 (n * t)  main :: IO () main = audition (out 0 sprinkler)++-- > audition (out 0 sprinkler')+sprinkler' :: UGen+sprinkler' =+           let n = whiteNoise 'α' AR+               f = mouseX KR 0.2 50 Linear 0.2+               t = lfPulse KR f 0 0.25 * 0.1+           in bpz2 (n * t)
Sound/SC3/Graph/JMCC_sprinkler_m.hs view
@@ -1,11 +1,11 @@--- sprinkler-m (jmcc)+-- sprinkler-m (jmcc) #1 module Sound.SC3.Graph.JMCC_sprinkler_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  sprinkler_m :: UId m => m UGen sprinkler_m = do-  n <- whiteNoise AR+  n <- whiteNoiseM AR   let f = lfPulse KR 0.09 0 0.16 * 10 + 7       t = lfPulse KR f 0 0.25 * 0.1   return (bpz2 (n * t))
Sound/SC3/Graph/JMCC_string_wander_cluster.hs view
@@ -1,7 +1,7 @@--- string wander-cluster (jmcc)+-- string wander-cluster (jmcc) #6 module Sound.SC3.Graph.JMCC_string_wander_cluster where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -} import System.Random {- random -} @@ -16,9 +16,21 @@ swc st =     let (n,g) = wander st         d = 1 / midiCPS (constant n)-        w = whiteNoise 'c' AR * 0.008+        w = whiteNoise 'α' AR * 0.008         o = combC w 0.01 d (d * 1000)-    in (pan2 o (rand 'd' (-1) 1) 1,(n,g))+    in (pan2 o (rand 'β' (-1) 1) 1,(n,g))  main :: IO () main = overlapTextureS (4/3,4/3,6,maxBound) swc (60,mkStdGen 0)++swc' :: UGen+swc' =+    let n = rand 'α' 50 100+        n' = fold (n + rand 'β' 0 15 - 7) 50 120+        d = 1 / midiCPS n'+        w = whiteNoise 'γ' AR * 0.008+        o = combC w 0.01 d (d * 1000)+    in pan2 o (rand 'δ' (-1) 1) 1++main' :: IO ()+main' = overlapTextureU (4/3,4/3,6,maxBound) swc'
Sound/SC3/Graph/JMCC_strummable_guitar.hs view
@@ -1,20 +1,24 @@--- strummable guitar (jmcc)+-- strummable guitar (jmcc) #11 module Sound.SC3.Graph.JMCC_strummable_guitar where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} -strummable_guitar :: UGen-strummable_guitar =+str :: UGen -> Double -> UGen+str sc ix' =+    let ix = constant ix'+        x = mouseX KR 0 1 Linear 0.2+        t = abs (hpz1 (x >* (0.25 + ix * 0.1)))+        e = decay t 0.05+        n = pinkNoise ix' AR * e+        dt = 1 / midiCPS sc+        s = combL n dt dt 4+    in pan2 s (ix * 0.2 - 0.5) 1++gtr :: UGen+gtr =     let scale = [52,57,62,67,71,76]-        str i = let x = mouseX KR 0 1 Linear 0.2-                    t = abs (hpz1 (x >* (0.25 + constant i * 0.1)))-                    e = decay t 0.05-                    n = pinkNoise i AR * e-                    dt = 1 / midiCPS (scale !! i)-                    s = combL n dt dt 4-                in pan2 s (constant i * 0.2 - 0.5) 1-        strs = mixFill (length scale) str-  in leakDC (lpf strs 12000) 0.995+        strs = sum (zipWith str scale [0..])+    in leakDC (lpf strs 12000) 0.995  main :: IO ()-main = audition (out 0 strummable_guitar)+main = audition (out 0 gtr)
Sound/SC3/Graph/JMCC_sweepy_noise.hs view
@@ -1,8 +1,7 @@--- sweepy noise (jmcc)+-- sweepy noise (jmcc) #6 module Sound.SC3.Graph.JMCC_sweepy_noise where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -}  sweepy_noise :: UGen sweepy_noise =
+ Sound/SC3/Graph/JMCC_swept_resonant_noise.hs view
@@ -0,0 +1,21 @@+-- swept resonant noise (jmcc) #2+module Sound.SC3.Graph.JMCC_swept_resonant_noise where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++srn :: UGen+srn =+  let p = 10+      n = whiteNoise 'α' AR * 0.007+      f = midiCPS (fSinOsc KR (rand 'β' 0.1 0.3) 0 * rand 'γ' 0 24 + rand 'δ' 36 84)+      sw = resonz n f 0.1+      spec = klankSpec_mce+             (linRandN p 'ε' 80 10080 0)+             (mce (replicate p 1))+             (randN p 'ζ' 0.5 2.5)+  in uclone 'η' 2 (klank sw 1 0 1 spec)++main :: IO ()+main = overlapTextureU (4,4,5,maxBound) srn
Sound/SC3/Graph/JMCC_synthetic_piano_m.hs view
@@ -1,17 +1,18 @@--- synthetic piano (jmcc)+-- synthetic piano (jmcc) #3 module Sound.SC3.Graph.JMCC_synthetic_piano_m where  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} +-- > g <- synthetic_piano synthetic_piano :: UId m => m UGen synthetic_piano = do-  n <- iRand 36 90-  f <- rand 0.1 0.5-  ph <- rand 0 (pi * 2)+  n <- iRandM 36 90+  f <- randM 0.1 0.5+  ph <- randM 0 1   let s = impulse AR f ph * 0.1       e = decay2 s 0.008 0.04-      c i = do n0 <- lfNoise2 AR 3000+      c i = do n0 <- lfNoise2M AR 3000                let o = [-0.05,0,0.04] !! i                    dt = 1 / midiCPS (n + o)                return (combL (n0 * e) dt dt 6)
Sound/SC3/Graph/JMCC_tank.hs view
@@ -2,49 +2,48 @@ -- http://create.ucsb.edu/pipermail/sc-users/2004-April/009692.html module Sound.SC3.Graph.JMCC_tank where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} -pling :: ID a => a -> UGen-pling e =-    let d = dust e AR 0.2-        f = expRand e 300 2200-        p = rand e (-1) 1+pling :: UGen+pling =+    let d = dust 'α' AR 0.2+        f = expRand 'β' 300 2200+        p = rand 'γ' (-1) 1         s1 = cubed (fSinOsc AR f 0)         s2 = decay2 d 0.1 0.5 * 0.1 * s1     in pan2 s2 p 1 -bang :: ID a => a -> UGen-bang e =-    let d = dust e AR 0.01-        n = brownNoise e AR+bang :: UGen+bang =+    let d = dust 'δ' AR 0.01+        n = brownNoise 'ε' AR     in pan2 (decay2 d 0.04 0.3 * n) 0 1 -r_allpass :: ID z => z -> UGen -> UGen-r_allpass e i =-    let r = randN 2 e 0.005 0.02-    in allpassN i 0.03 r 1+-- > let u = useq 'λ' 4 r_allpass (soundIn 0)+r_allpass :: UGen -> UGen+r_allpass i = allpassN i 0.03 (randN 2 'ζ' 0.005 0.02) 1 -tank_f :: ID z => z -> UGen -> UGen-tank_f e i =-    let r1 = randN 2 e 0.01 0.05-        r2 = randN 2 e 0.03 0.15-        l0 = localIn 2 AR * 0.98+tank_f :: UGen -> UGen+tank_f i =+    let l0 = localIn 2 AR (mce2 0 0) * 0.98         l1 = onePole l0 0.33         (l1l,l1r) = mce2c l1         l2 = rotate2 l1l l1r 0.23-        l3 = allpassN l2 0.05 r1 2+        l3 = allpassN l2 0.05 (randN 2 'θ' 0.01 0.05) 2         l4 = delayN l3 0.3 (mce2 0.17 0.23)-        l5 = allpassN l4 0.05 r2 2+        l5 = allpassN l4 0.05 (randN 2 'ι' 0.03 0.15) 2         l6 = leakDC l5 0.995         l7 = l6 + i     in mrg [l7,localOut l7]  tank :: UGen tank =-  let s = bang 'α' + mix (uclone 'β' 8 (pling 'γ'))-  in tank_f 'δ' (useq 'ε' 4 (r_allpass 'ζ') s)+  let s = bang + mix (uclone 'κ' 8 pling)+  in tank_f (useq 'λ' 4 r_allpass s)  main :: IO () main = audition (out 0 tank)++-- > audition (out 0 trev)+trev = tank_f (useq 'λ' 4 r_allpass (soundIn 0))
Sound/SC3/Graph/JMCC_tank_hp.hs view
@@ -2,27 +2,29 @@ {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_tank_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -}  pling :: UId m => m UGen pling = do-  let s = decay2 #(dust AR 0.2) 0.1 0.5-          * cubed (fSinOsc AR #(expRand 300 2200) 0)+  let s = decay2 #(dustM AR 0.2) 0.1 0.5+          * cubed (fSinOsc AR #(expRandM 300 2200) 0)           * 0.1-  return (pan2 s #(rand (-1) 1) 1)+  return (pan2 s #(randM (-1) 1) 1)  bang :: UId m => m UGen-bang = do return (pan2 (decay2 #(dust AR 0.01) 0.04 0.3 * #(brownNoise AR)) 0 1)+bang = do return (pan2 (decay2 #(dustM AR 0.01) 0.04 0.3 * #(brownNoiseM AR)) 0 1)  r_allpass :: UId m => UGen -> m UGen-r_allpass i = do return (allpassN i 0.03 #(clone 2 (rand 0.005 0.02)) 1)+r_allpass i = do return (allpassN i 0.03 #(clone 2 (randM 0.005 0.02)) 1) +-- > audition . out 0 =<< tank_f (soundIn 4) tank_f :: UId m => UGen -> m UGen tank_f i = do-  let [l,r] = mceChannels (onePole (localIn 2 AR * 0.98) 0.33)-  let a = allpassN (rotate2 l r 0.23) 0.05 #(clone 2 (rand 0.01 0.05)) 2+  let [l,r] = mceChannels (onePole (localIn' 2 AR * 0.98) 0.33)+  let a = allpassN (rotate2 l r 0.23) 0.05 #(clone 2 (randM 0.01 0.05)) 2       b = delayN a 0.3 (mce [0.17,0.23])-  let c = leakDC (allpassN b 0.05 #(clone 2 (rand 0.03 0.15)) 2) 0.995 + i+  let c = leakDC (allpassN b 0.05 #(clone 2 (randM 0.03 0.15)) 2) 0.995 + i   return (mrg [c,localOut c])  tank :: UId m => m UGen
Sound/SC3/Graph/JMCC_tank_m.hs view
@@ -2,33 +2,35 @@ -- http://create.ucsb.edu/pipermail/sc-users/2004-April/009692.html module Sound.SC3.Graph.JMCC_tank_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -}  pling :: UId m => m UGen pling = do-  d <- dust AR 0.2-  f <- expRand 300 2200-  p <- rand (-1) 1+  d <- dustM AR 0.2+  f <- expRandM 300 2200+  p <- randM (-1) 1   let s1 = cubed (fSinOsc AR f 0)       s2 = decay2 d 0.1 0.5 * 0.1 * s1   return (pan2 s2 p 1)  bang :: UId m => m UGen bang = do-  d <- dust AR 0.01-  n <- brownNoise AR+  d <- dustM AR 0.01+  n <- brownNoiseM AR   return (pan2 (decay2 d 0.04 0.3 * n) 0 1)  r_allpass :: UId m => UGen -> m UGen r_allpass i = do-  r <- clone 2 (rand 0.005 0.02)+  r <- clone 2 (randM 0.005 0.02)   return (allpassN i 0.03 r 1) +-- > audition . out 0 =<< tank_f (soundIn 4) tank_f :: UId m => UGen -> m UGen tank_f i = do-  r1 <- clone 2 (rand 0.01 0.05)-  r2 <- clone 2 (rand 0.03 0.15)-  let l0 = localIn 2 AR * 0.98+  r1 <- clone 2 (randM 0.01 0.05)+  r2 <- clone 2 (randM 0.03 0.15)+  let l0 = localIn' 2 AR * 0.98       l1 = onePole l0 0.33       [l1l,l1r] = mceChannels l1       l2 = rotate2 l1l l1r 0.23
+ Sound/SC3/Graph/JMCC_tapping_tools.hs view
@@ -0,0 +1,22 @@+-- tapping tools (jmcc) #7+module Sound.SC3.Graph.JMCC_tapping_tools where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++tapping_tools :: UGen+tapping_tools =+    let e = envLinen 1 4 1 1+        rate = xLine KR 64 0.125 60 DoNothing+        exc = decay (impulse AR (linRand 'α' 1 21 0 * rate) 0 * 0.03) 0.001+        spc = klankSpec_mce (randN 4 'β' 400 8400) (mce [1,1,1,1]) (randN 4 'γ' 0.01 0.11)+        flt = klank exc 1 0 1 spc+    in pan2 flt (rand 'δ' (-1) 1) (envGen KR 1 1 0 1 RemoveSynth e)++-- > let g = pp (silent 1)+pp :: UGen -> UGen+pp z = let f x = allpassN x 0.05 (mce2 (rand 'ε' 0 0.05) (rand 'ζ' 0 0.05)) 2 in useq 'η' 3 f z++main :: IO ()+main = overlapTextureU_pp (2,1,3,maxBound) tapping_tools 2 pp
Sound/SC3/Graph/JMCC_tremulate.hs view
@@ -1,9 +1,9 @@--- tremulate (jmcc)+-- tremulate (jmcc) #1 module Sound.SC3.Graph.JMCC_tremulate where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  tremulate :: UGen tremulate =
Sound/SC3/Graph/JMCC_tremulate_hp.hs view
@@ -2,14 +2,14 @@ {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_tremulate_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  tremulate :: UId m => m UGen tremulate = do-  let o = fSinOsc AR (#(rand 500 900) * mce [1,1.2,1.5,1.8]) 0-  n <- clone 4 (lfNoise2 KR #(rand 30 90))-  return (mix (pan2 o #(clone 4 (rand (-1) 1)) (max 0 (n * 0.1))))+  let o = fSinOsc AR (#(randM 500 900) * mce [1,1.2,1.5,1.8]) 0+  n <- clone 4 (lfNoise2M KR #(randM 30 90))+  return (mix (pan2 o #(clone 4 (randM (-1) 1)) (max 0 (n * 0.1))))  tremulate_pp :: UGen -> UGen tremulate_pp i = combN i 0.1 0.1 1
Sound/SC3/Graph/JMCC_tremulate_m.hs view
@@ -1,17 +1,17 @@--- tremulate (jmcc)+-- tremulate (jmcc) #1 module Sound.SC3.Graph.JMCC_tremulate_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  tremulate :: UId m => m UGen tremulate = do-  f <- rand 500 900+  f <- randM 500 900   let o = fSinOsc AR (f * mce [1,1.2,1.5,1.8]) 0-  r <- rand 30 90-  n <- clone 4 (lfNoise2 KR r)+  r <- randM 30 90+  n <- clone 4 (lfNoise2M KR r)   let a = max 0 (n * 0.1)-  l <- clone 4 (rand (-1) 1)+  l <- clone 4 (randM (-1) 1)   return (mix (pan2 o l a))  tremulate_pp :: UGen -> UGen
Sound/SC3/Graph/JMCC_tsort.hs view
@@ -2,14 +2,16 @@ module Sound.SC3.Graph.JMCC_tsort where  {-+ This simple graph tests the topological sort of the unit generator graph, it ought only to use a minimal number of interconnect buffers.  The below 369 node graph works with 'scsynth -u 57110 -w 2'.  (Note that graphs loaded from disk during startup will grow the number-of interconnect buffers, so to test this we must delete all graphs that-would otherwise be loaded.)+of interconnect buffers, so to run this test we must delete all graphs+that would otherwise be loaded.)+ -}  import Sound.SC3 {- hsc3 -}
Sound/SC3/Graph/JMCC_uplink.hs view
@@ -1,8 +1,7 @@--- uplink (jmcc)+-- uplink (jmcc) #2 module Sound.SC3.Graph.JMCC_uplink where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  randz :: ID a => a -> UGen -> UGen
@@ -1,18 +1,19 @@--- uplink (jmcc)+-- uplink (jmcc) #2 {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.JMCC_uplink_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  uplink :: UId m => m UGen uplink = do-  let p0 = do return (lfPulse KR #(rand 0 20) 0 #(rand 0 1))-  let p1 = do return (lfPulse KR #(rand 0 4) 0 #(rand 0 1)-                      * #(rand 0 8000)-                      + #(rand 0 2000))+  let p0 = do return (lfPulse KR #(randM 0 20) 0 #(randM 0 1))+  let p1 = do return (lfPulse KR #(randM 0 4) 0 #(randM 0 1)+                      * #(randM 0 8000)+                      + #(randM 0 2000))   f <- fmap mix (clone 2 (p0 .*. p1))-  return (pan2 (lfPulse AR f 0 0.5 * 0.04) #(rand (-0.8) 0.8) 1)+  return (pan2 (lfPulse AR f 0 0.5 * 0.04) #(randM (-0.8) 0.8) 1)  main :: IO () main = overlapTextureU (4,1,5,maxBound) =<< uplink
Sound/SC3/Graph/JMCC_what_was_i_thinking_m.hs view
@@ -1,19 +1,20 @@--- what was i thinking? (jmcc)+-- what was i thinking? (jmcc) #2 module Sound.SC3.Graph.JMCC_what_was_i_thinking_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} +-- > g <- what_was_i_thinking what_was_i_thinking :: UId m => m UGen what_was_i_thinking = do-  n0 <- lfNoise1 KR 0.2-  n1 <- lfNoise1 KR 0.157+  n0 <- lfNoise1M KR 0.2+  n1 <- lfNoise1M KR 0.157   let p = pulse AR f (n1 * 0.4 + 0.5) * 0.04       i = lfPulse AR 0.1 0 0.05 * impulse AR 8 0 * 500       d = decay i 2       f = max (sinOsc KR 4 0 + 80) d       z = rlpf p (n0 * 2000 + 2400) 0.2-      c x = do r <- rand 0 0.3-               n <- lfNoise1 KR r+      c x = do r <- randM 0 0.3+               n <- lfNoise1M KR r                return (combL x 0.06 (n * 0.025 + 0.035) 1)       y = z * 0.6   z0 <- clone 2 (c y)
Sound/SC3/Graph/JMCC_why_supercollider.hs view
@@ -1,9 +1,8 @@--- why supercollider (jmcc)+-- why supercollider (jmcc) #0 module Sound.SC3.Graph.JMCC_why_supercollider where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  why_supercollider :: UGen why_supercollider =@@ -12,7 +11,7 @@         z = delayN s 0.048 0.048         c = combL z 0.1 (lfNoise1 'δ' KR (rand 'ε' 0 0.1) * 0.04 + 0.05) 15         y = mix (uclone 'ζ' 7 c)-        f i = allpassN i 0.050 (randN 2 'η' 0 0.05) 1+        f i = allpassN i 0.05 (randN 2 'η' 0 0.05) 1         x = useq 'θ' 4 f y     in out 0 (s + 0.2 * x) 
Sound/SC3/Graph/JMCC_wind_metals_m.hs view
@@ -2,19 +2,19 @@ module Sound.SC3.Graph.JMCC_wind_metals_m where  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  -- > audition . out 0 =<< wind_metals wind_metals :: UId m => m UGen wind_metals = do   let n = 6-  base <- expRand 60 4000-  rng <- 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 + rng)))-  dt <- sequence (replicate n (rand 0.1 2))+  base <- expRandM 60 4000+  rng <- randM 500 8000+  n0 <- clone 2 (brownNoiseM AR)+  r0 <- expRandM 0.125 0.5+  n1 <- lfNoise1M KR r0+  f <- sequence (replicate n (randM base (base + rng)))+  dt <- sequence (replicate n (randM 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
+ Sound/SC3/Graph/JMCC_zizle.hs view
@@ -0,0 +1,26 @@+-- zizle (jmcc) #SC3d1.5+module Sound.SC3.Graph.JMCC_zizle where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++twopi :: Floating n => n+twopi = 2 * pi++rand2 :: ID a => a -> UGen -> UGen+rand2 e n = rand e (-n) n++-- > Sound.SC3.UGen.Dot.draw zizle+-- > audition zizle+zizle :: UGen+zizle =+  let a e f = let fm = mce2 (rand 'α' 0.7 1.3) 1+                  ph = mce2 (rand 'β' 0 twopi) (rand 'γ' 0 twopi)+              in uprotect e (mix (sinOsc AR (f * fm) ph * 0.1))+      a1 = max (a 'δ' (expRand 'ε' 0.3 8)) 0+      a2 = abs (a 'ζ' (expRand 'η' 6 24))+      o = sinOsc AR (midiCPS (rand 'θ' 24 108)) (rand 'ι' 0 twopi)+  in pan2 (o * a1 * a2) (rand2 'κ' 1) 1++main :: IO ()+main = overlapTextureU (4,4,12,maxBound) zizle
+ Sound/SC3/Graph/JMCC_zizle_hp.hs view
@@ -0,0 +1,25 @@+-- zizle (jmcc) #SC3d1.5+{-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-}+module Sound.SC3.Graph.JMCC_zizle_hp where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++twopi :: Floating n => n+twopi = 2 * pi++rand2 :: UId m => UGen -> m UGen+rand2 n = randM (-n) n++-- Sound.SC3.UGen.Dot.draw =<< zizle+-- audition =<< zizle+zizle :: UId m => m UGen+zizle = do+  let a f = mix (sinOsc AR (f * mce2 #(randM 0.7 1.3) 1) (mce2 #(randM 0 twopi) #(randM 0 twopi)) * 0.1)+  let a1 = max (a #(expRandM 0.3 8)) 0+  let a2 = abs (a #(expRandM 6 24))+  let o = sinOsc AR (midiCPS #(randM 24 108)) #(randM 0 twopi)+  return (pan2 (o * a1 * a2) #(rand2 1) 1)++main :: IO ()+main = overlapTextureU (4,4,12,maxBound) =<< zizle
Sound/SC3/Graph/JRHB_black_atlantic_currents.hs view
@@ -2,10 +2,10 @@ module Sound.SC3.Graph.JRHB_black_atlantic_currents where  import Data.Numbers.Primes {- primes -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect {- hsc3 -} import System.Random {- random -} import System.Random.Shuffle {- random-shuffle -}++import Sound.SC3 {- hsc3 -}  nth_prime :: Integral a => Int -> a nth_prime j = primes !! j
Sound/SC3/Graph/JRHB_chain_saw_m.hs view
@@ -5,7 +5,7 @@ -- increasing the stack limit of the haskell run time system  import qualified Sound.SC3.Lang.Random.IO as R {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  coinIf :: Double -> a -> a -> IO a coinIf n a b = do@@ -26,10 +26,10 @@  chain_saw :: IO UGen chain_saw = do-  let f s1 = do xr <- fmap dup (expRand 0.1 2)-                n1 <- lfNoise1 KR xr-                n2 <- lfNoise1 KR xr-                n3 <- lfNoise1 KR xr+  let f s1 = do xr <- fmap dup (expRandM 0.1 2)+                n1 <- lfNoise1M KR xr+                n2 <- lfNoise1M KR xr+                n3 <- lfNoise1M KR xr                 f1 <- coinIf 0.6 (exprange n1 0.01 10) (exprange n2 10 50)                 s2 <- coinIf 0.5 (1 - s1) (mceReverse s1)                 let f2 = linExp s1 (-1) 1 f1 (f1 * exprange n3 2 10)
Sound/SC3/Graph/JRHB_deep_sea.hs view
@@ -1,13 +1,8 @@ -- deep sea (jrhb) module Sound.SC3.Graph.JRHB_deep_sea where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}--rng :: UGen -> UGen -> UGen -> UGen-rng s l r =-    let m = (r - l) * 0.5-    in mulAdd s m (m + l)+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  deep_sea :: UGen deep_sea =@@ -22,7 +17,7 @@         count = pulseCount t 0         mul = count <* n         u1 = bpf (mul * t) f 1 * 0.1-        f2 = f * ((count `modE` rng (lfNoise1 'ε' KR 1) 2 20) + 1)+        f2 = f * ((count `modE` range (lfNoise1 'ε' KR 1) 2 20) + 1)         u2 = bpf u1 f2 1 * 0.2     in mrg [pan2 u2 pan (amp * 10)            ,detectSilence u2 0.0001 0.2 RemoveSynth]@@ -30,5 +25,5 @@ main :: IO () main = do   let s = synthdef "deep-sea" (out 0 deep_sea)-      p = pbind [(K_instr,psynth s),(K_dur,pxrand 'ζ' [0.25,0.5,1,2] inf)]-  audition p+      sc = P.sbind1 (s,[("dur",P.xrand 'ζ' [0.25,0.5,1,2])])+  audition sc
Sound/SC3/Graph/JRHB_dial_history_m.hs view
@@ -2,33 +2,30 @@ module Sound.SC3.Graph.JRHB_dial_history_m where  import Data.List {- base -}-import Sound.SC3.Monad {- hsc3 -}--rng :: UGen -> UGen -> UGen -> UGen-rng s = linLin s 0 1+import Sound.SC3 {- hsc3 -}  dial_history :: UId m => m UGen dial_history = do   let mfv = [[697,770,852,941],[1209,1336,1477,1633]]       numbers = [3,1] : [[a,b] | a <- [0..2],b <- [0..2]]       mce_r = mce . map mce-  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+  n <- dwhiteM dinf 7 12+  w <- dwhiteM 1 2 7+  b <- dbrownM n 0.1 0.2 0.01+  rate <- dseqM dinf (mce2 w b)+  q <- dseqM dinf (mce [1..10])+  g1 <- grayNoiseM AR+  g2 <- grayNoiseM AR+  d <- lfdNoise3M KR 0.5   let tr = trig (tDuty KR rate 0 DoNothing q 1) 0.09       pat = latch tr tr       x = mouseX KR 0 1 Linear 0.2       h = hasher (pat * x)-      which = trunc (rng h 0 (constant (length numbers))) 1+      which = trunc (linLin_u h 0 (constant (length numbers))) 1       both = select which (mce_r numbers)       dial = select both (mce_r (transpose mfv))       sig = sinOsc AR dial 0 * 0.05 * tr-      dsig = delayN sig 0.2 (rng d 0 0.01)+      dsig = delayN sig 0.2 (linLin_u d 0 0.01)       hiss = g1 * 0.01 + hpf (g2 * 0.02) 3000   return (dsig + hiss) 
Sound/SC3/Graph/JRHB_half_life.hs view
@@ -1,13 +1,13 @@ -- half-life (jrhb) module Sound.SC3.Graph.JRHB_half_life where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  half_life :: UGen half_life =   let t_half = 1/3.92       n_atoms = 1e+5-      n = max 0 (n_atoms - pulseCount (localIn 2 AR) 0)+      n = max 0 (n_atoms - pulseCount (localIn' 2 AR) 0)       activity = dust 'α' AR (n * log 2 * t_half)   in mrg [activity,localOut activity] 
Sound/SC3/Graph/JRHB_sam_i_am.hs view
@@ -4,9 +4,10 @@ import Control.Monad.Random {- MonadRandom -} import Data.List {- base -} import Data.Maybe {- base -}+ import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.Monad {- hsc3-lang -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  text :: [String] text =@@ -34,22 +35,23 @@         o = sinOsc AR f1 0 * pulse AR f2 0.5 * saw AR f3 * e     in synthdef "sam" (out 0 o) -b :: (RandomGen g,Floating n,Random n) => g -> [(String,[(Key,n)])]+b :: (Floating t, RandomGen g, Random t) => g -> [(String,(t,t,t,t))] b g =     let mk w = do           f1 <- exprand 200 9000           f2 <- exprand 20 9000           f3 <- exprand 20 9000           let d = 0.1 * fromIntegral (length w)-          return (w,[(K_param "freq1",f1)-                    ,(K_param "freq2",f2)-                    ,(K_param "freq3",f3)-                    ,(K_dur,d)])+          return (w,(f1,f2,f3,d))     in evalRand (mapM mk a) g  main :: IO () main = do   g <- getStdGen   let t = b g-      ae = mapMaybe (\w -> fmap e_from_list (lookup w t)) (concat x)-  audition (p_with (K_instr,psynth sam) (pseq (map return ae) 1))+      (f1,f2,f3,d) = unzip4 (mapMaybe (\w -> lookup w t) (concat x))+      p = [("freq1",f1)+          ,("freq2",f2)+          ,("freq3",f3)+          ,("dur",d)]+  audition (P.sbind1 (sam,p))
+ Sound/SC3/Graph/JR_jr_100515.hs view
@@ -0,0 +1,20 @@+-- http://permalink.gmane.org/gmane.comp.audio.supercollider.user/100515 (jr)+module Sound.SC3.Graph.JR_jr_100515 where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}+import System.Random {- random -}++pat :: UGen+pat = panAz 32 (sinOscFB AR 18 1.4) (sinOscFB AR 0.2 1.4) 1 2 0.5++mat :: Int -> UGen -> UGen+mat n x = splay (sinOscFB AR (expRandN n 'α' 1 11e3) x * x) 1 1 0 True++main :: IO ()+main = do+  let r = randomRs (1,64) (mkStdGen 245763)+      f (n0:n) = (mat n0 pat,n)+      f [] = undefined+  overlapTextureS (6,2,2,maxBound) f r
Sound/SC3/Graph/MN_k2ws.hs view
@@ -1,7 +1,7 @@ -- https://www.listarc.bham.ac.uk/lists/sc-users/msg21341.html (mn) module Sound.SC3.Graph.MN_k2ws where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  rng :: (UGen,UGen) -> UGen -> UGen rng (i,j) = range i j
Sound/SC3/Graph/MN_k2ws_hp.hs view
@@ -2,17 +2,17 @@ {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.MN_k2ws_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  k2ws :: UId m => m UGen k2ws = do-  let fc = 400 + range 100 200 #(lfNoise2 AR (mce2 1 2))-  let fm = range 100 200 #(lfNoise0 AR 5)-  let i = range 1 20 #(lfNoise1 AR 10)+  let fc = 400 + range 100 200 #(lfNoise2M AR (mce2 1 2))+  let fm = range 100 200 #(lfNoise0M AR 5)+  let i = range 1 20 #(lfNoise1M AR 10)   let x = sinOsc AR (fc + (sinOsc AR fm 0 * i * fm)) 0 * 0.5-  let rf = range 1000 2000 (sinOsc AR (range 0.1 1 #(lfNoise1 AR 1)) 0)-  let rq = range 0.5 10 #(lfNoise1 AR 1)-  let ph = rlpf x rf rq * range 1.0 4.0 #(lfNoise1 AR 0.1) * 4 * pi+  let rf = range 1000 2000 (sinOsc AR (range 0.1 1 #(lfNoise1M AR 1)) 0)+  let rq = range 0.5 10 #(lfNoise1M AR 1)+  let ph = rlpf x rf rq * range 1.0 4.0 #(lfNoise1M AR 0.1) * 4 * pi   return (sinOsc AR 0.2 ph * 0.5)  main :: IO ()
Sound/SC3/Graph/NC_after_goeyvaerts.hs view
@@ -6,7 +6,7 @@ import Data.List.Split {- split -} import qualified Data.Map as M {- containers -} import Sound.OSC.FD {- hosc -}-import Sound.SC3.ID.FD {- hsc3 -}+import Sound.SC3.FD {- hsc3 -} import qualified Sound.SC3.Lang.Collection as C {- hsc3-lang -} import qualified Sound.SC3.Lang.Random.Gen as R import System.Random {- random -}
Sound/SC3/Graph/NC_arpeggio.hs view
@@ -5,21 +5,24 @@ import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Pattern {- hsc3-lang -} +outk :: UGen -> UGen+outk = out (control KR "out" 0)++pan2k :: UGen -> UGen+pan2k s = pan2 s (control KR "pan" 0) (control KR "amp" 0.1)+ analogarpeggio :: Synthdef analogarpeggio =     let k = control KR-        o = k "out" 0-        p = k "pan" 0         g = k "gate" 1         f = k "freq" 440-        a = k "amp" 0.1         c = k "cutoffmult" 3         r = k "res" 0.1         e = let d = envADSR 0.01 0.3 0.5 1 1 (EnvNum (-4)) 0             in envGen AR g 1 0 1 RemoveSynth d         i = mix (saw AR (f * mce [0.497,0.999,1.0,2.03]))         s = bLowPass i (c * f) r * 0.25-    in synthdef "analogarpeggio" (out o (pan2 (e * s * a) p 0.25))+    in synthdef "analogarpeggio" (outk (pan2k (e * s)))  {- audition (pbind [(K_instr,psynth analogarpeggio)@@ -84,4 +87,4 @@ main = do   let n = 60/157       p = pedit K_dur (* n) (pbind arpeggio)-  withSC3 (play p)+  paudition p
Sound/SC3/Graph/NP_pebble_beach.hs view
@@ -3,8 +3,7 @@ -- requires 'scsynth -u 57110 -m 32768' module Sound.SC3.Graph.NP_pebble_beach where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -}  exprange :: UGen -> UGen -> UGen -> UGen exprange l r i = linExp i (-1) 1 l r
+ Sound/SC3/Graph/NV_nv_ml_2014_06_03.hs view
@@ -0,0 +1,18 @@+-- sc-users, 2014-06-03 (nv)+module Sound.SC3.Graph.NV_nv_ml_2014_06_03 where++import Sound.SC3 {- hsc3 -}++nv_ml_2014_06_03 :: UGen+nv_ml_2014_06_03 =+    let y = mouseY KR 1 100 Linear 0.2+        x = mouseX KR 50 400 Exponential 0.2+        i = decay (impulse AR 0.5 0) 0.1+        i' = sin (bpf (i * y) 50 1)+    in pluck i' (lfSaw AR 10000 0) 0.1 (1 / x) 4 0.5++repl :: Int -> UGen -> UGen+repl n = mce . replicate n++main :: IO ()+main = audition (out 0 (repl 2 nv_ml_2014_06_03))
Sound/SC3/Graph/NV_nv_tw_1.hs view
@@ -1,8 +1,7 @@ -- http://sccode.org/1-V (nv) module Sound.SC3.Graph.NV_nv_tw_1 where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -}  nv_tw_1 :: UGen nv_tw_1 =
+ Sound/SC3/Graph/NV_nv_tw_2013_01_11.hs view
@@ -0,0 +1,34 @@+-- https://twitter.com/headcube/status/289761321065541633 (nv)+module Sound.SC3.Graph.NV_nv_tw_2013_01_11 where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Collection {- hsc3-lang -}++mce_concat :: [UGen] -> UGen+mce_concat = mce . concat . map mceChannels++mce_rotate :: Integral i => i -> UGen -> UGen+mce_rotate n = mce . rotate n . mceChannels++-- > length (mceChannels nv_tw_2013_01_11) == 100+nv_tw_2013_01_11 :: UGen+nv_tw_2013_01_11 =+    let nc = 80+        i = inFeedback nc 20+        n = (uclone 'α' nc (lfNoise1 'β' KR 1e-3 + 1)) / constant nc+        j = combL (lpf i 2e3) 1 n 0.05+        d = uclone 'γ' nc (dust2 'δ' AR 0.01)+        x = sin (j + d)+    in mce_concat [splay x 1 1 0 True+                  ,mce (replicate 18 0)+                  ,(x - mce_rotate 1 x) / 2]++main :: IO ()+main = audition (out 0 nv_tw_2013_01_11)++main_w :: IO ()+main_w = do+  let sy = synthdef "nv_tw_2013_01_11" (out 0 nv_tw_2013_01_11)+  synthdefWrite sy "/tmp"+  withSC3 (do _ <- async (d_load "/tmp/nv_tw_2013_01_11.scsyndef")+              send (s_new "nv_tw_2013_01_11" (-1) AddToTail 1 []))
+ Sound/SC3/Graph/NV_nv_tw_2013_12_04.hs view
@@ -0,0 +1,22 @@+-- https://twitter.com/headcube/status/408145586970324992 (nv)+module Sound.SC3.Graph.NV_nv_tw_2013_12_04 where++import Sound.SC3 {- hsc3 -}++mean :: Fractional a => [a] -> a+mean l = sum l / fromIntegral (length l)++f :: UGen -> UGen+f j =+    let i = j + 1;+        a = saw AR ((1 / i + 1) / 6)+        p = pluck a a 1 (1 / i / (3 - lfPulse AR (1 / i) 0 0.5) / 30) 9 (0.9 / i)+        x = (0.5 ** i) * p+        o = sinOsc AR 2 0 + mce2 4 9+    in combC x 1 (o * 1e-3) 0 - x++nv :: UGen+nv = mean (map f [0 .. 8]) / 9++main :: IO ()+main = audition (out 0 nv)
+ Sound/SC3/Graph/NV_nv_tw_2014_02_21.hs view
@@ -0,0 +1,29 @@+-- https://twitter.com/headcube/status/437094206767513600 (nv)+-- requires -m at scsynth+module Sound.SC3.Graph.NV_nv_tw_2014_02_21 where++import Sound.SC3 {- hsc3 -}++x :: UGen+x = impulse AR 0.05 0++-- > audition (out 0 (f x))+f :: UGen -> UGen+f i =+    let n e = lfNoise2 e KR+        a = allpassL (leakDC i 0.995) 4 ((8 ** n 'α' 0.1) / 2) 8 * 1.2+    in tanh (lpf a ((8 ** n 'β' (mce2 (rand 'γ' 0 0.1) (rand 'δ' 0 0.1))) * 2500))++-- > audition (out 0 y)+y :: UGen+y = useq 'ε' 20 f x * 5++-- > audition (out 0 z)+z :: UGen+z = mix (uclone 'ζ' 4 y)++z_opt :: UGen+z_opt = ugen_optimise_ir_rand z++main :: IO ()+main = audition (out 0 z_opt)
+ Sound/SC3/Graph/NV_nv_tw_2014_06_03.hs view
@@ -0,0 +1,36 @@+-- https://twitter.com/headcube/status/474064500564324352 (nv)+-- requires -m at scsynth+-- inaccurate...+module Sound.SC3.Graph.NV_nv_tw_2014_06_03 where++import Sound.SC3 {- hsc3 -}++-- > audition (out 0 p)+p :: UGen+p = lfPulse AR (2 ** rand 'α' (-9) 1) (rand 'β' 0 2 / 2) 0.5++q :: Int -> UGen+q i = product (uclone' 'γ' (i + 2) p) / (1 + constant i) + 1++-- > audition (out 0 s)+s :: UGen+s =+    let f = product (uprotect' 'δ' (map q [0 .. 7])) * 86+    in pluck (sin (bpf f f 1)) (saw AR 440) 1 (1 / f) 9 0.5++nv :: UGen+nv = splay (uclone 'ε' 9 s) 1 1 0 True++-- > audition (out 0 nv_opt)+nv_opt :: UGen+nv_opt = ugen_optimise_const_operator (ugen_optimise_ir_rand nv)++-- > via_disk (out 0 nv)+via_disk :: UGen -> IO ()+via_disk u = do+  let sy = synthdef "nv" u+  synthdefWrite sy "/tmp"+  withSC3 (async (d_load "/tmp/nv.scsyndef") >> send (s_new "nv" (-1) AddToHead 1 []))++main :: IO ()+main = audition (out 0 nv_opt)
Sound/SC3/Graph/NV_nv_tw_41.hs view
@@ -1,15 +1,16 @@ -- http://sccode.org/1-V (nv) module Sound.SC3.Graph.NV_nv_tw_41 where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  nv_tw_41 :: UGen nv_tw_41 =-    let nd i =-            let t = (0.6 ** i) * 40 * impulse AR ((2 ** i) / 32) (1/2)-                f = (4 ** lfNoise0 i KR (1/16)) * 300+    let nd z =+            let i = constant z+                t = (0.6 ** i) * 40 * impulse AR ((2 ** i) / 32) (1/2)+                f = (4 ** lfNoise0 z KR (1/16)) * 300             in sin (rlpf t f 5e-3)-        x = splay (mce (map nd [0..7])) 1 1 0 True+        x = splay (mce (map nd [0::Int .. 7])) 1 1 0 True         r u = let (p,q) = mce2c u in freeVerb2 p q 0.1 1 1     in r (r x) 
Sound/SC3/Graph/NV_nv_tw_54.hs view
@@ -2,7 +2,7 @@ module Sound.SC3.Graph.NV_nv_tw_54 where  import Sound.SC3 {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Bind as P {- hsc3-lang -}  fF :: Double -> Double -> Double fF i f =@@ -25,8 +25,7 @@  main :: IO () main =-    let fS' = map realToFrac fS-    in audition (pbind [(K_instr,psynth nvi)-                       ,(K_param "f",toP fS')-                       ,(K_param "i",pseries 0 1 inf)-                       ,(K_dur,0.3)])+    let p = [("f",fS)+            ,("i",[0..])+            ,("dur",repeat 0.3)]+    in audition (P.sbind1 (nvi,p))
Sound/SC3/Graph/PJ_forest_sounds_m.hs view
@@ -1,12 +1,12 @@ -- sc-users, 2007-04-06 (pj) [paul jones] module Sound.SC3.Graph.PJ_forest_sounds_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  insects :: UId m => m UGen insects = do-  n1 <- brownNoise AR-  n2 <- lfNoise2 KR 50+  n1 <- brownNoiseM AR+  n2 <- lfNoise2M KR 50   let o = sinOsc KR (n2 * 50 + 50) 0 * 100 + 2000   return (bpf n1 o 0.001 * 10) 
Sound/SC3/Graph/RD_bs_070705_m.hs view
@@ -2,7 +2,7 @@ module Sound.SC3.Graph.RD_bs_070705_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO {- hsc3-lang -}  -- | One step in a bubble sort with specified /greater than/ function.@@ -32,10 +32,10 @@ play_data :: (UId m,Transport m) => UGen -> m () play_data r = do   let inf_sc = 9e8-  phase <- dseries inf_sc 0 1-  f' <- dbufrd 10 phase Loop-  a' <- dbufrd 11 phase Loop-  p' <- dbufrd 12 phase Loop+  phase <- dseriesM inf_sc 0 1+  f' <- dbufrdM 10 phase Loop+  a' <- dbufrdM 11 phase Loop+  p' <- dbufrdM 12 phase Loop   let tr = impulse AR r 0       f'' = demand tr 0 f'       a'' = demand tr 0 a'
Sound/SC3/Graph/RD_ccomb_m.hs view
@@ -1,21 +1,20 @@ -- ccomb (rd) module Sound.SC3.Graph.RD_ccomb_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  ccomb :: (Functor m,UId m) => m UGen ccomb = do-  let rng l r i = linLin i (-1) 1 l r-      lwr = 48+  let lwr = 48       flwr = midiCPS lwr-      spart t = do n <- fmap (rng lwr 72.0) (lfNoise2 KR 0.1)-                   e <- fmap (decay2 t 0.01) (tRand 0.05 0.75 t)-                   x <- fmap (* e) (whiteNoise AR)-                   m <- lfNoise2 KR 0.1+      spart t = do n <- fmap (range lwr 72.0) (lfNoise2M KR 0.1)+                   e <- fmap (decay2 t 0.01) (tRandM 0.05 0.75 t)+                   x <- fmap (* e) (whiteNoiseM AR)+                   m <- lfNoise2M KR 0.1                    let f = lag (midiCPS n) 0.25-                       m' = rng 1 8 m+                       m' = range 1 8 m                    return (combC x (recip flwr) (recip f) m')-  t <- dust KR (mce2 0.75 0.35)+  t <- dustM KR (mce2 0.75 0.35)   return . (* 0.1) . sum =<< sequence (replicate 12 (spart t))  main :: IO ()
Sound/SC3/Graph/RD_cds_070701_m.hs view
@@ -8,7 +8,7 @@ module Sound.SC3.Graph.RD_cds_070701_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  -- | Real type R = Double@@ -68,11 +68,11 @@ play_data :: IO () play_data = do   let inf_sc = 9e8-  phase <- dseries inf_sc 0 1-  t' <- dbufrd 10 phase Loop-  f' <- dbufrd 11 phase Loop-  a' <- dbufrd 12 phase Loop-  p' <- dbufrd 13 phase Loop+  phase <- dseriesM inf_sc 0 1+  t' <- dbufrdM 10 phase Loop+  f' <- dbufrdM 11 phase Loop+  a' <- dbufrdM 12 phase Loop+  p' <- dbufrdM 13 phase Loop   let tr = tDuty AR t' 0 DoNothing 1 0       f'' = demand tr 0 f'       a'' = demand tr 0 a'
Sound/SC3/Graph/RD_chrd_m.hs view
@@ -1,14 +1,14 @@ -- chrd (rd) module Sound.SC3.Graph.RD_chrd_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  chrd :: UId m => m UGen 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+  r0 <- randM 0.05 0.5+  [r1, r2] <- sequence (replicate 2 (randM (-1) 1))+  r3 <- randM 0.15 0.35+  r4 <- randM 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])
Sound/SC3/Graph/RD_cricket_m.hs view
@@ -2,17 +2,17 @@ module Sound.SC3.Graph.RD_cricket_m where  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  cricket :: UId m => m UGen cricket = do-  r1 <- clone 2 (rand 10 13)-  r2 <- clone 2 (rand 10 13)-  r3 <- clone 2 (rand 4 7)+  r1 <- clone 2 (randM 10 13)+  r2 <- clone 2 (randM 10 13)+  r3 <- clone 2 (randM 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-  r4 <- clone 2 (tRand 2130 2230 t)+  r4 <- clone 2 (tRandM 2130 2230 t)   return (sinOsc AR r4 0 * f * 0.25)  main :: IO ()
Sound/SC3/Graph/RD_crotale.hs view
@@ -1,7 +1,7 @@ -- crotale (rd) module Sound.SC3.Graph.RD_crotale where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  crotale :: UGen crotale =
Sound/SC3/Graph/RD_crotale_sine.hs view
@@ -1,8 +1,8 @@ -- crotale-sine (rd) module Sound.SC3.Graph.RD_crotale_sine where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  crotale_sine :: UGen crotale_sine =@@ -12,27 +12,28 @@         e = let p = envASR 1 1 1 (EnvNum (-4))             in envGen KR g 1 0 1 RemoveSynth p         fn m' f' a' =-            let f = constant f'+            let k = floor f' :: Int+                f = constant f'                 a = constant a'-                r0 = rand (f+0) 0 (2 * pi)-                r1 = rand (f+1) 0.1 0.3-                r2 = rand (f+2) 0.025 0.1-                r3 = rand (f+3) 0 (2 * pi)+                r0 = rand (k + 0) 0 (2 * pi)+                r1 = rand (k + 1) 0.1 0.3+                r2 = rand (k + 2) 0.025 0.1+                r3 = rand (k + 3) 0 (2 * pi)                 o = sinOsc AR (f * midiRatio (m' - 12)) r0                 e' = e * sinOsc KR r1 0 * a             in pan2 o (sinOsc KR r2 r3) e'     in sum (zipWith (fn m) cf ca) * 0.1 -pattern :: [P_Bind]+pattern :: P.Param pattern =-    [(K_param "m",pwhitei 'α' 0 12 inf)-    ,(K_dur,pxrand 'β' [1,2,3] inf)-    ,(K_sustain,6)]+    [("m",map roundE (P.white 'α' 0 12))+    ,("dur",P.xrand 'β' [1,2,3])+    ,("sustain",repeat 6)]  main :: IO () main = do   let s = synthdef "crotale-sine" (out 0 crotale_sine)-  audition (p_with (K_instr,psynth s) (pbind pattern))+  audition (P.sbind1 (s,pattern))  crotale_data :: ([Double],[Double]) crotale_data =
Sound/SC3/Graph/RD_cut_outs_m.hs view
@@ -1,19 +1,19 @@ -- cut-outs (rd) module Sound.SC3.Graph.RD_cut_outs_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  cut_outs :: (Functor m,UId m) => m UGen cut_outs = do   let t = impulse AR 22 0 * (sinOsc KR 0.5 0 + 1)       x = mouseX KR 0.005 0.12 Exponential 0.1       y = mouseY KR 0.01 0.52 Exponential 0.1-      n = do n1 <- lfNoise0 KR 2-             n2 <- coinGate (0.05 + n1 + y * 0.4 + t * 0.5) (t * 0.5)-             n3 <- tExpRand (mce2 500 900) 1600 t+      n = do n1 <- lfNoise0M KR 2+             n2 <- coinGateM (0.05 + n1 + y * 0.4 + t * 0.5) (t * 0.5)+             n3 <- tExpRandM (mce2 500 900) 1600 t              return (ringz n2 n3 x)   s <- fmap sum (sequence (replicate 3 n))-  b <- tRand 0 1 =<< dust KR 8+  b <- tRandM 0 1 =<< dustM KR 8   return (mrg [clip2 s (in' 1 KR 0) * 0.25,out 0 b])  main :: IO ()
Sound/SC3/Graph/RD_diffraction_m.hs view
@@ -2,25 +2,25 @@ module Sound.SC3.Graph.RD_diffraction_m where  import Control.Monad {- base -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  diffraction ::(Functor m,UId m) => m UGen diffraction = do   let p = do let x = mouseX KR 0.001 0.02 Exponential 0.1                  y = mouseY KR 120 400 Exponential 0.1-             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+             f <- fmap (* mce2 32 64) (lfNoise0M KR 4)+             w <- fmap (* x) (lfNoise0M KR 32)+             z <- fmap (* 0.1) (lfNoise0M KR 2)+             m <- lfNoise0M KR 6              let s = pulse AR f w              return (resonz s (y + z) (m * 0.4 + 0.8) * 0.5)-      q = do n <- lfNoise0 KR 128+      q = do n <- lfNoise0M KR 128              s <- p              return (combN s 0.2 (n * 0.1 + 0.1) 3)       r = let x = mouseX KR 0.75 1.25 Exponential 0.1               y = mouseY KR 0.25 1 Exponential 0.1-              f _ = do fr <- fmap (* x) (rand 50 59)-                       am <- fmap (* y) (rand 0.04 0.16)+              f _ = do fr <- fmap (* x) (randM 50 59)+                       am <- fmap (* y) (randM 0.04 0.16)                        return (sinOsc AR fr 0 * am)           in liftM2 mce2 (mixFillM 16 f) (mixFillM 12 f)   fmap sum (sequence [p,q,r])
Sound/SC3/Graph/RD_discretion.hs view
@@ -1,9 +1,8 @@ -- discretion (rd) module Sound.SC3.Graph.RD_discretion where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  discretion :: UGen discretion =
Sound/SC3/Graph/RD_discretion_m.hs view
@@ -1,15 +1,15 @@ -- discretion-m (rd) module Sound.SC3.Graph.RD_discretion_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  discretion :: UId m => m UGen discretion = do   let mkls bp t = envGen KR 1 1 0 1 RemoveSynth (envCoord bp t 1 EnvLin)-      part = do f1 <- clone 2 (rand 50 55)-                f2 <- clone 2 (rand 50 65)-                f3 <- clone 2 (rand 50 55)-                a <- clone 2 (rand 0.01 0.035)+      part = do f1 <- clone 2 (randM 50 55)+                f2 <- clone 2 (randM 50 65)+                f3 <- clone 2 (randM 50 55)+                a <- clone 2 (randM 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
Sound/SC3/Graph/RD_e_lamell.hs view
@@ -3,7 +3,7 @@  import Control.Monad import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Random.IO as R {- hsc3-lang -}  e_lamell :: UGen
Sound/SC3/Graph/RD_e_lamell_p.hs view
@@ -1,8 +1,8 @@ -- e-lamell-p (rd) module Sound.SC3.Graph.RD_e_lamell_p where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  e_lamell :: UGen e_lamell =@@ -19,25 +19,22 @@         e = envGen AR 1 a 0 1 RemoveSynth e_d     in pan2 s l e -patterns :: [[P_Bind]]+patterns :: [(Synthdef,P.Param)] patterns =-    let i = psynth (synthdef "e-lamell" (out 0 e_lamell))-    in [[(K_instr,i)-        ,(K_note,prand 'β' [0,2,5,7] inf)-        ,(K_octave,pwrand 'γ' [2,3,4,5] [0.2,0.35,0.35,0.1] inf)-        ,(K_dur,0.1)-        ,(K_param "d",pwhite 'δ' 0.01 0.8 inf)-        ,(K_amp,pwhite 'ε' 0 0.75 inf)-        ,(K_param "n",pwhite 'ζ' 2 36 inf)-        ,(K_param "l",pwhite 'η' (-1) 1 inf)]-       ,[(K_instr,i)-        ,(K_note,prand 'θ' [0] inf)-        ,(K_octave,prand 'ι' [2,3] inf)-        ,(K_dur,0.1)-        ,(K_param "d",pwhite 'κ' 0.01 1.2 inf)-        ,(K_amp,prand 'λ' [0,0.25,0.5,1] inf)-        ,(K_param "n",pwhite 'μ' 2 36 inf)-        ,(K_param "l",pwhite 'ν' (-1) 1 inf)]]+    let sy = synthdef "e-lamell" (out 0 e_lamell)+        to_cps = P.degree_to_cps' [0,2,4,5,7,9,11] 12+    in [(sy,[("freq",to_cps (P.rand 'β' [0,2,5,7]) (P.wrand 'γ' [2,3,4,5] [0.2,0.35,0.35,0.1]))+            ,("dur",repeat 0.1)+            ,("d",P.white 'δ' 0.01 0.8)+            ,("amp",P.white 'ε' 0 0.75)+            ,("n",P.white 'ζ' 2 36)+            ,("l",P.white 'η' (-1) 1)])+       ,(sy,[("freq",to_cps (P.rand 'θ' [0]) (P.rand 'ι' [1,2,3]))+            ,("dur",repeat 0.1)+            ,("d",P.white 'κ' 0.01 1.2)+            ,("amp",P.rand 'λ' [0,0.25,0.5,1])+            ,("n",P.white 'μ' 2 36)+            ,("l",P.white 'ν' (-1) 1)])]  main :: IO ()-main = audition (ppar (map pbind patterns))+main = audition (P.sbind patterns)
Sound/SC3/Graph/RD_eggcrate.hs view
@@ -1,7 +1,7 @@ -- eggcrate (rd) module Sound.SC3.Graph.RD_eggcrate where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  atp :: (t -> u) -> (t,t) -> (u,u) atp f (i,j) = (f i,f j)@@ -15,8 +15,8 @@       (x,y) = atp (`brownNoise` KR) ('α','β')       t = dust 'γ' KR 2.4       (f0,f1) = atp (\z -> tChoose z t p) ('δ','ε')-      f = linLin (eggcrate_f x y) (-1) 1 f0 f1-      a = linLin x (-1) 1 0 0.1+      f = linLin_b (eggcrate_f x y) f0 f1+      a = linLin_b x 0 0.1  in pan2 (mix (sinOsc AR f 0)) y a  main :: IO ()
Sound/SC3/Graph/RD_eggcrate_m.hs view
@@ -1,7 +1,7 @@ -- eggcrate-m (rd) module Sound.SC3.Graph.RD_eggcrate_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  eggcrate :: UId m => m UGen eggcrate = do@@ -9,11 +9,11 @@       sinu = sin . (* pi)       eggcrate_f u v = cosu u * sinu v       p = mce [64,72,96,128,256,6400,7200,8400,9600]-  [x,y] <- sequence (replicate 2 (brownNoise KR))-  t <- dust KR 2.4-  [f0,f1] <- sequence (replicate 2 (tChoose t p))-  let f = linLin (eggcrate_f x y) (-1) 1 f0 f1-      a = linLin x (-1) 1 0 0.1+  [x,y] <- sequence (replicate 2 (brownNoiseM KR))+  t <- dustM KR 2.4+  [f0,f1] <- sequence (replicate 2 (tChooseM t p))+  let f = linLin_b (eggcrate_f x y) f0 f1+      a = linLin_b x 0 0.1   return (pan2 (mix (sinOsc AR f 0)) y a)  main :: IO ()
Sound/SC3/Graph/RD_f_lets_m.hs view
@@ -1,22 +1,22 @@ -- f-lets (rd) module Sound.SC3.Graph.RD_f_lets_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  f_lets :: (Functor m,UId m) => m UGen f_lets = do   let f_let t g j n f = do            let pd = pulseDivider t j 0-           r0 <- tIRand (mce2 2 1) n pd-           r1 <- tRand 0.01 0.04 pd-           r2 <- tRand 0.05 0.10 pd+           r0 <- tIRandM (mce2 2 1) n pd+           r1 <- tRandM 0.01 0.04 pd+           r2 <- tRandM 0.05 0.10 pd            return (formlet pd (f * r0) r1 r2 * g)       mk_n t = do-           r0 <- tRand 0 1 t-           r1 <- tRand 0 1 t-           r2 <- tRand 0 1 t-           r3 <- tRand 0 1 t-           r4 <- coinGate 0.2 t+           r0 <- tRandM 0 1 t+           r1 <- tRandM 0 1 t+           r2 <- tRandM 0 1 t+           r3 <- tRandM 0 1 t+           r4 <- coinGateM 0.2 t            sequence [f_let t 0.15 2 9 (mce2 200 400)                     ,f_let t 0.25 2 9 (mce2 (200 + r0) (400 + r1))                     ,f_let t 0.05 4 5 (mce2 25 50)@@ -24,7 +24,7 @@                     ,let lr = fmap (* latch r4 t)                      in lr (f_let t 0.5 1 16 (mce2 300 600))]       tr = impulse AR 24 0-  n <- lfNoise0 KR 2+  n <- lfNoise0M KR 2   return . (* (n * 0.25 + 0.25)) . sum =<< mk_n tr  main :: IO ()
Sound/SC3/Graph/RD_fb_090531.hs view
@@ -8,8 +8,8 @@  fb_090531 :: UGen fb_090531 =-    let k_in n = linLin (in' 1 KR n) (-1) 1-        p = localIn 1 AR+    let k_in n = linLin_b (in' 1 KR n)+        p = localIn' 1 AR         bt = recip controlRate         ig_f = k_in 0 1 20         ig = impulse AR ig_f 0
Sound/SC3/Graph/RD_fbl_fbf.hs view
@@ -1,7 +1,7 @@ -- fbl-fbf (rd) module Sound.SC3.Graph.RD_fbl_fbf where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  fbl :: UGen -> [UGen] -> [UGen] -> [UGen] -> (UGen, UGen) fbl l i d g =@@ -27,7 +27,7 @@       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+      (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]
Sound/SC3/Graph/RD_feedr_m.hs view
@@ -3,22 +3,23 @@ module Sound.SC3.Graph.RD_feedr_m where  import Sound.OSC.FD {- hosc -}-import Sound.SC3.Monad.FD {- hsc3 -}+import Sound.SC3.FD {- hsc3 -}  delayWr :: UGen -> UGen -> UGen delayWr b = recordBuf AR b 0 1 0 1 Loop 0 DoNothing -tap :: Int -> UGen -> UGen -> UGen-tap nc b dt = playBuf nc AR b 1 0 (dt * (- sampleRate)) Loop DoNothing+tap' :: Int -> UGen -> UGen -> UGen+tap' nc b dt = playBuf nc AR b 1 0 (dt * (- sampleRate)) Loop DoNothing  type State = (UGen,Double) +-- > u <- feedr (mce2 0 1,6) 18 feedr :: (UId m) => State -> Int -> m UGen feedr (ch,dl) 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+  t <- sequence (replicate n (randM 0.0 (constant dl)))+  g <- sequence (replicate n (randM 0.4 1.0))+  f <- sequence (replicate n (randM 0.9 0.95))+  let d = zipWith (\p q -> tap' 2 10 p * q) t g       x = mouseX KR 0.02 1.0 Exponential 0.1       s = clip2 (leakDC (hpf (sum d) 20) 0.995) 1       i = soundIn ch@@ -32,6 +33,6 @@   audition =<< feedr (ch,dl) 18  main :: IO ()-main = withSC3 (run (mce2 4 5,6))+main = withSC3 (run (mce2 0 1,6))  -- withSC3 (\fd -> send fd (b_zero 10))
Sound/SC3/Graph/RD_fm_iter.hs view
@@ -1,7 +1,7 @@ -- fm-iter (rd) module Sound.SC3.Graph.RD_fm_iter where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  -- audition (out 0 fm_iter)
Sound/SC3/Graph/RD_fm_kltr_m.hs view
@@ -2,15 +2,15 @@ module Sound.SC3.Graph.RD_fm_kltr_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad as U {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO {- hsc3-lang -}  fm_kltr :: UId m => m UGen fm_kltr = do-  r1 <- U.rand 0.975 1.025-  r2 <- U.rand 0.5 1.5-  r3 <- U.rand 0.975 1.025-  r4 <- U.rand 0.75 1.25+  r1 <- randM 0.975 1.025+  r2 <- randM 0.5 1.5+  r3 <- randM 0.975 1.025+  r4 <- randM 0.75 1.25   let o = control IR "out" 0       a = control KR "amp" 0.1       d = control KR "dur" 0.1
Sound/SC3/Graph/RD_fm_kltr_p.hs view
@@ -1,8 +1,8 @@ -- fm-kltr-p (rd) module Sound.SC3.Graph.RD_fm_kltr_p where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  fm_kltr :: UGen fm_kltr =@@ -25,17 +25,15 @@       l = line KR p (p * r4) dt DoNothing   in out o (pan2 (sinOsc AR m 0) l e) -pattern :: [P_Bind]+pattern :: P.Param pattern =-    [(K_instr,psynth (synthdef "fm_kltr" fm_kltr))-    ,(K_freq,fmap midiCPS 53)-    ,(K_param "freq2",fmap midiCPS (pwhitei 'ε' 48 96 inf +-                                    pwhite 'ζ' (-1) 1 inf))-    ,(K_amp,pwhite 'η' 0.1 0.4 inf)-    ,(K_dur,pwhite 'θ' 0.15 1.25 inf)-    ,(K_sustain,pwhite 'ι' 5 6 inf)-    ,(K_param "index",pwhite 'κ' 240 1480 inf)-    ,(K_param "pan", pwhite 'λ' (-1) 1 inf)]+    [("freq",repeat (midiCPS 53))+    ,("freq2",map midiCPS (P.white 'α' 48 96))+    ,("amp",P.white 'β' 0.1 0.4)+    ,("dur",P.white 'γ' 0.15 1.25)+    ,("sustain",P.white 'δ' 5 6)+    ,("index",P.white 'ε' 240 1480)+    ,("pan",P.white 'ζ' (-1) 1)]  main :: IO ()-main = audition (pbind pattern)+main = audition (P.sbind1 (synthdef "fm_kltr" fm_kltr,pattern))
Sound/SC3/Graph/RD_fwalk_m.hs view
@@ -2,13 +2,13 @@ module Sound.SC3.Graph.RD_fwalk_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  fwalk' :: UId m => UGen -> m UGen fwalk' r = do-  t <- dust KR 3-  r1 <- tIRand 0 6 t-  r2 <- tRand (-0.0001) 0.0001 t+  t <- dustM KR 3+  r1 <- tIRandM 0 6 t+  r2 <- tRandM (-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
Sound/SC3/Graph/RD_h_chatter_m.hs view
@@ -1,28 +1,27 @@ -- h-chatter (rd) module Sound.SC3.Graph.RD_h_chatter_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  h_chatter :: UId m => m UGen h_chatter = do   let mma m a = return . (+ a)  . (* m)-      h0 = do n <- mma 5 5 =<< lfNoise0 KR 1-              a <- mma 0.2 1.2 =<< lfNoise2 KR n-              b <- mma 0.15 0.15 =<< lfNoise2 KR n+      h0 = do n <- mma 5 5 =<< lfNoise0M KR 1+              a <- mma 0.2 1.2 =<< lfNoise2M KR n+              b <- mma 0.15 0.15 =<< lfNoise2M KR n               let f = 40                   h = henonN AR (mce2 f (f * 0.5)) a b 0 0               return (saw AR (h * 3200 + 1600) * 0.35)-      h1 = do n0 <- lfNoise0 KR 32-              n1 <- lfNoise0 KR 2+      h1 = do n0 <- lfNoise0M KR 32+              n1 <- lfNoise0M KR 2               let a = mouseX KR 1.2 1.4 Linear 0.1                   b = mouseY KR 0.2 0.3 Linear 0.1-                  wrp i = linLin i (-1) 1-                  h = wrp n0 1 32-                  p = wrp n1 2400 3200-                  l = wrp n1 (-0.75) 0.75-                  g = wrp n1 0.55 0.85+                  h = linLin_b n0 1 32+                  p = linLin_b n1 2400 3200+                  l = linLin_b n1 (-0.75) 0.75+                  g = linLin_b n1 0.55 0.85                   f = 40-                  o = blip AR (wrp (henonN AR f a b 0 0) p (p * 2)) h+                  o = blip AR (linLin_b (henonN AR f a b 0 0) p (p * 2)) h               return (pan2 o l g * 0.35)   h0 .+. h1 
Sound/SC3/Graph/RD_implosion_m.hs view
@@ -1,7 +1,7 @@ -- implosion (rd) module Sound.SC3.Graph.RD_implosion_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  mkls :: [(UGen,UGen)] -> UGen -> UGen mkls bp t =@@ -15,17 +15,16 @@ pmr_n rt l0 l1 r0 r1 d = do   let le = mkrmp l0 r0 d       re = mkrmp l1 r1 d-      wrp i = linLin i (-1) 1-  n <- whiteNoise rt-  return (wrp n le re)+  n <- whiteNoiseM rt+  return (linLin_b n le re)  implosion :: UId m => m UGen implosion = do-  n0 <- rand (-1) 0-  n1 <- rand 0 1-  d  <- rand 7.5 13.5-  f0 <- rand 10990 16220-  f1 <- rand  9440 19550+  n0 <- randM (-1) 0+  n1 <- randM 0 1+  d  <- randM 7.5 13.5+  f0 <- randM 10990 16220+  f1 <- randM  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
Sound/SC3/Graph/RD_k_ppr.hs view
@@ -1,21 +1,19 @@ -- k-ppr (rd) module Sound.SC3.Graph.RD_k_ppr where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -}  k_ppr :: UGen k_ppr =-  let wrp i = linLin i (-1) 1-      x = mouseX KR 0.05 0.35 Linear 0.1+  let x = mouseX KR 0.05 0.35 Linear 0.1       y = mouseY KR 0.15 0.75 Linear 0.1       ti = lfTri KR x 0-      tf = wrp ti 100 200+      tf = linLin_b ti 100 200       t = impulse AR tf 0       stream e lf rf ld rd g =           let r1 = rand e 9 18               t' = pulseDivider t r1 0-              r2 = tRand e lf (wrp ti lf rf) t'+              r2 = tRand e lf (linLin_b ti lf rf) t'               r3 = tRand e ld rd t'           in ringz (decay2 t' 0.01 0.5) r2 (r3 * y) * g       s1 = stream 'α' 3140 6240 0.050 0.005 0.15
Sound/SC3/Graph/RD_k_ppr_m.hs view
@@ -1,21 +1,20 @@ -- k-ppr-m (rd) module Sound.SC3.Graph.RD_k_ppr_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  k_ppr_m :: UId m => m UGen k_ppr_m = do-  let wrp i = linLin i (-1) 1-      x = mouseX KR 0.05 0.35 Linear 0.1+  let x = mouseX KR 0.05 0.35 Linear 0.1       y = mouseY KR 0.15 0.75 Linear 0.1       ti = lfTri KR x 0-      tf = wrp ti 100 200+      tf = linLin_b ti 100 200       t = impulse AR tf 0       stream lf rf ld rd g =-          do r1 <- rand 9 18+          do r1 <- randM 9 18              let t' = pulseDivider t r1 0-             r2 <- tRand lf (wrp ti lf rf) t'-             r3 <- tRand ld rd t'+             r2 <- tRandM lf (linLin_b ti lf rf) t'+             r3 <- tRandM 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
Sound/SC3/Graph/RD_klink.hs view
@@ -1,7 +1,7 @@ -- klink (rd) module Sound.SC3.Graph.RD_klink where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  klink :: UGen klink =
Sound/SC3/Graph/RD_lf_pulses.hs view
@@ -1,7 +1,7 @@ -- lf pulses (rd) module Sound.SC3.Graph.RD_lf_pulses where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  lf_pulses :: UGen lf_pulses =
Sound/SC3/Graph/RD_lg_timed_m.hs view
@@ -1,14 +1,14 @@ -- lg-timed (rd) module Sound.SC3.Graph.RD_lg_timed_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  lg_timed :: UId m => m UGen lg_timed = do   let timed r y p =-          do d0 <- dser r p-             d1 <- dcons 0 d0-             d2 <- dser r y+          do d0 <- dserM r p+             d1 <- dconsM 0 d0+             d2 <- dserM r y              let t = tDuty AR d1 0 RemoveSynth d2 1              return (latch t t)       lg u = return (lag u 0.03)
Sound/SC3/Graph/RD_lso_061101_m.hs view
@@ -2,15 +2,17 @@ module Sound.SC3.Graph.RD_lso_061101_m where  import Control.Monad {- base -}+import System.Directory {- directory -}+import qualified System.FilePath as P {- filepath -}+ import Graphics.PS {- hps -} import qualified LSystem.LSystem as L {- hls -} import qualified LSystem.Systems as L import qualified LSystem.Turtle as L+ import qualified Sound.File.NeXT as F {- hsc3-sf -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO as R {- hsc3-lang -}-import System.Directory {- directory -}-import qualified System.FilePath as P {- filepath -}  -- | Normalise to lie in (0,1). --@@ -84,14 +86,12 @@ -- | Oscillator instrument oi :: IO UGen oi = do-  let rng i = linLin i (-1) 1-      exprng i = linExp i (-1) 1   c <- R.choose [0.25, 0.55, 0.75, 1.25]   let t = impulse KR c 0-  b <- tIRand 0 12 t+  b <- tIRandM 0 12 t   let n  = bufFrames KR b       m  = n / 4-      i  = floorE (rng (lfSaw AR c 0) 0 m) * 4+      i  = floorE (linLin_b (lfSaw AR c 0) 0 m) * 4       tt = impulse AR (m / c) 0       x0 = bufRdL 1 AR b i       NoLoop       y0 = bufRdL 1 AR b (i + 1) NoLoop@@ -99,8 +99,8 @@       y1 = bufRdL 1 AR b (i + 3) NoLoop   f0 <- R.choose [16, 32, 64, 128, 256, 512, 8192]   let f1 = 22000-      o x y = let f = exprng x f0 f1-              in pan2 (blip AR f (rng y 1 64)) y0 (decay tt 0.005)+      o x y = let f = linExp_b x f0 f1+              in pan2 (blip AR f (linLin_b y 1 64)) y0 (decay tt 0.005)   return (o x0 y0 + o x1 y1)  main :: IO ()
+ Sound/SC3/Graph/RD_lz_bf.hs view
@@ -0,0 +1,25 @@+-- lz-bf (rd)+module Sound.SC3.Graph.RD_lz_bf where++import Sound.OSC {- hosc -}+import Sound.SC3 {- hsc3 -}++lz_bf_u :: UGen+lz_bf_u =+  let x = mouseX KR 1 12 Linear 0.1+      l = lorenzL AR sampleRate+                     (mulAdd (lfNoise0 'α' KR x) 2 12)+                     (mulAdd (lfNoise0 'β' KR x) 20 38)+                     (mulAdd (lfNoise0 'γ' KR x) 1.5 3)+                     (mce2 0.025 0.05)+                     0.1 0.0 0.0+      p = phasor AR 0 (l * 24 * bufRateScale KR 0) 0 (bufFrames KR 0) 0+  in bufRd 1 AR 0 p NoLoop CubicInterpolation++lz_bf :: Transport m => String -> m ()+lz_bf fn = do+  _ <- async (b_allocRead 0 fn 0 0)+  play (out 0 lz_bf_u)++main :: IO ()+main = withSC3 (lz_bf "/home/rohan/data/audio/pf-c5.aif")
Sound/SC3/Graph/RD_mouse_clatter_m.hs view
@@ -1,33 +1,25 @@ -- mouse clatter (rd) module Sound.SC3.Graph.RD_mouse_clatter_m where -import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}--mouse_clatter :: UId m => m UGen-mouse_clatter = do-  let x = mouseX KR 100 12000 Linear 0.1-      y = mouseY KR 0.01 0.15 Linear 0.1-  n1 <- lfNoise0 KR (mce [3,3.25])-  let t = impulse KR (n1 * 16 + 18) 0-  n2 <- tRand 0.005 y t-  n3 <- whiteNoise AR-  n4 <- tRand 10 x t-  n5 <- tRand 0 1 t-  n6 <- tExpRand 0.15 1 t-  o <- let e = decay2 t 0.01 n2-       in return (bpf (n3 * e) n4 n5)-  n7 <- pv_RandComb (fft' 10 o) n6 t-  return (o * 0.05 + ifft' n7)+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} -run :: (UId m,Transport m) => m ()-run = do-  _ <- async (b_alloc 10 2048 1)-  play . out 0 =<< mouse_clatter+mouse_clatter :: UGen+mouse_clatter =+    let x = mouseX KR 100 12000 Linear 0.1+        y = mouseY KR 0.01 0.15 Linear 0.1+        n1 = lfNoise0 'α' KR (mce [3,3.25])+        t = impulse KR (n1 * 16 + 18) 0+        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 bpf (n3 * e) n4 n5+        c = pv_Splita 'η' (ffta 'θ' 2048 o 0.5 0 1 0)+        n7 = pv_RandComb 'ι' c n6 t+    in mix (o * 0.05 + ifft n7 0 0)  main :: IO ()-main = withSC3 run--{--s.sendMsg('b_alloc', 10, 2048, 1);--}+main = audition (out 0 mouse_clatter)
Sound/SC3/Graph/RD_nharm_m.hs view
@@ -4,7 +4,7 @@ import Control.Concurrent {- base -} import Control.Monad import Sound.OSC {- hosc -}-import Sound.SC3.Monad as U {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO {- hsc3-lang -}  nharm :: (Num b, Integral a) => a -> b -> [b]@@ -13,10 +13,10 @@ klg :: UId m => UGen -> Int -> m UGen klg m u = do     n <- rrand 4 u-    d <- iRand 9 12-    f <- iRand m (m + 2)-    l <- sequence (replicate n (U.rand 0.01 0.02))-    p <- U.rand (-1.0) 1.0+    d <- iRandM 9 12+    f <- iRandM m (m + 2)+    l <- sequence (replicate n (randM 0.01 0.02))+    p <- randM (-1.0) 1.0     let a = 0.5         e = envGen KR 1 0.9 0 1 RemoveSynth (envSine d a)         nh = nharm n (midiCPS f)
Sound/SC3/Graph/RD_nharm_p.hs view
@@ -1,9 +1,9 @@ -- nharm-p (rd) module Sound.SC3.Graph.RD_nharm_p where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  nharm :: Num n => Int -> n -> [n] nharm n f = map ((* f) . fromIntegral) [1..n]@@ -20,19 +20,17 @@         s = klangSpec nh l (replicate n 0.0)     in out 0 (pan2 (klang AR 1 0 s) p e) -type Range = (Field,Field)+type Range = (Double,Double) -{- Note that the dur key is used only to schedule the nodes. Both it,-and any gate message, are ignored by the UGen graph, which manages-duration internally.  -}+{- Note that the dur key is used only to schedule the nodes, the UGen+graph manages duration internally.-} -pN :: Int -> Range -> Range -> P Event+pN :: Int -> Range -> Range -> (Synthdef,P.Param) pN n (m0,m1) (d0,d1) =     let s = synthdef ("klg" ++ show n) (klg n)-    in pbind [(K_instr,psynth s)-             ,(K_midinote,pwhite 'α' m0 m1 inf)-             ,(K_dur,pwhite 'β' d0 d1 inf)]+    in (s,[("freq",map midiCPS (P.white 'α' m0 m1))+          ,("dur",P.white 'β' d0 d1)])  main :: IO ()-main = audition (pmerge (pN 24 (90,92) (0.25,0.75))-                        (pN 54 (12,14) (1.25,1.76)))+main = audition (P.sbind [(pN 24 (90,92) (0.25,0.75))+                         ,(pN 54 (12,14) (1.25,1.76))])
+ Sound/SC3/Graph/RD_oscillator_cluster_m.hs view
@@ -0,0 +1,36 @@+-- oscillator cluster (rd)+module Sound.SC3.Graph.RD_oscillator_cluster_m where++import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}++oscillator_cluster :: (Functor m,UId m) => m UGen+oscillator_cluster = do+  let ln a b d = line KR a b d RemoveSynth+      rln r a b d = fmap (\n -> ln (a + n) b d) (randM 0 r)+      prt d a cf = do r1 <- randM cf (cf + 2)+                      r2 <- rln 1 5 0.01 d+                      r3 <- rln 10 20 0 d+                      r4 <- randM 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+                      return (o * e)+      np = 12+      fp = sequence (replicate np (randM 220 660))+  d <- randM 4 7+  a <- randM 0.01 0.05+  fmap sum (mapM (prt d a) =<< fp)++main :: IO ()+main = do+  u <- oscillator_cluster+  let s = synthdef "oscillator_cluster" (out 0 u)+      p = [("dur",P.rand 'α' [0.25,0.5,1,3,5])]+  audition (P.sbind1 (s,p))++{-+audition . (out 0) =<< oscillator_cluster+let otu = Sound.SC3.Lang.Control.OverlapTexture.overlapTextureU+otu (3,1,5,maxBound) =<< oscillator_cluster+-}
Sound/SC3/Graph/RD_pattern_buffer_m.hs view
@@ -2,7 +2,7 @@ module Sound.SC3.Graph.RD_pattern_buffer_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO {- hsc3-lang -}  tseq :: [UGen] -> UGen@@ -17,7 +17,7 @@   r1 <- sequence (replicate c (rrand 36 96))   r2 <- sequence (replicate c (rrand (-1.0) 1.0))   r3 <- rrand 0 1-  n1 <- tRand 0.02 0.08 t+  n1 <- tRandM 0.02 0.08 t   let e = decay2 t 0.01 n1       f = midiCPS (tseq r1)       l = tseq r2
Sound/SC3/Graph/RD_rzblp.hs view
@@ -1,16 +1,17 @@ -- rzblp (rd) module Sound.SC3.Graph.RD_rzblp where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} -lfn :: ID a => a -> UGen -> UGen -> UGen -> UGen+lfn :: ID a => a -> UGen -> Double -> Double -> UGen lfn z f l r =     let z' = z `joinID` l `joinID` r-    in range l r (lfNoise0 z' KR f)+    in range (constant l) (constant r) (lfNoise0 z' KR f) -hpb :: (ID a) => a -> UGen -> UGen+hpb :: ID a => a -> UGen -> UGen hpb z q =-    let g i = let z' = idHash z + i+    let g :: Int -> UGen+        g i = let z' = z `joinID` i                   f = lfn z' q 1330 1395                   a = lfn z' q 0.001 0.007               in blip AR f 24 * a
Sound/SC3/Graph/RD_rzblp_hp.hs view
@@ -2,10 +2,11 @@ {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} module Sound.SC3.Graph.RD_rzblp_hp where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -}  lfn :: UId m => UGen -> UGen -> UGen -> m UGen-lfn f l r = fmap (range l r) (lfNoise0 KR f)+lfn f l r = fmap (range l r) (lfNoise0M KR f)  hpb :: UId m => UGen -> m UGen hpb q =@@ -26,7 +27,7 @@   return (sum [s1,s2,s3,s4])  rzblp :: UId m => m UGen-rzblp = mk_f drand .+. mk_f dxrand+rzblp = mk_f drandM .+. mk_f dxrandM  main :: IO () main = audition . out 0 =<< rzblp
Sound/SC3/Graph/RD_rzblp_m.hs view
@@ -1,10 +1,11 @@ -- rzblp-m (rd) module Sound.SC3.Graph.RD_rzblp_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -}  lfn :: UId m => UGen -> UGen -> UGen -> m UGen-lfn f l r = fmap (range l r) (lfNoise0 KR f)+lfn f l r = fmap (range l r) (lfNoise0M KR f)  hpb :: UId m => UGen -> m UGen hpb q =@@ -29,7 +30,7 @@   return (sum [s1,s2,s3,s4])  rzblp :: UId m => m UGen-rzblp = mk_f drand .+. mk_f dxrand+rzblp = mk_f drandM .+. mk_f dxrandM  main :: IO () main = audition . out 0 =<< rzblp
Sound/SC3/Graph/RD_rzblp_u.hs view
@@ -2,10 +2,10 @@ module Sound.SC3.Graph.RD_rzblp_u where  import Sound.SC3 {- hsc3 -}-import Sound.SC3.UGen.Unsafe {- hsc3-unsafe -}+import qualified Sound.SC3.UGen.Unsafe as U {- hsc3-unsafe -}  lfn :: UGen -> UGen -> UGen -> UGen-lfn f l r = range l r (lfNoise0 KR f)+lfn f l r = range l r (U.lfNoise0 KR f)  hpb :: UGen -> UGen hpb q =@@ -30,7 +30,7 @@            ,blip AR (lfn q 16 36) 3 * mce2 0.03 0.09]  rzblp :: UGen-rzblp = mk_f drand + mk_f dxrand+rzblp = mk_f U.drand + mk_f U.dxrand  main :: IO () main = audition (out 0 rzblp)
Sound/SC3/Graph/RD_s_chirp.hs view
@@ -2,7 +2,7 @@ module Sound.SC3.Graph.RD_s_chirp where  import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  s_chirp :: UGen s_chirp =
Sound/SC3/Graph/RD_scritto.hs view
@@ -3,7 +3,7 @@  import Control.Monad import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Data.Vowel as V {- hsc3-lang -}  scritto_i :: UGen -> UGen@@ -12,7 +12,7 @@         v_filter i f a b = resonz i f (b / f) * dbAmp a         n0 = lfNoise2 'α' KR 3         v_filter_b i =-            let bi = linLin n0 (-1) 1 0 bx+            let bi = linLin_b n0 0 bx                 b = buf_at bi in v_filter i (b 0) (b 5) (b 10)         t = impulse AR (n0 * 9 + 9) 0         ble (e,d) =
Sound/SC3/Graph/RD_scritto_m.hs view
@@ -1,7 +1,7 @@ -- scritto (rd) module Sound.SC3.Graph.RD_scritto_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Data.Vowel as V {- hsc3-lang -}  main :: IO ()@@ -13,15 +13,15 @@       v_filter i f a b = resonz i f (b / f) * dbAmp a       v_filter_b bi i = v_filter i (buf_at bi 0) (buf_at bi 5) (buf_at bi 10)       mk_instr bx = do-        n <- lfNoise2 KR 3+        n <- lfNoise2M KR 3         let t = impulse AR (n * 9 + 9) 0-            i d = do n1 <- tRand 0.02 0.06 t-                     n2 <- tIRand 30 52 t-                     n3 <- tIRand 16 32 t+            i d = do n1 <- tRandM 0.02 0.06 t+                     n2 <- tIRandM 30 52 t+                     n3 <- tIRandM 16 32 t                      let p = pulseDivider t d 0                          b = blip AR (midiCPS n2) n3                      return (decay2 p 0.01 n1 * b * 12)-            bi = linLin n (-1) 1 0 bx+            bi = linLin_b n 0 bx             voice = mix . v_filter_b bi         return . out 0 . mce . map voice =<< mapM i [1,2]   in withSC3 (do mapM_ s_alloc (zip V.fdata_table [0..])
Sound/SC3/Graph/RD_seqr.hs view
@@ -1,8 +1,8 @@ -- seqr (rd) module Sound.SC3.Graph.RD_seqr where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  nrand :: ID z => Int -> z -> UGen -> UGen -> [UGen] nrand n e l = mceChannels . randN n e l
+ Sound/SC3/Graph/RD_seqr_n.hs view
@@ -0,0 +1,25 @@+-- seqr-n (rd)+module Sound.SC3.Graph.RD_seqr_n where++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}++seqr_f :: UGen -> UGen -> UGen+seqr_f f e =+    let n = constant (mceDegree e) / 2+    in select (mulAdd (lfSaw KR f 0) n n) e++seqr_n :: Int -> UGen+seqr_n n =+  let f = iRand 'α' 9 18 / constant n+      o1 = let f1 = seqr_f f (midiCPS (iRandN n 'β' 72 96))+               f2 = seqr_f f (midiCPS (iRandN n 'γ' 72 84))+               h1 = seqr_f f (randN n 'δ' 1 3)+               h2 = seqr_f f (randN n 'ε' 3 6)+           in blip AR (mce2 f1 f2) (mce2 h1 h2)+      o2 = mce2 (seqr_f f (randN n 'ζ' 0.05 0.10)) (seqr_f f (randN n 'η' 0.05 0.15))+  in o1 * o2++main :: IO ()+main = overlapTextureU (6,6,3,maxBound) (seqr_n 13)
Sound/SC3/Graph/RD_shifting_pulses_m.hs view
@@ -1,17 +1,14 @@ -- shifting pulses (rd) module Sound.SC3.Graph.RD_shifting_pulses_m where -import Sound.SC3.Monad {- hsc3 -}--wrp :: UGen -> UGen -> UGen -> UGen-wrp i l r = linLin i (-1) 1 l r+import Sound.SC3 {- hsc3 -}  prt :: UId m => UGen -> UGen -> m UGen prt a f = do-  r0 <- rand 0.2 0.9-  r1 <- rand 0.95 1.05-  r2 <- clone 2 (rand 0.95 1.05)-  let f' = f * wrp (sinOsc KR r0 0) 1 1.01 * r1+  r0 <- randM 0.2 0.9+  r1 <- randM 0.95 1.05+  r2 <- clone 2 (randM 0.95 1.05)+  let f' = f * linLin_b (sinOsc KR r0 0) 1 1.01 * r1       a' = a * r2       o = sinOsc AR (mce2 f f') 0   return (o * a')@@ -24,21 +21,21 @@ -- audition . out 0 =<< fmt fmt :: UId m => m UGen fmt = do-  n <- (lfNoise2 KR 2)-  return  (formant AR (mce2 20 21) (wrp n 10 100) 200 * 0.35)+  n <- (lfNoise2M KR 2)+  return (formant AR (mce2 20 21) (linLin_b n 10 100) 200 * 0.35)  -- audition . out 0 =<< pulses pulses :: UId m => m UGen pulses = do-  n0 <- clone 2 (brownNoise KR)-  n1 <- clone 2 (brownNoise KR)-  n2 <- clone 2 (brownNoise KR)-  t <- dust KR 0.75+  n0 <- clone 2 (brownNoiseM KR)+  n1 <- clone 2 (brownNoiseM KR)+  n2 <- clone 2 (brownNoiseM KR)+  t <- dustM KR 0.75   let warp i = linLin i (-1) 1       l = latch t t       p = pulse AR (warp n0 2 (mce2 11 15)) 0.01 * 0.1-      f = warp n1 300 1800-      rq = warp n2 0.01 2+      f = warp n1 90 300+      rq = warp n2 2 9   return (mrg2 (l * rlpf p f rq) (sendTrig t 0 t))  shifting_pulses :: UId m => m UGen
Sound/SC3/Graph/RD_sosc_lp_m.hs view
@@ -2,13 +2,13 @@ module Sound.SC3.Graph.RD_sosc_lp_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} -dustR :: UId m => Rate -> UGen -> UGen -> m UGen-dustR r lo hi = do-  n1 <- dwhite 1 lo hi-  n2 <- whiteNoise r-  d <- dseq dinf n1+dustR' :: UId m => Rate -> UGen -> UGen -> m UGen+dustR' r lo hi = do+  n1 <- dwhiteM 1 lo hi+  n2 <- whiteNoiseM r+  d <- dseqM dinf n1   return (tDuty r d 0 DoNothing (abs n2) 1)  setup :: Transport m => m ()@@ -20,6 +20,9 @@   send (b_setn1 10 0 a)   send (b_setn1 11 0 b) +--b0 = asLocalBuf 'α' [60, 71, 89, 65, 36, 57, 92, 97, 92, 97]+--b1 = asLocalBuf 'β' [71, 89, 60, 57, 65, 36, 95, 92, 93, 97]+ sosc_lp :: UGen -> UGen -> UGen sosc_lp t n =     let d_env = decay2 t 0.002 2.5@@ -34,8 +37,8 @@  sosc_lp_m :: UId m => m UGen sosc_lp_m = do-  clk <- dustR KR 0.2 0.9-  n <- lfNoise0 KR (mce2 1 3)+  clk <- dustR' KR 0.2 0.9+  n <- lfNoise0M KR (mce2 1 3)   return (sosc_lp clk n)  main :: IO ()
Sound/SC3/Graph/RD_tgb_m.hs view
@@ -2,19 +2,18 @@ module Sound.SC3.Graph.RD_tgb_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  tgb :: UId m => UGen -> UGen -> m UGen tgb b d = do   let mkls bp t = envGen KR 1 1 0 1 RemoveSynth (envCoord bp t 1 EnvLin)       pm_t l r du t = let le = mkls l du                           re = mkls r du-                      in tRand le re t-      wrp i = linLin i (-1) 1+                      in tRandM le re t       pm_n rt l du = do let le = mkls l du                             re = mkls l du-                        n <- whiteNoise rt-                        return (wrp n le re)+                        n <- whiteNoiseM rt+                        return (linLin_b n le re)   gps <- pm_n AR [(0,400),(1,900)] d   let t = impulse AR gps 0       pm_f (l,r) = pm_t l r d t
Sound/SC3/Graph/RD_tgr_rpr_m.hs view
@@ -2,22 +2,22 @@ module Sound.SC3.Graph.RD_tgr_rpr_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO {- hsc3-lang -} -dustR :: UId m => Rate -> UGen -> UGen -> m UGen-dustR r lo hi = do-  n1 <- dwhite 1 lo hi-  n2 <- whiteNoise r-  d <- dseq dinf n1+dustR' :: UId m => Rate -> UGen -> UGen -> m UGen+dustR' r lo hi = do+  n1 <- dwhiteM 1 lo hi+  n2 <- whiteNoiseM r+  d <- dseqM dinf n1   return (tDuty r d 0 DoNothing (abs n2) 1)  rpr :: UId m => UGen -> UGen -> m UGen-rpr n = tRand (in' 1 KR n) (in' 1 KR (n + 1))+rpr n = tRandM (in' 1 KR n) (in' 1 KR (n + 1))  tgr_rpr :: (Functor m,UId m) => m UGen tgr_rpr = do-  clk <- dustR AR (in' 1 KR 0) (in' 1 KR 1)+  clk <- dustR' AR (in' 1 KR 0) (in' 1 KR 1)   rat <- rpr 2 clk   dur <- rpr 4 clk   pos <- fmap (* bufDur KR 10) (rpr 8 clk)
Sound/SC3/Graph/RD_tgrn.hs view
@@ -2,7 +2,7 @@ module Sound.SC3.Graph.RD_tgrn where  import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  -- > Sound.SC3.UGen.Dot.draw (tgrn 10) tgrn :: UGen -> UGen
Sound/SC3/Graph/RD_thb.hs view
@@ -1,14 +1,18 @@ -- thb (rd)+{-# OPTIONS_GHC -F -pgmF hsc3-psynth #-} module Sound.SC3.Graph.RD_thb where -import Data.List+import Data.List {- base -}+ import qualified Music.Theory.Contour.Polansky_1992 as T {- hmt -} import qualified Music.Theory.Pitch as T+ import Sound.SC3 {- hsc3 -}-import qualified Sound.SC3.Lang.Math as M-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -} import Sound.OSC {- hosc -} +import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}+ -- | Happy birthday -- -- > nub hb == "hapy birtd"@@ -46,19 +50,18 @@ plain :: Transport m => m () plain = do   _ <- async (d_recv defaultSynthdef)-  let p :: [[Double]] -> P Field-      p = toP . map realToFrac . concat-  play (pbind [(K_degree,p hb_d - 1)-              ,(K_octave,p hb_o + 1)-              ,(K_dur,p hb_t / 16)])+  let fr = map P.octpc_to_cps (zip (concat hb_o .+ 1) (concat hb_k))+  play (P.sbind1 (defaultSynthdef+                 ,[("freq",fr)+                  ,("dur",concat hb_t ./ 16)]))  -- | Pitch classes -- -- > tail hb_k == [[7,7,9,7,2,0],[7,7,7,4,0,11,9],[5,5,4,0,2,0]]-hb_k :: Integral n => [[n]]+hb_k :: Num n => [[n]] hb_k =-    let f = floor . M.degreeToKey [0,2,4,5,7,9,11] 12 . pred-    in map (map f) (hb_d :: [[Double]])+    let f = fromInteger . floor . P.degreeToKey [0,2,4,5,7,9,11] 12 . pred+    in map (map f) hb_d  -- | Midi note numbers --@@ -158,15 +161,11 @@ -- -- > audition ins_s ins_s :: Synthdef-ins_s =-    let f = control IR "freq" 440-        l = control IR "loc" 0-        a = control IR "amp" 0.1-        d = control IR "sustain" 0.1-        s = envSine d a+ins_s = psynth {bus = 0,freq = 440,loc = 0,amp = 0.1,sustain = 0.1} where+    let s = envSine sustain amp         e = envGen AR 1 1 0 1 RemoveSynth s-        i = impulse AR f 0-    in synthdef "ins" (out 0 (pan2 i l e))+        i = impulse AR freq 0+    in out bus (pan2 i loc e)  -- | 'audition' 'ph' using pattern library.  /blur/ is @legato@. --@@ -175,13 +174,12 @@ hear :: Transport m => Double -> [Cim Double] -> m () hear blur x =     let (f,d,c) = unzip3 x-        p = toP . map realToFrac-    in play (pbind [(K_instr,psynth ins_s)-                   ,(K_freq,p f)-                   ,(K_dur,p d)-                   ,(K_legato,p (repeat blur))-                   ,(K_amp,p c * 0.1 + 0.1)-                   ,(K_param "loc",p c * 2 - 1)])+        pr = [("freq",f)+             ,("dur",d)+             ,("sustain",d .* blur)+             ,("amp",c .* 0.1 .+ 0.1)+             ,("loc",c .* 2 .- 1)]+    in play (P.sbind1 (ins_s,pr))  main :: IO () main = withSC3 (hear 9 ph)
+ Sound/SC3/Graph/RD_three_cpsw.hs view
@@ -0,0 +1,19 @@+-- three-cpsw (rd)+module Sound.SC3.Graph.RD_three_cpsw where++import Sound.SC3 {- hsc3 -}++three_cpsw :: UGen+three_cpsw =+    let 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+        f = f1 * mce2 9000 12000 + 9500+        o = saw AR f + saw AR (f * dh) + saw AR (f * dt)+    in clip2 (o * a) 0.75++main :: IO ()+main = audition (out 0 three_cpsw)
Sound/SC3/Graph/RD_three_cpsw_m.hs view
@@ -1,16 +1,16 @@ -- three-cpsw (rd) module Sound.SC3.Graph.RD_three_cpsw_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  three_cpsw :: UId m => m UGen three_cpsw = 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+  t <- dustM KR (mce2 12 18)+  f0 <- tRandM 1 64 t+  f1 <- lfNoise0M KR f0+  a <- tRandM 0.0 0.5 t+  dt <- tRandM 0.975 1.025 t+  dh <- tRandM 0.750 0.7505 t   let f = f1 * mce2 9000 12000 + 9500       o = saw AR f + saw AR (f * dh) + saw AR (f * dt)   return (clip2 (o * a) 0.75)
Sound/SC3/Graph/RD_tipnso.hs view
@@ -1,7 +1,7 @@ -- tipnso (rd) module Sound.SC3.Graph.RD_tipnso where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  tipnso :: UGen tipnso =
Sound/SC3/Graph/RD_tr_out_m.hs view
@@ -2,14 +2,14 @@ module Sound.SC3.Graph.RD_tr_out_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  tr_nd :: UId m => UGen -> m (UGen,UGen) tr_nd n = do-  t <- dust KR 1.6-  r1 <- tRand 0 6 t-  r2 <- tRand 0 6 t-  r3 <- tRand 0 6 t+  t <- dustM KR 1.6+  r1 <- tRandM 0 6 t+  r2 <- tRandM 0 6 t+  r3 <- tRandM 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
Sound/SC3/Graph/RD_trkl_m.hs view
@@ -2,18 +2,18 @@ module Sound.SC3.Graph.RD_trkl_m where  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  trkl :: UId m => UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> m UGen trkl d ul fu dy la fy = do   let tf = xLine KR 1 ul d RemoveSynth       st = impulse AR (tf * 8) 0       t = impulse AR tf 0-  r0 <- rand (-1) 1-  r1 <- rand (-1) 1-  r2 <- tRand 0.05 1.0 t-  r3 <- tExpRand 0.001 0.25 st -- non-zero minima-  fh <- tRand 1.75 2.25 t+  r0 <- randM (-1) 1+  r1 <- randM (-1) 1+  r2 <- tRandM 0.05 1.0 t+  r3 <- tExpRandM 0.001 0.25 st -- non-zero minima+  fh <- tRandM 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@@ -24,12 +24,12 @@ -- > audition . out 0 =<< trkl_r trkl_r :: UId m => m UGen trkl_r = 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+  d <- randM 0.5 16+  ul <- randM 16 64+  fu <- randM 1200 9000+  dy <- randM 0.005 0.175+  la <- randM (-60) (-25)+  fy <- randM 0.015 0.125   trkl d ul fu dy la fy  main :: IO ()
Sound/SC3/Graph/RD_trmlo.hs view
@@ -1,13 +1,13 @@ -- trmlo (rd) module Sound.SC3.Graph.RD_trmlo where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  -- > audition (out 0 trmlo) trmlo :: UGen trmlo =-    let mWrp i l r = linLin i (-1) 1 (midiCPS l) (midiCPS r)+    let mWrp i l r = linLin_b i (midiCPS l) (midiCPS r)         mWrp1 i m = mWrp i m (m + 1)         mWrpN i m n = mWrp i m (m + n)         o1 = let f = 5@@ -31,7 +31,7 @@                  n = iRand 'θ' 69 72                  m = sinOsc KR f 0                  l = line KR 0 (iRand 'ι' 1 5) d DoNothing-             in pan2 (blip AR (mWrp1 m (n + l)) (linLin m (-1) 1 1 2)) m e+             in pan2 (blip AR (mWrp1 m (n + l)) (linLin_b m 1 2)) m e         o4 = let f = iRand 'κ' 5 18                  d = iRand 'λ' 12 15                  s = envSine d (rand 'μ' 0.1 0.2)@@ -40,13 +40,11 @@                  m = sinOsc KR f 0                  l = line KR 0 (iRand 'ξ' 1 5) d RemoveSynth                  fr = mWrpN m (n + l) (iRand 'ο' 1 5)-             in pan2 (blip AR fr (linLin m (-1) 1 1 (iRand 'π' 2 24))) m e+             in pan2 (blip AR fr (linLin_b m 1 (iRand 'π' 2 24))) m e     in o1 + o2 + o3 + o4  main :: IO () main = do   let s = synthdef "trmlo" (out 0 trmlo)-      p = pbind [(K_instr,psynth s)-                ,(K_dur,pxrand 'ρ' [0.25,0.5,1,2,4] inf)-                ,(K_legato,1.25)]-  audition p+      p = [("dur",P.xrand 'ρ' [0.25,0.5,1,2,4])]+  audition (P.sbind1 (s,p))
Sound/SC3/Graph/RD_trmlo_u.hs view
@@ -2,13 +2,13 @@ module Sound.SC3.Graph.RD_trmlo_u where  import Sound.SC3 {- hsc3 -}-import Sound.SC3.UGen.Unsafe {- hsc3-unsafe -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import qualified Sound.SC3.UGen.Unsafe as U {- hsc3-unsafe -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  -- > audition (out 0 trmlo) trmlo :: UGen trmlo =-    let mWrp i l r = linLin i (-1) 1 (midiCPS l) (midiCPS r)+    let mWrp i l r = linLin_b i (midiCPS l) (midiCPS r)         mWrp1 i m = mWrp i m (m + 1)         mWrpN i m n = mWrp i m (m + n)         o1 = let f = 5@@ -18,36 +18,34 @@                  n = 65                  m = sinOsc KR f 0              in pan2 (sinOsc AR (mWrp1 m n) 0) m e-        o2 = let f = iRand 5 9-                 d = iRand 5 9-                 s = envSine d (rand 0.1 0.2)+        o2 = let f = U.iRand 5 9+                 d = U.iRand 5 9+                 s = envSine d (U.rand 0.1 0.2)                  e = envGen KR 1 1 0 1 DoNothing s-                 n = iRand 69 72+                 n = U.iRand 69 72                  m = sinOsc KR f 0              in pan2 (sinOsc AR (mWrp1 m n) 0) m e-        o3 = let f = iRand 5 9-                 d = iRand 9 12-                 s = envSine d (rand 0.1 0.2)+        o3 = let f = U.iRand 5 9+                 d = U.iRand 9 12+                 s = envSine d (U.rand 0.1 0.2)                  e = envGen KR 1 1 0 1 DoNothing s-                 n = iRand 69 72+                 n = U.iRand 69 72                  m = sinOsc KR f 0-                 l = line KR 0 (iRand 1 5) d DoNothing-             in pan2 (blip AR (mWrp1 m (n + l)) (linLin m (-1) 1 1 2)) m e-        o4 = let f = iRand 5 18-                 d = iRand 12 15-                 s = envSine d (rand 0.1 0.2)+                 l = line KR 0 (U.iRand 1 5) d DoNothing+             in pan2 (blip AR (mWrp1 m (n + l)) (linLin_b m 1 2)) m e+        o4 = let f = U.iRand 5 18+                 d = U.iRand 12 15+                 s = envSine d (U.rand 0.1 0.2)                  e = envGen KR 1 5e-2 0 1 DoNothing s-                 n = iRand 69 72+                 n = U.iRand 69 72                  m = sinOsc KR f 0-                 l = line KR 0 (iRand 1 5) d RemoveSynth-                 fr = mWrpN m (n + l) (iRand 1 5)-             in pan2 (blip AR fr (linLin m (-1) 1 1 (iRand 2 24))) m e+                 l = line KR 0 (U.iRand 1 5) d RemoveSynth+                 fr = mWrpN m (n + l) (U.iRand 1 5)+             in pan2 (blip AR fr (linLin_b m 1 (U.iRand 2 24))) m e     in o1 + o2 + o3 + o4  main :: IO () main = do   let s = synthdef "trmlo" (out 0 trmlo)-      p = pbind [(K_instr,psynth s)-                ,(K_dur,pxrand 'α' [0.25,0.5,1,2,4] inf)-                ,(K_legato,1.25)]-  audition p+      p = [("dur",P.xrand 'ρ' [0.25,0.5,1,2,4])]+  audition (P.sbind1 (s,p))
Sound/SC3/Graph/RD_urandom.hs view
@@ -3,7 +3,8 @@  import Control.Monad {- base -} import qualified Data.ByteString.Lazy as B {- bytestring -}-import Sound.OSC.Coding.Byte {- hosc -}+import Data.Int {- base -}+import Data.Binary {- binary -} import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -} import System.IO {- base -}@@ -11,35 +12,33 @@ ur_bytes :: Int -> IO B.ByteString ur_bytes n = withFile "/dev/urandom" ReadMode (flip B.hGet n) -ur_int :: IO Int-ur_int = fmap decode_i32 (ur_bytes 4)--ur_double :: IO Double-ur_double = fmap decode_f64 (ur_bytes 8)+ur_int32 :: IO Int32+ur_int32 = fmap decode (ur_bytes 4)  ur_byte_set :: Int -> Int -> IO [B.ByteString] ur_byte_set n k =     let f h = replicateM k (B.hGet h n)     in withFile "/dev/urandom" ReadMode f --- > ur_int_set 3-ur_int_set :: Int -> IO [Int]-ur_int_set = fmap (map decode_i32) . ur_byte_set 4+-- > ur_int32_set 3+ur_int32_set :: Int -> IO [Int32]+ur_int32_set = fmap (map decode) . ur_byte_set 4 --- > fmap (map int_to_normal) (ur_int_set 3)-int_to_normal :: Fractional n => Int -> n-int_to_normal n = fromIntegral (abs n) / fromIntegral (maxBound::Int)+-- > fmap (map int32_to_normal) (ur_int32_set 3)+int32_to_normal :: Fractional n => Int32 -> n+int32_to_normal n = fromIntegral (abs n) / fromIntegral (maxBound::Int32) +-- > ur_real_set 3 ur_real_set :: Fractional n => Int -> IO [n]-ur_real_set = fmap (map int_to_normal) . ur_int_set+ur_real_set = fmap (map int32_to_normal) . ur_int32_set  -- > audition =<< mk_node mk_node :: IO UGen mk_node = do   [f,g,l] <- ur_real_set 3-  let f' = linLin f 0 1 440 660-      g' = linLin g 0 1 0.05 0.25-      l' = linLin l 0 1 (-1) 1+  let f' = linLin_u f 440 660+      g' = linLin_u g 0.05 0.25+      l' = linLin_u l (-1) 1   return (pan2 (sinOsc AR f' 0) l' g')  main :: IO ()
Sound/SC3/Graph/RD_vla_addtn.hs view
@@ -1,14 +1,51 @@ -- vla-adttn (rd) module Sound.SC3.Graph.RD_vla_addtn where -import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -} -type R = Double-type R2 = (R,R)+-- fr = freq,dt = detune+vla_partial :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> UGen+vla_partial b fr rise fall dt n =+    let m = n * 2+        ampl = dbAmp (bufRdN 1 KR b m NoLoop)+        ph = bufRdN 1 KR b (m + 1) NoLoop+        o = let dt' = lfNoise1 'α' KR 1 * dt + 1.0+            in fSinOsc AR (fr * (n + 1) * dt') ph+        e = linen (impulse KR 0 0)+                  (rise * rand 'β' 0.75 1.25)+                  ampl+                  (fall * rand 'γ' 0.75 1.25)+                  DoNothing+    in o * e -vla :: [R2]+vla_plyr :: UGen -> UGen -> UGen+vla_plyr b n =+    let fr = midiCPS (rand 'α' 10 30)+        rise = rand 'β' 1 2+        fall = rand 'γ' 4 7+        dt = rand 'δ' 0.001 0.005+        a = rand 'ε' 0.05 0.1+        l = rand 'ζ' (-1) 1+        s = sum (map (vla_partial b fr rise fall dt) [0 .. n - 1])+        e = detectSilence s 0.001 0.2 RemoveSynth+    in mrg2 (pan2 s l a) e++plyr36 :: UGen+plyr36 =+    let unp (i,j) = [i,j]+        b = asLocalBuf 'α' (concatMap (map double_to_ugen . unp) vla)+    in vla_plyr b 36++main :: IO ()+main = spawnTextureU (const 3,maxBound) plyr36++-- q = quantised+vla_q :: (RealFrac n,Fractional n) => [(n,n)]+vla_q = let f (a,p) = (roundTo_ a 0.1,roundTo_ p 0.1) in map f vla++-- ampl (DB) and phase data+vla :: Fractional n => [(n,n)] vla =     [(-49.43290,1.99165)     ,(0.00000,1.09187)@@ -86,63 +123,3 @@     ,(-81.89010,3.12971)     ,(-80.18220,1.76888)     ,(-82.94420,2.77531)]--p_prep :: R2 -> R2-p_prep (a,p) = (dbAmp a,p)--unp :: R2 -> [R]-unp (i,j) = [i,j]--vla_prep :: [R]-vla_prep = concatMap (unp . p_prep) vla---- fr = freq,dt = detune-vla_partial :: UGen -> UGen -> UGen -> UGen -> UGen -> UGen-vla_partial fr rise fall dt n =-    let m = n * 2-        ampl = bufRdN 1 KR 0 m NoLoop-        ph = bufRdN 1 KR 0 (m + 1) NoLoop-        o = let dt' = lfNoise1 'α' KR 1 * dt + 1.0-            in fSinOsc AR (fr * (n + 1) * dt') ph-        e = linen (impulse KR 0 0)-                  (rise * rand 'β' 0.75 1.25)-                  ampl-                  (fall * rand 'γ' 0.75 1.25)-                  DoNothing-    in o * e--vla_plyr :: UGen -> UGen-vla_plyr n =-    let a = control KR "amp" 0.1-        f = control KR "freq" 129.897-        rs = control KR "rise" 0.1-        fa = control KR "fall" 0.5-        l = control KR "loc" 0.0-        dt = control KR "dt" 0.001-        s = sum (map (vla_partial f rs fa dt) [0 .. n - 1])-        e = detectSilence s 0.001 0.2 RemoveSynth-    in mrg2 (pan2 s l a) e--plyr36 :: Synthdef-plyr36 = synthdef "plyr36" (out 0 (vla_plyr 36))--pattern :: [P_Bind]-pattern =-    [(K_instr,pinstr "plyr36")-    ,(K_param "loc",pwhite 'δ' (-1) 1 inf)-    ,(K_amp,pwhite 'ε' 0.05 0.1 inf)-    ,(K_degree,prand 'ζ' [0,1,2,3,4,5,6,7,8] inf)-    ,(K_octave,prand 'η' [2,3] inf)-    ,(K_param "dt",pwhite 'θ' 0.001 0.005 inf)-    ,(K_param "rise",pwhite 'ι' 1 2 inf)-    ,(K_param "fall",pwhite 'κ' 4 7 inf)-    ,(K_dur,5)]--act :: Transport m => m ()-act = do-  _ <- async (b_alloc_setn1 0 0 vla_prep)-  _ <- async (d_recv plyr36)-  play (pbind pattern)--main :: IO ()-main = withSC3 act
Sound/SC3/Graph/RD_vla_addtn_sharc.hs view
@@ -1,11 +1,13 @@ -- vla-adttn-sharc (rd)+{-# OPTIONS_GHC -F -pgmF hsc3-uparam #-}+-- http://www.timbre.ws/sharc/ module Sound.SC3.Graph.RD_vla_addtn_sharc where  import Data.List {- base -} import Sound.Analysis.SHARC {- hsharc -} import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  type R = Double type R3 = (R,R,R)@@ -43,37 +45,31 @@  vla_plyr :: UGen -> UGen vla_plyr n =-    let a = control KR "amp" 0.1-        f = control KR "freq" 129.897-        rs = control KR "rise" 0.1-        fa = control KR "fall" 0.5-        l = control KR "loc" 0.0-        dt = control KR "dt" 0.001-        s = sum (map (vla_partial f rs fa dt) [0 .. n - 1])+    let uparam = {amp = 0.1,freq = 129.897,rise = 0.1,fall = 0.5,loc = 0,dt = 0.001}+        s = sum (map (vla_partial freq rise fall dt) [0 .. n - 1])         e = detectSilence s 0.001 0.2 RemoveSynth-    in mrg2 (pan2 s l a) e+    in mrg2 (pan2 s loc amp) e  plyr36 :: Synthdef plyr36 = synthdef "plyr36" (out 0 (vla_plyr 36)) -pattern :: [P_Bind]+pattern :: P.Param pattern =-    [(K_instr,pinstr "plyr36")-    ,(K_param "loc",pwhite 'δ' (-1) 1 inf)-    ,(K_amp,pwhite 'ε' 0.05 0.1 inf)-    ,(K_degree,prand 'ζ' [0,1,2,3,4,5,6,7,8] inf)-    ,(K_octave,prand 'η' [2,3] inf)-    ,(K_param "dt",pwhite 'θ' 0.001 0.005 inf)-    ,(K_param "rise",pwhite 'ι' 1 2 inf)-    ,(K_param "fall",pwhite 'κ' 4 7 inf)-    ,(K_dur,prand 'λ' [3,5] inf)]+    let to_cps = P.degree_to_cps' [0,2,4,5,7,9,11] 12+    in [("loc",P.white 'α' (-1) 1)+       ,("amp",P.white 'β' 0.05 0.1)+       ,("freq",to_cps (P.rand 'γ' [0,1,2,3,4,5,6,7,8]) (P.rand 'δ' [1,2]))+       ,("dt",P.white 'ε' 0.001 0.005)+       ,("rise",P.white 'ζ' 1 2)+       ,("fall",P.white 'η' 4 7)+       ,("dur",repeat 5)]  act :: Transport m => FilePath -> m () act fn = do   v <- vla fn   _ <- async (b_alloc_setn1 0 0 (vla_prep v))   _ <- async (d_recv plyr36)-  play (pbind pattern)+  play (P.sbind1 (plyr36,pattern))  main :: IO () main = withSC3 (act "/home/rohan/data/sharc/sharc.xml")
Sound/SC3/Graph/RD_vlc_distrtn_m.hs view
@@ -1,9 +1,10 @@ -- vlc-distrtn (rd)+{-# OPTIONS_GHC -F -pgmF hsc3-uparam #-} -- caution - audio feedback graph module Sound.SC3.Graph.RD_vlc_distrtn_m where  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Random.IO as L {- hsc3-lang -}  prep :: (Double,Double) -> [Double]@@ -11,8 +12,8 @@  partial :: UId m => UGen -> UGen -> UGen -> UGen -> UGen -> UGen -> m UGen partial b i freq detune fall n = do-  n0 <- lfNoise1 KR 1-  n1 <- rand 0.75 1.25+  n0 <- lfNoise1M KR 1+  n1 <- randM 0.75 1.25   let m = n * 2       ampl = bufRdN 1 KR b m NoLoop       f = freq * (n + 1) * (n0 * detune + 1)@@ -20,14 +21,7 @@  plyr :: UId m => UGen -> UGen -> m UGen plyr i n = do-  let ctl = control KR-      buf = ctl "buf" 0-      iamp = ctl "iamp" 0.1-      ampl = ctl "ampl" 0.1-      freq = ctl "freq" 129.897-      fall = ctl "fall" 0.5-      loc = ctl "loc" 0.0-      detune = ctl "detune" 0.001+  let uparam = {buf=0,iamp=0.1,ampl=0.1,freq=129.897,fall=0.5,loc=0.0,detune=0.001}   s <- mapM (partial buf (i * iamp) freq detune fall) [0 .. n-1]   return (out 0 (clip2 (pan2 (sum s) loc ampl) 0.1)) @@ -64,7 +58,7 @@ run = do   _ <- async (b_alloc 0 (length vlc * 2) 1)   send (b_setn1 0 0 (concatMap prep vlc))-  let i = soundIn 4+  let i = soundIn 0   _ <- async . d_recv . synthdef "plyr48" =<< plyr i 48   send (s_new "plyr48" 1002 AddToTail 1 [])   sequence_ (replicate 32 pattern)
Sound/SC3/Graph/RD_voscil.hs view
@@ -2,7 +2,7 @@ module Sound.SC3.Graph.RD_voscil where  import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO {- hsc3-lang -}  -- > Sound.SC3.UGen.Dot.draw (voscil 32)
Sound/SC3/Graph/RD_voscil_u.hs view
@@ -4,12 +4,12 @@ import Sound.OSC {- hosc -} import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO {- hsc3-lang -}-import Sound.SC3.UGen.Unsafe {- hsc3-unsafe -}+import qualified Sound.SC3.UGen.Unsafe as U {- hsc3-unsafe -}  -- > Sound.SC3.UGen.Dot.draw (voscil 32) voscil :: Real a => a -> UGen voscil b =-  let lfn = lfNoise0 KR+  let lfn = U.lfNoise0 KR       hb = (constant b - 1) / 2       rt = 6       f = 600
− Sound/SC3/Graph/RD_waveset.hs
@@ -1,155 +0,0 @@--- A simple waveset synthesiser (rd)-module Sound.SC3.Graph.RD_waveset where--import qualified Data.Array as A {- array -}-import Data.List {- base -}-import qualified Sound.File.NeXT as F {- hsc3-sf -}-import Sound.OSC {- hosc -}-import Sound.SC3 {- hsc3 -}-import System.Environment-import System.Random {- random -}---- * Score model.---- | Interval to schedule in advance.-latency :: Double-latency = 0.15---- | Add t to timestamp.-offset :: Time -> Bundle -> Bundle-offset t (Bundle t0 m) = Bundle (t + t0) m---- | Play non-empty set of osc bundles.-play_set :: Transport m => [Bundle] -> m ()-play_set [] = error "play_set:empty"-play_set (x:xs) = do-  let (Bundle t _) = x-  pauseThreadUntil (t - latency)-  mapM_ sendBundle (x:xs)---- | Play grouped score.-play_sets :: Transport m => [[Bundle]] -> m ()-play_sets [] = return ()-play_sets s = do-  t <- time-  mapM_ (play_set . map (offset t)) 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 m => Int -> [Bundle] -> m ()-play_score n s = play_sets (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 =-    let 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 = Envelope [a, a, 0] [d, 0] [EnvLin] Nothing Nothing-        e_ugen = envGen AR 1 1 0 1 RemoveSynth e_data-    in offsetOut o (bufRdL 1 AR b ph Loop * e_ugen)---- * Waveset synthesizer---- | Construct s_new message for synthesiser.-mk_msg :: Double -> Double -> Double -> Double -> Message-mk_msg b sf ef d =-    let a = [("bufnum", b), ("start", sf), ("end", ef), ("dur", d)]-    in s_new "waveset" (-1) AddToTail 1 a---- | 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)] -> [Bundle]-mk_score sr repeats w =-    let durations = zipWith (\(s, e) r -> (e - s) * r / sr) w repeats-        start_times = scanl (+) 0 durations-        mk_elem (s,e) t d = Bundle t [mk_msg 10 s e d]-    in zipWith3 mk_elem w start_times durations---- | n randomly chosen elements of w.-rchoose :: Int -> [a] -> [a]-rchoose n w =-    let (l, r) = (1, length w)-        a = A.listArray (l,r) w-    in take n (map (a A.!) (randomRs (l,r) (mkStdGen 1)))---- | Load waveset instrument, allocate sound file buffer, do waveset---   analysis, generate & play scores.-run_waveset :: Transport m => String -> m ()-run_waveset fn = do-  _ <- async (d_recv (synthdef "waveset" waveset))-  _ <- async (b_allocRead 10 fn 0 0)-  (hdr, cs) <- liftIO (F.read fn)-  let nc = F.channelCount hdr-      nf = F.frameCount hdr-      sr = fromIntegral (F.sampleRate hdr)-      b = cs !! 0-      w = ws (prune 64 0 (fzc 0 b))-      pl s = play_score 10 s >> wait 1-      post = liftIO . putStrLn-  post ("#f: " ++ show (nc, nf, sr))-  post ("#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)) (rchoose 512 w))--main :: IO ()-main = do-  a <- getArgs-  case a of-    [fn] -> withSC3 (run_waveset fn)-    _ -> error "audio file?"--{---withSC3 (run_waveset "/home/rohan/data/audio/pf-c5.snd")---}
Sound/SC3/Graph/RD_wial_m.hs view
@@ -1,14 +1,14 @@ -- wial (rd) module Sound.SC3.Graph.RD_wial_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  wial :: (Functor m,UId m) => m UGen wial = do   let pls c d f = do let t = pulseDivider c d 0                          e = decay2 t 0.05 0.75                          o = sinOsc AR (toggleFF t * f + f * 2) 0-                     n0 <- tIRand 0 1 t+                     n0 <- tIRandM 0 1 t                      return (o * e * n0 * 0.5)       smpl f = [(4,6,f,0.75)                ,(2,6,f * 2,0.75)@@ -19,8 +19,8 @@                ,(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-  n0 <- dust KR 2-  f <- tWChoose n0 (mce2 (20 * 0.66) 20) (mce2 0.25 0.75) 0+  n0 <- dustM KR 2+  f <- tWChooseM n0 (mce2 (20 * 0.66) 20) (mce2 0.25 0.75) 0   fmap sum (mapM (plss clk) (smpl f))  main :: IO ()
Sound/SC3/Graph/RD_xy_interference.hs view
@@ -1,8 +1,7 @@ -- xy-interference (rd) module Sound.SC3.Graph.RD_xy_interference where -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -}  xy_interference :: UGen xy_interference =@@ -12,7 +11,7 @@                a = sinOsc AR (x + n) 0                b = sinOsc AR y 0            in a * b-  in mix (uclone 'β' 3 nd)+  in mix (uclone 'β' 3 nd) * 0.1  main :: IO () main = audition (out 0 xy_interference)
Sound/SC3/Graph/RD_xy_interference_m.hs view
@@ -1,13 +1,13 @@ -- xy-interference-m (rd) module Sound.SC3.Graph.RD_xy_interference_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  xy_interference :: UId m => m UGen xy_interference = do   let x = mouseX KR 20 22000 Linear (mce2 0.005 0.025)       y = mouseY KR 20 22000 Linear (mce2 0.005 0.075)-      nd = do n <- lfNoise0 KR (mce2 5 9)+      nd = do n <- lfNoise0M KR (mce2 5 9)               let a = sinOsc AR (x + n) 0                   b = sinOsc AR y 0               return (a * b)
Sound/SC3/Graph/SC_bottle_m.hs view
@@ -2,19 +2,19 @@ module Sound.SC3.Graph.SC_bottle_m where  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  bottle :: UId m => m UGen bottle = do-  freq <- rand 220 880-  wn <- whiteNoise AR-  pn <- pinkNoise AR+  freq <- randM 220 880+  wn <- whiteNoiseM AR+  pn <- pinkNoiseM AR   let perc = envPerc 0.1 0.6       ex = envGen KR 1 1 0 1 DoNothing perc * wn * 0.02       flute = ringz ex freq 0.3       r = resonz pn (5 + (freq / 2)) 0.1       breath = envGen KR 1 1 0 1 DoNothing perc * r-      rapf i = do x <- linRand 0.001 0.1 (-1)+      rapf i = do x <- linRandM 0.001 0.1 (-1)                   return (i + allpassN i 0.1 x 1.0 * 0.5)       cls i = let en = let c = EnvNum (-4) in (c,c,c)                   l = envLinen' 0.01 3.0 1.0 1 en
Sound/SC3/Graph/SP_insects_m.hs view
@@ -1,16 +1,16 @@ -- insects (sp) module Sound.SC3.Graph.SP_insects_m where -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  insect :: UId m => m UGen 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+  r1 <- randM 2000 3000+  r2 <- randM 0.05 0.1+  n1 <- lfNoise2M KR (r2 * 50 + 50)+  r4 <- randM 1 10+  r5 <- randM 0.05 0.1+  n2 <- lfNoise2M KR r5   let a = sinOsc KR r4 0 * 0.5 + 0.5       o = sinOsc AR (r1 + n1) r2 * 0.005 * a   return (pan2 o n2 1)
+ Sound/SC3/Graph/TB_1_4Tw.hs view
@@ -0,0 +1,15 @@+-- http://sccode.org/1-4Tw (tb)+module Sound.SC3.Graph.TB_1_4Tw where++import Sound.SC3 {- hsc3 -}++one_4tw :: UGen+one_4tw =+    let im = mix (impulse AR (mce3 1 (1/3) (1/5)) (mce3 0 0.133 0.5))+        f i = tDuty AR (max 0.25 (timer i)) 0 DoNothing 1 0+        g n i = sinOsc AR ((4000 + (i * 500))) 0 * decay2 n 0.01 0.2+        nd = zipWith g (iterate f im) [0..9]+    in splay (mce nd) 1 1 0 True++main :: IO ()+main = audition (out 0 one_4tw)
Sound/SC3/Graph/TM_drummer.hs view
@@ -1,7 +1,7 @@ -- drummer (tm) module Sound.SC3.Graph.TM_drummer where -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  drummer :: UGen drummer =
gr/1-1Ni.hs view
@@ -1,9 +1,9 @@ -- http://sccode.org/1-1Ni  import Control.Concurrent {- base -}-import Control.Monad+import Control.Monad {- base -} import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  scr :: (UGen -> (UGen,UGen)) -> Int -> UGen -> UGen -> UGen scr h n f d =@@ -11,7 +11,7 @@         o z = sinOsc AR (expRand z h0 h1) 0 * 0.2         m = mce (map o (take n ['α'..]))         e = lfGauss AR d (1/4) 0 NoLoop RemoveSynth-    in splay (m * e) 1 0.1 0 True+    in splay (m * e) 1 0.25 0 True  -- > audition (b 12) -- > Sound.SC3.UGen.Dot.draw (b 8)
+ gr/1-1Ni.scd view
@@ -0,0 +1,34 @@+// http://sccode.org/1-1Ni++{+var f = {+    var h = [40,45,52].choose.midicps;+    var o = {SinOsc.ar(exprand(h,h + (h / 64)),0,0.2)};+    {Splay.ar(o ! 16) * LFGauss.ar(9,1/4,0,0,2)}.play;+    4.wait;+};+var g = {+    var h = x.choose.midicps;+    var o = {SinOsc.ar(exprand(h - (h / 128),h + (h / 128)),0,0.1)};+    {Splay.ar(o ! 16) * LFGauss.ar(6,1/4,0,0,2)}.play;+    0.5.wait;+};+var ch = [[72,69,64], [70,64,62], [67,60,70], [65,60,69], [64,60,67], [65,60,69]];+var x = ch[0];+var b = {f.loop}.fork;+var c = {g.loop}.fork;+var main = {+    5.do({+        ch.do({+            arg i;+            x = i;+            x.postln;+            10.wait;+        });+    });+    10.wait;+    c.stop;+    4.wait;+    b.stop;+};+main.fork}.();
gr/1-4Q6.hs view
@@ -1,15 +1,15 @@ -- http://sccode.org/1-4Q6 (f0)  import Sound.SC3 {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  -- > audition risset ----- let set p = withSC3 (\fd -> send fd (n_set (-1) p))--- set [("trig",1)]--- set [("freq",midiCPS 100),("sustain",3),("trig",1)]--- set [("freq",midiCPS 60),("sustain",9),("trig",1)]--- set [("freq",midiCPS 40),("sustain",15),("trig",1)]+-- > let set p = withSC3 (send (n_set (-1) p))+-- > set [("trig",1)]+-- > set [("freq",midiCPS 100),("sustain",3),("trig",1)]+-- > set [("freq",midiCPS 60),("sustain",9),("trig",1)]+-- > set [("freq",midiCPS 40),("sustain",15),("trig",1)] risset :: Synthdef risset =     let k = control KR@@ -30,16 +30,19 @@         src = mixFill 11 fn     in synthdef "risset" (out 0 (pan2 src pan 1)) -pattern :: [P_Bind]+pattern :: (Synthdef,Int,P.Param) pattern =-  [(K_instr,pinstr' (Instr_Def risset False))-  ,(K_id,1000)-  ,(K_note,prand 'α' [0,2,5,7,11] inf)-  ,(K_octave,prand 'β' [4,5,6,7,9] inf)-  ,(K_legato,1)-  ,(K_dur,prand 'γ' [2,3,5,7] inf)-  ,(K_amp,pwhite 'δ' 0.025 0.15 inf)-  ,(K_param "trig",1)]+    let fr = let d = P.rand 'α' [0,2,5,7,11]+                 o = P.rand 'β' [4,5,6,7,9]+                 sc = [0,2,4,5,7,9,11]+             in P.degree_to_cps' sc 12 d o+        du = P.rand 'γ' [2,3,5,7]+    in (risset,1000+       ,[("freq",fr)+        ,("dur",du)+        ,("sustain",map (* 1.25) du)+        ,("amp",P.white 'δ' 0.025 0.15)+        ,("trig",repeat 1)])  main :: IO ()-main = audition (pmono pattern)+main = audition (P.nbind1 pattern)
gr/1-4Q6.scd view
@@ -12,7 +12,7 @@  ;SinOsc.ar(freq*frqs[i]+dets[i],0,amp*env)} ;var src = Mix.fill(11,fn) ;Out.ar(out,Pan2.ar(src,pan));-}).add;+}).send;  a = Synth(\risset,[\freq,72.midicps,\dur,4]) a.set(\t_trig,1)
gr/1-4QM.hs view
@@ -2,9 +2,9 @@  import Control.Monad {- base -} import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Random.IO as L {- hsc3-lang -}-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  type ST = (UGen,UGen,UGen) 
gr/1-4QM.scd view
@@ -10,7 +10,7 @@   ;play{var p = Env.perc(0.01,a + rel.next)        ;var e = EnvGen.ar(p,doneAction:2)        ;var x = [60,67,75,79,94].scramble-	   ;var ta = x.midicps * a * s1.choose+       ;var ta = x.midicps * a * s1.choose        ;var tb = x * s2.choose.midicps        ;var tc = a * s3.choose.midicps        ;e * AY.ar(ta,tb,tc,0.25,3,15,10,7)}
gr/1-4QN.hs view
@@ -3,8 +3,8 @@ import Control.Concurrent {- base -} import Control.Monad {- base -} import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -} import qualified Sound.SC3.Lang.Random.IO as L  -- > withSC3 init_b@@ -14,6 +14,7 @@   async (b_gen_sine1 0 [Normalise,Wavetable,Clear] (map recip [1,2,3,4]))  -- > Sound.SC3.UGen.Dot.draw (mk_g (lfNoise0 'α'))+-- > audition (mk_g (lfNoise0 'α')) mk_g :: (Rate -> UGen -> UGen) -> Synthdef mk_g o =     let k = control KR@@ -30,29 +31,26 @@         g = grainBuf 2 t (1 / l) b r p 2 0 (-1) 512     in synthdef "g" (out 0 (g * e)) -p1 :: [P_Bind]-p1 =-    [(K_dur,pseq [4] inf)-    ,(K_param "sdens",pseq [9000,1000,500] inf / 100)-    ,(K_param "edens",prand 'δ' [pseq [9000,1000,500] 1 / 10-                                ,pseq [1] 3] inf)-    ,(K_param "rate",pwhite 'ε' (-10) 10 inf)-    ,(K_param "pos",pwhite 'ζ' (-10) 10 inf)]--p2 :: [P_Bind]-p2 =-    [(K_dur,pseq [4/3] inf)-    ,(K_param "sdens",pseq [9000,1000,500,25] inf)-    ,(K_param "edens",prand 'η' [pseq [9000,1000,500,25] 1-                                ,pseq [1] 4] inf)-    ,(K_param "rate",pwhite 'θ' (-100) 100 inf)-    ,(K_param "pos",pwhite 'ι' (-10) 10 inf)]+pb :: [P.Param]+pb =+    [[("dur",repeat 4)+     ,("sdens",cycle [9000,1000,500] ./ 100)+     ,("edens",concat (P.rand 'α' [[9000,1000,500] ./ 10+                                  ,[1,1,1]]))+     ,("rate",P.white 'β' (-10) 10)+     ,("pos",P.white 'γ' (-10) 10)]+    ,[("dur",repeat (4/3))+     ,("sdens",cycle [9000,1000,500,25])+     ,("edens",concat (P.rand 'δ' [[9000,1000,500,25]+                                  ,[1,1,1,1]]))+     ,("rate",P.white 'ε' (-100) 100)+     ,("pos",P.white 'ζ' (-10) 10)]]  push_g :: Transport m => m Message push_g = do   let ph u r f = u r f 0       wd u r f = u r f 0 0-      o_set = [lfNoise0 'κ',ph sinOsc,ph impulse,wd lfPulse,ph lfSaw]+      o_set = [lfNoise0 'α',ph sinOsc,ph impulse,wd lfPulse,ph lfSaw]   o <- L.choose o_set   async (d_recv (mk_g o)) @@ -62,7 +60,11 @@   dt <- L.choose [1,2,4,8,16,32]   wait dt +-- 1. there is a 'pattern' that plays the 'g'+-- 2. there is a process that sends new 'g' definitions to scsynth main :: IO () main = do   _ <- forkIO (withSC3 (reset >> init_b >> forever update_g))-  audition (p_with (K_instr,pinstr "g") (ppar (map pbind [p1,p2])))+  let g = mk_g (lfNoise0 'α')+      sc = P.sbind (zip (repeat g) pb)+  audition sc
gr/1-4QN.scd view
@@ -15,25 +15,25 @@   ;Out.ar(out,g * env)}).add()};  b = Pbind(-	\instrument,\g1,-	\dur,Pseq([4],inf),-	\sdens,Pseq([9000,1000,500]/100,inf),-	\edens,Prand([Pseq([9000,1000,500]/10,1),Pseq([1],3)],inf),-	\rate,Pfunc({-10.0.rrand(10)}),-	\pos,Pfunc({-10.0.rrand(10)}),-	\bufnum,z.bufnum);+    \instrument,\g1,+    \dur,Pseq([4],inf),+    \sdens,Pseq([9000,1000,500]/100,inf),+    \edens,Prand([Pseq([9000,1000,500]/10,1),Pseq([1],3)],inf),+    \rate,Pfunc({-10.0.rrand(10)}),+    \pos,Pfunc({-10.0.rrand(10)}),+    \bufnum,z.bufnum);  c = Pbind(-	\instrument,\g1,-	\dur,Pseq([4/3],inf),-	\sdens,Pseq([9000,1000,500,25],inf),-	\edens,Prand([Pseq([9000,1000,500,25],1),Pseq([1],4)],inf),-	\rate,Pfunc({-100.0.rrand(100)}),-	\pos,Pfunc({-10.0.rrand(10)}),-	\bufnum,z.bufnum);+    \instrument,\g1,+    \dur,Pseq([4/3],inf),+    \sdens,Pseq([9000,1000,500,25],inf),+    \edens,Prand([Pseq([9000,1000,500,25],1),Pseq([1],4)],inf),+    \rate,Pfunc({-100.0.rrand(100)}),+    \pos,Pfunc({-10.0.rrand(10)}),+    \bufnum,z.bufnum);  fork({loop  {var o = [LFNoise0,SinOsc,Impulse,LFPulse,LFSaw].choose- ;g.value(o);[1,2,4,8,16,32].choose.postln.wait}});+ ;g.(o);[1,2,4,8,16,32].choose.postln.wait}});  [b,c].do({|p| p.play});
+ gr/1-4Tw.hs view
@@ -0,0 +1,14 @@+-- http://sccode.org/1-4Tw (tb)++import Sound.SC3 {- hsc3 -}++one_4tw :: UGen+one_4tw =+    let im = mix (impulse AR (mce3 1 (1/3) (1/5)) (mce3 0 0.133 0.5))+        f i = tDuty AR (max 0.25 (timer i)) 0 DoNothing 1 0+        g n i = sinOsc AR ((4000 + (i * 500))) 0 * decay2 n 0.01 0.2+        nd = zipWith g (iterate f im) [0..9]+    in splay (mce nd) 1 1 0 True++main :: IO ()+main = audition (out 0 one_4tw)
+ gr/1-4Tw.scd view
@@ -0,0 +1,5 @@+{var i = Impulse.ar([1,3,5].reciprocal,[0,0.133,0.5]).sum+;var f = {|st,z| [TDuty.ar(max(0.25,Timer.ar(st.first)),0,1)] ++ st}+;var n = (1..10).inject([i],f)+;n = n.collect{|n,i| SinOsc.ar((4000 + (i * 500))) * Decay2.ar(n,0.01,0.2)}+;Splay.ar(n)}.play
+ gr/1-4VL.hs view
@@ -0,0 +1,83 @@+-- http://sccode.org/1-4VL++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}+import qualified Sound.SC3.Lang.Random.ID as R {- hsc3-lang -}++tb_freq :: [UGen]+tb_freq =+    let n e z (l,r) = range l r (lfNoise1 e KR z)+        ln (s,e,d) = line KR s e d DoNothing+        f0 = n 'α' 0.5 (2424, 2444)+    in [f0 + ln (20, 0, 0.5)+       ,f0 + n 'β' 0.5 (1, 3)+       ,n 'γ' 1.5 (5435, 5440) - ln (35, 0, 1)+       ,n 'δ' 1.5 (5480, 5485) - ln (10, 0, 0.5)+       ,n 'ε' 2 (8435, 8445) + ln (15, 0, 0.05)+       ,n 'ζ' 2 (8665, 8670)+       ,n 'η' 2 (8704, 8709)+       ,n 'θ' 2 (8807, 8817)+       ,n 'ι' 2 (9570, 9607)+       ,n 'κ' 2 (10567, 10572) - ln (20, 0, 0.05)+       ,n 'λ' 2 (10627, 10636) + ln (35, 0, 0.05)+       ,n 'μ' 2 (14689, 14697) - ln (10, 0, 0.05)]++tb_amp :: [UGen]+tb_amp =+    let n e z (l,r) = range l r (lfNoise1 e KR z)+        a = [n 'α' 1 (-10, -5)+            ,n 'β' 1 (-20, -10)+            ,n 'γ' 1 (-12, -6)+            ,n 'δ' 1 (-12, -6)+            ,-20+            ,-20+            ,-20+            ,-25+            ,-10+            ,-20+            ,-20+            ,-25]+    in map dbAmp a++tb_rtime :: Floating b => b -> [b]+tb_rtime freqscale =+    let t = [20 * (freqscale ** 0.2)+            ,20 * (freqscale ** 0.2)+            ,5+            ,5+            ,0.6+            ,0.5+            ,0.3+            ,0.25+            ,0.4+            ,0.5+            ,0.4+            ,0.6]+    in map (* ((recip freqscale) ** 0.5)) t++prayer_bell :: UGen -> UGen -> UGen -> UGen -> DoneAction -> UGen+prayer_bell exc freq decayscale lagTime doneAction =+    let freqscale = lag3 (freq / 2434) lagTime+        decayscale' = lag3 decayscale lagTime+        spec = klankSpec tb_freq tb_amp (tb_rtime freqscale)+        sig = dynKlank exc freqscale 0 decayscale' spec+        end = detectSilence (mix sig) 1e-4 0.1 doneAction+    in mrg2 sig end++-- > audition (out 0 bell_1)+bell_1 :: UGen+bell_1 =+    let tr = impulse AR 0 0 * rand 'α' 0.05 0.09+        exc = tr + (pinkNoise 'β' AR * xLine KR 2e-3 1e-6 15 DoNothing)+        frq = lchoose 'γ' [120,240 .. 2000]+    in prayer_bell exc frq 1 0 RemoveSynth++-- > audition (out 0 bell_2)+bell_2 :: UGen+bell_2 =+    let exc = impulse AR 0 0 * rand 'α' 0.05 0.09+        frq = lchoose 'β' [240, 360 .. 2000]+    in prayer_bell exc frq 1 10 RemoveSynth++main :: IO ()+main = spawnTextureU (\i -> R.rrand i (1/3) 9,maxBound) (lchoose 'α' [bell_1,bell_2])
+ gr/1-9.hs view
@@ -0,0 +1,16 @@+-- http://sccode.org/1-9++import Sound.SC3 {- hsc3 -}++k :: Enum a => a -> Int -> [Int]+k c n = let i = fromEnum c in [i .. i + n]++u :: UGen+u =+    let a = hpf (pinkNoise 'α' AR * 0.005) 10 * line KR 0 1 9 DoNothing+        f i = let i' = constant i+              in ringz (a * lfNoise1 i KR (0.05 + rand i 0 0.1)) (55 * i' + 60) 0.2+    in tanh (gVerb (sum (map f (k 'β' 98))) 70 99 0.5 0.5 15 1 0.7 0.5 300)++main :: IO ()+main = audition (out 0 u)
+ gr/1-9.scd view
@@ -0,0 +1,5 @@+// http://sccode.org/1-9++{var a = HPF.ar(PinkNoise.ar * 0.005,10) * Line.kr(0,1,9)+;var f = {arg i; Ringz.ar(a * LFNoise1.kr(0.05 + 0.1.rand),55 * i + 60,0.2)}+;GVerb.ar((f ! 99).sum,70,99).tanh}.play
gr/1-Td.hs view
@@ -1,9 +1,9 @@ -- http://sccode.org/1-Td  import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Collection as C {- hsc3-lang -}-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  one_td_u :: UGen one_td_u =
gr/acid-otophilia.hs view
@@ -3,7 +3,7 @@ import Data.List {- base -} import Data.Maybe import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import System.Random {- random -}  -- * Instruments
+ gr/adc-16-6-2.hs view
@@ -0,0 +1,50 @@+-- adc-16-6-2 (adc) #p.489+{-# OPTIONS_GHC -F -pgmF hsc3-uparam #-}++import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.List as L {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}++constQ :: Synthdef+constQ =+    let uparam = {bus=0,bufnum=0,amp=0.1,pan=0,centerPos=0.5,sustain=0.1,rate=1,freq=400,rq=0.3}+        ringtime = min ((2.4 / (freq * rq)) * 0.66) 0.5 -- estimated+        ampcomp = (rq ** (-1)) * ((400 / freq) ** 0.5)+        envSig = let env = envelope [0,amp,0] (map (* sustain) [0.5,0.5]) [EnvWelch]+                 in envGen AR 1 1 0 1 DoNothing env+        cutoffEnv = let env = envelope [1,1,0] [sustain + ringtime,0.01] [EnvLin]+                    in envGen KR 1 1 0 1 RemoveSynth env+        startPos = (centerPos - (sustain * rate * 0.5)) * bufSampleRate IR bufnum+        grain = playBuf 1 AR bufnum rate 0 startPos Loop DoNothing * envSig+        filtered = bpf grain freq rq * ampcomp+    in synthdef "constQ" (offsetOut bus (pan2 filtered pan cutoffEnv))++p :: Double -> P.Param+p b =+    [("bufnum",repeat b)+    ,("sustain",P.white 'α' 0.02 0.04)+    ,("amp",P.white 'β' 0.05 0.25)+    ,("centerPos",cycle [0,0.01 .. 2])+    ,("dur",L.brown 'γ' 0.01 0.09 5)+    ,("rate",P.white 'δ' 0.95 1.05)+    ,("freq",map midiCPS (L.brown 'ε' 64 120 8))+    ,("pan",P.white 'ζ' (-1) 1)+    ,("rq",P.white 'η' 0.03 0.15)]++p' :: Double -> P.Param+p' b =+    [("bufnum",repeat b)+    ,("sustain",P.white 'θ' 0.02 0.04)+    ,("amp",repeat 0.3)+    ,("centerPos",cycle [0,0.01 .. 2])+    ,("dur",P.white 'ι' 0.01 0.03)+    ,("rate",P.white 'κ' 0.95 1.05)+    ,("freq",map midiCPS (L.brown 'λ' 80 82 8))+    ,("pan",P.white 'μ' (-1) 1)+    ,("rq",repeat 0.05)]++main :: IO ()+main = withSC3$do+  let fn = "/usr/local/share/SuperCollider/sounds/a11wlk01-44_1.aiff"+  _ <- async (b_allocRead 0 fn 0 0)+  play (P.sbind [(constQ,p 0),(constQ,p' 0)])
+ gr/adc-16-6-2.scd view
@@ -0,0 +1,37 @@+// adc-16-6-2 (adc) #p.489++b = Buffer.read(s, "sounds/a11wlk01-44_1.aiff");++d = SynthDef(\constQ, {+    arg out, bufnum=0, amp=0.1, pan, centerPos=0.5, sustain=0.1, rate=1, freq=400, rq=0.3;+    var ringtime = (2.4 / (freq * rq) * 0.66).min(0.5); // estimated+    var ampcomp = (rq ** -1) * (400 / freq ** 0.5);+    var envSig = EnvGen.ar(Env([0, amp, 0], [0.5, 0.5] * sustain, \welch));+    var cutoffEnv = EnvGen.kr(Env([1, 1, 0], [sustain+ringtime,0.01]), doneAction: 2);+    var startPos = (centerPos - (sustain * rate * 0.5)) * BufSampleRate.ir(bufnum);+    var grain = PlayBuf.ar(1, bufnum, rate, 0, startPos, 1) * envSig;+    var filtered = BPF.ar( grain, freq, rq, ampcomp);+    OffsetOut.ar(out, Pan2.ar(filtered, pan, cutoffEnv))+}, \ir.dup(8)).add;++Pbindef(\gr1Q,+	\instrument, \constQ,+    \bufnum, b.bufnum,+	\sustain, 0.01,+    \amp, 0.2,+	\centerPos, Pn(Penv([1, 2.0], [10], \lin)),+	\dur, Pn(Penv([0.01, 0.09, 0.03].scramble, [0.38, 0.62] * 10, \exp)),+	\rate, Pwhite(0.95, 1.05),+	\freq, Pbrown(64.0, 120, 8.0).midicps,+	\pan, Pwhite(-1, 1, inf),+	\rq, 0.03+).play;++Pbindef(\gr1Q, \rq, 0.05);+Pbindef(\gr1Q, \rq, 0.01);+Pbindef(\gr1Q, \sustain, 0.03, \amp, 0.3);+Pbindef(\gr1Q, \freq, Pbrown(80, 82, 18.0).midicps);+Pbindef(\gr1Q, \rq, 0.03);+Pbindef(\gr1Q, \rate, Pn(Penv([1,1], [6], \lin)));+Pbindef(\gr1Q, \dur, Pwhite(0.01, 0.02));+Pbindef(\gr1Q, \centerPos, Pn(Penv([0, 1.0], [10], \lin)));
gr/after-goeyvaerts.hs view
@@ -5,7 +5,7 @@ import Data.List.Split {- split -} import qualified Data.Map as M {- containers -} import Sound.OSC.FD {- hosc -}-import Sound.SC3.ID.FD {- hsc3 -}+import Sound.SC3.FD {- hsc3 -} import qualified Sound.SC3.Lang.Collection as C {- hsc3-lang -} import qualified Sound.SC3.Lang.Random.Gen as R import System.Random {- random -}
gr/aleatoric-quartet-m.hs view
@@ -1,27 +1,28 @@--- aleatoric quartet (jmcc)+-- aleatoric quartet (jmcc) #7 -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -} +-- > g <- aleatoric_quartet aleatoric_quartet :: UId m => m UGen aleatoric_quartet = do-  let base_mn = control KR "note" 66-      amp = control KR "ampl" 0.07+  let base_mn = 66 -- control KR "note" 66+      amp = 0.07 -- control KR "ampl" 0.07       density = mouseX KR 0.01 1 Linear 0.1       dmul = recip density * 0.5 * amp       dadd = amp - dmul-      rapf i = do r <- clone 2 (rand 0 0.05)+      rapf i = do r <- clone 2 (randM 0 0.05)                   return (allpassN i 0.05 r 1)-      mk_f = do i0 <- iRand 0 2-                let r0 = select i0 (mce [1, 0.5, 0.25])-                r1 <- rand (-30) 30-                n0 <- lfNoise0 KR r0+      mk_f = do r0 <- lchooseM [1, 0.5, 0.25]+                r1 <- randM (-30) 30+                n0 <- lfNoise0M KR r0                 let m = n0 * 7 + base_mn + r1                     m' = lag (roundTo m 1) 0.2                 return (midiCPS m')       mk_s = do f <- fmap recip mk_f-                r <- rand (-1) 1-                x <- do n0 <- pinkNoise AR-                        n1 <- lfNoise1 KR 8+                r <- randM (-1) 1+                x <- do n0 <- pinkNoiseM AR+                        n1 <- lfNoise1M KR 8                         return (n0 * max 0 (n1 * dmul + dadd))                 return (pan2 (combL x 0.02 f 3) r 1)   g <- chainM 5 rapf =<< fmap sum (sequence (replicate 4 mk_s))
gr/aleatoric-quartet.scd view
@@ -1,3 +1,5 @@+// aleatoric quartet (jmcc) #7+ { var amp = 0.07 ; var density = MouseX.kr(0.01, 1, 'linear', 0.1) ; var dmul = density.reciprocal * 0.5 * amp@@ -5,18 +7,18 @@ ; var rapf = { arg i              ; var r = Array.fill(2, { Rand(0, 0.05) })              ; AllpassN.ar(i, 0.05, r, 1) }-; var mk_f = { var i0 = IRand.new(0, 2)+; var mk_f = { var i0 = IRand(0, 2)              ; var r0 = Select.kr(i0, [1, 0.5, 0.25])-             ; var r1 = Rand.new(-30, 30)+             ; var r1 = Rand(-30, 30)              ; var n0 = LFNoise0.kr(r0)              ; var m = Lag.kr((n0 * 7 + 66 + r1).round(1), 0.2)              ; m.midicps }-; var mk_s = { var f = mk_f.value.reciprocal-             ; var r = Rand.new(-1, 1)-             ; var n0 = PinkNoise.ar()+; var mk_s = { var f = mk_f.().reciprocal+             ; var r = Rand(-1, 1)+             ; var n0 = PinkNoise.ar              ; var n1 = LFNoise1.kr(8)              ; var x = n0 * 0.max(n1 * dmul + dadd)              ; Pan2.ar(CombL.ar(x, 0.02, f, 3), r, 1) } ; var g = Mix.fill(4, mk_s)-; 5.do({ g = rapf.value(g) })-; Out.ar(0, LeakDC.ar(g, 0.995)) }.play+; 5.do({ g = rapf.(g) })+; LeakDC.ar(g, 0.995) }.play
+ gr/alien-froggies-rec.hs view
@@ -0,0 +1,13 @@+-- alien froggies (jmcc) #1++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++alien_froggies :: UGen -> (UGen,UGen)+alien_froggies r =+    let r' = fold (r * exp (linRand 'α' (-0.2) 0.2 0)) 1 30+        o = formant AR r' (expRand 'β' 200 3000) (rand 'γ' 0 9 * r' + r')+    in (o * 0.05,r')++main :: IO ()+main = overlapTextureS (0.25,0.5,5,maxBound) alien_froggies 11
gr/alien-froggies.hs view
@@ -1,13 +1,14 @@--- alien froggies (jmcc)+-- alien froggies (jmcc) #1 -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -} -alien_froggies :: UGen -> (UGen,UGen)+alien_froggies :: UGen -> UGen alien_froggies r =     let r' = fold (r * exp (linRand 'α' (-0.2) 0.2 0)) 1 30         o = formant AR r' (expRand 'β' 200 3000) (rand 'γ' 0 9 * r' + r')-    in (o * 0.05,r')+    in o * 0.05 +-- > let u = alien_froggies 11 main :: IO ()-main = overlapTextureS (0.25,0.5,5,maxBound) alien_froggies 11+main = overlapTextureU (0.25,0.5,5,maxBound) (alien_froggies 11)
gr/alien-froggies.scd view
@@ -1,5 +1,9 @@-var rate = 11.0;-play({OverlapTexture.ar({-rate = (rate * (0.2.bilinrand.exp)).fold(1.0,30.0);-var o = Formant.ar(rate,exprand(200,3000.0),9.0.rand * rate + rate,0.05)},-0.5,0.25,5,1)})+// alien froggies (jmcc) #1++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    var rate = 11;+    var r = (rate * (0.2.bilinrand.exp)).fold(1.0,30.0);+    Formant.ar(r,exprand(200,3000.0),9.0.rand * r + r,0.05);+},sustainTime:0.5,transitionTime:0.25,overlap:5);
gr/alien-meadow.hs view
@@ -1,16 +1,13 @@--- alien meadow (jmcc)+-- alien meadow (jmcc) #6 -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  alien_meadow :: UGen alien_meadow =-    let a = rand 'α' 0 20-        b = rand 'α' 0 5000-        c = rand 'α' 0 20-        p = rand 'α' (-1) 1-        f = sinOsc AR a 0 * b * 0.1 + b-    in pan2 (sinOsc AR f 0) p (sinOsc AR c 0 * 0.05 + 0.05)+    let b = rand 'α' 0 5000+        f = sinOsc AR (rand 'β' 0 20) 0 * b * 0.1 + b+    in pan2 (sinOsc AR f 0) (rand 'γ' (-1) 1) (sinOsc AR (rand 'δ' 0 20) 0 * 0.05 + 0.05)  main :: IO () main = overlapTextureU (2,6,6,maxBound) alien_meadow
+ gr/alien-meadow.scd view
@@ -0,0 +1,11 @@+// alien meadow (jmcc) #6++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    var a = 20.0.rand;+    var b = 5000.0.rand;+    var c = 20.0.rand;+    var pan = 1.0.rand2;+    Pan2.ar(SinOsc.ar(SinOsc.ar(a, 0, 0.1*b, b), 0, SinOsc.kr(c, 0, 0.05, 0.05)), pan);+},sustainTime:6,transitionTime:2,overlap:6);
gr/ambient1.hs view
@@ -2,7 +2,7 @@ -- some edits......  import Sound.SC3 {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  chain :: a -> [a -> a] -> a chain n ff =@@ -55,45 +55,42 @@ audition bass_u -} -pulse_i :: Instr-pulse_i = Instr_Def (synthdef "pulse" pulse_u) False+pulse_s :: Synthdef+pulse_s = synthdef "pulse" pulse_u -drone_i :: Instr-drone_i = Instr_Def (synthdef "drone" drone_u) False+drone_s :: Synthdef+drone_s = synthdef "drone" drone_u -bass_i :: Instr-bass_i = Instr_Def (synthdef "bass" bass_u) False+bass_s :: Synthdef+bass_s = synthdef "bass" bass_u -dur_p :: Fractional a => P a-dur_p = prand 'β' [3,0.7,1,0.5] inf+dur_p :: Fractional a => [a]+dur_p = P.rand 'β' [3,0.7,1,0.5] -pulse_p :: [P_Bind]+pulse_p :: P.Param pulse_p =-    [(K_instr,pinstr' pulse_i)-    ,(K_dur,dur_p * 10)-    ,(K_midinote,prand 'α' [59,72,76,79,81,88,90] inf)-    ,(K_amp,pwhite 'β' 0.2 0.27 inf)-    ,(K_param "attackTime",pwhite 'γ' 0 7 inf)-    ,(K_param "delayTime",0.02)]+    [("dur",map (* 10) dur_p)+    ,("freq",fmap midiCPS (P.rand 'α' [59,72,76,79,81,88,90]))+    ,("amp",P.white 'β' 0.2 0.27)+    ,("attackTime",P.white 'γ' 0 7)+    ,("delayTime",repeat 0.02)] -drone_p :: [P_Bind]+drone_p :: P.Param drone_p =-    [(K_instr,pinstr' drone_i)-    ,(K_dur,dur_p)-    ,(K_midinote,prand 'α' [31,40,45,64,68,69] inf)-    ,(K_amp,pwhite 'β' 0.03 0.08 inf * 0.7)-    ,(K_param "phase",pwrand 'γ' [0,4.7123] [0.5,0.5] inf)]+    [("dur",dur_p)+    ,("freq",fmap midiCPS (P.rand 'α' [31,40,45,64,68,69]))+    ,("amp",P.white 'β' 0.02 0.06)+    ,("phase",P.rand 'γ' [0,4.7123])] -bass_p :: [P_Bind]+bass_p :: P.Param bass_p =-    [(K_instr,pinstr' bass_i)-    ,(K_dur,dur_p)-    ,(K_midinote,31)-    ,(K_amp,0.3)]+    [("dur",dur_p)+    ,("freq",repeat (midiCPS 31))+    ,("amp",repeat 0.3)]  main :: IO () main = do-  let p = ppar [pbind pulse_p-               ,pbind drone_p-               ,pbind bass_p]-  audition p+  let sc = P.sbind [(pulse_s,pulse_p)+                   ,(drone_s,drone_p)+                   ,(bass_s,bass_p)]+  audition sc
+ gr/analog-bubbles-mouse.hs view
@@ -0,0 +1,16 @@+-- analog bubbles with mouse control (jmcc) #3++import Sound.SC3 {- hsc3 -}++analog_bubbles_mouse :: UGen+analog_bubbles_mouse =+  let y = mouseY KR 0.1 10 Exponential 0.2 -- lfo 1 rate+      x = mouseX KR 2 40 Exponential 0.2  -- lfo 2 rate+      o2 = lfSaw KR x 0 * (-3) + 80 -- depth & offset in semitones+      o1 = lfSaw KR y 0 * 24 + o2 -- depth in semitones, offset is lfo_2+      f = midiCPS o1 -- convert to frequency+      s = sinOsc AR f 0 * 0.04+  in combN s 0.2 0.2 4 -- echoing sine wave++main :: IO ()+main = audition (out 0 analog_bubbles_mouse)
+ gr/analog-bubbles-mouse.scd view
@@ -0,0 +1,9 @@+// analog bubbles with mouse control (jmcc) #3++{var y = MouseY.kr(0.1,10,'exponential') /* lfo 1 rate */+;var x = MouseX.kr(2,40,'exponential')  /* lfo 2 rate */+;var lfo_2 = LFSaw.kr(x,0,-3,80) /* depth & offset in semitones */+;var lfo_1 = LFSaw.kr(y,0,24,lfo_2) /* depth in semitones, offset is lfo_2 */+;var freq = lfo_1.midicps /* convert to frequency */+;CombN.ar(SinOsc.ar(freq, 0, 0.04), 0.2, 0.2, 2) /* echoing sine wave */+}.play
gr/analog-bubbles.hs view
@@ -1,7 +1,11 @@--- analog bubbles (jmcc)+-- analog bubbles (jmcc) #1  import Sound.SC3 {- hsc3 -} +-- > putStrLn$synthstat analog_bubbles+-- > let g = synthdef_to_graphdef (synthdef "analog-bubbles" (out 0 analog_bubbles))+-- > import qualified Sound.SC3.Server.Graphdef as G+-- > putStrLn$G.graphdef_stat g analog_bubbles :: UGen analog_bubbles =   let o = lfSaw KR (mce2 8 7.23) 0 * 3 + 80
gr/analog-bubbles.scd view
@@ -1,4 +1,6 @@-{var o = LFSaw.kr([87.23]0380)-;var f = LFSaw.kr(0.4024o)-;var s = SinOsc.ar(f.midicps00.04)-;Out.ar(0CombN.ar(s0.20.240.1))}.play+// analog bubbles (jmcc) #1++{var o = LFSaw.kr([8,7.23],0) * 3 + 80+;var f = LFSaw.kr(0.4,0) * 24 + o // glissando function+;var s = SinOsc.ar(f.midicps,0) * 0.04+;CombN.ar(s,0.2,0.2,4) * 0.1}.play // echoing sine wave
+ gr/analogue-daze.hs view
@@ -0,0 +1,24 @@+-- analogue daze (jmcc) #3++import Sound.SC3 {- hsc3 -}++analogue_daze :: UGen+analogue_daze =+    let pattern = [55,63,60,63,57,65,62,65]+        sequ k s tr = demand tr 0 (dseq k dinf (mce s))+        f k octave clockRate pwmrate fltrate =+            let trg = impulse KR clockRate 0+                pattern' = map (midiCPS .  (+ (12 * octave))) pattern+                sq = sequ 'α' pattern' trg+                pwm = sinOsc KR pwmrate (rand ('β' `joinID` k) 0 (2 * pi)) * 0.4 + 0.5+                cf = sinOsc KR fltrate (rand ('γ' `joinID` k) 0 (2 * pi)) * 1400 + 2000+            in rlpf (lfPulse AR (lag sq 0.05) 0 pwm * 0.1) cf (1/15)+        a = lfNoise0 'δ' AR (lfNoise1 'ε' KR 0.3 * 6000 + 8000) * (mce2 0.07 0.08)+        x = decay (impulse AR 2 0) 0.15 * a+        g = mce [f 'ζ' 1 8 0.31 0.2,f 'η' 0 2 0.13 0.11] + x+        z = 0.4 * (combN g 0.375 0.375 5 + mceReverse g)+        e = envLinen 2 56 2 1+    in z * envGen KR 1 1 0 1 RemoveSynth e++main :: IO ()+main = audition (out 0 analogue_daze)
+ gr/analogue-daze.scd view
@@ -0,0 +1,21 @@+// analogue daze (jmcc) #3++{+var pattern = #[55,63,60,63,57,65,62,65];+var f = {+    arg octave, clockRate, pwmrate, fltrate;+    var sequ = {arg s, tr; Demand.kr(tr, 0, Dseq(s, inf))};+    var tr = Impulse.kr(clockRate);+    var pattern_ = (pattern + (12 * octave)).midicps;+    var sq = sequ.(pattern_, tr);+    var pwm = SinOsc.kr(pwmrate, 2pi.rand, 0.4, 0.5);+    var cf = SinOsc.kr(fltrate, 2pi.rand, 1400, 2000);+    RLPF.ar(LFPulse.ar(Lag.kr(sq,0.05), 0, pwm, 0.1), cf, 1/15);+};+var a = LFNoise0.ar(LFNoise1.kr(0.3,6000,8000),[0.07,0.07]);+var x = Decay.ar(Impulse.ar(2), 0.15, a);+var g = [f.(1,8,0.31,0.2), f.(0,2,0.13,0.11)] + x;+var z = 0.4 * (CombN.ar(g, 0.375, 0.375, 5) + g.reverse);+var e = Env.linen(2, 56, 2);+z * EnvGen.kr(e,doneAction:2);+}.play;
gr/arpeggio.hs view
@@ -4,21 +4,24 @@ import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Pattern {- hsc3-lang -} +outk :: UGen -> UGen+outk = out (control KR "out" 0)++pan2k :: UGen -> UGen+pan2k s = pan2 s (control KR "pan" 0) (control KR "amp" 0.1)+ analogarpeggio :: Synthdef analogarpeggio =     let k = control KR-        o = k "out" 0-        p = k "pan" 0         g = k "gate" 1         f = k "freq" 440-        a = k "amp" 0.1         c = k "cutoffmult" 3         r = k "res" 0.1         e = let d = envADSR 0.01 0.3 0.5 1 1 (EnvNum (-4)) 0             in envGen AR g 1 0 1 RemoveSynth d         i = mix (saw AR (f * mce [0.497,0.999,1.0,2.03]))         s = bLowPass i (c * f) r * 0.25-    in synthdef "analogarpeggio" (out o (pan2 (e * s * a) p 0.25))+    in synthdef "analogarpeggio" (outk (pan2k (e * s)))  {- audition (pbind [(K_instr,psynth analogarpeggio)@@ -83,4 +86,4 @@ main = do   let n = 60/157       p = pedit K_dur (* n) (pbind arpeggio)-  withSC3 (play p)+  paudition p
gr/babbling-brook-m.hs view
@@ -1,12 +1,12 @@--- babbling brook (jmcc)+-- babbling brook (jmcc) #SC3 -- http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  babbling_brook :: UId m => m UGen babbling_brook = do-  let b f m a g = do n1 <- brownNoise AR-                     n2 <- brownNoise AR+  let b f m a g = do n1 <- brownNoiseM AR+                     n2 <- brownNoiseM AR                      let n3 = lpf n2 f * m + a                          n4 = onePole n1 0.99                      return (rhpf n4 n3 0.03 * g)
+ gr/babbling-brook.hs view
@@ -0,0 +1,16 @@+-- babbling brook (jmcc) #SC3+-- http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html++import Sound.SC3 {- hsc3 -}++babbling_brook :: UGen+babbling_brook =+  let b f m a g = let n3 = lpf (brownNoise 'α' AR) f * m + a+                      n4 = onePole (brownNoise 'β' AR) 0.99+                  in rhpf n4 n3 0.03 * g+      x = uclone 'γ' 2 (b 14 400 500 0.006)+      y = uclone 'δ' 2 (b 20 800 1000 0.010)+  in x + y++main :: IO ()+main = audition (out 0 babbling_brook)
gr/babbling-brook.scd view
@@ -1,7 +1,9 @@-{ var b = { arg f, m, a, g-          ; { var n1 = OnePole.ar(BrownNoise.ar, 0.99)-            ; var n2 = LPF.ar(BrownNoise.ar, f)-            ; RHPF.ar(n1, n2 * m + a, 0.03, g) } }-; var x = b.value(14, 400, 500, 0.006) ! 2-; var y = b.value(20, 800, 1000, 0.010) ! 2-; Out.ar(0, x + y) }.play+// babbling brook (jmcc) #SC3++{var b = {arg f, m, a, g+         ;{var n1 = OnePole.ar(BrownNoise.ar, 0.99)+          ;var n2 = LPF.ar(BrownNoise.ar, f)+          ;RHPF.ar(n1, n2 * m + a, 0.03, g)}}+;var x = b.(14, 400, 500, 0.06) ! 2+;var y = b.(20, 800, 1000, 0.10) ! 2+;x + y}.play
+ gr/berlin-1977.hs view
@@ -0,0 +1,31 @@+-- berlin 1977 (jmcc) #4++import Sound.SC3 {- hsc3 -}++-- Somewhat akin to SC2 Sequencer.+sequ :: ID a => a -> [UGen] -> UGen -> UGen+sequ e s tr = demand tr 0 (dseq e dinf (mce s))++-- Somewhat akin to SC2 Sequencer with random selection function as input.+sequR :: ID a => a -> [UGen] -> UGen -> UGen+sequR e s tr = demand tr 0 (dshuf e dinf (mce s))++berlin_1977 :: UGen+berlin_1977 =+    let clock_rate = mouseX KR 5 20 Exponential 0.2 -- mouse x controls clock rate+        clock_time = 1 / clock_rate+        clock = impulse KR clock_rate 0 -- sequencer trigger+        patternList = [55,60,63,62,60,67,63,58];+        note = sequ 'α' patternList clock -- midi note pattern sequencer+        clock_16 = pulseDivider clock 16 0 -- divide clock by 16+        note' = sequR 'β' [-12,-7,-5,0,2,5] clock_16 + note -- transpose somewhat randomly+        freq = midiCPS note' -- convert midi note to cycles per second+        env = decay2 clock (0.05 * clock_time) (2 * clock_time)+        amp = env * 0.1 + 0.02 -- amplitude envelope+        filt = env * (fSinOsc KR 0.17 0 * 800)+ 1400 -- filter frequency+        pw = sinOsc KR 0.08 (mce2 0 (0.5 * pi)) * 0.45 + 0.5 -- pulse width LFO(s)+        s = pulse AR freq pw * amp+    in combN (rlpf s filt 0.15) 0.2 (mce2 0.2 0.17) 1.5++main :: IO ()+main = audition (out 0 berlin_1977)
+ gr/berlin-1977.scd view
@@ -0,0 +1,18 @@+// berlin 1977 (jmcc) #4++{var sequ = {arg s,tr; Demand.kr(tr,0,Dseq(s,inf))}+;var sequR = {arg s,tr; Demand.kr(tr,0,Dshuf(s,inf))}+;var clock_rate = MouseX.kr(5,20,'exponential',0.2) // mouse x controls clock rate+;var clock_time = 1 / clock_rate+;var clock = Impulse.kr(clock_rate,0) // sequencer trigger+;var patternList = [55,60,63,62,60,67,63,58]+;var note = sequ.(patternList,clock) // midi note pattern sequencer+;var clock_16 = PulseDivider.kr(clock,16,0) // divide clock by 16+;var note_ = sequR.([-12,-7,-5,0,2,5],clock_16) + note // transpose somewhat randomly+;var freq = note_.midicps // convert midi note to cycles per second+;var env = Decay2.kr(clock,0.05 * clock_time,2 * clock_time)+;var amp = env * 0.1 + 0.02 // amplitude envelope+;var filt = env * (FSinOsc.kr(0.17,0) * 800) + 1400 // filter frequency+;var pw = SinOsc.kr(0.08,[0,0.5 * pi]) * 0.45 + 0.5 // pulse width LFO(s)+;var s = Pulse.ar(freq,pw) * amp+;CombN.ar(RLPF.ar(s,filt,0.15),0.2,[0.2,0.17],1.5)}.play;
+ gr/birdies.hs view
@@ -0,0 +1,20 @@+-- birdies (jmcc) #6++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: ID a => a -> UGen -> UGen+rand2 e n = rand e (- n) n++birdies :: UGen+birdies =+    let p1 = lfPulse KR (0.4 + rand 'α' 0 1) 0 (rand 'β' 0 0.8 + 0.1) * (rand 'γ' 0 3 + 4) + 2+        p2 = lfPulse KR (0.4 + rand 'δ' 0 1) 0 (rand 'ε' 0 0.8 + 0.1) * (rand 'ζ' 0 3 + 4)+        p3 = lfPulse KR (0.2 + rand 'η' 0 0.5) 0 0.4 * 0.02+        sw = lfSaw KR (p1 + p2) 0 * (- (1000 + rand 'θ' 0 800)) + (4000 + rand2 'ι' 1200)+        freq = lag sw 0.05+        amp = lag p3 0.3+    in pan2 (sinOsc AR freq 0 * amp) (rand2 'κ' 1) 1++main :: IO ()+main = overlapTextureU (7,4,4,maxBound) birdies
+ gr/birdies.scd view
@@ -0,0 +1,13 @@+// birdies (jmcc) #6++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    var p1 = LFPulse.kr(0.4 + 1.0.rand, 0, 0.8.rand + 0.1, 3.0.rand + 4, 2);+    var p2 = LFPulse.kr(0.4 + 1.0.rand, 0, 0.8.rand + 0.1, 3.0.rand + 4);+    var p3 = LFPulse.kr(0.2 + 0.5.rand, 0, 0.4, 0.02);+    var sw = LFSaw.kr(p1 + p2, 0, (1000 + 800.rand).neg, 4000 + 1200.rand2);+    var freq = Lag.kr(sw, 0.05);+    var amp = Lag.kr(p3, 0.3);+    Pan2.ar(SinOsc.ar(freq,0,amp), 1.0.rand2);+},7,4,4);
+ gr/birds-am-fm.hs view
@@ -0,0 +1,151 @@+-- birds-am-fm (af)+-- http://www.obiwannabe.co.uk/tutorials/html/tutorial_birds.html+-- perhaps some mis-translations...++-- import Debug.Trace {- base -}+import System.Random {- random -}++import Sound.SC3 hiding (sweep) {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}+import qualified Sound.SC3.Lang.Random.Gen as R++-- > audition (out 0 (pd_noise 'a' * 0.1))+pd_noise :: ID a => a -> UGen+pd_noise e = whiteNoise e AR++-- > audition (out 0 (pd_lop (pd_noise 'a') 500 * 0.1))+pd_lop :: UGen -> UGen -> UGen+pd_lop = lpf -- actually lop is one-pole, lpf is two pole...++-- > audition (out 0 (pd_osc 440 * 0.1))+pd_osc :: UGen -> UGen+pd_osc f = sinOsc AR f pi++-- > audition (out 0 (pd_phasor 440 * 0.1))+pd_phasor :: UGen -> UGen+pd_phasor f = linLin_b (lfSaw AR f 0) 0 1++-- | Ramp doesn't make sense with a constant input signal.+--+-- > audition (out 0 (pd_osc (pd_line (lfNoise0 'a' AR 0.5) 300 * 500 + 300) * 0.1))+pd_line :: UGen -> UGen -> UGen+pd_line x msec = if isConstant x then x else ramp x (msec / 1000)++-- > audition (out 0 (pd_clip (pd_osc 220) (-0.05) 0.05))+pd_clip :: UGen -> UGen -> UGen -> UGen+pd_clip = clip++-- > audition (out 0 (pd_cos (pd_phasor 440) * 0.1))+pd_cos :: Floating a => a -> a+pd_cos i = cos (i * 2 * pi)++-- > audition (out 0 (pd_vcf (pd_noise 'a') (pd_phasor 0.1 * 500 + 200) 6 * 0.1))+pd_vcf :: UGen -> UGen -> UGen -> UGen+pd_vcf i cf q = bpf i cf (1 / q)++data B n = B {artic :: n+             ,tweet :: n+             ,syr1a :: n+             ,syr1m :: n+             ,syr2a :: n+             ,syr2m :: n+             ,basef :: n+             ,sweep :: n+             ,moda :: n+             ,modb :: n+             ,tf1 :: n+             ,tb1 :: n+             ,tf2 :: n+             ,tb2 :: n+             ,reson :: n+             ,vol :: n}+         deriving (Show)++square :: Num a => a -> a+square n = n * n++-- > let (_,o) = autotweet (presets !! 0)+-- > Sound.SC3.UGen.Dot.draw o+-- > audition (out 0 (sinOsc AR (sqrt o * 1000) 0 * 0.1))+autotweet :: B UGen -> (UGen,UGen)+autotweet b_data =+    let artic' = pd_line (artic b_data) 300+        tweet' = tweet b_data * 3+        ph = let x = abs (pd_lop (pd_noise 'a') 0.01) * (tweet' * 1000)+                 y = pd_osc x * (x * tweet')+             in pd_lop (pd_phasor y) 2+    in (ph,square (pd_cos (pd_clip (artic' - ph) (-0.25) 0.25)))++type TW = (UGen, UGen, UGen, UGen, UGen, UGen, UGen)++-- > Sound.SC3.UGen.Dot.draw (tweetypie (1,2,3,4,5,6,7))+tweetypie :: TW -> UGen+tweetypie (a,b,c,d,e,f,g) =+    let m = pd_osc (pd_osc a * pd_osc b * c + d)+    in pd_lop ((pd_vcf m e g + pd_vcf m f g) * 0.5) 5000++modmatrix :: UGen -> B UGen -> TW+modmatrix modall b_data =+    let get var mul tm = pd_line (var b_data * mul) tm+        syr1a' = get syr1a 3000 300+        syr1m' = get syr1m 200 500+        syr2a' = get syr2a 3000 300+        syr2m' = get syr2m 200 500+        basef' = get basef 5000 300+        sweep' = get sweep 3000 300+        moda' = get moda 2000 300+        modb' = get modb 50 300+        tf1' = get tf1 3000 300+        tb1' = get tb1 3000 300+        tf2' = get tf2 3000 300+        tb2' = get tb2 3000 300+        reson' = reson b_data * 20 + 2+        a = (syr1a' * modall) + syr2a'+        b = let p = syr1a' + syr1m'+                q = p * modall+                r = syr2a' + syr2m'+            in q + r+        c = modall * moda' * modb'+        d = (modall * sweep') + basef'+        e = (modall * tf1') + tb1'+        f = (modall * tf2') + tb2'+    in (a,b,c,d,e,f,reson')++-- > Sound.SC3.UGen.Dot.draw (birdbox (presets !! 0))+birdbox :: B UGen -> UGen+birdbox b_data =+    let (modall,a) = autotweet b_data+        tw = tweetypie (modmatrix modall b_data)+        a' = sqrt a * 1000+    in pd_vcf tw a' 0.1 * vol b_data++presets :: Fractional n => [B n]+presets =+    [B 0.683544 0.658228 0.177215 0.0886076 0.911392 0.0126582 0.291139 0.772152 0.0886076 0.632911 0.316456 0.860759 0.227848 0.620253 0.417722 0.199808+    ,B 0.683544 0.582278 0.405063 0.78481 0.911392 0.0126582 0.848101 0.0506329 0.0886076 0.632911 0.316456 0.240506 0.113924 0.620253 0.417722 0.199808+    ,B 0.924051 0.936709 0.886076 0.78481 0 0.291139 0.126582 0.721519 0.0253165 0.189873 0.0759494 0.810127 0.329114 0.139241 0.0759494 0.243502+    ,B 0.455696 0.620253 0 0.0506329 0.0126582 0.0126582 0.56962 1 0.0506329 0.620253 0.949367 0.810127 0.848101 0.683544 0.0886076 0.127144+    ,B 0.21519 0.518987 0.379747 1 0.0126582 0.0126582 0.405063 1 0.0506329 0.620253 0.949367 0.164557 0.848101 0.164557 0.746835 0.372008+    ,B 0.886076 0.518987 0 0.0632911 0.0126582 0.0126582 0.278481 0.417722 0.0506329 0.278481 0.443038 0.164557 0.544304 0.164557 0.746835 0.372008+    ,B 0.962025 0.898734 0 0.278481 0.164557 0.822785 0.0759494 0.417722 0.556962 0.113924 0.291139 0.126582 0.544304 0.151899 0.911392 0.372008+    ,B 0.164557 0.974684 0.734177 0.670886 0.240506 0.202532 0.227848 0.392405 0.0253165 0.392405 0.291139 0.126582 0.544304 0.734177 0.379747 0.868261+    ,B 0.708861 0.721519 0.253165 0.0759494 0.658228 0.177215 0.746835 0.202532 0.329114 0.202532 0.417722 0.177215 0.392405 0.405063 1 0.314002+    ,B 0.392405 0.721519 0.0759494 0.316456 0.658228 0.177215 0.177215 0.848101 0.0886076 0.202532 0.417722 0.177215 0.392405 0.405063 1 0.314002+    ,B 0.379747 0.962025 0.265823 0.0126582 0.0886076 0.177215 0.721519 0.139241 0.113924 0.139241 0.0759494 0.759494 0.936709 0.911392 0.848101 0.314002+    ,B 0.291139 0.556962 0.0632911 0.0253165 0.0506329 0.0379747 0.0759494 0 0.177215 0.227848 0.0759494 0.240506 0.0379747 0.506329 0.924051 0.314002+    ,B 0.848101 0.772152 0.367089 0.189873 0.35443 0.0506329 0.0126582 0.177215 0.101266 0.0253165 0.924051 0.0886076 1 0.0886076 0.455696 0.732876]++-- B 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0++-- > hearb (presets !! 4)+hearb :: B UGen -> IO ()+hearb = audition . out 0 . birdbox++main :: IO ()+main = do+  let f g = let (p,g') = R.choose presets g in (birdbox p,g')+  overlapTextureS (20,4,5,maxBound) f =<< getStdGen++-- Local Variables:+-- truncate-lines:t+-- End:
gr/birds-hp.hs view
@@ -2,21 +2,22 @@ -- http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  node :: UId m => m UGen node = do-  let f = lag (lfSaw AR (7 + #(rand (-1.5) 1.5)) #(rand 0 1) * #(rand 11 15)) 0.1 + #(rand 94 102)-  let a = lfPulse KR (1 / #(rand 12 15.6)) #(rand 0 1) 0.16 * 0.05-  let b = sinOsc AR (midiCPS f) #(rand 0 1) * a-  return (rotate2 b (silent 1) #(rand (-1) 1))+  let f = lag (lfSaw AR (7 + #(randM (-1.5) 1.5)) #(randM 0 1) * #(randM 11 15)) 0.1 + #(randM 94 102)+  let a = lfPulse KR (1 / #(randM 12 15.6)) #(randM 0 1) 0.16 * 0.05+  let b = sinOsc AR (midiCPS f) #(randM 0 1) * a+  return (rotate2 b (silent 1) #(randM (-1) 1))  birds :: UId m => m UGen birds = do   d <- return . sum =<< sequence (replicate 6 node)-  let apf i = do return (allpassL i 0.07 #(rand 0 0.06) #(rand 0.7 2.0))-  w <- chainM 12 apf d+  let f i = do return (allpassL i 0.07 #(randM 0 0.06) #(randM 0.7 2.0))+  w <- chainM 12 f d   return (d * 0.7 + w * 0.3) +-- > birds >>= putStrLn . synthstat main :: IO () main = audition . out 0 =<< birds
gr/birds-m.hs view
@@ -1,28 +1,29 @@ -- birds (jmcc) -- http://lists.create.ucsb.edu/pipermail/sc-users/2007-April/033239.html -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  birds :: UId m => m UGen birds = do-  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 node = do r1 <- randM 94.0 102.0+                r2 <- randM (-1.5) 1.5+                r3 <- randM 0.0 1.0+                r4 <- randM 11.0 15.0+                r5 <- randM 0.0 1.0+                r6 <- randM 12.0 15.6+                r7 <- randM 0.0 1.0+                r8 <- randM (-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                 return (rotate2 b (silent 1) r8)-      apf i = do r1 <- rand 0.0 0.06-                 r2 <- rand 0.7 2.0+      apf i = do r1 <- randM 0.0 0.06+                 r2 <- randM 0.7 2.0                  return (allpassL i 0.07 r1 r2)   d <- return . sum =<< sequence (replicate 6 node)   w <- chainM 12 apf d   return (d * 0.7 + w * 0.3) +-- > birds >>= putStrLn . synthstat main :: IO () main = audition . out 0 =<< birds
+ gr/birds.hs view
@@ -0,0 +1,21 @@+-- birds (jmcc)++import Sound.SC3 {- hsc3 -}++node :: UGen+node =+  let f = lag (lfSaw AR (7 + rand 'α' (-1.5) 1.5) (rand 'β' 0 1) * rand 'γ' 11 15) 0.1 + rand 'δ' 94 102+      a = lfPulse KR (1 / rand 'ε' 12 15.6) (rand 'ζ' 0 1) 0.16 * 0.05+      b = sinOsc AR (midiCPS f) (rand 'η' 0 1) * a+  in rotate2 b (silent 1) (rand 'θ' (-1) 1)++-- > putStrLn$synthstat birds+birds :: UGen+birds =+  let d = mix (uclone 'α' 6 node)+      f i = allpassL i 0.07 (rand 'β' 0 0.06) (rand 'γ' 0.7 2.0)+      w = useq 'δ' 12 f d+  in d * 0.7 + w * 0.3++main :: IO ()+main = audition (out 0 birds)
gr/bit-reduction.hs view
@@ -1,6 +1,6 @@ -- bit reduction (adc) -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  sample_rate_decrease :: UGen sample_rate_decrease =
gr/bitwise.hs view
@@ -13,7 +13,7 @@               ((t *  5) .&. (t .>>. (mce2 3 4))) .|.               ((t *  2) .&. (t .>>. 9)) .|.               ((t *  8) .&. (t .>>. 11))) - 3) .%. 256-    in tanh (hpf (((s / 127) - 1) * 3) 20)+    in tanh (hpf (((s / 127) - 1) * 3) 20) * 0.02  main :: IO () main = audition (out 0 bitwise_operators)
gr/bitwise.scd view
@@ -5,4 +5,4 @@            ((t *  5) & (t >> [3,4])) |            ((t *  2) & (t >> 9)) |            ((t *  8) & (t >> 11))) - 3) % 256-;HPF.ar(((s / 127) - 1) * 3, 20).tanh}.play+;HPF.ar(((s / 127) - 1) * 3, 20).tanh * 0.02}.play
gr/black-atlantic-currents.hs view
@@ -1,10 +1,10 @@ -- http://www.listarc.bham.ac.uk/lists/sc-users/msg08240.html (jrhb)  import Data.Numbers.Primes {- primes -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect {- hsc3 -} import System.Random {- random -} import System.Random.Shuffle {- random-shuffle -}++import Sound.SC3 {- hsc3 -}  nth_prime :: Integral a => Int -> a nth_prime j = primes !! j
+ gr/blips-001-hp.hs view
@@ -0,0 +1,33 @@+-- blips 001 (jmcc) #SC3d1.5+{-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-}++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: UId m => UGen -> m UGen+rand2 n = randM (-n) n++blips_001 :: UId m => m UGen+blips_001 = do+  let c = #(randM 0 1) <* 0.8+  let b = do+        let f = xLine KR #(expRandM 0.25 400) #(expRandM 0.25 400) 4 DoNothing+        let nh = xLine KR #(expRandM 2 100) #(expRandM 2 100) 4 DoNothing+        return (blip AR f nh)+  return (c * pan2 (#(b) * #(b)) (line KR #(rand2 1) #(rand2 1) 4 DoNothing) 0.3)++{-+iter_m :: (Monad m, Num a, Ord a) => (b -> m b) -> a -> b -> m b+iter_m f n st = if n > 0 then iter_m f (n - 1) =<< f st else return st++postProcess :: UId m => UGen -> m UGen+postProcess z = do+  let z' = distort z+      f x = do+        return (allpassN x 0.05 (mce2 #(rand 0 0.05) #(rand 0 0.05)) 4)+  iter_m f 6 z'+-}++main :: IO ()+main = overlapTextureU (2,1,12,maxBound) =<< blips_001+
+ gr/blips-001-u.hs view
@@ -0,0 +1,33 @@+-- blips 001 (jmcc) #SC3d1.5++import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.UGen.Unsafe as U {- hsc3-unsafe -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: UGen -> UGen+rand2 n = U.rand (-n) n++-- ghci 7.6.3 doesn't see through this...+blip_001 :: t -> UGen+blip_001 _ =+    let f = xLine KR (U.expRand 0.25 400) (U.expRand 0.25 400) 4 DoNothing+        nh = xLine KR (U.expRand 2 100) (U.expRand 2 100) 4 DoNothing+    in blip AR f nh++blips_001 :: UGen+blips_001 =+    let c = U.rand 0 1 <* 0.8+        o = blip_001 'α' * blip_001 'β'+    in (c * pan2 o (line KR (rand2 1) (rand2 1) 4 DoNothing) 0.3)++iter :: (Num a, Ord a) => (t -> t) -> a -> t -> t+iter f n st = if n > 0 then iter f (n - 1) (f st) else st++postProcess :: UGen -> UGen+postProcess z =+    let z' = distort z+        f x = allpassN x 0.05 (mce2 (U.rand 0 0.05) (U.rand 0 0.05)) 4+    in iter f 6 z'++main :: IO ()+main = overlapTextureU_pp (2,1,12,maxBound) blips_001 2 postProcess
+ gr/blips-001.hs view
@@ -0,0 +1,30 @@+-- blips 001 (jmcc) #SC3d1.5++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++rand2 :: ID a => a -> UGen -> UGen+rand2 e n = rand e (-n) n++blip_001 :: ID a => a -> UGen+blip_001 e =+    let f = xLine KR (expRand 'α' 0.25 400) (expRand 'β' 0.25 400) 4 DoNothing+        nh = xLine KR (expRand 'γ' 2 100) (expRand 'δ' 2 100) 4 DoNothing+    in uprotect e (blip AR f nh)++blips_001 :: UGen+blips_001 =+    let c = rand 'ε' 0 1 <* 0.8+        o = blip_001 'ζ' * blip_001 'η'+    in (c * pan2 o (line KR (rand2 'θ' 1) (rand2 'ι' 1) 4 DoNothing) 0.3)++-- > let g = blips_pp blips_001+-- > audition (out 0 (blips_pp blips_001))+blips_pp :: UGen -> UGen+blips_pp z =+    let z' = distort z+        f x = allpassN x 0.05 (mce2 (rand 'κ' 0 0.05) (rand 'λ' 0 0.05)) 4+    in useq 'μ' 6 f z'++main :: IO ()+main = overlapTextureU_pp (2,1,12,maxBound) blips_001 2 blips_pp
+ gr/blips-001.scd view
@@ -0,0 +1,19 @@+// blips 001 (jmcc) #SC3d1.5++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    if(0.8.coin, {+        var b = {+            var f = XLine.kr(exprand(0.25, 400), exprand(0.25, 400), 4);+            var nh = XLine.kr(exprand(2, 100), exprand(2, 100), 4);+            Blip.ar(f, nh);+        };+        Pan2.ar(b.() * b.(),Line.kr(1.0.rand2, 1.0.rand2, 4), 0.3);+    },{Silent.ar});+}, 2, 1, 12, postProcess: {+	arg z;+    z = z.distort;+	6.do({z = AllpassN.ar(z, 0.05, [0.05.rand, 0.05.rand], 4)});+	z;+});
gr/bohlen-pierce-140.hs view
@@ -1,7 +1,7 @@ -- http://sccode.org/1-W (jj) -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  bp140u :: UGen bp140u =@@ -14,6 +14,4 @@ bp140 = synthdef "bp140" (out 0 bp140u)  main :: IO ()-main = do-  let p = pbind [(K_instr,psynth bp140),(K_dur,prand 'δ' [1/6,1/3] inf)]-  audition p+main = audition (P.sbind1 (bp140,[("dur",P.rand 'δ' [1/6,1/3])]))
gr/bottle-m.hs view
@@ -1,19 +1,19 @@ -- bottle (sc)  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  bottle :: UId m => m UGen bottle = do-  freq <- rand 220 880-  wn <- whiteNoise AR-  pn <- pinkNoise AR+  freq <- randM 220 880+  wn <- whiteNoiseM AR+  pn <- pinkNoiseM AR   let perc = envPerc 0.1 0.6       ex = envGen KR 1 1 0 1 DoNothing perc * wn * 0.02       flute = ringz ex freq 0.3       r = resonz pn (5 + (freq / 2)) 0.1       breath = envGen KR 1 1 0 1 DoNothing perc * r-      rapf i = do x <- linRand 0.001 0.1 (-1)+      rapf i = do x <- linRandM 0.001 0.1 (-1)                   return (i + allpassN i 0.1 x 1.0 * 0.5)       cls i = let en = let c = EnvNum (-4) in (c,c,c)                   l = envLinen' 0.01 3.0 1.0 1 en
+ gr/bouncing-objects.hs view
@@ -0,0 +1,23 @@+-- bouncing objects (jmcc) #2++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}+import qualified Sound.SC3.Lang.Random.ID as R {- hsc3-lang -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}++bouncing_objects :: UGen+bouncing_objects =+  let imp_frq = xLine KR (5 + rand 'α' (-2) 2) 600 4 DoNothing+      imp_amp = xLine KR 0.09 0.000009 4 DoNothing+      imp = impulse AR imp_frq 0 * imp_amp+      exc = decay imp 0.001+      flt_frq = randN 4 'β' 400 8400+      flt_amp = randN 4 'γ' 0 1+      flt_rtm = randN 4 'δ' 0.01 0.11+      flt = klank exc 1 0 1 (klankSpec_mce flt_frq flt_amp flt_rtm)+      loc = pan2 flt (rand 'ε' (-1) 1) 1+      e = Envelope [1,1,0] [3,0.001] (replicate 2 EnvLin) Nothing Nothing+  in loc * envGen KR 1 1 0 1 RemoveSynth e++main :: IO ()+main = spawnTextureU (\i -> R.rrand i 0.6 1.6,maxBound) bouncing_objects
+ gr/bouncing-objects.scd view
@@ -0,0 +1,24 @@+// bouncing objects (jmcc) #2++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~spawn.({+    // impulses trigger decay envelope+    var imp_frq = XLine.kr(5 + 2.0.rand2, 600, 4); // accelerating frequency+    var imp_amp = XLine.kr(0.09, 0.000009, 4); // decaying impulse amplitude+    var imp = Impulse.ar(imp_frq,0,imp_amp);+    // decays excite filter bank+    var exc = Decay.ar(imp,0.001);+    // resonant filter bank simulates resonant modes of bouncing objects+    var flt_frq = Array.fill(4, { 400 + 8000.0.rand }); // resonant freqs+    var flt_amp = Array.fill(4, { 1.0.rand });+    var flt_rtm = Array.fill(4, { 0.01 + 0.1.rand });+    var flt = Klank.ar(`[flt_frq,flt_amp,flt_rtm],exc);+    // place each bouncer at a random position in the stereo field+    var loc = Pan2.ar(flt,1.0.rand2);+    // 3 second cut off envelope to end sound+    var e = Env([1, 1, 0],[3, 0.001]);+    loc * EnvGen.kr(e,doneAction:2);+}, nextTime: { 0.6 + 0.6.rand });++// lightbulbs, pencils, cans, and other assorted objects
gr/bowed-string-m.hs view
@@ -1,19 +1,21 @@ -- bowed string (jmcc) +import Sound.SC3 {- hsc3 -}+import Sound.SC3.Common.Monad.Syntax {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -} +-- > u <- bowed_string bowed_string :: UId m => m UGen bowed_string = do   let root = 5       scale = map (+ root) [0,2,4,5,7,9,11]       oct = [24,36,48,60,72,84]-  n0 <- clone 2 (brownNoise AR)-  r0 <- expRand 0.125 0.5-  r1 <- rand 0.7 0.9-  r2 <- sequence (replicate 12 (rand 1.0 3.0))-  f <- midiCPS `fmap` (lchoose scale .+. lchoose oct)-  n1 <- lfNoise1 KR r0+  n0 <- clone 2 (brownNoiseM AR)+  r0 <- expRandM 0.125 0.5+  r1 <- randM 0.7 0.9+  r2 <- sequence (replicate 12 (randM 1.0 3.0))+  f <- midiCPS `fmap` (lchooseM scale .+. lchooseM oct)+  n1 <- lfNoise1M KR r0   let x = n0 * 0.007 * max 0 (n1 * 0.6 + 0.4)       geom n i z = take n (iterate (* z) i)       iota n i z = take n (iterate (+ z) i)
gr/bowed-string.scd view
@@ -1,13 +1,15 @@+// bowed string (jmcc)+ { var root = 5 ; var scale = #[0,2,4,5,7,9,11] + root ; var oct = #[24,36,48,60,72,84] ; var f = (scale.choose + oct.choose).midicps-; var n0 = BrownNoise.ar().dup-; var r0 = ExpRand.new(0.125,0.5)+; var n0 = BrownNoise.ar.dup+; var r0 = ExpRand(0.125,0.5) ; var n1 = LFNoise1.kr(r0)-; var r1 = Rand.new(0.7,0.9)-; var r2 = Array.fill(12,{ Rand.new(1.0,3.0) })+; var r1 = Rand(0.7,0.9)+; var r2 = Array.fill(12,{ Rand(1.0,3.0) }) ; var x = n0 * 0.007 * max(0,n1 * 0.6 + 0.4) ; var d = `[Array.series(12,f,f),Array.geom(12,1,r1),r2] ; var k = Klank.ar(d,x)-; Out.ar(0,(k * 0.1).softclip) }.play+; (k * 0.1).softclip }.play
gr/bs-070705-m.hs view
@@ -1,7 +1,7 @@ -- bs-070705 (rd)  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Random.IO {- hsc3-lang -}  -- | One step in a bubble sort with specified /greater than/ function.@@ -31,10 +31,10 @@ play_data :: (UId m,Transport m) => UGen -> m () play_data r = do   let inf_sc = 9e8-  phase <- dseries inf_sc 0 1-  f' <- dbufrd 10 phase Loop-  a' <- dbufrd 11 phase Loop-  p' <- dbufrd 12 phase Loop+  phase <- dseriesM inf_sc 0 1+  f' <- dbufrdM 10 phase Loop+  a' <- dbufrdM 11 phase Loop+  p' <- dbufrdM 12 phase Loop   let tr = impulse AR r 0       f'' = demand tr 0 f'       a'' = demand tr 0 a'
gr/buffer-display.hs view
@@ -2,7 +2,7 @@  import Control.Concurrent {- base -} import qualified Graphics.Rendering.Cairo as C {- cairo -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Cairo.Scope.Shell {- hsc3-cairo -}  -- * Type@@ -118,7 +118,7 @@  {- -import Sound.SC3.ID+import Sound.SC3  let s = saw AR (mouseX KR 20 800 Exponential 0.2) in audition (out 0 s)
gr/ccomb-m.hs view
@@ -1,20 +1,19 @@ -- ccomb (rd) -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  ccomb :: (Functor m,UId m) => m UGen ccomb = do-  let rng l r i = linLin i (-1) 1 l r-      lwr = 48+  let lwr = 48       flwr = midiCPS lwr-      spart t = do n <- fmap (rng lwr 72.0) (lfNoise2 KR 0.1)-                   e <- fmap (decay2 t 0.01) (tRand 0.05 0.75 t)-                   x <- fmap (* e) (whiteNoise AR)-                   m <- lfNoise2 KR 0.1+      spart t = do n <- fmap (range lwr 72.0) (lfNoise2M KR 0.1)+                   e <- fmap (decay2 t 0.01) (tRandM 0.05 0.75 t)+                   x <- fmap (* e) (whiteNoiseM AR)+                   m <- lfNoise2M KR 0.1                    let f = lag (midiCPS n) 0.25-                       m' = rng 1 8 m+                       m' = range 1 8 m                    return (combC x (recip flwr) (recip f) m')-  t <- dust KR (mce2 0.75 0.35)+  t <- dustM KR (mce2 0.75 0.35)   return . (* 0.1) . sum =<< sequence (replicate 12 (spart t))  main :: IO ()
gr/ccomb.scd view
@@ -3,9 +3,9 @@ ;var spart = {arg t               ;{var n = LFNoise2.kr(0.1).range(lwr,72.0)                ;var e = Decay2.kr(t,0.01,TRand.kr(0.05,0.75,t))-               ;var x = WhiteNoise.ar() * e+               ;var x = WhiteNoise.ar * e                ;var m = LFNoise2.kr(0.1)                ;var f = Lag.kr(n.midicps,0.25)                ;CombC.ar(x,flwr.reciprocal,f.reciprocal,m.range(1,8))}} ;var t = Dust.kr([0.75,0.35])-;Out.ar(0,Mix.fill(12,spart.value(t)) * 0.1)}.play+;Mix.fill(12,spart.(t)) * 0.1}.play
gr/cds-070701-m.hs view
@@ -7,7 +7,7 @@ -- gives the time interval to step forward.  import Sound.OSC {- hosc -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  -- | Real type R = Double@@ -67,11 +67,11 @@ play_data :: IO () play_data = do   let inf_sc = 9e8-  phase <- dseries inf_sc 0 1-  t' <- dbufrd 10 phase Loop-  f' <- dbufrd 11 phase Loop-  a' <- dbufrd 12 phase Loop-  p' <- dbufrd 13 phase Loop+  phase <- dseriesM inf_sc 0 1+  t' <- dbufrdM 10 phase Loop+  f' <- dbufrdM 11 phase Loop+  a' <- dbufrdM 12 phase Loop+  p' <- dbufrdM 13 phase Loop   let tr = tDuty AR t' 0 DoNothing 1 0       f'' = demand tr 0 f'       a'' = demand tr 0 a'
gr/chain-saw-m.hs view
@@ -4,7 +4,7 @@ -- increasing the stack limit of the haskell run time system  import qualified Sound.SC3.Lang.Random.IO as R {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  coinIf :: Double -> a -> a -> IO a coinIf n a b = do@@ -25,10 +25,10 @@  chain_saw :: IO UGen chain_saw = do-  let f s1 = do xr <- fmap dup (expRand 0.1 2)-                n1 <- lfNoise1 KR xr-                n2 <- lfNoise1 KR xr-                n3 <- lfNoise1 KR xr+  let f s1 = do xr <- fmap dup (expRandM 0.1 2)+                n1 <- lfNoise1M KR xr+                n2 <- lfNoise1M KR xr+                n3 <- lfNoise1M KR xr                 f1 <- coinIf 0.6 (exprange n1 0.01 10) (exprange n2 10 50)                 s2 <- coinIf 0.5 (1 - s1) (mceReverse s1)                 let f2 = linExp s1 (-1) 1 f1 (f1 * exprange n3 2 10)
gr/chain-saw.scd view
@@ -1,9 +1,9 @@ { var f = { arg s1-          ; var rate = ExpRand.new(0.1, 2).dup+          ; var rate = ExpRand(0.1, 2).dup           ; var n1 = { LFNoise1.kr(rate).exprange(0.01, 10) }           ; var n2 = { LFNoise1.kr(rate).exprange(10, 50) }           ; var n3 = LFNoise1.kr(rate).exprange(2, 10)-          ; var f1 = if(0.6.coin) { n1.value } { n2.value }+          ; var f1 = if(0.6.coin) { n1.() } { n2.() }           ; var s2 = [1 - s1, s1.reverse].choose           ; var f2 = LinExp.kr(s1, -1, 1, f1, f1 * n3)           ; var u1 = LFSaw.kr(f2, 0)@@ -15,7 +15,7 @@           ; func } ; var inp = LFSaw.kr(0.2 * [1, 1.1], 0) ; var b_freq = [70, 800, 9000, 5242]-; var ff = g.(f, 4).value(inp)+; var ff = g.(f, 4).(inp) ; var c_saw = Saw.ar(ff.exprange(6, 11000)).product ; var b_saw = BPF.ar(c_saw, b_freq, 0.2).sum.dup-; Out.ar(0, b_saw * 0.3) }.play+; b_saw * 0.3 }.play
gr/choip.hs view
@@ -1,8 +1,7 @@--- choip (jmcc)+-- choip (jmcc) #10 -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  xl :: ID a => a -> a -> UGen -> UGen -> UGen -> UGen@@ -16,7 +15,7 @@     let t = 12         i = impulse AR (xl 'α' 'β' 1 30 t) 0         f = xl 'γ' 'δ' 600 8000 t-        a = sinOsc AR (decay2 i 0.05 0.5 * (-0.9 * f) + f) 0+        a = sinOsc AR (decay2 i 0.05 0.5 * (-0.9) * f + f) 0         l = line KR (r2 'ε' 1) (r2 'ζ' 1) t DoNothing     in pan2 (decay2 (i * xl 'η' 'θ' 0.01 0.5 t) 0.01 0.2 * a) l 1 @@ -26,4 +25,4 @@     in useq 'κ' 4 f  main :: IO ()-main = overlapTextureU_pp (1,10,8,maxBound) choip 2 choip_pp+main = overlapTextureU_pp (10,1,8,maxBound) choip 2 choip_pp
gr/choip.scd view
@@ -1,9 +1,17 @@-var t = 12;-var z = OverlapTexture.ar({-  var i = Impulse.ar(XLine.kr(exprand(1,30),exprand(1,30),t));-  var f = XLine.kr(exprand(600.0,8000.0),exprand(600.0,8000.0),t);-  var a = SinOsc.ar(Decay2.ar(impulses,0.05,0.5,-0.9*f,f));-  var l = Line.kr(1.0.rand2,1.0.rand2,t);-  var j = XLine.kr(exprand(0.01,0.5),exprand(0.01,0.5),t);-  Pan2.ar(Decay2.ar(i * j,0.01,0.2,a),l)},t-2,1,8,2);-4.do({z = AllpassN.ar(z,0.1,[0.05.rand,0.05.rand],4)});+// choip (jmcc) #10++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    var t = 12;+    var i = Impulse.ar(XLine.kr(exprand(1,30),exprand(1,30),t));+    var f = XLine.kr(exprand(600.0,8000.0),exprand(600.0,8000.0),t);+    var a = SinOsc.ar(Decay2.ar(i,0.05,0.5,-0.9*f,f));+    var l = Line.kr(1.0.rand2,1.0.rand2,t);+    var j = XLine.kr(exprand(0.01,0.5),exprand(0.01,0.5),t);+    Pan2.ar(Decay2.ar(i * j,0.01,0.2,a),l);+},sustainTime:10,transitionTime:1,overlap:8,postProcess:{+    arg z;+    4.do({ z = AllpassN.ar(z, 0.1, [0.05.rand,0.05.rand], 4)});+    z;+});
gr/chrd-m.hs view
@@ -1,13 +1,13 @@ -- chrd (rd) -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  chrd :: UId m => m UGen 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+  r0 <- randM 0.05 0.5+  [r1, r2] <- sequence (replicate 2 (randM (-1) 1))+  r3 <- randM 0.15 0.35+  r4 <- randM 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])
gr/chrd.scd view
@@ -1,8 +1,8 @@-{ var chrd = { var r0 = Rand.new(0.05, 0.5)-             ; var r1 = Rand.new(-1, 1)-             ; var r2 = Rand.new(-1, 1)-             ; var r3 = Rand.new(0.15, 0.35)-             ; var r4 = Rand.new(0.005, 0.01)+{ var chrd = { var r0 = Rand(0.05, 0.5)+             ; var r1 = Rand(-1, 1)+             ; var r2 = Rand(-1, 1)+             ; var r3 = Rand(0.15, 0.35)+             ; var r4 = Rand(0.005, 0.01)              ; var m = [60, 65, 72, 77, 79, 84]              ; var ds = 3              ; var d = [5, 4, 5, 7, 4, 5] * ds@@ -13,4 +13,4 @@              ; var p = XLine.kr(r1, r2, d)              ; var o = SinOsc.ar(f, 0)              ; Mix.ar(Pan2.ar(o, p, e)) }-; Out.ar(0, Mix.fill(9, chrd)) }.play+; Mix.fill(9, chrd) }.play
gr/clustered-sines-m.hs view
@@ -1,16 +1,16 @@--- clustered sines (jmcc)+-- clustered sines (jmcc) #2  import Control.Monad {- base -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  -- > fmap synthstat (clone 2 cs) cs :: UId m => m UGen cs = do   let n = 80-  f1 <- rand 100 1100+  f1 <- randM 100 1100   let f2 = 4 * f1-  y <- replicateM n (f1 +. rand 0 f2)+  y <- replicateM n (f1 +. randM 0 f2)   let sp = klangSpec y (map (f1 /) y) (replicate n 0)   return (klang AR 1 0 sp * (0.3 / fromIntegral n)) 
gr/clustered-sines.hs view
@@ -1,7 +1,6 @@--- clustered sines (jmcc)+-- clustered sines (jmcc) #2 -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  -- > synthstat cs@@ -10,9 +9,9 @@     let n = 80         f1 = rand 'α' 100 1100         f2 = 4 * f1-        sp = let y = uclone' 'α' n (f1 + rand 'α' 0 f2)+        sp = let y = uclone' 'β' n (f1 + rand 'γ' 0 f2)              in klangSpec y (map (f1 /) y) (replicate n 0)-    in uclone 'α' 2 (klang AR 1 0 sp * (0.3 / fromIntegral n))+    in uclone 'δ' 2 (klang AR 1 0 sp * (0.3 / fromIntegral n))  main :: IO () main = xfadeTextureU (4,4,maxBound) cs
+ gr/clustered-sines.scd view
@@ -0,0 +1,17 @@+// clustered sines (jmcc) #2++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~xfade_texture.({+    var n = 80;+    var f1 = 100 + 1000.0.rand;+    var f2 = 4.0 * f1;+    var z = Array.fill(2, {+        `[  // sine oscil bank specification :+            y = Array.fill(n, { f1 + f2.rand} ), // frequencies+            f1 / y, // amplitudes+            nil // phases default to zero+        ]+    });+    Klang.ar(z, 1, 0) * (0.3/n);+}, 4, 4);
gr/comb-delay-sweeps.hs view
@@ -1,6 +1,6 @@--- comb delay sweeps (jmcc)+-- comb delay sweeps (jmcc) #6 -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -} import System.Random {- random -} @@ -14,7 +14,6 @@        ,foldToRange 50 120 (e + e')        ,g'') --- > Sound.SC3.UGen.Dot.draw (fst (cds (60,61,mkStdGen 3567824))) cds :: ST -> (UGen,ST) cds st =     let (s,e,g) = wander st@@ -23,7 +22,21 @@         d = 1 / midiCPS l         c = 1 / midiCPS (constant s)         o = combC w 0.01 d (c * 1000)-    in (pan2 o (rand 'α' (-1) 1) 1,(s,e,g))+    in (pan2 o (rand 'β' (-1) 1) 1,(s,e,g))  main :: IO () main = overlapTextureS (4/3,4/3,9,maxBound) cds (60,61,mkStdGen 3567824)++cds' :: UGen+cds' =+    let s = fold (rand 'α' (- 7) 8) 50 120+        e = fold (rand 'β' (- 7) 8) 50 120+        l = line KR s e 4 DoNothing+        w = whiteNoise 'γ' AR * 0.005+        d = 1 / midiCPS l+        c = 1 / midiCPS s+        o = combC w 0.01 d (c * 1000)+    in pan2 o (rand 'δ' (-1) 1) 1++main' :: IO ()+main' = overlapTextureU (4/3,4/3,9,maxBound) cds'
+ gr/comb-delay-sweeps.scd view
@@ -0,0 +1,17 @@+// comb delay sweeps (jmcc) #6++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    arg dur;+    {+        var note = 50 + 70.rand;+        var endNote = (note + 15.rand - 7).fold(50,120);+        var note_ = (note + 15.rand - 7).fold(50,120);+        var endNote_ = (endNote + 15.rand - 7).fold(50,120);+        var noteSweep = Line.kr(note_, endNote_, dur);+        var dt = 1/noteSweep.midicps;+        var dc = 1/note_.midicps * 1000;+        Pan2.ar(CombC.ar(WhiteNoise.ar(0.005), 0.01, dt, dc),1.0.rand2);+    }+}.(4),sustainTime:4/3,transitionTime:4/3,overlap:6);
gr/contamination-zone.hs view
@@ -1,8 +1,7 @@--- contamination zone (jmcc)+-- contamination zone (jmcc) #9 -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  cz :: UGen@@ -19,6 +18,7 @@         a = lfPulse KR (linRand 'ι' 0 150 0) 0 (rand 'κ' 0.2 0.4)     in pan2 r (lfNoise1 'λ' KR (rand 'μ' 0 1)) a +-- > let g = cz_pp (silent 1) cz_pp :: UGen -> UGen cz_pp =     let f x = allpassN x 0.04 (randN 2 'ν' 0 0.04) 16
+ gr/contamination-zone.scd view
@@ -0,0 +1,27 @@+// contamination zone (jmcc) #9++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    var f = exprand(800, 8000);+    Pan2.ar(+        RLPF.ar(+            Klank.ar(+                `[+                    Array.rand(4, 50.0, 2000.0),+                    nil,+                    Array.rand(4, 0.2, 4.0)+                ],+                PinkNoise.ar(LFNoise1.kr(3.0.rand, 0.0008, 0.0022))+            ).abs * #[-1, 1].choose,+            SinOsc.kr(1.0.linrand, 0, 0.7 * f, f),+            0.1+        ),+        LFNoise1.kr(1.0.rand),+        LFPulse.kr(15.0.linrand, 0, 0.2 + 0.2.rand)+    )+}, 8, 3, 4, postProcess: {+    arg z;+    6.do({ z = AllpassN.ar(z, 0.1, [0.05.rand,0.05.rand], 4)});+    z;+});
gr/coolant.hs view
@@ -1,7 +1,6 @@--- coolant (jmcc)+-- coolant (jmcc) #2 -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  coolant :: UGen@@ -14,4 +13,4 @@     in klank s 1 0 1 (mceTranspose sp)  main :: IO ()-main = xfadeTextureU (4,4,maxBound) coolant+main = overlapTextureU (4,4,2,maxBound) coolant
+ gr/coolant.scd view
@@ -0,0 +1,11 @@+// coolant (jmcc) #2++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    var p = 10;+    Klank.ar([+        `[Array.fill(p, { 40 + 2000.0.rand }),nil,nil],+        `[Array.fill(p, { 40 + 2000.0.rand }),nil,nil]],+        OnePole.ar(BrownNoise.ar([0.002,0.002]),0.95));+},sustainTime:4,transitionTime:4,overlap:2);
gr/cricket-m.hs view
@@ -1,17 +1,17 @@ -- cricket (rd)  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  cricket :: UId m => m UGen cricket = do-  r1 <- clone 2 (rand 10 13)-  r2 <- clone 2 (rand 10 13)-  r3 <- clone 2 (rand 4 7)+  r1 <- clone 2 (randM 10 13)+  r2 <- clone 2 (randM 10 13)+  r3 <- clone 2 (randM 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-  r4 <- clone 2 (tRand 2130 2230 t)+  r4 <- clone 2 (tRandM 2130 2230 t)   return (sinOsc AR r4 0 * f * 0.25)  main :: IO ()
gr/cricket.scd view
@@ -1,8 +1,8 @@-{ var r1 = Array.fill(2, { Rand.new(10, 13) })-; var r2 = Array.fill(2, { Rand.new(10, 13) })-; var r3 = Array.fill(2, { Rand.new(4, 7) })+{ var r1 = Array.fill(2, { Rand(10, 13) })+; var r2 = Array.fill(2, { Rand(10, 13) })+; var r3 = Array.fill(2, { Rand(4, 7) }) ; var t = Impulse.kr(0.7, 0) ; var e = Decay2.kr(Impulse.kr(r1, 0), 0.001, 0.005) ; var f = SinOsc.kr(r2, 0) * e * r3 ; var r4 = Array.fill(2, { TRand.kr(2220, 2227, t) })-; Out.ar(0, SinOsc.ar(r4, 0) * f * 0.25) }.play+; SinOsc.ar(r4, 0) * f * 0.25 }.play
gr/crotale-sine.hs view
@@ -1,7 +1,7 @@ -- crotale-sine (rd) -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  crotale_sine :: UGen crotale_sine =@@ -11,27 +11,28 @@         e = let p = envASR 1 1 1 (EnvNum (-4))             in envGen KR g 1 0 1 RemoveSynth p         fn m' f' a' =-            let f = constant f'+            let k = floor f' :: Int+                f = constant f'                 a = constant a'-                r0 = rand (f+0) 0 (2 * pi)-                r1 = rand (f+1) 0.1 0.3-                r2 = rand (f+2) 0.025 0.1-                r3 = rand (f+3) 0 (2 * pi)+                r0 = rand (k + 0) 0 (2 * pi)+                r1 = rand (k + 1) 0.1 0.3+                r2 = rand (k + 2) 0.025 0.1+                r3 = rand (k + 3) 0 (2 * pi)                 o = sinOsc AR (f * midiRatio (m' - 12)) r0                 e' = e * sinOsc KR r1 0 * a             in pan2 o (sinOsc KR r2 r3) e'     in sum (zipWith (fn m) cf ca) * 0.1 -pattern :: [P_Bind]+pattern :: P.Param pattern =-    [(K_param "m",pwhitei 'α' 0 12 inf)-    ,(K_dur,pxrand 'β' [1,2,3] inf)-    ,(K_sustain,6)]+    [("m",map roundE (P.white 'α' 0 12))+    ,("dur",P.xrand 'β' [1,2,3])+    ,("sustain",repeat 6)]  main :: IO () main = do   let s = synthdef "crotale-sine" (out 0 crotale_sine)-  audition (p_with (K_instr,psynth s) (pbind pattern))+  audition (P.sbind1 (s,pattern))  crotale_data :: ([Double],[Double]) crotale_data =
gr/crotale.hs view
@@ -1,6 +1,6 @@ -- crotale (rd) -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  crotale :: UGen crotale =
gr/crotale.scd view
@@ -152,7 +152,7 @@ ; var ca = crotale[1] ; var cd = crotale[2] ; var ps = [-12, -5, 0, 2, 4, 5, 7, 12]-; var n = PinkNoise.ar()+; var n = PinkNoise.ar ; var t = Dust.kr(3) ; var fs = Select.kr(TIRand.kr(0, 7, t), ps) ; var g = TRand.kr(0, 1, t)@@ -161,4 +161,4 @@ ; var p = TRand.kr(-1, 1, t) ; var s = Decay2.kr(t, 0.06, 0.01) * n * g ; var k = DynKlank.ar(`[cf, ca, cd.reciprocal], s, fs.midiratio, fo, ds)-; Out.ar(0, Pan2.ar(k, p, 1)) }.play+; Pan2.ar(k, p, 1) }.play
gr/cut-outs-m.hs view
@@ -1,18 +1,18 @@ -- cut-outs (rd) -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  cut_outs :: (Functor m,UId m) => m UGen cut_outs = do   let t = impulse AR 22 0 * (sinOsc KR 0.5 0 + 1)       x = mouseX KR 0.005 0.12 Exponential 0.1       y = mouseY KR 0.01 0.52 Exponential 0.1-      n = do n1 <- lfNoise0 KR 2-             n2 <- coinGate (0.05 + n1 + y * 0.4 + t * 0.5) (t * 0.5)-             n3 <- tExpRand (mce2 500 900) 1600 t+      n = do n1 <- lfNoise0M KR 2+             n2 <- coinGateM (0.05 + n1 + y * 0.4 + t * 0.5) (t * 0.5)+             n3 <- tExpRandM (mce2 500 900) 1600 t              return (ringz n2 n3 x)   s <- fmap sum (sequence (replicate 3 n))-  b <- tRand 0 1 =<< dust KR 8+  b <- tRandM 0 1 =<< dustM KR 8   return (mrg [clip2 s (in' 1 KR 0) * 0.25,out 0 b])  main :: IO ()
gr/cut-outs.scd view
@@ -8,4 +8,4 @@ ; var s = Mix.fill(3, n) ; var b = TRand.kr(0, 1, Dust.kr(8)) ; Out.kr(0, b)-; Out.ar(0, s.clip2(In.kr(0, 1)) * 0.25) }.play+; s.clip2(In.kr(0, 1)) * 0.25 }.play
gr/cymbalism-accelerando.hs view
@@ -1,6 +1,6 @@--- cymbalism accellerando (jmcc)+-- cymbalism accelerando (jmcc) #2 -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  enumFromN :: Enum a => a -> Int -> [Int]
+ gr/cymbalism-accelerando.scd view
@@ -0,0 +1,19 @@+// cymbalism accelerando (jmcc) #2++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~xfade_texture.({+    var p = 15; // number of partials per channel per 'cymbal'.+    var f1 = 500 + 2000.0.rand;+    var f2 = 8000.0.rand;+    var z = Array.fill(2, {+        `[  // sine oscil bank specification:+            y = Array.fill(p, { f1 + f2.rand} ), // frequencies+            nil, // amplitudes default to 1.0+            Array.fill(p, { 1.0 + 4.0.rand }) // ring times+        ]+    });+    var tf = XLine.kr(4.0.linrand + 0.5, 35.0.rand + 0.5, 12);+    var t = Impulse.ar(tf);+    Klank.ar(z, Decay.ar(t, 0.004, WhiteNoise.ar(0.02)));+}, 4, 4);
gr/cymbalism-m.hs view
@@ -1,19 +1,20 @@--- cymbalism (jmcc)+-- cymbalism (jmcc) #2  import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} +-- > g <- cymbalism cymbalism :: (Functor m,UId m) => m UGen cymbalism = do   let p = replicate 15-  f1 <- rand 500 2500-  f2 <- rand 0 8000-  let y = do f <- sequence (p (rand f1 (f1 + f2)))-             rt <- sequence (p (rand 1 5))+  f1 <- randM 500 2500+  f2 <- randM 0 8000+  let y = do f <- sequence (p (randM f1 (f1 + f2)))+             rt <- sequence (p (randM 1 5))              return (klankSpec f (p 1) rt)   z <- clone 2 y-  n <- fmap (* 0.03) (whiteNoise AR)-  tf <- rand 0.5 3.5+  n <- fmap (* 0.03) (whiteNoiseM AR)+  tf <- randM 0.5 3.5   let t = impulse AR tf 0       s = decay t 0.004 * n   return (klank s 1 0 1 (mceTranspose z))
gr/cymbalism.scd view
@@ -1,11 +1,16 @@+// cymbalism (jmcc) #2++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~xfade_texture.( {var p = 15-;var f1 = Rand.new(500,2500)-;var f2 = Rand.new(0,8000)-;var y = {var f = Array.fill(p,{f1 + Rand.new(0,f2)} )-         ;var rt = Array.fill(p,{1 + Rand.new(0,4)})+;var f1 = Rand(500,2500)+;var f2 = Rand(0,8000)+;var y = {var f = Array.fill(p,{f1 + Rand(0,f2)})+         ;var rt = Array.fill(p,{1 + Rand(0,4)})          ;`[f,nil,rt]} ;var z = Array.fill(2,y)-;var t = Impulse.ar(Rand.new(0,3) + 0.5,0)-;var n = WhiteNoise.ar() * 0.03+;var t = Impulse.ar(Rand(0,3) + 0.5,0)+;var n = WhiteNoise.ar * 0.03 ;var s = Decay.ar(t,0.004) * n-;Out.ar(0,Klank.ar(z,s))}.play+;Klank.ar(z,s)},4,4);
gr/dark-sea-horns-hp.hs view
@@ -1,15 +1,15 @@ -- http://sccode.org/1-j#c51 (jl) {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} -import Sound.SC3.Monad {- hsc3 -}-import Sound.SC3.UGen.External.RDU.Monad {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  dark_sea_horns :: UId m => m UGen dark_sea_horns = do-  let n = lfNoise1-  let x = localIn 2 AR+  let n = lfNoise1M+  let x = localIn' 2 AR   let a = tanh (sinOsc AR 65 (x * #(n AR 0.1) * 3) * #(n AR 3) * 6)-  let f i = do return (allpassN i 0.3 #(randN 2 0.1 0.3) 5)+  let f i = do return (allpassN i 0.3 #(randNM 2 0.1 0.3) 5)   let o = tanh #(chainM 9 f a)   return (mrg2 o (localOut o)) 
gr/dark-sea-horns.hs view
@@ -1,13 +1,12 @@ -- http://sccode.org/1-j#c51 (jl) -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  dark_sea_horns :: UGen dark_sea_horns =     let n = lfNoise1-        x = localIn 2 AR+        x = localIn' 2 AR         a = tanh (sinOsc AR 65 (x * n 'α' AR 0.1 * 3) * n 'β' AR 3 * 6)         f i = allpassN i 0.3 (randN 2 'γ' 0.1 0.3) 5         o = tanh (useq 'δ' 9 f a)
gr/data-space-hp.hs view
@@ -1,12 +1,12 @@--- data space (jmcc)+-- data space (jmcc) #2 {-# OPTIONS_GHC -F -pgmF hsc3-hash-paren #-} -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  data_space :: UId m => m UGen data_space = do-    let r = rand 0+    let r = randM 0     let p0 = lfPulse KR #(r 200) 0 #(r 1)     p1 <- lfPulse KR #(r 40) 0 #(r 1) *. r 8000 .+. r 2000     let p2 = lfPulse KR #(r 20) 0 #(r 1)@@ -14,9 +14,9 @@     let p4 = lfPulse KR #(r 20) 0 #(r 1)     p5 <- lfPulse KR #(r 4) 0 #(r 1) *. r 8000 .+. r 2000     let f = p0 * p1 + p2 * p3 + p4 * p5-    dt <- rand 0.15 0.35+    dt <- randM 0.15 0.35     let o = lfPulse AR f 0 0.5 * 0.04-    l <- lfNoise0 KR #(r 3) .* 0.8+    l <- lfNoise0M KR #(r 3) .* 0.8     return (combL (pan2 o l 1) dt dt 3)  main :: IO ()
gr/data-space.hs view
@@ -1,6 +1,6 @@--- data space (jmcc)+-- data space (jmcc) #2 -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  data_space :: UGen
+ gr/data-space.scd view
@@ -0,0 +1,14 @@+// data space (jmcc) #2++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    var dt = 0.25.rand + 0.1;+    var osc = {+        arg n;+        var e = LFPulse.kr(4.0.rand, 0, 1.0.rand, 8000.rand, 2000.rand);+        LFPulse.kr(n.rand, 0, 1.0.rand, e)+    };+    var freq = osc.(200) + osc.(20) + osc.(20);+    CombL.ar(Pan2.ar(LFPulse.ar(freq, 0, 0.5, 0.04), LFNoise0.kr(3.0.rand, 0.8)), dt, dt, 3);+},sustainTime:6,transitionTime:1,overlap:4);
gr/deep-sea.hs view
@@ -1,12 +1,7 @@ -- deep sea (jrhb) -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}--rng :: UGen -> UGen -> UGen -> UGen-rng s l r =-    let m = (r - l) * 0.5-    in mulAdd s m (m + l)+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  deep_sea :: UGen deep_sea =@@ -21,7 +16,7 @@         count = pulseCount t 0         mul = count <* n         u1 = bpf (mul * t) f 1 * 0.1-        f2 = f * ((count `modE` rng (lfNoise1 'ε' KR 1) 2 20) + 1)+        f2 = f * ((count `modE` range (lfNoise1 'ε' KR 1) 2 20) + 1)         u2 = bpf u1 f2 1 * 0.2     in mrg [pan2 u2 pan (amp * 10)            ,detectSilence u2 0.0001 0.2 RemoveSynth]@@ -29,5 +24,5 @@ main :: IO () main = do   let s = synthdef "deep-sea" (out 0 deep_sea)-      p = pbind [(K_instr,psynth s),(K_dur,pxrand 'ζ' [0.25,0.5,1,2] inf)]-  audition p+      sc = P.sbind1 (s,[("dur",P.xrand 'ζ' [0.25,0.5,1,2])])+  audition sc
gr/deep-sea.scd view
@@ -1,10 +1,10 @@ { var amp = 1 ; var pan = 0 ; var variation = 0.9-; var n = Rand.new(7, 46)-; var dt1 = 25.0 + Rand.new(-1.7, 1.7)+; var n = Rand(7, 46)+; var dt1 = 25.0 + Rand(-1.7, 1.7) ; var dt2 = (dt1 + LFNoise2.kr(2)) * variation * 0.001-; var freq = 901 + Rand.new(0, 65)+; var freq = 901 + Rand(0, 65) ; var t = Impulse.ar(dt2.reciprocal, 0, 100) ; var count = PulseCount.ar(t, 0) ; var mul = count < n@@ -12,4 +12,4 @@ ; var freq2 = freq * ((count % LFNoise1.kr(1).range(2, 20)) + 1) ; var u2 = BPF.ar(u1, freq2, 1) * 0.2 ; DetectSilence.ar(u2, 0.0001, 0.2, 2)-; Out.ar(0, Pan2.ar(u2, pan, amp * 10)) }.play+; Pan2.ar(u2, pan, amp * 10) }.play
gr/deep-trip.hs view
@@ -1,7 +1,7 @@--- deep trip (jmcc)+-- deep trip (jmcc) #9 -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.External.RDU.ID  {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU  {- sc3-rdu -} import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}  deep_trip :: UGen
+ gr/deep-trip.scd view
@@ -0,0 +1,13 @@+// deep trip (jmcc) #9++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    var f = LFNoise1.kr(0.3.rand, 60, 70).midicps;+    var a = LFNoise2.ar(f * 0.5.rand,LFNoise1.kr(8.0.rand, SinOsc.kr(40.0.rand,0,0.1)).max(0));+    var z = SinOsc.ar(f, 0, a);+    var s = Pan2.ar(z, LFNoise1.kr(5.0.rand));+    var c1 = CombN.ar(s, 0.5, [0.2.rand + 0.3, 0.2.rand + 0.3], 20);+    var c2 = CombN.ar(s, 0.5, [0.2.rand + 0.3, 0.2.rand + 0.3], 20);+    s + c1 + c2;+}, 12, 4, 4);
gr/default.hs view
@@ -1,17 +1,17 @@ -- default (jmcc) -import Data.Default {- data-default -}-import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.List as L {- hsc3-lang -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -} -pattern :: [P_Bind]+pattern :: (Synthdef,P.Param) pattern =-    [(K_instr,psynth def)-    ,(K_note,pxrand 'α' [0,1,5,7,9] inf)-    ,(K_octave,prand 'β' [3,4,5,6] inf)-    ,(K_dur,pwrand 'γ' [0.1,0.2,0.4] [0.5,0.4,0.1] inf)-    ,(K_amp,pbrown 'δ' 0.01 0.2 0.01 inf)-    ,(K_param "pan",pbrown 'ε' (-1) 1 0.25 inf)]+    let to_cps = P.degree_to_cps' [0,2,4,5,7,9,11] 12+    in (defaultSynthdef+       ,[("freq",to_cps (P.xrand 'α' [0,1,5,7,9]) (P.rand 'β' [2,3,4,5,6]))+        ,("dur",P.wrand 'γ' [0.1,0.2,0.4] [0.5,0.4,0.1])+        ,("amp",L.brown 'δ' 0.01 0.2 0.01)+        ,("pan",L.brown 'ε' (-1) 1 0.25)])  main :: IO ()-main = audition (pbind pattern)+main = audition (P.sbind1 pattern)
gr/default.scd view
@@ -1,8 +1,12 @@+// default (jmcc)+ SynthDef(\default, {-arg out=0,freq=440,amp=0.1,pan=0,gate=1;-var e = Linen.kr(gate, 0.01, 0.7, 0.3, 2);-var f3 = freq + [0, Rand(-0.4,0.0), Rand(0.0,0.4)];-var l = XLine.kr(Rand(4000,5000), Rand(2500,3200), 1);-var z = LPF.ar(Mix.new(VarSaw.ar(f3, 0, 0.3, 0.3)),l) * e;-OffsetOut.ar(out, Pan2.ar(z, pan, amp));+    arg out=0,freq=440,amp=0.1,pan=0,gate=1;+    var e = Linen.kr(gate, 0.01, 0.7, 0.3, 2);+    var f3 = freq + [0, Rand(-0.4,0.0), Rand(0.0,0.4)];+    var l = XLine.kr(Rand(4000,5000), Rand(2500,3200), 1);+    var z = LPF.ar(Mix(VarSaw.ar(f3, 0, 0.3, 0.3)),l) * e;+    OffsetOut.ar(out, Pan2.ar(z, pan, amp)); },[\ir]).add;++Pbind(\note,Pseq([1,2,3],1)).play;
gr/demanding-studies.hs view
@@ -1,6 +1,6 @@ -- demanding studies (jmcc) -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  demanding_studies :: UGen demanding_studies =
gr/demanding-studies.scd view
@@ -1,10 +1,12 @@-{var s1 = Drand.new([72,75,79,82],inf)-;var s2 = Drand.new([82,84,86],1)-;var s3 = Dseq.new([72,75,79,s2],inf)+// demanding studies (jmcc)++{var s1 = Drand([72,75,79,82],inf)+;var s2 = Drand([82,84,86],1)+;var s3 = Dseq([72,75,79,s2],inf) ;var x = MouseX.kr(5,13,'linear',0.2) ;var tr = Impulse.kr(x,0) ;var f = Demand.kr(tr,0,[(s1 - 12).midicps,s3.midicps]) ;var o1 = SinOsc.ar(f + [0,0.7],0) ;var o2 = Saw.ar(f + [0,0.7]) * 0.3 ;var o3 = (o1 + o2).distort.log.distort.cubed-;Out.ar(0,o3 * 0.1)}.play+;o3 * 0.1}.play;
gr/dial-history-m.hs view
@@ -1,33 +1,30 @@ -- dial history (jrhb)  import Data.List {- base -}-import Sound.SC3.Monad {- hsc3 -}--rng :: UGen -> UGen -> UGen -> UGen-rng s = linLin s 0 1+import Sound.SC3 {- hsc3 -}  dial_history :: UId m => m UGen dial_history = do   let mfv = [[697,770,852,941],[1209,1336,1477,1633]]       numbers = [3,1] : [[a,b] | a <- [0..2],b <- [0..2]]       mce_r = mce . map mce-  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+  n <- dwhiteM dinf 7 12+  w <- dwhiteM 1 2 7+  b <- dbrownM n 0.1 0.2 0.01+  rate <- dseqM dinf (mce2 w b)+  q <- dseqM dinf (mce [1..10])+  g1 <- grayNoiseM AR+  g2 <- grayNoiseM AR+  d <- lfdNoise3M KR 0.5   let tr = trig (tDuty KR rate 0 DoNothing q 1) 0.09       pat = latch tr tr       x = mouseX KR 0 1 Linear 0.2       h = hasher (pat * x)-      which = trunc (rng h 0 (constant (length numbers))) 1+      which = trunc (linLin_u h 0 (constant (length numbers))) 1       both = select which (mce_r numbers)       dial = select both (mce_r (transpose mfv))       sig = sinOsc AR dial 0 * 0.05 * tr-      dsig = delayN sig 0.2 (rng d 0 0.01)+      dsig = delayN sig 0.2 (linLin_u d 0 0.01)       hiss = g1 * 0.01 + hpf (g2 * 0.02) 3000   return (dsig + hiss) 
gr/dial-history.scd view
@@ -1,10 +1,10 @@ { var mfv = [[697, 770, 852, 941], [1209, 1336, 1477, 1633]] ; var numbers = [[3, 1]] ++ {: [a, b], a <- (0..2), b <- (0..2) }.all-; var n = Dwhite.new(7, 12, inf)-; var w = Dwhite.new(2, 7, 1)-; var b = Dbrown.new(0.1, 0.2, 0.01, n)-; var rate = Dseq.new([w, b], inf)-; var q = Dseq.new((1..10), inf)+; var n = Dwhite(7, 12, inf)+; var w = Dwhite(2, 7, 1)+; var b = Dbrown(0.1, 0.2, 0.01, n)+; var rate = Dseq([w, b], inf)+; var q = Dseq((1..10), inf) ; var trig = Trig.kr(TDuty.kr(rate, 0, q), 0.09) ; var pat = Latch.kr(trig, trig) ; var x = MouseX.kr(0, 1, 'linear', 0.2)@@ -15,8 +15,8 @@ ; var sig = SinOsc.ar(dial, 0) * 0.05 * trig ; var d = LFDNoise3.kr(0.5) ; var dsig = DelayC.ar(sig, 0.2, d.range(0, 0.01))-; var g1 = GrayNoise.AR-; var g2 = GrayNoise.AR+; var g1 = GrayNoise.ar+; var g2 = GrayNoise.ar ; var z = Silent.ar(1) ; var hiss = g1 * 0.01 + HPF.ar(g2 * 0.02, 3000)-; Out.ar(0, [z, dsig + hiss]) }.play+; [z, dsig + hiss] }.play
gr/diffraction-m.hs view
@@ -1,25 +1,25 @@ -- diffraction (rd)  import Control.Monad {- base -}-import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  diffraction ::(Functor m,UId m) => m UGen diffraction = do   let p = do let x = mouseX KR 0.001 0.02 Exponential 0.1                  y = mouseY KR 120 400 Exponential 0.1-             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+             f <- fmap (* mce2 32 64) (lfNoise0M KR 4)+             w <- fmap (* x) (lfNoise0M KR 32)+             z <- fmap (* 0.1) (lfNoise0M KR 2)+             m <- lfNoise0M KR 6              let s = pulse AR f w              return (resonz s (y + z) (m * 0.4 + 0.8) * 0.5)-      q = do n <- lfNoise0 KR 128+      q = do n <- lfNoise0M KR 128              s <- p              return (combN s 0.2 (n * 0.1 + 0.1) 3)       r = let x = mouseX KR 0.75 1.25 Exponential 0.1               y = mouseY KR 0.25 1 Exponential 0.1-              f _ = do fr <- fmap (* x) (rand 50 59)-                       am <- fmap (* y) (rand 0.04 0.16)+              f _ = do fr <- fmap (* x) (randM 50 59)+                       am <- fmap (* y) (randM 0.04 0.16)                        return (sinOsc AR fr 0 * am)           in liftM2 mce2 (mixFillM 16 f) (mixFillM 12 f)   fmap sum (sequence [p,q,r])
gr/diffraction.scd view
@@ -7,11 +7,11 @@          ;var s = Pulse.ar(f,w)          ;Resonz.ar(s,y + z,(m * 0.4) + 0.8) * 0.5} ;var q = {var n = LFNoise0.kr(128)-         ;CombN.ar(p.value,0.2,(n * 0.1) + 0.1,3)}+         ;CombN.ar(p.(),0.2,(n * 0.1) + 0.1,3)} ;var r = {var x1 = MouseX.kr(0.75,1.25,'exponential',0.1)          ;var y1 = MouseY.kr(0.25,1,'exponential',0.1)          ;var f = {var fr = Rand(50,59) * x1                   ;var am = Rand(0.04,0.16) * y1                   ;SinOsc.ar(fr,0) * am}          ;[Mix.fill(16,f),Mix.fill(12,f)]}-;Out.ar(0,p.value + q.value + r.value)}.play+;p.() + q.() + r.()}.play
gr/discretion-m.hs view
@@ -1,14 +1,14 @@ -- discretion-m (rd) -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  discretion :: UId m => m UGen discretion = do   let mkls bp t = envGen KR 1 1 0 1 RemoveSynth (envCoord bp t 1 EnvLin)-      part = do f1 <- clone 2 (rand 50 55)-                f2 <- clone 2 (rand 50 65)-                f3 <- clone 2 (rand 50 55)-                a <- clone 2 (rand 0.01 0.035)+      part = do f1 <- clone 2 (randM 50 55)+                f2 <- clone 2 (randM 50 65)+                f3 <- clone 2 (randM 50 55)+                a <- clone 2 (randM 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
gr/discretion.hs view
@@ -1,8 +1,7 @@ -- discretion (rd) -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -}  discretion :: UGen discretion =
+ gr/distort-input.hs view
@@ -0,0 +1,11 @@+-- distort input (jmcc) #5++import Sound.SC3 {- hsc3 -}++distort_input :: UGen+distort_input =+    let gain = mouseX KR 1 100 Exponential 0.2  -- mouse x controls gain into distortion+    in distort (soundIn (mce2 0 1) * gain) * 0.4++main :: IO ()+main = audition (out 0 distort_input)
+ gr/distort-input.scd view
@@ -0,0 +1,4 @@+// distort input (jmcc) #5++{var gain = MouseX.kr(1,100,'exponential') /* mouse x controls gain into distortion */+;SoundIn.ar([0,1], gain).distort * 0.4}.play;
gr/doppler.hs view
@@ -22,9 +22,14 @@     let t = line KR (-pi/2) (pi * 3/2) dt RemoveSynth     in (a * cos t,b * sin t) +src :: UGen+src = rlpf (fSinOsc AR 200 0 * lfPulse AR 31.3 0 0.4) 400 0.3++d1 :: UGen+d1 = doppler (line_x 10 100 6) src++d2 :: UGen+d2 = doppler (ellipse 10 75 12) src+ main :: IO ()-main = do-  let s = rlpf (fSinOsc AR 200 0 * lfPulse AR 31.3 0 0.4) 400 0.3-  withSC3 (do play (out 0 (doppler (line_x 10 100 6) s))-              wait 8-              play (out 0 (doppler (ellipse 10 75 12) s)))+main = withSC3 (play (out 0 d1) >> wait 8 >> play (out 0 d2))
+ gr/drone-plus-rhythm.hs view
@@ -0,0 +1,50 @@+-- drone plus rhythm (jmcc) #12++import Control.Concurrent {- hsc3 -}+import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Control.OverlapTexture {- hsc3-lang -}++scale :: Num a => [a]+scale = [0, 2, 3, 5, 7, 9, 10]++rand2 :: ID a => a -> UGen -> UGen+rand2 z n = rand z (negate n) n++drone_1 :: UGen+drone_1 =+    let f0 = midiCPS (lchoose 'α' [24,36] + rand2 'β' 0.08)+        f1 = lfSaw AR (mce2 f0 (f0 + 0.2)) 0 * lfNoise2 'γ' KR (f0 * mce2 0.05 0.04) * 0.06+    in lpf f1 (rand 'δ' 1000 3000)++drone_1_txt :: IO ()+drone_1_txt = overlapTextureU (4,4,8,maxBound) drone_1++drone_2 :: UGen+drone_2 =+    let x = rand 'ε' 0 1 >* 0.8+        m = lchoose 'ζ' [60,72] + lchoose 'η' scale + uclone 'θ' 2 (rand2 'ι' 0.05)+    in sinOsc AR (midiCPS m) 0 * x * rand 'κ' 0.04 0.07++drone_2_txt :: IO ()+drone_2_txt = overlapTextureU (4,6,3,maxBound) drone_2++iseqr :: ID a => a -> [UGen] -> UGen -> UGen+iseqr z s tr = tr * demand tr 0 (dxrand z dinf (mce s))++rhy :: UGen+rhy =+    let m = lchoose 'λ' [48, 60, 72, 84] + lchoose 'μ' scale + uclone 'ν' 2 (rand2 'ξ' 0.03)+        sq = iseqr 'ο' [0,1,0,1,1,0] (impulse AR (lchoose 'π' [1.5,3,6]) 0)+        sg = lfPulse AR (midiCPS m) 0 0.4 * rand 'ρ' 0.03 0.08+    in rlpf (decay2 sq 0.004 (rand 'σ' 0.2 0.7) * sg) (expRand 'τ' 800 2000) 0.1++pp :: UGen -> UGen+pp z = combN z 0.5 0.5 6 + mceReverse z++rhy_txt :: IO ()+rhy_txt = overlapTextureU_pp (6,6,6,maxBound) rhy 2 pp++main = do+  forkIO drone_1_txt+  forkIO drone_2_txt+  forkIO rhy_txt
+ gr/drone-plus-rhythm.scd view
@@ -0,0 +1,33 @@+// drone plus rhythm (jmcc) #12++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~scale = #[0, 2, 3, 5, 7, 9, 10];++~overlap_texture.({+    var f = (#[24,36].choose + 0.08.rand2).midicps;+    LPF.ar(LFSaw.ar([f, f + 0.2], 0, LFNoise2.kr(f*[0.05, 0.04], 0.06)), rrand(1000,3000));+}, 4, 4, 8);++~overlap_texture.({+    arg i;+    if (i > 1 and: { 0.8.coin }, {+        var f = (#[60, 72].choose + ~scale.choose + [0.05.rand2, 0.05.rand2]).midicps;+        SinOsc.ar(f, 0, rrand(0.04,0.07));+    }, {+        Silent.ar(2)+    });+}, 4, 6, 3);++~overlap_texture.({+    arg i;+    var isequ = {arg s, tr; tr * Demand.ar(tr, 0, Dseq(s, inf))};+    if (i > 8, {+        var f = (#[48, 60, 72, 84].choose + ~scale.choose + [0.03.rand2, 0.03.rand2]).midicps;+        var sq = isequ.([1,1,1,0,0,0].scramble,Impulse.ar([1.5,3,6].choose));+        var sg = LFPulse.ar(f, 0, 0.4, rrand(0.03,0.08));+        RLPF.ar(Decay2.ar(sq, 0.004, rrand(0.2, 0.7),sg),exprand(800,2000),0.1)+    },{ Silent.ar(2) });+}, 6, 6, 6);++~post_process.({arg z; CombN.ar(z, 0.5, 0.5, 6, 1, z.reverse)});
gr/drummer.hs view
@@ -1,6 +1,6 @@ -- drummer (tm) -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  drummer :: UGen drummer =
gr/drummer.scd view
@@ -1,9 +1,9 @@-{ var tempo = 4-; var n = WhiteNoise.ar()-; var tr = Impulse.ar(tempo, 0)-; var tr_2 = PulseDivider.ar(tr, 4, 2)-; var tr_4 = PulseDivider.ar(tr, 4, 0)-; var snare = n * Decay2.ar(tr_2, 0.005, 0.5)-; var bass = SinOsc.ar(60, 0) * Decay2.ar(tr_4, 0.005, 0.5)-; var hihat = HPF.ar(n, 10000) * Decay2.ar(tr, 0.005, 0.5)-; Out.ar(0, Pan2.ar(snare + bass + hihat, 0, 0.4)) }.play+{var tempo = 4+;var n = WhiteNoise.ar+;var tr = Impulse.ar(tempo, 0)+;var tr_2 = PulseDivider.ar(tr, 4, 2)+;var tr_4 = PulseDivider.ar(tr, 4, 0)+;var snare = n * Decay2.ar(tr_2, 0.005, 0.5)+;var bass = SinOsc.ar(60, 0) * Decay2.ar(tr_4, 0.005, 0.5)+;var hihat = HPF.ar(n, 10000) * Decay2.ar(tr, 0.005, 0.5)+;Out.ar(0, Pan2.ar(snare + bass + hihat, 0, 0.4))}.play
gr/e-lamell-p.hs view
@@ -1,7 +1,7 @@ -- e-lamell-p (rd) -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.Lang.Pattern {- hsc3-lang -}+import Sound.SC3 {- hsc3 -}+import qualified Sound.SC3.Lang.Pattern.Plain as P {- hsc3-lang -}  e_lamell :: UGen e_lamell =@@ -18,25 +18,22 @@         e = envGen AR 1 a 0 1 RemoveSynth e_d     in pan2 s l e -patterns :: [[P_Bind]]+patterns :: [(Synthdef,P.Param)] patterns =-    let i = psynth (synthdef "e-lamell" (out 0 e_lamell))-    in [[(K_instr,i)-        ,(K_note,prand 'β' [0,2,5,7] inf)-        ,(K_octave,pwrand 'γ' [2,3,4,5] [0.2,0.35,0.35,0.1] inf)-        ,(K_dur,0.1)-        ,(K_param "d",pwhite 'δ' 0.01 0.8 inf)-        ,(K_amp,pwhite 'ε' 0 0.75 inf)-        ,(K_param "n",pwhite 'ζ' 2 36 inf)-        ,(K_param "l",pwhite 'η' (-1) 1 inf)]-       ,[(K_instr,i)-        ,(K_note,prand 'θ' [0] inf)-        ,(K_octave,prand 'ι' [2,3] inf)-        ,(K_dur,0.1)-        ,(K_param "d",pwhite 'κ' 0.01 1.2 inf)-        ,(K_amp,prand 'λ' [0,0.25,0.5,1] inf)-        ,(K_param "n",pwhite 'μ' 2 36 inf)-        ,(K_param "l",pwhite 'ν' (-1) 1 inf)]]+    let sy = synthdef "e-lamell" (out 0 e_lamell)+        to_cps = P.degree_to_cps' [0,2,4,5,7,9,11] 12+    in [(sy,[("freq",to_cps (P.rand 'β' [0,2,5,7]) (P.wrand 'γ' [2,3,4,5] [0.2,0.35,0.35,0.1]))+            ,("dur",repeat 0.1)+            ,("d",P.white 'δ' 0.01 0.8)+            ,("amp",P.white 'ε' 0 0.75)+            ,("n",P.white 'ζ' 2 36)+            ,("l",P.white 'η' (-1) 1)])+       ,(sy,[("freq",to_cps (P.rand 'θ' [0]) (P.rand 'ι' [1,2,3]))+            ,("dur",repeat 0.1)+            ,("d",P.white 'κ' 0.01 1.2)+            ,("amp",P.rand 'λ' [0,0.25,0.5,1])+            ,("n",P.white 'μ' 2 36)+            ,("l",P.white 'ν' (-1) 1)])]  main :: IO ()-main = audition (ppar (map pbind patterns))+main = audition (P.sbind patterns)
gr/e-lamell.hs view
@@ -2,7 +2,7 @@  import Control.Monad import Sound.OSC {- hosc -}-import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Random.IO as R {- hsc3-lang -}  e_lamell :: UGen
+ gr/early-space-music-lp-side-one.scd view
@@ -0,0 +1,31 @@+// early space music lp side one (jmcc) #12++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+	var scale = [0, 2, 4, 5, 7, 9, 11];+	var octave = [24, 36, 48, 60, 72, 84, 96] - 3;+    var s1 = {+        var f = (scale.choose + octave.choose).midicps;+        var z = {+            var ff = f * SinOsc.kr(exprand(4,6),0,0.008,1);+            LFSaw.ar([ff * rrand(0.99,1.01), ff * rrand(0.99,1.01)], 0, 0.01)+        };+        var x = LPZ2.ar(LPZ2.ar(Mix.arFill(10, z)));+        if (0.3.coin && (f < 1400), {+            x = RLPF.ar(x, SinOsc.kr(rrand(0.3,0.8),0,f*rrand(0.5,3), f * rrand(4,12)), 0.1)+        });+        x+    };+    var s2 = {+        var rnd = {exprand(4,12) * [1,rrand(0.9,1.1)]};+        var rates = XLine.kr(rnd.(), rnd.(), 12) * [1,-1].choose;+        var sw = LFSaw.kr(rates, 0, rrand(2,16), rrand(40,120));+        var f = LFTri.kr(exprand(0.25,0.5) * [1,-1].choose, 0, linrand(4,30), sw).midicps;+        CombN.ar(SinOsc.ar(f, 0, 0.02), 0.3, rrand(0.15,0.3), 4)+    };+    [s1,s2].choose.();+}, 4, 4, 6, postProcess: {+    arg z;+    CombN.ar(z, 0.5, [0.5,0.47], 7, 1, z.reverse)+});
gr/early-space-music-lp-side-two.hs view
@@ -1,9 +1,9 @@--- early space music LP, side 2 (jmcc)+-- early space music LP, side 2 (jmcc) #12 -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -} import qualified Sound.SC3.Lang.Random.Gen as R {- hsc3-lang -} import Sound.SC3.Lang.Control.OverlapTexture-import Sound.SC3.UGen.External.RDU.ID {- sc3-rdu -}+import Sound.SC3.UGen.External.RDU {- sc3-rdu -} import qualified System.Random as R {- random -}  m1 :: UGen@@ -28,29 +28,30 @@     let f = midiCPS (rand 'λ' 60 100)     in fSinOsc AR (mce2 f (f + 0.2)) 0 * lfNoise2 'μ' KR (f * mce2 0.15 0.16) * 0.1 +id_seq :: Enum a => a -> Int -> [Int]+id_seq c n = let c' = fromEnum c in [c' .. c' + n - 1]+ -- audition (out 0 m4) m4 :: UGen m4 =     let a = lfPulse KR (expRand 'ν' 0.2 1.2) 0 (rand 'ξ' 0.1 0.2)-        o i = let r = let (p,q) = mce2c (expRandN 2 i 0.1 20)+        o z = let i = constant z+                  r = let (p,q) = mce2c (expRandN 2 z 0.1 20)                       in xLine KR p q 25.6 DoNothing-                  f = midiCPS (rand i 24 96)-                  e = max 0 (sinOsc KR (r * rand i 0.9 1.1) (rand i 0 (2 * pi)) * 0.1 - 0.05)+                  f = midiCPS (rand z 24 96)+                  e = max 0 (sinOsc KR (r * rand z 0.9 1.1) (rand z 0 (2 * pi)) * 0.1 - 0.05)                   s = fSinOsc AR (f * i + f) 0 * e * (1 / (i + 1))-              in pan2 s (rand i (-1) 1) 1-    in sum (map o [0..11]) * a+              in pan2 s (rand z (-1) 1) 1+    in sum (map o (id_seq 0 12)) * a  -- audition (out 0 (m6 * 0.5)) m6 :: UGen m6 =-    let f = midiCPS (lfNoise1 'ο' KR (rand 'π' 0 0.3) * 60 + 70)-        a0 = lfNoise2 'ρ' AR (f * rand 'σ' 0 0.5)-        a1 = max 0 (lfNoise1 'τ' KR (rand 'υ' 0 8) * sinOsc KR (rand 'φ' 0 40) 0 * 0.1)+    let f = midiCPS (lfNoise1 'π' KR (rand 'ρ' 0 0.3) * 60 + 70)+        a0 = lfNoise2 'σ' AR (f * rand 'τ' 0 0.5)+        a1 = max 0 (lfNoise1 'υ' KR (rand 'φ' 0 8) * sinOsc KR (rand 'χ' 0 40) 0 * 0.1)         z = sinOsc AR f 0 * a0 * a1-    in pan2 z (lfNoise1 'χ' KR (rand 'ψ' 0 5)) 1--enumFromN :: Enum a => a -> Int -> [Int]-enumFromN e i = let j = fromEnum e in [j .. j + i]+    in pan2 z (lfNoise1 'ψ' KR (rand 'ω' 0 5)) 1  -- audition (out 0 m7) m7 :: UGen@@ -59,9 +60,9 @@         k = let y z = let fr = mceChannels (expRandN p z 100 6000)                           rt = mceChannels (randN p z 2 6)                       in klankSpec fr (replicate p 1) rt-            in mce2 (y 'ω') (y 'Α')-        f = xLine KR (expRand 'Β' 40 300) (expRand 'Γ' 40 300) 12 DoNothing-        t = lfPulse AR f 0 (rand 'Δ' 0.1 0.9) * 0.002 * max 0 (lfNoise2 'Ε' KR (rand 'Ζ' 0 8))+            in mce2 (y 'Α') (y 'Β')+        f = xLine KR (expRand 'Γ' 40 300) (expRand 'Δ' 40 300) 12 DoNothing+        t = lfPulse AR f 0 (rand 'Ε' 0.1 0.9) * 0.002 * max 0 (lfNoise2 'Ζ' KR (rand 'Η' 0 8))     in distort (klank t 1 0 1 (mceTranspose k)) * 0.3  esmlp2 :: R.RandomGen g => g -> (UGen, g)@@ -71,7 +72,7 @@ esmlp2_pp :: UGen -> UGen esmlp2_pp i =     let c z = combN i 0.3 (mce2 (rand z 0.1 0.3) (rand z 0.12 0.32)) 8-    in sum (map c ['Η'..'Θ']) * 0.3+    in sum (map c (id_seq 'Θ' 5)) * 0.3  main :: IO () main = do
+ gr/early-space-music-lp-side-two.scd view
@@ -0,0 +1,52 @@+// early space music lp side two (jmcc) #12++"/home/rohan/sw/hsc3-graphs/gr/overlap-texture.scd".load;++~overlap_texture.({+    [{+        var a = 20.0.rand;+        var b = 5000.0.rand;+        var c = 20.0.rand;+        var pan = 1.0.rand2;+        Pan2.ar(SinOsc.ar(SinOsc.ar(a, 0, 0.1*b, b), 0, SinOsc.kr(c, 0, 0.08, 0.08)), pan)+    },{+        var a0 = 200.0.rand + 40;+        var a1 = a0 + 1.0.rand2;+        var a = [a0, a1];+        var b = exprand(50,2400);+        var c = [a0 + 1.0.rand2, a1 + 1.0.rand2];+        SinOsc.ar(SinOsc.ar(a, 0, 1.0.rand * b, b), 0, SinOsc.kr(c, 0, 0.025, 0.025))+    },{+        var f = (60 + 40.rand).midicps;+        FSinOsc.ar([f, f + 0.2], 0, LFNoise2.kr(f*[0.15, 0.16], 0.1));+    },{+        var f = rrand(24, 96).midicps;+        var r = XLine.kr(exprand(0.1,20),exprand(0.1,20), 25.6);+        var n = 12;+        Mix.arFill(n, {+            arg i;+            var a = SinOsc.kr( r * rrand(0.9,1.1),2pi.rand,0.1,-0.05);+            var o = FSinOsc.ar(f * i + f, 0, a.max(0));+            Pan2.ar(o * (1/(i+1)), 1.0.rand2)+        }) * LFPulse.kr(exprand(0.2,1.2), 0, rrand(0.1,0.2));+    },{+        var f = LFNoise1.kr(0.3.rand, 60, 70).midicps;+        var o = SinOsc.kr(40.0.rand,0,0.1);+        var a = LFNoise2.ar(f * 0.5.rand, LFNoise1.kr(8.0.rand, o).max(0));+        var z = SinOsc.ar(f, 0, a);+        Pan2.ar(z, LFNoise1.kr(5.0.rand));+    },{+        var f1 = 100;+        var f2 = 6000.0;+        var f = Array.fill(p, { exprand(f1, f2) }); // frequencies+        var rt = Array.fill(p, { 2.0 + 4.0.rand });	// ring times+        var z = Array.fill(2, {`[f, nil,rt]});+        var f3 = XLine.kr(exprand(40.0, 300.0), exprand(40.0, 300.0), 12);+        var in = LFPulse.ar(f3, 0, rrand(0.1, 0.9), 0.002 * LFNoise2.kr(8.0.rand).max(0));+        Klank.ar(z, in).distort * 0.3;+    }].choose.();+}, 2, 4, 6, postProcess: {+    arg z;+    var fn = {CombN.ar(z, 0.3, [rrand(0.1,0.3),rrand(0.1,0.3)], 8)};+    Mix.arFill(5,fn) * 0.3;+});
gr/eggcrate-m.hs view
@@ -1,6 +1,6 @@ -- eggcrate-m (rd) -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  eggcrate :: UId m => m UGen eggcrate = do@@ -8,11 +8,11 @@       sinu = sin . (* pi)       eggcrate_f u v = cosu u * sinu v       p = mce [64,72,96,128,256,6400,7200,8400,9600]-  [x,y] <- sequence (replicate 2 (brownNoise KR))-  t <- dust KR 2.4-  [f0,f1] <- sequence (replicate 2 (tChoose t p))-  let f = linLin (eggcrate_f x y) (-1) 1 f0 f1-      a = linLin x (-1) 1 0 0.1+  [x,y] <- sequence (replicate 2 (brownNoiseM KR))+  t <- dustM KR 2.4+  [f0,f1] <- sequence (replicate 2 (tChooseM t p))+  let f = linLin_b (eggcrate_f x y) f0 f1+      a = linLin_b x 0 0.1   return (pan2 (mix (sinOsc AR f 0)) y a)  main :: IO ()
gr/eggcrate.hs view
@@ -1,6 +1,6 @@ -- eggcrate (rd) -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  atp :: (t -> u) -> (t,t) -> (u,u) atp f (i,j) = (f i,f j)@@ -14,8 +14,8 @@       (x,y) = atp (`brownNoise` KR) ('α','β')       t = dust 'γ' KR 2.4       (f0,f1) = atp (\z -> tChoose z t p) ('δ','ε')-      f = linLin (eggcrate_f x y) (-1) 1 f0 f1-      a = linLin x (-1) 1 0 0.1+      f = linLin_b (eggcrate_f x y) f0 f1+      a = linLin_b x 0 0.1  in pan2 (mix (sinOsc AR f 0)) y a  main :: IO ()
gr/eggcrate.scd view
@@ -1,11 +1,10 @@-{var eggcrate = {arg u,v-                ;(u * pi).cos * (v * pi).sin}+{var eggcrate = {arg u,v; (u * pi).cos * (v * pi).sin} ;var p = [64,72,96,128,256,6400,7200,8400,9600]-;var x = BrownNoise.kr()-;var y = BrownNoise.kr()+;var x = BrownNoise.kr+;var y = BrownNoise.kr ;var t = Dust.kr(2.4) ;var f0 = TChoose.kr(t,p) ;var f1 = TChoose.kr(t,p)-;var f = LinLin.kr(eggcrate.value(x,y),-1,1,f0,f1)+;var f = LinLin.kr(eggcrate.(x,y),-1,1,f0,f1) ;var a = LinLin.kr(x,-1,1,0,0.1)-;Out.ar(0,Pan2.ar(Mix.ar(SinOsc.ar(f,0)),y,a))}.play+;Pan2.ar(Mix.ar(SinOsc.ar(f,0)),y,a)}.play
gr/f-lets-m.hs view
@@ -1,21 +1,21 @@ -- f-lets (rd) -import Sound.SC3.Monad {- hsc3 -}+import Sound.SC3 {- hsc3 -}  f_lets :: (Functor m,UId m) => m UGen f_lets = do   let f_let t g j n f = do            let pd = pulseDivider t j 0-           r0 <- tIRand (mce2 2 1) n pd-           r1 <- tRand 0.01 0.04 pd-           r2 <- tRand 0.05 0.10 pd+           r0 <- tIRandM (mce2 2 1) n pd+           r1 <- tRandM 0.01 0.04 pd+           r2 <- tRandM 0.05 0.10 pd            return (formlet pd (f * r0) r1 r2 * g)       mk_n t = do-           r0 <- tRand 0 1 t-           r1 <- tRand 0 1 t-           r2 <- tRand 0 1 t-           r3 <- tRand 0 1 t-           r4 <- coinGate 0.2 t+           r0 <- tRandM 0 1 t+           r1 <- tRandM 0 1 t+           r2 <- tRandM 0 1 t+           r3 <- tRandM 0 1 t+           r4 <- coinGateM 0.2 t            sequence [f_let t 0.15 2 9 (mce2 200 400)                     ,f_let t 0.25 2 9 (mce2 (200 + r0) (400 + r1))                     ,f_let t 0.05 4 5 (mce2 25 50)@@ -23,7 +23,7 @@                     ,let lr = fmap (* latch r4 t)                      in lr (f_let t 0.5 1 16 (mce2 300 600))]       tr = impulse AR 24 0-  n <- lfNoise0 KR 2+  n <- lfNoise0M KR 2   return . (* (n * 0.25 + 0.25)) . sum =<< mk_n tr  main :: IO ()
+ gr/f0-454598285861617665.hs view
@@ -0,0 +1,15 @@+-- https://twitter.com/redFrik/status/454598285861617665 (f0)++import Sound.SC3 {- hsc3 -}++f0_454598285861617665 :: UGen+f0_454598285861617665 =+    let b = mce [9,8 .. 1]+        c = lfTri AR (3 ** lfTri AR (1 / b) (b / 9)) 0+        d = lfTri AR (1 / b) 0 `modE` 1 / 9 + 0.01+        f = 2 ** roundE (lfTri AR (b / 99) 0) * 99 * b+        o = grainSin 2 c d f 0 (-1) 512+    in splay (tanh o) 1 1 0 True / 2++main :: IO ()+main = audition (out 0 f0_454598285861617665)
+ gr/f0-454598285861617665.scd view
@@ -0,0 +1,8 @@+// https://twitter.com/redFrik/status/454598285861617665++{var b = (9..1)+;var c = LFTri.ar(3 ** LFTri.ar(1 / b,b / 9))+;var d = LFTri.ar(1 / b) % 1 / 9 + 0.01+;var f = 2 ** LFTri.ar(b / 99).round * 99 * b+;var o = GrainSin.ar(2,c,d,f)+;Splay.ar(o.tanh) / 2}.play
+ gr/f0-456384156159574016.hs view
@@ -0,0 +1,13 @@+-- https://twitter.com/redFrik/status/456384156159574016 (f0)++import Sound.SC3 {- hsc3 -}++f0_456384156159574016 :: UGen+f0_456384156159574016 =+    let a = 1 / mce [3,12,4,1,6,2]+        s = lag3 (sinOsc AR a 0) (abs (sinOsc AR (2.67 ** a) 0)) * 99+        f = ((sinOsc AR ((1 / a) / 9) a >* 0) * 20 + 99) / a+    in splay (sinOsc AR (hpf (ringz s f 1) 440) 0) 1 1 0 True * 0.25++main :: IO ()+main = audition (out 0 f0_456384156159574016)
+ gr/f0-456384156159574016.scd view
@@ -0,0 +1,7 @@+// https://twitter.com/redFrik/status/456384156159574016++{var a = 1 / [3,12,4,1,6,2]+;var s = SinOsc.ar(a).lag3(SinOsc.ar(2.67 ** a).abs) * 99+;var f = ((SinOsc.ar((1 / a) / 9,a) > 0) * 20 + 99) / a+;Splay.ar(SinOsc.ar(HPF.ar(Ringz.ar(s,f)))) * 0.25}.play+
− gr/f0-tw0001.scd
@@ -1,1 +0,0 @@-r{99.do{|i|x={Pan2.ar(SinOsc.ar(i+1,SinOsc.ar((i%9).div(3)*100+(i%9)+500),0.03),1.0.rand2)}.play;2.wait;x.release(25)}}.play
− gr/f0-tw0006.scd
@@ -1,1 +0,0 @@-r{loop{x={GVerb.ar(MoogFF.ar(ClipNoise.ar*0.4,LFPar.kr({0.3.rand}!2,0,600,990)),9,9,1)}.play(s,0,19);3.wait;x.release}}.play
+ gr/f0-tw0026.hs view
@@ -0,0 +1,33 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0)++import Sound.SC3 {- hsc3 -}+import Sound.SC3.Lang.Collection.Extension {- hsc3-lang -}+import Sound.SC3.Lang.Math {- hsc3-lang -}+import Sound.SC3.Lang.Pattern.Plain {- hsc3-lang -}++fibs :: Num n => [n]+fibs = 0 : scanl (+) 1 fibs++-- | In SC3, List.fibs begins at 1.+nfibs :: Num a => Int -> [a]+nfibs n = take n (tail fibs)++-- | In SC3, % of zero is zero.+mod0 :: (Extending f, Integral c) => f c -> f c -> f c+mod0 l = let f p q = if q == 0 then 0 else p `mod` q in zipWith_c f l++post_proc :: UGen+post_proc = let s = combL (tanh (in' 1 AR 8) / 8) 1 1 8 in mce2 s s * 0.1++pattern :: NRT+pattern =+    let d = nfibs 32 `mod0` (nfibs 64  `mod0` [12])+        f = map (\x -> degree_to_cps [0,2,4,5,7,9,11] 12 (fromIntegral x) 4) d+    in sbind1 (defaultSynthdef+              ,[("amp",repeat 8)+               ,("dur",repeat 0.25)+               ,("freq",cycle f)+               ,("out",repeat 8)])++main :: IO ()+main = audition (out 0 post_proc) >> audition pattern
+ gr/f0-tw0026.scd view
@@ -0,0 +1,4 @@+// http://www.fredrikolofsson.com/f0blog/?q=node/537++{CombL.ar(In.ar(8).tanh/8,1,1,8)!2 * 0.1}.play+;Pbind(\amp,8,\dur,1/4,\degree,Pseq(List.fib(32)%(List.fib(64)%12),inf),\out,8).play
gr/f0-tw0028.hs view
@@ -1,6 +1,6 @@ -- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0) -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  fib :: Integral i => [i] fib = 0 : scanl (+) 1 fib
gr/f0-tw0030.hs view
@@ -1,6 +1,6 @@ -- www.fredrikolofsson.com/f0blog/?q=node/537 (f0) -import Sound.SC3.ID {- hsc3 -}+import Sound.SC3 {- hsc3 -}  f0_0030 :: UGen f0_0030 =@@ -8,7 +8,7 @@         f = a 1 0 5 (a (mce2 0.05 0.04) 0 50 160 `roundTo` 50)         w = a 0.2 0 0.5 (a 3 0 0.2 0.5)         o = varSaw AR f 0 w / 8-    in out 0 (gVerb o 80 3 0.5 0.5 15 1 0.7 0.5 300)+    in out 0 (gVerb o 80 3 0.5 0.5 15 1 0.7 0.5 300 * 0.1)  main :: IO () main = audition f0_0030
gr/f0-tw0030.scd view
@@ -4,4 +4,4 @@ ;var f = a.ar(1,0,5,a.ar([0.05,0.04],0,50,160).round(50)) ;var w = a.ar(0.2,0,0.5,a.ar(3,0,0.2,0.5)) ;var o = VarSaw.ar(f,0,w) / 8-;GVerb.ar(o,80)}.play+;GVerb.ar(o,80) * 0.1}.play
gr/f0-tw0033.hs view
@@ -1,7 +1,6 @@ -- www.fredrikolofsson.com/f0blog/?q=node/537 (f0) -import Sound.SC3.ID {- hsc3 -}-import Sound.SC3.UGen.Protect+import Sound.SC3 {- hsc3 -}  f0_0033 :: UGen f0_0033 =@@ -10,7 +9,7 @@         n = uclone 'α' 4 (brownNoise 'α' AR) * a         z i = mce2 (i + 1 * f) (i * f + (i + 1 / 3))         o = lfPar AR (mce (map z [0..3])) 0-    in out 0 (splay ((o >* n) / 3) 1 1 0 True)+    in out 0 (splay ((o >* n) / 3) 1 1 0 True * 0.1)  main :: IO () main = audition f0_0033
gr/f0-tw0033.scd view
@@ -5,4 +5,4 @@ ;var n = BrownNoise.ar(a) ;var z = {|i| [i + 1 * f,i * f + (i + 1 / 3)]} ;var o = LFPar.ar(z ! 4,0)-;Splay.ar((o > n) / 3)}.play+;Splay.ar((o > n) / 3) * 0.1}.play
+ gr/f0-tw0041.hs view
@@ -0,0 +1,15 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/537 (f0)++import Sound.SC3 {- hsc3 -}++f0_tw0041 :: UGen+f0_tw0041 =+    let s = sweep (localIn' 6 AR) 1+        i = impulse AR (mce [1,0.749,6,12,3,4]) 0+        o = sinOsc AR (1 / runningMax s i) 0+    in mrg [tanh (splay o 1 1 0 True) / 2 * 0.1+           ,localOut o]++main :: IO ()+main = audition (out 0 f0_tw0041)+
+ gr/f0-tw0041.scd view
@@ -0,0 +1,7 @@+// http://www.fredrikolofsson.com/f0blog/?q=node/537++{var s = Sweep.ar(LocalIn.ar(6))+;var i = Impulse.ar([1,0.749,6,12,3,4])+;var o = SinOsc.ar(1 / RunningMax.ar(s,i))+;LocalOut.ar(o)+;Splay.ar(o).tanh / 2 * 0.1}.play
gr/f0-tw0045.hs view
@@ -8,7 +8,7 @@         f = a (a 0.11 0 1 0) 0 1 0         p_f = a (95 * a 0.01 0 1 1) 0 (a 5e-3 0 50 0) 100         p = a p_f (a (mce2 98 97) 0 1 0) (pi + a 5e-4 0 1 0) 0-    in out 0 (tanh (a f p 1 0))+    in tanh (a f p 1 0) * 0.1  main :: IO ()-main = audition f0_0045+main = audition (out 0 f0_0045)
gr/f0-tw0045.scd view
@@ -4,4 +4,4 @@ ;var f = a.ar(a.ar(0.11,0,1,0),0,1,0) ;var p_f = a.ar(95*a.ar(0.01,0,1,1),0,a.ar(5e-3,0,50,0),100) ;var p = a.ar(p_f,a.ar([98,97],0,1,0),pi+a.ar(5e-4,0,1,0),0)-;a.ar(f,p,1,0).tanh}.play+;a.ar(f,p,1,0).tanh * 0.1}.play
+ gr/f0-tw0120.hs view
@@ -0,0 +1,16 @@+-- http://sccode.org/1-4Qy (f0)++import Sound.SC3 {- hsc3 -}++f0_tw0120 :: UGen+f0_tw0120 =+    let a = lfTri+        z = a KR (1 / mce2 7 8) 0 * a KR (1 / 9) 0 * 99+        l = midiCPS (mce [60 .. 79])+        f = select z l+        w = a KR (1 / mce2 3 4) 0 `modE` 1+        o = varSaw AR f 0 w+    in combN o 1 (1 / mce2 5 6) 8 / 4++main :: IO ()+main = audition (out 0 f0_tw0120)
+ gr/f0-tw0120.scd view
@@ -0,0 +1,9 @@+//--tweet0120++{var a = LFTri+;var z = a.kr(1/[7,8])*a.kr(1/9,0,99)+;var l = (60..79).midicps+;var f = Select.kr(z,l)+;var w = a.kr(1/[3,4])%1+;var o = VarSaw.ar(f,0,w)+;CombN.ar(o,1,1/[5,6],8)/4}.play
+ gr/f0-tw0121.hs view
@@ -0,0 +1,15 @@+-- http://sccode.org/1-4Qy (f0)++import Sound.SC3 {- hsc3 -}++f0_tw0121 :: UGen+f0_tw0121 =+    let a = sinOsc+        z = a KR (1 / mce2 8 7) 0 * a KR (1 / 30) 0 * 9+        l = midiCPS (mce [56,62 .. 98])+        m = a AR (1 / mce2 4 3) 0+        o = a AR (select z l) 0 * m+    in tanh (combN o 1 (1 / mce2 6 5) 9)++main :: IO ()+main = audition (out 0 f0_tw0121)
+ gr/f0-tw0121.scd view
@@ -0,0 +1,8 @@+//--tweet0121++{var a = SinOsc+;var z = a.kr(1/[8,7]) * a.kr(1/30,0,9)+;var l = (56,62..98).midicps+;var m = a.ar(1/[4,3])+;var o = a.ar(Select.kr(z,l),0,m)+;CombN.ar(o,1,1/[6,5],9).tanh}.play
+ gr/f0-tw0125.hs view
@@ -0,0 +1,16 @@+-- http://sccode.org/1-4Qy (f0)++import Sound.SC3 {- hsc3 -}++f0_tw0125 :: UGen+f0_tw0125 =+    let a = sinOsc AR+        f = a (1 / mce [8,9]) 0 * 4 + mce [400,202]+        u = (a (1/9) 0 + 1) / 88+        d = (a (1/8) 0 + 1) / 99+        i = inFeedback 1 (mce [1,0])+        p = combC (lagUD i u d) 1 0.08 9+    in a f p++main :: IO ()+main = audition (out 0 f0_tw0125)
+ gr/f0-tw0125.scd view
@@ -0,0 +1,8 @@+//--tweet0125+{var a = SinOsc+;var f = a.ar(1/[8,9])*4+[400,202]+;var u = a.ar(1/9)+1/88+;var d = a.ar(1/8)+1/99+;var i = InFeedback.ar([1,0])+;var p = CombC.ar(i.lagud(u,d),1,0.08,9)+;a.ar(f,p)}.play
+ gr/f0-tw0134.hs view
@@ -0,0 +1,23 @@+-- http://sccode.org/1-4Qy (f0)+-- scsynth -u 57110 -w 512++import Sound.SC3 {- hsc3 -}++mean :: Fractional a => [a] -> a+mean l = sum l / fromIntegral (length l)++f0_tw0134 :: UGen+f0_tw0134 =+    let a = lfSaw AR+        n' = 50+        n = constant n'+        z i = let o1 = a ((i + 1) / mce [3,4]) 0+                  o2 = a ((i + 1) / 8) 0 + 1+                  f0 = o1 >* o2 * (n / 2) + n+                  m = a ((i + 1) / n) (i / (n / 2))+                  o3 = blip AR f0 (i + mce [2,3]) * m+              in ringz o3 ((i + 1) * (n * 2 - 1)) 0.1+    in mean (map z [0 .. n'])  / 5++main :: IO ()+main = audition (out 0 f0_tw0134)
+ gr/f0-tw0134.scd view
@@ -0,0 +1,12 @@+//--tweet0134++{var a = LFSaw+;var n = 50+;var z = {arg i+         ;var o1 = a.ar(i + 1 / [3,4])+         ;var o2 = a.ar(i + 1 / 8) + 1+         ;var f0 = o1 > o2 * (n / 2) + n+         ;var m = a.ar(i + 1 / n,i / (n / 2))+         ;var o3 = Blip.ar(f0,i + [2,3]) * m+         ;Ringz.ar(o3,i + 1 * (n * 2 - 1),0.1)}+;mean(z ! n) / 5}.play
+ gr/f0-tw0220.hs view
@@ -0,0 +1,20 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0)++import Sound.SC3 {- hsc3 -}++f0_tw0220 :: UGen+f0_tw0220 =+    let c = inFeedback 1 0+        b = clearBuf (localBuf 'α' 1 90000)+        g = tGrains 2 (sinOsc AR 3 0) b (c + 3) 2 12 0 0.1 4+        r = recordBuf AR b 0 1 0 1 Loop 1 DoNothing c+    in mrg2 (hpf (sinOsc AR 99 (c * 6) / 9 + g) 9) r++main :: IO ()+main = withSC3 (play (out 0 f0_tw0220))++{-+2014-10-11: tgrains needs a patch to work with localbuf+http://article.gmane.org/gmane.comp.audio.supercollider.user/110110+main = withSC3 (async (b_alloc bufnum 90000 1) >> play (out 0 f0_tw0220))+-}
+ gr/f0-tw0220.scd view
@@ -0,0 +1,7 @@+// http://www.fredrikolofsson.com/f0blog/?q=node/617++{var c = InFeedback.ar(0,1)+;var b = LocalBuf(90000).clear+;var g = TGrains.ar(2,SinOsc.ar(3,0),b,c + 3,2,12)+;RecordBuf.ar(c,b)+;HPF.ar(SinOsc.ar(99,c * 6) / 9 + g,9)}.play
+ gr/f0-tw0224.hs view
@@ -0,0 +1,14 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0)++import Sound.SC3 {- hsc3 -}++f0_tw0224 :: UGen+f0_tw0224 =+    let c = 200000+        b = clearBuf (localBuf 'α' 2 c)+        d = bufRd 2 AR b (sinOsc AR (mce2 2 3 * 9) 0 * c) NoLoop LinearInterpolation+        w = bufWr b (abs (sinOsc AR (mce2 99 145) 0) * c) Loop (sinOsc AR (3 / mce2 2 3) 0 / 3)+    in mrg2 d w++main :: IO ()+main = audition (out 0 f0_tw0224)
+ gr/f0-tw0224.scd view
@@ -0,0 +1,7 @@+// http://www.fredrikolofsson.com/f0blog/?q=node/617++{var c = 200000+;var b = LocalBuf(c,2).clear /* ClearBuf(LocalBuf(c,2)) */+;var d = BufRd.ar(2,b,SinOsc.ar([2,3] * 9) * c,0)+;BufWr.ar(SinOsc.ar(3 / [2,3]) / 3,b,SinOsc.ar([99,145]).abs * c)+;d}.draw
+ gr/f0-tw0225.hs view
@@ -0,0 +1,12 @@+-- http://www.fredrikolofsson.com/f0blog/?q=node/617 (f0)++import Sound.SC3 {- hsc3 -}++f0_tw0225 :: UGen+f0_tw0225 =+    let b = mce [1..8] * 99+        o = blip AR (b / 2 + lfSaw KR ((-8) / b) 1 * 99) (b / 4 + (lfSaw KR (1 / b) 1 * 99))+    in sin (splay (combN (o * sinOsc AR (8 / b) (lfSaw AR (99 / b) 0)) 0.2 0.2 1) 1 1 0 True)++main :: IO ()+main = audition (out 0 f0_tw0225)
+ gr/f0-tw0225.scd view
@@ -0,0 +1,5 @@+// http://www.fredrikolofsson.com/f0blog/?q=node/617++{var b = (1..8) * 99+;var o = Blip.ar(b / 2 + LFSaw.kr(-8 / b,1,99),b / 4 + LFSaw.kr(1 / b,1,99))+;Splay.ar(CombN.ar(o * SinOsc.ar(8 / b,LFSaw.ar(99 / b)))).sin}.play
gr/fb-090531.hs view

file too large to diff

gr/fbl-fbf.hs view

file too large to diff

gr/feedr-m.hs view

file too large to diff

+ gr/filter-input.hs view

file too large to diff

+ gr/filter-input.scd view

file too large to diff

gr/fm-iter.hs view

file too large to diff

gr/fm-kltr-m.hs view

file too large to diff

gr/fm-kltr-p.hs view

file too large to diff

gr/for-ann.scd view

file too large to diff

gr/forest-sounds-m.hs view

file too large to diff

gr/forest-sounds.scd view

file too large to diff

gr/fwalk-m.hs view

file too large to diff

+ gr/griot.scd view

file too large to diff

gr/h-chatter-m.hs view

file too large to diff

gr/h-chatter.scd view

file too large to diff

gr/half-life.hs view

file too large to diff

gr/half-life.scd view

file too large to diff

gr/hansm.hs view

file too large to diff

+ gr/hard-sync-sawtooth-with-lfo.hs view

file too large to diff

+ gr/hard-sync-sawtooth-with-lfo.scd view

file too large to diff

gr/harmonic-swimming-m.hs view

file too large to diff

gr/harmonic-swimming.hs view

file too large to diff

gr/harmonic-swimming.scd view

file too large to diff

gr/harmonic-tumbling-m.hs view

file too large to diff

+ gr/harmonic-tumbling.hs view

file too large to diff

gr/harmonic-tumbling.scd view

file too large to diff

gr/hell-is-busy.hs view

file too large to diff

gr/hell-is-busy.scd view

file too large to diff

gr/implosion-m.hs view

file too large to diff

+ gr/impulse-sequencer.hs view

file too large to diff

+ gr/impulse-sequencer.scd view

file too large to diff

gr/insects-m.hs view

file too large to diff

+ gr/jr-100515.hs view

file too large to diff

gr/k-ppr-m.hs view

file too large to diff

gr/k-ppr.hs view

file too large to diff

gr/k-ppr.scd view

file too large to diff

gr/k2ws-hp.hs view

file too large to diff

gr/k2ws.hs view

file too large to diff

gr/k2ws.scd view

file too large to diff

gr/kabelscahden.hs view

file too large to diff

gr/karplus-strong.hs view

file too large to diff

gr/klink.hs view

file too large to diff

gr/klink.scd view

file too large to diff

+ gr/landon-rose.hs view

file too large to diff

+ gr/landon-rose.scd view

file too large to diff

gr/laser-bubble.hs view

file too large to diff

gr/lf-pulses.hs view

file too large to diff

gr/lf-pulses.scd view

file too large to diff

gr/lfo-modulation.hs view

file too large to diff

gr/lfo-modulation.scd view

file too large to diff

gr/lg-timed-m.hs view

file too large to diff

gr/lg-timed.scd view

file too large to diff

+ gr/lots-o-sines.scd view

file too large to diff

+ gr/lp.hs view

file too large to diff

+ gr/lp.scd view

file too large to diff

gr/lso-061101-m.hs view

file too large to diff

gr/lucier.hs view

file too large to diff

gr/lucier.scd view

file too large to diff

+ gr/lz-bf.hs view

file too large to diff

gr/m21360.hs view

file too large to diff

gr/m21360.scd view

file too large to diff

+ gr/metal-plate.hs view

file too large to diff

+ gr/metal-plate.scd view

file too large to diff

gr/microhelix.hs view

file too large to diff

+ gr/modal-space-buf.hs view

file too large to diff

+ gr/modal-space-buf.scd view

file too large to diff

gr/modal-space.hs view

file too large to diff

gr/modal-space.scd view

file too large to diff

gr/moto-rev.hs view

file too large to diff

gr/moto-rev.scd view

file too large to diff

gr/mouse-clatter-m.hs view

file too large to diff

gr/mouse-clatter.scd view

file too large to diff

+ gr/mouse.hs view

file too large to diff

+ gr/mouse.scd view

file too large to diff

+ gr/mridangam-dr.hs view

file too large to diff

gr/mridangam.hs view

file too large to diff

+ gr/mridangam.scd view

file too large to diff

gr/music-box.hs view

file too large to diff

+ gr/narrow-band-filtered-crackle-noise.hs view

file too large to diff

+ gr/narrow-band-filtered-crackle-noise.scd view

file too large to diff

gr/nharm-m.hs view

file too large to diff

gr/nharm-p.hs view

file too large to diff

gr/noise-burst-sweep.hs view

file too large to diff

gr/noise-burst-sweep.scd view

file too large to diff

+ gr/noise-modulated-sawtooths.hs view

file too large to diff

+ gr/noise-modulated-sawtooths.scd view

file too large to diff

gr/noise-modulated-sines.hs view

file too large to diff

+ gr/noise-modulated-sines.scd view

file too large to diff

gr/nokia.hs view

file too large to diff

+ gr/nv-ml-2014-06-03.hs view

file too large to diff

+ gr/nv-ml-2014-06-03.scd view

file too large to diff

gr/nv-tw-1.hs view

file too large to diff

+ gr/nv-tw-2013-01-11.hs view

file too large to diff

+ gr/nv-tw-2013-01-11.scd view

file too large to diff

+ gr/nv-tw-2013-10-08.scd view

file too large to diff

+ gr/nv-tw-2013-12-04.hs view

file too large to diff

+ gr/nv-tw-2013-12-04.scd view

file too large to diff

+ gr/nv-tw-2014-02-21.hs view

file too large to diff

+ gr/nv-tw-2014-02-21.scd view

file too large to diff

+ gr/nv-tw-2014-06-03.hs view

file too large to diff

+ gr/nv-tw-2014-06-03.scd view

file too large to diff

gr/nv-tw-41.hs view

file too large to diff

gr/nv-tw-54.hs view

file too large to diff

gr/nx102.hs view

file too large to diff

gr/one-line.scd view

file too large to diff

gr/oscillator-cluster-m.hs view

file too large to diff

gr/oscillator-cluster.scd view

file too large to diff

gr/overlap-add.hs view

file too large to diff

+ gr/overlap-texture.scd view

file too large to diff

gr/pattern-buffer-m.hs view

file too large to diff

gr/pebble-beach.hs view

file too large to diff

+ gr/phase-modulation.hs view

file too large to diff

+ gr/phase-modulation.scd view

file too large to diff

+ gr/pkt-00.hs view

file too large to diff

+ gr/pkt-07.hs view

file too large to diff

gr/plucked-strings-m.hs view

file too large to diff

+ gr/plucked-strings.scd view

file too large to diff

+ gr/pm-crotale.scd view

file too large to diff

gr/police-state-m.hs view

file too large to diff

gr/police-state.hs view

file too large to diff

gr/police-state.scd view

file too large to diff

+ gr/pond-life-ha.hs view

file too large to diff

gr/pond-life-hp.hs view

file too large to diff

gr/pond-life.hs view

file too large to diff

gr/pond-life.scd view

file too large to diff

gr/proxy-mixer-m.hs view

file too large to diff

gr/proxy-mixer.hs view

file too large to diff

gr/pulsing-bottles-m.hs view

file too large to diff

gr/pulsing-bottles.hs view

file too large to diff

+ gr/pulsing-bottles.scd view

file too large to diff

gr/pwm-crossfade.hs view

file too large to diff

gr/rails.hs view

file too large to diff

gr/rails.scd view

file too large to diff

gr/rain-thunder.hs view

file too large to diff

gr/random-panning-sines-m.hs view

file too large to diff

gr/random-panning-sines.hs view

file too large to diff

+ gr/random-panning-sines.scd view

file too large to diff

gr/random-pulsations.hs view

file too large to diff

+ gr/random-pulsations.scd view

file too large to diff

gr/random-sine-waves-hp.hs view

file too large to diff

gr/random-sine-waves-she.hs view

file too large to diff

gr/random-sine-waves.hs view

file too large to diff

gr/random-sine-waves.scd view

file too large to diff

gr/record-scratcher.scd view

file too large to diff

gr/red-frik-m.hs view

file too large to diff

gr/red-frik.scd view

file too large to diff

+ gr/reso-pulse.hs view

file too large to diff

+ gr/reso-pulse.scd view

file too large to diff

gr/resonant-dust-hp.hs view

file too large to diff

gr/resonant-dust.hs view

file too large to diff

+ gr/resonant-dust.scd view

file too large to diff

+ gr/resonators-harmonic-series.hs view

file too large to diff

+ gr/resonators-harmonic-series.scd view

file too large to diff

+ gr/reverberated-noise-bursts.hs view

file too large to diff

+ gr/reverberated-noise-bursts.scd view

file too large to diff

gr/reverberated-sine-percussion-hp.hs view

file too large to diff

gr/reverberated-sine-percussion-m.hs view

file too large to diff

gr/reverberated-sine-percussion.scd view

file too large to diff

+ gr/ring-modulate-input.hs view

file too large to diff

+ gr/ring-modulate-input.scd view

file too large to diff

gr/ring-modulated-klank.hs view

file too large to diff

+ gr/ring-modulated-klank.scd view

file too large to diff

gr/rm-octaver.hs view

file too large to diff

gr/rzblp-hp.hs view

file too large to diff

gr/rzblp-m.hs view

file too large to diff

gr/rzblp-u.hs view

file too large to diff

gr/rzblp.hs view

file too large to diff

gr/s-chirp.hs view

file too large to diff

gr/sam-i-am.hs view

file too large to diff

gr/sample-and-hold-liquidities.hs view

file too large to diff

gr/sample-and-hold-liquidities.scd view

file too large to diff

gr/saucer-base.hs view

file too large to diff

+ gr/saucer-base.scd view

file too large to diff

gr/sawed-cymbals.hs view

file too large to diff

+ gr/sawed-cymbals.scd view

file too large to diff

gr/scratchy-m.hs view

file too large to diff

gr/scratchy.hs view

file too large to diff

gr/scratchy.scd view

file too large to diff

gr/scritto-m.hs view

file too large to diff

gr/scritto.hs view

file too large to diff

+ gr/seqr-n.hs view

file too large to diff

gr/seqr.hs view

file too large to diff

gr/shepard-tones.scd view

file too large to diff

gr/shifting-pulses-m.hs view

file too large to diff

gr/shifting-pulses.scd view

file too large to diff

gr/sidereal-time-hp.hs view

file too large to diff

gr/sidereal-time.hs view

file too large to diff

gr/sidereal-time.scd view

file too large to diff

gr/sinusdeklinationen.hs view

file too large to diff

gr/slow-beating-harmonic-sines.hs view

file too large to diff

+ gr/slow-beating-harmonic-sines.scd view

file too large to diff

gr/slow-beating-sines.hs view

file too large to diff

+ gr/slow-beating-sines.scd view

file too large to diff

gr/snare-909.hs view

file too large to diff

gr/snare-909.scd view

file too large to diff

gr/sosc-lp-m.hs view

file too large to diff

gr/spe-m.hs view

file too large to diff

gr/spe-p.hs view

file too large to diff

+ gr/spe.scd view

file too large to diff

gr/sprinkler-m.hs view

file too large to diff

+ gr/sprinkler-mouse.scd view

file too large to diff

gr/sprinkler.hs view

file too large to diff

gr/sprinkler.scd view

file too large to diff

gr/string-wander-cluster.hs view

file too large to diff

+ gr/string-wander-cluster.scd view

file too large to diff

gr/strummable-guitar.hs view

file too large to diff

gr/strummable-guitar.scd view

file too large to diff

gr/sweepy-noise.hs view

file too large to diff

gr/sweepy-noise.scd view

file too large to diff

+ gr/swept-resonant-noise.hs view

file too large to diff

+ gr/swept-resonant-noise.scd view

file too large to diff

gr/synthetic-piano-m.hs view

file too large to diff

gr/synthetic-piano.scd view

file too large to diff

gr/tank-hp.hs view

file too large to diff

gr/tank-m.hs view

file too large to diff

gr/tank.hs view

file too large to diff

gr/tank.scd view

file too large to diff

+ gr/tapping-tools.hs view

file too large to diff

+ gr/tapping-tools.scd view

file too large to diff

gr/tgb-m.hs view

file too large to diff

gr/tgr-rpr-m.hs view

file too large to diff

gr/tgrn.hs view

file too large to diff

gr/thb.hs view

file too large to diff

gr/theremin.scd view

file too large to diff

gr/three-cpsw-m.hs view

file too large to diff

+ gr/three-cpsw.hs view

file too large to diff

gr/three-cpsw.scd view

file too large to diff

gr/tipnso.hs view

file too large to diff

gr/tr-out-m.hs view

file too large to diff

gr/train.hs view

file too large to diff

gr/tremulate-hp.hs view

file too large to diff

gr/tremulate-m.hs view

file too large to diff

gr/tremulate.hs view

file too large to diff

gr/tremulate.scd view

file too large to diff

gr/trkl-m.hs view

file too large to diff

gr/trmlo-u.hs view

file too large to diff

gr/trmlo.hs view

file too large to diff

gr/tsort.hs view

file too large to diff

+ gr/tw-463992770596577280.hs view

file too large to diff

+ gr/tw-463992770596577280.scd view

file too large to diff

+ gr/tw-98315246548172800.hs view

file too large to diff

+ gr/tw-98315246548172800.scd view

file too large to diff

file too large to diff

gr/uplink.hs view

file too large to diff

+ gr/uplink.scd view

file too large to diff

gr/urandom.hs view

file too large to diff

gr/vla-addtn-sharc.hs view

file too large to diff

gr/vla-addtn.hs view

file too large to diff

gr/vlc-distrtn-m.hs view

file too large to diff

gr/voscil-u.hs view

file too large to diff

gr/voscil.hs view

file too large to diff

gr/waveset.hs view

file too large to diff

gr/what-was-i-thinking-m.hs view

file too large to diff

gr/what-was-i-thinking.scd view

file too large to diff

gr/why-supercollider.hs view

file too large to diff

gr/why-supercollider.scd view

file too large to diff

gr/wial-m.hs view

file too large to diff

gr/wind-metals-m.hs view

file too large to diff

gr/wind-metals.scd view

file too large to diff

gr/xy-interference-m.hs view

file too large to diff

gr/xy-interference.hs view

file too large to diff

gr/xy-interference.scd view

file too large to diff

+ gr/zizle-hp.hs view

file too large to diff

+ gr/zizle.hs view

file too large to diff

+ gr/zizle.scd view

file too large to diff

hs/hsc3-graphs.hs view

file too large to diff

+ hs/jmcc.hs view

file too large to diff

hs/mk-ix.hs view

file too large to diff

hsc3-graphs.cabal view

file too large to diff

sh/mk-html.sh view

file too large to diff

sh/mk-packages.sh view

file too large to diff

sh/mk-svg.sh view

file too large to diff

+ sh/print-fs.sh view

file too large to diff

+ sh/scd-to-html.sh view

file too large to diff

+ sh/scm-to-html.sh view

file too large to diff

sh/statistics.sh view

file too large to diff