You are reading a single comment by @alexanderbrevig and its replies. Click here to read the full conversation.
  • Looking forward to walk through the complete code - including display of current score! For example first at the top in the 'unused' space, and later at the bottom in the 'used' space of the settled blocks. Using the Graphics, it should be 'easy' to do...

    Regarding the music: For getting the rhythm, interpret the last blank of a sequence of separating blanks differently then the other ones. The last marks the separation and should be very short... the other ones should last as long as the note themselves (plus the length of the separation blank). This way you can get the rhythm right, but the holding of the notes is still missing. To help with that and not ending up with an overly long and cumbersome string, a more sophisticated notation is needed... The same is true for covering the range of an octave and beyond. Btw, the upper/lower case choice is great for getting the sharps and flats - because every flat can be represented by a flat (just don't try to tell that to a real musician...).

  • I don't really agree with your suggestion about how to write and handle the music :)

    I think the better way to think about it is that the piece is written in 16/16 (yes yes I know it's technically still 4/4 with 8th notes but I'm trying to get at the point that each note is actually both a note and a pause to get the staccato feel of the original).

    By counting it in my head as 16/16 I think this would be correct:

    var tune = "E   B C D   C B A   A C E   D C B     C D   E   C   A   A         D   F A   G F E     C E   D C B   B C D   E   C   A   A       ";
    

    Which is a string of 128 characters for the 8 bar song (with 8 notes and 8 pauses in each bar = 8 * (8+8) == 128) I've not tested it but I think it should be close :)

About