yammer/README.md

90 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

# Yammer
Audio visualizer thing in guile scheme
# Build
## Dependencies
`guile-sdl2`, `fftw`
## Compiling the library
You need to compile the yammer.c file because it has wrappers and stuff.
To disable FFTW, use `export NO_FFTW=1`
To disable PulseAudio, use `export NO_PULSE=1`
To enable debugging symbols, use `export DEBUG=1`
```sh
./compile.sh
```
You may need to adjust `PKG_CONFIG_PATH` if you use something like Guix System.
# Configuration
Copy `config.example.scm` to `~/.config/yammer/config.scm`
Below is a list of values and what they do
* `using-fftw?`: Was libyammer.so compiled using FFTW?
* `using-pulse?`: Was libyammer.so compiled using PulseAudio?
* `source`: The MPD fifo or PulseAudio source
* `source-type`: One of `'mpd` or `'pulse`
* `pulse-latency`: Latency to request from PulseAudio
* `bitrate`: The bitrate of the audio coming from the input
* `sample-factor`: Proportional to quality, may cause stuttering when >1.
* `fps`: Self explanatory
* `resolution`: Pixel width of bars
* `scale`: Bar height multiplier
* `color`: Bar color
* `bgcolor`: Background color
* `queue-size`: The size of the queue (minimum of 1), delays displaying bars by `queue-size` frames. Useful if desync is noticed
* `fft`: Whether or not to perform a fourier transform to show frequencies (like `spectrum` mode in most other visualizers)
* `interpolation`: Number of points to interpolate between values. <1 means disable
* `smoothing`: Smoothing mode. Possible values are:
* `#f`: No smoothing or interpolation. Disregards `interpolation`
* `'none`: No smoothing
* `'moving-average`: Moving average
* `'exponential`: Simple (basic) exponential smoothing
* `moving-average-block-size`: Size of the moving average window. Higher is smoother.
* `exponential-factor`: Exponential smoothing factor, lower is more smooth.
# Running
Either install .libs/libyammer.so, src/c/yammer.h, src/guile/yammer.scm, and src/guile/yammer to their respective systemwide locations, or do the following:
```bash
export LD_LIBRARY_PATH=.libs
export GUILE_LOAD_PATH=src/guile
```
Then, run yammer.
```bash
./yammer
```
# Screenshots
## Normal mode
![Normal Mode](http://git.vern.cc/cobra/yammer/raw/branch/main/screenshots/normal-mode.png)
![Normal Mode 2](http://git.vern.cc/cobra/yammer/raw/branch/main/screenshots/normal-mode-2.png)
## FFT mode
![FFT Mode](http://git.vern.cc/cobra/yammer/raw/branch/main/screenshots/fft-mode.png)
### Exponential
![Exponential FFT Mode](http://git.vern.cc/cobra/yammer/raw/branch/main/screenshots/exponential-fft.png)
### Moving Average
![Moving Average FFT Mode](http://git.vern.cc/cobra/yammer/raw/branch/main/screenshots/moving-average-fft.png)
# Wishlist
* Native PipeWire, ALSA, JACK, sndio sources
* More smoothing modes (one that actually works would be nice)
* Average over `resolution`
* Offload some calculations to the GPU
* Use more than one core lmao?
# Known issues
* Sometimes the read gets misaligned and just becomes noise
* When MPD is paused or the program is sleeping for the next frame, the UI doesn't update so you can't exit
* The surface can't be transparent
* PulseAudio can be reeaaaaally behind