You are not logged in.
Pages: 1
I've recently made a CLI visualizer.
Spectrum in stereo mode
Spectrum in mono mode
Ellipse visualizer
Lorenz visualizer
This project was heavily inspired by https://github.com/karlstav/cava, http://rybczak.net/ncmpcpp/, and https://github.com/sickill/rainbow
If you want to install it, I've already made an AUR package.
yaourt -S cli-visualizer
The github link is https://github.com/dpayne/cli-visualizer
Last edited by dpayne (2015-12-28 01:38:48)
Offline
I don't know what this does or why... but I want it :-)
Offline
It's a cli visualizer. Currently it only support MPD.
Offline
Looks great! If Cmus support is on the horizon I will definitely try it.
Offline
Pulse support would be awesome! Anyway, lovely work, will give this a spin.
Offline
I've been working on some experimental support for alsa and pulseaudio. In the alsa config created a default sink with a fifo file as output. Something like this
pcm.!default {
type file # File PCM
slave.pcm "hw:0,0" # This should match the playback device at /proc/asound/devices
file "|safe_fifo /tmp/audio"
format raw # File format ("raw" or "wav")
perm 0666 # Output file permission (octal, def. 0600)
}
It does not work directly with pulse audio, but it does work if alsa is installed with pulseaudio and alsa is then piped to pulseaudio. The full asound.conf examples are under https://github.com/dpayne/cli-visualize … r/examples The result is a fifo file exactly like mpd's fifo file which is nice since I'd prefer not to deal with alsa or pulse audios apis. The main issue is that it requires a helper program "safe_fifo" and as a result has proven to be very fragile. If anyone knows a better way let me know.
Offline
I finally got the visualizer working with pulseaudio correctly on my computer. Much of the code was taken from the way CAVA uses pulseaudio, their way ended up being much simpler than the way I was trying. The instructions to enable it are here https://github.com/dpayne/cli-visualize … setup-easy
Offline
build failed:
src/Transformer/SpectrumCircleTransformer.cpp: In member function ‘virtual void vis::SpectrumCircleTransformer::draw_bars(const std::vector<double>&, const std::vector<double>&, int32_t, bool, const wstring&, vis::NcursesWriter*)’:
src/Transformer/SpectrumCircleTransformer.cpp:38:9: error: ‘sqrt’ is not a member of ‘std’
std::sqrt(std::pow(half_height, 2) + std::pow(half_height, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:38:19: error: ‘pow’ is not a member of ‘std’
std::sqrt(std::pow(half_height, 2) + std::pow(half_height, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:38:46: error: ‘pow’ is not a member of ‘std’
std::sqrt(std::pow(half_height, 2) + std::pow(half_height, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:48:43: error: ‘cos’ is not a member of ‘std’
auto x = static_cast<int32_t>(std::cos(rad) * row_index);
^~~
src/Transformer/SpectrumCircleTransformer.cpp:50:43: error: ‘sin’ is not a member of ‘std’
auto y = static_cast<int32_t>(std::sin(rad) * row_index);
^~~
src/Transformer/SpectrumCircleTransformer.cpp:52:35: error: ‘sqrt’ is not a member of ‘std’
const auto distance = std::sqrt(std::pow(x, 2) + std::pow(y, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:52:45: error: ‘pow’ is not a member of ‘std’
const auto distance = std::sqrt(std::pow(x, 2) + std::pow(y, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:52:62: error: ‘pow’ is not a member of ‘std’
const auto distance = std::sqrt(std::pow(x, 2) + std::pow(y, 2));
^~~
Offline
Could you paste the output of `g++ -v` as well as the entire build output? It does appear to be building on my box but I think it's likely that something broke with the latest version of gcc.
Offline
09:37:45 % g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 6.1.1 20160501 (GCC)
08:40:27 % pacaur -y cli-visualizer-git
:: resolving dependencies...
:: looking for inter-conflicts...
AUR Packages (1):
Name Old Version New Version
aur/cli-visualizer-git latest
:: Proceed with installation? [Y/n] y
:: Retrieving package(s)...
Cloning into 'cli-visualizer-git'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 4 (delta 0)
Unpacking objects: 100% (5/5), done.
Checking connectivity... done.
[sudo] password for kwax:
:: Checking cli-visualizer-git integrity...
==> Making package: cli-visualizer-git 1:1-1 (Thu May 12 09:35:35 EEST 2016)
==> Retrieving sources...
-> Cloning cli-visualizer git repo...
Cloning into bare repository '/home/kwax/.cache/pacaur/cli-visualizer-git/cli-visualizer'...
remote: Counting objects: 1904, done.
remote: Total 1904 (delta 0), reused 0 (delta 0), pack-reused 1904
Receiving objects: 100% (1904/1904), 24.21 MiB | 3.67 MiB/s, done.
Resolving deltas: 100% (1283/1283), done.
Checking connectivity... done.
==> Validating source files with md5sums...
cli-visualizer ... Skipped
:: Building cli-visualizer-git package(s)...
==> Making package: cli-visualizer-git 1:343.588d208-1 (Thu May 12 09:35:46 EEST 2016)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating cli-visualizer git repo...
Fetching origin
==> Validating source files with md5sums...
cli-visualizer ... Skipped
==> Extracting sources...
-> Creating working copy of cli-visualizer git repo...
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Starting build()...
which: no clang in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
which: no ccache in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
mkdir -p /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build
rm -f /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/vis
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -D_ENABLE_PULSE -Wl,-O1,--sort-common,--as-needed,-z,relro -fno-omit-frame-pointer -D_ENABLE_PULSE -I/usr/local/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/src -c src/vis.cpp -o /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/vis.o
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -D_ENABLE_PULSE -Wl,-O1,--sort-common,--as-needed,-z,relro -fno-omit-frame-pointer -D_ENABLE_PULSE -I/usr/local/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/src -c src/Visualizer.cpp -o /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/Visualizer.o
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -D_ENABLE_PULSE -Wl,-O1,--sort-common,--as-needed,-z,relro -fno-omit-frame-pointer -D_ENABLE_PULSE -I/usr/local/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/src -c src/Writer/NcursesWriter.cpp -o /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/NcursesWriter.o
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -D_ENABLE_PULSE -Wl,-O1,--sort-common,--as-needed,-z,relro -fno-omit-frame-pointer -D_ENABLE_PULSE -I/usr/local/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/src -c src/Domain/VisException.cpp -o /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/VisException.o
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -D_ENABLE_PULSE -Wl,-O1,--sort-common,--as-needed,-z,relro -fno-omit-frame-pointer -D_ENABLE_PULSE -I/usr/local/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/src -c src/Domain/ColorDefinition.cpp -o /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/ColorDefinition.o
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -D_ENABLE_PULSE -Wl,-O1,--sort-common,--as-needed,-z,relro -fno-omit-frame-pointer -D_ENABLE_PULSE -I/usr/local/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/src -c src/Domain/Settings.cpp -o /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/Settings.o
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -D_ENABLE_PULSE -Wl,-O1,--sort-common,--as-needed,-z,relro -fno-omit-frame-pointer -D_ENABLE_PULSE -I/usr/local/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/include -I/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/src -c src/Transformer/SpectrumCircleTransformer.cpp -o /home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/SpectrumCircleTransformer.o
src/Transformer/SpectrumCircleTransformer.cpp: In member function ‘virtual void vis::SpectrumCircleTransformer::draw_bars(const std::vector<double>&, const std::vector<double>&, int32_t, bool, const wstring&, vis::NcursesWriter*)’:
src/Transformer/SpectrumCircleTransformer.cpp:38:9: error: ‘sqrt’ is not a member of ‘std’
std::sqrt(std::pow(half_height, 2) + std::pow(half_height, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:38:19: error: ‘pow’ is not a member of ‘std’
std::sqrt(std::pow(half_height, 2) + std::pow(half_height, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:38:46: error: ‘pow’ is not a member of ‘std’
std::sqrt(std::pow(half_height, 2) + std::pow(half_height, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:48:43: error: ‘cos’ is not a member of ‘std’
auto x = static_cast<int32_t>(std::cos(rad) * row_index);
^~~
src/Transformer/SpectrumCircleTransformer.cpp:50:43: error: ‘sin’ is not a member of ‘std’
auto y = static_cast<int32_t>(std::sin(rad) * row_index);
^~~
src/Transformer/SpectrumCircleTransformer.cpp:52:35: error: ‘sqrt’ is not a member of ‘std’
const auto distance = std::sqrt(std::pow(x, 2) + std::pow(y, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:52:45: error: ‘pow’ is not a member of ‘std’
const auto distance = std::sqrt(std::pow(x, 2) + std::pow(y, 2));
^~~
src/Transformer/SpectrumCircleTransformer.cpp:52:62: error: ‘pow’ is not a member of ‘std’
const auto distance = std::sqrt(std::pow(x, 2) + std::pow(y, 2));
^~~
Makefile:214: recipe for target '/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/SpectrumCircleTransformer.o' failed
make: *** [/home/kwax/.cache/pacaur/cli-visualizer-git/src/cli-visualizer/build/SpectrumCircleTransformer.o] Error 1
==> ERROR: A failure occurred in build().
Aborting...
:: failed to build cli-visualizer-git package(s)
pacaur -y cli-visualizer-git 4.75s user 0.58s system 21% cpu 25.179 total
Offline
Ok, should be fixed now. The newer compiler, g++ 6, broke the build.
Offline
Pages: 1