csound-expression-5.4.3: library to make electronic music
Safe HaskellNone
LanguageHaskell2010

Csound.Control.Osc

Contents

Description

Open Sound Control.

Synopsis

Documentation

type OscHost = String #

The hostname of the computer. An empty string is for local machine.

type OscPort = Int #

Port to listen OSC-messages.

type OscAddress = String #

Path-like string ("foobar/baz")

type OscType = String #

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.

data OscRef #

Server

initOsc :: OscPort -> OscRef #

Initializes host client. The process starts to run in the background.

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 #

class Tuple a => OscVal a #

Minimal complete definition

getOscTypes, getOscRef

Instances

Instances details
OscVal Sig 
Instance details

Defined in Csound.Typed.Control.Osc

Methods

getOscTypes :: Sig -> String

getOscRef :: Sig -> SE (Ref Sig)

OscVal Str 
Instance details

Defined in Csound.Typed.Control.Osc

Methods

getOscTypes :: Str -> String

getOscRef :: Str -> SE (Ref Str)

(OscVal a, OscVal b) => OscVal (a, b) 
Instance details

Defined in Csound.Typed.Control.Osc

Methods

getOscTypes :: (a, b) -> String

getOscRef :: (a, b) -> SE (Ref (a, b))

(OscVal a, OscVal b, OscVal c) => OscVal (a, b, c) 
Instance details

Defined in Csound.Typed.Control.Osc

Methods

getOscTypes :: (a, b, c) -> String

getOscRef :: (a, b, c) -> SE (Ref (a, b, c))

(OscVal a, OscVal b, OscVal c, OscVal d) => OscVal (a, b, c, d) 
Instance details

Defined in Csound.Typed.Control.Osc

Methods

getOscTypes :: (a, b, c, d) -> String

getOscRef :: (a, b, c, d) -> SE (Ref (a, b, c, d))

(OscVal a, OscVal b, OscVal c, OscVal d, OscVal e) => OscVal (a, b, c, d, e) 
Instance details

Defined in Csound.Typed.Control.Osc

Methods

getOscTypes :: (a, b, c, d, e) -> String

getOscRef :: (a, b, c, d, e) -> SE (Ref (a, b, c, d, e))

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.