Safe Haskell | None |
---|---|
Language | Haskell98 |
Open Sound Control.
- type OscHost = String
- type OscPort = Int
- type OscAddress = String
- type OscType = String
- data OscRef :: *
- initOsc :: OscPort -> OscRef
- listenOsc :: Tuple a => OscRef -> OscAddress -> OscType -> Evt a
- type ListenOsc a = OscAddress -> a -> SE a
- class Tuple a => OscVal a
- listenOscVal :: (Tuple a, OscVal a) => OscRef -> String -> a -> SE a
- listenOscSig :: OscRef -> OscAddress -> Sig -> SE Sig
- listenOscSig2 :: OscRef -> OscAddress -> Sig2 -> SE Sig2
- sendOsc :: Tuple a => OscHost -> OscPort -> OscAddress -> OscType -> Evt a -> SE ()
Documentation
type OscAddress = String #
Path-like string ("foobar/baz")
The string specifies the type of expected arguments. The string can contain the characters "bcdfilmst" which stand for Boolean, character, double, float, 32-bit integer, 64-bit integer, MIDI, string and timestamp.
Server
listenOsc :: Tuple a => OscRef -> OscAddress -> OscType -> Evt a #
Listens for the OSC-messages. The first argument is OSC-reference.
We can create it with the function initOsc
. The next two arguments are strings.
The former specifies the path-like address to listen the messages. It can be:
/foo/bar/baz
The latter specifies the type of expected arguments. The string can contain the characters "bcdfilmst" which stand for Boolean, character, double, float, 32-bit integer, 64-bit integer, MIDI, string and timestamp.
The result is an event of messages. We can run a callback on it
with standard function runEvt
:
runEvt :: Evt a -> (a -> SE ()) -> SE ()
type ListenOsc a = OscAddress -> a -> SE a Source #
getOscTypes, getOscRef
listenOscVal :: (Tuple a, OscVal a) => OscRef -> String -> a -> SE a #
Listens for tuples of continuous signals read from OSC-channel.
listenOscVal ref address initValue
listenOscSig :: OscRef -> OscAddress -> Sig -> SE Sig Source #
Listens for continuous signal from OSC-channel
listenOscSig host address initValue
listenOscSig2 :: OscRef -> OscAddress -> Sig2 -> SE Sig2 Source #
Listens for pair of continuous signals from OSC-channel
listenOscSig2 host address initValue
Client
sendOsc :: Tuple a => OscHost -> OscPort -> OscAddress -> OscType -> Evt a -> SE () #
Sends OSC-messages. It takes in a name of the host computer (empty string is alocal machine), port on which the target machine is listening, OSC-addres and type. The last argument produces the values for OSC-messages.