Skip to content

Instantly share code, notes, and snippets.

@data-doge
Last active October 22, 2016 22:32
Show Gist options
  • Save data-doge/2d5d34bf8ffa9f0add72 to your computer and use it in GitHub Desktop.
Save data-doge/2d5d34bf8ffa9f0add72 to your computer and use it in GitHub Desktop.
programming because it's fun

experiments with code ?


  • early example of playful code
  // javascript implementation

  function randomSlash () {
    var chars = ['/', '\\']
    var charIndex = Math.floor(0.5 + Math.random())
    return chars[charIndex]
  }

  function generateMaze () {
    setInterval(function () {
      process.stdout.write(randomSlash())
    }, 1)
  }

  generateMaze()

there's an entire book written about this single line of code. you can download a free version here, but if you have the $$$ you should buy it. the folx who wrote this book are pretty cool.

initial experiences with code

wait code can be used for other things?

  • zach alterman: senior thesis performance, 11:00

    • MAX
    • MAX MSP
    • MAX JITTER
    • deeply inspiring -- programming can be used to make music and musical instruments?
  • STUPID SHIT NO ONE NEEDS & TERRIBLE IDEAS HACKATHON

    • people making things just for fun, exploration. strictly play.
  • arduino - open-source, easy-to-use hardware platform

  • sparkfun - tons of plug-n-play modules for arduino (and other microcontrollers)

  • adafruit - similar to sparkfun

  • laser harp 0

    • laser pointed at photocell, photocell connected to arduino
    • when laser intercepted, change in light causes voltage difference
    • arduino detects voltage difference, sends serial message to laptop via USB
    • open source software on laptop converts serial to MIDI
    • in ableton (music software), detect MIDI messages and trigger notes with them.
    • more lasers, more photocells, more notes.
    • add potentiometer (a knob -- a variable resistor) -- changes chord
  • laser harp 1

    • connect ultrasound sensor, measures distance
    • if short distance, notes spaced closely
    • if long distance, notes spaced farther
  • laser harp 2

    • instead of playing notes, trigger samples of russian compositions.
  • laser harp 3

    • more potentiometers! bigger arduino! use extra knobs to control software effects on ableton (delay, bit crusher, flanger, LFO, etc.)
  • haptix node

    • ok, with arduino you can cheaply and easily measure anything you want -- sound, light, presence of gas in the air, flex, pressure, humidity, temperature, distance, emotional state (EEG), heartbeat, etc.
    • also, with arduino, you can actuate lots of things -- lights, motors, vibration motors, speakers, solenoids, etc.
    • synthetic synesthesia? choose a sensor and actuator. translate one sense to another sense.
    • can we feel distance? can we feel sound? of course we can!
    • came across the work of neil harbisson, a self-proclaimed 'cyborg'.
  • audiotactile backpack

    • $5USD MSGEQ7 chip lets you measure the amplitude of an audio signal at 7 distinct frequency bands (lows and mids and highs)
    • connect ipod to chip, connect chip to arduino.
    • with arduino, translate amplitudes to the speed of vibration motors attached to your back.
    • feel bass on your lower back, feel treble on your neck, feel everything in between, in between.
    • feel the music you're listening to while you code.

introduction to web programming:

experimentation on the web:

  • owls

    • the concept of an owl
    • look up: you're the man now dog
      • finding forester (IMPORTANT)
  • birds

    • on click, put bird on screen and make it grow.
    • do it over and over
  • lines

    • make column of line-shaped divs
    • lines get slightly more opaque as you go down the column.
    • rotate column
    • more columns
  • aehravx

    • watched an MIT opencourseware lecture, some sort of algorithms course?
    • learned about peak finding
    • simple implementation
    • looks a lot like bacteria in a petri dish?
  • raindrops

    • what happens if you put a div in a div in a div in a div in a ..., each one increasing in size by 1px?
  • diglett fuckdown

    • wait, with jQuery, you can find anything on a webpage, and do whatever you want with it.
    • you can listen for all sorts of events -- keypresses, clicks, mouse moves, etc.
    • can we use jQuery to create terrible browsing experiences?
  • spectrum analyzer

    • javascript web audio API
    • soundcloud API
    • wow

current experiments:

  • avoidance

    • what does it look like when you have a bunch of things trained to run away from eachother?
    • result: looks great
  • text visualizer

    • audio visualizers exist, but what about text visualizers?
    • when we see a poem, we see it on a page. wall of words. so much information loss!
    • can we have a texts' background or the layout of a text respond to its contents?
    • ongoing experiment, WIP (https://www.youtube.com/watch?v=YBcevPdnBl0)
  • audio visualizer composed of layers.

    • what does it look like to have 9 layers -- each one with a repeating pattern of shapes and direction of movement and a few variable parameters -- layered atop one another? what patterns might emerge? what do things look like if the layers are stacked in different orders? can we make it all responsive to audio?
    • prototype in progress
    • github repo
  • face_hunter

    • https://processing.org/
    • OpenCV
    • the faces in LOST are so funny
    • build program to scrape all of them, and save them.
    • can we watch LOST -- but only with the faces looking directly at you?
    • can we build and navigate a minecraft-like 3D landscape composed of faces from LOST?

other cool projects on the net


conclusion?

having a computer and a knowledge of programming means having a laboratory with more tools than you will ever have a chance to use.

these tools are constantly being peer-reviewed and improved by the entire world.

tons of these tools are free for you to use, and free for you to explore and modify.

tools can be used beyond their intended purposes.

there is so much free, raw data on the internet. do what you want with it!

programming is more than a job skill. programming is a fucking joy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment