From a1abb8f290685aafe1195fbada96f2ae976651b8 Mon Sep 17 00:00:00 2001 From: alemidev Date: Sat, 24 Dec 2022 03:25:47 +0100 Subject: [PATCH] docs: added readme, changed wording of opt --- README.md | 37 +++++++++++++++++++++++++++++++++++++ src/main.rs | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..03ea30f --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# scope-tui +A simple oscilloscope/vectorscope in your terminal + +![scope-tui interface](https://cdn.alemi.dev/scope-tui.png) + +Currently only for Linux (with Pulseaudio) + +## Why +I really love [cava](https://github.com/karlstav/cava). It provides a crude but pleasant frequency plot for your music: just the bare minimum to see leads solos and basslines. +I wanted to also be able to see waveforms, but to my knowledge nothing is available. There is some soundcard oscilloscope software available, but the graphical GUI is usually dated and breaks the magic. +I thus decided to solve this very critical issue with my own hands! And over a night of tinkering with pulseaudio (via [libpulse-simple-binding](https://crates.io/crates/libpulse-simple-binding)) and some TUI graphics (via [tui-rs](https://github.com/fdehau/tui-rs)), +the first version of `scope-tui` was developed, with very minimal settings given from command line, but a bonus vectorscope mode baked in. + +# Usage +``` +$ scope-tui [OPTIONS] + +Arguments: + Size of audio buffer, and width of scope + +Options: + -d, --device Audio device to attach to + -s, --scale Max value on Amplitude scale [default: 20000] + --no-reference Don't draw reference line + --no-braille Don't use braille dots for drawing lines + --scatter Use vintage looking scatter mode + --vectorscope Combine left and right channels into vectorscope view + -h, --help Print help information + -V, --version Print version information +``` + +The audio buffer size directly impacts resource usage, latency and refresh rate and its limits are given by the audio refresh rate. Larger buffers are slower but less resource intensive. A good starting value might be `8192` + +## Controls +* Use `q` or `CTRL+C` to exit. Not all keypresses are caught, so keep trying... (wip!) +* Use `` to pause and resume display +* Decrease/increase terminal font size to increase/decrease scope resolution. diff --git a/src/main.rs b/src/main.rs index 9b31f2b..426a4ba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ use clap::Parser; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] struct Args { - /// Sample size of buffer, and width of scope + /// Size of audio buffer, and width of scope width: u32, /// Audio device to attach to