From bb3d5bb7777d55da9e40b729fe2ccb6dc465c440 Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Sat, 18 Jan 2025 18:10:30 +0200 Subject: [PATCH] Fix typos in code --- documentation/BUILTIN.md | 8 ++++---- src/__benchmarks__/prelude.bench.ts | 2 +- src/__tests__/interval.spec.ts | 2 +- src/__tests__/monzo.spec.ts | 2 +- src/__tests__/scale-workshop-2.spec.ts | 2 +- src/cli.ts | 2 +- src/fjs.ts | 2 +- src/grammars/sonic-weave.pegjs | 2 +- src/interval.ts | 16 ++++++++-------- src/monzo.ts | 14 +++++++------- src/parser/__tests__/expression.spec.ts | 10 +++++----- src/parser/__tests__/poor-grammar.spec.ts | 2 +- src/parser/__tests__/sonic-weave-ast.spec.ts | 2 +- src/parser/__tests__/source.spec.ts | 6 +++--- src/parser/__tests__/stdlib.spec.ts | 12 ++++++------ src/parser/__tests__/tag.spec.ts | 16 ++++++++-------- src/parser/__tests__/temper.spec.ts | 4 ++-- src/parser/chord-parser.ts | 4 ++-- src/parser/expression.ts | 2 +- src/parser/parser.ts | 2 +- src/scale-workshop-2-parser.ts | 2 +- src/stdlib/builtin/index.ts | 8 ++++---- src/stdlib/builtin/temper.ts | 4 ++-- src/stdlib/prelude.ts | 6 +++--- src/stdlib/public.ts | 4 ++-- src/utils.ts | 4 ++-- 26 files changed, 70 insertions(+), 70 deletions(-) diff --git a/documentation/BUILTIN.md b/documentation/BUILTIN.md index e11f9eea..0253204f 100644 --- a/documentation/BUILTIN.md +++ b/documentation/BUILTIN.md @@ -265,7 +265,7 @@ Return the number of intervals in the scale, the length of a string or the size Convert interval to linear representation. Formatting information of logarithmic quantities is lost. ### lll(*basis*, *weighting = "tenney"*) -Perform Lensta-Lenstra-Lovász basis reduction. +Perform Lenstra-Lenstra-Lovász basis reduction. ### log1p(*x*) Calculate log1p x. @@ -699,10 +699,10 @@ Repeat the popped/given intervals as-is without accumulating equaves. Repeat the popped/given scale shifted linearly each time. ### replace(*interval*, *replacement*, *scale = ££*) -Obtain a copy of the popped/given scale with occurences of `interval` replaced by `replacement`. +Obtain a copy of the popped/given scale with occurrences of `interval` replaced by `replacement`. ### replaceStep(*step*, *replacement*, *scale = ££*) -Obtain a copy of the popped/given scale with relative occurences of `step` replaced by `replacement`. +Obtain a copy of the popped/given scale with relative occurrences of `step` replaced by `replacement`. ### retrovert(*scale = ££*) Obtain an retroverted copy of the popped/given scale (negative harmony i.e. reflect and transpose). @@ -738,7 +738,7 @@ Cumulatively sum the numbers of the popped/given array. Stack the popped/given inflections along with the guide generator into a periodic sequence of steps. ### stretch(*amount*, *scale = ££*) -Obtain a copy of the popped/given scale streched by the given amount. A value of `1` corresponds to no change. +Obtain a copy of the popped/given scale stretched by the given amount. A value of `1` corresponds to no change. ### subharmonics(*start*, *end*) Generate a subharmonic segment including the given start and end points. diff --git a/src/__benchmarks__/prelude.bench.ts b/src/__benchmarks__/prelude.bench.ts index f109ccfe..e1f2c6c1 100644 --- a/src/__benchmarks__/prelude.bench.ts +++ b/src/__benchmarks__/prelude.bench.ts @@ -5,7 +5,7 @@ import {PRELUDE_SOURCE, PRELUDE_VOLATILES} from '../stdlib/prelude'; import {RootContext} from '../context'; import {CSS_COLOR_CONTEXT} from '../css-colors'; -// NOTE: Most of these are not comparitive benchmarks. +// NOTE: Most of these are not comparative benchmarks. // Mainly useful for making sure tweaks to the parser won't destroy all performance. beforeAll(() => { getSourceVisitor(); diff --git a/src/__tests__/interval.spec.ts b/src/__tests__/interval.spec.ts index 628748e2..8fe7644b 100644 --- a/src/__tests__/interval.spec.ts +++ b/src/__tests__/interval.spec.ts @@ -11,7 +11,7 @@ import {FractionLiteral, NedjiLiteral} from '../expression'; import {sw} from '../parser'; import {LOG_PRIMES, PRIME_CENTS, dot} from 'xen-dev-utils'; -describe('Idempontent formatting', () => { +describe('Idempotent formatting', () => { it('has stable ratios (common factor)', () => { const sixOverFour = TimeMonzo.fromFraction('6/4', 2); const node = intervalValueAs(sixOverFour, { diff --git a/src/__tests__/monzo.spec.ts b/src/__tests__/monzo.spec.ts index 66dd2542..995a03c3 100644 --- a/src/__tests__/monzo.spec.ts +++ b/src/__tests__/monzo.spec.ts @@ -288,7 +288,7 @@ describe('Extended monzo with time', () => { expect(octave.equals(2)).toBeTruthy(); }); - it('can be ambiquous in terms of total size compared to reals', () => { + it('can be ambiguous in terms of total size compared to reals', () => { const octaveJI = new TimeMonzo(new Fraction(0), [new Fraction(1)]); const octaveReal = new TimeReal(0, 2); expect(octaveJI.strictEquals(octaveReal)).toBeFalsy(); diff --git a/src/__tests__/scale-workshop-2.spec.ts b/src/__tests__/scale-workshop-2.spec.ts index 5960b151..214f3408 100644 --- a/src/__tests__/scale-workshop-2.spec.ts +++ b/src/__tests__/scale-workshop-2.spec.ts @@ -16,7 +16,7 @@ describe('Line parser', () => { expect(() => parseLine('42')).toThrow(); }); - it('parses negative fractions and interpretes them as inverses', () => { + it('parses negative fractions and interprets them as inverses', () => { const result = parseLine('-1/2'); expect( result.equals( diff --git a/src/cli.ts b/src/cli.ts index f7e1e092..4c6ee0d9 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -18,7 +18,7 @@ const {version} = require('../package.json'); /** * Convert a program in the SonicWeave DSL to the Scala .scl format. * @param source Source code for a SonicWeave program. - * @returns A string convorming to the [Scala format](https://www.huygens-fokker.org/scala/scl_format.html). + * @returns A string conforming to the [Scala format](https://www.huygens-fokker.org/scala/scl_format.html). */ export function toScalaScl(source: string) { const visitor = evaluateSource(source); diff --git a/src/fjs.ts b/src/fjs.ts index 3a3df188..1eba8ea9 100644 --- a/src/fjs.ts +++ b/src/fjs.ts @@ -25,7 +25,7 @@ const MAX_EXPONENT = Object.freeze(new Fraction(100)); // Classic radius of tolerance. const RADIUS_OF_TOLERANCE = valueToCents(65 / 63); -// Using a half-sharp + epsilon as the radius of tolerace closes the gap between minor and major. +// Using a half-sharp + epsilon as the radius of tolerance closes the gap between minor and major. // https://en.xen.wiki/w/User:FloraC/Critique_on_Functional_Just_System const SEMIAPOTOME = 0.5 * valueToCents(2187 / 2048) + 1e-6; diff --git a/src/grammars/sonic-weave.pegjs b/src/grammars/sonic-weave.pegjs index 99f44c9e..482c4b38 100644 --- a/src/grammars/sonic-weave.pegjs +++ b/src/grammars/sonic-weave.pegjs @@ -921,7 +921,7 @@ ChainableUnaryOperator = '^' / '∧' / '\u2228' / '/' / LiftToken / '\\' / DropToken // The precedence between exponentiation and fractions is a bit uneasy. -// Uniform unary operators make a seccond appearance here to be valid right operands for exponentiation and fractions. +// Uniform unary operators make a second appearance here to be valid right operands for exponentiation and fractions. UnaryExpression = operator: UniformUnaryOperator uniform: '~'? operand: ImplicitCallExpression { return UnaryExpression(operator, operand, !!uniform); diff --git a/src/interval.ts b/src/interval.ts index c28696cb..f3f3b836 100644 --- a/src/interval.ts +++ b/src/interval.ts @@ -1162,7 +1162,7 @@ export class Interval { node = this.value.asMonzoLiteral(); } if (!Array.isArray(node.basis)) { - throw new Error('Unexpexted unpruned basis.'); + throw new Error('Unexpected unpruned basis.'); } if ( interchange && @@ -1172,7 +1172,7 @@ export class Interval { ) { node = this.value.asInterchangeLiteral()!; if (!Array.isArray(node.basis)) { - throw new Error('Unexpexted unpruned basis.'); + throw new Error('Unexpected unpruned basis.'); } } if (this.steps) { @@ -1786,7 +1786,7 @@ export class ValBasis { } /** - * Fix a map in this basis to the stadard basis. + * Fix a map in this basis to the standard basis. * @param map Tuning map of this basis' elements to cents. * @returns Tuning map of primes to cents. */ @@ -1869,7 +1869,7 @@ export class ValBasis { /** * Rebase intervals from the standard basis to this basis. * Rebase vals from a foreign subgroup basis to this basis. - * @param other {@link Interval} or {@link Val} to reinterprete. + * @param other {@link Interval} or {@link Val} to reinterpret. * @return The rebased value. */ intrinsicCall(other: Interval): Interval; @@ -1980,7 +1980,7 @@ export class ValBasis { } /** - * A mappping vector commonly used to convert intervals in just intonation to steps of an equal temperament. + * A mapping vector commonly used to convert intervals in just intonation to steps of an equal temperament. */ export class Val { value: TimeMonzo; @@ -2370,7 +2370,7 @@ export class Temperament { } /** - * Constuct a temperament that retains the properties shared by all of the given vals. + * Construct a temperament that retains the properties shared by all of the given vals. * @param vals Vals to mix into a more optimal combination. The number of vals decides the rank of the temperament. * @param weights Additional weights on top of Tenney weights to tweak what is considered optimal. * @param pureEquaves Boolean flag to force the tuning of the first basis element to remain pure. @@ -2410,7 +2410,7 @@ export class Temperament { } /** - * Constuct a temperament that tempers out the given commas. + * Construct a temperament that tempers out the given commas. * @param commas Commas to temper out. The number of commas decides the co-rank of the temperament. * @param basis Optional basis. Leave undefined to automatically infer from commas. * @param weights Additional weights on top of Tenney weights to tweak what is considered optimal. @@ -2601,7 +2601,7 @@ export class Temperament { /** * Produce an array of generator coefficients. - * @param other A value to interprete. + * @param other A value to interpret. * @returns An array representing the number of generators adding up to the value. */ dot(other: Interval): Interval[] { diff --git a/src/monzo.ts b/src/monzo.ts index a19edde9..73a23781 100644 --- a/src/monzo.ts +++ b/src/monzo.ts @@ -209,7 +209,7 @@ export class TimeReal { /** * Create a real-valued frequency. - * @param frequency Frequency of a musical note measuder in hertz. + * @param frequency Frequency of a musical note measured in hertz. * @returns Frequency value in the absolute echelon. */ static fromFrequency(frequency: number) { @@ -503,7 +503,7 @@ export class TimeReal { } /** - * Subrtact another time real from this one in linear space. + * Subtract another time real from this one in linear space. * @param other Another time real. * @returns The linear difference of the time reals. */ @@ -1783,7 +1783,7 @@ export class TimeMonzo { } /** - * Subrtact another time monzo from this one in linear space. + * Subtract another time monzo from this one in linear space. * @param other Another time monzo. * @returns The linear difference of the time monzos. */ @@ -2125,8 +2125,8 @@ export class TimeMonzo { } } } - const respow = other.residual.pow(solution); - if (!respow || respow.compare(this.residual)) { + const residualPow = other.residual.pow(solution); + if (!residualPow || residualPow.compare(this.residual)) { throw new Error("Logarithm doesn't exist."); } return solution; @@ -2381,7 +2381,7 @@ export class TimeMonzo { /** * Convert a relative time monzo to cents. - * Conert an absosulte time monzo to the size in cents of the scalar of its time unit. + * Covert an absolute time monzo to the size in cents of the scalar of its time unit. * @param ignoreSign Compute the size of the absolute value. * @returns Size of the time monzo in cents. */ @@ -2610,7 +2610,7 @@ export class TimeMonzo { } /** - * Factorize the time monzo into a Map instace with prime numbers as keys and their multiplicity as values. + * Factorize the time monzo into a Map instance with prime numbers as keys and their multiplicity as values. * @returns A sparse monzo. */ factorize() { diff --git a/src/parser/__tests__/expression.spec.ts b/src/parser/__tests__/expression.spec.ts index 172a6a7b..cf76cc5b 100644 --- a/src/parser/__tests__/expression.spec.ts +++ b/src/parser/__tests__/expression.spec.ts @@ -1044,8 +1044,8 @@ describe('SonicWeave expression evaluator', () => { }); it("has Lumi's bridging commas (memes)", () => { - const ohno = parseSingle('sm2^0l'); - expect(ohno.value.toFraction().toFraction()).toBe('15/14'); + const ohNo = parseSingle('sm2^0l'); + expect(ohNo.value.toFraction().toFraction()).toBe('15/14'); }); it('has syntonic rastmic subchroma notation (relative artodemisharp)', () => { @@ -1770,7 +1770,7 @@ describe('SonicWeave expression evaluator', () => { expect(fraction).toBe('1024/729'); }); - it('has a porkupine inflection', () => { + it('has a porcupine inflection', () => { const {fraction} = parseSingle('⅓m3_6l'); expect(fraction).toBe('6/5'); }); @@ -1799,7 +1799,7 @@ describe('SonicWeave expression evaluator', () => { expect(rootLift[1].valueOf()).toBe(1.5); }); - it('can longtail monzo components starting from a prime', () => { + it('can long-tail monzo components starting from a prime', () => { const tooMuch = parseSingle('[1 -2 3 -4 5 -6 7 -8 9>@31..'); const pe = tooMuch.value.primeExponents.map(e => e.toFraction()); expect(pe).toEqual([ @@ -2420,7 +2420,7 @@ describe('SonicWeave expression evaluator', () => { expect(interval.isAbsolute()).toBe(true); }); - it('coarces too accurate nedji to real', () => { + it('coerces too accurate nedji to real', () => { const interval = evaluate( '1000000000000000\\9007199254740997<3>' ) as Interval; diff --git a/src/parser/__tests__/poor-grammar.spec.ts b/src/parser/__tests__/poor-grammar.spec.ts index 4f8e7925..ea4d138c 100644 --- a/src/parser/__tests__/poor-grammar.spec.ts +++ b/src/parser/__tests__/poor-grammar.spec.ts @@ -37,7 +37,7 @@ describe('Angle brackets vs. comparisons', () => { expect(no).toBe(false); }); - it.fails('features the obstinence of (1°2 < 3) > 4', () => { + it.fails('features the obstinacy of (1°2 < 3) > 4', () => { const no = evaluate('1\\2<3 >4'); expect(no).toBe(false); }); diff --git a/src/parser/__tests__/sonic-weave-ast.spec.ts b/src/parser/__tests__/sonic-weave-ast.spec.ts index b68a059b..dd23f79b 100644 --- a/src/parser/__tests__/sonic-weave-ast.spec.ts +++ b/src/parser/__tests__/sonic-weave-ast.spec.ts @@ -779,7 +779,7 @@ describe('SonicWeave Abstract Syntax Tree parser', () => { ]); }); - it('supports multiple subcripts on AbsoluteFJS', () => { + it('supports multiple subscripts on AbsoluteFJS', () => { const ast = parseSingle('Fb4_5_5'); expect(ast.expression.subscripts).toEqual([ [5, ''], diff --git a/src/parser/__tests__/source.spec.ts b/src/parser/__tests__/source.spec.ts index a21c1e97..cf822869 100644 --- a/src/parser/__tests__/source.spec.ts +++ b/src/parser/__tests__/source.spec.ts @@ -1292,8 +1292,8 @@ describe('SonicWeave parser', () => { (* Manual conversion *) absolute `); - const freqs = scale.map(i => i.valueOf()); - expect(freqs).toEqual([320, 384, 512, 640, 792, 880]); + const frequencies = scale.map(i => i.valueOf()); + expect(frequencies).toEqual([320, 384, 512, 640, 792, 880]); }); it('technically supports partial application', () => { @@ -1537,7 +1537,7 @@ describe('SonicWeave parser', () => { ]); }); - it('generates the basic bright mode by defalt', () => { + it('generates the basic bright mode by default', () => { const scale = expand(` MOS 3L 2s K4 diff --git a/src/parser/__tests__/stdlib.spec.ts b/src/parser/__tests__/stdlib.spec.ts index 73c2265f..3874286f 100644 --- a/src/parser/__tests__/stdlib.spec.ts +++ b/src/parser/__tests__/stdlib.spec.ts @@ -879,7 +879,7 @@ describe('SonicWeave standard library', () => { expect(D4).toBe('D♮4^73h'); }); - it('can replace all occurences of a relative step with others', () => { + it('can replace all occurrences of a relative step with others', () => { const splitCPS = expand( 'cps([1, 3, 5, 7], 2);replaceStep(7/6, [11/10, 35/33])' ); @@ -1382,7 +1382,7 @@ describe('SonicWeave standard library', () => { ]); }); - it('has vectorizing vbool', () => { + it('has vectorized vbool', () => { const duckDuckGooseDuck = evaluateExpression('vbool(["", 0, 12, niente])'); expect(duckDuckGooseDuck).toEqual([false, false, true, false]); }); @@ -1650,10 +1650,10 @@ describe('SonicWeave standard library', () => { const scale = expand('afdo(5, 3)'); expect(scale).toEqual(['7/5', '9/5', '11/5', '13/5', '3']); // Verify that it's an arithmetic progression - const fracs = scale.map(f => new Fraction(f)); - fracs.unshift(new Fraction(1)); - for (let i = 0; i < fracs.length - 1; ++i) { - expect(fracs[i + 1].sub(fracs[i]).equals('2/5')).toBe(true); + const fractions = scale.map(f => new Fraction(f)); + fractions.unshift(new Fraction(1)); + for (let i = 0; i < fractions.length - 1; ++i) { + expect(fractions[i + 1].sub(fractions[i]).equals('2/5')).toBe(true); } }); diff --git a/src/parser/__tests__/tag.spec.ts b/src/parser/__tests__/tag.spec.ts index 8924bd9d..91e39d64 100644 --- a/src/parser/__tests__/tag.spec.ts +++ b/src/parser/__tests__/tag.spec.ts @@ -21,12 +21,12 @@ describe('SonicWeave template tag', () => { }); it('evaluates an array of numbers passed in', () => { - const nums: number[] = []; + const numbers: number[] = []; for (let i = 0; i < 10 * Math.random(); ++i) { - nums.push(Math.floor(Math.random() * 100)); + numbers.push(Math.floor(Math.random() * 100)); } - const value = sw`${nums}` as Interval[]; - expect(value.map(i => i.toInteger())).toEqual(nums); + const value = sw`${numbers}` as Interval[]; + expect(value.map(i => i.toInteger())).toEqual(numbers); }); it('evaluates PI passed in', () => { @@ -125,12 +125,12 @@ describe('SonicWeave raw template tag', () => { }); it('evaluates an array of numbers passed in', () => { - const nums: number[] = []; + const numbers: number[] = []; for (let i = 0; i < 10 * Math.random(); ++i) { - nums.push(Math.floor(Math.random() * 100)); + numbers.push(Math.floor(Math.random() * 100)); } - const value = swr`${nums}` as Interval[]; - expect(value.map(i => i.toInteger())).toEqual(nums); + const value = swr`${numbers}` as Interval[]; + expect(value.map(i => i.toInteger())).toEqual(numbers); }); it('evaluates PI passed in', () => { diff --git a/src/parser/__tests__/temper.spec.ts b/src/parser/__tests__/temper.spec.ts index d6836cf0..8a3c1e12 100644 --- a/src/parser/__tests__/temper.spec.ts +++ b/src/parser/__tests__/temper.spec.ts @@ -61,8 +61,8 @@ describe('Features related to tempering', () => { }); it('can combine three vals to approach the JIP', () => { - const fourtyOne = evaluate('tune([5@.7, 17@.7, 19@.7])') as Val; - expect(fourtyOne.value.toIntegerMonzo()).toEqual([41, 65, 95, 115]); + const fortyOne = evaluate('tune([5@.7, 17@.7, 19@.7])') as Val; + expect(fortyOne.value.toIntegerMonzo()).toEqual([41, 65, 95, 115]); }); it('can combine four vals to approach the JIP', () => { diff --git a/src/parser/chord-parser.ts b/src/parser/chord-parser.ts index 15bc6fdd..9140130c 100644 --- a/src/parser/chord-parser.ts +++ b/src/parser/chord-parser.ts @@ -75,7 +75,7 @@ export function parseBasis(input: string): ValBasis { /** * Parse a list of vals separated by '|', '&', ':', ';', ',' or whitespace. - * @param input User input in a context that expects a sequance of vals. + * @param input User input in a context that expects a sequence of vals. * @param basis Dot-separated subgroup basis or the prime limit parsed by {@link parseBasis}. * @param includePrelude Whether or not to include the extended standard library. Passing in `false` results in a faster start-up time. * @returns An array of number arrays representing vals in the subgroup basis. @@ -96,7 +96,7 @@ export function parseVals( throw new Error('Explicit subgroups not supported.'); } const val = evaluateExpression(part, includePrelude) as Val; - // Just re-interprete in the subgroup's basis. + // Just re-interpret in the subgroup's basis. result.push(Val.fromBasisMap(val.sval, basis)); } else { // Add a dummy named subgroup to make the warts parser do the right thing. diff --git a/src/parser/expression.ts b/src/parser/expression.ts index e6539288..3b0b9ec7 100644 --- a/src/parser/expression.ts +++ b/src/parser/expression.ts @@ -459,7 +459,7 @@ export class ExpressionVisitor { if (interrupt?.type === 'ReturnStatement') { return interrupt.value; } else if (interrupt) { - throw new Error('Illegal interupt.'); + throw new Error('Illegal interrupt.'); } return subVisitor.currentScale; } diff --git a/src/parser/parser.ts b/src/parser/parser.ts index 4ca1f48b..697fa8be 100644 --- a/src/parser/parser.ts +++ b/src/parser/parser.ts @@ -50,7 +50,7 @@ export function getGlobalVisitor( const visitor = SOURCE_VISITOR_WITH_PRELUDE.clone(); - // Volatiles are expected to interact with extra builins. + // Volatiles are expected to interact with extra builtins. for (const statement of VOLATILES.body) { visitor.visit(statement); } diff --git a/src/scale-workshop-2-parser.ts b/src/scale-workshop-2-parser.ts index b232f505..f43c9a43 100644 --- a/src/scale-workshop-2-parser.ts +++ b/src/scale-workshop-2-parser.ts @@ -136,7 +136,7 @@ function parseCents(sw2Node: SW2CentsLiteral, numberOfComponents: number) { * Parse a string to the {@link Interval} it represents. * @param input A string to parse. * @param numberOfComponents Number of components to use for the {@link Interval} instance's {@link TimeMonzo} prime exponent part. - * @param admitBareNumbers Interprete bare numbers as n/1 ratios instead of throwing an error. + * @param admitBareNumbers Interpret bare numbers as n/1 ratios instead of throwing an error. * @param universalMinus Allow unary minus operator in front of every line type. * @returns {@link Interval} instance constructed from the input string. * @throws An error if the input cannot be interpreted as an interval. diff --git a/src/stdlib/builtin/index.ts b/src/stdlib/builtin/index.ts index d8368344..8a034627 100644 --- a/src/stdlib/builtin/index.ts +++ b/src/stdlib/builtin/index.ts @@ -140,7 +140,7 @@ function lll( this.spendGas(0.3 * basis.numberOfComponents * basis.size ** 2); return basis.lll(weighting); } -lll.__doc__ = 'Perform Lensta-Lenstra-Lovász basis reduction.'; +lll.__doc__ = 'Perform Lenstra-Lenstra-Lovász basis reduction.'; lll.__node__ = builtinNode(lll); // == Third-party wrappers == @@ -570,8 +570,8 @@ radical.__node__ = builtinNode(radical); * @param interval Interval to convert. * @param preferredNumerator Preferred number of steps. * @param preferredDenominator Preferred number of steps per equave. - * @param preferredEquaveNumerator Prefferred numerator of the equave. - * @param preferredEquaveDenominator Prefferred denominator of the equave. + * @param preferredEquaveNumerator Preferred numerator of the equave. + * @param preferredEquaveDenominator Preferred denominator of the equave. * @returns The interval converted to relative NEDJI in the logarithmic domain. */ function nedji( @@ -1589,7 +1589,7 @@ function hasConstantStructure_(this: ExpressionVisitor, scale?: Interval[]) { const monzos = scale.map(i => rel(i).value); for (const monzo of monzos) { if (monzo instanceof TimeReal) { - // XXX: Margin CS is not realiable with zero margin, but whatever. + // XXX: Margin CS is not reliable with zero margin, but whatever. return hasMarginConstantStructure( monzos.map(m => m.totalCents()), 0 diff --git a/src/stdlib/builtin/temper.ts b/src/stdlib/builtin/temper.ts index 1673e031..e588375b 100644 --- a/src/stdlib/builtin/temper.ts +++ b/src/stdlib/builtin/temper.ts @@ -475,7 +475,7 @@ function tune( ); const jip = basis.value.map(m => m.totalCents()); const ws = valWeights(weights, basis.size); - const wvals = vs.map(val => + const weightedVals = vs.map(val => applyWeights( unapplyWeights( basis.value.map(m => m.dot(val.value).valueOf()), @@ -484,7 +484,7 @@ function tune( ws ) ); - const coeffs = intCombineTuningMaps(ws, wvals, radius); + const coeffs = intCombineTuningMaps(ws, weightedVals, radius); let result = vs[0].mul(fromInteger(coeffs[0])); for (let i = 1; i < coeffs.length; ++i) { result = result.add(vs[i].mul(fromInteger(coeffs[i]))); diff --git a/src/stdlib/prelude.ts b/src/stdlib/prelude.ts index f05ef685..a2844db6 100644 --- a/src/stdlib/prelude.ts +++ b/src/stdlib/prelude.ts @@ -889,7 +889,7 @@ riff mergeOffset(offsets, overflow = 'drop', scale = ££) { } riff stretch(amount, scale = ££) { - "Obtain a copy of the popped/given scale streched by the given amount. A value of \`1\` corresponds to no change."; + "Obtain a copy of the popped/given scale stretched by the given amount. A value of \`1\` corresponds to no change."; return scale ~^ amount; } @@ -949,7 +949,7 @@ riff coalesce(tolerance = 3.5, action = 'simplest', preserveBoundary = false, sc } riff replace(interval, replacement, scale = ££) { - "Obtain a copy of the popped/given scale with occurences of \`interval\` replaced by \`replacement\`."; + "Obtain a copy of the popped/given scale with occurrences of \`interval\` replaced by \`replacement\`."; for (const existing of scale) { if (existing == interval) { replacement; @@ -960,7 +960,7 @@ riff replace(interval, replacement, scale = ££) { } riff replaceStep(step, replacement, scale = ££) { - "Obtain a copy of the popped/given scale with relative occurences of \`step\` replaced by \`replacement\`."; + "Obtain a copy of the popped/given scale with relative occurrences of \`step\` replaced by \`replacement\`."; unstack(scale); replace(step, replacement); return stack(); diff --git a/src/stdlib/public.ts b/src/stdlib/public.ts index 0050578d..663702d7 100644 --- a/src/stdlib/public.ts +++ b/src/stdlib/public.ts @@ -188,9 +188,9 @@ export function relative( 'Reference frequency must be set for absolute -> relative conversion. Try 1/1 = 440 Hz.' ); } - const absolut = absolute.bind(this)(interval); + const absolute_ = absolute.bind(this)(interval); return new Interval( - absolut.value.div(this.rootContext.unisonFrequency), + absolute_.value.div(this.rootContext.unisonFrequency), interval.domain, interval.steps, undefined, diff --git a/src/utils.ts b/src/utils.ts index 876f9349..226c1629 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -56,7 +56,7 @@ export type MetricPrefix = | 'q'; /** - * Optain the ten's exponent associated with the given prefix. + * Obtain the ten's exponent associated with the given prefix. * @param prefix Prefix to find exponent for. * @returns The ten's exponent associated with the prefix. */ @@ -134,7 +134,7 @@ export type BinaryPrefix = | 'Qi'; /** - * Optain the exponent of 1024 associated with the given prefix. + * Obtain the exponent of 1024 associated with the given prefix. * @param prefix Prefix to find exponent for. * @returns The exponent of 1024 associated with the prefix. */