Skip to content

Commit

Permalink
partial fix to #1281
Browse files Browse the repository at this point in the history
  • Loading branch information
walterbender committed Jan 4, 2019
1 parent d1aec5b commit 4771436
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions js/utils/musicutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,64 @@ function getNote(noteArg, octave, transposition, keySignature, movable, directio
}
}

if (movable) {
switch(mode) {
case 'dorian':
var i = SOLFEGENAMES.indexOf(solfegePart);
i += 6;
if (i > 6) {
i -= 7;
}
solfegePart = SOLFEGENAMES[i];
break;
case 'phrygian':
var i = SOLFEGENAMES.indexOf(solfegePart);
i += 5;
if (i > 6) {
i -= 7;
}
solfegePart = SOLFEGENAMES[i];
break;
case 'lydian':
var i = SOLFEGENAMES.indexOf(solfegePart);
i += 4;
if (i > 6) {
i -= 7;
}
solfegePart = SOLFEGENAMES[i];
break;
case 'mixolydian':
var i = SOLFEGENAMES.indexOf(solfegePart);
i += 3;
if (i > 6) {
i -= 7;
}
solfegePart = SOLFEGENAMES[i];
break;
case 'minor':
case 'aeolian':
var i = SOLFEGENAMES.indexOf(solfegePart);
i += 2;
if (i > 6) {
i -= 7;
}
solfegePart = SOLFEGENAMES[i];
break;
case 'locrian':
var i = SOLFEGENAMES.indexOf(solfegePart);
i += 1;
if (i > 6) {
i -= 7;
}
solfegePart = SOLFEGENAMES[i];
break;
case 'major':
case 'ionian':
default:
break;
}
}

if (halfSteps.indexOf(solfegePart) !== -1) {
var index = halfSteps.indexOf(solfegePart) + offset;
if (index > 11) {
Expand Down

0 comments on commit 4771436

Please sign in to comment.