AudioPlugin GUI & decimal places

2 views (last 30 days)
Hi
The following code position two point , and calculate the attenuation between them based on distance. This is not the code I´m building, but properly ilustrate the questions I have:
1) Is it possible to display an XY plot (running as .vst) where I can show the position of each points?
2) Is it possible to define the decimal places to show for the parameters ? (when running as .vst, 3 decimal places are shown , eg 1.100 mts instead 1.1 mts). Wasn´t possible couple of years ago, but I don´t know if something has changed in latest releases.
Thanks in advance.
Br
Pablo
classdef ExperimentalGUI < audioPlugin
properties
Sx=5;
Sy=3;
Rx=5;
Ry=2;
Sz=1.7;
end
properties (Access = private)
AttDI
end
properties (Constant)
PluginInterface = audioPluginInterface('PluginName','ExperimentalGUI',...
audioPluginParameter('Sx',...
'DisplayName','Source x',...
'DisplayNameLocation','none',...
'Mapping',{'lin',0.5,9.5},...
'Label','mts',...
'Style', 'hslider','Layout', [9,5;9,8]),...
audioPluginParameter('Sy',...
'DisplayName','Source y',...
'Mapping',{'int',1,9},...
'DisplayNameLocation','none',...
'Label','mts',...
'Style', 'vslider','Layout', [3,3;7,4]),...
audioPluginParameter('Rx',...
'DisplayName','Receiver x',...
'DisplayNameLocation','none',...
'Mapping',{'lin',0.5,9.5},...
'Label','mts',...
'Style', 'hslider','Layout', [11,5;11,8]),...
audioPluginParameter('Ry',...
'DisplayName','Receiver y',...
'DisplayNameLocation','none',...
'Mapping',{'lin',0.5,9.5},...
'Label','mts',...
'Style', 'vslider','Layout', [3,1;7,2]),...
audioPluginParameter('Sz',...
'DisplayName','Heigth Source',...
'Mapping',{'lin',0.1,2.9},...
'DisplayNameLocation','none',...
'Label','mts',...
'Style', 'rotaryknob','Layout', [1,1;1,3]),... %[7,10;9,10]
audioPluginGridLayout('RowHeight', [90 10 90 10 90 10 50 10 50 10 50], ...
'ColumnWidth', [70 20 70 20 70 70 70 60],'RowSpacing',1));
end
methods
function plugin=ExperimentalGUI
needtocalculateAttenuation(plugin);
end
function out = process(plugin, in)
out=in*plugin.AttDI;
end
%%
function set.Sx(plugin, val)
plugin.Sx = val;
needtocalculateAttenuation(plugin)
end
function set.Sy(plugin,val)
plugin.Sy=val;
needtocalculateAttenuation(plugin)
end
function set.Rx(plugin, val)
plugin.Rx = val;
needtocalculateAttenuation(plugin)
end
function set.Ry(plugin,val)
plugin.Ry=val;
needtocalculateAttenuation(plugin)
end
function set.Sz(plugin,val)
plugin.Sz=val;
needtocalculateAttenuation(plugin)
end
%-----Direct Path HRTF--------
%%
function needtocalculateAttenuation(plugin) % Attenuation Calculation
LDI=sqrt((plugin.Sx-plugin.Rx)^2+(plugin.Sy-plugin.Ry)^2+(plugin.Sz-1.7)^2);
if LDI<1
plugin.AttDI=1;
else
plugin.AttDI=1/(LDI)^2;
end
end
end
end

Accepted Answer

Walter Roberson
Walter Roberson on 17 Mar 2021
2) The interface has not changed. There is no method provided to customize the display.
https://www.mathworks.com/matlabcentral/answers/489866-units-in-audio-plugin-interface?s_tid=srchtitle
  2 Comments
Pablo Panitta
Pablo Panitta on 17 Mar 2021
Edited: Pablo Panitta on 17 Mar 2021
Thanks. I opened a ticked long time ago (#03890290), and TS agent commited to send an improvement request. Seems didn´t progress.
Jimmy Lapierre
Jimmy Lapierre on 3 May 2021
You can customize the look of the GUI, but there is no way to change the number of decimal places or add a plot at this time.

Sign in to comment.

More Answers (0)

Categories

Find more on Audio Plugin Creation and Hosting in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!