There’s no way to push some audio to the system just at the moment when MIDI data arrives. Whenever a MIDI message is received, the system is already playing back an audio buffer that was generated previously. We’re going to use these to find out at what pitch and volume our oscillator will play. It has member functions like NoteNumber and Velocity. The ProcessMidiMsg function is passed an IMidiMsg, which describes the MIDI event in a normalized, format-independent way. when there’s automation for a plugin parameter). And it’s not just for key presses, but also for things like Pitch Bend or Control Changes ( CC) (e.g. It doesn’t matter if the note was played on a MIDI keyboard or it came from a piano roll. When a note is played or released, the plugin’s ProcessMidiMsg member function is called. When our plugin is loaded into a host, it receives all MIDI data on the track it is on. Let’s see how we can react to MIDI and start/stop the waveform at the right pitch according to the notes we’re receiving. So far we’ve been generating a steady waveform that keeps playing.