Thanks to the Blender add-on handling both the EVERTims raytracing client and the Evertims Python module from the GUI, only developers should require hereafter information.
 


Raytracing client - Command line arguments

NAME
ims start EVERTims raytracing simulation
OPTIONS
-s <port> the <port> for the reader to listen to the messages
-p <pattern> the dummy terminal print writer
-v <pattern/host:port> the <host> <port> to write in the “VirChor” protocol
-a <pattern/host:port> the <host> <port> to write reflection data for auralization in the “Markus” protocol
-m <materialfile> the name of the material file
-d <mindepth> the minimum order of reflections
-D <maxdepth> the maximum order of reflections
-g use the internal graphics module for drawing the result. BROKEN AT THE MOMENT. DO NOT USE!
-f <roomfile> read the room geometry from the <roomfile>. DOESN’T WORK AT THE MOMENT.



In the above pattern is a regular expression and is matched against the name of the solution formed as “source_name-listener_name”. If the pattern is omitted everything matches. Such that command line:

 ./ims –p ‘listener_0/’ –a waves:10234 –v ‘source_[03].*listener_1/localhost:1980’ 

would make the following:

  • print the solution for all the sound sources for listener_0
  • send to auralization all the reflection paths for all the listeners. The messages are sent to the port 10234 of computer named “waves”.
  • send to VirChor the reflection paths of sound sources “source_0” and “source_3” for listener_1. The messages are sent to port 1980 at the local computer.


Raytracing client - OSC messages format

Reader (messages from Blender add-on to raytracing client)

/face id mat_id p0_x p0_y p0_z p1_x p1_y ... p3_y p3_z update face <id> vertices (quad) coordinates and material
/facefinished indicate room geometry update is complete (triggers new beam tree calculation)
/source id m00 m10 m20 m30 m01 ... m33 update source <id> position / rotation, with mij the coefficient of its 4x4 homogeneous matrix
/listener id m00 m10 m20 m30 m01 ... m33 update listener <id> position / rotation, with mij the coefficient of its 4x4 homogeneous matrix

 

Writer Raytracing (messages from the raytracing client to the Blender add-on)

/line_on id x0 y0 z0 x1 y1 z1 active ray of id <id> from (x0,y0,z0) to (x1,y1,z1)
/line_off id ray <id> no longer active (/line_on is likely to reuse this id latter for a new ray)

 

Writer Auralization (messages from the raytracing client to the auralization engine)

/source source_id x y z source <id> position
/listener listener_id x y z listener <id> position
/in path_id order r1_x r1_y r1_z rN_x rN_y rN_z dist abs_0 abs_1 ... abs_9 new path <path_id> corresponding to a reflection of order <order>. first reflection point at (r1_x, r1_y, r1_z), last at (rN_x, rN_y, rN_z) for DOA estimation. dist is the length of the whole reflection path. abs_M is the absorption coefficient for the octave band M. <path_id> is guaranteed to be the same for a reflection path while it is visible.
/upd path_id order r1_x r1_y r1_z rN_x rN_y rN_z dist abs_0 abs_1 ... abs_9 updated path <path_id>
/out path_id removed path <path_id>


Blender Evertims module - Python API

setDebugMode(bool) Enable / disable debug mode (print info in console)
addRoom(obj) Add obj (type: KX_GameObject) as EVERTims room in local dictionary
addSource(obj) Add obj (type: KX_GameObject) as EVERTims source in local dictionary
addListener(obj) Add obj (type: KX_GameObject) as EVERTims listener in local dictionary
initConnection_read(ip, port) Init EVERTims to Blender connection, used to receive raytracing information (ip type: String, port type: Int)
initConnection_write(ip, port) Init Blender to EVERTims connection, used to send room, source, listener, etc. information (ip type: String, port type: Int)
isReady() Check EVERTims minimum requirements to enable simulation start: at least 1 room, 1 listener, 1 source, and initConnection_write parameters must have been defined.
updateClient(objType) Upload Room, Source, and Listener information to EVERTims client (objType type: String)
setMovementUpdateThreshold(thresholdLoc, thresholdRot) Define a threshold value (loc and rot) to limit listener / source update to EVERTims client (thresholdLoc, thresholdRot type: Float)
startClientSimulation() Start EVERTims simulation: sent '/facefinished' message to EVERTims client to start acoustic calculation, add local pre_draw method to BGE scene stack
updateClient(objType) Upload Room, Source, and Listener information to EVERTims client (objType type: String)
activateRayTracingFeedback(bool) Enable / disable visual feedback on EVERTims raytracing, will init read socket to receive raytracing messages if set to True




Example python script (runs in BGE) that defines Blender KX_GameObjects 'Room', 'Source', and 'Listener' as EVERTims room, source and listener and starts EVERTims simulation:

from bge import logic as gl
from .evertims import Evertims


IP_EVERT = 'localhost'                  # EVERTims client IP address
PORT_W = 3858                           # port used by EVERTims client to read data sent by the BGE
IP_LOCAL = 'localhost'                  # local host (this computer) IP address, running the BGE
PORT_R = 3862                           # port used by the BGE to read data sent by the EVERTims client
ENABLE_DEBUG = True                     # enable / disable console log
ENABLE_RAYTRACING = True                # enable / disable visual feedback on EVERTims client raytracing
MOVE_UPDATE_THRESHOLD_VALUE_LOC = 1.0   # minimum value a listener / source must move to be updated on EVERTims client (m)
MOVE_UPDATE_THRESHOLD_VALUE_ROT = 5.0   # minimum value a listener / source must rotate to be updated on EVERTims client (deg)

# get bge controller
cont = gl.getCurrentController()

# get main evertims module
gl.evertims = Evertims()

# set debug mode
gl.evertims.setDebugMode(ENABLE_DEBUG)

# define EVERTs elements: room, listener and source
scene = gl.getCurrentScene()
gl.evertims.addRoom(scene.objects['Room'])
gl.evertims.addSource(scene.objects['Source'])
gl.evertims.addListener(scene.objects['Listener'])

# limit listener / source position updates in EVERTims Client
gl.evertims.setMovementUpdateThreshold(MOVE_UPDATE_THRESHOLD_VALUE_LOC, MOVE_UPDATE_THRESHOLD_VALUE_ROT)

# init write network connection (from Blender to EVERTims client, compulsory)
gl.evertims.initConnection_write(IP_EVERT, PORT_W)

# init read network connection (from EVERTims client to Blender, used for visual feedback on EVERTims raytracing in BGE)
gl.evertims.initConnection_read(IP_LOCAL, PORT_R)

# activate raytracing
gl.evertims.activateRayTracingFeedback(ENABLE_RAYTRACING)

# check if evertims module is ready to start
if gl.evertims.isReady():
    # start EVERTims client
    gl.evertims.startClientSimulation()

else:
    # report error
    print ('\n###### EVERTims SIMULATION ABORTED ###### \nYou should create at least 1 room, 1 listener, 1 source, \nand define EVERTims client parameters.\n')

    # quit game
    gl.endGame()

About the auralization engine

 

 

Building...