{"id":228,"date":"2023-04-08T18:44:57","date_gmt":"2023-04-08T18:44:57","guid":{"rendered":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/?p=228"},"modified":"2023-04-08T18:44:57","modified_gmt":"2023-04-08T18:44:57","slug":"adityas-status-report-4-8","status":"publish","type":"post","link":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/2023\/04\/08\/adityas-status-report-4-8\/","title":{"rendered":"Aditya&#8217;s Status Report 4\/8"},"content":{"rendered":"<p>This week I started working out how to format information within the note data structures so that it&#8217;s always readable by Vexflow. I wrote functions in the back-end that went through the output of the integrator of the pitch and rhythm processors and modified the duration of each element, so that it would always be a multiple of 4. This is because our STFT was designed such that 4 windows would correspond to the length of an eight-note in sheet music.<\/p>\n<p>I then needed to make sure each duration is a power of 2. That&#8217;s because each subsequent note type (eighth, quarter, half, etc&#8230;) is 2 times the duration of the previous type. I iterated through the data and if any value was not a power of 2, I would split it into smaller notes. For example, if a notes was 24 units long, it would be split into notes of length 16 and 8. Then a Tie was added, which in music notation indicates that the durations of two notes are combined.<\/p>\n<p>Here is a demonstration of ties in the music:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone  wp-image-229\" src=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-content\/uploads\/sites\/253\/2023\/04\/image-3-300x76.png\" alt=\"\" width=\"521\" height=\"132\" srcset=\"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-content\/uploads\/sites\/253\/2023\/04\/image-3-300x76.png 300w, https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-content\/uploads\/sites\/253\/2023\/04\/image-3-768x195.png 768w, https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-content\/uploads\/sites\/253\/2023\/04\/image-3.png 1021w\" sizes=\"(max-width: 521px) 100vw, 521px\" \/><\/p>\n<p>As you can see, the first measure has been properly split so that the duration of the measure doesn&#8217;t exceed 4 beats (or 32 units in the back end). One bug is the tie connecting the notes at the end of Row 1 and the start of Row 2. This week I plan to fix this by implementing dotted notes, which are another way we handle non-power of 2 note sizes that don&#8217;t result in this graphical error.<\/p>\n<h3>Testing<\/h3>\n<p>To check the results of the formatting algorithms, I manually generated several small note lists that were meant to represent the output of the integrator, then ran it through the formatting methods. For example, a list containing only a note of duration 12 would output a new list of length 2, which notes of duration 8 and 4.<\/p>\n<p>In the future, I plan to implement tests that test data of varying tempos and time signatures, such as 3\/4 and 6\/8. I want the testing code to be robust and able to handle all these time signatures the same way, so that the same function can be used to generate notes from 6\/8 as in 3\/4, with the parameters of the function being changed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week I started working out how to format information within the note data structures so that it&#8217;s always readable by Vexflow. I wrote functions in the back-end that went through the output of the integrator of the pitch and rhythm processors and modified the duration of each element, so that it would always be &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/2023\/04\/08\/adityas-status-report-4-8\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Aditya&#8217;s Status Report 4\/8&#8221;<\/span><\/a><\/p>\n","protected":false},"author":712,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[9],"_links":{"self":[{"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/posts\/228"}],"collection":[{"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/users\/712"}],"replies":[{"embeddable":true,"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":1,"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/posts\/228\/revisions\/230"}],"wp:attachment":[{"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/course.ece.cmu.edu\/~ece500\/projects\/s23-teamd8\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}