hsc3-0.12: Haskell SuperCollider

Safe HaskellNone

Sound.SC3.Server.Transport.Monad

Contents

Description

Monad variant of interaction with the scsynth server.

Synopsis

hosc variants

send :: Transport m => Message -> m ()Source

Synonym for sendMessage.

wait :: Transport m => String -> m MessageSource

Synonym for waitReply.

async :: Transport m => Message -> m MessageSource

Send a Message and wait for a /done reply.

withSC3 :: Connection UDP a -> IO aSource

Bracket SC3 communication. withTransport at standard SC3 UDP port.

 import Sound.SC3.Server.Command
 withSC3 (send status >> wait "/status.reply")

Server control

stop :: Transport m => m ()Source

Free all nodes (g_freeAll) at group 1.

reset :: Transport m => m ()Source

Free all nodes (g_freeAll) at and re-create groups 1 and 2.

playSynthdef :: Transport m => Synthdef -> m ()Source

Send d_recv and s_new messages to scsynth.

playUGen :: Transport m => UGen -> m ()Source

Send an anonymous instrument definition using playSynthdef.

NRT

run_bundle :: Transport m => Double -> Bundle -> m ()Source

Wait (pauseThreadUntil) until bundle is due to be sent relative to initial UTCr time, then send each message, asynchronously if required.

performNRT :: Transport m => NRT -> m ()Source

Perform an NRT score (as would be rendered by writeNRT). In particular note that all timestamps must be in NTPr form.

Audible

class Audible e whereSource

Class for values that can be encoded and send to scsynth for audition.

Methods

play :: Transport m => e -> m ()Source

audition :: Audible e => e -> IO ()Source

Notifications

withNotifications :: Transport m => m a -> m aSource

Turn on notifications, run f, turn off notifications, return result.

Buffer

b_getn1_data :: Transport m => Int -> (Int, Int) -> m [Double]Source

Variant of b_getn1 that waits for return message and unpacks it.

 withSC3 (b_getn1_data 0 (0,5))

b_getn1_data_segment :: Transport m => Int -> Int -> (Int, Int) -> m [Double]Source

Variant of b_getn1_data that segments individual b_getn messages to n elements.

 withSC3 (b_getn1_data_segment 1 0 (0,5))

b_fetch :: Transport m => Int -> Int -> m [Double]Source

Variant of b_getn1_data_segment that gets the entire buffer.

Status

serverStatus :: Transport m => m [String]Source

Collect server status information.

serverSampleRateNominal :: Transport m => m DoubleSource

Read nominal sample rate of server.

serverSampleRateActual :: Transport m => m DoubleSource

Read actual sample rate of server.

serverStatusData :: Transport m => m [Datum]Source

Retrieve status data from server.