DAW not recording NoteOn or pitchwheel messages, Midi:Input and Midi:Output confusion

edit: It seems I was trying to record “Midi:Input” on my track in the DAW, which does record the midi sent from my physical midi keyboard. To record my plugin generated messages I had to record “Midi:Output”. :man_facepalming:
Just wondering, is there a way to make my plugin generated midi seem like it came from a midi input device?


I’m generating some midi pitchwheel messages in my plugin.
But they are not being recorded to the track (even though I can hear the pitch bends in playback). When I move the physical pitch wheel, by contrast those messages are.
I tried limiting the LSB to 0 by pitchValue1 &= ~0x007F; but still didn’t work. I think maybe my range is too large 0-16384 but I think the docs state that range.

What do I need to do to ensure my plugin generated midi messages like pitchwheel are recorded? I read some time ago there were issues with VST3 and midi CC messages.

int pitchValue1 = juce::jlimit(-8192, 8191, static_cast<int>(lfo1Value * 8191.0f));
// Convert normalized values to the 0 to 16383 range
pitchValue1 += 8192;
juce::MidiMessage pitchWheelMsg1 = juce::MidiMessage::pitchWheel(1, pitchValue1); // Channel 1
processedMidi.addEvent(pitchWheelMsg1, sample);

Physical keyboard pitchwheel messages which are being recorded:

 E0 00 16 [Pitch Wheel] chan 1 LSB 0 MSB 22
 E0 00 1B [Pitch Wheel] chan 1 LSB 0 MSB 27
 E0 00 22 [Pitch Wheel] chan 1 LSB 0 MSB 34
 E0 00 28 [Pitch Wheel] chan 1 LSB 0 MSB 40

My plugin generated ones:

 E0 05 3A [Pitch Wheel] chan 1 LSB 5 MSB 58
 E0 2A 3A [Pitch Wheel] chan 1 LSB 42 MSB 58
 E0 50 3A [Pitch Wheel] chan 1 LSB 80 MSB 58
 E0 75 3A [Pitch Wheel] chan 1 LSB 117 MSB 58

I’ve since got the LSB to be 0 and the MSB to be in range 0-127, but still DAW won’t record pitchwheel msg.

I tried the Plugin is synth option on, and isMidiEffect On also. (windows/reaper)
image
I just have the standard busses.

bool myplugin::isBusesLayoutSupported (const BusesLayout& layouts) const
{
  #if JucePlugin_IsMidiEffect
    juce::ignoreUnused (layouts);
    return true;
  #else
    if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono()
     && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo())
        return false;
   #if ! JucePlugin_IsSynth
    if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
        return false;
   #endif
    return true;
  #endif
}

I am adding my midi events to the processed Midi buffer and swapping at the end of my processBlock()

            processedMidi.addEvent(currentMessage, samplePos); 
        }
    }
    midiMessages.swapWith(processedMidi);
}