csound-expression-typed-0.2.7.1: typed core for the library csound-expression
Safe HaskellSafe-Inferred
LanguageHaskell2010

Csound.Typed.Control.Osc

Description

Open sound control

Synopsis

Documentation

type OscHost = String Source #

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

type OscPort = Int Source #

Port to listen OSC-messages.

type OscAddress = String Source #

Path-like string ("foobar/baz")

type OscType = String Source #

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.

initOsc :: OscPort -> OscRef Source #

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

listenOsc :: forall a. Tuple a => OscRef -> OscAddress -> OscType -> Evt a Source #

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 ()

sendOsc :: forall a. Tuple a => OscHost -> OscPort -> OscAddress -> OscType -> Evt a -> SE () Source #

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.

class Tuple a => OscVal a Source #

Minimal complete definition

getOscTypes, getOscRef

Instances

Instances details
OscVal Sig Source # 
Instance details

Defined in Csound.Typed.Control.Osc

Methods

getOscTypes :: Sig -> String

getOscRef :: Sig -> SE (Ref Sig)

OscVal Str Source # 
Instance details

Defined in Csound.Typed.Control.Osc

Methods

getOscTypes :: Str -> String

getOscRef :: Str -> SE (Ref Str)

(OscVal a, OscVal b) => OscVal (a, b) Source # 
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) Source # 
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) Source # 
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) Source # 
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 Source #

Listens for tuples of continuous signals read from OSC-channel.

listenOscVal ref address initValue