{"id":1661,"date":"2025-11-20T11:18:15","date_gmt":"2025-11-20T11:18:15","guid":{"rendered":"https:\/\/sites.wsagames.com\/pe1n23\/?p=1661"},"modified":"2026-01-12T12:33:11","modified_gmt":"2026-01-12T12:33:11","slug":"godot-prototyping-1","status":"publish","type":"post","link":"https:\/\/sites.wsagames.com\/pe1n23\/godot-prototyping-1\/","title":{"rendered":"Godot Prototyping 1"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">To start my first prototype, I first had to create a system for tracking beats and rhythm. The following video gave me some advice for doing so, but the process still seemed quite complicated in Godot:<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-video is-provider-youtube wp-block-embed-youtube\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Complete Godot Rhythm Game Tutorial\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/_FRiPPbJsFQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Another drawback of this implementation is that it gets the current song playback time to calculate beats off of <code>get_playback_position()<\/code>, which uses an audio file e.g a pre-recorded song. My solution has to be completely dynamic so I would have to find a way to use potentially an in-game timer for this.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As well as this I found a freely available godot plugin on GitHub which includes a modified version of this implementation, so I used this as a basis: <a href=\"https:\/\/github.com\/skibbl-dev\/GodotConductor\/\">https:\/\/github.com\/skibbl-dev\/GodotConductor\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After this I made some adaptations to make it more dynamic.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1047\" height=\"80\" src=\"https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image.png\" alt=\"\" class=\"wp-image-1666\" srcset=\"https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image.png 1047w, https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-300x23.png 300w, https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-1024x78.png 1024w, https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-768x59.png 768w\" sizes=\"(max-width: 1047px) 100vw, 1047px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"975\" height=\"132\" src=\"https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-1.png\" alt=\"\" class=\"wp-image-1667\" srcset=\"https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-1.png 975w, https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-1-300x41.png 300w, https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-1-768x104.png 768w\" sizes=\"(max-width: 975px) 100vw, 975px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In these parts of code I changed <code>get_playback_position()<\/code> to instead use <code>Time.get_ticks_usec()<\/code>, a function that counts how long the program has been running for in microseconds. All we have to do to get the elapsed time in the song is record the time the song started and take that away from the current time. From there you can divide it by the number of seconds per beat (dictated by our set BPM) to get the position in beats.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the integer value of that position variable goes up, that means a beat has been hit and we can emit a signal for it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"976\" height=\"235\" src=\"https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-2.png\" alt=\"\" class=\"wp-image-1668\" srcset=\"https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-2.png 976w, https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-2-300x72.png 300w, https:\/\/sites.wsagames.com\/pe1n23\/wp-content\/uploads\/sites\/10\/2025\/11\/image-2-768x185.png 768w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If we make an AudioStreamPlayer node in the game that listens to this signal and plays when it recieves it, we can get a sound on every beat. In this example I downloaded a 909 Kick sound for use.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To start my first prototype, I first had to create a system for tracking beats and rhythm. The following video gave me some advice for doing so, but the process still seemed quite complicated in Godot: Another drawback of this implementation is that it gets the current song playback time to calculate beats off of [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":1668,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-1661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-year-3"],"_links":{"self":[{"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/posts\/1661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/comments?post=1661"}],"version-history":[{"count":5,"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/posts\/1661\/revisions"}],"predecessor-version":[{"id":1669,"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/posts\/1661\/revisions\/1669"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/media\/1668"}],"wp:attachment":[{"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/media?parent=1661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/categories?post=1661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.wsagames.com\/pe1n23\/wp-json\/wp\/v2\/tags?post=1661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}