Commit 7474d92d authored by henryjandrew's avatar henryjandrew

updated example outdoor acoustics script

parent 4c0f05a6
...@@ -16,7 +16,7 @@ receiver_pos = [ 2 1.7 0 ]; % OpenGL coordinates ...@@ -16,7 +16,7 @@ receiver_pos = [ 2 1.7 0 ]; % OpenGL coordinates
va.set_sound_receiver_position( L, receiver_pos ) va.set_sound_receiver_position( L, receiver_pos )
%H = va.create_directivity_from_file( '$(DefaultHRIR)' ); %H = va.create_directivity_from_file( '$(DefaultHRIR)' );
H = va.create_directivity_from_file( 'D:/Users/andrew/dev/ITASuite/VA/VAMatlab/matlab/ITA_Artificial_Head_5x5_44kHz_128.v17.ir.daff' ); H = va.create_directivity_from_file( 'D:/Users/andrew/dev/ITASuite/VA/VAMatlab/matlab/ITA_Artificial_Head_5x5_44kHz_128.v17.ir.daff' );
interp1(
va.set_sound_receiver_directivity( L, H ); va.set_sound_receiver_directivity( L, H );
S = va.create_sound_source( 'VA_Source' ); S = va.create_sound_source( 'VA_Source' );
...@@ -71,11 +71,14 @@ for n = 1:length( x ) ...@@ -71,11 +71,14 @@ for n = 1:length( x )
prop_path_direct.source = S; %sound source ID prop_path_direct.source = S; %sound source ID
prop_path_direct.receiver = L; %sound receiver ID prop_path_direct.receiver = L; %sound receiver ID
prop_path_direct.path = strcat( 'direct_', num2str(S), '_to_', num2str(L) ); %sound path ID prop_path_direct.path = strcat( 'direct_', num2str(S), '_to_', num2str(L) ); %sound path ID
prop_path_direct.ID = 0;
prop_path_direct.delete = false; %set to true when the path should be deleted prop_path_direct.delete = false; %set to true when the path should be deleted
prop_path_direct.position = source_pos;
direct_deleted = false; direct_deleted = false;
else else
prop_path_direct = struct(); prop_path_direct = struct();
prop_path_direct.ID = 0;
prop_path_direct.path = strcat( 'direct_', num2str(S), '_to_', num2str(L) ); %sound path ID prop_path_direct.path = strcat( 'direct_', num2str(S), '_to_', num2str(L) ); %sound path ID
prop_path_direct.delete = true; %if source is in shadow zone, delete direct path prop_path_direct.delete = true; %if source is in shadow zone, delete direct path
direct_deleted = true; direct_deleted = true;
...@@ -97,11 +100,14 @@ for n = 1:length( x ) ...@@ -97,11 +100,14 @@ for n = 1:length( x )
prop_path_diffracted.frequency_magnitudes = values'; prop_path_diffracted.frequency_magnitudes = values';
prop_path_diffracted.source = S; prop_path_diffracted.source = S;
prop_path_diffracted.receiver = L; prop_path_diffracted.receiver = L;
prop_path_diffracted.ID = 1;
prop_path_diffracted.path = strcat( 'diff1_', num2str(S), '_to_', num2str(L) ); prop_path_diffracted.path = strcat( 'diff1_', num2str(S), '_to_', num2str(L) );
prop_path_diffracted.delete = false; prop_path_diffracted.delete = false;
prop_path_diffracted.position = apex;
% @todo at some point: load all paths from pre-calculated simulation -> ITAPropagationPathSim (C++) output % @todo at some point: load all paths from pre-calculated simulation -> ITAPropagationPathSim (C++) output
% D:/Users/andrew/dev/ITASuite/VA/VACore/tests/BinauralOutdoorNoiseRendererTest.VACore.ini % D:/Users/andrew/dev/ITASuite/VA/VACore/tests/BinauralOutdoorNoiseRendererTest.VACore.ini
disp(strcat('**diff dirn: ', num2str(apex),' Delay = ',num2str(distance/c),'** Direct sound: ',num2str(source_pos),' Delay = ',num2str(detour/c),'**'));
% Update wave fronts in renderer % Update wave fronts in renderer
path_update = struct(); path_update = struct();
......
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