SOUL PadSynth always plays note 0x6C

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.

The padsynth is a bit of a complicated beast, and expects to get MPE with continuous pitch bend data (so I don’t think a note on channel 1 would technically be valid MPE). Maybe try a simpler sine synth to start with? Or feed it real MIDI from a real device to make sure you’re not just giving it duff input.

Aaaah, yes, that was it! Thanks for clearing that up, Jules :slight_smile:

(Didn’t know SOUL supported MPE parsing out-of-the-box!)

Edit:
Given that pretty much all the .soul’s in the example are MPE parsed, might be interested to include some more actual simple ones to avoid confusion? For testing purposes?

In fact: this leads me to another question: is there a parser that just converts midi::Message to NoteEvents::noteOn/noteOff/etc.? Like midi::MPEParser, but for parsing regular ol’ MIDI?

I’ve got more questions than these, I’ll take them over to the Slack channel for details :slight_smile: