ozankasikci / rust-music-theory

A music theory guide written in Rust.
MIT License
627 stars 29 forks source link

Proper inversion generation #35

Open donRumata03 opened 2 years ago

donRumata03 commented 2 years ago

Is that correct that there are only n inversions generated where n is the number of notes in the chord?

https://github.com/ozankasikci/rust-music-theory/blob/2e09fa3c2574fd41a41650e4f95023ac9f7e3b20/src/chord/chord.rs#L191

As far as I understand, there should be n! of them to produce all the permutations.

AFAIK, according to the music theory, there only exists the invariant that the notes in chords shouldn't contain spaces more than one octave and this reduces the number of inversions of a given chord starting for a given octave exactly n!