Commit 4c460587 authored by Jonas Stienen's avatar Jonas Stienen
Browse files

Improving generic path example for VA (real-time filter exchange in VA from Matlab)

parent 038ff1eb
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
va = itaVA( 'localhost' ) va = itaVA( 'localhost' )
va.reset(); va.reset();
X = va.createAudiofileSignalSource( 'Audiofiles/Bauer.wav' );
ita_write_wav( ita_demosound, 'ita_demosound.wav', 'overwrite' );
va.addSearchPath( pwd );
X = va.createAudiofileSignalSource( 'ita_demosound.wav' );
va.setAudiofileSignalSourcePlaybackAction( X, 'play' ); va.setAudiofileSignalSourcePlaybackAction( X, 'play' );
va.setAudiofileSignalSourceIsLooping( X, true ); va.setAudiofileSignalSourceIsLooping( X, true );
S = va.createSoundSource( 'itaVA_Source' ); S = va.createSoundSource( 'itaVA_Source' );
...@@ -21,23 +24,23 @@ for n = size( mMods, 1 ) ...@@ -21,23 +24,23 @@ for n = size( mMods, 1 )
end end
if strcmp( modname, 'none' ) if strcmp( modname, 'none' )
disp( 'Could not find a generic path module, not activated in VA core configuration?' ) error( 'Could not find a generic path module, not activated in VA core configuration?' )
end end
% How to get help %% How to get help
mStruct = struct; mStruct = struct;
mStruct.help = ''; % or true or anything mStruct.help = ''; % or true or anything
mRes = va.callModule( modname, mStruct ); mRes = va.callModule( modname, mStruct );
disp( mRes.help ) disp( mRes.help )
% How to get infos %% How to get infos
mStruct = struct; mStruct = struct;
mStruct.info = ''; % or true or anything mStruct.info = ''; % or true or anything
mRes = va.callModule( modname, mStruct ) mRes = va.callModule( modname, mStruct )
% How to update using a file with two channels (matching channels required) %% How to update using a file with two channels (matching channels required)
a = ita_merge( ita_amplify( ita_generate_impulse, '-21dB' ), ita_amplify( ita_generate_impulse, '-12dB' ) ); a = ita_merge( ita_amplify( ita_generate_impulse, '-12dB' ), ita_amplify( ita_generate_impulse, '-21dB' ) );
ita_write_wav( a, 'unequal_dirac.wav', 'overwrite' ); ita_write_wav( a, 'unequal_dirac.wav', 'overwrite' );
mStruct = struct; mStruct = struct;
mStruct.verbose = ''; % Verbose output for testing only, costly ... mStruct.verbose = ''; % Verbose output for testing only, costly ...
...@@ -46,13 +49,11 @@ mStruct.source = S; ...@@ -46,13 +49,11 @@ mStruct.source = S;
mStruct.filepath = fullfile( pwd, 'unequal_dirac.wav' ); mStruct.filepath = fullfile( pwd, 'unequal_dirac.wav' );
mRes = va.callModule( modname, mStruct ) mRes = va.callModule( modname, mStruct )
% How to update a path sending floating point data (separate channels possible) %% How to update a path sending floating point data (separate channels possible)
b = ita_generate_impulse( 'fftDegree', 12 ); b = ita_generate_impulse( 'fftDegree', 15 );
mStruct = struct; mStruct = struct;
mStruct.verbose = true; % ... remove line if verbosity not required anymore. mStruct.verbose = true; % ... remove line if verbosity not required anymore.
mStruct.listener = L; mStruct.listener = L;
mStruct.source = S; mStruct.source = S;
mStruct.ch2 = b.timeData / 4; % here, only update channel 2 mStruct.ch2 = b.timeData / 2; % here, only update channel 2
mRes = va.callModule( modname, mStruct ) % Currently under testing, use short IRs only mRes = va.callModule( modname, mStruct )
va.disconnect()
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