AudioKit:如何更改使用 AKMIDIEvent 播放的音符的音量或音调?

AudioKit: How can I change the volume or pitch of a note played with AKMIDIEvent?

使用 AudioKit 我正在使用

播放音符
midi.sendEvent(AKMIDIEvent(noteOff: noteToPlay, velocity: MIDIVelocity(0), channel: MIDIChannel(0)))

是否有命令可用于更改使用 AudioKit 播放的音符的音量或音调?

经过一些搜索,我发现 CL 提到的控制器更改事件确实可以完成这项工作。

所以考虑到命令是

/// Modulation Control
case modulationWheel = 1
/// Breath Control (in MIDI Saxophones for example)
case breathControl = 2
/// Foot Control
case footControl = 4
/// Portamento effect
case portamento = 5
/// Data Entry
case dataEntry = 6
/// Volume (Overall)
case mainVolume = 7
/// Balance
case balance = 8
/// Stereo Panning
case pan = 10
/// Expression Pedal
case expression = 11

我需要打电话

midi.sendEvent(AKMIDIEvent(controllerChange: 7, value: MIDIByte(volume), channel: MIDIChannel(0)))