Interactive Musical Instruments

Experimental ideas for playful musical interactions powered by MIDI.js and the Web Audio API. Play instruments or make sounds by interacting with content.

musicalinteractions_800x600

View demo Download source

Today we’d like to share a little musical experiment with you. The demo has a couple of playful audio interactions that allow you to play music on instruments or simply make sounds by holding the mouse pressed and move around. All of the instruments, except the last set of small instruments, can be played using this interaction. The demo is built with the powerful MIDI.js JavaScript library by Michael Deal. It allows to easily create MIDI applications for the Web and comes with tons of useful features. Note that this demo is optimized for desktop and was not properly tested on mobile devices. We hope you enjoy this little experiment!

You’ve certainly already encountered various playable instruments and audio experiments on the Web that are powered by the amazing Web Audio API. The Web Audio Demos and the Web Audio Examples are great resources for Web Audio experiments. Josh also made this demo where you can play on SVG drums, and this record shop template is also powered by the Web Audio API. Moreover, the Above & Beneath Layout Effect shows how you can couple sounds to specific “layout” states.

Attention: Super-experimental techniques at work here, ready-to-rock browsers only!

The schematically presented instruments can all be played by clicking on the interactive parts, i.e. the keys or strings. This will make the respective sound for that note. In addition, holding the mouse pressed and moving it will allow you to play sound sequences. The guitar will play back chords if you do this movement. Depending on the position, different chords will be given off. Try strumming around.

musicalinteractions_guitar

The section with the microphone (“Voice” section) will play a recorded sound. It will get louder if you move closer to the center.

musicalinteractions_mic

The small instruments will all make sounds on click and whenever you click, a different sound or chord will be played.

musicalinteractions_tiny

Just have a try on all instrument sections and make some noise :)

Further Reading & Playing

References and Credits

Browser Support:
  • ChromeSupported
  • FirefoxSupported
  • Internet ExplorerSupported from version E
  • SafariSupported
  • OperaSupported

We hope you enjoy this experimental mash-up and find it useful and inspiring!

View demo Download source

Previous:
Next:

Tagged with:

ML is a freelance web designer and developer with a passion for interaction design. She studied Cognitive Science and Computational Logic and has a weakness for the smell of freshly ground peppercorns.

View all contributions by

Website: http://www.codrops.com

Related Articles

CSS Reference

Learn about all important CSS properties from the basics with our extensive and easy-to-read CSS Reference.

It doesn't matter if you are a beginner or intermediate, start leanirng CSS now.

Feedback 23

Follow this discussion

Leave a Comment