-
Notifications
You must be signed in to change notification settings - Fork 114
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
Inversions #82
Comments
Hey Nic, and thank you very much! There's no built-in support for inverting chords, because it should be pretty easy. Basically you just have to shift around the intervals you get from However, I just found out this is unnecessarily complex, because what you get back from I'll have a look at how I can simplify that. Thanks for reporting! |
Thanks so much! Nic |
I actually find it a bit problematic that the chord objects are mutable. I think it might be better if they were immutable(?). I think inversion functions are cool, but let me just think about whether they belong on teoria, or in a separate module. What about: var teoria = require('teoria');
var rotate = require('rotate-array');
var Am1 = teoria.chord('Am');
var Am2 = Am1.voicing(rotate(Am1.voicing(), 1));
var Am3 = Am2.voicing(rotate(Am2.voicing(), 1)); |
That would work fine for me if you'd rather it not be in teoria. |
I also had a thought that the new vars Thanks again, |
Just want to chime in that some kind of support for inversions would be really useful. I gather we're meant to do it ourselves, but for idiots like me the whole point of using teoria is that I'm not confident I understand how to do it correctly. FWIW, right now I'm doing something like: var vs = chord.voicing()
var vnames = vs.map(function(int){ return int.toString() })
vnames[0] = 'P8'
chord.voicing(vnames) But I've no idea if that would be correct for all chords, etc. |
Hey Andy, thanks for chiming in! Eh, you're totally right we need abstractions for "not-expert" users. Let's look for a good way to do this. What kind of methods would be helpful to you? Maybe?
Can you think of something more please let me know :) |
Thank you for the great library Jakob! Regarding your questions, the APIs you listed are basically what I'd hoped for, but you should take that with a grain of salt because I'm too much of a beginner to know if they make sense or not! (As a side note, would it make sense to also have As an alternate view, I'd originally supposed that inversions would be a matter of voicing, rather than the chord's notes, so I'd started writing myself a function like: var c = teoria.chord('C'); // c4, e4, g4
c.transposeVoicingByOctave([ 1, 0, -1 ]); // c5, e4, g3 I gather that would let one construct any inversion one wanted. But looking at teoria's implementation I see that notes are derived from voicing, not the reverse, so perhaps fiddling with the voicing doesn't make sense. (In fact, if chords are best thought of as immutable, I'm not sure I should be calling that method at all. It essentially lets you overwrite the chord's notes, right?) |
Just some thoughts on this: If you don't like the idea of the Chord data model containing this kind of "state", then perhaps inversions could be computed on-the-fly: var c = teoria.chord('C');
c.notes(); // Note objects: [c4 e4 g4]
c.notes(1); // Note objects: [e4 g4 c5] This approach seems like it would undermine the purpose of Personally, I'd like to be able to initialize a chord like "Am", then be able to independently modify its inversion and bass octave, and then finally retrieve an array of Note objects (with appropriate ordering and octaves), but I'm willing to work around whatever API design you prefer in the end - it's your project! |
What is the easiest way of creating a chord inversion? i.e moving the root to the top
Am (A, C, E) -> (C, E, A)
Would it be useful to have a chord function for creating these?
Awesome library!
Thanks
The text was updated successfully, but these errors were encountered: