Cannot receive NRPN

I've had success receiving and sending multiple types of MIDI messages using this library. Thanks so much for your work. It is a great asset. My only problem seems to be with receiving NRPN messages.

This is the incoming MIDI (via MIDI Monitor):

Based on my understanding, this should be a valid NRPN message, however, it will not trigger the callback function. Therefore, I assume webmidi.js is not accepting my NRPN as valid. I am attempting to structure my NRPN based on the MIDI spec and this article. I send controller 99 and 98 together, followed by 6 and 38, finally followed by 101 and 100.

My JS:

    let input = WebMidi.getInputByName(deviceName);
    input.addListener("nrpn", "all", function (rx) {
        console.log("Valid NRPN!");

In this same project I have used this same addListener syntax for other message types with success, for example, by replacing "nrpn" with "keyaftertouch".

Perhaps I'm making an obvious mistake. Any ideas of what I should try? I have full control over the structure of the incoming MIDI message.

Thanks again!



  • Sorry, I only just saw this other thread:

    So I guess NRPN listening is not currently supported? If so, it might be a good idea to make a note of that in the documentation until support is built for it. For now I suppose I can probably just implement my own NRPN parser using cc message listeners and conditionals.

    Looking forward to trying out V3 whenever it comes around.

  • Yes, you are so very right. I should have updated the documentation to prevent further confusion. I just did. Sorry about that.

    If you want to implement your own NRPN parsing, you can look at the source code to help you get started. As I said in the other thread, inbound NRPN messages is one of very few areas I haven't looked at myself. It will get a complete overhaul in version 3.

    If you want to try out the alpha of version 3, you just have to go to the develop branch. All the info is there to get started.

    By the way, thanks for the sponsorship!

  • Sounds good, thanks. If I get a chance I'll dip my toes into the develop branch.

    And no problem, I'm happy to support the project. This library has opened up a world of possibilities for me. 🎶

Sign In or Register to comment.