필터 지우기
필터 지우기

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 CenterFile Exchange에서 Simulation, 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