Crates.io | audioleaf |
lib.rs | audioleaf |
version | 2.3.0 |
source | src |
created_at | 2024-08-11 08:53:12.927156 |
updated_at | 2024-09-26 09:34:48.365766 |
description | Visualize music on your Nanoleaf Canvas |
homepage | |
repository | https://github.com/alfazet/audioleaf |
max_upload_size | |
id | 1333130 |
size | 94,274 |
An audio visualizer for Nanoleaf Canvas
Install from cargo with cargo install audioleaf
. Make sure that the directory with cargo binaries (by default $HOME\.cargo\bin
) is added to your $PATH
.
For users of Arch-based distros, audioleaf is also available as a package in the AUR. You can install it with your AUR helper of choice, for example with yay: yay -S audioleaf
.
All configuration of audioleaf is done through the audioleaf.toml
file, located in $HOME/.config/audioleaf
. All the options are described below:
audio_device
: The audio input device that will be the source of audio data for the visualizer.min/max_freq
: The minimum/maximum frequency (in Hz) to be included in the visualization.default_gain
: A non-negative real number, the bigger it is the more the audio samples are amplified before being visualized. While in audioleaf you can decrease and increase gain with - and = keys. This setting won't affect your listening volume.transition_time
: The duration of a single transition from one color to another, specified in units of 100 ms. Be careful of setting this value to 1 if you're photosensitive.hues
: A list of hues to be used in the visualizer's color palette, specified as angles between 0 and 360 degrees on the standard color wheel.nl_config.primary_axis
: The primary coordinate by which the panels will be sorted. Possible values are "x"
(left → right) and "y"
(bottom → top).nl_config.sort_primary/secondary
: The direction in which the panels will be sorted on the primary/secondary axis. Possible values are "asc"
(ascending) and "desc"
(descending).nl_config.active_panels
: A list of numbers of panels that should be lit up during visualization. These numbers relate to the sorting method mentioned earlier. For example, if you sorted your panels first by Y ascending, then by X descending, then the first panel will be in the lower right-hand corner of your setup and the last one will be in the upper left-hand corner. Frequencies will be visualized according to these panel numbers: the higher the number, the higher the frequency.nl_config.token_file_path
: The path where audioleaf will look for the file containing the Nanoleaf authentication token.nl_config.ip
: The local IP address of your Nanoleaf device.nl_config.port
: The port on your host to which the UDP socket handling the connection to the panels will be bound.IMPORTANT: When running audioleaf for the first time, do the following:
audioleaf --ip <local ip address of your Nanoleaf device>
(for example audioleaf --ip 192.168.0.101
). You can find that IP address by logging in to your WiFi router's admin panel and navigating to the DHCP clients list. Your Nanoleaf will have a MAC address starting with 00:55:DA:5
. Simply copy its assigned IP address.~/.config
directory - a directory audioleaf
with two files in it (audioleaf.toml
- the config file and nltoken
- containing the Nanoleaf auth token) will have been created there.Make sure to take a look at the config file and edit the options to match your Nanoleaf setup - the default settings are suited to my own panels and will very likely not work well with yours.
After a successful first-time setup, simply run audioleaf
to launch the program. To see available options add the --help
flag. Press Shift + Q to quit.
If you're playing audio and nothing is showing on your panels, check (for example using pavucontrol
on Linux) if your recording device for Audioleaf isn't set to e.g. your microphone, if you have one.