Bytebeat is the name of type of music made from math.
You provide a function who's only input is time t and from that write some code to generate a sound.
In this particular case t is an 8000hz timer that counts up. For example
sin(t) * 127 + 127
You can choose traditional bytebeat where the output of your function is expected to be 0 to 255 or you can choose floatbeat where the output is expected to be -1 to +1.
Here are a few sample songs
There 2 modes
- bytebeat: Your expression is expected to generate byte values from 0 to 255
- floatbeat: Your expression is expected to generate float values from -1.0 to 1.0
- Infix: Standard expressions eg. "(t * 2) / 4"
- Postfix(rpn): Reverse Polish Notation eg "t 2 * 4 /"
is the same as
Postfix requires that each element have at least one space between it.
t2* // BAD! t 2 * // Good!
Comments can be both // or /* */ style
There are several extra inputs available
The mouse position is available as mouseX and mouseY
sin(t * mouseX * 0.001) + cos(t * mouseY * 0.003)
The size of the window is available width and height
The orientation of a device may be available as tiltX and tiltY.
(sin(t * 0.1 * tiltX) + cos(t * tiltY * 0.07)) * 0.5
Also note, using the comma operator you can write fairly arbitrary code.
For more info
Check out http://canonical.org/~kragen/bytebeat/ and be sure follow the many links.