GithubHelp home page GithubHelp logo

cli-visualizer's Introduction

Table of Contents generated with DocToc

travis-ci

Coverity Scan Build Status

cli-visualizer

Command line visualizer. Supports mpd, with experimental support for alsa and pulseaudio.

This project was heavily inspired by C.A.V.A, ncmpcpp, and rainbow

spectrum_stereo

spectrum_mono

ellipse

lorenz

Installing Pre-requisites

fftw and ncursesw libraries are required to build. Note that ncurses with wide character support is needed.

A C++ compiler that supports C++14 is also needed. On arch linux, the latest g++ or clang++ will work.

256 Colors

In order to show the colors, you need a terminal with 256 color support.rxvt-unicode out of the box.

For xterm, the default $TERM setting needs to be changed to rxvt-256color. To change this run

export TERM=rxvt-256color

Setting TERM to xterm-256color may also work but seems to cause issues with rendering of the visualizers in some terminals.

Debian & Ubuntu

sudo apt install libfftw3-dev libncursesw5-dev cmake

For pulseaudio support, the pulseaudio library also needs to be installed

sudo apt install libpulse-dev

Older versions of Ubuntu also need newer a newer gcc compiler. Note, while this should be safe, it will upgrade some base libc libraries that might break your system.

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9

Arch Linux

In arch, the ncursesw is bundled with the ncurses package.

sudo pacman -S ncurses fftw cmake

Fedora

sudo dnf install fftw-devel gcc-c++ ncurses-devel pulseaudio-libs-devel cmake

Solus

Solus requires a handful of development packages and creating a link for libtinfo before installing.

sudo eopkg it -c system.devel
sudo eopkg install fftw fftw-devel ncurses ncurses-devel pulseaudio-devel cmake
sudo ln -s /usr/lib/libncurses.so.5 /usr/lib/libtinfo.so.5 # Should already be there, but just in case.
sudo ln -s /usr/lib/libtinfo.so.5 /usr/lib/libtinfo.so

./install.sh

Gentoo

Make sure to compile ncurses with unicode flag, have fftw and cmake installed on your Gentoo system.

sudo emerge fftw cmake
sudo USE="unicode" emerge ncurses

Mac OS X

Mac os x has a version of ncurses builtin, but a newer version is required.

brew install fftw cmake
brew tap homebrew/dupes
brew install ncurses

Installing

After the pre-requisites have been installed, run the install script.

./install.sh

The configuration file is installed under "~/.config/vis/config".

Older version of Ubuntu need to compile with the newer g++ compiler.

export CXX=g++-4.9
./install.sh

Arch Linux

The Arch Linux install is much simpler since an AUR package exist for cli-visualizer.

yaourt -S cli-visualizer

You will have to copy config and colors manually.

Setup

At least one of the following needs to be configured (and linked in the config): mpd, alsa, pulseaudio or squeezelite.

MPD Setup

The visualizer needs to use mpd's fifo output file to read in the audio stream. To do this, add the following lines to your mpd config file.

audio_output {
	type                    "fifo"
	name                    "my_fifo"
	path                    "/tmp/mpd.fifo"
	format                  "44100:16:2"
}

If you have any sync issues with the audio where the visualizer either get ahead or behind the music, try lowering the audio buffer in your mpd config.

audio_output {
    ...
    #this sets the buffer time to 50,000 microseconds
    buffer_time     "50000"
}

ALSA Setup

WARNING: alsa support is very very experimental. It is very possible that it will be completely broken on various systems and could cause weird/bad behaviour.

Similar to the MPD setup, the visualizer needs to use a fifo output file to read in the alsa audio stream. To do this, add the following lines to your alsa config file, usually at /etc/asound.conf. If the file does not exist create it under /etc/asound.conf.

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" #safe_fifo will be in the cli-visualizer/bin/safe_fifo directory
    format raw              # File format ("raw" or "wav")
    perm 0666               # Output file permission (octal, def. 0600)
}

Next change the visualizer config ~/.config/vis/config to point to the new fifo file

mpd.fifo.path=/tmp/audio

A normal fifo file can not be used since otherwise no sound would work unless the fifo file is being read. This effectively means that no sound would be played if the visualizer is not running. To get around this issue a helper program safe_fifo is used. The safe_fifo program is essentially a non-blocking fifo file, it takes stdin and writes it to a fifo files given as the first parameter. If the fifo buffer is full, it clears the buffer and writes again.

Note that alsa support is still very experimental. There are a couple of caveats with this approach. Firstly safe_fifo must in a location alsa can find it. If you are building from source it us under cli-visualizer/bin/safe_fifo. Secondly slave.pcm must match whatever your alsa playback device is.

ALSA with dmix

On sound cards that do not support hardware level mixing, alsa uses dmix to allow playback from multiple applications at once. In order to make this work with the visualizer a dmixer plugin needs to be defined in /etc/asound.conf and the visualizer pcm set to use dmixer instead of the hardware device directly. This configuration might will change slightly depending on the system.

This is an example asound.conf for Intel HD Audio.

pcm.dmixer {
    type dmix
    ipc_key 1024
    ipc_key_add_uid false
    ipc_perm 0666            # mixing for all users
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192
        rate 44100
    }
    bindings {
        0 0
        1 1
    }
}

pcm.dsp0 {
    type plug
    slave.pcm "dmixer"
}

pcm.!default {
    type plug
    slave.pcm "dmixer"
}

pcm.default {
   type plug
   slave.pcm "dmixer"
}

ctl.mixer0 {
    type hw
    card 0
}

pcm.!default {
    type file               # File PCM
    slave.pcm "dmixer"      # Use the dmixer plugin as the slave pcm
    file "|safe_fifo /tmp/audio"
    format raw              # File format ("raw" or "wav")
    perm 0666               # Output file permission (octal, def. 0600)
}

Pulse Audio Setup (Easy)

Pulse audio should be the easiest to setup out of all the options. In order for this to work pulseaudio must be installed and vis must be built with pulseaudio enabled. To build with pulseaudio support run make ENABLE_PULSE=1.

To enable pulse audio in the vis config set audio sources to pulse with

audio.sources=pulse

If this does not work, then vis has most likely not guess the correct sink to use. Try switching the pulseaudio source vis uses. A list can be found by running the command pacmd list-sinks | grep -e 'name:' -e 'index'. The correct pulseaudio source can then be set with

audio.pulse.source=0

Troubleshooting with Pulse For MacOS Users:

If vis is hanging for you after running it make sure the pulseaudio daemon is running. You can start it if you installed it with brew by running

brew services start pulseaudio

Alternatively you can run the pulseaudio command and send it to the background, then run bg to continue it.

Then try to run vis again. You'll know it worked if it asks to have access to your microphone.

Port Audio Setup (Wicked Easy)

Install portaudio, then build vis. That's it.

To enable port audio in the vis config set audio sources to port with

audio.sources=port

The correct port audio device can then be set with

audio.port.source=DEVICE NAME

squeezelite Setup

