abinop
abinop

Reputation: 3183

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

Using AudioKit I am playing a note using

midi.sendEvent(AKMIDIEvent(noteOff: noteToPlay, velocity: MIDIVelocity(0), channel: MIDIChannel(0)))

Is there a command that I can use to change to volume or pitch of that played note using AudioKit?

Upvotes: 3

Views: 694

Answers (1)

abinop
abinop

Reputation: 3183

After some search, I found the indeed that the controller change events that CL has mentioned do the job.

So taking into account that the commands are

/// 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

I need to call

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

Upvotes: 4

Related Questions