Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Make rank-2 modal more robust

Add more MOS and mode names to "Moment of symmetry scale" modal.

SonicWeave changelog
- Parse square roots in val equaves
- Make abs and labs unary operators
- Implement MOS declaration
- Implement mosstep syntax
- Use `_` as the natural ASCII accidental
- Bring back semiquartal nicknames (phi, chi, psi, ome)

ref #690
  • Loading branch information
frostburn committed May 12, 2024
1 parent f0de4f0 commit 209dba9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 44 deletions.
44 changes: 16 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scale-workshop",
"version": "3.0.0-beta.24",
"version": "3.0.0-beta.25",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
Expand All @@ -18,17 +18,17 @@
"isomorphic-qwerty": "^0.0.2",
"ji-lattice": "^0.0.3",
"jszip": "^3.10.1",
"moment-of-symmetry": "^0.4.2",
"moment-of-symmetry": "^0.5.1",
"pinia": "^2.1.7",
"qs": "^6.12.0",
"sonic-weave": "github:xenharmonic-devs/sonic-weave#v0.0.34",
"sonic-weave": "github:xenharmonic-devs/sonic-weave#v0.0.35",
"sw-synth": "^0.1.0",
"temperaments": "^0.5.3",
"values.js": "^2.1.1",
"vue": "^3.3.4",
"vue-router": "^4.3.0",
"webmidi": "^3.1.8",
"xen-dev-utils": "^0.6.1",
"xen-dev-utils": "^0.7.0",
"xen-midi": "^0.2.0"
},
"devDependencies": {
Expand Down
6 changes: 4 additions & 2 deletions src/character-palette.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
"ε": "Interordinal nominal epsilon. <code>ε4</code> is a semioctave above <code>E4</code>.",
"ζ": "Interordinal nominal zeta. <code>ζ4</code> is a semioctave above <code>F4</code>.",
"η": "Interordinal nominal eta. <code>η4</code> is a semioctave below <code>G4</code>.",
"φ": "Interordinal nominal phi. <code>φ4</code> is a semifourth above <code>C4</code>.",
"χ": "Interordinal nominal chi. <code>χ4</code> is 9/8 above <code>φ4</code>.",
"ψ": "Interordinal nominal psi. <code>ψ4</code> is a semifourth below <code>C5</code>.",
"ω": "Interordinal nominal omega. <code>ω4</code> is 9/8 above <code>ψ4</code>.",
"¢": "Cent. <code>1¢</code> is equal to <code>1\\1200</code>.",
"€": "Reciprocal cent. <code>€ · 1¢</code> is <code>1</code>.",
"¶": "Geometric inverse of the Hertz. <code>¶ · 1Hz</code> is <code>1</code>.",
"µ": "Metric prefix micro. E.g. Period of oscillation <code>2000 µs</code> corresponds to frequency of oscillation <code>500 Hz</code>.",
"⟨": "Val angle bracket. <code>⟨12 19 28]</code>.",
"⟩": "Monzo angle bracket. <code>[-4 4 -1⟩</code>."
Expand Down
30 changes: 20 additions & 10 deletions src/stores/tempering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,21 @@ export const useRank2Store = defineStore('rank2', () => {
const subgroupString = state.subgroupString

// === Computed state ===
const generatorPerPeriod = computed(
() => generator.value.totalCents() / period.value.totalCents()
)
const generatorPerPeriod = computed(() => {
const p = period.value.totalCents()
if (!p) {
return 0;
}
return generator.value.totalCents() / p
})
const safeNumPeriods = computed(() => {
const value = Math.abs(parseInt(numPeriods.value as unknown as string, 10))
if (isNaN(value)) {
return 1
}
return value || 1
})
const opposite = computed(() =>
isBright(generatorPerPeriod.value, safeSize.value / safeNumPeriods.value) ? 'dark' : 'bright'
)
const opposite = computed(() => isBright(generatorPerPeriod.value, safeSize.value / safeNumPeriods.value) ? 'dark' : 'bright')

const [mosPatterns, mosPatternsError] = computedAndError(() => {
if (method.value === 'generator') {
Expand Down Expand Up @@ -219,19 +221,27 @@ export const useRank2Store = defineStore('rank2', () => {
}, [])

const circlePeriodCents = computed(() => {
const p = period.value.totalCents()
if (!p || isNaN(p)) {
return 0.0001;
}
const stretch = parseFloat(periodStretch.value)
if (isNaN(stretch)) {
return period.value.totalCents()
return p
}
return period.value.totalCents() * Math.exp(stretch)
return p * Math.exp(stretch)
})

const circleGeneratorCents = computed(() => {
const g = generator.value.totalCents()
if (isNaN(g)) {
return 0;
}
const fine = parseFloat(generatorFineCents.value)
if (isNaN(fine)) {
return generator.value.totalCents()
return g
}
return generator.value.totalCents() + fine
return g + fine
})

const safeSize = computed(
Expand Down

0 comments on commit 209dba9

Please sign in to comment.