The Wolfram|Alpha Blog is now part of the Wolfram Blog. Join us there for the latest on Wolfram|Alpha and other Wolfram offerings »
Mike Winter

Connecting Music and Math with Wolfram|Alpha

September 1, 2011 —
Comments Off

While mathematics and music are inextricably linked, music is often regarded as magical. It transcends emotion and nature in a way that is often hard, if not impossible, to properly explain. For example, many people are deeply affected by the emotional power of Beethoven’s Ninth Symphony, but may not fully understand why. Perhaps great composers simply intuit mathematical connections to music.

But even music has plenty of structures that are clearly identifiable and thus computable. At Wolfram|Alpha, we are working hard to identify these underlying structures and are coming up with exciting ways to bring them to life.

Take a musical scale as an example. While we are used to arpeggios and melodic figures fluttering through familiar musical pieces, it is helpful to see that at its core, a scale has an intrinsic structure. Each pitch relates to the next by a certain measurable difference. Further, each of the pitches, which we perceive generally as high or low in a pitch space, has a specific frequency.

g major scale

Or you can directly query the frequency of a given note:

frequency of note Gsharp3

Or you can examine the properties of a given musical interval; Wolfram|Alpha provides support for music arithmetic, allowing users to get the result of a pitch plus or minus a given interval, such as a perfect fifth:

G flat 5 plus a perfect fifth

Wolfram|Alpha can also be used as a compositional tool. Perhaps you are not sure which scales contain a certain set of notes, or maybe you want to explore several scales that contain the same notes. We can do so simply by entering in several note names and computing the results. Wolfram|Alpha will return which scales and common chords contain those notes. Click on any of these to hear the result:

c e g

Musical styles and analytical techniques are constantly evolving. And at Wolfram|Alpha, we intend to cover as much as possible, from traditional tonal theory to more recent techniques of pitch-set analysis.

Enter one or more musical keys, for example, and Wolfram|Alpha will compute a number of useful facts, including closely related keys, the input keys’ position on the circle of fifths, and diatonic triads in a given key:

f major key

In the musical set theory example below, each pitch class is assigned a number with the convention that C = 0, C# = 1, D = 2, etc. Many theorists, such as Allen Forte, use this simple technique to classify various sets of pitches and apply transformations to them, as shown when you expand the results.

c d e f g pitch set class

We hope that our efforts will help the greater community of both musicians and non-musicians alike, from pedagogy to composition itself. As the formal connection between math and music date back to the ancient Greeks, we have a lot of ground to cover and are excited about taking on the challenges of making it all computable: from Pythagoras, who was one of the first to observe that the different divisions of a string produced different harmonics, to modern pioneers of digital audio synthesis, like Max Mathews, who was one of the first to synthesize sounds using digital computers. We aim to leave no stone unturned.


Exceptional article-its been mentioned by researchers there is a certain correlation between learning the piano (note: not just any other muscial instrument) and enhanced aptitude for maths. Playing the piano trains not just dexterity of the hands, but also that of the brain. In that respect, both brain hemispheres are equally developed, yielding specific advantages as compared to the “single hemisphere strong” individuals (ie either dominantly right brain or left brain). Some food for thought. Peace.

Posted by Whitecorp September 4, 2011 at 4:45 am

I’m hoping to study music and maths at university, and this is amazing! I’ve always been interested in the links between maths and music and I use wolframalpha for my maths homework- looks like I can use it for music too!
haha, this is brilliant. thanks!

Posted by Florence September 6, 2011 at 3:56 pm

I would like to know to create a symphony like thing using the wolfram language. However, I was creating a song when I came by the problem of playing/holding a chord on the right hand and at the same time, I want to play a scale in the left hand. How do I do this? Please let me know as soon as possible. Thank you very much.

Posted by Richard June 24, 2014 at 9:13 pm