Skip to content

Instantly share code, notes, and snippets.

@epar
epar / arrays-example.pde
Created November 7, 2019 08:44
Arrays Example IxL F2019
// 1) DECLARE THE ARRAYS
float[] xpositions = new float[50];
float[] ypositions = new float[50];
void setup() {
size(800, 600);
// 2) INITIALIZE THE ARRAYS (FILL THEM WITH VALUES)
for(int i=0; i<xpositions.length; i++) {
xpositions[i] = random(width);
ypositions[i] = random(height);
@epar
epar / 3dot-bounce-millis
Created March 21, 2019 11:31
3 dot bounce (millis)
// Include library
#include <FastLED.h>
// How many leds are in the strip?
#define NUM_LEDS 33
// Data pin that led data will be written out over
#define DATA_PIN 3
// This is an array of leds. One item for each led in your strip.
@epar
epar / 3dot-bounce-simple
Created March 21, 2019 11:30
3 dot bounce (simple)
// Include library
#include <FastLED.h>
// How many leds are in the strip?
#define NUM_LEDS 33
// Data pin that led data will be written out over
#define DATA_PIN 3
// This is an array of leds. One item for each led in your strip.
@epar
epar / DMX_3_lights.ino
Created March 20, 2019 10:55
3 DMX Controlled 9-Channel Par Lights
/*
* 3 DMX controlled LED Par Light example
*
* In this example we're using 3 par lights model Chauvet DJ Eve P-130 RGB
* Each light can have up to 9 DMX channels to control different
* functionality of the light. For an overview of the channels
* look at https://open-fixture-library.org/chauvet-dj/eve-p-130-rgb
*
* For this example the lights should be set to 9 channel DMX mode
* on the light itself. And, light1 should start at DMX channel 1,
@epar
epar / control-signals-across-domains.maxpat
Created November 8, 2018 02:49
Control signals across audio and video domains
<pre><code>
----------begin_max5_patcher----------
2031.3oc4as0aaaCE94jeEBtu5ow6jZu0Ur0UfMrgc6gUTLPKyjnNYIMIY2z
Nr+6iWjc8EYE5HozU67fQrHkN5bNe7b4iz+y0WMYV98ppIAeUvqCt5p+45qt
xdIyEtp46WMYg793TYkcZSlUHqiuSUNYpaPYVVdsrNIOyN7ydVvKJUxZUfLX
9x57LUPxB4spfm8r02wJYYlbgxNcjYFadVEk4040uuPsY7hj6S2beIp2sJoJ
YVRZR86MCCaFI+lapT0Ns.DBlZ9H3MMCllG+Wp4yKk2VEWlmlZlFnYr3zj3+
p9tx7k2d21WW+BLKUc2g2fafUGNvraWjOWs8K0r7x4ZUaq4jL2pS4yd6Wfwq
0prkKRxRU0VqazGuX9x50Wc8SzZ4Sxt8OKUwMZKBABoSC3.RHS+mfCfPNTv0
WCgDFSADuswv8TMlX28OYxlg1XyW8gPiaoLT620hbhY3+85qMeLcv.IeqTab
@epar
epar / generative-video.maxpat
Created November 2, 2018 09:08
Generative Video
<pre><code>
----------begin_max5_patcher----------
2059.3oc6b10aaaCEF95jeEBpWzaxbE+TT6tggNfNfc0.1EKMXfVhIVMxhdR
x4iVz+6ihTx0NgJgNR1QXQEnIvTT4HR9vy4kGRquc5I9yk2IJ889Yuy8N4ju
c5ImnKptfSZ97I9K42EmwK0Uye9JdU7BQg+YlKxyykU7pTYt9xu6cd+5Bd9U
BOt2MoIBYo27hzqVTkKJK+PrLupfWV8gRwJdg9t7d26Z+ScCuHmuTXLSQrrr
3bvEsWbUgrRVc+JwlprJ8trM2Zp31aRKSmmlkVce8kAMWQd4kkhJSKLXVvY0
+v6hlKlIiuVjjTvupLtPlkUWsflqEmkFec0hB45qVrc4pGf4YhEO9FLW3lGe
g4WsTlH19gZtrHQ0EtUcjqqxDU0sOyipu+lGRcGdZ9U+SgHtogvPvYHDBR.Q
DD.RNyCDhY0EginAQnPUIv.VcyEf1tAmudYZtxP5wxv1Ba6Qu4qyL86yTC4J
@epar
epar / ss2-ex4.pde
Created October 31, 2018 08:20
Study Session 2 - Extra Exercise 4
void setup() {
size(500, 500);
noStroke();
}
void draw() {
background(0);
// check if the mouse is in the correct quadrant by
// using different combinations of conditional test between
@epar
epar / ss2-ex3.pde
Created October 31, 2018 08:19
Study Session 2 - Extra Exercise 3
void setup() {
size(500, 500);
// using rectMode(CENTER) to make it easy
// to draw a rectangle in the center of the screen
rectMode(CENTER);
}
void draw() {
background(0);
@epar
epar / ss1-ex2.pde
Created October 31, 2018 08:18
Study Session 1 - Extra Exercise 2
// declare five color variables
color color1 = color(0, 255, 255);
color color2 = color(255, 0, 0);
color color3 = color(200, 0, 0);
color color4 = color(150, 0, 0);
color color5 = color(100, 0, 0);
// create a counter variable
int counter = 0;
@epar
epar / ss1-ex1.pde
Created October 31, 2018 08:12
Study Session 1 - Extra Exercise 1
// variables for the line x positions
int line1, line2, line3;
// color variables
color color1, color2, color3, color4;
void setup() {
// set up window size
size(800, 600);