This script allows the creation of an animated audio visualization representing the different frequencies of the sound in the form of bars, such as an equalizer.
This improved version has been designed to facilitate the manipulation of visualization by grouping the different objects generated within a parent object of type "EMPTY".
This script also brings some very useful additional features:
The first part of the script is reserved for configuration, allowing you to modify the options without touching the script itself.
Note: This script does not support all the possibilities of customizing the visualization. To fully customize the audio visualization, a good understanding of the Blender software is required.
The script is distributed without a license. You can edit and redistribute without restrictions.
Use the script in Blender:
Copy the script or load the file ".py" in the text editor of Blender, modify the options according to your preferences then launch the script by clicking on Run Script. It may take a few seconds to analyze the audio file.
Configure the script:
The script contains a first part for its configuration:
Note: Configuration is optional. Only the definition of the variable "audio_file_path" is mandatory.
Defines the path of the audio file.
Defines whether the visualization should be rendered in 2D or 3D using "Plane" or "Cube" objects. Possible values are "PLANE" or "CUBE".
Defines the number of bars in the visualization. The default value is 64.
Defines the maximum vertical size of the viewer.
Defines the "Scale" transformation of the group of bars using a number, a list, a tuple, or "None" to leave the default value (1.0, 1.0, 1.0).
Ex: None / 10 / (0.25, 0.2, 1.0)
Defines whether the viewer should be classical or symmetrical.
Defines whether the viewer should generate a second group of bars whose Y dimension is negative.
Defines whether the clone should be inverted by using a negative "Scale X" value.
Defines whether the clone should be inverted by using a negative "Scale Y" value.
Defines the offset between the two groups of bars on the y axis.
Defines whether the viewer should be horizontal or circular.
Defines the "Scale" transformation of the circle using a number, a list, a tuple, or "None" to leave the default value (1.0, 1.0, 1.0). Used only if "display_circular" is True.
Ex: None / 10 / (0.25, 0.2, 1.0)
Defines whether the audio file should be added automatically to the video sequencer.
Defines the number of the track in which the audio file is to be added.
Defines the name of the audio clip in the video sequencer.
Defines the name of the group used to materialize the visualization.
Defines whether the script should use an existing material or create a new one for the bars, or use none.
Boolean "None" / String "None" = No material, String "Create" = Create a new material, String "Use" = Use an existing material.
Defines the name of the material to be created or used, according to the "material_policy" variable.
Create a new material for the bars:
Configure the script by setting the variable "material_policy" to "Create". The variable "material_name" can also be redefined to assign a specific name to the material.
Use existing material for bars:
Configure the script by setting the variable "material_policy" to "Use". Use the variable "material_name" to define the name of the existing material to use.
Note: If the material does not exist, no material will be created or used.
Manipulate a horizontal visualization:
In the case of a horizontal visualization, the script generates a group containing the bars.
To manipulate the visualization, select this group in the "Outliner" interface and manipulate it like any 3D object (position, rotation, dimension).
Manipulate a circular visualization:
In the case of a circular view, the script generates a group containing the bars and a parent group containing the group of bars and the Bezier curve.
To manipulate the visualization and modify its shape, select the desired element or group in the "Outliner" interface and then manipulate it like any 3D object (position, rotation, dimension). To change the diameter of the circle, use the curve type object ("Curve").
In the "Outliner" interface, select the parent group, open the context menu (right-click) and choose Delete hierarchy.
Delete the audio strip:
If the script has been configured to automatically add the audio file to the video sequencer, go to "Video Sequence Editor". Select the audio clip, open the "Strip" menu and click Erase Strip.
This document by Christophe Leblanc is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.