Skip to content

Commit

Permalink
WIP: Round after prime mapping not in prime mapping
Browse files Browse the repository at this point in the history
TODO: Fix sonic-weave #348

ref #755
  • Loading branch information
frostburn committed Jun 15, 2024
1 parent 0e6d0e1 commit 3a27736
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/modals/modification/TemperScale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Temperament, tenneyVals, vanishCommas } from 'temperaments'
import { useTemperStore } from '@/stores/tempering'
import { useScaleStore } from '@/stores/scale'
import { useStateStore } from '@/stores/state'
import { setAndReportValidity } from '@/utils'
import { setAndReportValidity, centString } from '@/utils'
defineProps<{
show: boolean
Expand Down Expand Up @@ -48,6 +48,7 @@ function modify(expand = true) {
tenneyVals(temper.vals, temper.subgroup, temper.weights, 'cents')
)
}
scale.sourceText += `\n(* Vals = ${temper.valsString} *)`
}
} else if (temper.method === 'commas') {
if (temper.constraintsAvailable) {
Expand All @@ -65,11 +66,12 @@ function modify(expand = true) {
)
)
}
scale.sourceText += `\n(* Commas = ${temper.commasString} *)`
}
if (temper.method === 'mapping') {
scale.sourceText += `\nPrimeMapping(${temper.mappingString})`
} else if (mapping) {
scale.sourceText += `\nPrimeMapping(${mapping.map((c) => c.toFixed(state.centsFractionDigits)).join(', ')})`
scale.sourceText += `\nPrimeMapping(${mapping.map((c) => centString(c)).join(', ')})\ncents(£, ${state.centsFractionDigits})`
}
if (expand) {
const { visitor, defaults } = scale.getUserScopeVisitor()
Expand Down

0 comments on commit 3a27736

Please sign in to comment.