Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
29cfc41d
Commit
29cfc41d
authored
Nov 09, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Starting VA API change adaption
parent
dd77a633
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
applications/VirtualAcoustics/VA/itaVA.m
View file @
29cfc41d
This diff is collapsed.
Click to expand it.
applications/VirtualAcoustics/VA/itaVA_example_simple.m
View file @
29cfc41d
...
...
@@ -10,37 +10,29 @@ va.connect( 'localhost' )
va
.
reset
()
% Control output gain
va
.
set
O
utput
G
ain
(
.
25
)
va
.
set
_o
utput
_g
ain
(
.
25
)
% Add the current absolute folder path to VA application
va
.
add
S
earch
P
ath
(
pwd
);
va
.
add
_s
earch
_p
ath
(
pwd
);
% Create a signal source and start playback
ita_write_wav
(
ita_demosound
,
'ita_demosound.wav'
,
'overwrite'
);
X
=
va
.
createAudiofileSignalSource
(
'ita_demosound.wav'
);
va
.
setAudiofileSignalSourcePlaybackAction
(
X
,
'play'
)
va
.
setAudiofileSignalSourceIsLooping
(
X
,
true
);
X
=
va
.
create_signal_source_buffer_from_file
(
'$(DemoSound)'
);
va
.
set_signal_source_buffer_playback_action
(
X
,
'play'
)
va
.
set_signal_source_buffer_looping
(
X
,
true
);
% Create a virtual sound source and set a position
S
=
va
.
create
S
ound
S
ource
(
'itaVA_Source'
);
va
.
set
S
ound
S
ource
P
osition
(
S
,
[
0
1.7
-
2
]
)
S
=
va
.
create
_s
ound
_s
ource
(
'itaVA_Source'
);
va
.
set
_s
ound
_s
ource
_p
osition
(
S
,
[
2
1.7
2
]
)
% Connect the signal source to the virtual sound source
va
.
set
S
ound
S
ource
S
ignal
S
ource
(
S
,
X
)
va
.
set
_s
ound
_s
ource
_s
ignal
_s
ource
(
S
,
X
)
% Create a listener with a HRTF and position him
H
=
va
.
loadHRIRDataset
(
'$(DefaultHRIR)'
);
L
=
va
.
createListener
(
'itaVA_Listener'
,
'default'
,
H
);
va
.
setListenerPosition
(
L
,
[
0
1.7
0
]
)
va
.
setListenerOrientationYPR
(
L
,
[
0
0
0
]
)
% Default view is to -Z (OpenGL)
L
=
va
.
create_sound_receiver
(
'itaVA_Listener'
);
va
.
set_sound_receiver_position
(
L
,
[
0
1.7
0
]
)
% Set the listener as the active one
va
.
set
ActiveListener
(
L
)
H
=
va
.
create_directivity
(
'$(DefaultHRIR)'
);
va
.
set
_sound_receiver_directivity
(
L
,
H
)
;
% Now close connection
va
.
disconnect
()
% VA virtual scene is still active now ...
% Explore itaVA class ...
doc
itaVA
% More information
disp
(
'Type
''
doc itaVA
''
for more information.'
)
applications/VirtualAcoustics/VA/itaVA_example_tracked_listener.m
View file @
29cfc41d
...
...
@@ -2,20 +2,17 @@
% This assumes you already have set up a virtual scene without listener
% Create itaVA and connect
va
=
itaVA
(
'localhost'
)
va
=
itaVA
(
'localhost'
)
;
% Create a
listen
er
L
=
va
.
create
Listen
er
(
'itaVA_Tracked_Listener'
);
% Create a
sound receiv
er
L
=
va
.
create
_sound_receiv
er
(
'itaVA_Tracked_Listener'
);
% OptiTrack tracker conneection and
listen
er updates
va
.
set
T
racked
Listen
er
(
L
)
% For virtual scene / rendering
va
.
set
T
racked
R
eal
W
orld
Listen
er
(
L
)
% For CTC reproductions
va
.
connect
T
racker
pause
(
12
)
% Observe how you can move the virtual
listener in VAGUI
va
.
disconnect
T
racker
% OptiTrack tracker conneection and
sound receiv
er updates
va
.
set
_t
racked
_sound_receiv
er
(
L
)
% For virtual scene / rendering
va
.
set
_t
racked
_r
eal
_w
orld
_sound_receiv
er
(
L
)
% For CTC reproductions
va
.
connect
_t
racker
pause
(
12
)
% Observe how you can move the virtual
sound receiver
va
.
disconnect
_t
racker
% Remove listener again
va
.
deleteListener
(
L
)
% Now close connection
va
.
disconnect
()
va
.
delete_sound_receiver
(
L
)
applications/VirtualAcoustics/VA/itaVA_setup.fig
View file @
29cfc41d
No preview for this file type
applications/VirtualAcoustics/VA/itaVA_setup.m
View file @
29cfc41d
...
...
@@ -83,8 +83,9 @@ if ~isempty( current_va_server_dir )
for
i
=
1
:
numel
(
vs
)
vss
=
vs
{
1
,
i
};
if
numel
(
vss
)
>
6
if
strcmpi
(
vss
(
1
:
6
),
'VACore'
)
set
(
handles
.
edit_vaserver_version
,
'String'
,
strcat
(
vs
(
i
)
)
)
if
strcmpi
(
vss
(
3
:
10
),
'VAServer'
)
server_version
=
vss
(
15
:
end
);
set
(
handles
.
edit_vaserver_version
,
'String'
,
strcat
(
server_version
)
)
end
end
end
...
...
applications/VirtualAcoustics/VA/itaVA_simplest_scene.m
deleted
100644 → 0
View file @
dd77a633
itaVAq;
va.reset;
va.setOutputGain( .25 );
va.addSearchPath( pwd );
ita_write_wav( ita_demosound, 'ita_demosound.wav', 'overwrite' );
X = va.createAudiofileSignalSource( 'ita_demosound.wav' );
va.setAudiofileSignalSourcePlaybackAction( X, 'play' )
va.setAudiofileSignalSourceIsLooping( X, true );
S = va.createSoundSource( 'itaVA_Source', 'all' );
va.setSoundSourcePosition( S, [ 0 1.7 -2 ] );
va.setSoundSourceSignalSource( S, X );
H = va.loadHRIRDataset( '$(DefaultHRIR)' );
L = va.createListener( 'itaVA_Listener', 'all', H );
va.setListenerPosition( L, [ 0 1.7 0 ] );
va.setActiveListener( L );
\ No newline at end of file
applications/VirtualAcoustics/VA/itaVAq.m
View file @
29cfc41d
...
...
@@ -2,4 +2,4 @@
va
=
itaVA
(
'localhost'
);
%% Also add current dir to VA search path
va
.
addSearchPath
(
pwd
);
\ No newline at end of file
va
.
add_search_path
(
pwd
);
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment