Giter VIP home page Giter VIP logo

earwig's Introduction

earwig

A modular command line digital signal processor built in rust. Ever wanted to pipe raw audio samples around in the terminal to impress your friends at a party? Well then, you've come to the right place. earwig is a collection of CLI audio processors which harness the power of stdin and stdout to send samples down the signal chain.

For example: ./in sample.wav | ./choppy | ./out

Why

Mainly because once I had the idea, I couldn't unthink it... Also I wanted to become more familiar with digital signal processing, especially in rust. And actually I think it might be a really fun music making tool.

Try it

  1. cargo build --release

  2. ./target/release/in | ./target/release/choppy | ./target/release/out

Modules

Input

  • listen Listens on a default input device and pipes every sample represented as an amplitude between -1 and 1 to stdout.
  • play [path/to/file.wav] [loop] Reads an audio file from disk and pipes every sample represented as an amplitude between -1 and 1 to stdout. Passing loop argument means the file will be repeated indefinitely.
  • silly [OPTIONS] [F] [WAVE] Oscillator... Silly... Get it?

Output

  • out Audio output module. Slurps up samples from stdin and streams them as audible audio to the nearest output device.
  • imaginary [--width] [--height] [path] PNG output module. Slurps up samples from stdin and creates a png in which several amplitudes are represented by their maximum to fit the given width in pixel.

Transformation

  • choppy [chunk_size_ms] [max_buffer_len_secs] Chop up some audio semi-randomly. Fills a fixed length buffer with samples recieved from stdin then continually chops it up in a semi-random way, pipes chopped audio samples to stdout. All args optional.
  • clippy [threshold] [alignment] [alignment] It looks like you are trying to clip samples to an absolute value below the threshold amplitude. Unless clippy is chaotic, in which case it does the opposite. Oh, and if clippy is evil, it eats samples rather than fixing them.
  • extremely [t] Linearly interpolate each sample toward +/-1, t between zero and one determines how much to prioritize the extreme value.
  • hungry [threshold] Eats up any sample below the threshold amplitude.
  • randomly [t] Linearly interpolate each sample toward random values, t between zero and one determines how much to prioritize the random value.
  • reversi [ms] Reverses the order of samples within the passed time period.
  • smashy Can't quite explain what this does, it sounds like extreme compression being applied in an unpredictable manner. Takes stdin sends via sdout.
  • smoothy [n] Average each sample with the last n samples.
  • smiley [manic|cynic] Constrains samples to stay positive. Results in very mild distortion.
  • speedy [x] Changes the speed by factor x. For example, speedy 0.5 halves the speed.
  • wobbly [x] Modulates speed against a control signal, which makes everything sound.... wobbly.... wobbly 0.5 generates an LFO at frequency 0.5 and modulates the passed samples accordingly.

Contribute

Yes please!! When doing so, bare in mind:

  • one module per file in src/
  • add a [[bin]] entry to Cargo.toml for your new module
  • add a line to https://github.com/sandreae/earwig#modules describing the module a little
  • modules should be fun.. This includes: pointless, "really??", plain noisy, "is it working?" and funky
  • lots of code comments please
  • keep on the simple side of the tracks where possible, fewer dependencies and transparent logic is prefered

earwig's People

Contributors

aljoschameyer avatar meike-h avatar sandreae avatar

Stargazers

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

Watchers

 avatar  avatar

earwig's Issues

Re-write `in` module

I'd like to:

  • remove the dependency on web-audio-api
  • be able to decode any file into a sample stream
  • maybe rename it to ear ;-p

"Recipes"

Have a "Recipes" section in README where we collect module combinations / args which sound cooooooooooooooooool.

Readme Format With Clap

Do you want to keep the short and informal list of modules, or should we switch to listing modules together with their module --help output after switching everything to using clap?

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.