Sound.OpenSoundControl
Description
An implementation of a subset of the Open Sound Control byte protocol, documented at http://opensoundcontrol.org/.
For the most part this top-level module is the only import
required. It provides the Datum and OSC types, encodeOSC and
decodeOSC functions, basic UDP and TCP Transport layers,
and basic temporal operations utcr to access the current time and
pauseThread to delay the current thread.
let o = Bundle immediately [Message "/g_free" [Int 0]] in decodeOSC (encodeOSC o) == o
- module Sound.OpenSoundControl.Type
- module Sound.OpenSoundControl.Time
- module Sound.OpenSoundControl.Transport
- module Sound.OpenSoundControl.Transport.UDP
- module Sound.OpenSoundControl.Transport.TCP
- encodeOSC :: OSC -> ByteString
- decodeOSC :: ByteString -> OSC
- openUDP :: String -> Int -> IO UDP
- udpServer :: String -> Int -> IO UDP
- openTCP :: String -> Int -> IO TCP
- tcpServer :: Int -> (TCP -> IO ()) -> IO ()
Documentation
module Sound.OpenSoundControl.Type
module Sound.OpenSoundControl.Time
encodeOSC :: OSC -> ByteStringSource
Encode an OSC packet to a lazy ByteString.
let b = L.pack [47,103,95,102,114,101,101,0,44,105,0,0,0,0,0,0] in encodeOSC (Message "/g_free" [Int 0]) == b
decodeOSC :: ByteString -> OSCSource
Decode an OSC packet from a lazy ByteString.
let b = L.pack [47,103,95,102,114,101,101,0,44,105,0,0,0,0,0,0] in decodeOSC b == Message "/g_free" [Int 0]