A 20/12/2012, às 13:03, Stefan Kersten escreveu:
> I am happy to announce the release of version 0.8 of hsc3-process [1] and
> version 0.5 of hsc3-server [2], both providing additional features and
> abstractions for the excellent hsc3 interface [3] to the SuperCollider
> synthesis server [4].
> * A `Server' monad for accessing synthesis server state from concurrent
> threads,
Hi Stefan,
This is great news !! I’ve been using a bit v0.5 of hsc3-server and
hsc3-process and it’s very nice indeed !
I leave an example of running an interactive session in emacs using haskell
mode haskell-hsc3 mode from hsc3:
import qualified Streamero.MonadServer as MS
import qualified Sound.SC3.Server.State.Monad
import Sound.SC3.Server.State.Monad.Command
import Sound.SC3.Server.State.Monad.Process
import Sound.SC3.UGen
--Start up system
engine <- MS.new withDefaultSynth
let send a = MS.execute engine $ exec_ a
r <- MS.execute engine rootNode
let sine = (out 0 (sinOsc AR (control KR "freq" 400) 0 * 0.1))
-- select and run with c-c c-e
synth <- send $ do {
sd <- d_recv "hsc3-server:sine" sine;
s_new sd AddToTail r [("freq", 440), ("amp", 0.2)];
}
send $ n_set synth [ ("freq", 200)]
send $ n_free synth
Writing long functions or expressions in emacs to be run in ghci is a bit
difficult because you can’t use the normal indentation rules (at least I
haven’t figured out how), so one possibility would be to just write those
functions in a .hs file and load the file to ghci, but every time one does that
the previous bindings are destroyed and loose access to the server that we
booted, and any resources on it, so that doesn’t work for interaction with a sc
server via hsc3-server. Does anyone have any tips about this ? Is it possible
somehow to load a file to ghci and keep the bindings or is there a way to write
haskell code with indentation based expression boundaries and evaluate that in
ghci ?
best,
Miguel
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art