Skip to content

Commit

Permalink
Include bright generator monzo in notation config
Browse files Browse the repository at this point in the history
  • Loading branch information
frostburn committed May 9, 2024
1 parent 034d0ad commit 1dd1eb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/__tests__/notation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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]);
Expand All @@ -68,5 +70,6 @@ describe('Diamond mos notation generator', () => {

expect(equave).toEqual([2, 6]);
expect(period).toEqual([1, 3]);
expect(brightGenerator).toEqual([1, 2]);
});
});
5 changes: 5 additions & 0 deletions src/notation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export type DiamondMosNotation = {
* Interval of repetition.
*/
period: MosMonzo;
/**
* Bright generator of the scale.
*/
brightGenerator: MosMonzo;
};

/**
Expand Down Expand Up @@ -133,5 +137,6 @@ export function generateNotation(mode: string): DiamondMosNotation {
degrees,
equave,
period: [equave[0] / numPeriods, equave[1] / numPeriods],
brightGenerator: gen,
};
}

0 comments on commit 1dd1eb8

Please sign in to comment.