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

Admit cents as the equave when generating equal temperaments #808

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change log

## 3.0.2
* Bug fix: Admit cents as the equave when generating equal temperaments [#803](https://github.com/xenharmonic-devs/scale-workshop/issues/803)

## 3.0.1
* Feature: Apply CS margin to variety signature on Analysis tab [#796](https://github.com/xenharmonic-devs/scale-workshop/issues/796)
* Feature: Approximate Tenney-tall fractions on Analysis tab [#796](https://github.com/xenharmonic-devs/scale-workshop/issues/796)
Expand Down
16 changes: 15 additions & 1 deletion cypress/e2e/basic.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,18 @@ describe("Scale generation/modification", () => {
cy.get("button").contains("Done").click();
cy.get("#scale-data").should("contain.value", "8/7");
});
});

it("generates and displays 5 equal divisions of 1234.5 cents", () => {
cy.visit("/");

cy.get("a").contains("New scale").click();
cy.get("a").contains("Equal temperament").click();
cy.get("#equave").clear();
cy.get("#equave").type('1234.5');
cy.get("button").contains("OK").click();
cy.get("#scale-data").should("contain.value", "1\\5 ed 1234.5");

// This is how SonicWeave formats "3\5 ed 1234.5"
cy.get('.tuning-table').should("contain", "2469\\4000");
})
});
12 changes: 9 additions & 3 deletions src/components/modals/generation/EqualTemperament.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ function generate(expand = true) {
}
} else {
const ed = modal.divisions
const ji = modal.equave.toString()
if (expand || !modal.simpleEd) {
source = modal.degrees.map((steps) => `${steps}\\${ed}<${ji}>`).join('\n')
try {
// Prefer restricted 7\13<3> form
const ji = modal.equave.toFraction().toFraction()
source = modal.degrees.map((steps) => `${steps}\\${ed}<${ji}>`).join('\n')
} catch {
// Fall back to generic 7\13 ed 1912.3456 form
source = modal.degrees.map((steps) => `${steps}\\${ed} ed ${modal.equave}`).join('\n')
}
} else {
source = `tet(${ed}, ${ji})`
source = `tet(${ed}, ${modal.equave})`
}
}
emit('update:source', source)
Expand Down
Loading