packages feed

hsc3-utils 0.14 → 0.15

raw patch · 5 files changed

+91/−8 lines, 5 filesdep +directorydep +filepathdep +hashabledep ~hsc3-rwnew-component:exe:hsc3-hash-atnew-component:exe:hsc3-scsyndef-to-dot

Dependencies added: directory, filepath, hashable, hosc, hsc3, hsc3-dot, hsc3-sf, process

Dependency ranges changed: hsc3-rw

Files

README view
@@ -3,6 +3,8 @@  [hsc3][hsc3] related utility programs. +### hash-paren+ `hash-paren` is a simple minded [haskell][hs] pre-processor that extends the haskell `do` syntax by rewriting `#` parenthesised elements of a right hand side expression as monadic bindings.  Ie.@@ -22,7 +24,7 @@ [hsc3]: http://rd.slavepianos.org/?t=hsc3 [hs]: http://haskell.org/ -© [rohan drape][rd], 2013, [gpl][gpl].+© [rohan drape][rd], 2013-2014, [gpl][gpl].  [rd]: http://rd.slavepianos.org/ [gpl]: http://gnu.org/copyleft/
+ Sound/SC3/Server/Buffer/Send.hs view
@@ -0,0 +1,20 @@+module Sound.SC3.Server.Buffer.Send where++import Data.Hashable {- hashable -}+import System.Directory {- directory -}+import System.FilePath {- filepath -}++import qualified Sound.File.NeXT as F {- hsc3-sf -}+import Sound.OSC {- hosc -}+import Sound.SC3 {- hsc3 -}++-- | Message to send data to scsynth via temporary audio file.+b_tmp_allocRead :: (Hashable n,Floating n,Real n) => Int -> [n] -> IO Message+b_tmp_allocRead nid d = do+  tmp <- getTemporaryDirectory+  let nc = 1+      sr = 1+      h = F.Header (length d) F.Float sr nc+      nm = tmp </> show (hash d) <.> "au"+  F.write nm h [d]+  return (b_allocRead nid nm 0 0)
+ hs/hash-at.hs view
@@ -0,0 +1,4 @@+import Sound.SC3.RW.HA {- hsc3-rw -}++main :: IO ()+main = ha_rewrite_ghcF
+ hs/scsyndef-to-dot.hs view
@@ -0,0 +1,29 @@+import Control.Monad {- base -}+import System.Environment {- base -}+import System.FilePath {- filepath -}+import System.Process {- process -}++import qualified Sound.SC3.Server.Graphdef as R {- hsc3 -}+import qualified Sound.SC3.Server.Graphdef.Read as R {- hsc3 -}++import Sound.SC3.UGen.Dot {- hsc3-dot -}+import qualified Sound.SC3.UGen.Dot.Internal as D++scsyndef_to_dot :: Bool -> FilePath -> IO ()+scsyndef_to_dot opt sy_nm = do+  gr <- R.read_graphdef_file sy_nm+  let dot_nm = replaceExtension sy_nm "dot"+      svg_nm = replaceExtension sy_nm "svg"+      (_,gr') = R.graphdef_to_graph gr+      dr = D.dotGraph svg_options gr'+  writeFile dot_nm dr+  when opt (void (rawSystem "dot" ["-T","svg",dot_nm,"-o",svg_nm]))+  return ()++main :: IO ()+main = do+  arg <- getArgs+  case arg of+    [] -> putStrLn "scsyndef-to-dot [-svg] file..."+    "-svg":nm -> mapM_ (scsyndef_to_dot True) nm+    nm -> mapM_ (scsyndef_to_dot False) nm
hsc3-utils.cabal view
@@ -1,39 +1,67 @@ Name:              hsc3-utils-Version:           0.14+Version:           0.15 Synopsis:          Haskell SuperCollider Utilities Description:       Haskell SuperCollider Utilities License:           GPL Category:          Sound-Copyright:         (c) Rohan Drape, 2013+Copyright:         (c) Rohan Drape, 2013-2014 Author:            Rohan Drape Maintainer:        rd@slavepianos.org Stability:         Experimental-Homepage:          http://rd.slavepianos.org/?t=hsc3-utils-Tested-With:       GHC == 7.6.1+Homepage:          http://rd.slavepianos.org/t/hsc3-utils+Tested-With:       GHC == 7.8.2 Build-Type:        Simple Cabal-Version:     >= 1.8  Data-files:        README +Library+  Build-Depends:   base == 4.*,+                   directory,+                   filepath,+                   hashable,+                   hosc == 0.15.*,+                   hsc3 == 0.15.*,+                   hsc3-sf == 0.15.*+  GHC-Options:     -Wall -fwarn-tabs+  Exposed-modules: Sound.SC3.Server.Buffer.Send++executable hsc3-hash-at+  build-depends:   base == 4.*,+                   hsc3-rw == 0.15.*+  hs-source-dirs:  hs+  main-is:         hash-at.hs+  ghc-options:     -Wall -fwarn-tabs+ executable hsc3-hash-paren   build-depends:   base == 4.*,-                   hsc3-rw == 0.14.*+                   hsc3-rw == 0.15.*   hs-source-dirs:  hs   main-is:         hash-paren.hs   ghc-options:     -Wall -fwarn-tabs  executable hsc3-id-rewrite   build-depends:   base == 4.*,-                   hsc3-rw == 0.14.*+                   hsc3-rw == 0.15.*   hs-source-dirs:  hs   main-is:         id-rewrite.hs   ghc-options:     -Wall -fwarn-tabs  executable hsc3-id-clear   build-depends:   base == 4.*,-                   hsc3-rw == 0.14.*+                   hsc3-rw == 0.15.*   hs-source-dirs:  hs   main-is:         id-clear.hs+  ghc-options:     -Wall -fwarn-tabs++executable hsc3-scsyndef-to-dot+  build-depends:   base == 4.*,+                   filepath,+                   hsc3-dot == 0.15.*,+                   hsc3 == 0.15.*,+                   process+  hs-source-dirs:  hs+  main-is:         scsyndef-to-dot.hs   ghc-options:     -Wall -fwarn-tabs  Source-Repository  head