User:Contribution/Ups & downs notation in Python: Difference between revisions
Contribution (talk | contribs) No edit summary |
Contribution (talk | contribs) No edit summary |
||
| Line 7: | Line 7: | ||
for a in range(-5, 6): | for a in range(-5, 6): | ||
pos = (a * steps_per_fifth) % steps_per_octave | pos = (a * steps_per_fifth) % steps_per_octave | ||
oadj = -1 if (pos < steps_per_octave | oadj = -1 if (2 * pos < steps_per_octave and a in POS_ALTS) else (1 if (2 * pos > steps_per_octave and a in NEG_ALTS) else 0) | ||
naturals.append([pos, [0, a, oadj]]) | naturals.append([pos, [0, a, oadj]]) | ||
naturals.sort(key=lambda x: (x[0], -x[1][1], x[1][2])) | naturals.sort(key=lambda x: (x[0], -x[1][1], x[1][2])) | ||