2023-12-21 20:17:27 +00:00
# Yammer
Audio visualizer thing in guile scheme
# Build
## Dependencies
`guile-sdl2` , `fftw`
## Compiling the library
2023-12-23 03:17:23 +00:00
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`
2023-12-21 20:17:27 +00:00
```sh
2023-12-23 03:17:23 +00:00
./compile.sh
2023-12-21 20:17:27 +00:00
```
2023-12-23 03:17:23 +00:00
You may need to adjust `PKG_CONFIG_PATH` if you use something like Guix System.
2023-12-21 20:17:27 +00:00
# Configuration
2023-12-23 03:17:23 +00:00
Copy `config.example.scm` to `~/.config/yammer/config.scm`
2023-12-21 20:17:27 +00:00
Below is a list of values and what they do
2023-12-23 03:17:23 +00:00
* `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
2023-12-22 15:26:21 +00:00
* `bitrate` : The bitrate of the audio coming from the input
2023-12-22 15:33:23 +00:00
* `sample-factor` : Proportional to quality, may cause stuttering when >1.
2023-12-21 20:17:27 +00:00
* `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)
2023-12-22 15:39:58 +00:00
* `interpolation` : Number of points to interpolate between values. < 1 means disable
2023-12-22 02:57:37 +00:00
* `smoothing` : Smoothing mode. Possible values are:
2023-12-23 20:26:00 +00:00
* `#f` : No smoothing or interpolation. Disregards `interpolation`
2023-12-22 15:18:15 +00:00
* `'none` : No smoothing
* `'moving-average` : Moving average
* `'exponential` : Simple (basic) exponential smoothing
2023-12-22 02:57:37 +00:00
* `moving-average-block-size` : Size of the moving average window. Higher is smoother.
2023-12-22 15:18:15 +00:00
* `exponential-factor` : Exponential smoothing factor, lower is more smooth.
2023-12-21 20:17:27 +00:00
2023-12-21 20:32:00 +00:00
# Running
2023-12-24 16:25:57 +00:00
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:
2023-12-21 20:32:00 +00:00
```bash
2023-12-24 16:25:57 +00:00
export LD_LIBRARY_PATH=.libs
export GUILE_LOAD_PATH=src/guile
2023-12-21 20:32:00 +00:00
```
Then, run yammer.
```bash
2023-12-24 16:25:57 +00:00
./yammer
2023-12-21 20:32:00 +00:00
```
2023-12-22 16:57:19 +00:00
# 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 )
2023-12-21 20:17:27 +00:00
# Wishlist
2023-12-23 03:17:23 +00:00
* Native PipeWire, ALSA, JACK, sndio sources
2023-12-22 15:18:15 +00:00
* More smoothing modes (one that actually works would be nice)
2023-12-21 20:17:27 +00:00
* Average over `resolution`
* Offload some calculations to the GPU
2023-12-23 03:17:23 +00:00
* Use more than one core lmao?
2023-12-21 20:17:27 +00:00
# Known issues
2023-12-22 03:42:01 +00:00
* Sometimes the read gets misaligned and just becomes noise
2023-12-21 20:17:27 +00:00
* 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
2023-12-23 03:17:23 +00:00
* PulseAudio can be reeaaaaally behind