Skip to content

Commit

Permalink
Merge branch 'development' of ssh://github.com/gisogrimm/tascar into …
Browse files Browse the repository at this point in the history
…development
  • Loading branch information
gisogrimm committed Jun 7, 2024
2 parents 6b88ac4 + 97c1d97 commit cc9cd82
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/src/tascar_ap_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ void biquadplugin_t::add_variables(TASCAR::osc_server_t* srv)
srv->add_float("/fc", &fc, "]0,20000]", "Cutoff frequency in Hz");
if(ftype == biquadplugin_t::equalizer) {
srv->add_float("/gain", &gain, "[-30,30]", "Gain in dB");
srv->add_float("/q", &Q, "]0,1[", "Q-factor of resonance filter");
srv->add_float("/Q", &Q, "]0,10]", "Q-factor of resonance filter");
}
// srv->add_bool("/highpass",&highpass);
srv->unset_variable_owner();
}

Expand Down
44 changes: 44 additions & 0 deletions scripts/example_receive_osc.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
addpath('/usr/share/tascar/matlab');

% Install the javaosctomatlab tool from
% https://0110.be/posts/OSC_in_Matlab_on_Windows,_Linux_and_Mac_OS_X_using_Java
% e.g., with
% wget https://0110.be/files/attachments/430/javaosctomatlab.jar
javaaddpath('javaosctomatlab.jar');

% create receiver at port 1032:
receiver = com.illposed.osc.OSCPortIn(1032);
try
% Define the OSC method to listen to:
osc_value_listener = com.illposed.osc.MatlabOSCListener();
receiver.addListener("/value", osc_value_listener);

osc_quit_listener = com.illposed.osc.MatlabOSCListener();
receiver.addListener("/quit", osc_quit_listener);

receiver.startListening();
runscript = true;
while runscript
msg = osc_value_listener.getMessageArgumentsAsDouble();
if ~isempty(msg)
msg
end
quitval = osc_quit_listener.getMessageArgumentsAsDouble();
if ~isempty(quitval)
if quitval > 0
runscript = false;
end
end
end
clear('osc_quit_listener');
clear('osc_value_listener');
receiver.stopListening();
receiver.close();
clear('receiver');
catch
clear('osc_quit_listener');
clear('osc_value_listener');
receiver.close();
clear('receiver');
warning(lasterror);
end

0 comments on commit cc9cd82

Please sign in to comment.