The actual duration of a note value in seconds is relative to tempo. A map of durations for values can be created using this function:
Beats per minute(bpm) means the amount of quarter notes in a minute. Dividing minute(60 seconds) with bpm yields length of quarter note in seconds. Other time values can be counted from that quarter note value.
I wanted some more complex seed data:
Melody is now represented as list of tuples of note and value. Both types will have their own Markov chain structure
Creation of random sequence is not dependent of the type of item in this case. Functions can be made more generic by removing type declarations referring to note-type.
Here is the main now:
Random sequences are created for both notes and time values. Then they are zipped into list of tuples and written to wav-file.
Full source on GitHub. Here is an example output: