Main Content

MIDI Control for Audio Plugins

MIDI and Plugins

MIDI控制表面通常与数字音频工作站(DAW)环境中的音频插件结合使用。与插件参数同步MIDI控件为音频处理提供了一个切实的接口,并且是参数调整的有效方法。

In the MATLAB®environment, audio plugins are defined as any valid class that derives from theAudioplugin基类或AudiopluginSourcebase class. For more information about how audio plugins are defined in the MATLAB environment, seeMATLAB中的音频插件

Use MIDI withMATLABPlugins

The Audio Toolbox™ product provides three functions for enabling the interface between MIDI control surfaces and audio plugins:

  • configuremidi–– Configure MIDI connections between audio plugin and MIDI controller.

  • getmidiconnections- 获取音频插件的MIDI连接。

  • 脱节- 从音频插件断开MIDI控件。

These functions combine the abilities of general MIDI functions into a streamlined and user-friendly interface suited to audio plugins in MATLAB. For a tutorial on the general functions and the MIDI protocol, seeMIDI控制表面界面

该教程可引导您浏览MATLAB中音频插件的MIDI功能。

1.连接MIDI设备,然后启动MATLAB

在开始MATLAB之前,将MIDI控制面连接到计算机并将其打开。有关连接说明,请参阅MIDI设备的说明。如果您在连接设备之前启动MATLAB,则MATLAB连接时可能无法识别设备。要纠正问题,请与已经连接的设备重新启动MATLAB。

2. Establish MIDI Connections

Useconfiguremidito establish MIDI connections between your default MIDI device and an audio plugin. You can useconfiguremidiprogrammatically, or you can open a user interface (UI) to guide you through the process. TheconfiguremidiUI读取从你的音频插件和填充博士op-down list of tunable plugin properties. You are then prompted to move individual controls on your MIDI control surface to associate the position of each control with the normalized value of each property you select. For example, create an object ofaudiopluginexample.PitchShifter然后致电configuremidiwith the object as the argument:

ctrlpitch = audiopluginexample.pitchshifter;configuremidi(ctrlpitch)

同步到MIDI控件对话框与您的插件的可调属性自动打开。当您操作MIDI控件时,将其标识输入到Operate MIDI control to synchronize盒子。将可调属性与MIDI控件同步后,单击OK完成配置。如果您的MIDI控制表面是双向的,则将自动将同步控件的位置转移到插件指定的初始属性值。

To open a MATLAB function with the programmatic equivalent of your actions in the UI, select theGenerate MATLAB Code复选框。保存此功能使您可以重复使用设置并快速在将来的会话中建立配置。

3. Tune Plugin Parameters Using MIDI

在插件属性和MIDI控件之间建立连接后,可以使用MIDI控制表面实时调整属性。

音频工具箱提供了一个多合一的应用程序,用于运行和测试音频插件。测试工作台模仿DAW如何与插件相互作用。

打开Audio Test Benchfor yourctrlpitchobject.

audioTestBench(ctrlPitch)

When you adjust the controls on your MIDI surface, the corresponding plugin parameter sliders move. Clickto run the plugin. Move the controls on your MIDI surface to hear the effect of tuning the plugin parameters.

要建立MIDI连接并修改现有连接,请单击同步到MIDI控件button to open aconfiguremidiUI。

另外,您可以使用脚本或函数中建立的MIDI连接。例如,运行以下代码并移动同步的MIDI控件以听取俯仰变动效果:

filereader = dsp.audiofilereader(...'文件名',,,,'Counting-16-44p1-Mono-15secs.wav');DeviceWriter = AudioDeviceWriter;%音频流循环while〜ISDONE(FILEREADER)input = fileReader();输出= ctrlpitch(输入);DeviceWriter(输出);绘制limitrate;% Process callback immediately结尾release(fileReader); release(deviceWriter);

4. Get Current MIDI Connections

要查询使用音频插件建立的MIDI连接,请使用getmidiconnections功能。getmidiconnections返回带有与插件可调属性相对应的字段的结构。相应的值是嵌套结构,其中包含有关插件属性和指定的MIDI控件之间映射的信息。

Connectioninfo = getmidiconnections(ctrlpitch)
ConnectionInfo =带字段的结构:螺距速度:[1×1 struct]重叠:[1×1 struct]
Connectioninfo.pitchshift
ANS =带有字段的结构:法律:'int'最小值:-12 max:12 midicontrol:'bcf2000''的控制1081''

5.断开MIDI表面

As a best practice, release external devices such as MIDI control surfaces when you are done.

脱节(ctrlPitch)

也可以看看

应用

课程

职能

Related Topics

外部网站