Skip to content

Commit

Permalink
Golf some generated lambdas to popped scales
Browse files Browse the repository at this point in the history
  • Loading branch information
frostburn committed Jul 13, 2024
1 parent d8db61b commit 30d788d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/modals/generation/HistoricalScale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function generate(expand = true) {
}
}
if (historical.format === 'cents') {
source += `\ni => cents(i, ${scale.centsFractionDigits})`
source += `\ncents(£, ${scale.centsFractionDigits})`
}
// Check if the scale can be centered around C
if (
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/modification/RandomVariance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const equave = computed(() => {
})
function modify(expand = true) {
scale.sourceText += `\nrandomVariance(${centString(modal.varianceAmount)}, ${modal.varyEquave})\ninterval => cents(interval, ${scale.centsFractionDigits})`
scale.sourceText += `\nrandomVariance(${centString(modal.varianceAmount)}, ${modal.varyEquave})\ncents(£, ${scale.centsFractionDigits})`
if (expand) {
const { visitor, defaults } = scale.getUserScopeVisitor()
scale.sourceText = visitor.expand(defaults)
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/modification/StretchScale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const modal = useModalStore()
const scale = useScaleStore()
function modify(expand = true) {
scale.sourceText += `\nstretch(${decimalString(modal.stretchAmount)})\ninterval => cents(interval, ${scale.centsFractionDigits})`
scale.sourceText += `\nstretch(${decimalString(modal.stretchAmount)})\ncents(£, ${scale.centsFractionDigits})`
if (expand) {
const { visitor, defaults } = scale.getUserScopeVisitor()
scale.sourceText = visitor.expand(defaults)
Expand Down

0 comments on commit 30d788d

Please sign in to comment.