This week I been working on generating the music from the DNA sequences. To do this I split the sequence into 160 parts each part being 1 second/note - 150 being main notes to total a time of 2:30 seconds and the 10 being a repetitive 10 note backing track. I chose two minutes and thirty seconds as a base as that is how long most songs are, if after some tests the tunes are too similar then I shall shorten it down to a minute.
This means that I was now dealing with string about 120 characters long to create a note and an octave. To create note and octave I wrote a small methods to how many times a Nucleic Acid is found in that section. E.g C : 20 times, A : 40 times, T : 30 times, G : 30 times.
The most found character is then used as the note and the second most found is used as the octave giving +1 or - 1 to the current depending on which acid. If the string contains a ' - ' then the note will be longer. A dash occurs when the two sequences cannot be matched perfectly and need to be elongated to match, as this is a major sign the sequences are different I wanted it to stand out more.
I will be adding visuals along with the music, these will be counts of the characters in a bar chart style animation for each note so the user can see how many of each character was read.
This week I also added a please wait message during the alignment process.
This means that I was now dealing with string about 120 characters long to create a note and an octave. To create note and octave I wrote a small methods to how many times a Nucleic Acid is found in that section. E.g C : 20 times, A : 40 times, T : 30 times, G : 30 times.
The most found character is then used as the note and the second most found is used as the octave giving +1 or - 1 to the current depending on which acid. If the string contains a ' - ' then the note will be longer. A dash occurs when the two sequences cannot be matched perfectly and need to be elongated to match, as this is a major sign the sequences are different I wanted it to stand out more.
I will be adding visuals along with the music, these will be counts of the characters in a bar chart style animation for each note so the user can see how many of each character was read.
This week I also added a please wait message during the alignment process.
It tell the user how many characters are being aligned as a"Fun fact". I will make some changes to this given time to make it more aesthetically pleasing.