Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjusted modify_rotate to preserve nonlinear scale data #158

Merged
merged 2 commits into from
Feb 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions src/js/modifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,23 +275,24 @@ function modify_rotate() {
console.log(transposer)
console.log(equave)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the PR isn't about these lines, but if possible and no longer needed, then please remove these console logs


// transpose each line, mod equave
for (let i = 0; i < lines.length; i++) {
if (i !== degree) {
lines[i] = moduloLine(transposeLine(lines[i], transposer), equave)
} else {
lines[i] = equave
}
console.log(i)
let rotatedLines = []

// transpose lines, mod equave
// start on degree after transposer/new root, cycle around and stop before transposer
for (let i = 1; i < lines.length; i++) {
let deg = (i + degree) % lines.length
let index = i - 1
rotatedLines[index] = moduloLine(transposeLine(lines[deg], transposer), equave)
console.log(index)
console.log(degree)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend cleaning up console.log calls once the development of a feature have been finished.

}

// sort resulting scale
lines = scaleSort(lines)
// add equave
rotatedLines.push(equave)
console.log(lines)

// update tuning input field with new tuning
jQuery('#txt_tuning_data').val(lines.join(unix_newline))
jQuery('#txt_tuning_data').val(rotatedLines.join(unix_newline))
parse_tuning_data()
jQuery('#modal_modify_rotate').dialog('close')

Expand Down