yuri-xyz/chroma
关于
🌈 Shader-based audio visualizer for the terminal
设计与媒体可以做什么
- 🎨 GPU-accelerated shaders using wgpu (compute shaders)
- 🖼️ ASCII art rendering with ANSI color support
- ⚙️ Highly configurable parameters via config file
- 💾 Save and load configurations with automatic deduplication via hashing
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- +3
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文🌈 A Rust-based, ASCII art shader audio visualizer for your terminal!
⭐ Features
- 🎨 GPU-accelerated shaders using wgpu (compute shaders)
- 🖼️ ASCII art rendering with ANSI color support
- ⚙️ Highly configurable parameters via config file
- 💾 Save and load configurations with automatic deduplication via hashing
- 🔄 Live config reloading for real-time parameter adjustment
- 🎵 Audio visualization driven by system audio input
- 📊 FFT-based audio analysis for reactive visual effects
✨ Demos & screenshots
🔊 Make sure sound is enabled for the videos.
🔗 Install
Nix
# Run Chroma
nix run github:yuri-xyz/chroma
# Install the CLI into your profile
nix profile add github:yuri-xyz/chroma
# Develop locally with Rust, Vulkan, and audio dependencies
nix develop
Chroma always builds with audio support. Vulkan still requires a working host GPU driver/ICD. See Nix for the flake outputs, pinned Rust toolchains, and validation checks.
Cargo
git clone https://github.com/yuri-xyz/chroma.git
cd chroma
# Make sure you have ALSA, libpulse, and PipeWire/PulseAudio packages installed,
# the exact package names may vary depending on your distro.
cargo install --path .
ℹ️ Usage
# Run with default settings
chroma
# Load a saved configuration
chroma --config config_a3f8c2d9e1b5.toml
# Or using the short form
chroma -c config_a3f8c2d9e1b5.toml
# View help for all arguments and settings
chroma --help
# Emit output for embedding in other terminal apps
chroma --stream 80x24
Stream mode skips terminal setup, the status bar, and interactive input. By default it emits the legacy ANSI stream with a blank line after each frame for compatibility with existing embedders. Use --stream-format ansi for length-prefixed ANSI frames, or --stream-format cells for length-prefixed tab-separated cell records.
🕹️ Controls
QorEsc- Quit applicationR- Randomize parameters ⭐ (Discover new effects!)S- Save configuration 💾 (Createsconfig_<hash>.tomlin current directory)T- Cycle patternsC- Cycle color modesP- Cycle palettes 🎨 (16 different character sets!)N- Cycle the effect triggered by bass drops[/]- Zoom in and out
Frequency, speed, and amplitude are driven by the music, so they have no keys; set them with flags or a config file.
See Controls and Palettes for more details, or browse the full documentation.
🎨 Configuration & Ricing
Chroma is designed to be highly configurable and CLI-friendly, so it feels natural alongside your other terminal tools. There are multiple ways to configure the effects and visuals:
Config files: Load preset configurations from TOML files. You can find example preset configs in the examples directory:
chroma -c examples/0.toml
Live reloading: Edit your config file while Chroma is running and see changes applied instantly. This makes it easy to tweak parameters and visualize your adjustments in real time. Reloads keep your --preset underneath and your CLI parameters on top, just like at startup.
Built-in presets: --preset NUM (0-26) or --preset random starts from a preset embedded in the binary. Add --preset-interval SECONDS to keep switching while Chroma runs: a number steps through the presets in order, random keeps picking random ones.
chroma --preset random --preset-interval 30
CLI parameters: Most parameters can be set via command-line arguments. Run chroma --help to see all available options.
[!TIP] You can combine config files with CLI parameters—CLI args take precedence. This is perfect when you have a favorite base config but want to tweak specific values on the fly or in a script.
[!TIP] Use
--randomor-rto randomize any parameters that haven't been explicitly set by your config file or CLI args. Great for adding variety to each run!
You can also create custom shader patterns and load them with chroma --custom-shader my_shader.wgsl. See examples/custom_shader.wgsl for a beginner template.
📦 Dependencies
- Runtime
- vulkan-icd-loader
- A Vulkan driver: one of
vulkan-intel,vulkan-radeon, ornvidia-utils - Terminal with ANSI color support
- PipeWire/PulseAudio with libpulse for Linux system-audio capture
- alsa-lib for CPAL fallback capture
- Build
- rust, cargo, git
🏗️ Contributing
Contributions are welcome. If you have ideas, find bugs, or want to improve the project, feel free to create an issue and a corresponding PR.
How it works:
- Shader files are compiled by
wgpuand rendered as ASCII output with ANSI colors in the terminal. - Chroma connects to system audio with PulseAudio/PipeWire on Linux, falling back to
cpalwhere needed. - It uses fast Fourier transforms from the
rustfftcrate to make the visuals react to what is playing, extracting bass (20-250 Hz), mid (250-2000 Hz), and treble (2000-8000 Hz) bands.
See CONTRIBUTING for a more in-depth guide.
探索相关项目
加载中…