{"id":319,"date":"2022-07-16T13:48:13","date_gmt":"2022-07-16T13:48:13","guid":{"rendered":"https:\/\/vishnusrinivas.com\/?page_id=319"},"modified":"2022-07-16T17:27:44","modified_gmt":"2022-07-16T17:27:44","slug":"migos-song-generator-project","status":"publish","type":"page","link":"https:\/\/vishnusrinivas.com\/?page_id=319","title":{"rendered":"Migos Song Generator Project"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"659\" src=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/69cea3d7-f9c5-4a1b-91ff-0ca132392186_rw_1920-1024x659.png\" alt=\"\" class=\"wp-image-320\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/69cea3d7-f9c5-4a1b-91ff-0ca132392186_rw_1920-1024x659.png 1024w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/69cea3d7-f9c5-4a1b-91ff-0ca132392186_rw_1920-300x193.png 300w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/69cea3d7-f9c5-4a1b-91ff-0ca132392186_rw_1920-768x495.png 768w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/69cea3d7-f9c5-4a1b-91ff-0ca132392186_rw_1920-1536x989.png 1536w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/69cea3d7-f9c5-4a1b-91ff-0ca132392186_rw_1920.png 1618w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"has-primary-color has-text-color\">Overview<\/h3>\n\n\n\n<p>Migos are a rap trio from Atlanta who achieved worldwide fame with the release of their 2017 album Culture. Their music is infectious, catchy, and often repetitive. That got me thinking: how hard would it be to probabilistically&nbsp;generate a new Migos song?<\/p>\n\n\n\n<p>Using Java, a friend and I were able to build something fun, interesting, and hilarious.<\/p>\n\n\n\n<p>(Note: some words have been creatively censored)<\/p>\n\n\n\n<h3 class=\"has-primary-color has-text-color\">How it works<\/h3>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" width=\"742\" height=\"930\" src=\"http:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/c876c989-5097-4f5c-abb7-22ec98ac707d_rw_1200.png\" alt=\"\" class=\"wp-image-330 size-full\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/c876c989-5097-4f5c-abb7-22ec98ac707d_rw_1200.png 742w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/c876c989-5097-4f5c-abb7-22ec98ac707d_rw_1200-239x300.png 239w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p>On the left are the lyrics to Migos smash hit <em>Bad and Boujee<\/em>. The following steps will show how these lyrics were modfied and processed through multiple steps<\/p>\n\n\n\n<p>Generally, Migos songs are made up of a repeated chorus and one verse from each member. We repeated all of these steps separately for each member so that the verses generated for them were as authentic as possible.\u200b\u200b\u200b\u200b\u200b\u200b\u200b<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" width=\"872\" height=\"568\" src=\"http:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/54e39bff-bd65-4543-9b9b-511378001a25_rw_1200.png\" alt=\"\" class=\"wp-image-322 size-full\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/54e39bff-bd65-4543-9b9b-511378001a25_rw_1200.png 872w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/54e39bff-bd65-4543-9b9b-511378001a25_rw_1200-300x195.png 300w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/54e39bff-bd65-4543-9b9b-511378001a25_rw_1200-768x500.png 768w\" sizes=\"(max-width: 872px) 100vw, 872px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p>We wanted to &#8220;train&#8221; our program on every song off of Migos&#8217; album Culture, so we first convert the lyrics of each of the songs into a format that java could easily read.&nbsp;<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" width=\"906\" height=\"486\" src=\"http:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/75b42f23-8be9-44af-892d-0695ef1370ac.png\" alt=\"\" class=\"wp-image-324 size-full\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/75b42f23-8be9-44af-892d-0695ef1370ac.png 906w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/75b42f23-8be9-44af-892d-0695ef1370ac-300x161.png 300w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/75b42f23-8be9-44af-892d-0695ef1370ac-768x412.png 768w\" sizes=\"(max-width: 906px) 100vw, 906px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p>Then, using Java and a homemade part-of-speech database, we convert every lyric.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\" style=\"grid-template-columns:73% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" width=\"1024\" height=\"344\" src=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/Screen-Shot-2022-07-16-at-8.43.47-AM-1024x344.png\" alt=\"\" class=\"wp-image-331 size-full\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/Screen-Shot-2022-07-16-at-8.43.47-AM-1024x344.png 1024w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/Screen-Shot-2022-07-16-at-8.43.47-AM-300x101.png 300w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/Screen-Shot-2022-07-16-at-8.43.47-AM-768x258.png 768w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/Screen-Shot-2022-07-16-at-8.43.47-AM-1536x516.png 1536w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/Screen-Shot-2022-07-16-at-8.43.47-AM-2048x689.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p>Using our part-of-speech lyrics, we are then able to generate a transition matrix. Each row&nbsp;represents a part of speech and every column represents the next part of speech in the sentence.&nbsp;Each value represents the frequency with which that transition occurs.<\/p>\n\n\n\n<p>For example, the 4th row represents articles, and the 7th row represents nouns. In this section of lyrics, nouns follow articles 9 times, so the value for that entry in the matrix is a 9.<\/p>\n\n\n\n<p>We used one&nbsp;frequency matrix dedicated to&nbsp;each member and one for the chorus.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\" style=\"grid-template-columns:73% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" width=\"1024\" height=\"162\" src=\"http:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/7520f92c-2bd6-494f-9049-8d747bb7fe1f-1024x162.png\" alt=\"\" class=\"wp-image-327 size-full\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/7520f92c-2bd6-494f-9049-8d747bb7fe1f-1024x162.png 1024w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/7520f92c-2bd6-494f-9049-8d747bb7fe1f-300x47.png 300w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/7520f92c-2bd6-494f-9049-8d747bb7fe1f-768x122.png 768w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/7520f92c-2bd6-494f-9049-8d747bb7fe1f-1536x243.png 1536w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/7520f92c-2bd6-494f-9049-8d747bb7fe1f-2048x324.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p>Then, we divide every row by the sum of the row&#8217;s frequencies to get a probability transition matrix. Every entry in this matrix represents the probability that the row&#8217;s part of speech will be followed by the column&#8217;s part of speech<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" width=\"1024\" height=\"357\" src=\"http:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/157d977d-a3f6-47ea-b710-ac252ae6b7ef-1024x357.png\" alt=\"\" class=\"wp-image-325 size-full\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/157d977d-a3f6-47ea-b710-ac252ae6b7ef-1024x357.png 1024w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/157d977d-a3f6-47ea-b710-ac252ae6b7ef-300x105.png 300w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/157d977d-a3f6-47ea-b710-ac252ae6b7ef-768x268.png 768w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/157d977d-a3f6-47ea-b710-ac252ae6b7ef.png 1056w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p>We then use a random number generator along with our probability matrix to generate a new verse&#8217;s worth of parts of speech.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" width=\"1024\" height=\"211\" src=\"http:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/a83bb244-15bc-4ff7-be3b-c106092a6cdf-1024x211.png\" alt=\"\" class=\"wp-image-329 size-full\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/a83bb244-15bc-4ff7-be3b-c106092a6cdf-1024x211.png 1024w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/a83bb244-15bc-4ff7-be3b-c106092a6cdf-300x62.png 300w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/a83bb244-15bc-4ff7-be3b-c106092a6cdf-768x158.png 768w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/a83bb244-15bc-4ff7-be3b-c106092a6cdf-1536x316.png 1536w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/a83bb244-15bc-4ff7-be3b-c106092a6cdf.png 1934w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p>Random words are then selected from the part-of-speech database we had made earlier to fill in the rest of the lyrics.<\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" src=\"http:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/08f6c93c-a294-4788-b0ef-9d1d86e04526_rw_1920-1024x749.png\" alt=\"\" class=\"wp-image-321\" width=\"650\" height=\"475\" srcset=\"https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/08f6c93c-a294-4788-b0ef-9d1d86e04526_rw_1920-1024x749.png 1024w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/08f6c93c-a294-4788-b0ef-9d1d86e04526_rw_1920-300x219.png 300w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/08f6c93c-a294-4788-b0ef-9d1d86e04526_rw_1920-768x562.png 768w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/08f6c93c-a294-4788-b0ef-9d1d86e04526_rw_1920-1536x1123.png 1536w, https:\/\/vishnusrinivas.com\/wp-content\/uploads\/2022\/07\/08f6c93c-a294-4788-b0ef-9d1d86e04526_rw_1920.png 1556w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><figcaption>And vo\u00edla! Complete songs of total Migos-themed gibberish!<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Overview Migos are a rap trio from Atlanta who achieved worldwide fame with the release of their 2017 album Culture. Their music is infectious, catchy, and often repetitive. That got me thinking: how hard would it be to probabilistically&nbsp;generate a new Migos song? Using Java, a friend and I were able to build something fun, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"ub_ctt_via":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"featured_image_src":null,"_links":{"self":[{"href":"https:\/\/vishnusrinivas.com\/index.php?rest_route=\/wp\/v2\/pages\/319"}],"collection":[{"href":"https:\/\/vishnusrinivas.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/vishnusrinivas.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/vishnusrinivas.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vishnusrinivas.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319"}],"version-history":[{"count":2,"href":"https:\/\/vishnusrinivas.com\/index.php?rest_route=\/wp\/v2\/pages\/319\/revisions"}],"predecessor-version":[{"id":376,"href":"https:\/\/vishnusrinivas.com\/index.php?rest_route=\/wp\/v2\/pages\/319\/revisions\/376"}],"wp:attachment":[{"href":"https:\/\/vishnusrinivas.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}