Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The description fails to explain anything besides two links. Does a white kata need to be so obtuse?
@vivekpontoosh: in terms of
Bb
, there is no suspended 4th in this case. The 3rd of aBb
chord would be some kind ofD
, such asDb
forBb minor
orD
forBb major
. If there were a 4th for aBb
chord, then we would encounter anEb
in the chord. Simply put,Bb G D
reesults in a 1st inversionG minor
chord.A# is enharmonic (equivalent) to B-flat major.
(A# isn't used much because of all of the accidentals and double-sharps)
A# is an artifact from using the midi tables.
And if you look at this in Bb terms, it comes out to:
Bb G D, which is a raised 3rd (of 4th, or suspended)
which isn't a major triad
The major triad would be: Bb F D
I found this diagram more useful than the MIDI article mentioned.
https://djip.co/blog/logic-studio-9-midi-note-numbers
It was more compact.
I haven't checked all of the test cases, but it seems like there should be an augmented triad, and a diminished triad, to round out the possibilities. Also a suspended chord (R 4 5).
Also things like R 2 5, etc. Haven't analyzed what's there.
I think you should limit the kata to triads (including octaves of included notes), but not bigger chords. How would dominant 7 chord be classified, with major triad, but minor 7th, vs Major 7th.
Also, it would be good to summarize this part of music theory, rather than just pointing to a wikipedia page. I had a really good guitar teacher in highschool that explained this to me, but most people won't have that background.
Not all inversions of major chords are included in the sample space.
This is all because the description lacks 2 things:
In music theory, a major chord is a chord that has a root, major third, and perfect fifth.
So, I can see why the idea of a
Bb/A#
chord comes to mind first, because that's its root.You're right about a
third
defining chord modality, but we cannot assume the presence of anF
as a member of this chord.arpeggios
are chords simply played one note at a time, so they can also be just as complete or incomplete as any chord may or may not be, andbroken_chords
are no different in this principle.Stack them in
thirds
you getG Bb D
spellingGm
, andBb
is theminor third
here (defined in the kata asA#
) which just happens to be below the other two notes becasue the chord is inverted.there are arpegios and broken chords, isint needed all the notes to play a chord
the kata is asking to return if the chord is major or not, the only thing that you need to know if a chord is major is the 3rd (but the 6th in this case helps to know that it is in the major scale too)
the only other chord that could be formed with this would be if it were using a harmonic scale of Gm that would give a A#6(5+), but it would still be major, so it should be true even in that case
The actual chord would be spelled with a
Bb
, and to make aBb6
chord, it would have to have all four of these notes:Bb D F G
.The chord in question amounts to
Bb D G
, forming the1st inversion
of aG minor
chord. So, not major, and so the test should returnfalse
.Relatable to previous issue: I did at least find two cases of
2nd inversion
major chords that expecttrue
in the fixed tests.From the other tests, it seems that's not the case. I'd take a look at the issue below. The author is long gone, so I doubt we ever get a reply from him.
From the Wikipedia link, A# major chord should be A# D and F (at least in root position). But I see some sample test with more than 3 notes that should return
True
.Hi there:
First off, I like the idea for the kata, it's pretty cool and I actually much prefer it to some of our existing kata on music theory, but I don't think it will be approved in its current state. Here are some things I noticed:
Example: https://www.codewars.com/kata/reviews/55fab6dc96625f04d7000172/groups/5c238ffdded502516b000e8a
This is possible because your test suite is always the same inputs with the same outputs.
It's not necessarily clear whether you want different inversions or voicings to be supported, or which ones you want supported.
The tests all have the root as the first note in the given tuple, even when there are notes below it later in the list, so it's not clear whether that's by design or by mistake.
I think this would be better if the description was a bit more fleshed out in terms of specifying the desired inputs and outputs, or at least what will be tested.
Cheers
No need to include numpy by default
Nice kata, thanks! :) I've done a lot of such computations through the years and it is interesting to compare the expressivity of various languages (eg. C#, Java, Scala, Python, etc.). IMHO code in Python can the most expressive for these tasks as observed so far.
Another nice kata would be to sort the pitch class sets on Z12 by taking the index of the binary number. It allows to select a canonical representant of each pitch class set. And guess what's the rank of the diatonic set among all such canonic sets of size 7 and what are its neighbors ;)
Loading more items...