{"id":3662704,"date":"2025-01-31T08:00:10","date_gmt":"2025-01-31T13:00:10","guid":{"rendered":"https:\/\/spin.atomicobject.com\/?p=3662704"},"modified":"2025-02-03T15:19:52","modified_gmt":"2025-02-03T20:19:52","slug":"music-related-software-python","status":"publish","type":"post","link":"https:\/\/spin.atomicobject.com\/music-related-software-python\/","title":{"rendered":"Make Sick Beats with Python"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">As a software developer who is also a musician, I\u2019ve spent a lot of time creating music-related software in my freetime. In this post, I\u2019ll be outlining how to create a very simple drum machine using Python and the pygame library. While pygame is intended as a library for creating video games, its mixer is also very useful for music-making purposes.\u00a0 Let&#8217;s make some sick beats with Python.\ud83e\udd41\ud83d\udc0d<\/span><\/p>\n<h2><strong>Setup<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">You can download the latest Python version <a href=\"https:\/\/www.python.org\/downloads\/\">here<\/a>. The only library you\u2019ll need to import is pygame which can be installed with <code>pip3 install pygame==2.6.0<\/code>.<br \/>\n<\/span><\/p>\n<h2><b>Storing Sounds<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Our drum machine will support three different sounds: hi-hat, snare, and toms. The WAV files used in this example can be downloaded <\/span><a href=\"https:\/\/github.com\/georgia-martinez\/atomic-spin-projects\/tree\/main\/project1\/sounds\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">First, we are going to create a Sound class which will take the path to our WAV files and allow us to play them back.<\/span><\/p>\n<pre><code class=\"language-python\">\r\nimport pygame\r\nimport os\r\n\r\nclass Sound:\r\n\u00a0 \u00a0 mixer = pygame.mixer.init()<\/code><\/pre>\n<p>Here, we are creating a static variable called \u201cmixer\u201d which uses pygame\u2019s mixer.<\/p>\n<pre><code class=\"language-python\">\r\nclass Sound():\r\n   mixer = pygame.mixer.init()\r\n\r\n   def __init__(self, sound_name):\r\n       sound_file = os.path.join(\"sounds\", sound_name + \".wav\")\r\n       self.sound = pygame.mixer.Sound(sound_file)\r\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">Next, we are adding a constructor which lets the user input the path to a specific WAV file. Using that path, we are creating a sound object using the mixer. I have all of my WAV files in a folder called &#8220;sounds&#8221;. Adjust the path as necessary.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Finally, we can add a <code>play()<\/code> method to the Sound class which will play the sound back.<\/span><\/p>\n<pre><code class=\"language-python\">\r\n   def play(self):\r\n       self.sound.play()\r\n<\/code><\/pre>\n<h2><b>Representing Music in Code<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Before we delve into the rest of the code, we need to plan out how we\u2019re going to represent a drum loop in our program. This is going to require a bit of music background.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Music can be divided into different units of time called measures. Within each measure, there are a certain number of down beats. You can think of these down beats like a strong beat that you tap your foot along to naturally when listening to music. The most common number of down beats in a measure is four.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A single measure can be represented as an array. One way we can represent this is an integer array of length four. We can map each integer in the array to a different sound (e.g. 0=no sound, 1=hi-hat, etc.). <\/span><span style=\"font-weight: 400;\">When our code loops through the array, it will check the number at the current index, play the sound mapped to it, pause for a specified duration, and then move onto the next index.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The problem with this approach is that four beats doesn&#8217;t give us a lot to work with for a single measure. The simple way to fix this is to make our array longer. We can divide each downbeat into four shorter beats. With four downbeats in a measure, this now gives us sixteen beats to work with. We can keep dividing this further, but for the purposes of this tutorial, sixteen beats is sufficient to represent most simple one measure drum loops.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\"><b>Implementing Playback<\/b><\/span><\/h2>\n<p>With this in mind, let&#8217;s create a DrumMachine class which will play the drum loops. First<span style=\"font-weight: 400;\">, we create a sound map using our Sound class from earlier to map integers in our measure array to sounds. We will also initialize pygame when our DrumMachine is initialized.<\/span><\/p>\n<pre><code class=\"language-python\">\r\nimport pygame\r\nimport time\r\n\r\nfrom sound import Sound\r\n\r\nclass DrumMachine:\r\n   def __init__(self, bpm=100):\r\n       self.sound_map = {\r\n           0: None,\r\n           1: Sound(\"hi_hat\"),\r\n           2: Sound(\"snare\"),\r\n           3: Sound(\"tom\"),\r\n       }\r\n\r\n       pygame.init()\r\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\"><br \/>\nNext, let&#8217;s create a <code>play()<\/code> method which will take in array as outlined in the previous section.\u00a0<\/span><\/p>\n<pre><code class=\"language-python\">\r\n   def play(self, measure):\r\n       while True:\r\n           for beat in range(len(measure)):\r\n               sound_idx = measure[beat]\r\n\r\n               if sound_idx != 0:\r\n                   self.sound_map[sound_idx].play()\r\n\r\n               time.sleep(...) # We will handle this in the next section\r\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\"><br \/>\nInside the <code>play()<\/code> method, we put the code inside of an infinite while loop so that the measure loops forever. Then in the for loop,<\/span><span style=\"font-weight: 400;\"> we get the integer at the current index, get the Sound object the integer is mapped to, play the sound, pause for a set duration, and then move on to the next index. We do a check for the integer 0 because this represents no sound and does not have a Sound object associated with it.<br \/>\n<\/span><\/p>\n<h2><strong>Tempo and Pause Duration<\/strong><\/h2>\n<p>The last thing we need to handle is how we set the speed of our drum loop and what the pause duration between beats should be. <span style=\"font-weight: 400;\">The musical term for &#8220;speed&#8221; is tempo which can be measured in beats per minute (BPM). Using a set BPM value (e.g. 100), we can set the pause duration between each index in our measure array.<br \/>\n<\/span><\/p>\n<p>We will create a <code>set_bpm()<\/code> method which will take in a BPM and calculate the pause duration.<\/p>\n<pre><code class=\"language-python\">\r\n   def set_bpm(self, bpm):\r\n       self.pause = 0.25 * (60 \/ bpm)\r\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">The pause value will be passed into the <code>time.sleep()<\/code> call in our <code>play()<\/code> method.\u00a0 Since sleep method uses seconds, we need to convert our pause value into seconds. Since we divided each downbeat into four notes, we use the value 0.25. We then multiply this by the result of dividing 60 seconds by the BPM to get our pause duration in seconds.<br \/>\n<\/span><\/p>\n<p>The last step we need to do is go back to our constructor and call our <code>set_bpm()<\/code> method. We will give BPM a default value of 100.<\/p>\n<pre><code class=\"language-python\">\r\nclass DrumMachine:\r\n   def __init__(self, bpm=100):\r\n       self.set_bpm(bpm)\r\n       ...\r\n<\/code><\/pre>\n<h2><strong>Testing Out Our Program<\/strong><\/h2>\n<p>That concludes all of the code needed for our drum machine! If you would like to review the code, the GitHub repo can be found <a href=\"https:\/\/github.com\/georgia-martinez\/atomic-spin-projects\/tree\/main\/project1\">here<\/a>.<\/p>\n<p>Below, I have included a few example measures along with the corresponding audio files. For any musicians out there, I have also included the same loop notated in standard music notation.<\/p>\n<pre><code class=\"language-python\">\r\ndrum_machine = DrumMachine()\r\n\r\nmeasure = [\r\n    3, 0, 1, 0,\r\n    2, 0, 1, 0,\r\n    3, 0, 1, 0,\r\n    2, 0, 1, 0,\r\n]\r\n\r\ndrum_machine.play(measure)\r\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3662747\" src=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_1.png\" alt=\"\" width=\"289\" height=\"136\" srcset=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_1.png 429w, https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_1-150x71.png 150w\" sizes=\"auto, (max-width: 289px) 100vw, 289px\" \/><\/p>\n<p><audio class=\"wp-audio-shortcode\" id=\"audio-3662704-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_1.m4a?_=1\" \/><a href=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_1.m4a\">https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_1.m4a<\/a><\/audio><\/p>\n<pre><code class=\"language-python\">\r\ndrum_machine = DrumMachine()\r\n\r\nmeasure = [\r\n    3, 1, 1, 1,\r\n    2, 1, 1, 3,\r\n    1, 3, 1, 3,\r\n    2, 1, 1, 1,\r\n]\r\n\r\ndrum_machine.play(measure)\r\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3662748\" src=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_2-590x236.png\" alt=\"\" width=\"403\" height=\"161\" srcset=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_2-590x236.png 590w, https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_2-150x60.png 150w, https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_2-600x240.png 600w, https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_2.png 606w\" sizes=\"auto, (max-width: 403px) 100vw, 403px\" \/><\/p>\n<p><audio class=\"wp-audio-shortcode\" id=\"audio-3662704-2\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_2.m4a?_=2\" \/><a href=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_2.m4a\">https:\/\/spin.atomicobject.com\/wp-content\/uploads\/drum_loop_2.m4a<\/a><\/audio><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a software developer who is also a musician, I\u2019ve spent a lot of time creating music-related software in my freetime. In this post, I\u2019ll be outlining how to create a very simple drum machine using Python and the pygame library. While pygame is intended as a library for creating video games, its mixer is [&hellip;]<\/p>\n","protected":false},"author":679,"featured_media":3666092,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1858],"tags":[1332,23614,23615],"series":[],"class_list":["post-3662704","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-platforms-languages","tag-python","tag-pygame","tag-music"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Make Sick Beats with Python<\/title>\n<meta name=\"description\" content=\"I enjoy creating music-related software in my free time. Let&#039;s make some sick beats on a drum machine with Python and the pygame library.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/spin.atomicobject.com\/music-related-software-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Make Sick Beats with Python\" \/>\n<meta property=\"og:description\" content=\"I enjoy creating music-related software in my free time. Let&#039;s make some sick beats on a drum machine with Python and the pygame library.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/spin.atomicobject.com\/music-related-software-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Atomic Spin\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/atomicobject\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-31T13:00:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-03T20:19:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/sick-beats-e1738613984291.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1056\" \/>\n\t<meta property=\"og:image:height\" content=\"640\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Georgia Martinez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@atomicobject\" \/>\n<meta name=\"twitter:site\" content=\"@atomicobject\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Georgia Martinez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/\"},\"author\":{\"name\":\"Georgia Martinez\",\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/#\\\/schema\\\/person\\\/ad6b23a942d708c0522b101e0535bd9b\"},\"headline\":\"Make Sick Beats with Python\",\"datePublished\":\"2025-01-31T13:00:10+00:00\",\"dateModified\":\"2025-02-03T20:19:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/\"},\"wordCount\":881,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/atomicobject.com\\\/\"},\"image\":{\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/spin.atomicobject.com\\\/wp-content\\\/uploads\\\/sick-beats-e1738613984291.jpg\",\"keywords\":[\"python\",\"pygame\",\"music\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/\",\"url\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/\",\"name\":\"Make Sick Beats with Python\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/spin.atomicobject.com\\\/wp-content\\\/uploads\\\/sick-beats-e1738613984291.jpg\",\"datePublished\":\"2025-01-31T13:00:10+00:00\",\"dateModified\":\"2025-02-03T20:19:52+00:00\",\"description\":\"I enjoy creating music-related software in my free time. Let's make some sick beats on a drum machine with Python and the pygame library.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/music-related-software-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/spin.atomicobject.com\\\/wp-content\\\/uploads\\\/sick-beats-e1738613984291.jpg\",\"contentUrl\":\"https:\\\/\\\/spin.atomicobject.com\\\/wp-content\\\/uploads\\\/sick-beats-e1738613984291.jpg\",\"width\":1056,\"height\":640,\"caption\":\"Make Sick Beats with Python\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/#website\",\"url\":\"https:\\\/\\\/spin.atomicobject.com\\\/\",\"name\":\"Atomic Spin\",\"description\":\"Atomic Object\u2019s blog on everything we find fascinating.\",\"publisher\":{\"@id\":\"https:\\\/\\\/atomicobject.com\\\/\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/spin.atomicobject.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/#organization\",\"name\":\"Atomic Object\",\"url\":\"https:\\\/\\\/spin.atomicobject.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/spin.atomicobject.com\\\/wp-content\\\/uploads\\\/AO-Logo-Emblem-Color.png\",\"contentUrl\":\"https:\\\/\\\/spin.atomicobject.com\\\/wp-content\\\/uploads\\\/AO-Logo-Emblem-Color.png\",\"width\":258,\"height\":244,\"caption\":\"Atomic Object\"},\"image\":{\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/atomicobject\",\"https:\\\/\\\/x.com\\\/atomicobject\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/spin.atomicobject.com\\\/#\\\/schema\\\/person\\\/ad6b23a942d708c0522b101e0535bd9b\",\"name\":\"Georgia Martinez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/006529789a954b0f92e760a22949452b41f2b4195f4fccf175044150e4c5781e?s=96&d=blank&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/006529789a954b0f92e760a22949452b41f2b4195f4fccf175044150e4c5781e?s=96&d=blank&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/006529789a954b0f92e760a22949452b41f2b4195f4fccf175044150e4c5781e?s=96&d=blank&r=pg\",\"caption\":\"Georgia Martinez\"},\"description\":\"Software Consultant &amp; Developer at Atomic Object in Ann Arbor. Always thinking beyond the possible.\",\"url\":\"https:\\\/\\\/spin.atomicobject.com\\\/author\\\/georgia-martinez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Make Sick Beats with Python","description":"I enjoy creating music-related software in my free time. Let's make some sick beats on a drum machine with Python and the pygame library.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/spin.atomicobject.com\/music-related-software-python\/","og_locale":"en_US","og_type":"article","og_title":"Make Sick Beats with Python","og_description":"I enjoy creating music-related software in my free time. Let's make some sick beats on a drum machine with Python and the pygame library.","og_url":"https:\/\/spin.atomicobject.com\/music-related-software-python\/","og_site_name":"Atomic Spin","article_publisher":"https:\/\/www.facebook.com\/atomicobject","article_published_time":"2025-01-31T13:00:10+00:00","article_modified_time":"2025-02-03T20:19:52+00:00","og_image":[{"width":1056,"height":640,"url":"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/sick-beats-e1738613984291.jpg","type":"image\/jpeg"}],"author":"Georgia Martinez","twitter_card":"summary_large_image","twitter_creator":"@atomicobject","twitter_site":"@atomicobject","twitter_misc":{"Written by":"Georgia Martinez","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/spin.atomicobject.com\/music-related-software-python\/#article","isPartOf":{"@id":"https:\/\/spin.atomicobject.com\/music-related-software-python\/"},"author":{"name":"Georgia Martinez","@id":"https:\/\/spin.atomicobject.com\/#\/schema\/person\/ad6b23a942d708c0522b101e0535bd9b"},"headline":"Make Sick Beats with Python","datePublished":"2025-01-31T13:00:10+00:00","dateModified":"2025-02-03T20:19:52+00:00","mainEntityOfPage":{"@id":"https:\/\/spin.atomicobject.com\/music-related-software-python\/"},"wordCount":881,"commentCount":0,"publisher":{"@id":"https:\/\/atomicobject.com\/"},"image":{"@id":"https:\/\/spin.atomicobject.com\/music-related-software-python\/#primaryimage"},"thumbnailUrl":"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/sick-beats-e1738613984291.jpg","keywords":["python","pygame","music"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/spin.atomicobject.com\/music-related-software-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/spin.atomicobject.com\/music-related-software-python\/","url":"https:\/\/spin.atomicobject.com\/music-related-software-python\/","name":"Make Sick Beats with Python","isPartOf":{"@id":"https:\/\/spin.atomicobject.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/spin.atomicobject.com\/music-related-software-python\/#primaryimage"},"image":{"@id":"https:\/\/spin.atomicobject.com\/music-related-software-python\/#primaryimage"},"thumbnailUrl":"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/sick-beats-e1738613984291.jpg","datePublished":"2025-01-31T13:00:10+00:00","dateModified":"2025-02-03T20:19:52+00:00","description":"I enjoy creating music-related software in my free time. Let's make some sick beats on a drum machine with Python and the pygame library.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/spin.atomicobject.com\/music-related-software-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/spin.atomicobject.com\/music-related-software-python\/#primaryimage","url":"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/sick-beats-e1738613984291.jpg","contentUrl":"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/sick-beats-e1738613984291.jpg","width":1056,"height":640,"caption":"Make Sick Beats with Python"},{"@type":"WebSite","@id":"https:\/\/spin.atomicobject.com\/#website","url":"https:\/\/spin.atomicobject.com\/","name":"Atomic Spin","description":"Atomic Object\u2019s blog on everything we find fascinating.","publisher":{"@id":"https:\/\/atomicobject.com\/"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/spin.atomicobject.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/spin.atomicobject.com\/#organization","name":"Atomic Object","url":"https:\/\/spin.atomicobject.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/spin.atomicobject.com\/#\/schema\/logo\/image\/","url":"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/AO-Logo-Emblem-Color.png","contentUrl":"https:\/\/spin.atomicobject.com\/wp-content\/uploads\/AO-Logo-Emblem-Color.png","width":258,"height":244,"caption":"Atomic Object"},"image":{"@id":"https:\/\/spin.atomicobject.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/atomicobject","https:\/\/x.com\/atomicobject"]},{"@type":"Person","@id":"https:\/\/spin.atomicobject.com\/#\/schema\/person\/ad6b23a942d708c0522b101e0535bd9b","name":"Georgia Martinez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/006529789a954b0f92e760a22949452b41f2b4195f4fccf175044150e4c5781e?s=96&d=blank&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/006529789a954b0f92e760a22949452b41f2b4195f4fccf175044150e4c5781e?s=96&d=blank&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/006529789a954b0f92e760a22949452b41f2b4195f4fccf175044150e4c5781e?s=96&d=blank&r=pg","caption":"Georgia Martinez"},"description":"Software Consultant &amp; Developer at Atomic Object in Ann Arbor. Always thinking beyond the possible.","url":"https:\/\/spin.atomicobject.com\/author\/georgia-martinez\/"}]}},"_links":{"self":[{"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/posts\/3662704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/users\/679"}],"replies":[{"embeddable":true,"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/comments?post=3662704"}],"version-history":[{"count":0,"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/posts\/3662704\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/media\/3666092"}],"wp:attachment":[{"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/media?parent=3662704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/categories?post=3662704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/tags?post=3662704"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/spin.atomicobject.com\/wp-json\/wp\/v2\/series?post=3662704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}