hsc3-process-0.2.1: Create and control scsynth processes



This module includes utilities for spawning an external scsynth process, either for realtime or non-realtime execution.



class OpenTransport t whereSource

Helper class for polymorphic opening of network connections.


openTransport :: RTOptions -> String -> IO tSource

Open a transport to scsynth based on the given RTOptions and a hostname.

data OutputHandler Source

Handle output of external scsynth processes.




onPutString :: String -> IO ()

Handle one line of normal output

onPutError :: String -> IO ()

Handle one line of error output

defaultOutputHandler :: OutputHandlerSource

Default IO handler, writing to stdout and stderr, respectively.

withSynth :: (Transport t, OpenTransport t) => ServerOptions -> RTOptions -> OutputHandler -> (t -> IO a) -> IO aSource

Execute a realtime instance of scsynth with Transport t.

The spawned scsynth is sent a /quit message after the supplied action returns.

NOTE: When compiling executables with GHC, the -threaded option should be passed, otherwise the I/O handlers will not work correctly.

withNRT :: ServerOptions -> NRTOptions -> OutputHandler -> (Handle -> IO a) -> IO aSource

Execute a non-realtime instance of scsynth and return ExitCode when the process exists.