Skip to content

radavis/bytebeat

Repository files navigation

Bytebeat

Create interesting sounds by shifting bits around.

For example, here is a simple C program that creates a repeating audio pattern when piped to /dev/audio:

#include <stdio.h>

int main() {
  int i = 0;

  while(1) {
    i++;
    putchar(i&i>>8);
  }
}

OSX Instructions

First, brew install sox in order to have a way to pipe data to the sound system.

Next, compile one of the .c files: gcc -o 42_melody 42_melody.c.

Pipe the output of the program to sox: ./42_melody | sox -traw -r8000 -b8 -e unsigned-integer - -tcoreaudio. Or, use the handy bash script: ./play squares.

CTRL+C to stop the music.

Experiment!

References

Notes

Most of these programs are from @viznut's videos. All credit goes to him and the original authors.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published