20240226_GameSynth_Blender_API_EN

Adding Sounds in Blender

The creation of sound effects for 3D animations can greatly benefit from procedural audio. Indeed, the sounds must closely follow the movements, which is both time-consuming and harder to achieve with fixed samples in a linear audio editor.

In this post, we describe two free Blender add-ons that leverage the procedural audio engine of GameSynth to insert sounds triggered by markers and driven by animation parameters. We also explain how you can easily create your own add-ons!

Installing the add-ons

This is all made possible thanks to the GameSynth Tool API. If Blender and GameSynth (version 2023.1.2 or higher) are installed on your machine, you already have all you need. Simply download the free add-ons from our website. That is all: the two applications will communicate via TCP, and there is nothing extra to install or configure.

Once you have downloaded the GameSynth AddOns.zip package, install the add-ons as usual: go to Edit->Preferences, select Add-ons, and click on the “Install” button. In the browser, select the archive package, and click on the “Install Add-on” button. The add-ons contained in the .zip file will be installed. You can find them by typing “GameSynth” in the search box. Make sure to tick the checkbox in front of their names to activate them.

Rendering sounds on markers

The first add-on is available in the Sequencer view of the Video Sequencer. In the “Add” menu, select “GameSynth Patch” to automatically render the current GameSynth patch at each selected marker’s position. This can be useful to add footsteps sound effects for instance. Moreover, if the patch was assigned any random ranges, a slightly different sound will be produced for each marker, for more realism. (If no marker was selected in the Sequencer, a single sound will be rendered at the playback cursor’s location.)

The add-on’s settings window lets you specify the folder in which the audio files will be rendered, their bit depth, whether they are mono or stereo, as well as the destination channel in the Sequencer. If the GameSynth patch is infinite, the duration of the files to be rendered can also be chosen.

The video below demonstrates how to use this add-on. In this case, slightly different punching sounds are inserted at the markers’ positions (i.e., each time the character throws her fists). The procedural audio patch in GameSynth uses simple Noise Bands generators to produce the sound.

Using curves to drive sounds

The second add-on can be found in the F-Curve context menu of the Graph Editor. At the bottom of the menu, select “Export to GameSynth” to export the first selected F-Curve to the current GameSynth patch. There, it will appear as an automation curve that can drive one or several sound parameters, generating audio that perfectly matches your 3D animation.

The add-on’s dialog box offers to select the target curve, its duration (by default that of the F-Curve in Blender), whether it is looping or not, and various pre-processing options to map the curve data to the useful range in GameSynth.

The video below shows how we used the curves that control geometry node parameters to also drive the audio. The patch in GameSynth uses a combination of Chaos, Goo, and Granular Noise generators to produce a squishy, organic sound texture.

Writing your own scripts

We described two very useful Blender add-ons to add sounds to your animations by leveraging the unique advantages of procedural audio. But the fun does not stop there, as you can easily write your own too!

We encourage you to re-use the code of the add-ons we provided for the basics (e.g., TCP communication), and to consult the GameSynth Tool API website for detailed information about the commands you can send to GameSynth. They cover application configuration, patch manipulation, meta-parameters and automation curves handling, real-time playback, and more.

Functions to automatically create dialog boxes (such as the ones used by the add-ons above) are also available, so very little code is actually required in Blender (no need to create panels, add buttons, etc.).

With 1000+ procedural audio patches in the GameSynth repository, you will also have plenty of audio material to experiment with, before even having to create your own!

Finally, should you need help, do not hesitate to join our Discord server, which has a specific channel to discuss the GameSynth Tool API and its applications. Let us know if you develop any cool add-ons!

GameSynth

discord