Git Product home page Git Product logo

acoustic-walk's Introduction

Acoustic Walk

Context

This is hastily made software targeted toward an art opening in Athens, Georgia, and to be used under carefully controlled circumstances.

Usage

To play shuffled audio, specify a directory where a recursive file-tree walk will find stereo 16-bit WAV files, as in the example below.

cargo run play ~/samples-ecashin-orig/Zoom-H5

The application is designed to run until stopped with control-c.

Unsupported WAV files will result in undefined behavior. Only uncompressed 16-bit stereo WAV files are supported.

WAV Exclusion

Multiple WAVs may be listed by absolute path in an exclude file specified via an option. Use -- to separate acoustic-walk arguments from cargo arguments.

cargo run -- play --exclude excluded.txt \
    ~/samples-ecashin-orig/Zoom-H5

Grain Length

Short grains smear tiny sounds together for an acoustic blur, while long (e.g. 3000 ms) grains allow, e.g., a whole bird call to appear in the stream.

The default is one second, 1000 ms.

cargo run -- play --exclude excluded.txt \
    --grain-ms 3000 \
    ~/samples-ecashin-orig/Zoom-H5

Music Non-stop

This application is designed to run indefinitely and lacks fully fledged shut-down mechanics by design.

It can be manually stopped by control-c or by kill.

JACK Support

The play subcommand offers a --use-jack option that causes acoustic-walk to use JACK for audio.

By default it uses cpal, the cross-platform audio library.

The applications sends stereo audio to the JACK audio system. There's a lot of file opening and closing, and data copying going on right now. To avoid audible buzzes from audio underruns, I am configuring JACK to use a relatively low sample rate of 44100, and a relatively large buffer size of 2048.

The sample rate of 44100 allows acoustic-walk to skip the use of samplerate::convert when the WAV files also have a 44100 sample rate. The opportunity was exposed by using flamegraph and opening the resulting SVG file in a web browser.

cargo install flamegraph
flamegraph target/debug/acoustic-walk play ~/samples-ecashin-orig/Zoom-H5

Example Scripts

Scripts that work for me could serve as useful examples for you to build upon.

sh acouwalk.sh

The above command runs acoustic-walk in both "play" and "ring buffer" modes. It creates some files in the current working directory. To see output from the player, I trigger the ringbuf's output by creating a file named acourun.show.

I can kill the acoustic-walk processes as shown below or via sh acouwalk.sh stop.

for i in *.pid; do kill `cat "$i"`; done

acoustic-walk's People

Contributors

ecashin avatar

Watchers

 avatar

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.