Hi,
I’m trying to make my firt midi app work, compiling on Visual Studio. I managed to set up a midi input device, a midi output device, and it works perfectly. My problem is that when I call the function .setNoteNumber(), Visual Studio throws an error :
error C2662: ‘void juce::MidiMessage::setNoteNumber(int) noexcept’ : cannot convert ‘this’ pointer from ‘const juce::MidiMessage’ to ‘juce::MidiMessage &’
Here is my code :
void MainComponent::handleIncomingMidiMessage(const MidiMessage& message)
{
if(message.isNoteOnOrOff())
{
int n = message.getNoteNumber();
int a = myFunction(n);
message.setNoteNumber(n+a); // this line...
}
auto output = deviceManager.getDefaultMidiOutput();
output->sendMessageNow(message);
}
Any idea what I should try ?
Thanks in advance !