hsc3-unsafe 0.6 → 0.7
raw patch · 9 files changed
+127/−10 lines, 9 filesdep ~basedep ~hsc3PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, hsc3
API changes (from Hackage documentation)
+ Sound.SC3.UGen.Unsafe.Lift: liftP :: (a -> IO UGen) -> (a -> UGen)
+ Sound.SC3.UGen.Unsafe.Lift: liftP2 :: (a -> b -> IO UGen) -> (a -> b -> UGen)
+ Sound.SC3.UGen.Unsafe.Lift: liftP3 :: (a -> b -> c -> IO UGen) -> (a -> b -> c -> UGen)
+ Sound.SC3.UGen.Unsafe.Lift: liftP4 :: (a -> b -> c -> d -> IO UGen) -> (a -> b -> c -> d -> UGen)
Files
- Help/Graphs/rzblp.lhs +22/−0
- Help/Graphs/trmlo.lhs +40/−0
- Help/Graphs/voscil.lhs +30/−0
- README +2/−2
- Sound/SC3/UGen/Demand/Unsafe.hs +1/−1
- Sound/SC3/UGen/FFT/Unsafe.hs +1/−1
- Sound/SC3/UGen/Noise/Unsafe.hs +1/−1
- Sound/SC3/UGen/Unsafe/Lift.hs +20/−0
- hsc3-unsafe.cabal +10/−5
+ Help/Graphs/rzblp.lhs view
@@ -0,0 +1,22 @@+rzblp (rd)++> import Sound.SC3+> import qualified Sound.SC3.UGen.Unsafe as U++> let { wrp i l r = let m = (r - l) / 2+> in i * m + l + m+> ; lfn f l r = wrp (U.lfNoise0 kr f) l r+> ; hpb q = mixFill 2 (\_ -> let { f = lfn q 1330 1395+> ; a = lfn q 0.001 0.007 }+> in blip ar f 24 * a)+> ; mk_f d = let { q = lfn 5.2 5.2 5.21+> ; a = d dinf (mce [1, 3, 2, 7, 8])+> ; tr = impulse kr q 0+> ; freq = demand tr 0 a * 30 + 340 }+> in sum [ blip ar freq 3 * lfn q 0.001 0.01+> , resonz (impulse ar q (mce2 0 0))+> (lfn 5 30 640)+> (lfn q 0.1 0.5) * lfn q 0.01 1.8+> , hpb q * lfn q 1.2 1.8+> , blip ar (lfn q 16 36) 3 * mce2 0.03 0.09 ] }+> in audition (out 0 (mk_f U.drand + mk_f U.dxrand))
+ Help/Graphs/trmlo.lhs view
@@ -0,0 +1,40 @@+trmlo (rd)++> import Sound.SC3+> import qualified Sound.SC3.UGen.Unsafe as U++> let { mWrp i l r = linLin i (-1) 1 (midiCPS l) (midiCPS r)+> ; mWrp1 i m = mWrp i m (m + 1)+> ; mWrpN i m n = mWrp i m (m + n)+> ; o1 = let { f = 5+> ; d = 3+> ; s = envSine d 0.1+> ; e = envGen kr 1 1 0 1 DoNothing s+> ; n = 65+> ; m = sinOsc kr f 0 }+> in pan2 (sinOsc ar (mWrp1 m n) 0) m e+> ; 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 = U.iRand 69 72+> ; m = sinOsc kr f 0 }+> in pan2 (sinOsc ar (mWrp1 m n) 0) m e+> ; 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 = U.iRand 69 72+> ; m = sinOsc kr f 0+> ; l = line kr 0 (U.iRand 1 5) d DoNothing }+> in pan2 (blip ar (mWrp1 m (n + l)) (linLin m (-1) 1 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 = U.iRand 69 72+> ; m = sinOsc kr f 0+> ; 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 m (-1) 1 1 (U.iRand 2 24))) m e }+> in audition (out 0 (o1 + o2 + o3 + o4))
+ Help/Graphs/voscil.lhs view
@@ -0,0 +1,30 @@+voscil (rd)++> import Sound.SC3+> import qualified Sound.SC3.UGen.Unsafe as U+> import System.Random++> let { rrand l r = getStdRandom (randomR (l, r))+> ; lfn r = U.lfNoise0 kr r+> ; b = 32+> ; hb = (constant b - 1) / 2+> ; bn = 8192 * 4+> ; rt = 6+> ; f = 600+> ; s = let { v = vOsc ar (lfn rt * hb + hb) (f * 2) 0+> ; o = let { bf = lfn rt * 40 + 600+> ; nh = lfn rt * 16 + 24 }+> in blip ar bf nh * (lfn rt * 0.1 + 0.1)+> ; p = pan2 (v + o) (lfn rt) (lfn rt * 0.5 + 0.5)+> ; w = vOsc ar (lfSaw kr (1 / rt) 0 * hb + hb) f 0+> ; q = pan2 w (lfn rt) (lfn rt * 0.5 + 0.5) }+> in p + q+> ; run fd = let r_set i = +> do { m <- rrand 2 512+> ; j <- sequence (replicate m (rrand 0 bn))+> ; k <- sequence (replicate m (rrand (-1) 1))+> ; async fd (b_alloc i bn 1)+> ; send fd (b_set i (zip j k)) }+> in do { mapM_ r_set [0 .. (b - 1)]+> ; play fd (out 0 s) } }+> in withSC3 run
README view
@@ -1,10 +1,10 @@ hsc3-unsafe - haskell supercollider -hsc3 provides Sound.SC3.UGen.Unsafe. +hsc3-unsafe provides Sound.SC3.UGen.Unsafe. http://slavepianos.org/rd/f/207949/ http://haskell.org/ http://audiosynth.com/ -(c) rohan drape, 2006-2008+(c) rohan drape, 2006-2009 gpl, http://gnu.org/copyleft/
Sound/SC3/UGen/Demand/Unsafe.hs view
@@ -1,7 +1,7 @@ module Sound.SC3.UGen.Demand.Unsafe where import Sound.SC3.UGen.UGen-import Sound.SC3.UGen.UGen.Lift+import Sound.SC3.UGen.Unsafe.Lift import qualified Sound.SC3.UGen.Demand.Monadic as D import Sound.SC3.UGen.Enum
Sound/SC3/UGen/FFT/Unsafe.hs view
@@ -1,7 +1,7 @@ module Sound.SC3.UGen.FFT.Unsafe where import Sound.SC3.UGen.UGen-import Sound.SC3.UGen.UGen.Lift+import Sound.SC3.UGen.Unsafe.Lift import qualified Sound.SC3.UGen.FFT.Monadic as F -- | Randomize order of bins.
Sound/SC3/UGen/Noise/Unsafe.hs view
@@ -2,7 +2,7 @@ import Sound.SC3.UGen.Rate import Sound.SC3.UGen.UGen-import Sound.SC3.UGen.UGen.Lift+import Sound.SC3.UGen.Unsafe.Lift import qualified Sound.SC3.UGen.Noise.Monadic as N -- | Brown noise.
+ Sound/SC3/UGen/Unsafe/Lift.hs view
@@ -0,0 +1,20 @@+module Sound.SC3.UGen.Unsafe.Lift where++import Sound.SC3.UGen.UGen+import System.IO.Unsafe++-- | Lift monadic UGen to unsafe form.+liftP :: (a -> IO UGen) -> (a -> UGen)+liftP f = unsafePerformIO . f++-- | Lift monadic UGen to unsafe form.+liftP2 :: (a -> b -> IO UGen) -> (a -> b -> UGen)+liftP2 f a = unsafePerformIO . f a++-- | Lift monadic UGen to unsafe form.+liftP3 :: (a -> b -> c -> IO UGen) -> (a -> b -> c -> UGen)+liftP3 f a b = unsafePerformIO . f a b++-- | Lift monadic UGen to unsafe form.+liftP4 :: (a -> b -> c -> d -> IO UGen) -> (a -> b -> c -> d -> UGen)+liftP4 f a b c = unsafePerformIO . f a b c
hsc3-unsafe.cabal view
@@ -1,24 +1,29 @@ Name: hsc3-unsafe-Version: 0.6+Version: 0.7 Synopsis: Unsafe Haskell SuperCollider Description: hsc3 provides Sound.SC3.UGen.Unsafe. License: GPL Category: Sound-Copyright: (c) Rohan Drape, 2006-2008+Copyright: (c) Rohan Drape, 2006-2009 Author: Rohan Drape Maintainer: rd@slavepianos.org Stability: Experimental Homepage: http://slavepianos.org/rd/f/382071/-Tested-With: GHC==6.10.1+Tested-With: GHC == 6.8.2 Build-Type: Simple-Cabal-Version: >= 1.2+Cabal-Version: >= 1.6 Data-files: README+ Help/Graphs/rzblp.lhs+ Help/Graphs/trmlo.lhs+ Help/Graphs/voscil.lhs Library- Build-Depends: base, hsc3 == 0.6+ Build-Depends: base == 3.*,+ hsc3 == 0.7 GHC-Options: -Wall -fwarn-tabs Exposed-modules: Sound.SC3.UGen.Demand.Unsafe Sound.SC3.UGen.FFT.Unsafe Sound.SC3.UGen.Noise.Unsafe Sound.SC3.UGen.Unsafe+ Sound.SC3.UGen.Unsafe.Lift