This algorithm, inspired by fireflies, creates tumbling waves of colour which evolve, unrepeating, eternally. As the artwork builds, individual lines explore the canvas, tracing paths through unseen flow fields and defined geometries. When the paths meet, they connect and close into shapes. These shapes then seek out their neighbours and respond to one another.
In some species of firefly, each individual in a swarm influences and is influenced by the rhythmic flashing of others nearby, causing the cloud to synchronise in glowing ripples. Each firefly, or shape in this piece, holds an internal clock and, when it completes a cycle, a flashing pulse begins. Each clock independently ticks forward slowly but, when it sees others are flashing, it steps in larger leaps, causing waves of flashes to set off in turn.
Beneath the surface, a handful of unseen drifters wander quietly, carrying a hidden current through the swarm. Chance encounters with these passers-by nudge the chorus of clocks further forward, blooming into unexpected surges of light.
There is no centralised control of the timing of flashes across the collection of shapes. Each responds to its environment individually, yet together they form a system greater than themselves. In their meeting, they make light.
---
**Controls**
Once drawing is complete, 'd' enters interactive drawing mode, where you can add your own geometries
---
Part of Responsive Dreams 2025 Festival by The Generative Art Museum
19/20/21 September 2025.
Nau Dents de Serra, Roca Umbert Fàbrica de les Arts, Granollers, Barcelona
More info: responsivedreams.com/2025
This algorithm, inspired by fireflies, creates tumbling waves of colour which evolve, unrepeating, eternally. As the artwork builds, individual lines explore the canvas, tracing paths through unseen flow fields and defined geometries. When the paths meet, they connect and close into shapes. These shapes then seek out their neighbours and respond to one another.
In some species of firefly, each individual in a swarm influences and is influenced by the rhythmic flashing of others nearby, causing the cloud to synchronise in glowing ripples. Each firefly, or shape in this piece, holds an internal clock and, when it completes a cycle, a flashing pulse begins. Each clock independently ticks forward slowly but, when it sees others are flashing, it steps in larger leaps, causing waves of flashes to set off in turn.
Beneath the surface, a handful of unseen drifters wander quietly, carrying a hidden current through the swarm. Chance encounters with these passers-by nudge the chorus of clocks further forward, blooming into unexpected surges of light.
There is no centralised control of the timing of flashes across the collection of shapes. Each responds to its environment individually, yet together they form a system greater than themselves. In their meeting, they make light.
---
**Controls**
Once drawing is complete, 'd' enters interactive drawing mode, where you can add your own geometries
---
Part of Responsive Dreams 2025 Festival by The Generative Art Museum
19/20/21 September 2025.
Nau Dents de Serra, Roca Umbert Fàbrica de les Arts, Granollers, Barcelona
More info: responsivedreams.com/2025
let pl=[[{n:"Pop",t:"l",b:["#cac7d4","#faf5f8"],x:["#ada9ba","#dccced"],sg:[["#ffc629","#ffe0a8","#e3890b","#edc31c"],["#c71473","#ed5c9b","#990855","#7a1069"],["#ffb429","#fcc57c","#d6a30b"],["#4a158f","#af8be0","#24074a","#4a1a8a"]],z:[180,170],sga:()=>r(70,80),exa:()=>r(50,70),bc:[2,2,1],bce:[1,0,0],bdr:["#06010a","#04020f"],bdra:20,st:[["#ffc7df","#c71473","#ed5c9b"],["#e0c6f7","#302657"]]},3],[{n:"Slice",t:"l",b:["#d3e9ed","#e6eef0"],x:["#b5c5eb","#d2e9fa"],sg:[["#166db8","#A6C9E6","#0a518f"],["#05A5F0","#71CFE9","#20728a","#2bb0d6"],["#21C4D4","#b1dee3","#068c99","#1fcc81"],["#3de3b7","#9adbca","#1f6f91"],["#8FE43A","#d7f0aa","#86ff0d"]],z:[190,120],sga:()=>r(70,90),exa:()=>r(50,70),bc:[2,4,1],bce:[10,0,1],bdr:["#1f4566","#142638"],bdra:35,st:[["#1f4566","#166db8"],["#05A5F0","#A6C9E6"],["#05A5F0","#1f4566"]]},1],[{n:"Fading light",t:"d",b:["#05032b","#091a54"],x:["#190d66","#11021a"],sg:[["#230a45","#4a1a8a","#170233"],["#05032b","#ad218b","#280854","#910f54"],["#8C1BA5","#9c50ad","#4a1a8a","#280854"],["#e00d54","#e02b68","#b36a04","#910f54"],["#FF634B","#F89343","#ffefa1"],["#FF634B","#F89343","#ffefa1"]],z:[255,150],sga:()=>r(70,90),exa:()=>r(40,60),bc:[4,0,4],bce:[10,2,2],bdr:["#cacbdb","#050405"],bdra:10,st:[["#4a1a8a","#e3308f"],["#f7c8f0","#e3308f"],["#ffefa1","#4a1a8a"],["#141117","#e3308f"]]},2],[{n:"Gem",t:"l",b:["#d5ddeb","#f0f4f7"],x:["#dadbb4","#b0cdd4"],sg:[["#001D25","#4b7096","#01162b","#495663"],["#0080B6","#4cb8d9","#025375","#0374a8"],["#380D66","#2a71b5","#0757A3","#1C0245"],["#1C0245","#583d75","#5b2299","#1C0245"]],z:[240,170],feat:["#9AF10E","#9EFF03","#fbff05","#ffea05"],sga:()=>r(75,80),exa:()=>r(30,40),bc:[2,0,0],bce:[5,0,0],bdr:["#3d354f","#161d24"],bdra:20,st:[["#380D66","#4a3461"],["#0a1b4a","#0757A3"],["#380D66","#4a3461"],["#9AF10E","#0DA0CC"]]},2],[{n:"Laundrette",t:"l",b:["#f7d7ed","#f7f7e1"],x:["#f7e4be","#fffdd6"],sg:[["#db52de","#e9adf7","#75b7e0","#ed69f0"],["#db52de","#e9adf7","#75b7e0","#ed69f0"],["#db52de","#fcd89a","#FFD05B","#e66537"],["#a668ed","#ceb1f0","#4d5dc9"],["#688ede","#5adee6","#496dba"]],z:[255,150],sga:()=>r(80,95),exa:()=>r(50,60),bc:[6,0,3],bce:[3,0,2],bdr:["#38174d","#271433"],bdra:20,st:[["#472f57","#C874FE"],["#472f57","#ffe0ee"],["#688ede","#dda8ff"]]},2],[{n:"Tangerine",t:"l",b:["#d9cbab","#fff3d9"],x:["#fccc9d","#FFECA6"],sg:[["#ff8629","#ffbc70","#e66909","#ffbc70"],["#ff8629","#ffbc70","#e66909","#ffbc70"],["#f56e4c","#fcb29f","#e06343"],["#F5764C","#FFA130","#F5764C"],["#FF752A","#FFB733","#ffd891"],["#FFCD36","#FFECA6","#fcf5d7"],["#FFCD36","#FFECA6","#fcf5d7"],["#a31234","#e80e3a","#6b0920","#ab3003"]],z:[255,180],tex:["#a31234","#FF752A"],sga:()=>r(70,90),exa:()=>r(50,65),bc:[5,0,0],bce:[3,0,1],bdr:["#820723","#2b241f"],bdra:50,st:[["#F54C4C","#6b0920"],["#FFB733","#b02323"]]},2],[{n:"Bzzzz",t:"l",b:["#ded8d1","#faf5ed"],x:["#d1cfcd","#e0dbd1"],sg:[["#FFE53C","#FFE53C","#fff4ab","#ffbd24"],["#FFE53C","#FFE53C","#ffbd24"],["#ffc814","#fadc7a","#FFA011"],["#302c2f","#383337","#121112","#474447"],["#272226","#272226","#272226"]],z:[255,180],sga:()=>r(70,90),exa:()=>r(20,50),bc:[5,0,2],bce:[5,0,2],bdr:["#272226","#170e15"],bdra:70,st:[["#FFE53C","#ffc43c"],["#FFA011","#ffc43c"],["#FFA011","#272226"],["#ffc43c","#272226"],["#272226"]]},1],[{n:"Lime",t:"l",b:["#fafcc0","#feffe0"],x:["#bce0ce","#addbc4"],sg:[["#E9F7DE","#E9F7DE","#d7f2c2","#b1eb83"],["#00C67D","#E9F7DE","#029961"],["#ede026","#E9F7DE","#adb510"],["#26222F","#213a40","#0b0f0f"],["#9de630","#d0f59a","#27E88D","#7ef2be"],["#26222F","#1E3034","#0b0f0f"],["#8bed6b","#27E88D","#7ef2be","#27E88D"]],z:[170,130],sga:()=>r(70,90),exa:()=>r(50,70),bc:[1,0,0],bce:[1,0,0],bdr:["#45414B","#170e15"],bdra:30,st:[["#26222F","#674651"],["#26222F","#674651"],["#00C67D"],["#27E88D","#E9F7DE"],["#00C67D","#674651"]]},1],[{n:"Puff",t:"l",b:["#F5EDE5","#f7f4f0"],x:["#e8d8dc","#ded3e6"],sg:[["#FFA5BC","#FFBE64","#f55f86","#edbc40"],["#D0B1E3","#C0E0EC","#ac7fc7"],["#FFA5BC","#FFBE64","#f55f86"],["#D0B1E3","#C0E0EC","#58a8c7"],["#D0B1E3","#C0E0EC","#ac7fc7"],["#282828","#18304a","#000000"],["#ffffff","#ffffff","#e6e6e6","#c2c2c2"],["#4d4d4d","#4d4d4d","#000000"]],z:[230,100],sga:()=>r(70,90),exa:()=>r(40,60),bc:[2,0,0],bce:[1,0,0],bdr:["#282828","#282828"],bdra:40,st:[["#474747","#696969"],["#474747","#696969"],["#ffffff","#D0B1E3"],["#3888a6","#5abce0"],["#f25e96","#8d5cab"]]},3],[{n:"Hi-light",t:"l",b:["#d9d9d9","#f2f2f2"],x:["#c2c2c2","#dedede"],sg:[["#F53D84","#F55A61","#a33c41"],["#FF5133","#FF891E","#e86b31"],["#FF9C1A","#FAC72E","#F55A61"],["#E8F316","#f6ff52","#facd46","#E8F316"],["#BFF316","#BFF316","#ffb20d","#f6ff52"],["#292929","#707070","#BFF316","#F53D84"]],z:[230,180],sga:()=>r(75,80),exa:()=>r(30,60),bc:[2,0,0],bce:[3,0,1],bdr:["#232323","#232323"],bdra:50,st:[["#232323"],["#BFF316","#BFF316","#545454"],["#FF9C1A","#FF9C1A","#545454"]]},2],[{n:"Moon",t:"d",b:["#04042e","#25254a"],x:["#010112","#010112"],sg:[["#0381D1","#2690d4","#0c6aa6","#0c2f52"],["#A25FE4","#656ED4","#541196"],["#A25FE4","#656ED4","#0c6aa6","#541196"],["#0F3D81","#1E56AE","#2690d4","#0c6aa6"],["#2A1062","#C831CB","#C831CB","#541196"],["#102862","#1E56AE","#2690d4","#19052e"]],z:[255,150],feat:["#dae1ed","#eeedf0","#c8cfdb"],sga:()=>r(70,90),exa:()=>r(30,50),bc:[2,1,3],bce:[3,0,0],bdr:["#5e698a","#0a090a"],st:[["#170839"],["#734EC1","#170839"],["#A25FE4","#170839"],["#A25FE4","#C831CB"]]},2],[{n:"Avocado",t:"d",b:["#111210","#303030"],x:["#021c12","#050505"],sg:[["#3ddb97","#95e8b2","#4b9666"],["#279EA2","#42BDC1","#0e6366"],["#279EA2","#23d5db","#0e6366"],["#3ddb97","#95e8b2","#23d5db"],["#3ddb97","#95e8b2","#4b9666"],["#9442ad","#ae6bb5","#531466"],["#ed9968","#f2b6be","#f03288"],["#f03288","#e65094","#531466"]],z:[255,150],sga:()=>r(70,90),exa:()=>r(30,50),bc:[2,0,1],bce:[3,1,1],bdr:["#5f7867","#021c0a"],bdra:70,st:[["#531466","#30063d","#3ddb97"],["#f03288","#531466"]]},1],[{n:"Jazz Cup",t:"l",b:["#dbdbdb","#ebeff0"],x:["#c2b8c2","#d1e1e6"],sg:[["#c423d9","#d977e6","#9e13b0"],["#21a2c2","#3eedce","#10677d"],["#21a2c2","#5db4c9","#9e13b0"],["#371d47","#8f29cf","#371d47"]],z:[200,100],sga:()=>r(80,90),exa:()=>r(30,50),bc:[1,0,0],bce:[1,0,0],bdr:["#5d1b87","#3b204d"],bdra:40,st:[["#4a166b"],["#3eedce","#8f29cf"]]},2],[{n:"Grey Rainbow",t:"l",b:["#c9c9c9","#ededed"],x:["#adadad","#d4d4d4"],sg:[["#303030","#8a8a8a","#303030"],["#8a8a8a","#a8a8a8","#303030"],["#303030","#8a8a8a","#303030"],["#fa7523","#fab457","#e85e02"],["#67c9ac","#94ebb9","#158564"],["#467dc7","#85c8f2","#303b61"],["#3b237d","#8144c2","#3b237d"],["#701782","#db327e","#460254"]],z:[150,150],sga:()=>r(70,90),exa:()=>r(30,50),bc:[2,0,1],bce:[3,1,1],bdr:["#000000","#000000"],bdra:40,st:[["#ffffff"],["#000000"],["#303030","#000000"]]},2],[{n:"Trove",t:"d",b:["#24044f","#51edc9"],x:["#5fd2c9","#294c6e"],sg:[["#141414","#303030","#4791bf","#4cffa9"],["#000000","#164e70","#4791bf","#303030"],["#000000","#303030","#294c6e"],["#141414","#6c90a8","#4791bf"],["#4cffa9","#bdf3ff","#4791bf"]],z:[140,140],sga:()=>r(70,90),exa:()=>r(30,50),bc:[4,1,1],bce:[3,0,1],bdr:["#000000","#000000"],bdra:80,st:[["#b5d6eb"],["#baffde","#76d2db"]]},1],[{n:"Fruit Salad",t:"d",b:["#e02657","#ffae3d"],x:["#f55f86","#c21591"],sg:[["#ffa13d","#ffb566","#e02657"],["#e02657","#f55f86","#791280"],["#ffae3d","#ffe047","#ffae3d"],["#e02657","#e02657","#61081f"]],z:[160,150],sga:()=>r(70,90),exa:()=>r(30,50),bc:[2,0,1],bce:[5,0,1],bdr:["#61081f","#33030f"],bdra:80,st:[["#61081f","#f55f86"],["#e02657","#000000"]]},1],[{n:"Peachy",t:"l",b:["#ddf0c5","#eef2e9"],x:["#cedead","#cad4b8"],sg:[["#53c98a","#f2fca4","#7bbd82"],["#5ee0b9","#c6eb96","#6fabaa"],["#FF1C7F","#F99F52","#cc1666"],["#FF1C7F","#FFCB62","#e02276"]],z:[255,150],sga:()=>r(70,90),exa:()=>r(30,50),bc:[2,0,1],bce:[3,0,1],bdr:["#f8faf5","#f8faf5"],bdra:80,st:[["#FF1C7F","#FFCB62"],["#FF1C7F","#F99F52"]]},2],[{n:"Neon Street",t:"d",b:["#011323","#05496C"],x:["#010B14","#010B14"],sg:[["#13AED5","#36ffcf","#15679A"],["#ffc92e","#ffef8a","#dbae18"],["#d43b92","#f772be","#a83175"],["#4954c4","#a36de3","#2A3495"],["#4954c4","#a36de3","#2A3495"],["#128eb8","#36ffcf","#0DB2E9"],["#307cba","#438ef7","#487dc7"],["#6122ba","#9874db","#3e29a6"]],z:[255,180],sga:()=>r(70,90),exa:()=>r(30,50),bc:[2,3,0],bce:[3,2,1],bdr:["#102440","#102440"],bdra:80,st:[["#88e1f7"],["#0DB2E9","#36ffcf"]]},2],[{n:"Blush",t:"l",b:["#a4baf5","#EDF3FE"],x:["#b8ced9","#d3e9f5"],sg:[["#5B41D5","#c7bbfc","#452BC0","#e5e1f2"],["#5673e8","#9af5ec","#452BC0","#e5e1f2"],["#5673e8","#9af5ec","#452BC0","#e5e1f2"],["#5B41D5","#b3f2ec","#452BC0","#e5e1f2"],["#5B41D5","#b3f2ec","#452BC0","#e5e1f2"],["#7935bd","#edb4d7","#7935bd","#ffc5ab"],["#d130d1","#c7bbfc","#e841a5","#f78bb2"]],z:[255,100],sga:()=>r(70,90),exa:()=>r(30,50),bc:[4,0,1],bce:[3,0,1],bdr:["#13074d","#13074d"],bdra:80,st:[["#13074d"],["#f3ebfa","#4f1978"]]},1],[{n:"Volcano",t:"d",b:["#0E1D38","#7890ad"],x:["#2F3E59","#506680"],sg:[["#429A7D","#38c9c0","#284456"],["#F97F0C","#F3D138","#c77b34"],["#eb3d34","#f58e5b","#c9430a"],["#e61607","#f58e5b","#e61607","#f7d9d7"],["#0E1D38","#3a7194","#0E1D38"],["#0E1D38","#3a7194","#0E1D38"]],z:[220,140],sga:()=>r(70,90),exa:()=>r(50,70),bc:[2,1,1],bce:[3,0,1],bdr:["#beedde","#0E1D38"],bdra:80,st:[["#0E1D38"],["#284456","#beedde"]]},1],[{n:"Rough Seas",t:"d",b:["#020621","#111b42"],x:["#262f52","#020621"],sg:[["#265899","#6394d4","#042959"],["#265899","#74bee3","#061f40"],["#061f40","#1e395c","#1e4a82"],["#2588cf","#bfced9","#1e4a82"],["#051a29","#265899","#265899"],["#6fbaf2","#c9e1f2","#042959"],["#2588cf","#74bee3","#16426e"]],z:[250,150],feat:["#52c75b","#faff82","#52c75b"],sga:()=>r(80,90),exa:()=>r(30,50),bc:[4,1,0],bce:[3,1,1],bdr:["#2588cf","#1e395c"],bdra:80,st:[["#6fbaf2"],["#52c75b","#1e4a82"]]},1],[{n:"High Five",t:"d",b:["#01070D","#0D2635"],x:["#401432","#01070D"],sg:[["#E9413A","#f7e159","#E9AF3B"],["#E9413A","#FF9D4E","#E9413A"],["#AE0B3C","#ED4390","#84032B"],["#054F84","#3d9ccc","#054F84"],["#66cca1","#B5E9DB","#27a16d"]],z:[255,180],sga:()=>r(70,90),exa:()=>r(30,40),bc:[4,1,0],bce:[3,0,1],bdr:["#033457","#02021f"],bdra:50,st:[["#B5E9DB","#13151D"],["#F3E488","#054F84"]]},2],[{n:"Electric Garden",t:"d",b:["#0c0217","#122657"],x:["#15244a","#15244a"],sg:[["#ff0d55","#ff8aad","#bd083d"],["#15244a","#47daff","#15244a"],["#193478","#5c60bf","#3f1478"],["#c4e856","#fbff9e","#feffde","#80a11b"]],z:[255,130],sga:()=>r(70,90),exa:()=>r(30,40),bc:[5,1,1],bce:[6,1,1],bdr:["#5c60bf","#193478"],bdra:80,st:[["#ff0d55","#15244a"],["#c4e856"],["#47daff","#15244a"]]},1]];class Outline{constructor(s,t,n,i){this.num=e(os.ol[0]),this.gap=e(os.ol[1]),this.sGap=e(os.ol[2]),this.s_r=4,this.s_d=40,this.s_a=120,this.s_df=.5,this.j_r=e(os.ol[3]),this.j_d=e(os.ol[4]),this.j_df=.5,this.avl=n,this.i=i,this.colset=e(sx.p.st),this.path=s,this.cr=t,this.cpa(),this.cop(),this.shp(),this.type=e(os.olt),0==this.type?this.c_sgp():this.c_rp(),this.jp()}display(){blendMode(BLEND),this.displayjp()}displayjp(){for(let s of this.jp){let e=setCol(s.col,s.alpha);stroke(e),strokeWeight(s.weight),noFill(),beginShape();for(let e of s.path)vertex(e.pos.x,e.pos.y);endShape(CLOSE)}}jp(){let s;this.jp=[],s=this.rp?this.rp:this.sgp;for(let t of s){let s={path:[],weight:e(os.ol[6]),alpha:r(60,80),col:e(this.colset)},n=r(this.j_df);for(let e of t){let t=noise(e.jnpos.x,e.jnpos.y,n),i=map(t,0,1,-this.j_d,this.j_d)*e.amt;i*=e.dAmt;let r=cpv(e.pos,e.a,i);s.path.push({pos:r,a:e.a})}this.jp.push(s)}}c_rp(){this.rp=[];let s=map(this.avl,50,400,.2,1,!0);for(let e of this.shp){let t=rp(e,5);for(let e of t)e.a=ga(this.cr,e.pos),e.jnpos=cpv(this.cr,e.a,this.j_r),e.dAmt=s,e.amt=.7;this.rp.push(t)}}c_sgp(){this.sgp=[];for(let s of this.shp){let e=[],t=map(this.avl,50,500,.1,1,!0);for(let n of s){let s=int(n.d/4),i=n.d/s,r=s/2;for(let o=0;o<s;o++){let l=e_oc(o<=r?map(o,0,r,.1,1):map(o,r,s-1,1,.1)),c=cpv(n.pos,n.a,i*o),d=ga(this.cr,c),a=dt(this.cr,c);e.push({pos:c,jnpos:cpv(this.cr,d,this.j_r*map(a,20,200,.1,1,!0)),ja:d,a:n.a+90,amt:l,dAmt:t})}}this.sgp.push(e)}}shp(){this.shp=[];for(let s of this.op){let e=[],t=r(this.s_df);for(let n of s){let s=noise(n.npos.x,n.npos.y,t),i=map(s,0,1,.5*-this.s_d,this.s_d),r=noise(n.npos.x,n.npos.y,t+20),o=map(r,0,1,-this.s_a,this.s_a)+n.a,l=cpv(n.pos,o,i);e.push({pos:l})}for(let s=0;s<e.length;s++){let t=(s+1)%e.length;e[s].a=ga(e[s].pos,e[t].pos),e[s].d=dt(e[s].pos,e[t].pos)}this.shp.push(e)}}cop(){this.op=[];for(let s=0;s<this.num;s++){let e=[];for(let t of this.path){let n=(s*this.gap+this.sGap)*map(t.ad,0,90,3.2,1,!0),i=cpv(t.pos,t.a,n),r=ga(this.cr,i),o=cpv(this.cr,r,this.s_r);e.push({pos:i,npos:o,a:t.a,ad:t.ad})}this.op.push(e)}}cpa(){let s=0,e=0;for(let t of this.path){let n=(s+1)%this.path.length,i=s-1;i<0&&(i=this.path.length-1),t.pos.x!=this.path[n].pos.x&&t.pos.x!=this.path[i].pos.x||(t.pos.x+=1e-4);let r=ga(t.pos,this.path[n].pos)%360,o=ga(t.pos,this.path[i].pos)%360;e+=dt(t.pos,this.path[i].pos),t.a=ma(r,o)+180,t.ad=angleDiff(r,o),s++}this.avl=e/this.path.length}}let os={};function ops(){os.sg={cn_n:w([[[3,4,4,5,6,8,15],3],[[3,4,5],5],[[3,4,5,10],1],[[6,8,10],1],[[3,3,4,4,5],2],[[4],2],[[3,4,4,6],3]]),dist:w([[[40,40,40,50,70,100],3],[[40,100,200],2],[[50,80,90,100,200,300],2],[[50,60,80,90,100],2]]),rcn:w([[[[!0,1],[!1,1]],1],[[[!1,1]],1],[[[!0,1]],3],[[[!0,1],[!1,3]],1],[[[!0,4],[!1,1]],3]])},os.ol=w([[[[3,4,5],[2,3],[1,10],[1.2],[40],[15],[1.5,1.7]],1],[[[3,4,5],[4,5,8],[5,10,20],[1.3],[20,30],[6],[1,1.3]],3],[[[17],[2],[1],[.5],[80],[3],[1.5,.6,1.3]],2],[[[5,10],[1],[20,50],[.5],[80],[5],[.5,.6,1.3]],2]]),os.olt=w([[[0],1],[[0,1],1],[[1],1]]),os.e=w([[[18,10,.3],10],[[10,30,.4],5],[[30,5,.6],3],[[5,80,.15],1]]),os.r=w([[[5,7,15,.5,{x:.5*sz.nw,y:.5*sz.nh}],5],[[15,7,0,.9,cLoc()],5],[[25,5,5,.8,cLoc()],5],[[4,r(25,45),1,.6,cLoc()],1]]),os.lr=w([[[3,6,10,30,.6],5],[[6,5,30,80,.4],1],[[3,10,10,30,.3],5],[[4,15,5,25,.4],1]]),os.xr=w([[[5,12,3,20,6,.5,1],1],[[5,22,3,70,6,.5,1],1],[[5,22,7,1,3,.6,1.6],1],[[3,10,3,3,15,.6,1],1],[[3,5,15,1,30,.7,1],1]])}class Node{constructor(s,e){if("g"==sx.nd.l){let s=e%sx.nd_g.cols,t=int(e/sx.nd_g.cols);this.pos={x:s*sx.nd_g.colGap+sx.nd_g.margin.x,y:t*sx.nd_g.rowGap+sx.nd_g.margin.y}}else if("vp"==sx.nd.l){let s=map(e,0,sx.nd.num-1,0,sz.nh),t={x:map(noise(s*sx.nd_vp.noiseRes),0,1,-sx.nd_vp.overhangv,sz.nw+sx.nd_vp.overhangv),y:s};this.pos=cpv(t,r(0,360),sx.nd_vp.ofs())}else if("vl"==sx.nd.l){let s=int(e/sx.nd_vl.perLine),t=e%sx.nd_vl.perLine,n=map(t,0,sx.nd_vl.perLine-1,sx.nd_vl.emargin,sz.nh-sx.nd_vl.emargin),i=map(noise(n*sx.nd_vl.noiseRes,s*sx.nd_vl.lineDiff),0,1,-sx.nd_vl.ww,sx.nd_vl.ww),o=s*sx.nd_vl.gap+.5*sx.nd_vl.smargin+i;this.pos=cpv({x:o,y:n},r(360),sx.nd_vl.ofs())}else if("sc"==sx.nd.l){let s;if("c"==sx.nd_sc.dist){let e=.5*e_s(r());s=cpv({x:.5,y:.5},r(360),e)}else"v"==sx.nd_sc.dist?s={x:r(),y:e_oc(r())}:"e"==sx.nd_sc.dist&&(s={x:r(),y:r()});let e=map(s.x,0,1,sx.nd_sc.margin,sz.nw-sx.nd_sc.margin,!0)+r(-10,10),t=map(s.y,0,1,sx.nd_sc.margin,sz.nh-sx.nd_sc.margin,!0)+r(-10,10);this.pos={x:e,y:t}}else if("r"==sx.nd.l){let s=e*sx.nd_r.aGap,t=map(e_os(r()),0,1,0,sx.nd_r.max),n={x:sx.cr.x,y:sx.cr.y};if("c"==sx.nd_r.type&&t>sx.nd_r.m[0]&&t<sx.nd_r.m[1]&&(t=r(sx.nd_r.m[2],sx.nd_r.m[3])),"l"==sx.nd_r.type){let s=sx.nd_r.s[0],i=(sz.nh-sx.nd_r.s[2])/(s+1),o=sx.nd_r.s[1][e%s];for(let t=0;t<s;t++)(e+t)%s==0&&(n.y=i*t+i+.5*sx.nd_r.s[2]);sx.nd_r.s[3]&&(n.y-=50),t=e_os(r())*o}this.pos=cpv(n,s,t)}this.index=s,this.uac=0,this.iis=!1,this.failedUses=0,"d"==sx.p.t?this.col="#ffffff":this.col="#000000",this.sz=r(2,5)}isFailure(){return this.failedUses>20&&0==this.uac}failed(){this.failedUses++}isV(s){for(let e of s)if(dt(e.pos,this.pos)<20)return!1;return!0}display(){fill(this.col),noStroke(),ellipse(this.pos.x,this.pos.y,this.sz)}}function dt(s,e){return dist(s.x,s.y,e.x,e.y)}function cpv(s,e,t){return{x:s.x+sin(e)*t,y:s.y+cos(e)*t}}function lvr(s,e){return{x:lerp(s.x,e.x,.75),y:lerp(s.y,e.y,.75)}}function cLoc(){return cpv({x:.5*sz.nw,y:.5*sz.nh},r(360),200)}function ma(s,e){return s==e?s:(diff=e>s?e-s:360-s+e,(s+.5*diff)%360)}function rp(s,e){let t=[];t[0]=[];for(let e of s)t[0].push({pos:e.pos,i:e.i});for(let s=1;s<e;s++){t[s]=[];let e=s-1;for(let n=0;n<t[e].length;n++){let i=n-1,r=n+1;i<0&&(i=t[e].length-1),r>t[e].length-1&&(r=0),t[s].push({pos:lvr(t[e][i].pos,t[e][n].pos),i:t[e][n].i}),t[s].push({pos:lvr(t[e][r].pos,t[e][n].pos),i:t[e][n].i})}}return t[t.length-1]}function overlap(s,e){return!(s.b<e.t||e.b<s.t||s.r<e.l||e.r<s.l)}function gDims(s){let e={x:0,y:0},t=1/0,n={l:1/0,r:-1/0,t:1/0,b:-1/0},i=0;for(let r of s){let o=(i+1)%s.length,l=dt(r.pos,s[o].pos);l<t&&(t=l),e.x+=r.pos.x,e.y+=r.pos.y,r.pos.x<n.l&&(n.l=r.pos.x),r.pos.x>n.r&&(n.r=r.pos.x),r.pos.y<n.t&&(n.t=r.pos.y),r.pos.y>n.b&&(n.b=r.pos.y),i++}dims={h:n.b-n.t,w:n.r-n.l},dims.lgs=max(dims.h,dims.w),e.x/=s.length,e.y/=s.length;let r=0;for(let t of s)r+=dt(e,t.pos);r/=s.length;for(let t of s)dt(t.pos,e)<.01&&(e.x+=1,e.y+=1);let o=[map(e.x,n.l,n.r,0,1),map(e.y,n.t,n.b,1,0)];return{cr:e,shs:t,mt:n,dims:dims,avr:r,ncr:o}}function c_ln(s){let e=0,t=[];for(let n of s){let i=(e+1)%s.length;t[e]={p0:{x:n.pos.x,y:n.pos.y},p1:{x:s[i].pos.x,y:s[i].pos.y},p0id:n.index,p1id:s[i].index},t[e].pCenter={x:(t[e].p0.x+t[e].p1.x)/2,y:(t[e].p0.y+t[e].p1.y)/2},e++}return t}function angV(s){let e=map(s.length,3,10,180,360,!0);for(let t=0;t<s.length;t++){let n=(t+1)%s.length,i=t-1;i<0&&(i=s.length-1);let r=tpa(s[t].pos,s[i].pos,s[n].pos);if(r<20)return!1;if(r>e)return!1;abs(r-180)<.2&&(s[t].flat=!0)}for(let e=s.length-1;e>=0;e--)s[e].flat&&s.splice(e,1);return!0}function isClockwise(s,e){return((e%=360)+(360-(s%=360)))%360>180}function ptap(s,e){let t=dt(s.p0,s.p1);if(dt(s.p0,e)>t)return!1;let n=ga(s.p0,s.p1),i=ga(s.p0,e);return abs(n-i)<1}function ga(s,e){let t=createVector(e.x-s.x,e.y-s.y),n=createVector(0,100).angleBetween(t);return n=n<0?abs(n):map(n,180,0,180,360),n}function tpa(s,e,t){return angleDiffOneWay(ga(s,e),ga(s,t),s)}function angleDiffOneWay(s,e,t){let n;return(s%=360)<0&&(s+=360),(e%=360)<0&&(e+=360),isClockwise(s,e)?n=n=180-abs(abs(s-e)-180):(n=s-e,n<0&&(n+=360)),n}function angleDiff(s,e){return(s%=360)<0&&(s+=360),(e%=360)<0&&(e+=360),180-abs(abs(s-e)-180)}function isct(s,e,t,n){return!(dt(e,t)<sx.nd.m)&&(!(dt(s,n)<sx.nd.m)&&(isClockwiseFromLine(s,e,t)!=isClockwiseFromLine(s,e,n)&&isClockwiseFromLine(t,n,s)!=isClockwiseFromLine(t,n,e)))}function isClockwiseFromLine(s,e,t){let n=createVector(s.x-e.x,s.y-e.y),i=createVector(t.x-e.x,t.y-e.y);return n.angleBetween(i)<0}class Form{constructor(){this.sg=[],this.nd=[],this.g_nd(),this.g_c(),this.g_sg();for(let s of this.sg)s.rcn();for(let s of this.sg)s.cx_col();if(sx.p.feat){let s=0,t=100,n=200,i=0;for(;!s;)s=e(this.sg).featColor(t,n,i),t-=4,n+=4,i++}for(let s of ms.options)if(ms[s].on)for(let e of this.sg)e.ex_cx(s);let s=!0;for(;s;){s=!1;for(let e of ms.options)if(ms[e].on)for(let t of this.sg)t.dex[e].on&&t.dex[e].done<ms[e].num&&(t.ctex(e),s=!0)}if(this.evaluate(),sx.em){ms.m_xr.num.val=int(map(sx.emAmt,15,sx.maxEm,ms.m_xr.num.max,ms.m_xr.num.min,!0));let s="m_xr";for(let e of this.sg)e.ex_cx(s);let e=!0;for(;e;){e=!1;for(let t of this.sg)t.dex[s].on&&t.dex[s].done<ms[s].num.val&&(t.ctex(s),e=!0)}}if(ms.ol.on)for(let s of this.sg)s.ol();this.orderSegments()}g_sg(){this.numsg=sx.sg.num;for(let s=0;s<this.numsg;s++){let s,e=!1,t=!0,n=0;for(;t;)s=new Segment(this.nd,"s",this.sg.length),s.isV(this.sg,this.nd)?(e=!0,t=!1):s.ntV(this.nd),n>10&&(t=!1),n++;e&&(s.ntun(this.nd),this.sg.push(s))}}g_c(){this.c=[];for(let s=0;s<ms.c.num;s++){let s,e=!1,t=!0,n=0;for(;t;)s=new Segment(this.nd,"c",this.sg.length),s.isV(this.c)&&(e=!0,t=!1),n>5&&(t=!1),n++;e&&(s.ntun(this.nd),this.sg.push(s))}for(let s of this.sg)for(let e=this.nd.length-1;e>=0;e--)s.cpt(this.nd[e].pos)&&!s.ipt(this.nd[e])&&(s.pi_n++,s.pi_n>ms.c.pia&&(this.nd[e].insideCircle=!0))}orderSegments(){let s,e=-1;for(s of this.sg)if(s.feat){e=s.i;break}e>=0&&this.sg.splice(e,1),this.sg.sort(((s,e)=>s.avr-e.avr)),this.sg.reverse(),e>=0&&this.sg.push(s)}evaluate(){t_c.background(0,0,100);for(let s of this.sg)s.d_ts();image(t_c,0,0),t_c.loadPixels();let s=0,e=0;for(let t=0;t<t_c.pixels.length;t+=4)t_c.pixels[t]<90?s++:e++;let t=s/(s+e)*100;t<sx.maxEm&&(sx.em=!0,sx.emAmt=t,ms.m_xr.on=!0)}g_nd(){this.nd=[];for(let s=0;s<sx.nd.num;s++){let e,t=!1,n=!0,i=0;for(;n;)e=new Node(this.nd.length,s),e.isV(this.nd)&&(t=!0,n=!1),i>10&&(n=!1),i++;t&&this.nd.push(e)}}display(){if(push(),translate(sz.ts.x,sz.ts.y),scale(sz.f.x,sz.f.y),translate(sz.ts.rx,sz.ts.ry),se.ex)for(let s of this.sg)s.d_ex();if(pop(),blendMode(BLEND),ms.m_s.on&&se.ol)for(let s of this.sg)s.d_st();if(se.s)for(let s of this.sg)s.display();if(push(),translate(sz.ts.x,sz.ts.y),scale(sz.f.x,sz.f.y),translate(sz.ts.rx,sz.ts.ry),ms.ol.on&&se.ol)for(let s of this.sg)s.d_ol();pop()}d_n(){for(let s of this.nd)s.display()}}function dbg(){let s=rsd;t_g.shader(s),t_g.resizeCanvas(sz.w,sz.h),s.setUniform("u_t",rndTx),s.setUniform("u_r",[sz.w,sz.h]),s.setUniform("u_c1",hexToRGB(sx.p.b[0])),s.setUniform("u_c2",hexToRGB(sx.p.b[1])),s.setUniform("u_cn1",hexToRGB(sx.p.x[0])),s.setUniform("u_cn2",hexToRGB(sx.p.x[1])),s.setUniform("u_cr",[.5,.5]),s.setUniform("u_rs",.85),t_g.rect(0,0,sz.w,sz.h),image(t_g,0,0),t_g.clear()}
class Rnd{constructor(){this.useA=!1;let s=function(s){let e=parseInt(s.substr(0,8),16),t=parseInt(s.substr(8,8),16),n=parseInt(s.substr(16,8),16),i=parseInt(s.substr(24,8),16);return function(){e|=0,t|=0,n|=0,i|=0;let s=(e+t|0)+i|0;return i=i+1|0,e=t^t>>>9,t=n+(n<<3)|0,n=n<<21|n>>>11,n=n+s|0,(s>>>0)/4294967296}};this.prngA=new s(tokenData.hash.substr(2,32)),this.prngB=new s(tokenData.hash.substr(34,32));for(let s=0;s<1e6;s+=2)this.prngA(),this.prngB()}d(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}n(s,e){return s+(e-s)*this.d()}}let R=new Rnd;function r(s,e){return null==s&&(s=0,e=1),null==e&&(e=s,s=0),R.n(s,e)}function w(s){let e=[];for(let t of s)for(let s=0;s<t[1];s++)e.push(t[0]);return e[int(r(e.length))]}function e(s){return s[int(r(s.length))]}function dcx(s,e){let t=[],n=[];e=min(e,s.length-1);for(let e of s)n.push(e);for(let s=0;s<e;s++){let e=int(r(n.length));t[s]=n[e],n.splice(e,1)}return t}function shar(s){let e=[];for(let t=0;t<s.length;t++){let n=int(r(s.length));e[t]=s[n],s.splice(n,1)}return e}function e_s(s){angleMode(RADIANS);let e=1-cos(s*PI/2);return angleMode(DEGREES),e}function e_oc(s){return 1-Math.pow(1-s,3)}function e_os(s){return Math.sin(s*Math.PI/2)}var sz={r:1.4,s:!1,p:!1},rz={t:0,d:300,h:1},steps=[0,1200,1300,1700,2400,4500,4900];function ccsz(){sz.s?(sz.w=2e3,sz.h=Math.floor(sz.w*sz.r)):sz.p?(sz.w=4800,sz.h=Math.floor(sz.w*sz.r)):(sz.h=Math.floor(.98*window.innerHeight),sz.w=Math.floor(sz.h/sz.r)),sz.nw=1e3,sz.nh=Math.floor(sz.nw*sz.r),sz.dim=Math.min(sz.nw,sz.nh),sz.ldim=Math.max(sz.nw,sz.nh),sz.f={x:sz.w/sz.nw,y:sz.h/sz.nh},sz.ts={x:.5*sz.w,y:.5*sz.h,rx:-sz.w/sz.f.x*.5,ry:-sz.h/sz.f.y*.5},sz.w<steps[1]?sz.noiseSize=1:sz.w<steps[2]?sz.noiseSize=2:sz.w<steps[3]?sz.noiseSize=3:sz.w<steps[4]?sz.noiseSize=4:sz.w<steps[5]?sz.noiseSize=5:sz.noiseSize=6}function ckrz(){rz.h||millis()&&rz.t+rz.d<millis()&&d&&(hdrz(),rz.h=1)}function hdrz(){ccsz();let s=[window,c_2,t_c,rndTx];for(let e of s)e.resizeCanvas(sz.w,sz.h),e.clear(),e.blendMode(BLEND),e.noStroke();background(sx.p.b[0]),d=0}function myResize(){millis()&&(rz.t=millis()),rz.h=0}function setCol(s,e){return"string"==typeof s&&(s=color(s)),s.setAlpha(e),s}function hexToRGB(s){var e=(s=s.replace("#","")).match(/.{1,2}/g);return[parseInt(e[0],16)/255,parseInt(e[1],16)/255,parseInt(e[2],16)/255]}window.addEventListener("resize",myResize);let time,stime,lsd,rsd,t_g,s_c,c_2,ctx,f,sx,se,ms,t_c,rndTx,d,timeLoaded,rv,loadTime=0,vy="precision mediump float;",logged=0,vr="uniform vec2 u_r;uniform vec3 u_c1;uniform vec3 u_c2;uniform vec3 u_cn1;uniform vec3 u_cn2;",mn="void main() {vec2 st = gl_FragCoord.xy/u_r.xy;highp vec4 nv = texture2D(u_t, st);",ed="vec4 col_ = vec4(mix(col, cn, smoothstep(0.0, 1.2, ne)), 1.0);gl_FragColor = vec4(col_.x, col_.y, col_.z, 1.0);}",vs=vy+"attribute vec3 aPosition;void main() {vec4 p = vec4(aPosition, 1.0);p.xy = p.xy * 2.0 - 1.0;gl_Position = p; }",ls=vy+vr+"uniform sampler2D u_t;uniform float u_a;uniform vec2 u_cr;void main() {vec2 st = gl_FragCoord.xy/u_r.xy;highp vec4 nv = texture2D(u_t, st);vec2 origin = vec2(0.5, 0.5);st -= origin;float ang = radians(90.) - radians(u_a) + atan(st.y, st.x);float len = length(st);st = vec2(cos(ang) * len, sin(ang) * len) + origin;vec3 col = vec3(mix(u_c1, u_c2, smoothstep(0., 1., st.x)));vec3 cn = vec3(mix(u_cn1, u_cn2, smoothstep(0.499, 0.5, nv.y)));float ne = nv.x * 0.95;vec4 col_ = vec4(mix(col, cn, smoothstep(0.0, 1.2, ne)), 1.0);gl_FragColor = vec4(col_.x, col_.y, col_.z, 1.0);}",rs=vy+vr+"uniform vec2 u_cr;uniform float u_rs;uniform sampler2D u_t;"+mn+"float d = distance(st, u_cr);vec3 col = vec3(mix(u_c2, u_c1, smoothstep(0.0, u_rs, d)));vec3 cn = vec3(mix(u_cn1, u_cn2, smoothstep(0.499, 0.5, nv.y)));float ne = nv.x * smoothstep(-0.3, 0.4, d);"+ed;function setup(){ccsz(),createCanvas(sz.w,sz.h),c_2=createGraphics(sz.w,sz.h),t_g=createGraphics(sz.w,sz.h,WEBGL),t_c=createGraphics(sz.nw,sz.nh),rndTx=createGraphics(sz.w,sz.h),lsd=t_g.createShader(vs,ls),rsd=t_g.createShader(vs,rs),rv={b:[],s:[],c:[],j:int(r(1e3)),k:int(r(1e3))};let s=[window,c_2,t_g,t_c,rndTx];for(let e of s)e.colorMode(HSB,360,100,100,100),e.pixelDensity(1),e.noStroke(),e.angleMode(DEGREES);ctx=c_2.canvas.getContext("2d"),sxs(),f=new Form,background(sx.p.b[0]),sx.gAng=r(360);for(let s=0;s<1e6;s++)rv.b[s]=r(sx.p.z[0]),rv.s[s]=r(sx.p.z[1]),rv.c[s]=r(255)}function draw(){d||(rndTx.pixelDensity(1),resetRndTx(rv.j,rv.k,!1),d=!0,dbg(),push(),translate(sz.ts.x,sz.ts.y),scale(sz.f.x,sz.f.y),translate(sz.ts.rx,sz.ts.ry),se.b&&dbdr(80),pop(),f.display(),push(),translate(sz.ts.x,sz.ts.y),scale(sz.f.x,sz.f.y),translate(sz.ts.rx,sz.ts.ry),se.n&&f.d_n(),se.b&&dbdr(sx.p.bdra),pop(),logData(),timeLoaded=millis(),(sz.p||sz.s)&&(console.log("saving"),save(hash+".png"))),(sz.p||sz.s)&&millis()>stime+5e3&&(sz.p=!1,sz.s=!1,hdrz()),ckrz()}function resetRndTx(s,e,t){rndTx.loadPixels();let n=sz.noiseSize;for(let i=0;i<rndTx.width;i+=n)for(let r=0;r<rndTx.height;r+=n){for(let o=0;o<n;o++)for(let l=0;l<n;l++){let n=4*(i+o+(r+l)*rndTx.width);rndTx.pixels[n]=t?rv.s[s]:rv.b[s],rndTx.pixels[n+1]=rv.c[e],rndTx.pixels[n+2]=100,rndTx.pixels[n+3]=100}s=(s+1)%rv.b.length,e=(e+1)%rv.c.length}rndTx.updatePixels()}function keyPressed(){"s"===key||"p"===key?(stime=millis(),"p"===key?sz.p=!0:sz.s=!0,hdrz()):("1"===key&&(se.n=!se.n),"2"===key&&(se.s=!se.s),"3"===key&&(se.ex=!se.ex),"4"===key&&(se.ol=!se.ol),"5"===key&&(se.b=!se.b),"r"===key&&(se={n:!1,ex:!0,ol:!0,b:!0,s:!0}),hdrz())}function dbdr(s){blendMode(BLEND),noFill(),t=sx.bdr.type,"line"==t?(stroke(setCol(sx.p.bdr[0],s)),strokeWeight(1.4),rect(sx.bdr.sz,sx.bdr.sz,sz.nw-sx.bdr.x2,sz.nh-sx.bdr.x2)):"solid"==t&&(strokeWeight(sx.bdr.sz),c=setCol(sx.p.bdr[1],s),stroke(c),rect(sx.bdr.d2,sx.bdr.d2,sz.nw-sx.bdr.sz,sz.nh-sx.bdr.sz))}function sxs(){if(ops(),noiseSeed(r(999999)),se={n:0,ex:1,ol:1,b:1,s:1},sx={p:w(pl),cr:{x:.5*sz.nw,y:.5*sz.nh},em:0,maxEm:50},sx.sg={cn_n:()=>e(os.sg.cn_n),szl:w([["c",14],["v",1],["l",1],["r",1]])},sx.nd={l:w([["g",3],["sc",2],["vl",1],["vp",2],["r",1]])},"g"==sx.nd.l&&(sx.nd_g={cols:e([3,4,5,5,6,8,10,15])},sx.nd_g.rows=min(ceil(sx.nd_g.cols*sz.r*e([.5,1,1,1,1,1.2])),35),sz.r<1&&([sx.nd_g.cols,sx.nd_g.rows]=[sx.nd_g.rows,sx.nd_g.cols]),sx.nd_g.margin={x:sz.dim*w([[.086,1],[.15,5],[.2,1]])},sx.nd_g.margin.y=sx.nd_g.margin.x,sx.nd_g.colGap=(sz.nw-2*sx.nd_g.margin.x)/(sx.nd_g.cols-1),sx.nd_g.rowGap=(sz.nh-2*sx.nd_g.margin.y)/(sx.nd_g.rows-1),sx.nd.num=sx.nd_g.cols*sx.nd_g.rows,sx.nd_g.num=sx.nd.num,sx.sg.num=max(15,min(int(sx.nd.num*e([.5,.9])),400))),"r"==sx.nd.l&&(sx.sg.szl="c",sx.nd_r={max:sz.dim*w([[.4,7],[.43,7],[.6,1]])},sx.nd.num=int(w([[r(40,90),2],[r(100,200),3],[200,6],[500,1]])),sx.nd_r.type=w([["n",3],["l",2],["c",2]]),"c"==sx.nd_r.type&&(sx.nd_r.m=e([[100,300,400,450],[150,300,390,450],[80,300,390,430]]),sx.nd.num=max(150,sx.nd.num),os.sg.dist=[40,40,50,60,70,80,100]),"l"==sx.nd_r.type&&(sx.nd_r.s=e([[2,[150,320],-500,!0,300,20,[40,40,50,60,70,80,100]],[3,[190,190,95],-250,!1,300,20,[50,60,70,80,100,140]]]),sx.nd.num=sx.nd_r.s[4],os.sg.dist=sx.nd_r.s[6],sx.maxEm=sx.nd_r.s[5]),sx.sg.num=int(.9*sx.nd.num),sx.nd_r.aGap=360/sx.nd.num),"sc"==sx.nd.l&&(sx.nd.num=int(w([[r(50,120),2],[r(150,230),3],[r(250,450),1]])),sx.sg.num=int(min(300,.8*sx.nd.num)),sx.nd_sc={dist:e(["v","c","e"]),margin:sz.dim*w([[.15,1],[.1,5],[.05,1],[-.05,1]])}),"vp"==sx.nd.l){let s=e([40,60]);sx.nd_vp={ofs:()=>r(10,s),noiseRes:e([.005,.01,.02,.025]),overhangh:sz.nh*e([.1,.2,.2,.2,.2]),overhangv:sz.nw*e([.1,.2,.2,.2,.2])},sx.nd.num=int(w([[r(40,100),1],[r(100,250),8]])),sx.sg.num=max(30,int(.7*sx.nd.num))}if("vl"==sx.nd.l){let s=w([[[2,250,.001,600,100,.5,r(60,140),100],3],[[2,500,.008,500,-50,0,r(60,140),3],3],[[3,400,.003,500,100,.5,r(130,250),100],2],[[4,500,.001,400,100,.5,r(130,250),70],1]]);sx.nd_vl={ofs:()=>r(0,s[7]),num:s[0],ww:s[1],noiseRes:s[2],smargin:s[3],emargin:s[4],lineDiff:s[5]},sx.nd.num=int(s[6]),sx.sg.num=int(.8*sx.nd.num),sx.nd_vl.perLine=ceil(sx.nd.num/sx.nd_vl.num),sx.nd_vl.gap=(sz.nw-sx.nd_vl.smargin)/(sx.nd_vl.num-1)}sx.bdr={type:e(["solid","line"]),sz:w([[20,30],[45,5]])},"solid"==sx.bdr.type&&(sx.bdr.sz=10),sx.bdr.x2=2*sx.bdr.sz,sx.bdr.d2=.5*sx.bdr.sz,ms={num:e([1,2]),ol:{name:"ols",on:!1,done:0,cx:.6,seg_cx:.8},m_s:{name:"m_s",on:!1,weight:{min:.8,max:1.8},cx:.5,scx:.7},c:{name:"c",on:!0,num:w([[0,20],[1,3],[2,1]]),pia:e([0,1,2])},m_lr:{name:"m_lr",on:!1,segment_cx:{max:.95,min:.2},r_cx:os.lr[4],angle:os.lr[0],num:os.lr[1],dist:{min:os.lr[2],max:os.lr[3]}},m_r:{name:"m_r",on:!1,segment_cx:{max:.95,min:.3},r_cx:os.r[3],dir:e([!0,!1]),angle:os.r[0],num:os.r[1],dist:os.r[2],rotateAround:os.r[4]},m_e:{name:"m_e",on:!1,chance:.5,segment_cx:{max:.8,min:.2},exp_ch:os.e[2],dist:os.e[0],num:os.e[1],from:{x:r(.3*sz.nw,.7*sz.nw),y:r(.3*sz.nh,.7*sz.nh)}},m_m:{name:"m_m",on:!1,chance:.4,segment_cx:{max:.9,min:.3},num:1},m_xr:{segment_cx:{max:.9,min:1.6},num:{val:0,min:os.xr[0],max:os.xr[1]},angle:os.xr[2],angleStart:os.xr[3],expand:os.xr[4],exr_ch:os.xr[5],dir:e([-1,1]),from:{x:r(.4*sz.nw,.6*sz.nw),y:r(.4*sz.nh,.6*sz.nh)}}},ms.options=["m_r","m_e","m_m","m_lr"];let s=dcx(ms.options,ms.num),t=360/ms.num,n=r(360),i=0;for(let r of s){ms[r].on=!0;let s=(i*t+n)%360;ms[r].point=cpv(sx.cr,s,.3*sz.dim),ms[r].range=650,1==ms.num&&(ms[r].point=cpv(sx.cr,s,.2*sz.dim),ms[r].range=e([600,950,1200])),i++}if(ms.m_xr.on=!1,ms.m_xr.point=cpv(sx.cr,r(360),.2*sz.dim),ms.m_xr.range=1200,ms.m_xr.angle*=ms.m_xr.dir,ms.m_xr.angleStart*=ms.m_xr.dir,ms.m_xr.dir=e([!0,!1]),(sx.nd.num<30||"r"==sx.nd.l)&&(ms.c.num=min(ms.c.num,1)),"r"==sx.nd.l&&"l"==sx.nd_r.type&&(ms.c.num=0),0==ms.c.num&&(ms.c.on=!1),r()<ms.ol.cx&&(ms.ol.on=!0),r()<ms.m_s.cx&&(ms.m_s.on=!0),ms.ol.on&&ms.m_s.on&&(ms.m_s.on=!1),ms.m_m.on){let s=ga(sx.cr,ms.m_m.point);ms.m_m.mp={p0:cpv(sx.cr,s,3e3),p1:cpv(sx.cr,s+180,3e3),angle:s}}let o=max(Math.floor(.4*sx.sg.num),50);o=e([o,o,o,o,o,0,3,10,400]),sx.sg.iclsh=w([[0,5],[1,8],[2,3],[5,1],[300,1]]),"g"===sx.nd.l&&3===sx.nd_g.cols&&(o=max(3,o),sx.sg.iclsh=max(2,sx.sg.iclsh)),0===o&&(sx.sg.iclsh=1),sx.sg.clsh={pt:{a:o,f:0,r:["pt","opt"]},lisc:{a:3*o,f:0,r:["lisc"]},li:{a:o,f:0,r:["l","ol"]}},sx.p.blendChoices=[[BLEND,sx.p.bc[0]],[MULTIPLY,sx.p.bc[1]],[SCREEN,sx.p.bc[2]]];let l=[sx.p.z[0]-25,sx.p.z[1]-25],c=[sx.p.z[0]+25,sx.p.z[1]+25],d=map(sz.w,steps[sz.noiseSize-1],steps[sz.noiseSize],0,1);sx.p.z[0]=map(d,0,1,l[0],c[0]),sx.p.z[1]=map(d,0,1,l[1],c[1])}function logData(){if(!logged){logged=!0;let s=0,e=0;for(let t of os.sg.rcn)1==t[0]&&(s+=t[1]),e+=t[1];let t=s/e*100;console.log("loaded in: "+nf((millis()-loadTime)/1e3,0,3)+" seconds"),console.log(f),console.log(os),console.log(sx),console.log(ms),console.log("--------"),console.log("Palette: "+sx.p.n),console.log("Node Layout: "+sx.nd.l),console.log("Rounded Chance: "+t),console.log("mirror "+ms.m_m.on),console.log("expand "+ms.m_e.on),console.log("localRotate "+ms.m_lr.on),console.log("global rotate "+ms.m_r.on),console.log("outlines "+ms.ol.on),console.log("strokes "+ms.m_s.on),console.log("extra spin "+sx.em),console.log("Noise size "+sz.noiseSize)}}class Segment{constructor(s,t,n){this.cn=[],this.ex=[],this.dex={},this.t=t,this.i=n,this.cn_n=sx.sg.cn_n(),this.cn_n=int(min(this.cn_n,s.length-e([1,2,3]))),this.feat=!1,this.rv={j:int(r(1e3)),k:int(r(1e3))},"s"==t?this.chcn(s):this.chcc(s),this.fd(),this.oc(),"c"==t&&this.ficc(),this.fv()}chcc(s){let t=e(s);this.cn[0]={pos:t.pos,index:t.index},this.dig=w([[300,1],[r(300,400),8],[500,1]]);let n=[],i=0;for(let e of s)e.index!=t.index&&n.push({d:abs(this.dig-dt(e.pos,this.cn[0].pos)),i:i}),i++;n.sort(((s,e)=>s.d-e.d)),this.cn[1]={pos:s[n[0].i].pos,index:s[n[0].i].index},this.orcn=[this.cn[0].pos,this.cn[1].pos],this.dia=dt(this.cn[0].pos,this.cn[1].pos),this.gD=this.dia,this.rad=.5*this.dia,this.pi_n=0}ficc(){let s=w([[[.8,60],9],[[1.2,120],2],[[.6,200],3],1]),e=ga(this.cr,this.cn[0].pos),t=(ga(this.cr,this.cn[1].pos),100);for(let n=1;n<200;n++){let i=1.8*n+e,r=cpv(this.cr,i,s[0]),o=min(min(abs(0-n),abs(t-n)),abs(200-n)),l=map(o,0,50,0,1),c=map(noise(r.x,r.y),0,1,.5*-s[1],s[1])*l;this.dig<200?c/=2:this.dig<300&&(c/=1.5);let d=this.rad+c,a={pos:cpv(this.cr,i,d),index:"invented"};n<t?this.cn.splice(this.cn.length-1,0,a):n>t&&this.cn.push(a)}this.fd()}chcn(s){let t=[];for(let e of s)e.iis||e.insideCircle||t.push(e);t=shar(t),t.sort(((s,e)=>s.uac-e.uac));let n=min(max(3,.1*t.length),t.length);t.length<1&&(t=s);let i=int(r(n));this.cn[0]={pos:t[i].pos,index:t[i].index},"c"==sx.sg.szl?this.gd=e(os.sg.dist):"v"==sx.sg.szl?this.gd=map(t[i].pos.y,0,sz.nh,10,400):"l"==sx.sg.szl?this.gd=map(t[i].pos.x,0,sz.nw,10,400):this.gd=map(t[i].pos.x,sz.nw,0,10,400);let o=[];for(let e of s)e.index==this.cn[0].index||e.insideCircle||o.push({d:int(dt(e.pos,this.cn[0].pos)),i:e.index});for(let s of o)s.diff=abs(s.d-this.gd);o.sort(((s,e)=>s.diff-e.diff)),o[0].diff>20&&(this.tooFar=!0);let l=0;for(let t=1;t<this.cn_n;t++)this.cn[t]={pos:s[o[l].i].pos,index:s[o[l].i].index,dist:o[l].diff},l=(l+e([1]))%(o.length-1)}rcn(){this.rounded=w(os.sg.rcn),"c"==this.t&&(this.rounded=!1),this.rounded&&(this.unrcn=this.cn,this.cn=rp(this.cn,6))}cx_col(){"c"==this.t?this.colset=e(sx.p.sg):this.colset=sx.p.sg[this.i%sx.p.sg.length],this.ecolset=[this.colset[0],this.colset[1]];let s=e(sx.p.st);this.stroke={col:color(e(s)),weight:map(this.avr,20,150,ms.m_s.weight.min,ms.m_s.weight.max,!0),do:!1},r()<ms.m_s.scx&&(this.stroke.do=!0),this.bm=w(sx.p.blendChoices),this.alpha=sx.p.sga(),this.gt=lsd,"c"==this.t&&(this.gt=rsd)}featColor(s,e,t){return!(dt(this.cr,sx.cr)>300&&t<30)&&(this.avr>s&&this.avr<e?("function"==typeof sx.p.feat?this.colset=sx.p.feat():this.colset=sx.p.feat,this.bm=BLEND,this.alpha=r(75,90),this.feat=!0,!0):t>60)}fd(){let s=gDims(this.cn);this.cr=s.cr,this.shs=s.shs,this.mt=s.mt,this.dims=s.dims,this.avr=s.avr,this.ncr=s.ncr}oc(){for(let s of this.cn)s.angle=ga(this.cr,s.pos);this.cn.sort(((s,e)=>s.angle-e.angle))}ntun(s){for(let e of this.cn)for(let t of s)e.index==t.index&&(t.uac++,e.iis&&(t.iis=!0))}angV(){return angV(this.cn)}fv(){this.path=new Path2D,this.cn.forEach(((s,e)=>{this.path[0===e?"moveTo":"lineTo"](s.pos.x,s.pos.y)}))}lnsi(s){this.clsh.lisc=[];for(let e of this.overlap){let t=s[e];for(let s of this.lns)(t.itln(s)||t.cpt(s.pCenter))&&this.clsh.lisc.push(t.i)}return this.clsh.lisc=[...new Set(this.clsh.lisc)],!(this.clsh.lisc.length>0)}ptlnv(s){for(let e of this.overlap){let t=s[e];for(let s of t.cn)this.cpt(s.pos)&&!this.ipt(s)&&this.clsh.opt.push(t.i);for(let s of this.cn)t.cpt(s.pos)&&!t.ipt(s)&&(s.iis=!0,this.clsh.pt.push(t.i));for(let s of t.lns)this.cpt(s.pCenter)&&this.clsh.ol.push(t.i);for(let s of this.lns)t.cpt(s.pCenter)&&this.clsh.l.push(t.i)}for(let s in this.clsh)this.clsh[s]=[...new Set(this.clsh[s])];for(let s in this.clsh)if(s.length>0)return!1;return!0}isOvl(s){this.overlap=[];for(let e of s)if(overlap(this.mt,e.mt)){this.overlap.push(e.i);let s=0;for(let t of this.cn){if(!e.ipt(t))break;s++}if(s==this.cn.length)return!0}return!1}itlnCon(s){for(let e of this.lns)if(isct(s.p0,s.p1,e.p0,e.p1))return!0;return!1}itln(s){for(let e of this.lns)if(s.p0id==e.p0id||s.p0id==e.p1id||s.p1id==e.p0id||s.p1id==e.p1id);else if(ptap(e,s.p0));else if(ptap(e,s.p1));else if(isct(s.p0,s.p1,e.p0,e.p1))return!0;return!1}cpt(s){for(let e of this.lns)if(ptap(e,s))return!1;return drawingContext.isPointInPath(this.path,s.x,s.y)}ipt(s){for(let e of this.cn)if(s.index==e.index)return!0;return!1}isV(s,e){if(this.clsh={opt:[],pt:[],ol:[],l:[],lisc:[]},this.lns=c_ln(this.cn),"g"!==sx.nd.l&&this.tooFar)return!1;if("c"===this.t)return!0;if(!this.angV())return!1;if(this.isOvl(s))return!1;if(!this.ptlnv(s,this)&&(sx.sg.clsh.pt.f+=this.clsh.pt.length,sx.sg.clsh.pt.f+=this.clsh.opt.length,sx.sg.clsh.li.f+=this.clsh.ol.length,sx.sg.clsh.li.f+=this.clsh.l.length,sx.sg.clsh.pt.f>sx.sg.clsh.pt.a||sx.sg.clsh.li.f>sx.sg.clsh.li.a))return!1;if(!this.lnsi(s)&&(sx.sg.clsh.lisc.f+=this.clsh.lisc.length,sx.sg.clsh.lisc.f>sx.sg.clsh.lisc.a))return!1;for(let s in this.clsh)if(this.clsh[s].length>sx.sg.iclsh)return!1;return!0}ntV(s){for(let s in sx.sg.clsh)for(let e of sx.sg.clsh[s].r)sx.sg.clsh[s].f-=this.clsh[e].length;for(let e of this.cn)s[e.index].failedUses++}ex_cx(s){let e=dt(this.cr,ms[s].point),t=map(e,200,ms[s].range,ms[s].segment_cx.max,ms[s].segment_cx.min);if("m_m"==s)for(let s in this.clsh)this.clsh[s].length>1&&(t=0);this.dex[s]={on:!1,done:0},r()<t&&(this.dex[s].on=!0)}ctex(s){let t={cn:[],t:s,col:color(e(this.ecolset)),blendMode:w([[BLEND,sx.p.bce[0]],[MULTIPLY,sx.p.bce[1]],[SCREEN,sx.p.bce[2]]]),alpha:sx.p.exa(),stroke:!1};"m_m"==s&&(r()<ms.m_s.extraChance&&(t.stroke=!0),t.alpha=sx.p.sga()),"m_xr"==s&&(t.alpha*=os.xr[6]),t.cn=this[s](),this.dex[s].done++,t.cn.length>0&&this.ex.push(t)}m_xr(){let s=[];if(r()<ms.m_xr.exr_ch){let e=ga(ms.m_xr.from,this.cr),t=dt(this.cr,ms.m_xr.from),n=ms.m_xr.angle*this.dex.m_xr.done+ms.m_xr.angleStart;"r"==sx.nd.l&&"l"!=sx.nd_r.type?(n=0,t+=15*this.dex.m_xr.done):t+=2*this.dex.m_xr.done,e+=n,ms.m_xr.dir&&(e*=-1);let i=cpv(ms.m_xr.from,e,t),r=ms.m_xr.expand*this.dex.m_xr.done+ms.m_xr.expand;for(let e of this.cn){let t=ga(this.cr,e.pos),n=dt(this.cr,e.pos)+r;s.push({pos:cpv(i,t,n)})}}return s}m_lr(){this.m_lrDist||(this.m_lrDist=map(this.avr,50,400,ms.m_lr.dist.min,ms.m_lr.dist.max,!0),"c"==this.t&&(this.m_lrDist*=.4));let s=[];if(r()<ms.m_lr.r_cx){let e=ms.m_lr.angle*this.dex.m_lr.done+ms.m_lr.angle,t=this.m_lrDist*this.dex.m_lr.done+this.m_lrDist;for(let n of this.cn){let i=ga(this.cr,n.pos)+e,r=dt(this.cr,n.pos)+t;s.push({pos:cpv(this.cr,i,r)})}}return s}m_r(){if(!this.rang){let s=dt(this.cr,ms.m_r.rotateAround);this.rang=map(s,0,400,ms.m_r.angle,.5*ms.m_r.angle,!0)}let s=[];if(r(0,1)<ms.m_r.r_cx){let e=this.rang*this.dex.m_r.done+this.rang;ms.m_r.dir&&(e*=-1);let t=ms.m_r.dist*this.dex.m_r.done;for(let n of this.cn){let i=ga(ms.m_r.rotateAround,n.pos)+e,r=dt(ms.m_r.rotateAround,n.pos)+t;i||(i=180,r=.01),s.push({pos:cpv(ms.m_r.rotateAround,i,r)})}}else this.dex.m_r.num=9999;return s}m_e(){let s=[];if(r()<ms.m_e.exp_ch){let e=ms.m_e.dist*this.dex.m_e.done+ms.m_e.dist;e*=map(dt(this.cr,ms.m_e.from),0,800,.6,1);for(let t of this.cn){let n=ga(ms.m_e.from,t.pos),i=dt(ms.m_e.from,t.pos)+e;s.push({pos:cpv(ms.m_e.from,n,i)})}}return s}m_m(){let s=[];if("g"===sx.nd.l)return this.m_m_grid();let e=270,t=[],n=0;for(let s of this.cn)t.push({a:s.angle,diff:angleDiff(e,s.angle),i:n}),n++;t.sort(((s,e)=>s.diff-e.diff)),e+=90;let i=this.cn[t[0].i];for(let t of this.cn){let n=dt(i.pos,t.pos);if(n<.001)s.push({pos:t.pos});else{let r,o=ga(i.pos,t.pos);r=o>180?e+angleDiff(e,o):e-angleDiff(e,o),s.push({pos:cpv(i.pos,r,n)})}}return s}m_m_grid(){let s=[],e=int(r(this.cn.length)),t=(e+1)%this.cn.length,n=this.cn[e],i=this.cn[t],o=(ma(n.pos,i.pos),ga(n.pos,i.pos));for(let e of this.cn){let t=dt(n.pos,e.pos),r=dt(i.pos,e.pos);if(t<.1||r<.1)s.push({pos:e.pos});else{let i=o-angleDiff(o,ga(n.pos,e.pos));s.push({pos:cpv(n.pos,i,t)})}}return s}ol(){this.dool=!0,ms.ol.done>=os.ol[5]&&(this.dool=!1),r()>ms.ol.seg_cx&&(this.dool=!1),this.clsh.lisc.length>0&&r()<.4&&(this.dool=!1),this.clsh.lisc.length>1&&r()<.7&&(this.dool=!1),this.clsh.pt.length>0&&r()<.9&&(this.dool=!1),this.avr<30&&(this.dool=!1),"c"==this.t&&(this.dool=!1),this.dool&&(ms.ol.done++,this.unrcn||(this.unrcn=this.cn),this.ols=new Outline(this.unrcn,this.cr,this.avl,this.i))}d_ol(){this.dool&&this.ols.display()}d_ex(){let s=0;for(let e of this.ex){blendMode(e.blendMode);let t=e.alpha;this.ex.length>8?t*=map(s,0,this.ex.length,1,.3,!0):this.ex.length>1&&(t*=map(s,0,this.ex.length,1,.6,!0)),fill(setCol(e.col,t)),noStroke(),beginShape();for(let s of e.cn)vertex(s.pos.x,s.pos.y);endShape(CLOSE),s++}}d_ts(){t_c.fill(0,0,0),t_c.beginShape();for(let s of this.cn)t_c.vertex(s.pos.x,s.pos.y);t_c.endShape();for(let s of this.ex){t_c.beginShape();for(let e of s.cn)t_c.vertex(e.pos.x,e.pos.y);t_c.endShape()}}display(){t_g.shader(this.gt);let s=ceil(this.dims.lgs*sz.f.x),e=s;t_g.resizeCanvas(s,e),c_2.resizeCanvas(s,e),rndTx.resizeCanvas(s,e),resetRndTx(this.rv.j,this.rv.k,!0),this.gt.setUniform("u_t",rndTx),this.gt.setUniform("u_r",[s,e]),this.gt.setUniform("u_c1",hexToRGB(this.colset[0])),this.gt.setUniform("u_c2",hexToRGB(this.colset[1])),this.gt.setUniform("u_cn1",hexToRGB(this.colset[2])),this.colset[3]?this.gt.setUniform("u_cn2",hexToRGB(this.colset[3])):this.gt.setUniform("u_cn2",hexToRGB(this.colset[2])),this.gt.setUniform("u_rs",.45),this.gt.setUniform("u_a",sx.gAng),t_g.rect(0,0,s,e),ctx.globalCompositeOperation="source-over",c_2.image(t_g,0,0),ctx.globalCompositeOperation="destination-in",c_2.push(),c_2.fill(0,0,0),c_2.translate(-this.mt.l*sz.f.x,-this.mt.t*sz.f.y),c_2.beginShape();for(let s of this.cn)c_2.vertex(s.pos.x*sz.f.x,s.pos.y*sz.f.x);c_2.endShape(),c_2.pop(),push(),blendMode(this.bm),tint(0,0,100,this.alpha),image(c_2,Math.round(this.mt.l*sz.f.x),Math.round(this.mt.t*sz.f.x)),pop(),t_g.clear(),c_2.clear(),rndTx.clear()}d_st(){if(this.stroke.do){push(),strokeJoin(ROUND),noFill(),blendMode(BLEND),strokeWeight(max(.1,this.stroke.weight*sz.f.x)),stroke(setCol(this.stroke.col,100)),beginShape();for(let s of this.cn)vertex(s.pos.x*sz.f.x,s.pos.y*sz.f.x);endShape(CLOSE),pop()}}}
“Life will be lived all the better if it has no meaning” - Albert Camus
Optimistic nihilism embraces the idea that life's inherent meaninglessness is, in fact, positive. The conflict between intrinsic meaninglessness and our search for meaning is both absurd and liberating. We are free to create our own meaning yet ultimately, there is none. By acknowledging both the futility and the opportunity, we can find joy.
These images have no specific meaning yet often they seem purposed. Each output evokes an emotional tone, such as calm, erratic, troubled, bold, mysterious or cheerful. We are frequently reminded of something or can identify shapes like birds, houses or spaceships. Our innate tendency to find patterns and meaning is evident.
The algorithm uses geometry and rules but has been given as much freedom as possible to create varied compositions which contain both chaos and order. The compositions are constructed using node layouts, which are connected to form shapes. Connection is a recurrent theme in our pursuit of meaning - manifested in pattern formation, our relationships and the interconnectedness of the universe. The shapes are duplicated and modified through rotation, mirroring, and scaling to build up structure and chaotic form. If an output appears too sparse, an extra stage of manipulation is applied. Keypresses reveal the components, allowing viewers to observe the underlying mathematical structure of the composition. How does this insight influence our perception of meaning?
The meaning communicated by each piece is subjective, shaped by the viewer's own experiences interacting with the work. The artist aspires to connect with her audience by discovering the meanings they derive from the outputs we have yet to encounter.
Toggle components -
1 - Nodes
2 - Shapes
3 - Extras
4 - Strokes or Outlines (if present)
5 - Border
r - Return to full piece
s - Save 2000px wide image
p - Save 5000px wide image