From 4b55eec3de38d8cb42dcb9fd344feff015ea4ed8 Mon Sep 17 00:00:00 2001 From: Giso Grimm Date: Sun, 2 Jun 2024 13:58:21 +0200 Subject: [PATCH 1/2] correct case of Q-factor for compatibility with XML variable --- plugins/src/tascar_ap_filter.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/src/tascar_ap_filter.cc b/plugins/src/tascar_ap_filter.cc index 2169ef77..5bdab769 100644 --- a/plugins/src/tascar_ap_filter.cc +++ b/plugins/src/tascar_ap_filter.cc @@ -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(); } From 97c1d97d7e0ccb73c6d40d2667121dffc7c73ef8 Mon Sep 17 00:00:00 2001 From: Giso Grimm Date: Tue, 4 Jun 2024 11:51:50 +0200 Subject: [PATCH 2/2] example script to receive OSC messages in Matlab. --- scripts/example_receive_osc.m | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 scripts/example_receive_osc.m diff --git a/scripts/example_receive_osc.m b/scripts/example_receive_osc.m new file mode 100644 index 00000000..7104d687 --- /dev/null +++ b/scripts/example_receive_osc.m @@ -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 \ No newline at end of file