@a773 the implementation for these N ops is fairly naïve, they’re just simple tables of hard-coded scale/chord intervals and N.CS just indexes into the N.C table. Nothing very algorithmic going on.
// scales for N.S op
const int table_n_s[9][7] = {
{0, 2, 4, 5, 7, 9, 11}, // Major
{0, 2, 3, 5, 7, 8, 10}, // Natural Minor
{0, 2, 3, 5, 7, 8, 11}, // Harmonic Minor
{0, 2, 3, 5, 7, 9, 11}, // Melodic Minor
{0, 2, 3, 5, 7, 9, 10}, // Dorian
{0, 1, 3, 5, 7, 8, 10}, // Phrygian
{0, 2, 4, 6, 7, 9, 11}, // Lydian
{0, 2, 4, 5, 7, 9, 10}, // Myxolidian
{0, 1, 3, 5, 6, 8, 10}, // Locrian
};
// chords for N.C op
const int table_n_c[13][4] = {
{0, 4, 7, 11}, // Major 7th - 0
{0, 3, 7, 10}, // Minor 7th - 1
{0, 4, 7, 10}, // Dominant 7th - 2
{0, 3, 6, 9}, // Diminished 7th - 3
{0, 4, 8, 10}, // Augmented 7th - 4
{0, 4, 6, 10}, // Dominant 7b5 - 5
{0, 3, 6, 10}, // Minor 7b5 - 6
{0, 4, 8, 11}, // Major 7#5 - 7
{0, 3, 7, 11}, // Minor major 7th - 8
{0, 3, 6, 11}, // Dim Major 7th - 9
{0, 4, 7, 9}, // Major 6th - 10
{0, 3, 7, 9}, // Minor 6th - 11
{0, 5, 7, 10}, // 7th sus 4 - 12
};
// chord scales for N.CS op - values are indices into table_n_c
const int table_n_cs[9][7] = {
{0, 1, 1, 0, 2, 1, 6}, // Major
{1, 6, 0, 1, 1, 0, 2}, // Natural Minor
{8, 6, 7, 1, 2, 0, 3}, // Harmonic Minor
{8, 1, 7, 2, 2, 6, 6}, // Melodic Minor
{1, 1, 0, 2, 1, 6, 0}, // Dorian
{1, 0, 2, 1, 6, 0, 1}, // Phrygian
{0, 2, 1, 6, 0, 1, 1}, // Lydian
{6, 0, 1, 1, 0, 2, 1}, // Locrian
{2, 1, 6, 0, 1, 1, 0}, // Myxolydian
};