Trying my hand at loading my own SOUL patch and playing it, using the SOULPatchHostDemo and PadSynth.soulpatch as example.
Loading and creating of a player works, but when I send a MIDI note on to it I always hear a high-pitched sound. Playing around in the demo tells me I’m hearing pitch 0x6C
, even though I’m clearly sending 0x3C
to it (in fact, it doesn’t really matter which pitch I use, always sounds the same). Here’s the corresponding code:
std::array<soul::patch::MIDIMessage, 1> midiMessages = {
soul::patch::MIDIMessage{ 0, 0x90, 0x3C, 0x64 }
};
context.incomingMIDI = midiMessages.data();
if (!triggered)
{
context.numMIDIMessages = midiMessages.size();
triggered = true;
} else {
context.numMIDIMessages = 0;
}
Thing I’ve checked:
- I’m creating the player with the correct sample rate (44100) and buffer size (512) using
compileNewPlayer()
(the other arguments are nullptr, is that ok?). - Input channel count is 0, output channel count is 0 for the
RenderContext
. - No compile messages (error or warning) were given.
Normally I’d dive into the code myself and figure out what goes wrong, but clearly I can’t do that with the dylib right now. Does the JUCE/SOUL team have any idea what I could be missing? The demo app works fine, using the same dylib, so the problem must be somewhere in my code, but I’ve yet to find a clue.