hsc3-0.14: Haskell SuperCollider

Safe HaskellNone




Monad variant of interaction with the scsynth server.


hosc variants

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

Synonym for sendMessage.

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

Send a Message and waitReply 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 >> waitReply "/status.reply")

Server control

stop :: SendOSC m => m ()Source

Free all nodes (g_freeAll) at group 1.

reset :: SendOSC m => m ()Source

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

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

Send d_recv and s_new messages to scsynth.

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

Send an anonymous instrument definition using playSynthdef.


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

Wait (pauseThreadUntil) until bundle is due to be sent relative to the initial 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.


class Audible e whereSource

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


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

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


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

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


b_getn1_data :: DuplexOSC 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 :: DuplexOSC 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 :: DuplexOSC m => Int -> Int -> m [Double]Source

Variant of b_getn1_data_segment that gets the entire buffer.


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

Collect server status information.

serverSampleRateNominal :: DuplexOSC m => m DoubleSource

Read nominal sample rate of server.

 withSC3 serverSampleRateNominal

serverSampleRateActual :: DuplexOSC m => m DoubleSource

Read actual sample rate of server.

 withSC3 serverSampleRateActual

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

Retrieve status data from server.