Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

deep-music-visualizer

> 编程语言
Open source

The Deep Visualizer uses BigGAN (Brock et al., 2018) to visualize music.

397 stars0 likes0 views
WebsiteGitHub

About

The Deep Visualizer uses BigGAN (Brock et al., 2018) to visualize music.

Deep Music Visualizer

The Deep Music Visualizer uses BigGAN (Brock et al., 2018), a generative neural network, to visualize music. Like this: More examples: https://www.instagram.com/deep_music_visualizer/

Installation

This repo has been tested on Python3

Assuming you have python installed, open terminal and run these commands:

bash
git clone https://github.com/msieg/deep-music-visualizer.git
cd deep-music-visualizer
pip install -r requirements.txt

If you are on linux, you may also need to run:

bash
apt-get update
apt-get install ffmpeg
apt-get install libsndfile1

How to run

All features of the visualizer are available as input parameters. Each parameter is described below.

song

Audio file of type mp3, wav, or ogg.

This is the only required argument!

Example:

bash
python visualize.py --song beethoven.mp3

resolution

128, 256, or 512

Default: 512

If you are running on a CPU (if you're not sure, you are on a CPU), you might want to use a lower resolution or else the code will take a very long time to run. At 512X512, it will take ~7 HOURS to generate 1 minute of video on a standard desktop computer (assuming all other parameters are default). At 128x128, it would take ~25 minutes. To speed up runtime, you can decrease the resolution or increase the frame_length. To dramatically speed up runtime and generate higher quality videos, use a resolution of 512 on a GPU on a google cloud virtual machine.

Example:

bash
python visualize.py --song beethoven.mp3 --resolution 128

duration

Duration of the video output in seconds. It can be useful to generate shorter videos while you are tweaking the other visualizer parameters. Once you find your preferred parameters, remove the duration argument and set use_previous_vectors to 1 to generate the same video but for the full duration of the song.

Default: Full length of the audio

Example:

bash
python visualize.py --song beethoven.mp3 --duration 30

pitch sensitivity

The pitch sensitivity controls how rapidly the class vector (thematic content of the video) will react to changes in pitch. The higher the number, the higher the sensitivity.

Range: 1 – 299

Recommended range: 200 – 295

Default: 220

Example:

bash
python visualize.py --song beethoven.mp3 --pitch_sensitivity 280

tempo sensitivity

The tempo sensitivity controls how rapidly the noise vector (i.e. the overall size, position, and orientation of objects in the images) will react to changes in volume and tempo. The higher the number, the higher the sensitivity.

Recommended range: 0.05 – 0.8

Default: 0.25

Example:

bash
python visualize.py --song beethoven.mp3 --pitch_sensitivity 0.1

depth

The depth specifies the max value of the class vector units. Numbers closer to 1 seem to yield more thematically rich content. Numbers closer to 0 seem to yield more 'deep' structures like human and dog faces. However, this depends heavily on the specific classes you are using.

Range: 0.01 - 1

Default: 1

Example:

bash
python visualize.py --song beethoven.mp3 --depth 0.5

classes

If you want to choose which classes (image categories) to visualize, you can specify a list of ImageNet indices (1-1000) here. (list of ImageNet class indices). The number of classes must be equal to [num_classes] (default is twelve, corresponding to the twelve musical pitches (A, A#, B, etc.)). You can also enter the class indices in order of priority (highest priority first) and set sort_classes_by_power to 1.

Default: Twelve random indices between 0-999

Example (if num_classes is set to default of twelve):

bash
python visualize.py --song beethoven.mp3 --classes 45 99 567 234 89 90 105 998 56 677 884 530

num_classes

If you want to focus the visualizer around fewer than twelve themes, you can set num_classes to a number less than twelve. Since each class is associated with a pitch, the pitches that are retained when num_classes 0

Recommended range: 10 – 30

Default: 20

Example:

bash
python visualize.py --song beethoven.mp3 --smooth_factor 6

batch_size

BigGAN generates the images in batches of size [batch_size]. The only reason to reduce batch size from the default of 30 is if you run out of CUDA memory on a GPU. Reducing the batch size will slightly increase overall runtime.

Default: 30

Example:

bash
python visualize.py --song beethoven.mp3 --batch_size 20

use_previous_classes

If your previous run of the visualizer used random classes (i.e. you did not manually set the class input), and you liked the video output but want to mess with some other parameters, set use_previous_classes to 1 so that you create a similar video with the same classes on the next run of the code.

Default: 0

Example:

bash
python visualize.py --song beethoven.mp3 --use_previous_classes 1

use_previous_vectors

If you're messing around with the visualizer parameters, it can be useful to generate videos with short durations to keep your runtime low. Once you find the right set of parameters, remove the duration argument and set use_previous_vectors to 1 to generate the same video again, but for a longer duration.

Default: 0

Example:

bash
python visualize.py --song beethoven.mp3 --use_previous_vectors 1

output_file

Output file name

Default: output.mp4

Example:

bash
python visualize.py --song beethoven.mp3 --output_file my_movie.mp4

Issues· 28 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言