フィルターのクリア

How to implement tic, toc and pause in audioPlugins?

1 回表示 (過去 30 日間)
Lorenzo Tonelli
Lorenzo Tonelli 2022 年 9 月 29 日
コメント済み: Lorenzo Tonelli 2022 年 9 月 29 日
I'm implementing a digital delay using real-time audio plugins. I need a button on the GUI that does the same of this code. Basically I want to give the delay time as an average time between 4 inputs, using a dedicated button on the GUI to avoid knowing the exact value of such time in milliseconds. I'm sure I cannot just use this code, is there an "optimal way" to do it?
a = zeros(1,4);
disp('Press now to start the sequence')
pause
tic
%requesting input
disp('Press')
pause
a(1) = toc;
tic
%requesting input
disp('Press')
pause
a(2) = toc;
tic
%requesting input
disp('Press')
pause
a(3) = toc;
tic
%requesting input
disp('Press')
pause
a(4) = toc;
%average
time = mean(a);

回答 (1 件)

Kevin Holly
Kevin Holly 2022 年 9 月 29 日
If you are trying to create a UI, you could create an app with App Designer as shown attached. Let me know if this addresses your question.
  1 件のコメント
Lorenzo Tonelli
Lorenzo Tonelli 2022 年 9 月 29 日
I'm forced to use the UI designer with object oriented languages, this one:
properties (Constant)
PluginInterface = audioPluginInterface(...
audioPluginParameter('DoubleEcho', ...
'Style','vtoggle', ...
'Layout',[2,6], ...
'DisplayNameLocation','Above'),...
audioPluginParameter('Gain', ...
'DisplayName','Echo Level', ...
'Mapping', {'lin',0,3}, ...
'Style', 'rotaryknob', ...
'Layout', [2,1], ...
'DisplayNameLocation','Above'), ...
audioPluginParameter('Time',...
'DisplayName', 'Echo Time',...
'Mapping', {'lin',0,1}, ...
'Label', 'Seconds', ...
'Style', 'rotaryknob', ...
'Layout', [2,2], ...
'DisplayNameLocation','Above'),...
audioPluginParameter('Repetitions', ...
'DisplayName', 'Repetitions',...
'Mapping',{'int',1,2}, ...
'Style', 'rotaryknob', ...
'Layout', [2,4], ...
'DisplayNameLocation','Above'), ...
audioPluginParameter('Mode', ...
'DisplayName', 'Amplitude Decay Mode', ...
'Mapping', {'enum' , 'Linear', 'Exponential','Aggressive'}, ...
'Style', 'dropdown', ...
'Layout', [4,1;4,2], ...
'DisplayNameLocation','Above'), ...
audioPluginGridLayout(...
'RowHeight', [ 20, 130, 20, 30, 80], ...
'ColumnWidth', [100, 100, 40, 80, 20, 80]) ...
)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulation, Tuning, and Visualization についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by