Beta

Making music (sort of)

Description
Loading description...
Algorithms
Mathematics
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    Random tests have floating point errors.

  • Voile Avatar

    The samples should be string values to seven decimal places

    But 0 expects 0.000000 instead of 0.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?

  • Voile Avatar

    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.

  • Voile Avatar

    Throw an error if the MIDI input is invalid (see more here).

    The provided link is just a Wikipedia dump to the MIDI article. Please be more specific what is actually wanted.

  • wthit56 Avatar

    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.

    • ZozoFouchtra Avatar

      I agree with Thomas. I've also some difficulties to figure exactly what to do with length & value.

    • tbtommyb Avatar

      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).

  • smile67 Avatar

    This comment has been hidden.