Skip to content

Commit

Permalink
Fix typos in code and elsewhere
Browse files Browse the repository at this point in the history
Add dummy constructors to pacify the type checker.
  • Loading branch information
frostburn committed Jan 26, 2025
1 parent ab0aca6 commit b828e6b
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 40 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
* Improvement: Improve loading times with asynchronous components [#520](https://github.com/xenharmonic-devs/scale-workshop/issues/520)
* Bug fix: Fix tempering in exotic subgroups [#518](https://github.com/xenharmonic-devs/scale-workshop/issues/518)
* Bug fix: Close Korg export modal when pressing escape [#524](https://github.com/xenharmonic-devs/scale-workshop/issues/524)
* Refactoring: Split isomorhic QWERTY to s re-usable package [#336](https://github.com/xenharmonic-devs/scale-workshop/issues/336)
* Refactoring: Split isomorphic QWERTY into a re-usable package [#336](https://github.com/xenharmonic-devs/scale-workshop/issues/336)

## 2.3.2
* Bug fix: Make copy & paste possible outside of scale data [#515](https://github.com/xenharmonic-devs/scale-workshop/issues/515)
Expand Down Expand Up @@ -153,7 +153,7 @@
* Feature: Light-weight algorithms for tempering in extremely large just intonation subgroups
* Feature: Visualize how the various MIDI mappings assign scale degrees
* Feature: Implement visual MIDI channel indicators
* Feature: Interprete non-integer equal temperaments as cET
* Feature: Interpret non-integer equal temperaments as cET
* Feature: Implement basic reverb using a ping-pong delay
* Feature: Implement new metric prefixes from quecto to quetta
* Standardization: Rename reference pitch to A4
Expand Down Expand Up @@ -190,7 +190,7 @@
* Feature: Rank-2 scales can now be manipulated interactively by clicking on the period circle in a new tab inside the modal for *New scale → Rank-2 temperament*
* Refactoring: Core functionality now at [scale-workshop-core](https://github.com/xenharmonic-devs/scale-workshop-core) for better reusability
* Refactoring: Utility packages [xen-dev-utils](https://www.npmjs.com/package/xen-dev-utils), [moment-of-symmetry](https://www.npmjs.com/package/moment-of-symmetry) and [temperaments](https://www.npmjs.com/package/temperaments) are now sourced from npm.
* Bug fix: Decimal dots in the interval matrix is now consistent with the tunng table
* Bug fix: Decimal dots in the interval matrix is now consistent with the tuning table
* Bug fix: Touching the screen in piano layout played multiple notes in unison
* Bug fix: Typing out text in some of the scale creation modals made sound
* Bug fix: Disable browser specific features like quick find on Firefox
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ See [sw-server](https://github.com/xenharmonic-devs/sw-server) for the backend c

## License

MIT, see [LICENCE](LICENSE) for details.
MIT, see [LICENSE](LICENSE) for details.

## Related projects

Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ onMounted(async () => {
const url = new URL(window.location.href)
const query = url.searchParams
// This is overriden when scale data is evaluated, but some corner cases need to be covered.
// This is overridden when scale data is evaluated, but some corner cases need to be covered.
setNumberOfComponents(DEFAULT_NUMBER_OF_COMPONENTS)
// Special handling for the empty app state so that
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 @@ -41,7 +41,7 @@ describe('Exponential formatter', () => {
})

describe('Hertz formatter', () => {
it('leaves resonable frequencies as is', () => {
it('leaves reasonable frequencies as is', () => {
expect(formatHertz(12.345)).toBe('12.345Hz')
expect(formatHertz(21234.567)).toBe('21234.567Hz')
})
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('Auto key color algorithm', () => {
)
})

it('produces something resonable with 17 notes', () => {
it('produces something reasonable with 17 notes', () => {
const colors = autoKeyColors(17)
expect(colors.join(' ')).toBe(
'white white black white white white black white white black white white white black white white black'
Expand Down
4 changes: 2 additions & 2 deletions src/analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function otonalCorrection(ratios: number[]) {
}

// Calculate the best multiplier for a set of ratios that
// miminizes the perceived motion of an otonal chord wheel.
// minimizes the perceived motion of an otonal chord wheel.
function otonalMultiplier(ratios: number[], maxMultiplier = 16) {
let leastError = Infinity
let result = 1
Expand Down Expand Up @@ -69,7 +69,7 @@ function utonalCorrection(ratios: number[]) {
}

// Calculate the best divisor for a set of ratios that
// miminizes the perceived motion of an utonal chord wheel.
// minimizes the perceived motion of an utonal chord wheel.
export function utonalDivisor(ratios: number[], maxDivisor = 23) {
let leastError = Infinity
let result = 1
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChordWheel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function draw(time: DOMHighResTimeStamp) {
}
// Render a chord wheel that appears to move based on how
// disconcordant the voices are compared to a pure enumerated chord.
// discordant the voices are compared to a pure enumerated chord.
const offsetWidth = canvas.value!.offsetWidth
ctx.lineWidth = (props.lineWidth * props.width) / offsetWidth
ctx.strokeStyle = props.strokeStyle
Expand Down
8 changes: 4 additions & 4 deletions src/components/Faux3DLattice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const viewBox = reactive([-1, -1, 2, 2])
const lattice = computed(() => {
const result = spanLattice3D(props.monzos, store.latticeOptions3D)
// Center everything so that the vanishing point is at the center of the view box
const inorm = 1 / result.vertices.length
const avgX = result.vertices.reduce((s, v) => s + v.x, 0) * inorm
const avgY = result.vertices.reduce((s, v) => s + v.y, 0) * inorm
const avgZ = result.vertices.reduce((s, v) => s + v.z, 0) * inorm
const inverseNorm = 1 / result.vertices.length
const avgX = result.vertices.reduce((s, v) => s + v.x, 0) * inverseNorm
const avgY = result.vertices.reduce((s, v) => s + v.y, 0) * inverseNorm
const avgZ = result.vertices.reduce((s, v) => s + v.z, 0) * inverseNorm
result.vertices = result.vertices.map((v) => ({
...v,
x: v.x - avgX,
Expand Down
4 changes: 2 additions & 2 deletions src/components/PeriodCircle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const mosLabel = computed(() => {
const n = props.numPeriods
return `${n * countL}L ${n * countM}M ${n * countS}s`
}
// There are degenerate edgecases with step variety = 2. Show nothing to avoid implying MOS.
// There are degenerate edge-cases with step variety = 2. Show nothing to avoid implying MOS.
return ''
})
Expand Down Expand Up @@ -250,7 +250,7 @@ function onWindowMouseUp(event: MouseEvent) {
// Notes on touch handling:
// * Touch start must not preventDefault to allow scrolling with two fingers.
// * Touch move must preventDefault to prevent scrolling with one finger.
// * The behaviour is a bit sporadic when two-finger scrolling is released and only one finger remains on the svg element.
// * The behavior is a bit sporadic when two-finger scrolling is released and only one finger remains on the svg element.
function handleTouch(touch: Touch) {
const svg = container.value!
Expand Down
6 changes: 5 additions & 1 deletion src/exporters/pure-data.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { BaseExporter } from '@/exporters/base'
import { BaseExporter, type ExporterParams } from '@/exporters/base'

export default class PureDataExporter extends BaseExporter {
static tuningMaxSize = 128

constructor(params: ExporterParams) {
super(params)
}

// assemble the text file contents
getFileContents() {
let file = ''
Expand Down
6 changes: 5 additions & 1 deletion src/exporters/reaper.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { BaseExporter } from '@/exporters/base'
import { BaseExporter, type ExporterParams } from '@/exporters/base'
import { Interval, TimeReal, intervalValueAs } from 'sonic-weave'
import { mmod, valueToCents } from 'xen-dev-utils'

export default class ReaperExporter extends BaseExporter {
static tuningMaxSize = 128
static fractionDigits = 3

constructor(params: ExporterParams) {
super(params)
}

getFileContentsAndSuffix() {
const digits = ReaperExporter.fractionDigits
const scale = this.params.scale
Expand Down
6 changes: 5 additions & 1 deletion src/exporters/soniccouture.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { BaseExporter } from '@/exporters/base'
import { BaseExporter, type ExporterParams } from '@/exporters/base'
import { ftom } from 'xen-dev-utils'

export default class SoniccoutureExporter extends BaseExporter {
static tuningMaxSize = 128

constructor(params: ExporterParams) {
super(params)
}

// assemble the nka contents
getFileContents() {
const newline = this.params.newline
Expand Down
6 changes: 3 additions & 3 deletions src/presets.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"pelog": {
"title": "Pelog",
"name": "Normalised Pelog, Kunst, 1949. Average of 39 Javanese gamelans",
"name": "Normalized Pelog, Kunst, 1949. Average of 39 Javanese gamelans",
"source": "120. white\n270. white\n540. white\n670. white\n785. white\n950. white\n1215. gray\n",
"categories": ["traditional"]
},
Expand Down Expand Up @@ -49,7 +49,7 @@
},
"hirajoshi-ji": {
"title": "Hirajoshi just",
"name": "Japanese pentatonic koto scale, theoretical. Helmholz/Ellis p.519, nr.110",
"name": "Japanese pentatonic koto scale, theoretical. Helmholtz/Ellis p.519, nr.110",
"source": "9/8 white\neulerGenus(15 white, 5, 2/1 gray)\n",
"categories": ["traditional", "just intonation"]
},
Expand Down Expand Up @@ -309,7 +309,7 @@
"categories": ["non-octave", "equal temperament"]
},
"otonalstacks": {
"name": "Sevish stacked otonal framents",
"name": "Sevish stacked otonal fragments",
"source": "unstack(24 white:27:30:32:36)\nunstack(24 lightblue:27:28:32:36)\nunstack(24 palegoldenrod:27:30:32:36)\nstack()\n",
"categories": ["non-octave", "just intonation"]
},
Expand Down
2 changes: 1 addition & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const router = createRouter({
},
{
path: '/prefs',
name: 'preferencess',
name: 'preferences',
component: () => import('../views/PreferencesView.vue')
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/scale-workshop-one.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class ScaleWorkshopOneData {
this.vertical = searchParams.getNumber('vert', 5)
this.horizontal = searchParams.getNumber('horiz', 1)

// get key colours
// get key colors
this.colors = searchParams.get('colors')

// get synth options
Expand Down
2 changes: 1 addition & 1 deletion src/scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class Scale {
* Construct a new musical scale.
* @param intervalRatios Intervals of the scale excluding 1/1, ending with the interval of equivalence.
* @param baseFrequency Base frequency of 1/1.
* @param baseMidiNote MIDI note corresponfing to base frequency
* @param baseMidiNote MIDI note corresponding to base frequency
*/
constructor(
intervalRatios: number[],
Expand Down
8 changes: 4 additions & 4 deletions src/stores/historical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export const useHistoricalStore = defineStore('historical', () => {
}
}

// Record order is supposed to be quaranteed since ES2015, but that doesn't seem to be the case...
// Record order is supposed to be guaranteed since ES2015, but that doesn't seem to be the case...
const presetKeys: string[] = [...Object.keys(presets)]

// Sort by wideness of the generator
Expand Down Expand Up @@ -421,10 +421,10 @@ export const useHistoricalStore = defineStore('historical', () => {
down.value = preset.down
wellCommaString.value = preset.comma
wellComma.value = parseInterval(preset.comma)
const fracs = preset.commaFractions.split(',')
const fractions = preset.commaFractions.split(',')
wellCommaFractionStrings.clear()
for (let i = 0; i < fracs.length; ++i) {
wellCommaFractionStrings.set(i - preset.down, fracs[i])
for (let i = 0; i < fractions.length; ++i) {
wellCommaFractionStrings.set(i - preset.down, fractions[i])
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/stores/scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const useScaleStore = defineStore('scale', () => {
// The user can either set the base frequency or have it be automatically calculated.
// baseFrequencyDisplay reflects the initial value passed to the SonicWeave runtime.
// However the runtime may assign a different unison frequency and that's what ends up in scale.value.baseFrequency.
// Threrefore stores.scale.scale.baseFrequency is the source of truth, while stores.scale.baseFrequencyDisplay is the v-model.
// Therefore stores.scale.scale.baseFrequency is the source of truth, while stores.scale.baseFrequencyDisplay is the v-model.
const userBaseFrequency = ref(261.63)
const autoFrequency = ref(true)
const baseFrequencyDisplay = computed({
Expand Down Expand Up @@ -698,7 +698,7 @@ export const useScaleStore = defineStore('scale', () => {
...LIVE_STATE,
id,
uploadedId,
// Presistent state
// Persistent state
centsFractionDigits,
decimalFractionDigits,
accidentalPreference,
Expand Down
10 changes: 5 additions & 5 deletions src/url-encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const LEFT_SQUARE_BRACKET = 'Q'
const PLUS = 'P'
const ESCAPE = 'E'

// Color shorhands
// Color shorthands
const BLACK = '-'
const WHITE = '~'
const SEPARATOR = '_'
Expand Down Expand Up @@ -99,21 +99,21 @@ function encodeLine(scaleLine: string) {
.replace(/>/g, RIGHT_ANGLE_BRACKET)
.replace(/\[/g, LEFT_SQUARE_BRACKET)
.replace(/\+/g, PLUS)
let lastNondigit = ''
let lastNonDigit = ''
let result = ''
let currentNumber = ''

;[...scaleLine].forEach((character) => {
if (isDigit(character)) {
currentNumber += character
} else {
result += encodeDigits(currentNumber, !'.,'.includes(lastNondigit))
result += encodeDigits(currentNumber, !'.,'.includes(lastNonDigit))
currentNumber = ''
lastNondigit = character
lastNonDigit = character
result += escapeCharacter(character)
}
})
return result + encodeDigits(currentNumber, !'.,'.includes(lastNondigit))
return result + encodeDigits(currentNumber, !'.,'.includes(lastNonDigit))
}

function decodeLine(encoded: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export function formatCents(x: number, fractionDigits = 3) {

/**
* Fill in the gaps of a parent scale (in white) with accidentals (in black).
* @param generatorPerPeriod Generator sizre divided by period size (in pitch space).
* @param generatorPerPeriod Generator size divided by period size (in pitch space).
* @param size Size of the parent scale.
* @param down Number of generators to go down from 1/1.
* @returns Array of key colors.
Expand Down Expand Up @@ -546,7 +546,7 @@ export function encodeUrlSafe64(n: number) {
* @returns Random identifiers with a low chance of collision
*/
export function randomId() {
// Coarce timestamp for indexing in ~30 year cycles
// Coarse timestamp for indexing in ~30 year cycles
const msSince1970 = new Date().valueOf()
const hour = Math.floor(msSince1970 / (1000 * 60 * 60))
const hourLow = hour & 63
Expand Down
2 changes: 1 addition & 1 deletion src/views/AboutView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const tagline = computed(() => TAGLINES[Math.floor(Math.random() * TAGLINES.leng
<hr />
<div id="about">
<h2>About Scale Workshop</h2>
<p>Scale Workshop is MIT licensensed open source.</p>
<p>Scale Workshop is MIT licensed open source.</p>
<p>
Feel free to check out the
<a href="https://github.com/xenharmonic-devs/scale-workshop">source code on GitHub</a>. You
Expand Down
2 changes: 1 addition & 1 deletion src/views/PrivacyPolicy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
<p>
We use your data to provide and improve the Service. By using the Service, you agree to the
collection and use of informationin accordance with this policy. Unless otherwise defined in
collection and use of information accordance with this policy. Unless otherwise defined in
this Privacy Policy,terms used in this Privacy Policy have the same meanings as in our
<RouterLink to="/terms-of-service">Terms of Service</RouterLink>.
</p>
Expand Down

0 comments on commit b828e6b

Please sign in to comment.