Conversation
|
I'm excited to see that you're developing this! I have some comments. Feel free to ignore or address any of them:
For discussion sake, a very rough draft of what I'm thinking of is: type Note = string;
type Constraint = (notes: Note[]) => Error[];
type Transform = (notes: Note[]) => Note[];
const requireExactNoteLength = (expectedLength: number): Constraint => (notes) => {
if (notes.length !== expectedLength) {
return [new Error(`expected note length of ${expectedLength}, got: ${notes.length}];
}
return [];
};
const majorTriad = musicTheory()
.setConstraint(requireExactNoteLength(1))
.addTransform((notes) => {
const root = notes[0];
const third = tonaljs.Note.transpose(root, '3M');
const fifth = tonaljs.Note.transpose(root, '5P');
return [root, third, fifth];
});
const firstInversion = majorTriad
.setConstraint(requireExactNoteLength(3));
.addTransform((notes) => {
const [root, third, fifth] = notes;
return [third, fifth, tonaljs.Note.transpose(root, '8P')];
});Then, some utility could transform these fully qualified note names into guitar positions and those could be subsequently fed to a |
|
Hi @jaredjj3 sorry for the extremely late response! I basically stopped working on this (and on a parallel, similar piano diagram generator that I drafted) because...it took away precious practice time : D After 2/3h working on a virtual fretboard, I don't want to touch a real one! Or at least I don't have time for work + project + drilling :/ This does not mean I won't work on this anymore of course, I will actively check the inbox of the project. At least I would like to properly merge this. Addressing your points:
You are right ^^ the idea is "after the middle fret", but I don't think that Another possibility may be
The library is using aliases: ["maj7", "Δ", "ma7", "M7", "Maj7"],So we should be covered here! That should be documented of course.
You are right ^^ at the same time, very often you'll need to render specific things like chords / scales / triads...I just included convenience methods that allow you to do: const fretboard = new Fretboard(...);
fretboard.renderChord('G7b9');
fretboard.renderScale('G lydian dominant');instead of: import Fretboard, { getChord, getScale } from '...';
const fretboard = new Fretboard(...);
fretboard.setDots(getChord({
root: 'C',
type: '7b9',
string: 5
));
fretboard.setDots(getScale({
root: 'G',
type: 'Lydian dominant',
string: 6
));There is already the Your musicTheory library idea is VERY interesting, because it is very coherent with the transformation / piping idea of concepts like transposing, mode rotation, etc...another thing I would love to implement and test, but that would steal time from my non js guitar :D |
|
@moonwave99, thanks for taking the time out to respond! I moved recently, and I've been very occupied with that. I'll try to prototype some of the ideas we discussed here and come back for more feedback. |
While brushing up my fretboard triad knowledge (read: relearning it from scratch), I couldn't help writing the feature for fretboard.js (mainly for the inversions).
One can now do: