Sunday, April 3, 2011

Music Theory in JavaScript

VexFlow is a pretty cool looking HTML5/JavaScript music notation renderer. And even cooler, you can directly access the underlying music theory API.
Most of my work last week consisted of writing music theory code. VexFlow now has a neat little music theory API, that gives you answers to questions like the following:

  • What note is a minor 3rd above a B?
  • What are the scale tones of a Gb Harmonic Minor?
  • What relation is the C# note to an A Major scale? (Major 3rd)
  • What accidentals should be displayed for the perfect 4th note of a G Major scale?
  • etc.

The API is part of VexFlow, and can be used independently of the rendering API. Take a look at music.js in the VexFlow GitHub repository for the complete reference. There's also a handy key management library for building scores in keymanager.js.
Definitely a neat piece of software, and the rendering is pretty too (check out the tests page and scroll down to see numerous examples).

1 comment:

  1. You have shared a nice article here. Your article is very informative and useful for those who are interested. Thank you for sharing this article here. music theory books

    ReplyDelete