Hello everyone. This is one of the strangest bugs I’ve ever encountered. For a few weeks I’ve been using the below demo code to create a midi sequencer VST. I have it hooked this up to a midi synth and then to an audio output using the Juce VSTHost. This has been working fine. All the sudden I noticed it was no longer making sound. I managed to reduce my processBlock code down to simply sending a note 60 on event once and never turning it off. Still there is no sound. I verified that I am sending the audio to the correct device and everything. What is odd is that I’ve loaded the plugin in reaper, and I can see the note being triggered, but I cannot hear it. In fact, when I record in reaper, it actually records all the notes properly for me to play back and hear, but they will not play while recording. Thank you for any insight.
void DoomTestAudioProcessor::addMessageToBuffer(const juce::MidiMessage& message, MidiBuffer& midiBuffer)
{
auto timestamp = message.getTimeStamp();
auto sampleNumber = (int)(timestamp * getSampleRate());
midiBuffer.addEvent(message, sampleNumber);
}
void DoomTestAudioProcessor::setNoteNumber(int noteNumber, bool on, MidiBuffer& midiMessages)
{
if (on) {
auto message = juce::MidiMessage::noteOn(1, noteNumber, (juce::uint8)100);
message.setTimeStamp(juce::Time::getMillisecondCounterHiRes() * 0.001);
addMessageToBuffer(message, midiMessages);
}
else {
auto message = juce::MidiMessage::noteOff(1, noteNumber, (juce::uint8)100);
message.setTimeStamp(juce::Time::getMillisecondCounterHiRes() * 0.001);
addMessageToBuffer(message, midiMessages);
}
}
