Hi, I am currently developing a poly synth Plug-In where all the DSP part is coded in Faust.
I followed the tutorial on the faust website about how to incorporate it into a JUCE project.
For those who might not know how it works, faust provides a .h file containing a FaustPolyEngine class that can be instanciated to do the DSP work.
For example in the processBlock function of the AudioProcessor, by running :
for (int channel = 0; channel < totalNumOutputChannels; ++channel)
for(int i=0; i<buffer.getNumSamples(); i++)
*buffer.getWritePointer(channel,i) = outputs[channel][i];
we copy the generated audio in the AudioBuffer. Where faustObject is of type FaustPolyEngine, and output is a float array containing the generated samples.
But the “tricky” part is that the faustObject doesn’t use the MidiBuffer “midiMessages” to retrieve which note must be played.
Instead, every time a note is pressed or released, we must call on of those functions:
This makes it easy to link an external midi input using MidiInputCallback and MidiKeyboardStateListener.
However, by doing so, only the notes that are actually played on that midi input will be considered.
So when I load the plugin in Ableton for example, I can’t play with the computer keyboard, and the midi clip on the track do not produce any sound.
Since those note are in the MidiBuffer “midiMessages”, I am wondering if there is a way to create some sort of MidiInput from everything that is in the MidiBuffer “midiMessages”.
This is probably not the only way of solving this problem so I am open to anything that could help me.
Thank you fo your help.