Skip to content

Commit

Permalink
Replace Annotation class with Metadata type
Browse files Browse the repository at this point in the history
  • Loading branch information
infojunkie committed Dec 18, 2024
1 parent 5d04deb commit b48668f
Show file tree
Hide file tree
Showing 20 changed files with 732 additions and 1,721 deletions.
6 changes: 3 additions & 3 deletions build/scalextric.cjs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions build/scalextric.cjs.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions build/scalextric.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions build/scalextric.js.map

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions build/types/src/ToneRow.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Tuning, Tone } from './Tuning';
import { Annotation } from './utils/Annotation';
import { Tuning, Tone, Metadata } from './Tuning';
import { Solmization } from './Solmization';
/**
* TONE ROW
Expand All @@ -16,15 +15,15 @@ import { Solmization } from './Solmization';
export declare class ToneRow {
tuning: Tuning;
tones: Tone[];
annotations: Annotation[];
metadata?: Metadata;
/**
* CONSTRUCTOR
*
* @param tuning: the reference tuning
* @param tones: the tones making up the row
* @param annotations: notes about the row
*/
constructor(tuning: Tuning, tones: Tone[], annotations?: Annotation[]);
constructor(tuning: Tuning, tones: Tone[], metadata?: Metadata);
/**
* Transpose a row to a target tone.
*/
Expand Down Expand Up @@ -54,17 +53,17 @@ export declare class ToneRow {
/**
* Create a tone row from given pitches.
*/
static fromPitches(tuning: Tuning, pitches: number[], annotations?: Annotation[]): ToneRow;
static fromPitches(tuning: Tuning, pitches: number[], metadata?: Metadata): ToneRow;
/**
* Create a tone row from given pitches.
*/
static fromPitchClasses(tuning: Tuning, pitchClasses: number[], octave: number, annotations?: Annotation[]): ToneRow;
static fromPitchClasses(tuning: Tuning, pitchClasses: number[], octave: number, metadata?: Metadata): ToneRow;
}
export declare class ToneRowSolmized extends ToneRow {
tuning: Tuning;
solmization: Solmization;
tones: Tone[];
annotations: Annotation[];
constructor(tuning: Tuning, solmization: Solmization, tones: Tone[], annotations?: Annotation[]);
metadata?: Metadata;
constructor(tuning: Tuning, solmization: Solmization, tones: Tone[], metadata?: Metadata);
static fromToneRow(row: ToneRow, solmization: Solmization): ToneRowSolmized;
}
13 changes: 8 additions & 5 deletions build/types/src/Tuning.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Annotation } from './utils/Annotation';
import { Interval } from './Interval';
export type Metadata = {
label: string;
description?: string;
source?: string;
};
/**
* TUNING SYSTEM
*
Expand All @@ -24,25 +28,24 @@ import { Interval } from './Interval';
*/
export declare class Tuning {
intervals: Interval[];
annotations: Annotation[];
metadata?: Metadata;
/**
* CONSTRUCTOR
*
* @param intervals: tuning intervals
* The intervals will be _guaranteed_ to be sorted.
* The first interval will be _guaranteed_ to be the unison.
* The last interval will be _assumed_ to be the repeater (e.g. 2/1 the octave).
* @param annotations: annotations about the tuning
*/
constructor(intervals: Interval[], annotations?: Annotation[]);
constructor(intervals: Interval[], metadata?: Metadata);
/**
* Create a tuning from ratios or cents.
*
* @param intervals: an array of ratios expressed as strings, or cents expressed as numbers
* @param annotations: as per constructor
* @returns tuning object
*/
static fromIntervals(intervals: (number | string)[], annotations?: Annotation[]): Tuning;
static fromIntervals(intervals: (number | string)[], metadata?: Metadata): Tuning;
/**
* IS A TUNING TRANSPOSABLE?
*
Expand Down
1 change: 0 additions & 1 deletion build/types/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './Solmization';
export * from './Interval';
export * from './ToneRow';
export * from './MusicXML';
export * from './utils/Annotation';
Loading

0 comments on commit b48668f

Please sign in to comment.