Fixes

parent 854770ae
...@@ -139,9 +139,9 @@ classdef itaVA < handle ...@@ -139,9 +139,9 @@ classdef itaVA < handle
this.disconnect this.disconnect
end end
function [connected] = is_connected(this) function [connected] = get_connected(this)
% Returns if a connection to a server is established % Returns if a connection to a server is established
connected = VAMatlab('is_connected', this.handle); connected = VAMatlab('get_connected', this.handle);
end end
function connect(this, addressstring) function connect(this, addressstring)
......
...@@ -16,31 +16,23 @@ va.set_output_gain( .25 ) ...@@ -16,31 +16,23 @@ va.set_output_gain( .25 )
va.add_search_path( pwd ); va.add_search_path( pwd );
% Create a signal source and start playback % Create a signal source and start playback
ita_write_wav( ita_demosound, 'ita_demosound.wav', 'overwrite' ); X = va.create_signal_source_buffer_from_file( '$(DemoSound)' );
X = va.create_signal_source_buffer_from_file( 'ita_demosound.wav' );
va.set_signal_source_buffer_playback_action( X, 'play' ) va.set_signal_source_buffer_playback_action( X, 'play' )
va.set_signal_source_buffer_looping( X, true ); va.set_signal_source_buffer_looping( X, true );
% Create a virtual sound source and set a position % Create a virtual sound source and set a position
S = va.create_sound_source( 'itaVA_Source' ); S = va.create_sound_source( 'itaVA_Source' );
va.set_sound_source_position( S, [0 1.7 -2] ) va.set_sound_source_position( S, [ 2 1.7 2 ] )
% Connect the signal source to the virtual sound source % Connect the signal source to the virtual sound source
va.set_sound_source_signal_source( S, X ) va.set_sound_source_signal_source( S, X )
% Create a listener with a HRTF and position him % Create a listener with a HRTF and position him
H = va.create_directivity( '$(DefaultHRIR)' );
L = va.create_sound_receiver( 'itaVA_Listener' ); L = va.create_sound_receiver( 'itaVA_Listener' );
va.set_sound_receiver_position( L, [ -2 1.7 0 ] ) va.set_sound_receiver_position( L, [ 0 1.7 0 ] )
va.set_sound_receiver_orientation_view_up( L, [ 0 0 -1 ], [ 0 1 0 ] )
% Set the listener as the active one
va.set_active_sound_receiver( L )
% Now close connection H = va.create_directivity( '$(DefaultHRIR)' );
va.disconnect() va.set_sound_receiver_directivity( L, H );
% VA virtual scene is still active now ...
% Explore itaVA class ... % More information
doc itaVA disp( 'Type ''doc itaVA'' for more information.' )
...@@ -2,20 +2,17 @@ ...@@ -2,20 +2,17 @@
% This assumes you already have set up a virtual scene without listener % This assumes you already have set up a virtual scene without listener
% Create itaVA and connect % Create itaVA and connect
va = itaVA( 'localhost' ) va = itaVA( 'localhost' );
% Create a listener % Create a sound receiver
L = va.createListener( 'itaVA_Tracked_Listener' ); L = va.create_sound_receiver( 'itaVA_Tracked_Listener' );
% OptiTrack tracker conneection and listener updates % OptiTrack tracker conneection and sound receiver updates
va.setTrackedListener( L ) % For virtual scene / rendering va.set_tracked_sound_receiver( L ) % For virtual scene / rendering
va.setTrackedRealWorldListener( L ) % For CTC reproductions va.set_tracked_real_world_sound_receiver( L ) % For CTC reproductions
va.connectTracker va.connect_tracker
pause( 12 ) % Observe how you can move the virtual listener in VAGUI pause( 12 ) % Observe how you can move the virtual sound receiver
va.disconnectTracker va.disconnect_tracker
% Remove listener again % Remove listener again
va.deleteListener( L ) va.delete_sound_receiver( L )
% Now close connection
va.disconnect()
...@@ -732,9 +732,9 @@ void set_tracked_real_world_sound_receiver_torso_rigid_body_index( int nlhs, mxA ...@@ -732,9 +732,9 @@ void set_tracked_real_world_sound_receiver_torso_rigid_body_index( int nlhs, mxA
pConnection->pVAMatlabTracker->iTrackedRealWorldSoundReceiverTorsoRigidBodyIndex = iTrackedRigidBodyIndex; pConnection->pVAMatlabTracker->iTrackedRealWorldSoundReceiverTorsoRigidBodyIndex = iTrackedRigidBodyIndex;
} }
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_sound_receiver_head_rigid_body_translation ); REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_sound_receiver_head_rigid_body_translat );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_sound_receiver_head_rigid_body_translation, offset, "real 1x3", "Tracked real-world sound receiver rigid body position offset" ); DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_sound_receiver_head_rigid_body_translat, offset, "real 1x3", "Tracked real-world sound receiver rigid body position offset" );
void set_tracked_real_world_sound_receiver_head_rigid_body_translation( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) void set_tracked_real_world_sound_receiver_head_rigid_body_translat( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{ {
REQUIRE_INPUT_ARGS( 2 ); REQUIRE_INPUT_ARGS( 2 );
...@@ -747,9 +747,9 @@ void set_tracked_real_world_sound_receiver_head_rigid_body_translation( int nlhs ...@@ -747,9 +747,9 @@ void set_tracked_real_world_sound_receiver_head_rigid_body_translation( int nlhs
pConnection->pVAMatlabTracker->vTrackedRealWorldSoundReceiverTranslation = VistaVector3D( float( v3Pos.x ), float( v3Pos.y ), float( v3Pos.z ) ); pConnection->pVAMatlabTracker->vTrackedRealWorldSoundReceiverTranslation = VistaVector3D( float( v3Pos.x ), float( v3Pos.y ), float( v3Pos.z ) );
} }
REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_sound_receiver_head_rigid_body_rotation ); REGISTER_PRIVATE_FUNCTION( set_tracked_real_world_sound_receiver_head_rigid_body_rot );
DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_sound_receiver_head_rigid_body_rotation, rotation, "real 1x4", "Tracked real-world sound receiver rigid body rotation (quaternion values with w (real), i, j, k)" ); DECLARE_FUNCTION_REQUIRED_INARG( set_tracked_real_world_sound_receiver_head_rigid_body_rot, rotation, "real 1x4", "Tracked real-world sound receiver rigid body rotation (quaternion values with w (real), i, j, k)" );
void set_tracked_real_world_sound_receiver_head_rigid_body_rotation( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) void set_tracked_real_world_sound_receiver_head_rigid_body_rot( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{ {
REQUIRE_INPUT_ARGS( 2 ); REQUIRE_INPUT_ARGS( 2 );
...@@ -2576,7 +2576,7 @@ void set_homogeneous_medium_shift_parameters( int nlhs, mxArray *plhs[], int nrh ...@@ -2576,7 +2576,7 @@ void set_homogeneous_medium_shift_parameters( int nlhs, mxArray *plhs[], int nrh
REGISTER_PUBLIC_FUNCTION( create_acoustic_material_from_file, "Create acoustic material", "" ); REGISTER_PUBLIC_FUNCTION( create_acoustic_material_from_file, "Create acoustic material", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_acoustic_material_from_file, file_path, "string", "Material file path" ); DECLARE_FUNCTION_REQUIRED_INARG( create_acoustic_material_from_file, file_path, "string", "Material file path" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_acoustic_material_from_file, material_name, "string", "Material name", "" ); DECLARE_FUNCTION_OPTIONAL_INARG( create_acoustic_material_from_file, material_name, "string", "Material name", "''" );
DECLARE_FUNCTION_OUTARG( create_acoustic_material_from_file, material_id, "double-1x1", "Material identifier" ); DECLARE_FUNCTION_OUTARG( create_acoustic_material_from_file, material_id, "double-1x1", "Material identifier" );
void create_acoustic_material_from_file( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) void create_acoustic_material_from_file( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{ {
...@@ -2646,7 +2646,7 @@ void set_acoustic_magerial_parameters( int nlhs, mxArray *plhs[], int nrhs, cons ...@@ -2646,7 +2646,7 @@ void set_acoustic_magerial_parameters( int nlhs, mxArray *plhs[], int nrhs, cons
REGISTER_PUBLIC_FUNCTION( create_geometry_mesh_from_file, "Create geometry mesh from file", "" ); REGISTER_PUBLIC_FUNCTION( create_geometry_mesh_from_file, "Create geometry mesh from file", "" );
DECLARE_FUNCTION_REQUIRED_INARG( create_geometry_mesh_from_file, file_path, "string", "Geometry mesh file path" ); DECLARE_FUNCTION_REQUIRED_INARG( create_geometry_mesh_from_file, file_path, "string", "Geometry mesh file path" );
DECLARE_FUNCTION_OPTIONAL_INARG( create_geometry_mesh_from_file, geo_mesh_name, "string", "Geometry mesh name", "" ); DECLARE_FUNCTION_OPTIONAL_INARG( create_geometry_mesh_from_file, geo_mesh_name, "string", "Geometry mesh name", "''" );
DECLARE_FUNCTION_OUTARG( create_geometry_mesh_from_file, geo_mesh_id, "double-1x1", "Geometry mesh identifier" ); DECLARE_FUNCTION_OUTARG( create_geometry_mesh_from_file, geo_mesh_id, "double-1x1", "Geometry mesh identifier" );
void create_geometry_mesh_from_file( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) void create_geometry_mesh_from_file( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment