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

Update SonicWeave and always show custom warnings #668

Merged
merged 4 commits into from
Apr 27, 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Feature: Show labels, ratios, cents and frequencies on the tuning table [#534](https://github.com/xenharmonic-devs/scale-workshop/issues/534)
* Bug fix: Extreme ratios now only break parts of the tuning table that do not have IEEE floating point representation and format better when non-finite [#631](https://github.com/xenharmonic-devs/scale-workshop/issues/631), [#632](https://github.com/xenharmonic-devs/scale-workshop/issues/632)
* Style fix: Make checkbox and radio button labels more consistent [#644](https://github.com/xenharmonic-devs/scale-workshop/issues/644)
* Beta cycle issues: [#643](https://github.com/xenharmonic-devs/scale-workshop/issues/643), [#640](https://github.com/xenharmonic-devs/scale-workshop/issues/640), [#577](https://github.com/xenharmonic-devs/scale-workshop/issues/577), [#513](https://github.com/xenharmonic-devs/scale-workshop/issues/513), [#658](https://github.com/xenharmonic-devs/scale-workshop/issues/658)
* Beta cycle issues: [#643](https://github.com/xenharmonic-devs/scale-workshop/issues/643), [#640](https://github.com/xenharmonic-devs/scale-workshop/issues/640), [#577](https://github.com/xenharmonic-devs/scale-workshop/issues/577), [#513](https://github.com/xenharmonic-devs/scale-workshop/issues/513), [#658](https://github.com/xenharmonic-devs/scale-workshop/issues/658), [#664](https://github.com/xenharmonic-devs/scale-workshop/issues/664), [#666](https://github.com/xenharmonic-devs/scale-workshop/issues/666)
* Alpha cycle issues: [#574](https://github.com/xenharmonic-devs/scale-workshop/issues/574), [#579](https://github.com/xenharmonic-devs/scale-workshop/issues/579)

## 2.4.1
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

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

4 changes: 2 additions & 2 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.18",
"version": "3.0.0-beta.19",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
Expand All @@ -21,7 +21,7 @@
"moment-of-symmetry": "^0.4.2",
"pinia": "^2.1.7",
"qs": "^6.12.0",
"sonic-weave": "github:xenharmonic-devs/sonic-weave#v0.0.23",
"sonic-weave": "github:xenharmonic-devs/sonic-weave#v0.0.26",
"sw-synth": "^0.1.0",
"temperaments": "^0.5.3",
"values.js": "^2.1.1",
Expand Down
6 changes: 3 additions & 3 deletions src/components/VirtualKeyInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { formatHertz, formatExponential, formatCents } from '@/utils'

const props = defineProps<{
label: string
cent: number
cents: number
ratio: number
frequency: number
showLabel: boolean
showCent: boolean
showCents: boolean
showRatio: boolean
showFrequency: boolean
}>()
Expand All @@ -18,7 +18,7 @@ const props = defineProps<{
<div v-if="props.showLabel">
<strong>{{ props.label }}</strong>
</div>
<div v-if="props.showCent">{{ formatCents(props.cent, 0) }}</div>
<div v-if="props.showCents">{{ formatCents(props.cents, 0) }}</div>
<div v-if="props.showRatio">{{ formatExponential(props.ratio) }}</div>
<div v-if="props.showFrequency">{{ formatHertz(props.frequency) }}</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/components/VirtualKeyboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const props = defineProps<{
colorMap: ColorMap
labelMap: LabelMap
showLabel: boolean
showCent: boolean
showCents: boolean
showRatio: boolean
showFrequency: boolean
}>()
Expand All @@ -32,7 +32,7 @@ type VirtualKey = {
index: number
color: string
frequency: number
cent: number
cents: number
ratio: number
label: string
}
Expand All @@ -48,7 +48,7 @@ const virtualKeys = computed(() => {
const index = props.baseIndex + x * horizontal + y * vertical
const color = props.colorMap(index)
const frequency = props.frequencies[index]
const cent = props.centss[index]
const cents = props.centss[index]
const ratio = frequency * inverseBaseFreq
const label = props.labelMap(index)
row.push({
Expand All @@ -57,7 +57,7 @@ const virtualKeys = computed(() => {
index,
color,
frequency,
cent,
cents,
ratio,
label
})
Expand Down Expand Up @@ -89,11 +89,11 @@ const isMousePressed = ref(false)
>
<VirtualKeyInfo
:label="key.label"
:cent="key.cent"
:cents="key.cents"
:ratio="key.ratio"
:frequency="key.frequency"
:showLabel="props.showLabel"
:showCent="props.showCent"
:showCents="props.showCents"
:showRatio="props.showRatio"
:showFrequency="props.showFrequency"
/>
Expand Down
6 changes: 1 addition & 5 deletions src/exporters/korg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,7 @@ export class KorgExporter extends BaseExporter {

// prepare files for zipping
const format = getKorgModelInfo(this.modelName)
const tuningInfo = this.getTuningInfoXml(
this.modelName,
'ScaleWorkshop',
scale.title
)
const tuningInfo = this.getTuningInfoXml(this.modelName, 'ScaleWorkshop', scale.title)
const fileInfo = this.getFileInfoXml(this.modelName)
const [fileNameHeader, fileType] = this.useOctaveFormat
? ['TunO_000.TunO_', format.octave]
Expand Down
7 changes: 6 additions & 1 deletion src/scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export class Scale {
* @param baseFrequency Base frequency of 1/1.
* @param baseMidiNote MIDI note corresponfing to base frequency
*/
constructor(intervalRatios: number[], baseFrequency: number, baseMidiNote: number, title: string) {
constructor(
intervalRatios: number[],
baseFrequency: number,
baseMidiNote: number,
title: string
) {
this.intervalRatios = intervalRatios
this.baseFrequency = baseFrequency
this.baseMidiNote = baseMidiNote
Expand Down
11 changes: 9 additions & 2 deletions src/stores/scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,12 @@ export const useScaleStore = defineStore('scale', () => {
}
if (ratios.length) {
const name = str.bind(ev)
scale.value = new Scale(ratios, visitorBaseFrequency, baseMidiNote.value, ev.rootContext!.title)
scale.value = new Scale(
ratios,
visitorBaseFrequency,
baseMidiNote.value,
ev.rootContext!.title
)
if (autoColors.value === 'silver') {
colors.value = intervals.map(
(interval, i) =>
Expand All @@ -408,7 +413,9 @@ export const useScaleStore = defineStore('scale', () => {
scale.value = new Scale(TET12, visitorBaseFrequency, baseMidiNote.value, name.value)
colors.value = defaultColors(baseMidiNote.value)
labels.value = defaultLabels(baseMidiNote.value, accidentalPreference.value)
warning.value = 'Empty scale defaults to 12-tone equal temperament.'
if (!warning.value) {
warning.value = 'Empty scale defaults to 12-tone equal temperament.'
}
}
const noteNumber = baseMidiNote.value
if (!warning.value && isBlackMidiNote(noteNumber) && !userDeclaredPitch) {
Expand Down
Loading