squeezelite is one of several software clients available for the Logitech Media Server. Squeezelite can export its audio data as shared memory, which is what this source module uses. Just adapt your config:

audio.sources=shmem
shmem.shmemname=/squeezelite-AA:BB:CC:DD:EE:FF

where AA:BB:CC:DD:EE:FF is squeezelite's MAC address (check the LMS Web GUI (Settings>Information) if unsure).
Note: squeezelite must be started with the -v flag to enable visualizer support.

Usage

Start with

vis

Controls

Key Description
space Switch visualizers
q or CTRL-C Quit
r Reload config
c Next color scheme
s Toggle Mono/Stereo Mode
+ Increase scaling by 10%
- Decrease scaling by 10%

Configuration

Reloading Config

The config can be reload while vis is running by either pressing the r key or by sending the USR1 signal to vis. Sending the USR1 signal can be done with killall -USR1 vis, this is useful if you want to dynamically reload colors from a script.

Colors

The display colors and their order can be changed by switching the color scheme in the config under colors.scheme. This is a comma separated list of color schemes. Each color scheme must be defined at ~/.config/vis/colors/<name_of_the_color_scheme>. There are three different ways to specific a color within the scheme: by name, by hex number, and by index.

An example color scheme configuration with only one scheme would be

colors.scheme=rainbow

Using two color schemes

colors.scheme=rainbow,blue

Note, vis does not override or change any of the terminal colors. All colors will be influenced by whatever terminal settings are set by the users terminal. Usually these colors are specified in .Xdefaults.

Color Schemes by Visualizer

Each visualizer supports its own list of color schemes. This will control the colors of a particular visualizer without effecting the others and will override the global defined by colors.scheme.

An example of settings the spectrums visualizer to rainbow color scheme and the default for other visualizers to the blue color scheme.

visualizer.spectrum.color.scheme=rainbow
color.scheme=blue

Color Gradients

Gradients are turned on by default. To disable gradients add gradient=false to the top of the color scheme file. Note this is NOT in the main config but instead in the color scheme file.

Color scheme example with gradients disabled.

gradient=false
#4040ff
#03d2aa
#56fc2d

Color scheme example with gradients enabled that blends red to blue.

red
blue

RGB colors

The color scheme can be defined in two ways with RGB values or by index. The RGB values are defined as a hex color code, they are useful for creating a 256 bit color scheme. The displayed color will not be the true color, but instead an approximation of the color based on 256-bit terminal colors.

RGB color scheme example

#4040ff
#2c56fc
#2a59fc
#1180ed
#04a6d5
#02abd1
#03d2aa
#04d6a5
#12ee7f
#2bfc58
#2dfc55
#56fc2d

Color indexes

The second way to define a color scheme is by the color index. Specifically this is the exact color index used by ncurses. Color indexes are useful for creating a visualizer that matches the terminal's set color scheme.

Color index color scheme example

4
12
6
14
2
10
11
3
5
1
13
9
7
15
0

basic_colors

All the basic 16 terminal colors from 0-15 in-order. The spectrum colors can be ordered in any you want, this example was done in order to show all colors.



Color names

The third way to define a color scheme is by the color name. Only 8 color names are supported: black, blue, cyan, green, yellow, red, magenta, white. Note that these 8 colors are the basic terminal colors and are often set by a terminal's color scheme. This means that the color name might not match the color shown since the terminal theme might change it. For example, dark themes often set white to something dark since white is usually the default color for the terminal background.

blue

A color scheme with only one color blue.



Spectrum

The spectrum visualizer allows for many different configuration options.

Smoothing

There are three different smoothing modes, monstercat, sgs, none.

#Available smoothing options are monstercat, sgs, none.
visualizer.spectrum.smoothing.mode=sgs
Sgs Smoothing

SGS smoothing Savitzky-Golay filter. There are a couple of options for sgs smoothing.

The first option is controlling the number of smoothing passes done when rendering the bars. Increasing this number with make the spectrum smoother. This is set with visualizer.sgs.smoothing.passes.

The second option is the number of neighbors to look at when smoothing. This is set with visualizer.sgs.smoothing.points. This should always be an odd number. A larger number will generally increase the smoothing since more neighbors will be looked at.

sgs_smoothing

Default sgs smoothing.



sgs_smoothing

Sgs smoothing with number of passes set to 5.

MonsterCat Smoothing

