diff --git a/packages/chord/README.md b/packages/chord/README.md index c3f53694..dce6c2d4 100644 --- a/packages/chord/README.md +++ b/packages/chord/README.md @@ -106,15 +106,15 @@ c4m7(0); // => "" See [`Scale.degrees`](https://github.com/tonaljs/tonal/tree/main/packages/scale#scaledegreesscalename-string--degree-number--string) -### `Chord.steps(chordName: string) => (degree: number) => string` +### `Chord.steps(chordType: string, tonic?: string) => (degree: number) => string` Same as `Chord.degrees` but 0 is the tonic. Plays better with numeric ranges: ```js import { Range, Chord } from "tonal"; -Range.numeric([-3, 3]).map(Chord.steps(["C4", "aug"])); -// => ["G#3", "E3", "C3", "C4", "E4", "G#4", "C5"] +Range.numeric([-3, 3]).map(Chord.steps("aug", "C4")); +// => ["C3", "E3", "G#3", "C4", "E4", "G#4", "C5"] ``` #### `Chord.detect(notes: string[]) => string[]` diff --git a/packages/chord/test.ts b/packages/chord/test.ts index e892ff80..02e989f8 100644 --- a/packages/chord/test.ts +++ b/packages/chord/test.ts @@ -283,8 +283,8 @@ describe("tonal-chord", () => { }); test("Chord.steps", () => { - expect([-1, -2, -3, 0, 1, 2, 3].map(Chord.steps("Caug", "C4"))).toEqual( - "G#3 E3 C3 C4 E4 G#4 C5".split(" "), + expect([-3, -2, -1, 0, 1, 2, 3].map(Chord.steps("aug", "C4"))).toEqual( + "C3 E3 G#3 C4 E4 G#4 C5".split(" "), ); }); diff --git a/site/content/docs/groups/chords.md b/site/content/docs/groups/chords.md index 156aab6e..0f208962 100644 --- a/site/content/docs/groups/chords.md +++ b/site/content/docs/groups/chords.md @@ -111,15 +111,15 @@ See [`Scale.degrees`](https://github.com/tonaljs/tonal/tree/main/packages/scale# ### `Chord.steps` -`steps(chordName: string) => (degree: number) => string` +`steps(chordType: string, tonic?: string) => (degree: number) => string` Same as `Chord.degrees` but 0 is the tonic. Plays better with numeric ranges: ```js import { Range, Chord } from "tonal"; -Range.numeric([-3, 3]).map(Chord.steps(["C4", "aug"])); -// => ["G#3", "E3", "C3", "C4", "E4", "G#4", "C5"] +Range.numeric([-3, 3]).map(Chord.steps("aug", "C4")); +// => ["C3", "E3", "G#3", "C4", "E4", "G#4", "C5"] ``` ## Finding chords