back to list

Interval Calculator version 7.2 how it works

🔗john777music <jfos777@...>

6/12/2010 10:29:17 AM

The Interval Calculator program can be found in the JohnOSullivan folder in the "Files" section. There is a Mac OSX and a PC version.

Here's how it works. Take two sine wave tones with relative frequencies of 2 and 3. My formula (well tested) for the consonance of a sine wave interval (no overtones) is...

(2 + 1/x + 1/y - diss(x,y))/2

Assign each tone an amplitude of 1.0. The '2' at the left hand side of the formula is the sum of the strength values of the two tones (1 + 1). The 1/x + 1/y relates to the periodicity of the interval and the diss(x,y) describes the dissonance (beats).

'x' is 3 and 'y' is 2. If y/x is less than or equal to 0.9375 (which is 15/16) then the formula for dissonance is simply y/x. If y/x is greater than 0.9375 then the formula for dissonance is
(1 - y/x)*15.

So 3/2 put through the formula is (2 + 0.333 + 0.5 - 0.667)/2 = 1.0833. The 2 at the the right hand side of a formula is a guess that seems to work, perhaps it's an average per number of notes considered, in this case 2. When you divide by 2 then all intervals (using sine waves) with a value greater than 1.0 sound major and intervals with a value less than 1.0 sound minor.

The next step is to use this formula with, say, the first 1024 harmonics of both notes in an interval using complex tones (i.e. tones with a harmonic series where the frequencies of the harmoics are 1a, 2a, 3a, 4a, 5a etc and the amplitudes of the harmonics are b, b/2, b/3, b/4, b/5 etc.

Take 5/7 as an example. The first 1024 harmonics of both the 5 and the 7 are listed (e.g. 5, 10, 15, 20 etc. and 7, 14, 21, 28 etc). If you pair all 2048 elements (harmonics/partials) with each other you run into huge negative numbers (I think this has to do with the infinite nature of the harmonics whose sum approaches infinity). The trick I used was to pair only the first 32 elements of each note with all the other 2000 or so elements to get a rough approximation.

Here is an example of one pairing that occurs. Consider the 5's third element (15) and 7's fourth element (28). The strength of 5's third element on its own is 1/3 (0.333) and the strength of 7's fourth element on its own is 1/4 (0.25). So the left hand side of the equation should be 0.333 + 0.25 = 0.583 (this is the sum of the amplitudes). The 1/x + 1/y - diss(x,y) is as usual but the result here must be weighted according to the strength (amplitude) of the quiter element (in this case the 4th element) so the 1/x + 1/y - diss(x,y) result should be divided by 4. Just as a chain is only as strong as its weakest link so the strength value of an interval is only as strong as the quieter element.

I'm not sure but I think the 0.583 above should be added to the (1/x + 1/y - diss(x,y)) and this new sum divide by 2. All 2048 elements should be paired with eachother once (i.e. the 1024 elements of the 5 are paired with eachother, the 1024 elements of the 7 are paired with eachother and all the elements of *both* notes ae paired with eachother. Ratios that occur should *not* be simplified (e.g. with an 8/4 ratio, the 8 and 4 are used and not 2 and 1 which is 8/4 simplified to 2/1).

When I wrote my program, because I used only the first 32 elements of both notes paired with the 2000 or so other elements I wasn't sure what the left hand side value (the sum of the amplitudes) should be (theoretically infinite) but I knew that it should be a constant (i.e. it should always have the same value) no matter what interval is considered. So I ignored the left hand side (sum of the amplitudes) of the formula and just used the 1/x + 1/y - diss(x,y). When I ran the program I was able to estimate the "sum of the amplitudes" value by testing various intervals. If the interval was clearly dissonant then it should have a negative value. If clearly consonant it should have a positive value. So I added a value (I think it was between 50 and 60) to each result so that the intervals with a value greater than zero sounded good and less than zero, bad. Admittedly the zero point was set according to my own taste and some intervals I consider bad are considered good by others. Even so, the hierarchy of intervals is still the same and anyone could choose their own cut off point (e.g. -1.6).

As regards chords with 3 or more notes, if every possible dyad/inteval in a chord has a value greater than zero, according to my calculator, then the chord should be good. These good dyads/intervals are all within plus or minus 6.775877 cents (256/255) of a "true" interval.
.
John.

P.S. my formula and calculator could be wrong but if they are correct, or close to correct then that would be someting. They seem consistent to me so far.