GeoListener

Inherits from: Object

A GeoListener instance creates a Listener in a virtual space. The active sound objects sequences are filtered (see CartoonModel filter and sendDef methods) by the Listener, in order to simulate the perception of an exploration of the Soundscape. This class only collects information about the Listener position, orientation and movement boundaries. It also provides OSC commands to interact with the Listener both from a local machine or from a network. Anyway, without it you cannot hear the Soundscape.

See also: CartoonModel, Soundscape

Creation / Class Methods

*new (a, b, scapeWidth, scapeHeight)

Assuming the soundscape represented as a 2D space, the parameters you should configure are:

a - The initial x position of the listener in the virtual space.

b - The initial y position of the listener in the virtual space.

scapeWidth - The width of the virtual space representing the soundscape (assumed as a rectangle).

scapeHeight - The height of the virtual space representing the soundscape.

// inline example

g = GeoListener.new(0, 0, 2000, 2000);

Accessing Instance and Class Variables

address

Address is the host name or IP adress of a machine running the application for soundscape generation.

Default value is nil, and in this case it is set as localhost ("127.0.0.1", 57120).

la

la is the variable that store the x position of the Listener

lb

lb is the variable that store the y position of the Listener.

lorient

lorient store the Listener orientation, as a radiant.

perceptionArea

In meter, the area where the listener perceive clearly sound object, this parameter is used in CartoonModel to compute the cutFrequency of the LowBandPass Filter used to simulate the perception of far sound object

Default value is 30 meter.

gostraight()

Increase the position in the direction of the orientation.

goback()

Increase the position in the opposite direction of the orientation.

turnleft()

Increment the orientation of the listener in the opposite clockwise direction of the default angle unit.

turnright()

Increment the orientation of the listener in the clockwise direction of the default angle unit.

setPosition (x, y)

Set the Listener position to (x,y) coordinates.

calculatePanning (aXv, aYv, aA, aB, aOrient, anAtm)

Calculate the panning value between a vertex (sound object) and the Listener.

aXv - The x position of a vertex

aYv - The y position of a vertex.

aA - The x position of the Listener.

aB - The y position of the Listener.

aOrient - The Listener orientation.

anAtm - The W and H dimensions of the vertex if it is a non point source.

update (theChanged, theChanger, more)

When the Listener position/orientation changes, send the changes to Soundscape (GeoListener Dependant), to perform the synthesis of the spatialisation and exploration model you choose (Right now only CartoonModel exists).

Examples

// Interact with the Listener from a GUI on the local machine

l = GeoListener.new(xListener, yListener, WSoundscape, HSoundscape);

e = GeoListenerGUI.new(l);

// Interact with the Listener in a network (assuming you created a GeoListener instance in another machine)

m.sendMsg("/spatdif/core/listener/1/position", x, y);

//create the listener

m = NetAddr.new(address, 57120)

//the host name or IP adress where the application runs

m.sendMsg("/spatdif/core/listener/1/position", x, y);

//move the listener to a new point

m.sendMsg("/spatdif/core/listener/1/move", "gostraight");

m.sendMsg("/spatdif/core/listener/1/move", "goback");

m.sendMsg("/spatdif/core/listener/1/move", "turnright");

m.sendMsg("/spatdif/core/listener/1/move", "turnleft");