How to receive host MIDI changes?

Hello there,

I am very new to JUCE, and this question could have been asked before, but I didn’t find any clue by searching in the forum.

I am using FL Studio as software for making music, and I try to create a VST for it with JUCE.
For this VST, I need to take in account the changes on the MIDI channels that are made in the host.

How can I be notified of instrument change from the host inside the audio processor for example ?


The standard plugin formats don’t usually have facilities for knowing about things like routing changes in the host. (Or if they do, JUCE does not support those because it needs to support so many plugin formats.)


What do you mean by this?

@Xenakios I don’t really need knowing things like routing, but just which instrument is set for a specify MIDI channel for example.

Well, I’m using a library to synthesize audio from MIDI using an SF2 file. In order to specify which instrument to use when synthesizing, I must be aware of the instrument number of a specified MIDI channel, that is what I mean.

I hope this is more clear now.

You may get a MIDI program change message from the host in the MidiBuffer given to processBlock. So you need to check for those and change your sound preset accordingly.

When you say MIDI “channel” are you talking about the tracks in the FL Studio project, or the literal MIDI Channel number (between 0-15).

I don’t think you can do this with a plugin. Normally you’d present the patch/instrument selection as a parameter and allow the user to select it.

@Xenakios I receive MIDI Not ON but, no event when it’s a program change.

@Holy_City I’m talking about the MIDI channel number (which you can change on the track as same as the instrument). I see, but as I saw some plugins rendering MIDI from FL Studio, I was wondering if it’s possible with JUCE.

Well, after some tests and investigations I found out that program change MIDI event type is not received by processBlock while I can receive events when I change the MIDI track pan, volume bank change from FL studio (debug logs in in my VST).

I there something specific I should do to get program change events from the DAW / host ?

Ok, compiled my plugin using VST (Legacy), and it works now.