WEBMIDI.js — Send and receive MIDI messages with ease

If you don’t want to directly use the Web MIDI API, you can use WEBMIDI.js

WEBMIDI.js makes it easy to interact with MIDI instruments directly from a web browser or from Node.js. It simplifies the control of physical or virtual MIDI instruments with user-friendly functions such as playNote(), sendPitchBend() or sendControlChange(). It also allows reacting to inbound MIDI messages by adding listeners for events such as noteon, pitchbend or programchange.

Works like a charm. Initialize it, and start listening for events.

See the Pen WebMidi.js by Bramus (@bramus) on CodePen.

In the browser you can include a self-registering script to get it. ESM and CJS flavors are also available.

WEBMIDI.js →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Join the Conversation

1 Comment

  1. Hello Bramus,
    I have a question, I’m a 75 year old organ player making my own backingtracks.
    Is it possible with WebMidi.js because it can read midi messages, to start the
    audio player in html5? So when I start playing the backingtrack starts too.
    I’m not a programmer, I’ve tried some example scripts but no results.
    Hope you have a solution for me.
    Regards Gerrit.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.