hsc3-process-0.5.1: Create and control scsynth processes

Safe HaskellNone

Sound.SC3.Server.Process

Description

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

Synopsis

Documentation

data OutputHandler Source

Handle output of external scsynth processes.

Constructors

OutputHandler 

Fields

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.

withTransport :: Transport t => (ServerOptions -> RTOptions -> IO t) -> ServerOptions -> RTOptions -> (t -> IO a) -> IO aSource

withSynth :: Transport t => (ServerOptions -> RTOptions -> IO 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.