hsc3-process-0.9.0: 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, and for connecting to existing processes.

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.

data NetworkTransport Source

Network transport wrapper.

withTransportSource

Arguments

:: ServerOptions

General server options

-> RTOptions

Realtime server options

-> Maybe String

Host to connect to (defaults to localhost)

-> (NetworkTransport -> IO a)

Action to execute with the transport

-> IO a

Action result

Open a transport to a running scsynth process determined by networkPort.

withSynthSource

Arguments

:: ServerOptions

General server options

-> RTOptions

Realtime server options

-> OutputHandler

Output handler

-> (NetworkTransport -> IO a)

Action to execute with the transport

-> IO a

Action result

Execute a realtime instance of scsynth with Transport t.

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

GHC Note: in order to call withSynth without blocking all the other threads in the system, you must compile the program with -threaded.

runNRTSource

Arguments

:: ServerOptions

General server options

-> NRTOptions

Non-realtime server options

-> OutputHandler

Output handler

-> FilePath

NRT score file path

-> IO () 

Render a NRT score by executing an instance of scsynth.

Since 0.8.0

withNRTSource

Arguments

:: ServerOptions

General server options

-> NRTOptions

Non-realtime server options

-> OutputHandler

Output handler

-> (Handle -> IO a)

Action

-> IO a

Action result

Execute a non-realtime instance of scsynth and pass the process' input handle to Action and return the result.

GHC Note: in order to call withNRT without blocking all the other threads in the system, you must compile the program with -threaded.

Since 0.8.0