ByteBeat Shell Script

April 28, 2013 in Tutorials

Recently I have been playing around with ByteBeat. You can play around with these in your browser here if you are interested. SuperCollider can also do this as of version 3.5 (although I’ve noticed some differences in the output) if you want more control. I however felt like being able to play with these in a more brute force way: directly from terminal.

Since the workflow for messing with these is always the same I decided to make a little shell script to speed up the process. I’m on a Mac so I have to use sox for playback. If you are on Linux you’d need to change the pipe to /dev/audio or /dev/dsp unless you wanted to use sox instead.


#!/bin/bash

# This script creates and plays a simple ByteBeat
# ARGS
# $1: a string with the ByteBeat algorithm e.g. "((t * 3) & (t >> 5))"
# $2: the name of the file to be creates (without an extension)
###
# make the c file
echo "main(t) {
for( t = 0;;t++)
putchar( $1 );
}" > "$2.c"
###
# compile the source
gcc "$2.c" -o "$2"
###
# play it with standard ByteBeat settings
./"$2" | sox -traw -r8000 -b8 -u - -tcoreaudio

Save that to a file called something like bytebeat.sh and make it executable with chmod 755. after that you can just run

./bytebeat.sh "((t * 3) & (t >> 5))" test

and automagically you get 8-bit goodness right from your terminal. There’s a slight delay between running the script and hearing the output because it needs to compile so I wouldn’t necessarily perform with this (unless you get really good a timing it). Now this could be modified to let you specify the arguments for sox or whatever… but meh. This is just intended as a quick and dirty way to look like you are more of a hacker than you really are.

Post to Twitter Post to Facebook Post to Google Buzz Send Gmail

Homunculus

April 25, 2013 in Electronic, Music

Homunculus is a live performance network piece. Performers manipulate various objects which create their sound by reading from and writing to various buffers, creating and altering new feedback chains. The location of the object on the screen also alters various control parameters with influence each sound as well. Performed on February 27, 2013 at the University of Colorado Pendulum New Music concert series in the ATLAS Black Box Theater by the Glitch Lich network laptop quartet.

Homunculus from Cole Ingraham on Vimeo.

Post to Twitter Post to Facebook Post to Google Buzz Send Gmail

OSX Bash music…

April 9, 2013 in Electronic, Music

So this is a little something that I though of years ago based on a quote from The Simpsons. If you are on OSX and know what you are looking at you know what to do (and I’m sorry).


#!/bin/bash
for i in {1..13}
do
say "a night with Phillip Glass followed by"
done
for i in {1..11}
do
say "a night with Phillip Glass followed by"
say "a night with Phillip followed by"
done
for i in {1..8}
do
say "a night with Phillip Glass followed by"
say "a night with Phillip followed by"
say "a night with followed by"
done
for i in {1..5}
do
say "a night with Phillip Glass followed by"
say "a night with Phillip followed by"
say "a night with followed by"
say "a night followed by"
done
for i in {1..3}
do
say "a night with Phillip Glass followed by"
say "a night with Phillip followed by"
say "a night with followed by"
say "a night followed by"
say "a followed by"
done
for i in {1..2}
do
say "a night with Phillip Glass followed by"
say "a night with Phillip followed by"
say "a night with followed by"
say "a night followed by"
say "a followed by"
say "followed by"
done
say "a night with Phillip Glass followed by"
say "a night with Phillip followed by"
say "a night with followed by"
say "a night followed by"
say "a followed by"
say "followed by"
say "by"

Post to Twitter Post to Facebook Post to Google Buzz Send Gmail

Canvas

February 15, 2013 in Electronic, Music, Video, Visual

An hour long audio/visual work created and performed by Cole Ingraham. The original video is 4 screen 1080p and this version maintains the same aspect ratio which is why this version is so narrow. Video created using Processing. Music is a combination of SuperCollider, Moog Guitar, and Roland VG-99. Premiered on 2/15/2013 at the University of Colorado ATLAS black box theater. This version features the Orava String Quartet performing Aether at 7’43″ whereas the live performance is played with SuperCollider and iPad using my custom OSC interface Un:Limit.

Canvas from Cole Ingraham on Vimeo.

Post to Twitter Post to Facebook Post to Google Buzz Send Gmail

“Chromatic” Just Intonation – fast version

January 26, 2013 in Music, Tutorials

About a month ago I talked here about the math required to take a set of ratios and generate a set of +/- 50 cent alterations for tuning a chromatic scale to any 12-tone just tuning. There were quite a number of steps and a lot of math as I wanted to show how to do it in a way that could be applied to any programming language (or done by hand if you are feeling masochistic). Now I’m going to show a shortcut if you are specifically using SuperCollider.

SuperCollider has a method called ratiomidi that takes a ratio and converts it to the float MIDI number version. This replaces the need to multiply the ratios by a fundamental and mod 12 it as, because all our ratios are within an octave, everything will be from 0.0 through 11.99. In other words: it gives us tuned versions of pitch classes. This one simple method removes 2 of the previous steps.

[1,17/16,9/8,6/5,5/4,4/3,10/7,3/2,8/5,12/7,7/4,15/8].ratiomidi;

gives us

[ 0, 1.0495540950041, 2.0391000173077, 3.1564128700055, 3.8631371386483, 4.9804499913461, 6.1748780739571, 7.0195500086539, 8.1368628613517, 9.3312909439626, 9.6882590646912, 10.882687147302 ]

Now that we have that, like before we need to get the cents in the +/- 50 cents, here in decimals. Once again we just need to subtract a series of integers from 0 to 11 like so:

( [1,17/16,9/8,6/5,5/4,4/3,10/7,3/2,8/5,12/7,7/4,15/8].ratiomidi – (0..11) ).round(0.01);

which gives us

[ 0, 0.05, 0.04, 0.16, -0.14, -0.02, 0.17, 0.02, 0.14, 0.33, -0.31, -0.12 ]

Great, that was easy! Now, you may notice by comparing it to the result we got from the other post that although the numbers are all the same, they aren’t in the same order. That is because before we based the tuning on A being the fundamental/tonic. Here C (array slot or pitch class 0) is the tonic. This is fine if you want C to be the tonic but what if you don’t? Simple! Arrays in SuperCollider also provide a method called rotate(numPlaces) which, as you might guess, shifts items left or right by a number of slots. So for our final version of this:

( [1,17/16,9/8,6/5,5/4,4/3,10/7,3/2,8/5,12/7,7/4,15/8].ratiomidi – (0..11) ).round(0.01).rotate(9);

gives us

[ 0.16, -0.14, -0.02, 0.17, 0.02, 0.14, 0.33, -0.31, -0.12, 0, 0.05, 0.04 ]

which is exactly what we got in the old example. Why are we using 9? If you prefer to think about this as a transposition operation then T9 = A. You could also put a -3 in there and you would get the exact same result. Totally depends on how you want to think about it.

Post to Twitter Post to Facebook Post to Google Buzz Send Gmail