{"id":7088,"date":"2024-05-16T07:38:16","date_gmt":"2024-05-16T07:38:16","guid":{"rendered":"https:\/\/tsugi-studio.com\/blog\/?p=7088"},"modified":"2024-06-27T07:37:12","modified_gmt":"2024-06-27T07:37:12","slug":"godot-and-the-gamesynth-tool-api","status":"publish","type":"post","link":"https:\/\/tsugi-studio.com\/blog\/2024\/05\/16\/godot-and-the-gamesynth-tool-api\/","title":{"rendered":"Godot &#038; the GameSynth Tool API"},"content":{"rendered":"<p>The <a href=\"https:\/\/www.tsugi-studio.com\/Software\/GameSynth\/API\/en\/index.html\">GameSynth Tool API<\/a> facilitates the interfacing of GameSynth with other creative tools such as game engines. In a <a href=\"https:\/\/tsugi-studio.com\/blog\/2023\/06\/27\/the-gamesynth-tool-api-and-unity\/\">previous post<\/a>, we saw how it allowed us to generate sound variations directly in the Unity Editor. This time, we will describe two new plug-ins for <a href=\"https:\/\/godotengine.org\/\">Godot Engine<\/a> that will improve your audio workflow when making games.<\/p>\n<p><a style=\"display: block; margin: 0 auto; max-width: 600px;\" class=\"litymp3\" href=\"https:\/\/youtu.be\/5w2CwBrYPts\" data-lity=\"\"><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/godot\/thumbnail_EN.jpg\" alt=\"\"><\/a><br \/>\n<\/p>\n<h2 class=\"tsugiblog-blackheader\" style=\"margin-top: 40px; padding: 16px 18px; max-width: 670px; background-position: right center; background-repeat: no-repeat; background-size: contain; letter-spacing: 0.05em; color: #ffffff; background-color: #00628e; background-image: url('https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/godot\/header-bg0.png');\">GETTING STARTED<\/h2>\n<p>The plug-ins are scripts written in GDScript, Godot&#8217;s built-in scripting language (similar to Python), that extend the editor\u2019s functionality. They can be enabled or disabled at any time from the Godot settings.<\/p>\n<p>To get started, <a href=\"https:\/\/tsugi-studio.com\/web\/gamesynth\/api\/en\/examples.html#godot-plugins\">download the scripts<\/a> from our examples page on the GameSynth Tool API website. For these scripts to be recognized by the game engine, create a new folder called \u201caddons\u201d at the root of your Godot project, and copy the scripts there.<\/p>\n<p>To enable the plug-ins in the editor, first make sure that GameSynth is running so that the scripts can communicate with it. Then, inside Godot, click on \u201cProject\u201d &gt; \u201cProject Settings\u2026\u201d and open the \u201cPlugins\u201d tab. Tick the boxes under the \u201cStatus\u201d column to enable the plug-ins.<\/p>\n<p><a class=\"blog-picture-lity\" style=\"max-width: 550px; margin: 0 auto;\" href=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/project_settings.png\" data-lity=\"\"><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/project_settings.png\" alt=\"\" \/><\/a><\/p>\n<p>A message appears in the Output dock to confirm that the connection with GameSynth has been established.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/successful_connection.png\" alt=\"\" \/><\/p>\n<h2 class=\"tsugiblog-blackheader\" style=\"margin-top: 40px; padding: 16px 18px; max-width: 670px; background-position: right center; background-repeat: no-repeat; background-size: contain; letter-spacing: 0.05em; color: #ffffff; background-color: #00628e; background-image: url('https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/godot\/header-bg1.png');\">RENDERING PATCHES WITHIN GODOT<\/h2>\n<p>The GSAPI_RenderCurrentPatch plug-in will render the current GameSynth patch and automatically assign the resulting WAV file to an audio node. This feature is available via a \u201cRender GameSynth Patch\u201d button that is added to the inspectors of the <strong>AudioStreamPlayer<\/strong>, <strong>AudioStreamPlayer2D,<\/strong> and <strong>AudioStreamPlayer3D<\/strong> nodes.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/render_button.png\" alt=\"render_button\"\/><\/p>\n<p>Once the button is pressed, the rendering settings, such as the sample rate, bit depth, and number of channels of the wave file to generate, as well as its destination folder, can be selected. Note that if the GameSynth patch is infinite, the rendering duration must be specified as well.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/window_render.png\" alt=\"\" \/><\/p>\n<p>Once generated, the WAV file will automatically be added to the project and assigned to the \u201cStream\u201d property of the audio node.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/audio_stream.png\" alt=\"\" \/><\/p>\n<p>If the GameSynth patch contains randomized parameters, you will be able to specify the number of sound variations to generate. All the variations will be rendered at once and assigned to a Stream of type <strong>AudioStreamRandomizer<\/strong> in Godot. Each time the audio node is played, a new variation will be randomly selected. This is great for avoiding repetition in often-triggered sound effects such as impacts or footsteps!<\/p>\n<h2 class=\"tsugiblog-blackheader\" style=\"margin-top: 40px; padding: 16px 18px; max-width: 670px; background-position: right center; background-repeat: no-repeat; background-size: contain; letter-spacing: 0.05em; color: #ffffff; background-color: #00628e; background-image: url('https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/godot\/header-bg2.png');\">DRIVING SOUNDS FROM GODOT\u2019S ANIMATION CURVES<\/h2>\n<p>The GSAPI_ExportAnimationCurve plug-in lets you select a track from an <strong>AnimationPlayer<\/strong> node, and export its curve to GameSynth. There, it will appear as an automation curve that can be used to control audio parameters. This will allow you to create sound effects that perfectly match your animations!<\/p>\n<p>An \u201cExport Curve to GameSynth\u201d button has been added to the inspector of the <strong>AnimationPlayer<\/strong> node.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/export_button-1.png\" alt=\"\" \/><\/p>\n<p>Before starting the export, make sure that the right animation is selected in the Animation dock. It must contain at least 2 keys, and be of type \u201cBezier Curve\u201d, \u201c3D Position\u201d, \u201c3D Rotation\u201d, or \u201c3D Scale\u201d.<\/p>\n<p>Curve segment types differ between Godot and GameSynth. Therefore, the Godot curve will be evaluated at regular intervals (i.e., sampled) to generate a similar curve in GameSynth. In the settings window, the \u201cnumber of points per second\u201d will determine these intervals.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/window_export.png\" alt=\"\" \/><\/p>\n<p>Once the OK button is pressed, an identical automation curve will be added to the current GameSynth patch.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2024\/05\/godot_curve-1-1.png\" \/><\/p>\n<p>You can now use this automation curve to control one or more synthesis parameters and generate sound effects that are driven by your animation.<\/p>\n<p>We hope these examples of integration gave you an idea of what you can achieve with the GameSynth Tool API in Godot. We are curious to see what plug-ins and scripts you will build!<\/p>\n<p><a class=\"gs-learn-more\" href=\"https:\/\/tsugi-studio.com\/web\/en\/products-gamesynth.html\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2020\/06\/2020_06_Introducing-Modular-Weapons-Modules-banner-1.png\" alt=\"GameSynth\" \/><\/a><\/p>\n<p><a class=\"gs-learn-more\" href=\"https:\/\/discord.com\/invite\/hacFY2EmgF\"><img decoding=\"async\" src=\"https:\/\/tsugi-studio.com\/blog\/wp-content\/uploads\/2023\/04\/discord.png\" alt=\"discord\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The GameSynth Tool API facilitates the interfacing of GameSynth with other creative tools such as game engines. In a previous post, we saw how<\/p>\n","protected":false},"author":1,"featured_media":7127,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,6],"tags":[],"class_list":["post-7088","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-procedural-audio","category-gamesynth"],"_links":{"self":[{"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/posts\/7088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/comments?post=7088"}],"version-history":[{"count":30,"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/posts\/7088\/revisions"}],"predecessor-version":[{"id":7132,"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/posts\/7088\/revisions\/7132"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/media\/7127"}],"wp:attachment":[{"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/media?parent=7088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/categories?post=7088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tsugi-studio.com\/blog\/wp-json\/wp\/v2\/tags?post=7088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}