Skip to content
/ cog Public

Rust code demonstrating the use of rusty-jack for interop with the Jack Audio Connection Kit lib

Notifications You must be signed in to change notification settings

psantacl/cog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cog

Cog is an rust program which uses the Jack Audio Connection Kit to play sound. It relies on the crate rusty-jack(https://github.com/psantacl/rusty-jack) for its interop with Jack.

Building

  1. Install the Jack Audio Connection Kit server
  2. Clone the rusty-jack create and build with make
  3. Copy the crate's build artifact (librusty_jackdylib) into the cog's libs directory
  4. make && ./bin/cog

Fun

Cog will connect to a runner Jack server. You can use the JackPilot which comes with the Jack to connect the Cog application to whatever output you wish: Speakers, Logic Audio etc.

Cog also creates a named fifo under /tmp/cog-in. Any data you pipe through that fifo will be interpretted as audio data and played: cat snd-files/the-sound-of-silence-f32.wav > /tmp/cog-in Note, there is nothing stopping you from sending non-audio data into this pipe as well: dd if=/dev/urandom of=/tmp/cog-in bs=44100 count=100

Playback Algorithms

Cog can optionally manipulate the data it receives prior to sending it to Jack. Descriptions of some of the algorithm are below:

  • Clean: Interpret all data as 32 bit floats. Any samples outside of the audio range(-1.0 ... 1.0) will be brought into the aforemention range.
  • Bit Reduce: Interpret all data as 32 bit floats and then bit reduce them by XOR the mantissa. The result is distortion.
  • Stutter: Emulate CD skipping by probabilistically stuttering the output.

About

Rust code demonstrating the use of rusty-jack for interop with the Jack Audio Connection Kit lib

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages