Play note given MIDI name


#1

Hey guys, I’ve looked around and haven’t been able to find something regarding this, but given a note name (ie. C5) is there a way to play the corresponding sound?

Thanks!


#2

Did you have a look at the MIDI tutorial?

If that doesn’t help, maybe outline your plans and your setting a little more in detail, so that people know, where you got stuck…


#3

There’s not a function to do this in JUCE but it would be relatively easy to write one yourself. You could use something like the MidiMessage::getNoteName() method but in reverse to derive a note number from a String containing a note name.

As for what you do with this message afterwards to make it “play the corresponding sound” you should follow @daniel’s advice and look at the MIDI tutorial. If you have any specific questions after reading it I’d be happy to answer them.

Ed