Safe Haskell | None |
---|---|
Language | Haskell98 |
Monad variant of interaction with the scsynth server.
- send :: SendOSC m => Message -> m ()
- async :: DuplexOSC m => Message -> m Message
- withSC3 :: Connection UDP a -> IO a
- stop :: SendOSC m => m ()
- reset :: SendOSC m => m ()
- playGraphdef :: DuplexOSC m => (Int, AddAction, Int) -> Graphdef -> m ()
- playSynthdef :: DuplexOSC m => (Int, AddAction, Int) -> Synthdef -> m ()
- playUGen :: DuplexOSC m => (Int, AddAction, Int) -> UGen -> m ()
- run_bundle :: Transport m => Time -> Bundle -> m ()
- performNRT :: Transport m => NRT -> m ()
- class Audible e where
- audition_at :: Audible e => (Int, AddAction, Int) -> e -> IO ()
- audition :: Audible e => e -> IO ()
- withNotifications :: DuplexOSC m => m a -> m a
- b_getn1_data :: DuplexOSC m => Int -> (Int, Int) -> m [Double]
- b_getn1_data_segment :: DuplexOSC m => Int -> Int -> (Int, Int) -> m [Double]
- b_fetch :: DuplexOSC m => Int -> Int -> m [Double]
- c_getn1_data :: DuplexOSC m => (Int, Int) -> m [Double]
- serverStatus :: DuplexOSC m => m [String]
- serverSampleRateNominal :: DuplexOSC m => m Double
- serverSampleRateActual :: DuplexOSC m => m Double
- serverStatusData :: DuplexOSC m => m [Datum]
hosc variants
send :: SendOSC m => Message -> m () Source
Synonym for sendMessage
.
withSC3 :: Connection UDP a -> IO a Source
Bracket SC3
communication. withTransport
at standard SC3 UDP
port.
import Sound.SC3.Server.Command
withSC3 (send status >> waitReply "/status.reply")
Server control
Composite
reset :: SendOSC m => m () Source
clearSched
, free all nodes (g_freeAll
) at, and then
re-create, groups 1
and 2
.
playUGen :: DuplexOSC m => (Int, AddAction, Int) -> UGen -> m () Source
Send an anonymous instrument definition using playSynthdef
.
NRT
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
).
Asynchronous commands at time 0
are separated out and run before
the initial time-stamp is taken. This re-orders synchronous
commands in relation to asynchronous at time 0
.
let sc = NRT [bundle 1 [s_new0 "default" (-1) AddToHead 1] ,bundle 2 [n_set1 (-1) "gate" 0]] in withSC3 (performNRT sc)
Audible
Class for values that can be encoded and send to scsynth
for
audition.
Notifications
withNotifications :: DuplexOSC m => m a -> m a Source
Turn on notifications, run f, turn off notifications, return result.
Buffer
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.
Status
serverStatus :: DuplexOSC m => m [String] Source
Collect server status information.
serverSampleRateNominal :: DuplexOSC m => m Double Source
Read nominal sample rate of server.
withSC3 serverSampleRateNominal
serverSampleRateActual :: DuplexOSC m => m Double Source
Read actual sample rate of server.
withSC3 serverSampleRateActual
serverStatusData :: DuplexOSC m => m [Datum] Source
Retrieve status data from server.