#music #visualizer #audio #graphics

app coffeevis

Personal graphical/console music visualizer for Linux

6 releases (3 breaking)

0.5.1 Sep 10, 2024
0.5.0 Aug 23, 2024
0.4.0 Jun 11, 2023
0.3.0 Jul 10, 2022
0.2.1 Jun 12, 2022

#20 in Visualization

MIT license

5MB
5K SLoC

Logo of Coffeevis

Coffee Music Visualizer

A personal GUI + TUI music visualizer written in Rust.

About this project

I decided to write the visualizer because existing projects didn't suit me. Some too slow, some didn't have the visualizer I like, some take up too much cpu usage, etc.

This project also serves as my playground, so you'll see a lot of weird implementations in the source files.

v0.5.1 Hot fix

Fix compilation failure in terminal mode

What's new in v0.5.0

Terminal and minifb mode have been moved to their own features. You'll need to recompile with --features terminal and/or --features minifb to use them.

v0.5.0 introduces Winit as the default window backend for Coffeevis. Cvis can still be launched with minifb with the --minifb flag. Coffeevis is now also Wayland by default.

The app now has a new set of visualizers called Milky. These visualizers (should) look more artistic and colorful than the default Classic visualizers. Currently there's only 1 visualizer in the set lol. I plan to design some more by 0.6.0.

With performance improvements Cvis should now use less CPU usage, and even less when idle.

Examples:

console mode windowed mode

Platform support

Coffeevis is built for and runs on Linux. Windows, MacOS and BSD support is not available.

Installation

Run cargo install coffeevis

To run coffeevis in a terminal, use:

cargo install coffeevis --features terminal

If for some reason you want to use minifb, use:

cargo install coffeevis --features minifb

Configuration

Coffeevis does not remember settings and does not generate config files (feature won't be implemented unless requested).

To get around this, make a user script that runs coffeevis with flags

E.g:

#!/bin/bash

/path/to/coffeevis --fps 60 --no-auto-switch --size 40x40

Flags

Coffeevis supports temporary options at launch

Option Value (example) Description
--minifb opens window with minifb (coffeevis now runs with winit by default)
--x11 runs in X11 (Wayland is the default)
--ascii
--block
--braille
runs in the terminal
--no-auto-switch disables automatic visualizer switching
--size 80x80 sets resolution in window mode
--scale 2 upscales in window mode
--fps 60 sets refresh rate
--resizable allows resizing in window mode
--max-con-size 50x50 sets maximum resolution in terminal mode
--vis spectrum launches coffeevis with the specified visualizer

Notes

Upon launch coffeevis will grab your default audio source, use an audio config tool to direct your desired source to coffeevis (e.g. pavucontrol).

On Wayland, coffeevis cannot set itself on top so you will have to rely on an external tool. For example, on KDE Plasma, you can use the window rules feature.

When input is quiet, the visualizer will try to amplify the input so that the visualizers don't become boring.

Coffeevis prints text directly to stdout, rendering may be heavy depending on your terminal.

A terminal with GPU-accelerated support is recommended (i.e Alacritty, Kitty, Wezterm, ...)

A maximum resolution is built into the console mode (default: 50x50). Coffeevis will render in the center of the screen if terminal dimensions are larger than the limit.

Keyboard shortcuts

Global

Key Description
Space iterates forward through visualizers (wraps around)
b iterates backward (wraps around)
Esc exits
/ resets all settings
- / + decreases/increases input volume
[ / ] decreases/increases spectrum roughness
; / ' decreases/increases amount of samples into input (works for some wave-based visualizers only)
\ toggles auto switching (default: ON, 8 seconds)
n switches through sets of visualizers (wraps around)

Terminal

Key Description
. toggles between ascii rendering, block rendering and braille rendering
9 / 0 decreases/increases maximum resolution
7 / 8 decreases/increases fps by 5 (default: 60)
1 ... 6 changes fps to 10 ... 60 respectively

Please don't look at my code. No I'm not hiding anything in there it's all garbage code idk how to do gpu programming so it's all cpu code uh uhhh

Dependencies

~3–35MB
~570K SLoC