OscReceive(port, address, mul=1, add=0)
Receives values over a network via the Open Sound Control protocol.
Uses the OSC protocol to receive values from other softwares or other computers. Get a value at the beginning of each buffersize and fill it's buffer with it.
Parent class : PyoObject
Parameters:
port : int Port on which values are received. Sender should output on the same port. address : string Address used on the port to identify values. Address is in the form of a Unix path (ex.: '/pitch').
Methods:
get(identifier, all) : Return the first sample of the current buffer as a float.
Notes:
Audio streams are accessed with the `address` string parameter. The user should call : OscReceive['/pitch'] to retreive streams named '/pitch'. The out() method is bypassed. OscReceive's signal can not be sent to audio outs.
Examples:
>>> s = Server().boot() >>> s.start() >>> a = OscReceive(port=10001, address=['/pitch', '/amp']) >>> b = Sine(freq=a['/pitch'], mul=a['/amp']).out()
Methods details:
OscReceive.get(identifier=None, all=False): Return the first sample of the current buffer as a float. Can be used to convert audio stream to usable Python data. Address as string must be given to `identifier` to specify which stream to get value from. Parameters: identifier : string Address string parameter identifying audio stream. Defaults to None, useful when `all` is True to retreive all streams values. all : boolean, optional If True, the first value of each object's stream will be returned as a list. Otherwise, only the value of the first object's stream will be returned as a float. Defaults to False.