Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tonal-fretboard #8

Open
danigb opened this issue May 8, 2016 · 20 comments
Open

tonal-fretboard #8

danigb opened this issue May 8, 2016 · 20 comments

Comments

@danigb
Copy link
Collaborator

danigb commented May 8, 2016

Hi @devboell,

I would like to have a tonal-fretboard module, and I thought maybe we can share some ideas before. The API I was thinking is something like this:

  • tuning(name): return an array of notes with the strings in open position. For example, for tuning('guitar') it would return ['E2', 'A2', 'D3', 'G3', 'B3', 'E4']. A kind of dictionary of corded instruments tunings.
  • build(tuning, first, last): build a fretboard with the given tuning, from first fret number to last fret number. It returns an array of arrays, one for each string.
  • buildSet(tuning, set, first, last): the same of above, but nulls instead of note names for the notes that doesn't belong to the set.

What do you think? Do you find useful? Anything missing?

Cheers,
Dani

@devboell
Copy link

devboell commented May 9, 2016

Hey Dani,

Sure, sounds good.
You have to bear in mind that guitarists like to use different tunings. Next to standard tuning, the are lots of alternate tunings, some of which are used often. Here's a whole list: https://en.wikipedia.org/wiki/List_of_guitar_tunings

As long as build(tuning, first, last) takes an array of notes as a first param, there's no problem, but it may complicate the naming in the tuning-dictionary. To only have 'guitar' would be a limited use case.
And you would have to handle that string instruments have different number of strings, but I assume you know that.

I am not quite sure what you mean by 'set' in buildSet?

@danigb
Copy link
Collaborator Author

danigb commented May 9, 2016

Great! Thanks, I would try to write a first implementation. By set I'm basically referring to scales, a collection of unique pitch classes (https://en.wikipedia.org/wiki/Set_theory_(music). It can be used to represent chords.

@grimmdude
Copy link
Contributor

This would be a useful module. I'm happy to help as well,

-Garrett

@danigb
Copy link
Collaborator Author

danigb commented Jun 16, 2016

Hi Garret! The first version of the module it's implemented here: https://github.com/danigb/tonal/blob/master/modules/fretboard/index.js

It's not published on npm yet. Suggestions and PR welcomed :-)

@grimmdude
Copy link
Contributor

Nice, it's looking good. I just though of an interesting idea; a method that takes a chord name and returns an array of objects containing the string and fret number. Could be useful for building chord charts, etc. The logic would have to take into account tuning of course, and nearby chord notes that are within reaching distance of each other.

chordShapes(chord) => [{'E2' : 3, 'A2' : 2}]

I'll see if I can come up with something in my fork,

-Garrett

@danigb
Copy link
Collaborator Author

danigb commented Jun 17, 2016

Great Garret! Looking forward a PR ;-) Don't hesitate to ask if you found any trouble.

@mitselek
Copy link

If this means I could generate a chord diagrams for arbitrary tuning, then Your work might start an unexpected revolution in pop music.

@mitselek
Copy link

The classical tuning is mathematically quite solid but I'm not sure it's optimal for fingers.
Next thing somebody will build a tuning generator where you feed in the array of chords to play and get back finger-optimized tuning. Combining this with guitar tuner app will make any piece playable for everybody.
Imagine an app, where you put in your favourite song and instantly get back to adjusted tuner plus chord diagrams plus chord-annotated lyrics. 🎸

@grimmdude
Copy link
Contributor

Hi @danigb,

I'm working on a browser based project which I would like to incorporate this package with. I'm having a bit of a hard time getting this built correctly for the browser, could you please point me in the right direction? Thanks,

-Garrett

@grimmdude
Copy link
Contributor

Nevermind, I see now the build/index.js in the npm package and was able to use browserify to get that going. Thanks!

-Garrett

@grimmdude
Copy link
Contributor

Sorry...so many messages. I would like to know though how you would build this package during development? I may be contributing more to this package shortly.

-Garrett

@danigb
Copy link
Collaborator Author

danigb commented Jul 21, 2017

Hi @grimmdude

Yes... to many packages. I'm thinking in a way to reduce them and provide a simpler build process.

There's a pre-built package in dist folder (but it doesn't include fretboard). The process is done with rollup: see the "build" and "dist" scripts in package.json and the rollup.config.dist.js file.

Hope it helps.

@grimmdude
Copy link
Contributor

Thanks @danigb, I think I figured it out. FYI I'm using this along with VexChords to create a guitar chord lookup page here: http://musictheorysite.com/guitar-chord-chart/

That page makes it easier to dial this package in a bit. I submitted a PR, and will probably have more to come. Working on limiting the shapes chordShapes() it returns to be more realistically reachable.

-G

@danigb
Copy link
Collaborator Author

danigb commented Jul 30, 2017

Hi @grimmdude

The chord lookup page looks terrific! Great job! I tried to create something like this but I never finished it (https://danigb.github.io/tonal-app/) ... Glad to see that some people do! 👍

Thanks for your PR, and sorry for the delay. I still think this module it's a little bit too complex (at least the interface to it) and there's room to improve, so any PR will be more than welcomed ;-)

Cheers,
Dani

@martijnmichel
Copy link
Contributor

martijnmichel commented Jul 8, 2020

I just found this issue while scrolling around a bit in tonal and thought of a little tool i made some years back which im planning to revise with tonal (and Vue)

http://tocadomusic.nl/guitarneck/

@4lejandrito
Copy link
Contributor

Same as @martijnmichel. I'd like to share my project https://react-guitar.com. All the music theory stuff is built on top of tonal. Thanks so much for such a great project!

@justinlawrence
Copy link

justinlawrence commented Sep 22, 2020 via email

@danigb
Copy link
Collaborator Author

danigb commented Sep 23, 2020

Nice work! Probably you already know that there's a Projects using tonal section of the readme. PRs to add those projects to the list are welcomed.

@4lejandrito
Copy link
Contributor

Thanks @danigb! I just sent #213.

@leocaseiro
Copy link

Hey @danigb, just found that opened issue.
Are there any chances to bring back the fretboard module in the newest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants