Beta
Making music (sort of)
Loading description...
Algorithms
Mathematics
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
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.
The provided link is just a Wikipedia dump to the MIDI article. Please be more specific what is actually wanted.
Would really appreciate a full example. Just use the input you showed, and show us the output.
Also, I'm pretty confused about the whole 10,000 times a second thing. If the length is 0.5 (assuming this means half a second--though you should explain this also), shouldn't there be 5,000 values?
Also, does each sine wave start at 0 degrees?
It sounds like an interesting kata to me, but for someone who doesn't understand the details of sound engineering it's difficult to grasp.
I agree with Thomas. I've also some difficulties to figure exactly what to do with
length
&value
.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).
This comment has been hidden.
I want to add randomised tests but to be honest the docs are no help. Could you give a very quick example of how they should work and I'll add some in?
The easiest way is to look into an example. You have solved other Javascript katas like: https://www.codewars.com/kata/the-lazy-startup-office/solutions/javascript So follow the link and open the "Show Kata Testcases" tab and you will see the testcase- code and what to do (this one contains random tests). I think it's better than longer explanations;-). Hope it helps!
ah cool, i've never looked at that before. Thanks for the help!