%% Host External Audio Plugin Tutorial
%
%% 1. Load External Audio Plugin
% Use the |loadAudioPlugin| function to host the |ReaDelay| VST plugin.
% Specify the complete path to the plugin or place the plugin in your
% current folder. In this example, the plugin is placed in the current
% folder and loaded by specifying the file name only.
hostedPlugin = loadAudioPlugin('readelay-standalone.dll');
%%
% Call the hosted plugin to display basic information:
hostedPlugin
%%
% The first line displays the plugin type, plugin display name, and the
% number of input and output channels for the main audio processing
% algorithm of the plugin. If you are hosting a source plugin, the number
% of output channels and the default samples per frame are displayed.
%
% By default, only the first five parameters are displayed. To display all
% parameters of the hosted plugin, click |See all 12 params|.
%
% The table provides the parameter index, parameter name, normalized
% parameter value, displayed parameter value, and the displayed parameter
% value label.
%
% <<../parameterTableCallouts.png>>
%
% The _normalized parameter value_ is always in the range [0,1] and
% generally corresponds to the position of a user interface (UI) widget in
% a DAW or the position of a MIDI control on a MIDI control surface. The
% _parameter display value_ is related to the normalized parameter value by
% an unknown mapping internal to the plugin, and typically reflects the
% value used internally by the plugin for processing.
%% 2. Set and Get Hosted Plugin Parameter Values
% You can use |getParameter| and |setParameter| to interact with the
% parameters of the hosted plugin. Using |getParameter| and |setParameter|
% is the programmatic equivalent of moving widgets in a UI or controls on a
% MIDI control surface. A typical DAW UI provides the parameter name, a
% visual representation of the normalized parameter value, the displayed
% parameter value, and the displayed parameter value label.
%
% <<../typicalDAWUserInterface_1.png>>
%%
% For example, the |Wet| parameter of |readelay-standalone.dll| has a
% normalized parameter value of |1| and a display parameter value of |+0.0|.
% The |Wet| parameter might be displayed in a DAW as follows:
%
% <<../typicalDAWUserInterface_2.png>>
%%
% With Audio System Toolbox, you can use |getParameter| to return the
% normalized parameter value and additional information about a single
% hosted plugin parameter. You can specify which parameter to get by the
% parameter index.
parameterIndex = 1;
[normParamValue,paramInfo] = getParameter(hostedPlugin,parameterIndex)
%%
% You can use |setParameter| to set a normalized parameter value of your
% hosted plugin. You can specify which parameter to set by its parameter
% index.
normParamValue = 0.5;
setParameter(hostedPlugin,parameterIndex,normParamValue)
%%
% Setting the normalized parameter value to 0.5 is equivalent to setting
% the indicator to the center of a slider in a DAW.
%
% <<../typicalDAWUserInterface_3.png>>
%%
% To verify the new normalized parameter value for |Wet|, use
% |getParameter|.
parameterIndex = 1;
[normParamValue,paramInfo] = getParameter(hostedPlugin,parameterIndex);
%%
% The |DisplayValue| for the |Wet| parameter updates from |+0.0| to |-6.0|
% because you set the corresponding normalized parameter value. The
% relationship between the displayed value and the normalized value is
% determined by an unknown mapping that is internal to the hosted plugin.
%% 3. Use Hosted Plugin to Process Audio
% To process an audio signal with the hosted plugin, use |process|.
audioIn = [1,1];
audioOut = process(hostedPlugin,audioIn);
%%
% Audio plugins are designed for variable-frame-based processing, meaning
% that you can call |process| with successive audio input frames of
% different lengths. The hosted plugin saves the internal states required
% for continuous processing. To process an audio signal read from a file
% and then written to your audio output device, place your hosted plugin in
% an audio stream loop. Use
% <matlab:web(fullfile(docroot,'dsp/ref/dsp.audiofilereader-class.html'))
% |dsp.AudioFileReader|> and
% <matlab:web(fullfile(docroot,'audio/ref/audiodevicewriter-class.html'))
% |audioDeviceWriter|> objects as the input and output to your audio stream
% loop, respectively. Set the sample rate of the hosted plugin to the
% sample rate of the audio file by using |setSampleRate|.
fileReader = dsp.AudioFileReader('Counting-16-44p1-mono-15secs.wav');
sampleRate = fileReader.SampleRate;
deviceWriter = audioDeviceWriter('SampleRate',sampleRate);
setSampleRate(hostedPlugin,sampleRate);
while ~isDone(fileReader)
audioIn = fileReader();
% The hosted plugin requires a stereo input.
stereoAudioIn = [audioIn,audioIn];
x = process(hostedPlugin,stereoAudioIn);
deviceWriter(x);
end
release(fileReader)
release(deviceWriter)
%%
% You can modify parameters in the audio stream loop. To control the |Wet|
% parameter of your plugin in an audio stream loop, create an
% <matlab:web(fullfile(docroot,'audio/ref/audiooscillator-class.html'))
% |audioOscillator|> System object(TM). Use the |fileReader|, |deviceWriter|,
% and |hostedPlugin| objects you created previously to process the audio.
osc = audioOscillator('sine',...
'Frequency',10,...
'Amplitude',0.5,...
'DCOffset',0.5',...
'SamplesPerFrame',fileReader.SamplesPerFrame,...
'SampleRate',sampleRate);
while ~isDone(fileReader)
audioIn = fileReader();
controlSignal = osc();
setParameter(hostedPlugin,1,controlSignal(1));
stereoAudioIn = [audioIn,audioIn];
x = process(hostedPlugin,stereoAudioIn);
deviceWriter(x);
end
release(fileReader)
release(deviceWriter)
%% 4. Analyze Hosted Plugin
% You can use the Audio System Toolbox measurement and visualization tools
% to display behavior information about your hosted plugin. To display the
% input and output of your hosted audio plugin, create a
% <matlab:web(fullfile(docroot,'dsp/ref/dsp.timescope-class.html'))
% |dsp.TimeScope|> object. Create a
% <matlab:web(fullfile(docroot,'audio/ref/loudnessmeter-class.html'))
% |loudnessMeter|> object and use the |'EBU Mode'| visualization to monitor
% loudness output by the hosted plugin. Use the |fileReader|,
% |deviceWriter|, |osc|, and |hostedPlugin| objects you created previously
% to process the audio.
scope = dsp.TimeScope(...
'SampleRate',sampleRate,...
'TimeSpanOverrunAction','Scroll',...
'TimeSpan',5,...
'BufferLength',5*2*sampleRate,...
'YLimits',[-1 1]);
loudMtr = loudnessMeter('SampleRate',sampleRate);
visualize(loudMtr)
while ~isDone(fileReader)
audioIn = fileReader();
controlSignal = osc();
setParameter(hostedPlugin,1,controlSignal(1));
stereoAudioIn = [audioIn,audioIn];
x = process(hostedPlugin,stereoAudioIn);
loudMtr(x);
scope([x(:,1),audioIn(:,1)])
deviceWriter(x);
end
release(fileReader)
release(deviceWriter)
release(scope)
release(loudMtr)
%%
% You can investigate the relationship between the normalized hosted plugin
% parameter values and the displayed values by creating a sweeping
% function.
%
% For example, save the |displayParameterMapping| function to your current
% folder. This function is for example purposes and might not perform as
% expected with all hosted plugins.
%
% <include>displayParameterMapping</include>
%
% Call the |displayParameterMapping| function with the hosted plugin and a
% parameter index.
displayParameterMapping(hostedPlugin,1)
%%
% If you use the |displayParameterMapping| function with a nonnumeric
% parameter, the relationship displays in the Command Window:
displayParameterMapping(hostedPlugin,3)
没有合适的资源?快使用搜索试试~ 我知道了~
yank?lanmakla_yaz?l?mlailgili_源码
共233个文件
m:111个
xml:90个
slx:15个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 193 浏览量
2021-10-02
01:04:04
上传
评论
收藏 2.3MB RAR 举报
温馨提示
onetwothree idontknowenglish
资源详情
资源评论
资源推荐
收起资源包目录
yank?lanmakla_yaz?l?mlailgili_源码 (233个子文件)
HostExternalAudioPluginTutorialExample.m 8KB
CommunicateBetweenADAWAndMATLABUsingUDPExample.m 6KB
SoundPosition.m 4KB
DiminishPlosivesFromSpeechSignalExample.m 3KB
CompareDynamicRangeLimiterAndCompressorExample.m 3KB
SpecifyNondefaultChannelMappingExample.m 3KB
DetermineOverrunExample.m 3KB
ApplySplitbandDeessingExample.m 3KB
DesktopRealTimeAudioAccelerationWithMATLABCoderExample.m 3KB
SpecifyChannelMappingForAudioDeviceWriterExample.m 3KB
CreateAnOctaveFilterBankExample.m 2KB
SplitAudioSignalIntoFourBandsExample.m 2KB
FilterAudioWithFOSParametricEqualizerExample.m 2KB
UseWeightingFilterDesignWithBiquadFilterExample.m 2KB
FilterAudioWithParametricEqualizerExample.m 2KB
UseLowShelfEqualizerExample.m 2KB
LowpassFilterAudioExample.m 2KB
SpecifyChannelMappingExample.m 2KB
myEchoPlugin.m 2KB
myEchoSystemObjectPlugin.m 2KB
CompareEffectOfOctaveBandFilteringExample.m 2KB
ExpandAudioSignalExample.m 2KB
GateAudioSignalExample.m 2KB
LimitAudioSignalExample.m 2KB
PlotMomentaryLoudnessAndLoudnessRangeOfAudioStreamExample.m 2KB
RemoveNoiseFromToneScaleExample.m 2KB
PerformMultibandParametricEqualizationExample.m 2KB
ManipulateAudioSamplesUsingWavetableSynthesizerExample.m 2KB
ControlCutoffFrequencyOfLowpassFilterExample.m 2KB
PerformFractionalOctaveBandFilteringExample.m 2KB
PerformAweightedFilteringExample.m 2KB
CompressAudioSignalExample.m 1KB
AddReverberationToAudioSignalExample.m 1KB
SynchronizePlaybackAndRecordingExample.m 1KB
CreateAMelodyByTuningOscillationFrequencyExample.m 1KB
UseRelativeScaleForLoudnessMeasurementsExample.m 1KB
ConvertMATLABCodeToAnAudioPluginExistingScriptExample.m 1KB
parameterTuningUI.m 1KB
HostExternalPluginInMATLABExample.m 1KB
simpleStrobe.m 1KB
AudioStreamFromDeviceToFileExample.m 1KB
displayParameterMapping.m 1KB
gainOscillator.m 1KB
AudioStreamFromFileToDeviceExample.m 1KB
HowToOutputValuesFromControlsExample.m 1KB
RunExternalPluginInMATLABExample.m 1KB
CompareWeightingTypesExample.m 1KB
RunExternalSourcePluginInMATLABExample.m 1KB
TriggerGainControlBasedOnLoudnessMeasurementExample.m 1KB
PassNoiseSignalThroughCrossoverFilterExample.m 1KB
ModifyWavetableWhileStreamProcessingExample.m 1KB
AudioStreamFromDeviceToDeviceExample.m 1KB
ReaderFromMicrophoneAndWriteToSpeakerExample.m 1KB
DesignParametricEqualizersExample.m 1KB
SpecifyHostedPluginParameterValuesExample.m 1KB
helperAudioToneRemoval.m 1KB
SpecifyHostedSourcePluginParameterValuesExample.m 1KB
GenerateVariableFrequencyStaircaseWaveExample.m 1KB
CompareSOSAndFOSModesExample.m 1KB
UseReverberatorToMimicAcousticEnvironmentsExample.m 1KB
UseOctaveFilterBlockExample.m 1KB
ComputeLoudnessOfAudioSignalExample.m 1KB
UseParametricEQFilterBlockExample.m 1KB
DesignHighShelfFilterExample.m 1KB
DesignLowShelfFilterExample.m 1KB
CalculateLatencyDueToDeviceBufferExample.m 1KB
ReadAudioFromFileAndPlayExample.m 1KB
TestDocAudioPluginsExample.m 1008B
ReadFromMicrophoneAndWriteToAudioFileExample.m 1000B
mySystemObjectSourcePlugin.m 997B
BandCrossoverFilteringForAStereoSpeakerSystemExample.m 992B
ChannelMappingExample.m 980B
RealTimeAudioInMATLABExample.m 941B
myBasicSourcePlugin.m 941B
mySystemObjectPlugin.m 929B
OversampleAudioSignalExample.m 923B
UseTheLoudnessMeterBlockExample.m 920B
HelperUDPPluginVisualizer.m 916B
WriteVariableFrameSizesToBufferusingaudOscExample.m 897B
GenerateVariableFrequencySineWaveExample.m 887B
CalculateLatencyDueToOutputDeviceBufferExample.m 885B
pluginWithLogMapping.m 868B
myBasicPlugin.m 863B
CompressAudioSignalBlockExample.m 848B
RemoveLowLevelNoiseExample.m 848B
SuppressVolumeOfLoudSoundsExample.m 836B
DetermineLoudnessRangeExample.m 814B
pluginWithEnumMapping.m 813B
AttenuateBackgroundNoiseExample.m 801B
UseTheWeightingFilterBlockExample.m 791B
DesignLowpassIIRFilterExample.m 769B
DesignHighpassIIRFilterExample.m 758B
EnumForEnumerationClassParameterMappingExample.m 720B
AudioProcessingScript.m 656B
ValidateFilterComplianceExample.m 647B
DetermineIntegratedLoudnessExample.m 614B
EnumForLogicalPropertiesParameterMappingExample.m 601B
LogParameterMappingExample.m 556B
IntParameterMappingExample.m 553B
Design2BandEqualizerExample.m 525B
共 233 条
- 1
- 2
- 3
呼啸庄主
- 粉丝: 74
- 资源: 4702
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0