INTRODUCTION

Simple audio visualizer is a small script for the open source 3D modeling software Blender, written in Python Python, created by Sirrandalot in 2015 and improved by Christophe Leblanc in 2018.

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.

The original script, created by Sirrandalot, allowed the creation and animation of "Plane" objects. However, the visualization generated was difficult to manipulate.

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:

  • Creation of a parent object of type "EMPTY" regrouping all the bars, thus allowing the manipulation of the group (position, rotation, dimension).
  • Choice between the 2D or 3D visualization by using "Plane" or "Cube" objects.
  • Choice between classic or bipolar visualization.
  • Creation of a classic horizontal or circular visualization, thanks to the addition of a bezier curve in the scene and a "CURVE" modifier to each bar.
  • Possibility of creating a second group of bars whose X and Y scale can be inverted, producing a parallel group or "mirror".
  • Definition of the "Scale" of the group as soon as it is created.
  • Creation of a material or use of an existing material and addition of this material to all the bars, facilitating customization.
  • Automatically add the audio file to the Blender video sequencer.
  • Checking the presence of the file before starting the script (avoids a bug if the file does not exist).

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.

INSTRUCTIONS

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.
Nom
Description
audio_file_path
Defines the path of the audio file.
Ex: "C:\Documents\audio_file.wav"
bar_mesh_type
Defines whether the visualization should be rendered in 2D or 3D using "Plane" or "Cube" objects. Possible values ​​are "PLANE" or "CUBE".
number_of_bars
Defines the number of bars in the visualization. The default value is 64.
bars_max_height
Defines the maximum vertical size of the viewer.
bars_group_scale
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)
bars_bipolar
Defines whether the viewer should be classical or symmetrical.
generate_clone
Defines whether the viewer should generate a second group of bars whose Y dimension is negative.
clone_inverted_x
Defines whether the clone should be inverted by using a negative "Scale X" value.
clone_inverted_y
Defines whether the clone should be inverted by using a negative "Scale Y" value.
clone_offset_y
Defines the offset between the two groups of bars on the y axis.
generate_circular
Defines whether the viewer should be horizontal or circular.
circular_curve_scale
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)
add_audio_to_video_sequencer
Defines whether the audio file should be added automatically to the video sequencer.
video_sequencer_track
Defines the number of the track in which the audio file is to be added.
video_sequencer_strip_name
Defines the name of the audio clip in the video sequencer.
group_name
Defines the name of the group used to materialize the visualization.
material_policy
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.
material_name
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").

Delete visualization:

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.

LICENSE

This program is free software, you can redistribute it and/or modify it without restrictions.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

DOWNLOAD

RELATED

Creative Commons License

This document by Christophe Leblanc is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.