Skip to content

Instantly share code, notes, and snippets.

@whichlight
whichlight / js_interactive_art_talk.md
Last active December 26, 2015 14:59
Making interactive art with Javascript (BarCampBoston 2013)

Making interactive art with Javascript (BarCampBoston 2013)

@whichlight

community

ubiquity

interest

(not so much the technical parts of the language)

ART + JS

@whichlight
whichlight / node kinect problem
Created September 15, 2013 16:20
having some weird issues installing node-kinect on my old laptop. might be some c issue
Installing the module, this comes up, but it still installs fine
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/kinect/src/kinect.o
../src/kinect.cc:1:1: warning: "BUILDING_NODE_EXTENSION" redefined
<command-line>: warning: this is the location of the previous definition
SOLINK_MODULE(target) Release/kinect.node
ld: warning: in /usr/local/lib/libfreenect.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
SOLINK_MODULE(target) Release/kinect.node: Finished
@whichlight
whichlight / kinect-depth-smoothing.js
Last active July 12, 2017 09:38
pixel smoothing and moving average in javascript, for Kinect depth frame buffers in https://github.com/whichlight/figure-sketching-kinect/
//from http://www.codeproject.com/Articles/317974/KinectDepthSmoothing
function smoothDepth(arr){
var res = createArray(width,height);
for(var i=2; i< width-2; i++){
for(var j=2; j < height-2; j++){
if(arr[i][j]===0){
var innerBandCount = 0;
var outerBandCount = 0;
var filterCollection = [];
@whichlight
whichlight / index.html
Last active December 18, 2015 17:18
Embedly drag and drop example
<!DOCCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<meta name="viewport" content="width=620">
<title>Embedly Drag and Drop</title>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.embedly-3.1.1.min.js"></script>
</head>
@whichlight
whichlight / gist:5522924
Created May 6, 2013 01:46
blue generator , web audio synth 1.
$(document).ready(function(){
$(".start").css("width","100%");
$(".start").css("height","100px");
$(".start").css("background-color","#A6D1FF");
$(".start").css("cursor","pointer");
var playing = false;
try{
@whichlight
whichlight / gist:5506776
Created May 3, 2013 02:13
simple deep drone synth
s1 = get_synth(35);
s2 = get_synth(35.2);
function get_synth(pitch){
nodes={};
nodes.source = myAudioContext.createOscillator();
nodes.source.type=3;
nodes.filter = myAudioContext.createBiquadFilter();
nodes.volume = myAudioContext.createGainNode();
nodes.filter.type=0; //0 is a low pass filter
@whichlight
whichlight / gist:4645157
Created January 26, 2013 22:45
libusb autogen error
libusb -> ./autogen.sh
glibtoolize: putting auxiliary files in `.'.
glibtoolize: copying file `./ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
glibtoolize: copying file `m4/libtool.m4'
glibtoolize: copying file `m4/ltoptions.m4'
glibtoolize: copying file `m4/ltsugar.m4'
glibtoolize: copying file `m4/ltversion.m4'
glibtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:34: error: 'AM_CONFIG_HEADER': this macro is obsolete.
==> ./autogen.sh
You should use the 'AC_CONFIG_HEADERS' macro instead.
/usr/local/Cellar/automake/1.13.1/share/aclocal-1.13/obsolete-err.m4:14: AM_CONFIG_HEADER is expanded from...
configure.ac:25: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
@whichlight
whichlight / minimal_tone.ino
Created September 23, 2012 15:53
minimal tone example
// http://arduino.cc/en/Reference/Tone
void setup() {
// iterate over the notes of the melody:
}
void loop() {
tone(8, 2000);
}
@whichlight
whichlight / rangefinder_hcsr04.ino
Created September 23, 2012 15:49
rangefinder code hc-sr04
int pingPin = 13;
int inPin = 12;
void setup() {
Serial.begin(9600);
}
void loop()
{
// establish variables for duration of the ping,