In order to programmatically generate a lot of scales at once, it would save time to have a list of various interval sets in integer format. Originally, this was assuming lists of intervals (each covering multiple scales) would likely be more prevalent. However, either would be sufficient.

I am referring to an interval as the number of semitones separating a note in the scale [e.g. interval set: 1,2,1,2,1,2,1,2]).

  • Are you looking for something like, "A perfect 5th = 7, an octave = 12"? It's not clear exactly what you're looking for. What are you hoping to do with these integers? Are you familiar with MIDI? I think your understand of "interval" isn't as good as it might be also. There are intervals wider than an octave. An interval is really just the musical distance between any two notes. Nov 9, 2015 at 18:22
  • Here, try this: musictheoryblog.blogspot.com/2007/01/intervals.html Nov 9, 2015 at 18:49
  • Thank you for the timely responses. Yes, whatever the interval (e.g. 1,2,1,2,1,2,1) would be for 'A perfect 5th,' or any other common interval, is what I am looking for. "There are intervals wider than an octave." This did not occur to me, and its potential implications are interesting. My direct use of the integers will be to programmatically (in python) generate scale lists based on each interval.
    – Phillip
    Nov 9, 2015 at 20:02
  • 1
    I think there's something interesting you're asking about and I still don't quite get it. One number I might assign to a perfect 5th is 7, because there are 7 semitones between the two notes of a perfect 5th. Also, if you take the MIDI note numbers of two notes that make a perfect 5th and you subtract the smaller from the larger, you'll get 7. I'm confused because something like 2-1-2-2-1-2-2 is more like a scale definition in numbers of semitones, ascending. A scale pattern sort of generates intervals but I wonder if you're looking for scales more than intervals? Nov 9, 2015 at 20:42
  • I wrote a long comment but I escaped the page...to sum up: In order to programmatically generate a lot of scales at once, it would have saved time to have a list of various interval sets in this format (the space between each note in the scale). Why your comment ('intervals wider than an octave') is interesting is that it could pertain to an interesting problem I ran into: Programmatically determining which notes can deviate from a standard (e.g. C major) scale and not clash. To do this directly, the underlying frequencies of complementary notes may be useful. Profound dejavu
    – Phillip
    Nov 9, 2015 at 21:00

2 Answers 2


Most of the Wiki articles on scales and chords describe them in multiple notations. Most notations start with some reference set of notes. For example 1 3 5 to describe a triad that works on both a major and minor scale. Or 1 b3 5 to descibe a minor chord on a major scale.

But it sounds like you want a notation relative to the chromatic scale, or semitone counts. So a major scale would be 0 2 4 5 7 9 11, and minor 0 2 3 ..., or alternatively 2 2 1 2 2 2 1 to describe the steps.

The pitch constellations article shows a lot of this information in a nice graphical form. You could easily translate that to Python lists.


A while back I wrote myself a little Python script to generate guitar fretboard patterns. I identified all notes relative to the lowest note, mapped those onto the 6 strings. Octaves are modulus 12.

  • It appears pitch constellations may be current shortest path in deriving scales in integer format.
    – Phillip
    Nov 10, 2015 at 20:15
  • That is, I see that they are read as essentially pointing to their respective semitones, as if on the face of a clock. However, it appears they are image based, so the issue of having to read each may be at least as cumbersome as reading the scales themselves to find the intervals. Constellations perhaps do, however, point to the potential for descriptive lists of the semi-tones used in each constellation, as alluded to on the wiki page
    – Phillip
    Nov 10, 2015 at 20:29


I'm not sure if this file will give you what you need exactly, but I have a JSON file which defines the various intervals with several values including an integer for the number of chromatic steps.


I hope this can help,


Not the answer you're looking for? Browse other questions tagged or ask your own question.