Skip to content

Commit 2f0cbd4

Browse files
committed
allow reversing of string order
1 parent e72b590 commit 2f0cbd4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/lib/frets/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { Interval, Note } from "tonal";
22

33
export default function frets(
44
tuning = ["E2", "A2", "D3", "G3", "B3", "E4"],
5-
count = 13
5+
count = 13,
6+
reverse = true
67
) {
8+
const processedTuning = reverse ? [...tuning].reverse() : tuning;
79

8-
const strings = tuning.map((string, stringIndex) => {
10+
const strings = processedTuning.map((string, stringIndex) => {
911
const notes = [];
1012
for (let fret = 0; fret < count; fret++) {
1113
const note = Note.transpose(string, Interval.fromSemitones(fret));

0 commit comments

Comments
 (0)