You are not logged in.

#1 2015-12-28 00:18:05

dpayne
Member
Registered: 2014-10-23
Posts: 13

I made a new CLI visualizer

I've recently made a CLI visualizer.

BGyfYiv.gif
Spectrum in stereo mode

Zo5lByM.gif
Spectrum in mono mode

WoQlObi.gif
Ellipse visualizer

9QJjnDI.gif
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

#2 2015-12-28 00:25:46

oliver
Member
Registered: 2007-12-12
Posts: 448

Re: I made a new CLI visualizer

I don't know what this does or why... but I want it :-)

Offline

#3 2015-12-28 00:27:07

dpayne
Member
Registered: 2014-10-23
Posts: 13

Re: I made a new CLI visualizer

It's a cli visualizer. Currently it only support MPD.

Offline

#4 2015-12-28 02:32:33

theGunslinger
Member
Registered: 2011-05-20
Posts: 300

Re: I made a new CLI visualizer

Looks great! If Cmus support is on the horizon I will definitely try it.

Offline

#5 2015-12-29 05:37:53

Svenstaro
Administrator
From: Germany
Registered: 2008-11-19
Posts: 388

Re: I made a new CLI visualizer

Pulse support would be awesome! Anyway, lovely work, will give this a spin.

Offline

#6 2016-01-04 05:20:20

dpayne
Member
Registered: 2014-10-23
Posts: 13

Re: I made a new CLI visualizer

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

#7 2016-01-05 06:09:58

dpayne
Member
Registered: 2014-10-23
Posts: 13

Re: I made a new CLI visualizer

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

#8 2016-05-11 09:12:59

erno
Member
Registered: 2009-08-24
Posts: 83

Re: I made a new CLI visualizer

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

#9 2016-05-11 15:13:39

dpayne
Member
Registered: 2014-10-23
Posts: 13

Re: I made a new CLI visualizer

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

#10 2016-05-12 06:40:04

erno
Member
Registered: 2009-08-24
Posts: 83

Re: I made a new CLI visualizer

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

#11 2016-05-12 17:22:17

dpayne
Member
Registered: 2014-10-23
Posts: 13

Re: I made a new CLI visualizer

Ok, should be fixed now. The newer compiler, g++ 6, broke the build.

Offline

Board footer

Powered by FluxBB