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.
Random tests have floating point errors.
But 0 expects
0.000000
instead of0.0000000
, which only has 6 decimal places. Similarly, when values have leading zeroes it expects more than 7 decimal places, like-0.06421801
instead of-0.0642180
,-0.004701102
instead of-0.0047011
, ... This is actually 7 significant digits, not 7 decimal places.Seriously, 6 solves without anyone catching this?
The input is not real MIDI: delta time in MIDI note packets are given as integer ticks, not actual duration in seconds. In the current design there would also be possibilities that a note do not last a whole tick.
Why the hell is
Test.expectError
used with empty string argument, 4 times, in the test fixture? This is intentional hostile abuse of test framework.Do mods retire abandoned katas like this? Author has been inactive since 2017 (5 years ago as of this comment).
Fun but needs a few more out of range tests:
console.log(getMIDI('D11'));
console.log(getMIDI('Ab0'))
console.log(getMIDI('A0'));
console.log(getMIDI('Bb0'))
http://newt.phys.unsw.edu.au/jw/notes.html this site have the right numbers, the ones in the kata are really wrong.
reference solution (hence the tests) is incorrect: A and B notes are associated with the wrong octave (1 higher than what they should be)description is misleading (see edits below)EDIT: Mmmmmh, wait... Might be that the description is misleading, without the link, actually... I'm not musician, so I don't know, but does A0 exists or not? the current state of the description suggests it doesn't, hence my second point above, but is that the case, actually?
EDIT²: confirmed, that's the info missing with the link. A0 is considered to be after C0, not before...
because the reference solution is incorrect... ;)
edit: might actually be a problem about not being musician (misleading info, without the link to sort it out)
Why would
A#9
equal118
andBb4
equal58
(an octave higher than I would expect it to be)?Link in the description is dead.
Julia translation kumited. I've changed the description a little, the description of how octave numbering works didn't match the MIDI spec or the test cases.
No random tests.
Test.expectError
does not provide useful information on fail.Test do not give any hints what is inccorest.
"Value is not what was expected" is shown. And what is expeccted?
Thanks for the comments. I have added an example output and also added a bit more to the explanation at the beginning.
A Hz represents one cycle per second, not 10,000. I had specified that the length was in seconds but have added more explanation, I hope it's clearer. The example should make clear that each sine wave starts at 0 (you are right that I hadn't set out that assumption).
Loading more items...