Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into lattice-click-support
Browse files Browse the repository at this point in the history
  • Loading branch information
wilckerson committed Jun 10, 2024
2 parents a0ebe67 + 24458ab commit 5c1b10a
Show file tree
Hide file tree
Showing 40 changed files with 2,310 additions and 383 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* Feature: New "repeat" modifier [#406](https://github.com/xenharmonic-devs/scale-workshop/issues/406)
* Feature: Implement multi-channel MIDI mode compatible with the Lumatone [#649](https://github.com/xenharmonic-devs/scale-workshop/pull/649)
* Feature: Show labels, ratios, cents and frequencies on the tuning table [#534](https://github.com/xenharmonic-devs/scale-workshop/issues/534)
* Feature: Full width view dedicated to the MOS pyramid [#700](https://github.com/xenharmonic-devs/scale-workshop/issues/700)
* Feature: Import scale title from .scl files
* Bug fix: Fix handling of trailing comments when importing .scl files [#706](https://github.com/xenharmonic-devs/scale-workshop/issues/706)
* 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), [#664](https://github.com/xenharmonic-devs/scale-workshop/issues/664), [#666](https://github.com/xenharmonic-devs/scale-workshop/issues/666)
Expand Down
85 changes: 60 additions & 25 deletions package-lock.json

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

11 changes: 6 additions & 5 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.31",
"version": "3.0.0-beta.41",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
Expand All @@ -15,20 +15,21 @@
"format": "prettier --write src/"
},
"dependencies": {
"harmonic-entropy": "^0.2.0",
"isomorphic-qwerty": "^0.0.2",
"ji-lattice": "^0.0.3",
"ji-lattice": "^0.2.0",
"jszip": "^3.10.1",
"moment-of-symmetry": "^0.5.2",
"moment-of-symmetry": "^0.8.1",
"pinia": "^2.1.7",
"qs": "^6.12.0",
"sonic-weave": "^0.2.0",
"sonic-weave": "0.4.3",
"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.7.0",
"xen-dev-utils": "^0.9.0",
"xen-midi": "^0.2.0"
},
"devDependencies": {
Expand Down
16 changes: 12 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useAudioStore } from '@/stores/audio'
import { useStateStore } from './stores/state'
import { useMidiStore } from './stores/midi'
import { useScaleStore } from './stores/scale'
import { useHarmonicEntropyStore } from '@/stores/harmonic-entropy'
import { clamp, mmod } from 'xen-dev-utils'
import { parseScaleWorkshop2Line, setNumberOfComponents } from 'sonic-weave'
Expand All @@ -21,6 +22,7 @@ const state = useStateStore()
const scale = useScaleStore()
const midi = useMidiStore()
const audio = useAudioStore()
const entropy = useHarmonicEntropyStore()
// == URL path handling ==
/**
Expand Down Expand Up @@ -328,7 +330,7 @@ function typingKeydown(event: CoordinateKeyboardEvent) {
}
// === Lifecycle ===
onMounted(() => {
onMounted(async () => {
window.addEventListener('keyup', windowKeyup)
window.addEventListener('keydown', windowKeydownOrUp)
window.addEventListener('keyup', windowKeydownOrUp)
Expand All @@ -346,7 +348,7 @@ onMounted(() => {
// Special handling for the empty app state so that
// the browser's back button can undo to the clean state.
if (![...query.keys()].length) {
router.push({ path: getPath(url), query: { version } })
await router.push({ path: getPath(url), query: { version } })
} else if (!query.has('version')) {
// Scale Workshop 1 compatibility
try {
Expand Down Expand Up @@ -376,7 +378,7 @@ onMounted(() => {
audio.releaseTime = scaleWorkshopOneData.releaseTime
// Replace query with version 3.
router.push({ path: getPath(url), query: { version } })
await router.push({ path: getPath(url), query: { version } })
} catch (error) {
console.error('Error parsing version 1 URL', error)
}
Expand Down Expand Up @@ -431,11 +433,12 @@ onMounted(() => {
scale.computeScale()
// Replace query with version 3.
router.push({ path: getPath(url), query: { version } })
await router.push({ path: getPath(url), query: { version } })
} catch (error) {
console.error(`Error parsing version ${query.get('version')} URL`, error)
}
}
await entropy.fetchTable()
})
onUnmounted(() => {
Expand Down Expand Up @@ -474,6 +477,9 @@ function panic() {
<RouterLink to="/about"><strong>Sw</strong></RouterLink>
</li>
<li><RouterLink to="/">Build Scale</RouterLink></li>
<li v-if="state.showMosTab">
<RouterLink to="/mos">MOS</RouterLink>
</li>
<li><RouterLink to="/analysis">Analysis</RouterLink></li>
<li><RouterLink to="/lattice">Lattice</RouterLink></li>
<li><RouterLink to="/vk">Virtual Keyboard</RouterLink></li>
Expand Down Expand Up @@ -527,6 +533,7 @@ nav#app-navigation {
display: flex;
}
#app > #view,
#app > main {
flex: 1 1 auto;
overflow-y: hidden;
Expand Down Expand Up @@ -610,6 +617,7 @@ nav a:first-of-type {
line-height: 1;
padding-right: 1em;
text-align: right;
color: var(--color-text-mute);
}
#app-footer a {
color: var(--color-text-mute);
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('Gap key color algorithm', () => {

describe('URL safe number encoder', () => {
it('encodes the whole range', () => {
const expected = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-~'
const expected = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'
for (let i = 0; i < 64; ++i) {
expect(encodeUrlSafe64(i)).toBe(expected[i])
}
Expand All @@ -111,7 +111,7 @@ describe('URL safe number encoder', () => {

describe('Unique ID generator', () => {
it('produces a short URL-friendly identifier', () => {
const urlSafe = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-~'
const urlSafe = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'
const id = randomId()
expect(id).toHaveLength(9)
for (const char of id) {
Expand Down
7 changes: 5 additions & 2 deletions src/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

--color-accent: #803080;
--color-accent-text: #fff;
--color-accent-text-btn: #803080;
--color-accent-text-btn: #703070;
--color-accent-mute: #b7b;
--color-accent-deeper: #603060;
--color-accent-background: #fffeff;
Expand All @@ -25,6 +25,9 @@
--color-warning: orangered;
--color-indicator: #c35;

--color-bright-indicator: #63d023;
--color-dark-indicator: #427210;

/* Mimic Bootstrap alert with 'danger' variant */
--color-alert-danger: rgba(104, 35, 39, 1);
--color-alert-danger-background: rgba(243, 216, 218, 1);
Expand Down Expand Up @@ -53,7 +56,7 @@

--color-accent: #803080;
--color-accent-text: #fff;
--color-accent-text-btn: #a3a;
--color-accent-text-btn: #a848a8;
--color-accent-mute: #646;
--color-accent-deeper: #602060;
--color-accent-background: #011;
Expand Down
Binary file added src/assets/harmonic-entropy.ydata.raw
Binary file not shown.
1 change: 1 addition & 0 deletions src/character-palette.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"¾": "Sesqui-semi-prefix. E.g. D sesqui semisharp four <code>D¾♯4</code>.",
"⅓": "One-third-prefix. E.g. Third-major second <code>⅓M2</code>.",
"⅔": "Two-thirds-prefix. E.g. E two-thirds flat four <code>E⅔♭4</code>.",
"£": "Popped scale. E.g. <code>£ rdc £[-1]</code> reduces all intervals in your scale by the equave.",
"×": "Times symbol. E.g. <code>4/3 × 4/3</code> is <code>16/9</code>.",
"÷": "Division symbol. E.g. <code>9/8 ÷ 81/80</code> is <code>10/9</code>.",
"·": "Dot product. E.g. <code>12@ · 3/2</code> is <code>7</code> i.e. a fifth is seven steps of 12-tone equal temperament.",
Expand Down
Loading

0 comments on commit 5c1b10a

Please sign in to comment.