Just kidding, that’s just my friend, but I promise it’ll get me one soon.
My favorite kind of thing to make is a useless one, so this assignment was right up my alley.
auto_rizz.ck is a program that (in conjunction with auto_rizz_relay.ck, FaceOSC, and Wekinator) can make your sexy face just that much sexier.
I was inspired by a bunch of memes I’ve seen recently of people playing this song and making that face simultaneously to make a move on a girl. I thought, why not take out all the unnecessary steps like having to press play and simply have the camera detect when you’re making the face and play it for you?
I think its easy to adopt this toxic capitalistic mindset that everything you do or make has to be productive or “for” something. But when we follow that dogma, we forget to make beautiful thinks just because they’re beautiful, do funny things just because they’re funny, or make stupid projects just because they’re stupid. There’s so much beauty in doing things just because. It was nice to take a pause on life and make something just for the sake of making it (and for a grade, but that’s more of an afterthought).
So, here is my first project with Wekinator. It’s given my friends and me so many laughs, so I think it ended up being more valuable than I anticipated.
Here is the code:
1// our OSC receiver (from FaceOSC) 2OscIn oin; 3// incoming port (from FaceOSC) 412000 => oin.port; 5// our OSC message shuttle 6OscMsg msg; 7// listen for all message 8oin.addAddress( "/wek/outputs, f" ); 9cherr <= "listening for messages on port " <= oin.port() 10 <= "..." <= IO.newline(); 11 12SndBuf rizz => dac; 13"rizz.wav" => string filename; 14filename => rizz.read; 15rizz.samples() => rizz.pos; 16 170 => int CURRENTLY_PLAYING; 185 => int NUM_AVG; 190 => int curr_i; 20 21float inputs[NUM_AVG]; 22for (0 => int i; i < NUM_AVG; i++) {0 => inputs[i];} 23// spork the listener 24spork ~ incoming(); 25 26// main shred loop 27while( true ) 28{ 29 1::second => now; 30} 31 32fun void incoming() 33{ 34 while( true ) 35 { 36 oin => now; 37 while( oin.recv(msg) ) 38 { 39 cherr <= "RECEIVED: \"" <= msg.address <= "\": "; 40 printArgs( msg ); 41 if( msg.address == "/wek/outputs" ) 42 { 43 msg.getFloat(0) => float input; 44 push(input) => float result; 45 if (result > 0.5) { 46 // start playing 47 if (CURRENTLY_PLAYING == 0) { 48 1 => CURRENTLY_PLAYING; 49 0 => rizz.pos; 50 } 51 } else { 52 // stop playing 53 if (CURRENTLY_PLAYING == 1) { 54 0 => CURRENTLY_PLAYING; 55 rizz.samples() => rizz.pos; 56 } 57 } 58 } 59 } 60 61 } 62} 63 64fun float push(float value) { 65 value => inputs[curr_i]; 66 0 => float sum; 67 for (0 => int i; i < NUM_AVG; i++) {sum + inputs[i] => sum;} 68 (curr_i + 1) % NUM_AVG => curr_i; 69 return sum / NUM_AVG; 70} 71 72fun void printArgs( OscMsg msg ) 73{ 74 for( int i; i < msg.numArgs(); i++ ) 75 { 76 if( msg.typetag.charAt(i) == 'f' ) // float 77 { 78 cherr <= msg.getFloat(i) <= " "; 79 } 80 else if( msg.typetag.charAt(i) == 'i' ) // int 81 { 82 cherr <= msg.getInt(i) <= " "; 83 } 84 else if( msg.typetag.charAt(i) == 's' ) // string 85 { 86 cherr <= msg.getString(i) <= " "; 87 } 88 } 89 cherr <= IO.newline(); 90}