Skip to content

Instantly share code, notes, and snippets.

/***********************************************************************
MSAFluidDemo.pde
Demo of the MSAFluid library (www.memo.tv/msafluid_for_processing)
Move mouse to add dye and forces to the fluid.
Click mouse to turn off fluid rendering seeing only particles and their paths.
Demonstrates feeding input into the fluid and reading data back (to update the particles).
Also demonstrates using Vertex Arrays for particle rendering.
/***********************************************************************
@tildebyte
tildebyte / ex00_methodChaining.pyde
Created June 23, 2014 16:09
Conversion of first HYPE example to Processing's Python mode.
add_library('hype')
def setup():
size(640, 640)
H.init(this).background(36)
smooth()
rect1 = HRect(100)
rect1.rounding(10) # set corner rounding
rect1.fill(255, 102, 0) # set fill color
@tildebyte
tildebyte / example_001.pyde
Created June 23, 2014 20:17
HMagneticField example converted to Processing's Python mode.
add_library('HYPE')
field = None
def setup():
size(640, 640)
H.init(this).background(0xFF202020)
smooth()
colors = HColorPool([0xFFFFFFFF, 0xFFF7F7F7,
soBase = (HOscillator().
speed(1).
range(-5, 5).
freq(4).
property(H.ROTATION))
rects = [HRect(rectDiameter)
.fill(141, 73, 63, choice([64, 196]))
.noStroke()
.loc(x, y)
.anchorAt(H.CENTER)
@tildebyte
tildebyte / circle.py
Created June 29, 2014 21:32
Creative Coding, Week 3 example 2
class Circle(object):
HalfWidth = 0
def __init__(self, x, y, speed=random(10), phase=random(TAU)):
self.x = x
self.y = y
self.speed = speed
self.phase = phase
self.holdX = self.x
@tildebyte
tildebyte / constrain.pde
Last active August 29, 2015 14:03
Processing `constrain()` tests.
float x = 0;
float y = 0;
float speed = 0.9;
void setup(){
}
void draw(){
@tildebyte
tildebyte / ex00_methodChaining.pde
Created August 19, 2014 19:14
Simple HYPE example, Java & Python.
import hype.core.util.*;
import hype.extended.drawable.*;
void setup() {
size(640,640);
H.init(this);
HRect rect1 = new HRect(100);
rect1.fill(#FF6600) // set fill color
.stroke(#000000, 150) // set stroke color and alpha
@tildebyte
tildebyte / whale.js
Created December 2, 2014 20:18
A gibber.audio synth.
AudioContext = require('web-audio-api').AudioContext
Gibber = require('gibber.audio.lib/build/gibber.audio.lib.js')
// I want something truly random which can give a uniform distribution of integers
Random = require('random-js')
random = Random(Random.engines.browserCrypto)
// random.integer(30, 41)
Gibber.init()
Clock.bpm = 96 // 2500ms/whole, 625ms/quarter, 19.53ms/128th
@tildebyte
tildebyte / gist:2f7b815d22d36ab80d17
Last active August 29, 2015 14:10
gibber.audio ST3 livecoding
On Mon, Dec 1, 2014 at 9:55 AM, Ben <ben.alkov@gmail.com> wrote:
> Question: how hard would it be to integrate gibber.audio.lib running under
> node with Sublime 3?
LOL, I was already looking into this. Right now, I'm dead in the water.
The best thing I know of is SublimeREPL, but with ST3 under Win7 x64, I'm
getting OSError: [WinError 6] The handle is invalid every time I try to send
anything to Node. I've Googled around a bit, but I haven't found anything like
a solution yet.
@tildebyte
tildebyte / Explicit global
Created February 5, 2015 16:33
Globals style
import array
def setup():
global vertexes
vertexes = array.array('f', (0,) * 12)
def draw():
# drawing stuff here
def updateGeometry():