packages feed

hsc3-graphs-0.15: Sound/SC3/Graph/JMCC_clustered_sines_m.hs

-- clustered sines (jmcc) #2
module Sound.SC3.Graph.JMCC_clustered_sines_m where

import Control.Monad {- base -}
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 <- randM 100 1100
  let f2 = 4 * f1
  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))

main :: IO ()
main = xfadeTextureU (4,4,maxBound) =<< clone 2 cs