The set is 0, 2, 4, 5, 7, 9, 11 (or A), 12 (or B)
For this set
The following list shows the interval spacing between the three notes; and then the combinations of the three notes.
In short: 40 × 3! = 240 ;)
I didn't do the coding on my own - two functions on Stack Overflow that were not chosen as answers, but were nevertheless correct (permute by zavg; and array_combination by Piotr Salaciak.)
$n = array('0','2','4','5','7','9','11','12');
//this is really a permutation
$C = array_combination(3,$n);
$by_in = array();
echo "<dl>";
foreach($C as $c){
//create an interval class for each set
$in_f = $c[1] - $c[0];
$in_s = $c[2] - $c[1];
$in_class = "$in_f-$in_s";
//do hexadecimal notation for readability
$c = str_replace('11','A',$c);
$c = str_replace('12','B',$c);
//don't fill the interval class if it is already filled
if(!isset($by_in[$in_class])){
$by_in[$in_class] = "$c[0]$c[1]$c[2]";
echo "<dt>$in_class</dt>";
//this is really a combination
$perms = permute($by_in[$in_class]);
foreach($perms as $p){
echo "<dd>$p</dd>";
}
}
}
This is still early morning thinking.The PHP I cobbled together works out an "interval order class"; it takes the three notes and works out the intervals between the first and the second notes, then the second and third notes. If we work these out first, then we can calculate the rest pretty easily, without code or heavy maths.
Here, tt means tritone; S means semitone, and T means tone.
1(VIII) + 2(S) + 5(T) + 3(iii) + 3(III) + 4(P4) + 4(P5) + 1(tt) + 1(vi) + 2(VI) + 1(vii) + 1(VII) = 28 intervals, 12 types
need to exclude the octave, leaving 11 types of interval.
But this is the wrong question, because the choice of the second interval is constrained by the first.
By hand:
First choice | next interval options |
---|---|
S | T, III, tt, V |
T | T, iii, III, IV, V, vi, vii |
iii | T, III, IV, tt, V, vi |
III | S, T, iii, IV, V, vi |
IV | T, iii, III, tt, V |
V | S, T, iii, III, IV |
tt | S |
vi | none |
VI | S, T, iii |
vii | none |
VII | S |
So 40 choices.
Two intervals produce three notes; there are 3! = 6 ways of combining three items; so 40 × 6 = 240 unique three-note sets within a major scale.