Monster cat smoothing is inspired by the monster cat youtube channel (https://www.youtube.com/user/MonstercatMedia). To control the amount of smoothing for montercat use visualizer.monstercat.smoothing.factor. The default smoothing factor for monstercat is 1.5. Increase the smoothing factor by a lot could hurt performance.

monstercat_smoothing

No Smoothing

Smoothing can be completely turned off by setting the smoothing option to none.

visualizer.spectrum.smoothing.mode=none

Spectrum with smoothing off

none_smoothing

Falloff

This configures the falloff effect on the spectrum visualizer. This effect creates a slow fall in bar height. Available falloff options are fill,top,none. The default falloff option is fill.

visualizer.spectrum.falloff.mode=fill

With the top setting the falloff effect is only applied to the top character in the bar. This creates a gap between the main bar and the top falloff character.

top_falloff

top falloff effect with the spectrum character set to #.

The fill option leaves no gaps between the very top character and the rest of the bar.

fill_falloff

fill falloff effect with the spectrum character set to #.



The none option removing the falloff effect entirely..

none_falloff

Falloff effect removed with the spectrum character set to #.

Spectrum Appearance

Certain aspects of the spectrum appearance can be controlled through the config.

The bar width can be controlled to make it wider or narrower. The default is 2.

visualizer.spectrum.bar.width=2

bar_width

Bar width set to 5.



The spacing between bars can also be controlled to make it wider or narrower. The default is 1.

visualizer.spectrum.bar.spacing=1

bar_spacing

Bar spacing set to 0.



The margin widths of the spectrum visualizer can also be controlled. The margins are set in percent of total screen for spectrum visualizer. All margin percentages default to 0.0.

visualizer.spectrum.top.margin=0.0
visualizer.spectrum.bottom.margin=0.0
visualizer.spectrum.right.margin=0.0
visualizer.spectrum.left.margin=0.0

spectrum_margins

Spectrum with the top margin set to 0.30, stereo mode set to false, and the left right margins set to 0.10.


Turn stereo mode off to show only one set of bars.

audio.stereo.enabled=false



Normally the bars are ordered so that the lowest frequencies are handled by the left most bars and the highest frequencies by the right most bars. The reversed option gives the option to reverse this so that the highest frequencies come first.

visualizer.spectrum.reversed=true

spectrum_reversed

Spectrum with reverse set to true.

Scaling

The spectrum visualizer should auto-scale, but for lorenz and ellipse visualizers scaling is based off volume. If your music volume is a lot lower than the system volume then you can scale the visualizers with the settings

visualizer.scaling.multiplier=1.5

This setting can also be controlled with +/- keys.

Full configuration example

#Refresh rate of the visualizers. A really high refresh rate may cause screen tearing. Default is 20.
visualizer.fps=20

#Defaults to "/tmp/mpd.fifo"
mpd.fifo.path

#If set to false the visualizers will use mono mode instead of stereo. Some visualizers will
#behave differently when mono is enabled. For example, spectrum show two sets of bars.
audio.stereo.enabled=false

#Specifies how often the visualizer will change in seconds. 0 means do not rotate. Default is 0.
visualizer.rotation.secs=10

#Configures the samples rate and the cutoff frequencies.
audio.sampling.frequency=44100
audio.low.cutoff.frequency=30
audio.high.cutoff.frequency=22050

##Applies scaling factor to both lorenz and ellipse visualizers. This is useful when the system audio is set
#to a low volume.
#visualizer.scaling.multiplier=1.0

#Configures the visualizers and the order they are in. Available visualizers are spectrum,lorenz,ellipse.
#Defaults to spectrum,ellipse,lorenz
visualizers=spectrum,ellipse,lorenz


#Configures what character the spectrum visualizer will use. Specifying a space (e.g " ") means the
#background will be colored instead of the character. Defaults to " ".
visualizer.spectrum.character=#

#Spectrum bar width. Defaults to 1.
visualizer.spectrum.bar.width=2

#The amount of space between each bar in the spectrum visualizer. Defaults to 1. It's possible to set this to
#zero to have no space between bars
visualizer.spectrum.bar.spacing=1

#Available smoothing options are monstercat, sgs, none. Defaults to sgs.
visualizer.spectrum.smoothing.mode=monstercat

#This configures the falloff effect on the spectrum visualizer. Available falloff options are fill,top,none.
#Defaults to "fill"
visualizer.spectrum.falloff.mode=fill

#Configures how fast the falloff character falls. This is an exponential falloff so values usually look
#best 0.9+ and small changes in this value can have a large effect. Defaults to 0.95
visualizer.spectrum.falloff.weight=0.95

#Margins in percent of total screen for spectrum visualizer. All margins default to 0
visualizer.spectrum.top.margin=0.0
visualizer.spectrum.bottom.margin=0.0
visualizer.spectrum.right.margin=0.0
visualizer.spectrum.left.margin=0.0

#Reverses the direction of the spectrum so that high freqs are first and low freqs last. Defaults to false.
visualizer.spectrum.reversed=false

#Sets the audio sources to use. Currently available ones are "mpd" and "alsa"Sets the audio sources to use.
#Currently available ones are "mpd", "pulse", "port", and "alsa". Defaults to "mpd".
audio.sources=pulse

##vis tries to find the correct pulseaudio sink, however this will not work on all systems.
#If pulse audio is not working with vis try switching the audio source. A list can be found by running the
#command pacmd list-sinks  | grep -e 'name:'  -e 'index'
audio.pulse.source=0

#vis tries to find the correct portaudio device (through portaudio default method), however its not for-sure.
#If port audio is not working with vis try switching the audio srouce. A list can be found by setting
#this value to "list" and checking the vis log file. Replace this value with the device name desired
audio.port.source=auto

#This configures the sgs smoothing effect on the spectrum visualizer. More points spreads out the smoothing
#effect and increasing passes runs the smoother multiple times on reach run. Defaults are points=3 and passes=2.
visualizer.sgs.smoothing.points=3
visualizer.sgs.smoothing.passes=2


#Configures what character the ellipse visualizer will use. Specifying a space (e.g " ") means the
#background will be colored instead of the character. Defaults to " ".
visualizer.ellipse.character=#

#The radius of each color ring in the ellipse visualizer. Defaults to 2.
visualizer.ellipse.radius=2

## Turns off overriding the user's terminal colors
#colors.override.terminal=false

#Specifies the color scheme. The color scheme must be in ~/.config/vis/colors/ directory. Default is "colors"
colors.scheme=rainbow

Trouble Shooting

General

vis is overwriting my terminal colorscheme

Turn off overriding terminal colors.

colors.override.terminal=false

Due to the way terminal color schemes work, there is no portable way for ncurses to get the original color scheme. By default it overrides the user's terminal colors with the visualizer colors. It does this to get a smoother transition between gradients, however this overrides the user's terminal color scheme.

Tearing our corrupt output

This is usually and issue with ncurses versions past versions 6.0+20170729. Try changing the TERM variable to rxvt with

export TERM=rxvt-256color

Mac OSX

vis hangs with no output #1

It is possible there is a naming conflict with an existing BSD tool vis. Try running vis -h. If the output looks something like

mac ❯❯❯ vis -h
vis: illegal option -- h
usage: vis [-cbflnostw] [-F foldwidth] [file ...]

then there is a naming conflict with cli-visualizer. To fix this issue, put /usr/local/bin before /usr/bin/ in $PATH.

vis hangs with no output #2

MPD on mac os does not automatically create the output file for the visualizer.

mkfifo /tmp/mpd.fifo

Running mkfifo will create the output file. This file is usually /tmp/mpd.fifo, but please make sure it matches any overrides set in your mpd.conf and vis config ~/.config/vis/config.

cli-visualizer's People

Contributors

blshkv avatar camotubi avatar chargingbulle avatar dawe35 avatar dnalor avatar dpayne avatar duckthom avatar erikboesen avatar fes0j avatar greenbigfrog avatar hackerb9 avatar jensenr30 avatar jgkamat avatar juliosueiras avatar kaligule avatar levisnoot avatar m4cs avatar matthewarmand avatar maxice8 avatar noriah avatar sbussetti avatar snuggle avatar teeuwen avatar tsweet64 avatar xanarin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli-visualizer's Issues

readme lacks explaination

I might simply be blind, but how do i place the bars in the button of the screen, instead of in the middle?

Thank you!

Compilation error in Alpine

Getting the following errors
(the ncurses-dev package for Alpine is installed)

src/Writer/NcursesWriter.cpp: In member function 'void vis::NcursesWriter::write_background(int32_t, int32_t, vis::ColorIndex, const wstring&)':
src/Writer/NcursesWriter.cpp:62:41: error: 'mvaddwstr' was not declared in this scope
     mvaddwstr(height, width, msg.c_str());
                                         ^
src/Writer/NcursesWriter.cpp: In member function 'void vis::NcursesWriter::write_foreground(int32_t, int32_t, vis::ColorIndex, const wstring&)':
src/Writer/NcursesWriter.cpp:73:41: error: 'mvaddwstr' was not declared in this scope
     mvaddwstr(height, width, msg.c_str());
                                         ^
make: *** [Makefile:233: /cli-visualizer/build/NcursesWriter.o] Error 1

Unable to launch with terminator -e or --command

I have script which is intended to launch vis when I bring up my music player. Unfortunately, the following commands result in an empty or blank Terminator screen.

terminator -e vis
terminator --command vis

I've also tried this with i3-sensible-terminal.

Furthermore, I have tried launching vis via a specific Terminator profile but this produced the same result. It's possible I'm missing something but any feedback would be greatly appreciated. Thank you.

Beyond this, I am able to launch vis just fine by itself.

Blank Screen when running vis

So... I am an idiot. Please have patience.
I am on Ubuntu 16.04, fresh install.

list of what I did:
export TERM=xterm-256color
sudo apt-get install libfftw3-dev libncursesw5-dev
sudo apt-get install libpulse-dev
make ENABLE_PULSE=1
./install.sh
pacmd list-sinks | grep -e 'name:' -e 'index' <-- to find audio source
vim ~/.config/vis/config
^ added 'audio.sources=pulse' and 'audio.pulse.source=0'
sudo apt-get install pulseaudio
but i cant help but notice that running pulseaudio gives me the following:
This message was edited
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.
but i have sound

What should I do/have not done?
If say, I have a music video playing in a different screen coming out of headphones, is there more I should be doing?

Thank you very much. Whatever your response is, I'll give this a star =)

CMUS support

Hello, I'm interested in working on porting this to work with CMUS if you haven't already.

Q: Can I get the raw spectrum totals out via fifo

A question:

In the same way cli can pull the PCM from MPD fifo, can cli dump analyzed band amplitudes out to a fifo (along with displaying it)?

I'd like to pick up the spectrum and send it to another device to display in an alternate manner.

Cheers!

T

PulseAudio pulls from sources instead of sinks

Hello,
First, I apologize if it turns out this doesn't have to do with your program. However, as far as I can tell, vis is listening to my input sources rather than my output sinks.
For example, when I run pacmd list-sinks | grep -e 'name:' -e 'index', it spits this out:

 index: 0
    name: <alsa_output.pci-0000_01_00.1.hdmi-stereo>
 index: 1
    name: <alsa_output.pci-0000_00_1b.0.analog-stereo>`

So I type in 1 for the audio.pulse.source= field. The spectrum, however responds to all audio input, so when i checked the sources output (pacmd list-sources | grep -e device.string -e 'name:'), it came up with this:

  name: <alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor>
            device.string = "1"
  name: <alsa_input.usb-OmniVision_Technologies__Inc.-S2640-07.05.28.1_Monitor_Integrated_Webcam-02.analog-stereo>
            device.string = "front:2"
  name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor>
            device.string = "0"
  name: <alsa_input.pci-0000_00_1b.0.analog-stereo>
            device.string = "front:0"

Here, 1 is also my default source for PulseAudio. What's more is that audio.pulse.source= displays a valid spectrum for all inputs up to 3, which is my number of PulseAudio sources.

Is there a way for me to modify this to pull from my PulseAudio sinks? Thank you for any input.

MacOS example config

Would be super handy to have a default macOS config in the examples folder as it deviates quite a bit from the given example config.

Thanks

OSX audio output

Hello. I got a bit confused at the setup section. I'm running MacOS and I don't know which audio output should I choose.
Thanks for your answers.

Some bars get stuck at a certain level

I love the program, just got a strange problem where, after a while of playing, the music the bars can get 'stuck' at a point, and not go below that point, but they can go above that point, after going above the stuck level, it returns back to the stuck point.

The same thing happens with ellipse mode too, can't really tell with lorenz

It sometimes goes away after changing to a song, possibly with a blank part at the start of the song.

Photo of it when no audio is being played. https://i.imgur.com/Q0O7q2V.png

Video of music playing, and the bug happening
https://youtu.be/rteCqFnHmPA

Tested on the latest commit.

Config: https://gist.github.com/AConsolePeasant/5fdb31de56e0662b3ed5

visualizer not working

I am using Arch.
I installed vis both form aur and from github.
the only one that works is the spectrum. the other 2 doesnot work, it is just a blank screen.
how do i fix it?

ALSA configuration breaks sound system

Using ALSA and adding the following code to /etc/asound.conf breaks the sound system:

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" #safe_fifo will be in the cli-visualizer/bin/safe_fifo directory
    format raw              # File format ("raw" or "wav")
    perm 0666               # Output file permission (octal, def. 0600)
}

sound no longer plays and audio program deadbeef crashes when attempting to play an mp3.

speaker-test -t sine -f 2600 results in:

Playback open error: -16,Device or resource busy

System information:

cat /proc/asound/modules

 0 snd_ca0106
 1 snd_intel8x0

I'm using the Creative Labs ca0106 card

uname -a
Linux dimension 4.1.23-1-MANJARO #1 SMP PREEMPT Sun Apr 24 10:46:46 UTC 2016 i686 GNU/Linux

Mopidy + MPD blank screen

I know you're probably sick of blank screen complaints! I implemented someone's suggestion to output to /tmp/mpd.fifo and i can tail that and it seems to be working, but I'm not seeing any visuals when vis runs. It's not the naming conflict, and with activity in mpd.fifo, i'm not sure where to do.

my ~/.config/vis/config

audio.sources=mpd
mpd.fifo.path=/tmp/mpd.fifo

16 color terminal

Is it possible to add support for non 256 color terminals? For example $TERM=screen-16color.

(Out of curiosity: Why is 256 color required in the first place?)

AUR PKGBUILD fails

I'm trying to install this project from the AUR. I didn't touch the PKGBUILD or the .install file, and it spat out a compiler error.

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/tmp/yaourt-tmp-fredo/aur-cli-visualizer/src/cli-visualizer-1.1/include -I/tmp/yaourt-tmp-fredo/aur-cli-visualizer/src/cli-visualizer-1.1/src -c src/Transformer/SpectrumCircleTransformer.cpp -o /tmp/yaourt-tmp-fredo/aur-cli-visualizer/src/cli-visualizer-1.1/build/SpectrumCircleTransformer.o
src/Transformer/SpectrumCircleTransformer.cpp: In member function ‘virtual void vis::SpectrumCircleTransformer::draw_bars(const std::vector&, const std::vector&, 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 '/tmp/yaourt-tmp-fredo/aur-cli-visualizer/src/cli-visualizer-1.1/build/SpectrumCircleTransformer.o' failed
make: *_* [/tmp/yaourt-tmp-fredo/aur-cli-visualizer/src/cli-visualizer-1.1/build/SpectrumCircleTransformer.o] Error 1

Sorry if this is difficult to parse through, I'm not sure how to make it pretty.

Compilation errors on Debian Jessie

Getting some compilation errors when running on Debian Jessie:

src/Writer/NcursesWriter.cpp: In member function ‘void vis::NcursesWriter::write_background(int32_t, int32_t, vis::ColorIndex, const wstring&)’:
src/Writer/NcursesWriter.cpp:54:41: error: ‘mvaddwstr’ was not declared in this scope
     mvaddwstr(height, width, msg.c_str());
                                         ^
src/Writer/NcursesWriter.cpp: In member function ‘void vis::NcursesWriter::write_foreground(int32_t, int32_t, vis::ColorIndex, const wstring&)’:
src/Writer/NcursesWriter.cpp:65:41: error: ‘mvaddwstr’ was not declared in this scope
     mvaddwstr(height, width, msg.c_str());
                                         ^
Makefile:218: recipe for target '/home/pi/cli-visualizer/build/NcursesWriter.o' failed
make: *** [/home/pi/cli-visualizer/build/NcursesWriter.o] Error 1

(OS X) does not output anything onto screen, just a blank terminal

I followed the instructions from this issue as well: #24
Still no output.

Here is my config:

##Refresh rate of the visualizers. A really high refresh rate may cause screen tearing. Default is 20.
#visualizer.fps=20

##Sets the audio sources to use. Currently available ones are "mpd" and "alsa"Sets the audio sources to use.
##Currently available ones are "mpd", "pulse" and "alsa". Defaults to "mpd".
audio.sources=mpd

##vis tries to find the correct pulseaudio sink, however this will not work on all systems.
##If pulse audio is not working with vis try switching the audio source. A list can be found by running the
##command pacmd list-sinks  | grep -e 'name:'  -e 'index'
#audio.pulse.source=0

##Defaults to "/tmp/mpd.fifo"
mpd.fifo.path=/tmp/mpd.fifo

##If set to false the visualizers will use mono mode instead of stereo. Some visualizers will
##behave differently when mono is enabled. For example, spectrum show two sets of bars.
#audio.stereo.enabled=false

##Specifies how often the visualizer will change in seconds. 0 means do not rotate. Default is 0.
#visualizer.rotation.secs=10

##Configures the samples rate and the cutoff frequencies.
#audio.sampling.frequency=44100
#audio.low.cutoff.frequency=22050
#audio.high.cutoff.frequency=30


##Configures the visualizers and the order they are in. Available visualizers are spectrum,lorenz,ellipse.
##Defaults to spectrum,ellipse,lorenz
#visualizers=spectrum,ellipse,lorenz


##Configures what character the spectrum visualizer will use. Specifying a space (e.g " ") means the
##background will be colored instead of the character. Defaults to " ".
#visualizer.spectrum.character=#

##Spectrum bar width. Defaults to 2.
#visualizer.spectrum.bar.width=2

##The amount of space between each bar in the spectrum visualizer. Defaults to 1. It's possible to set this to
##zero to have no space between bars
#visualizer.spectrum.bar.spacing=1

##Available smoothing options are monstercat, sgs, none.
#visualizer.spectrum.smoothing.mode=monstercat

##This configures the falloff effect on the spectrum visualizer. Available falloff options are fill,top,none.
##Defaults to "fill"
#visualizer.spectrum.falloff.mode=fill

##Configures how fast the falloff character falls. This is an exponential falloff so values usually look
##best 0.9+ and small changes in this value can have a large effect. Defaults to 0.95
#visualizer.spectrum.falloff.weight=0.95

##Margins in percent of total screen for spectrum visualizer. All margins default to 0
#visualizer.spectrum.top.margin=0.30
#visualizer.spectrum.bottom.margin=0.10
#visualizer.spectrum.right.margin=0.10
#visualizer.spectrum.left.margin=0.10

##Reverses the direction of the spectrum so that high freqs are first and low freqs last. Defaults to false.
#visualizer.spectrum.reversed=false

##This configures the sgs smoothing effect on the spectrum visualizer. More points spreads out the smoothing
##effect and increasing passes runs the smoother multiple times on reach run. Defaults are points=3 and passes=1
#visualizer.sgs.smoothing.points=3
#visualizer.sgs.smoothing.passes=1


##Configures what character the ellipse visualizer will use. Specifying a space (e.g " ") means the
##background will be colored instead of the character. Defaults to "█".
#visualizer.ellipse.character=#

##The radius of each color ring in the ellipse visualizer. Defaults to 2.
#visualizer.ellipse.radius=2


##Configures what character the lorenz visualizer will use. Specifying a space (e.g " ") means the
##background will be colored instead of the character. Defaults to "█".
#visualizer.lorenz.character=#

##Specifies the color scheme. The color scheme must be in ~/.config/vis/colors/ directory. The default scheme is "colors".
#colors.scheme=rainbow

Error in `g++': double free or corruption

I owe a Raspberry Pi 3.

After extracting I run make.

When I run "make" I got the following error:

mkdir -p /home/ikem/Downloads/cli-visualizer_1.1/cli-visualizer-1.1/build
rm -f /home/ikem/Downloads/cli-visualizer_1.1/cli-visualizer-1.1/build/vis
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -DNCURSESW -fno-omit-frame-pointer -DNCURSESW -I/usr/local/include -I/home/ikem/Downloads/cli-visualizer_1.1/cli-visualizer-1.1/include -I/home/ikem/Downloads/cli-visualizer_1.1/cli-visualizer-1.1/src -c src/vis.cpp -o /home/ikem/Downloads/cli-visualizer_1.1/cli-visualizer-1.1/build/vis.o
*** Error in `g++': double free or corruption (top): 0x0083acc0 ***
Makefile:214: recipe for target '/home/ikem/Downloads/cli-visualizer_1.1/cli-visualizer-1.1/build/vis.o' failed
make: *** [/home/ikem/Downloads/cli-visualizer_1.1/cli-visualizer-1.1/build/vis.o] Aborted

According to this site, gcc has trouble to detect the right architecture.

I fixed it by editing the "Makefile" and changing the lines:

CXX_FLAGS += -march=native
PERF_TEST_CXX_FLAGS += -march=native

To this lines:

CXX_FLAGS += -march=armv6
PERF_TEST_CXX_FLAGS += -march=armv6

And it compiled without an error.

Tearing/Corruption occurs with non standard tab sizes on xterm

This is probably a bug in xterm or ncurses, but I thought I would report it here, to see if anyone else can reproduce it (and let you know).

When setting the tabs sizes in your terminal to a non stanard size (eg: 4), corruption occurs.

This problem is most pronounced in xterm, but it seems to affect other terminals too. When on non standard tab sizes in urxvt, there is corruption, but it is much less (I'm getting this sort of corruption when the screen is very large in urxvt, but that's probably unrelated).

$ tabs -8 (this is good!)

2017-03-04-011335_1909x1056_scrot

$ tabs -4

2017-03-04-011400_1901x1051_scrot

$ tabs -0

2017-03-04-011430_1910x1054_scrot

xterm: XTerm(325)
ncurses: 6

Let me know if you cannot reproduce or if you want additional information!

DESTDIR is not respected

I'm building the tool in a sandbox env is getting the following message:

>>> Install cli-visualizer-1.6 into /var/tmp/portage/media-sound/cli-visualizer-1.6/image/ category media-sound
make -j4 DESTDIR=/var/tmp/portage/media-sound/cli-visualizer-1.6/image/ install 
which: no ccache in (/usr/lib/portage/python2.7/ebuild-helpers/xattr:/usr/lib/portage/python2.7/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0:/usr/x86_64-pc-linux-gnu/aarch64-unknown-linux-gnu/gcc-bin/6.3.0)
Found libpulse-simple, enabling pulseaudio support
cp /var/tmp/portage/media-sound/cli-visualizer-1.6/work/cli-visualizer-1.6/build/vis /bin/
 * ACCESS DENIED:  open_wr:      /bin/vis
cp: cannot create regular file '/bin/vis': Permission denied
make: *** [Makefile:225: install] Error 1
 * ERROR: media-sound/cli-visualizer-1.6::local-overlay failed (install phase):

Please fix installation by adding a DESTDIR variable:

install: 
  cp $(BUILD_DIR)/$(TARGET) $(DESTDIR)/$(PREFIX)

For more details, see the following doc:
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

Bars invisible (when not marked)

I have a weird issue with the bar vizualization. I cannot see it. When toggling through the the other options (ellipse and lorentz), they appear just fine. Just the bars are missing. When I "select" (click and drag the cursor across the terminal window) I can see the bars for the length of the frame.
Here two screenshots.

I am running Manjaro, installed the AUR build. TERM outputs rxvt-unicode-256color
vis gets fft-information via mpd

Lower Visualizer Tolerance

Hi, i would like the visualizer to respond more to the audio. I dont know how to explain it, or what terms to use but ( atleast with lorenze and ellipse, spectrum its ok) my audio output has to be very loud to see something "meaningfull" in the visualizer.
This is what it looks like at a acceptable volume
2017-08-03-190637_631x570_scrot
In order to see this
2017-08-03-190833_545x620_scrot
2017-08-03-190927_695x726_scrot
The volume has to be at ear-bleeding levels ( very load)
I have read the readme and the examples but I havent found anything to "lower the tolerance".
I'm on fedora 25 and pulse audio.
Anyway thanks for sharing this awesome software.

Naming conflict

While working on proper OS X support, I discovered that the vis name has apparently been claimed in BSD-land for over two decades. It hasn't caused me any trouble, but I'm honestly not sure how important the real vis is. Locally I've just changed my makefile to use TARGET=viz instead, and that doesn't seem to conflict with anything else as far as I can tell. Just thought I'd throw this out there.

Unable to set visualizer.spectrum.bar.spacing=0 after recent commits

Compiling from git with recent commits (403), cli-visualizer show this error at lauch

Invalid settings visualizer.spectrum.bar.spacing=0

and it doesn't run; with e.g. value = 1 it works fine.

previous version (at least commit 376) works fine also setting 0 as value

Regards

[MacOS] Spectrum not appearing, can't update config.

I'm not sure what is going on. I setup everything like intended but for some reason the spectrum isn't appearing, the second visualizer works perfectly and the third one appears but it looks glitchy.
I've changed things about my config but it doesn't seem to have an effect on the visualizer. I've changed the characters for all the visualizers from "#" but they still keep using "#". Tapping R doesn't seem to do anything either. I'm using iTerm and although there isn't anything appearing for the spectrum there is a CPU usage bump when I switch to it with space.

MPD config

music_directory "/Music/iTunes/iTunes Media/Music"
playlist_directory "
/.mpd/playlists"
db_file "/.mpd/mpd.db"
log_file "
/.mpd/mpd.log"
pid_file "/.mpd/mpd.pid"
state_file "
/.mpd/mpdstate"
auto_update "yes"

audio_output {
type "ao"
name "My Mac Device"
mixer_type "software"
options "buffer_time=400"
}

audio_output {
type "fifo"
name "my_fifo"
path "/tmp/mpd.fifo"
format "44100:16:2"
}

bind_to_address "127.0.0.1"
port "6600"

Vis config

##Refresh rate of the visualizers. A really high refresh rate may cause screen tearing. Default is 20.
#visualizer.fps=20

##Sets the audio sources to use. Currently available ones are "mpd" and "alsa"Sets the audio sources to use.
##Currently available ones are "mpd", "pulse" and "alsa". Defaults to "mpd".
#audio.sources=mpd

##vis tries to find the correct pulseaudio sink, however this will not work on all systems.
##If pulse audio is not working with vis try switching the audio source. A list can be found by running the
##command pacmd list-sinks | grep -e 'name:' -e 'index'
#audio.pulse.source=0

##Defaults to "/tmp/mpd.fifo"
#mpd.fifo.path=/tmp/mpd.fifo

##If set to false the visualizers will use mono mode instead of stereo. Some visualizers will
##behave differently when mono is enabled. For example, spectrum show two sets of bars.
#audio.stereo.enabled=false

##Specifies how often the visualizer will change in seconds. 0 means do not rotate. Default is 0.
#visualizer.rotation.secs=10

##Configures the samples rate and the cutoff frequencies.
#audio.sampling.frequency=44100
#audio.low.cutoff.frequency=22050
#audio.high.cutoff.frequency=30

##Configures the visualizers and the order they are in. Available visualizers are spectrum,lorenz,ellipse.
##Defaults to spectrum,ellipse,lorenz
#visualizers=spectrum,ellipse,lorenz

##Configures what character the spectrum visualizer will use. Specifying a space (e.g " ") means the
##background will be colored instead of the character. Defaults to " ".
#visualizer.spectrum.character=#

##Spectrum bar width. Defaults to 2.
#visualizer.spectrum.bar.width=2

##The amount of space between each bar in the spectrum visualizer. Defaults to 1. It's possible to set this to
##zero to have no space between bars
#visualizer.spectrum.bar.spacing=1

##Available smoothing options are monstercat, sgs, none.
#visualizer.spectrum.smoothing.mode=monstercat

##This configures the falloff effect on the spectrum visualizer. Available falloff options are fill,top,none.
##Defaults to "fill"
#visualizer.spectrum.falloff.mode=fill

##Configures how fast the falloff character falls. This is an exponential falloff so values usually look
##best 0.9+ and small changes in this value can have a large effect. Defaults to 0.95
#visualizer.spectrum.falloff.weight=0.95

##Margins in percent of total screen for spectrum visualizer. All margins default to 0
#visualizer.spectrum.top.margin=0.30
#visualizer.spectrum.bottom.margin=0.10
#visualizer.spectrum.right.margin=0.10
#visualizer.spectrum.left.margin=0.10

##Reverses the direction of the spectrum so that high freqs are first and low freqs last. Defaults to false.
#visualizer.spectrum.reversed=false

##This configures the sgs smoothing effect on the spectrum visualizer. More points spreads out the smoothing
##effect and increasing passes runs the smoother multiple times on reach run. Defaults are points=3 and passes=1
#visualizer.sgs.smoothing.points=3
#visualizer.sgs.smoothing.passes=1

##Configures what character the ellipse visualizer will use. Specifying a space (e.g " ") means the
##background will be colored instead of the character. Defaults to "█".
#visualizer.ellipse.character=#

##The radius of each color ring in the ellipse visualizer. Defaults to 2.
#visualizer.ellipse.radius=2

##Configures what character the lorenz visualizer will use. Specifying a space (e.g " ") means the
##background will be colored instead of the character. Defaults to "█".
#visualizer.lorenz.character=#

##Specifies the color scheme. The color scheme must be in ~/.config/vis/colors/ directory. The default scheme is "colors".
#colors.scheme=rainbow

Visualizer is all black (no colors)

First off, thank ypu for putting this project together. The screenshots look incredible and I'm excited to get it working as I've always wished that ncmpcpp's visualizer was more colorful.

I cloned this repo, compiled, and installed the program, but when running vis the visualizer is all black bars as shown here:
2015-12-27-173525_6720x1080_scrot

My config files is the default with the colors option set to rainbow. Note that the off-black background color is coming from my XTerm settings. If I remove the .Xresources file, the background correctly reverts back to white.

Interestingly enough, when I comment out the colors option in the config file, the bars don't seem to max out, but are still black. Here's another screenshot showing this:
2015-12-27-173556_6720x1080_scrot

For what it's worth, the ncmpcpp visualizer works as intended with the correct color.

System info:

  • Arch
  • i3 WM
  • XTerm

Any ideas why this may be happening? It could very well be something specific to my terminal environment. Any debugging steps I can take to determine the problem?

Support for floating sample format in mpd fifo audio source

Piping floating point samples through a fifo and having cli-visualizer visualize it results in a very choppy and inaccurate visualization. The same file converted to signed 16-bit little endian samples works just fine.

EDIT: I can confirm the issue by piping floating point audio output through sox and converting it to s16le, which results in normal visualization.

Relevant part of my .asoundrc for reference:

pcm.!default {
	type file

	slave.pcm "plug:plugequal"
	file "| sox -t raw -b 32 -e float -r 44100 - -b 16 -e signed -c 2 -r 44100 -t raw - | safe_fifo /tmp/alsa.fifo"
	format raw
	perm 0666
}

This is, of course, insanely slow and not ideal because you'd have to change the sox line all the time.

EDIT2:
Actually, yes, you can detect what sample format you're getting according to this.

.asoundrc is now:

pcm.!default {
	type file

	slave.pcm "plug:plugequal"
	file "| /home/[user]/alsafifo.sh %r %c %b %f | safe_fifo /tmp/alsa.fifo"
	format raw
	perm 0666
}

alsafifo.sh:

#!/bin/sh

echo "r= $1" 1>&2
echo "c= $2" 1>&2
echo "b= $3" 1>&2
echo "f= $4" 1>&2

case $4 in
FLOAT_LE)
	sox -t raw -b $3 -e float -c $2 -r $1 - -b 16 -e signed -c 2 -r 44100 -t raw - <&0
	;;
S16_LE)
	cat <&0
	;;
default)
	# There's a lot more, but this is just an example
	exit 1
	;;
esac

Not sure how you'd detect what kind of input your getting in cli-visualizer though. It wouldn't be a nice solution...

Visualizer Lag/Delay

Hi, thanks for the awesome visualizer. It's simple to use and one of the prettiest I've seen so far.

However, I couldn't help but notice an odd little delay between the notes actually playing in my ears and the movement/spikes of the visualizer (e.g. bass drum would come in for the first time but the visualizer would take a split second to actually react).

I'd really appreciate any thoughts on this! ^_^

Visualizer fails to work if started at 30fps in mono mode.

For some reason, setting the fps to 30(only value I tested) and setting mono mode to false:

visualizer.fps = 30
audio.stereo.enabled = false

makes the visualizer fail to work on startup.

I can use it at 30fps if I start it at another value(or at 30fps in stereo mode), change the configuration file, then reload with r, however.

illegal hardware instruction thrown

I'm getting an illegal hardware instruction when executing vis with or without a config file.

If you can let me know what you'd need for debugging purposes, I'd appreciate it. ;)

Thank you!

Cannot compile on FreeBSD 11 with clang or gcc

I've tried using clang38, clang39, g++49, and g++6. Each different one gets an error, though not all the same one.

With g++6 I get an error in NcursesWriter.cpp:54:41 about mvaddwstr
With g++49, I get Utils.h:156:20: error: 'stod' is not a member of 'std' return std::stod(wstring_to_string(iter->second));
With clang++38 and clang++39 I get src/Visualizer.cpp:139:28: error: cannot initialize a parameter of type 'int64_t *' (aka 'long *') with an rvalue of type 'long long *' &last_rotation_timestamp);

Have you encountered any of these?

Install fails on OSX

When I run ./install.sh on OSX (after installing the deps) I get this error

mkdir -p /Users/Damien/Desktop/Stuff/cli-visualizer/build
rm -f /Users/Damien/Desktop/Stuff/cli-visualizer/build/vis
c++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -dynamic -D_OS_OSX -D_XOPEN_SOURCE_EXTENDED -D_ENABLE_PULSE  -fno-omit-frame-pointer -D_XOPEN_SOURCE_EXTENDED -D_ENABLE_PULSE -I/usr/local/include -I/Users/Damien/Desktop/Stuff/cli-visualizer/include -I/Users/Damien/Desktop/Stuff/cli-visualizer/src -c src/Source/MpdAudioSource.cpp -o /Users/Damien/Desktop/Stuff/cli-visualizer/build/MpdAudioSource.o
src/Source/MpdAudioSource.cpp:80:36: error: no member named 'read' in the global namespace
            int64_t bytes_read = ::read(m_mpd_fifo_fd, buffer, bytes_left);
                                 ~~^
src/Source/MpdAudioSource.cpp:109:27: error: no type named 'close' in the global namespace
                        ::close(m_mpd_fifo_fd);
                        ~~^
src/Source/MpdAudioSource.cpp:141:11: error: no type named 'close' in the global namespace
        ::close(m_mpd_fifo_fd);
        ~~^
3 errors generated.
make: *** [/Users/Damien/Desktop/Stuff/cli-visualizer/build/MpdAudioSource.o] Error 1

What am I missing?

(OS X) Visualizing Stereo Output (from all applications)

Related: #41

Is it possible to visualize sound output (e.g. Spotify, Youtube running on Chrome, games, etc) on OS X? Currently stuck with the blank screen because I literally have no music on my laptop (mpd only plays local music and I stream all music).

Thanks :)

Spectrum inverted?

I recently upgraded my hardware which involved recompiling my kernel. After I got my system up and running again vis was no longer working so I recompiled it from source and now it does weird things. The other two visuallizers work but I only ever used spectrum. Spectrum for some reason is like inverted. I say like because I'm not sure what to call it. When I launch vis it basically just clears my terminal. If I then drag my mouse to highlight the visualizer that's when I can see it but the second I stop highlighting it disappears. I've played around with the config but haven't been able to figure it out and the log doesn't say anything.

vis clears the screen when exiting

Demonstration: https://asciinema.org/a/oC6jCraGE32OBSfzb1rgG7EOa

tl;dw: ncmpcpp (and less, and mutt, and vim) don't clear the whole screen when they exit – they remove their content from the terminal, but nothing more, as if they exited with no output. vis clears the entire screen (like pressing ^L), which is disconcerting when you're expecting your previous commands to still be visible. It would be nice if vis behaved like other applications and didn't remove output that it didn't create.

Build fails with Pulse-Audio on Ubuntu 16.04

so, I've been trying to build with Pulse audio support. Now, I haven't compiled C in a while, so I'm not entirely certain how I need to use make ENABLE_PULSE=1. my first thought was to add it to the makefile (as in replace make with make ENABLE_PULSE=1), but it fails like so:

drake@NeonBlack:~/github/cli-visualizer-master$ sudo ./install.sh 
mkdir -p /home/drake/github/cli-visualizer-master/build
rm -f /home/drake/github/cli-visualizer-master/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 -DNCURSESW  -fno-omit-frame-pointer -D_ENABLE_PULSE -DNCURSESW -I/usr/local/include -I/home/drake/github/cli-visualizer-master/include -I/home/drake/github/cli-visualizer-master/src -c src/vis.cpp -o /home/drake/github/cli-visualizer-master/build/vis.o
src/vis.cpp: In function ‘int main(int, char**)’:
src/vis.cpp:96:32: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
     system("setterm -blank 10");
                                ^
src/vis.cpp:97:20: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
     system("clear");
                    ^
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -D_ENABLE_PULSE -DNCURSESW  -fno-omit-frame-pointer -D_ENABLE_PULSE -DNCURSESW -I/usr/local/include -I/home/drake/github/cli-visualizer-master/include -I/home/drake/github/cli-visualizer-master/src -c src/Visualizer.cpp -o /home/drake/github/cli-visualizer-master/build/Visualizer.o
In file included from src/Visualizer.cpp:10:0:
src/Source/PulseAudioSource.h:14:30: fatal error: pulse/pulseaudio.h: No such file or directory
compilation terminated.
Makefile:214: recipe for target '/home/drake/github/cli-visualizer-master/build/Visualizer.o' failed
make: *** [/home/drake/github/cli-visualizer-master/build/Visualizer.o] Error 1
cp /home/drake/github/cli-visualizer-master/build/vis /bin/
cp: cannot stat '/home/drake/github/cli-visualizer-master/build/vis': No such file or directory
Makefile:206: recipe for target 'install' failed
make: *** [install] Error 1

I've tried on its own, and if fails like below:

drake@NeonBlack:~/github/cli-visualizer-master$ sudo make ENABLE_PULSE=1
mkdir -p /home/drake/github/cli-visualizer-master/build
rm -f /home/drake/github/cli-visualizer-master/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 -DNCURSESW  -I/usr/local/include -I/home/drake/github/cli-visualizer-master/include -I/home/drake/github/cli-visualizer-master/src -L/usr/local/lib -o /home/drake/github/cli-visualizer-master/build/vis /home/drake/github/cli-visualizer-master/build/vis.o /home/drake/github/cli-visualizer-master/build/Visualizer.o /home/drake/github/cli-visualizer-master/build/NcursesWriter.o /home/drake/github/cli-visualizer-master/build/VisException.o /home/drake/github/cli-visualizer-master/build/ColorDefinition.o /home/drake/github/cli-visualizer-master/build/Settings.o /home/drake/github/cli-visualizer-master/build/SpectrumCircleTransformer.o /home/drake/github/cli-visualizer-master/build/LorenzTransformer.o /home/drake/github/cli-visualizer-master/build/EllipseTransformer.o /home/drake/github/cli-visualizer-master/build/SpectrumTransformer.o /home/drake/github/cli-visualizer-master/build/GenericTransformer.o /home/drake/github/cli-visualizer-master/build/NcursesUtils.o /home/drake/github/cli-visualizer-master/build/Utils.o /home/drake/github/cli-visualizer-master/build/ConfigurationUtils.o /home/drake/github/cli-visualizer-master/build/Logger.o /home/drake/github/cli-visualizer-master/build/MpdAudioSource.o /home/drake/github/cli-visualizer-master/build/PulseAudioSource.o /home/drake/github/cli-visualizer-master/build/AudioSource.o /home/drake/github/cli-visualizer-master/build/MacOsXAudioSource.o -lfftw3 -lm -lstdc++ -lpulse -lpulse-simple -lncursesw
/usr/bin/ld: cannot find -lpulse
/usr/bin/ld: cannot find -lpulse-simple
collect2: error: ld returned 1 exit status
Makefile:217: recipe for target 'vis' failed
make: *** [vis] Error 1

is there something I'm doing wrong here? it builds fine when i don't try with Pulse audio support.

Non-functional in tmux and/or st

Running vis in st or in any of several terminals under tmux results in a blank screen with nothing being painted.

There are no errors to report as far as I can tell, simply no function. Note, this was tested using the pulse backend, but since the same configuration was functional under other terminals, I assume this is immaterial.

Nothing happens on OS X

brew install fftw
Warning: fftw-3.3.4_1 already installed
brew tap homebrew/dupes
brew install ncurses
Warning: homebrew/dupes/ncurses-6.0_1 already installed

Seemed to install fine after cloning the repo and entering "./install.sh" and the config file is in the right place. I have mpd+ncmpcpp working fine, and my mpd.conf contains the fifo output lines.

Any idea?

Instruction for Fedora 25/26

Hi again, I think that the documentation can be improved. Unfortunately the names of the dependencies on fedora has a completely different name. Last week I spent like an hours looking for the dependencies. If you could add these to the readme it would be awesome
sudo dnf install fftw-devel fftw-doc <---- (I'm not sure if the docs are needed)
sudo dnf install ncurses-devel
sudo dnf install pulseaudio-libs-devel.
I have only tested this on fedora 25 and 26.
PD. The scaling multiplier is working great.

Keybinding to toggle stereo on/off

First off, thanks for this awesome software!

I have the following feature request to add a keybinding to toggle between stereo enabled and disabled. Perhaps s.

With limited vertical space, stereo not enabled looks nicer than enabled.

limited space, stereo enabled
screen shot 2017-01-22 at 2 09 26 pm

limited space, stereo disabled
screen shot 2017-01-22 at 2 09 03 pm

ample space, stereo enabled
screen shot 2017-01-22 at 2 09 33 pm

I'd like to be able to quickly switch between these as I may be using the visualization either as a split pane in tmux alongside ncmpcpp or standalone in its own window. My current solution is to edit the config and reload in only one of my running vis instances.

Error:

When installing i get this error:

andromeda@AndyPC:~/cli-visualizer-master$ ./install.sh
mkdir -p /home/andromeda/cli-visualizer-master/build
rm -f /home/andromeda/cli-visualizer-master/build/vis
g++ -std=c++14 -O3 -march=native -ffast-math -fno-omit-frame-pointer -D__extern_always_inline=inline -D_LINUX -DNCURSESW  -fno-omit-frame-pointer -DNCURSESW -I/usr/local/include -I/home/andromeda/cli-visualizer-master/include -I/home/andromeda/cli-visualizer-master/src -c src/vis.cpp -o /home/andromeda/cli-visualizer-master/build/vis.o
make: g++: Command not found
make: *** [/home/andromeda/cli-visualizer-master/build/vis.o] Error 127
cp /home/andromeda/cli-visualizer-master/build/vis /bin/
cp: cannot stat ‘/home/andromeda/cli-visualizer-master/build/vis’: No such file or directory
make: *** [install] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.