fretboard.js icon indicating copy to clipboard operation
fretboard.js copied to clipboard

Fretboard inlays

Open Aduffy opened this issue 5 years ago • 13 comments

Is there a way to display fretboard inlays at 3,5,7,9 12 for example?

Also why is fret 11 the "middle fret" ? perhaps to a programmer used to a base 0 index, that makes sense, but to most players things repeat at the 12th? (unless Im missing the point completely) :-)

Aduffy avatar Nov 25 '20 15:11 Aduffy

Re inlays: I thought about it, but I realised that more round elements would add just noise. It is definitely feasible to have a separate g wrapper containing the inlays though ^^

A compromise may be to display just the 3-5-7-9-12 numbers below.

Re middle fret: you are right - I think the problem is the fact when one refers to the n-th fret, is actually talking about the neck portion right before it, hence the confusion.

I will mark fret 12 (i.e. the 13th drawn line) as middle!

moonwave99 avatar Nov 25 '20 20:11 moonwave99

personalty not a huge fan of the numbers below, that was why i was hoping for inlays... Agree it could be cluttered but maybe a default opacity .2 or something so they are subtle

inlayStyle: dot,diamond, trapezoid, PRS
inlayOpacity: .2

Could be relay fancy and make the inlayStyle except an object of svg items, and I can make my own PRS style inlays :-)

Aduffy avatar Nov 25 '20 21:11 Aduffy

or perhaps take the same approach as for "middle" fret so the user can adjust the color of the actual frets 3,5,7,9,12...?

Aduffy avatar Nov 26 '20 16:11 Aduffy

I think the highlight element should span the whole area between two consecutive frets (like in a real guitar), making it less ambiguous.

fretboard_highlight

Guess I will add a showInlays(frets: number[], render: Function) method that renders a default style, and can render more stylish versions by appending svg to the exposed rectangular frame, what do you think?

moonwave99 avatar Nov 26 '20 20:11 moonwave99

Sounds like a perfect and very flexible solution!

Aduffy avatar Nov 26 '20 21:11 Aduffy

Did this super high priority / purely cosmetic feature make it into .2 ? :P

Aduffy avatar Dec 22 '20 22:12 Aduffy

Especially now that I am using the full populated fretboard, I think the inlays provide more noise than not.

Again, the implementation should not be complex so feel free to give it a go in case!

moonwave99 avatar Dec 24 '20 12:12 moonwave99

I'm also interested in this feature. @moonwave99, sounds like you're not opposed to this but you haven't implemented it yourself, is that right?

Awesome job on this, by the way! I'm using your library in a small proof of concept project that allows the user to reconfigure the fretboard using voice commands. Having lots of fun with this!

rodnolan avatar Jan 31 '21 20:01 rodnolan

Hey @rodnolan, I am curious about your PoC, would love to see that!

Atm I have no time for new features. If anybody likes to work on the inlays themselves I am glad to receive PRs!

moonwave99 avatar Feb 01 '21 09:02 moonwave99

@moonwave99, my little app is at https://github.com/rodnolan/say-and-see-fretboard. I'll take a shot at implementing the overlays but it'll take me a while. @Aduffy, just curious if you've done anything around this?

rodnolan avatar Feb 01 '21 22:02 rodnolan

@rodnolan no i have not had an opportunity to look at this... but I did quite like Diagos suggestion from Nov 26 "element should span the whole area between two consecutive frets" . I did attempt a quick hack using a BG image behind the fretboard element and based on that, the fret dots defenitly cluttered the display a bit. But just a 10% color fill on the 3,5,7,9 and 12 (etc) or maybe a Les Paul style inlays... Im not sure a showInlays() function is needed.. perhaps if the SVG elements where there with a class such as "fretinlay1" and we can just style them with CSS..

Aduffy avatar Feb 02 '21 04:02 Aduffy

@Aduffy, @moonwave99 I took a brief look at the code last night and advanced my understanding a little but I still have a lot to figure out. I like the flexibility provided by exposing the inlays in css and I have no idea yet whether a showInlays() function makes sense. I'm envisioning an option to toggle the overlays on/off and to also adjust the opacity according to user preferences... to put the control in the user's hands.

rodnolan avatar Feb 02 '21 23:02 rodnolan

I am also very intereted in this feature - I'll have a look and see I can implement it myself.

toby11 avatar May 18 '23 14:05 toby11