From 1dd1eb889215d88dd23ab67d3c8ec0a49d424367 Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Thu, 9 May 2024 15:42:24 +0300 Subject: [PATCH] Include bright generator monzo in notation config --- src/__tests__/notation.spec.ts | 7 +++++-- src/notation.ts | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/__tests__/notation.spec.ts b/src/__tests__/notation.spec.ts index e978b08..2cbdebf 100644 --- a/src/__tests__/notation.spec.ts +++ b/src/__tests__/notation.spec.ts @@ -6,7 +6,7 @@ describe('Diamond mos notation generator', () => { it('generates the config for diatonic major', () => { const notation = generateNotation('LLsLLLs'); const basic = [2, 1]; - const {scale, degrees, equave, period} = notation; + const {scale, degrees, equave, period, brightGenerator} = notation; expect(dot(basic, scale.get('J')!)).toBe(0); expect(dot(basic, scale.get('K')!)).toBe(2); expect(dot(basic, scale.get('L')!)).toBe(4); @@ -46,10 +46,12 @@ describe('Diamond mos notation generator', () => { expect(dot(basic, equave)).toBe(12); // P8 expect(dot(basic, period)).toBe(12); // P8 + expect(dot(basic, brightGenerator)).toBe(7); // P5 }); it('generates the config for subaric 4|2(2)', () => { - const {scale, degrees, equave, period} = generateNotation('sLsssLss'); + const {scale, degrees, equave, period, brightGenerator} = + generateNotation('sLsssLss'); expect(scale.get('J')).toEqual([0, 0]); expect(scale.get('K')).toEqual([0, 1]); expect(scale.get('L')).toEqual([1, 1]); @@ -68,5 +70,6 @@ describe('Diamond mos notation generator', () => { expect(equave).toEqual([2, 6]); expect(period).toEqual([1, 3]); + expect(brightGenerator).toEqual([1, 2]); }); }); diff --git a/src/notation.ts b/src/notation.ts index 73d0f7b..c1b52bf 100644 --- a/src/notation.ts +++ b/src/notation.ts @@ -66,6 +66,10 @@ export type DiamondMosNotation = { * Interval of repetition. */ period: MosMonzo; + /** + * Bright generator of the scale. + */ + brightGenerator: MosMonzo; }; /** @@ -133,5 +137,6 @@ export function generateNotation(mode: string): DiamondMosNotation { degrees, equave, period: [equave[0] / numPeriods, equave[1] / numPeriods], + brightGenerator: gen, }; }