[ Launch: Tributary inlet ] 7431628 by zeffii
-
-
Save zeffii/7431628 to your computer and use it in GitHub Desktop.
Tributary inlet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"Tributary inlet","endpoint":"","display":"canvas","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.pde":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int num_parts = 3; | |
int x = 20; | |
int y = 14; | |
int diameter = 20; | |
String[] pattern_strings = new String[num_parts]; | |
void setup() { | |
size(tributary.sw*2, tributary.sh*2); | |
smooth(); | |
noStroke(); | |
for (int i = 0; i<num_parts; i++){ | |
pattern_strings[i] = "1.1.1.1. 1.1.1.1. 1.1.1.1."; | |
} | |
} | |
void draw() { | |
background(150); | |
for (int i = 0; i<num_parts; i++){ | |
String[] separate_tracks = pattern_strings[i].split(" "); | |
int num_triggers = separate_tracks[0].length(); | |
for(int t = 0; t<separate_tracks.length; t++){ | |
int[] triggers = new int[num_triggers]; | |
for(int p = 0; p<num_triggers; p++){ | |
char pad_state = separate_tracks[t].charAt(p); | |
triggers[p] = (pad_state =='1')? 1 : 0; | |
} | |
for(int tr=0; tr<triggers.length; tr++){ | |
int value = (triggers[tr]==1) ? 20: 140; | |
fill(value); | |
ellipse(40+ (x*tr), 50+(y*t) + (70*i), 5, 5); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment