80s Disco Dance Floor

Concept

When I started out I had absolutely no idea what I wanted to do and just kept browsing in a rabbit whole of links till I found the holy grail, a website with tons of examples done by students that had their code attached to them in order to understand the how of every part of their code (https://openprocessing.org/). That’s when the current idea hit me, 80s Disco Dance Floor, an interactive and dynamic representation of what I see the funnest most alive era to be like.

Highlight of my code

let circleRadius;
let squareColors = [];

function setup() {
  createCanvas(400, 400);
  circleRadius = width / 2;

  // Initialize square colors with some transparency 
  for (let i = 0; i < width / 20; i++) {
    squareColors[i] = [];
    for (let j = 0; j < height / 20; j++) {
      squareColors[i][j] = color(random(255), random(255), random(255), 150);
    }
  }
}

function draw() {
  background(255);

  // Dynamic concentric circles based on mouse position, which changes the radius of the first one based on the position of mouseX
  strokeWeight(2);
  for (let r = 30; r < circleRadius; r += 30) {
    ellipse(width / 2, height / 2, r * 2);
  }
  circleRadius = map(mouseX, 0, width, 70, width / 2);

  // Drawing a grid of squares and calculate the distance between the center of the current square and the center of the canvas.
  for (let i = 0; i < width; i += 20) {
    for (let j = 0; j < height; j += 20) {
      let d = dist(i + 10, j + 10, width / 2, height / 2);
      if (d < circleRadius) {
        fill(squareColors[i / 20][j / 20]);
      } else {
        fill(150, 150, 220, 150);
      }
      rect(i, j, 20, 20);
    }
  }
}

 

Honestly, I’m proud of the entire thing because it took a ton of trial and error to get the initial idea through but in the end I love what I came up with as a compromise I made with myself since I started of wanting to create a turning disco ball but after a ton of trial and error I just was not able to figure it out and went with the next best thing about the 80s, the colors and life of the dance floor itself. To create the “dance floor” I created a global variable to store the colors of the each squares then I used a nested loop to generate random colors for each of the dance floor tiles, and then added another loop in the draw function to make several squares in order to have a proper dance floor.

After the base was done, my initial idea was to have a mouseClicked function that would just make the colors change each time the mouse is clicked but found it not to be an accurate representation of the 80s vibe I was going for. So after thinking about it, I decided to give the disco ball another try but with a different approach and in the end I got the idea to make the disco “ball” several circles that as you moved you mouse across the drawing would keep getting bigger and bringing life to the dance floor with it just like real disco balls do. To do that I added a new global variable for the radius of the circle then set it to be half the width of the canvas. After that I created a loop to draw the concentric circles with randomized colors, drawn all from the same center of the canvas, and with a distance of 30 pixels between each. After that to make it come to life, I added a map function to follow the mouseX value width range to make it the circles “grow” to where the mouse is. So basically the further the user goes from left to the right the wider and more circles there are and eventually fill up the entire canvas. Then I added a conditional to the previous for loop I made that draws the squares to use the distance function to check whether or not the center of each square is inside the current circle radius then if it is then it would color the tile a random color stored in the squareColor variable if not then it would get the default color, lavender.

 

Future ideas:

I still would love to find out how to make the disco ball of my dreams since a part of me still feels disappointed that it didn’t work out so I will keep going with my research and experiments and see if I can figure it out to put my mind at ease. Other than that I also want to add audio to it to bring it closer to the 80s disco vibe I was aiming for.

References:

I mainly browsed through the OpenProcesing website for ideas and how people did things using the keyword search option to get inspired but other than that I also used the reference page from P5.js along with class and past knowledge.

How to make most of the OpenProcesing website:

Step one: scroll till you see the following image then click on the tiny “See all” on the bottom right of it

Step 2: Write anything you are looking for in the key word section and filter to however long ago you would like

ex: I wanted to check out mouse position examples and how to implement them so I wrote “mouse” in the keyword spot and it gave me all of the examples that used such technique.

 

Week 2 – Reading Reflection

After watching the video, I started researching a little about the concept of “chaos” and “randomness”. There is something very powerful, even ironic behind the idea of wanting to create something that drifts apart from the author’s will. Moreover, utilizing an element such as computer processing, which relies completely upon rational decisions and binaries, is especially interesting. There are no middle points in the computer’s processing, and yet artists manage to create such varied art through chance operations.

Now, all this makes me think more about the fact that we managed to create a “chaos” formed entirely from a controlled, non-stochastic environment. Therefore, can we really say it is “true chaos”? Same happens with “true randomness”(see reference) The existence of “controlled chaos” could be a point that more artists explore and think about. William Paley, in his book Natural Theology: or, Evidences of the Existence and Attributes of the Deity, Collected from the Appearances of Nature, said: “Chance seems to be only a term, by which we express our ignorance of the cause of anything“. Maybe the key does not rely on trying to create “real chaos” or “real randomness”, but rather, being able to constantly create things that do not align necessarily with our own thoughts, but instead create an entirely new thought from that “randomness” and that “chaos” we have created earlier.

Reference:

Does True Randomness Exist? –  https://medium.com/illumination/does-true-randomness-exist-5d2fc7f413dd

Week 2 – Natural Movement Among Chaos

Concept: Natural Movement Among Chaos:

This week, I intended to work on a piece that would make the most out of simulated natural movement with noise() and the random() function. To do so, I inspired myself to do something related to space after playing Starfield, an action videogame with a space theme. I experimented using new ways of portraying my shapes, such as vertex(), curveVertex(), and trigonometric functions. The movement of the Spaceship is completely dependent on the noise() function, both on the x-axis and the y-axis, while the star position in the x-axis is randomized by the random() function. The stars in the background also appear in a random sequence. They are placed one by one in a “for” loop, and the amount of stars that appear per frame is also varied.

Code Highlights:

I am personally proud of the application of the noise function. The movement of the spaceship looks just like a natural turbulent run through the space. Also, it is my first time working with the beginShape() function, which allows to “record” vertices and make them a whole drawing.

 //NOISE
xoff = xoff + 0.01;
let n = noise(xoff) * width;
let j = 400;


//STARSHIP
beginShape();//<---- TOP
fill(205,60,60);
curveVertex(n+15, j-30);
curveVertex(n+15, j-30); 
curveVertex(n, j-50);
curveVertex(n-15, j-30);
curveVertex(n-15, j-30);
endShape();
//-----------
fill(220);//<---BODY
rectMode(CENTER);
rect (n,j,30,60);
fill(0);
ellipse (n,j-15,15,15);
fill(205,60,60);
ellipse (n,j-15,10,10);
fill(250,150,10);//<-----FIRE
triangle(n-15,j+35,n-20,j+50,n-5,j+35);
triangle(n+15,j+35,n+20,j+50,n+5,j+35)

Reflections and Improvements:

Initially trying with more realistic drawing, I have come to realize utilizing P5JS for that purpose would be some sort of “golden hammer problem” (see reference for explanation), where I would try to use this one tool to experiment on all art styles. Instead of forcing this tool on an art style it is not made for, I decided to improve my shapes and the details of my shape drawings.

For next time, I would like to improve my art style by exploring more abstract expressions instead of things that exist in real life. It is okay to portray objects and people, but my thoughts go beyond material subjects, and I would like to include more of them in my projects.

References and inspirations:

Randomness: https://medium.com/re-write/randomness-in-p5js-ed152d93cd26

Shooting Stars: https://codepen.io/acekreations/full/pYQOxP

Golden Hammer: https://en.wikipedia.org/wiki/Law_of_the_instrument

Week 2 – Reading Reflection

The lecture by Casey Reas on Chance Operations was a fascinating look at randomness, and the dynamics between chaos and order. Being a Computer Science major, most code I write is defined by rigid precision. Even areas such as web development which allow some artistic precision, allow this only within set boundaries. The first two weeks of this course have already opened me up to the idea of using code for artistic expression – this video only added to this.

My favorite sections of the videos were the demonstrations where persistent chaos would give way to some sort of symmetry and order. The best example of this would be the “Fractal Invaders” example where, random pixels and some duplication can lead our imagination to see characters and objects.

Having explored principles of Taoism through some of my Philosophy coursework, I have read about how concepts such as order and chaos don’t have to conflict, but can rather enhance each other. I can see this principle floating through the talk, and I hope to integrate this in my later projects through this course.

Moving on, Reas states in the video how “the idea of using a rational machine to do something unexpected at the time was a subversive one”. Here, by “at the time”, Reas refers to the period where computers were still severely limited in what they could do and were just starting to be widely used. However, I believe that this statement may be true even today. Most people choose to use their computers for tasks that are constrained and rigid. Tasks such as playing games, that are intended for recreational purposes, also don’t allow artistic expression which has even become a lot more accessible to everyone using the systems today. As such, I feel it is an avenue for self-exploration, discover, and fun that is overlooked by most people today. I would be highly interested in making a web tool that could enable people to play around with randomness and its accompanying mechanics without needing knowledge of code, but I assume this may be difficult due to the nature of art.

The last point I wanted to touch in this discussion is an emerging technology – and its relation to both art and randomness : Generate AI – specifically diffusion models. Having been interested in the technology powering the space – I know the role randomness plays in it. Having a different ‘seed'(a measure of randomness) with the same ‘prompt'(the input given to the AI) can result in artworks extremely different from one-another. Researchers and enthusiasts have been working constantly to traverse this randomness in an effective way to get the best possible results. But perhaps, there is beauty in this randomness too that has yet to be explored. (The discussion of the ethics of using such technologies is also equally important)

Assignment 2: Art Work

Concept

I had a hard time deciding what I wanted to create at first. Then, while I was listening to music, the idea struck me: why not make a sketch of a spinning CD while playing music in the background? I thought the fusion of auditory and visual elements would be an interesting challenge for this assignment.

Donald Glover served as the muse for this artwork, as it was his music I was listening to when the initial idea came to me, influencing my choice of song for this project.

Sketch

Code highlight
// colored lines to give the illusion of a cd
for (let angle = 0; angle < 360; angle += 2) {
  let x1 = centerX + cos(radians(angle + rotationAngle)) * (circleRadius - 20);
  let y1 = centerY + sin(radians(angle + rotationAngle)) * (circleRadius - 20);
  let x2 = centerX + cos(radians(angle + rotationAngle)) * 150;
  let y2 = centerY + sin(radians(angle + rotationAngle)) * 150;

  let randomColor = color(random(100, 255), random(100, 255), random(100, 255), 150);
  stroke(randomColor);

  strokeWeight(7);
  line(x1, y1, x2, y2);
}

I found this bit particularly challenging as I had a hard time trying to figure out how to give the illusion of a spinning CD. I decided to create a series of lines that radiated from the circle in the center, incrementing the ‘angle’ variable from 0 to 360 in steps of 2 degrees to find the right angle for all the lines. For each angle, I calculated the coordinates (x1, y1) and (x2, y2) for the endpoints of the line. And to add an extra touch of realism, I decided to randomly generate different colors for the lines.

Reflection

I’m really pleased with how I was able to incorporate audio into my sketch; it added a dynamic and immersive element to the overall experience. Initially, my vision was for the CD to remain stationary until the user clicked on the screen, at which point it would start spinning. However, I was not very pleased with my implementation of applying a gradient color to the CD during its stationary phase. Therefore, I decided to make the CD spin continuously. This experience has underscored the importance of further refining my skills with gradient colors, as I believe it holds the potential to elevate my creations. Overall, I am very satisfied with how the final piece turned out.

References
  • https://www.youtube.com/watch?v=vwwRWCErx_Q
  • “Redbone” by Childish Gambino

Reading Reflection – Week 2

Written Response: Eyeo2012 – Casey Reas

After taking a first glance at the assigned reading, I was not too excited to watch a 40-minute presentation about something called “Chance Operations.” Nonetheless, I was thoroughly intrigued by the concepts Reas explained and demonstrated.

Prior to enrolling in this course, my exposure to computer-generated art and media was highly superficial, and when I thought of ‘computer graphics’ only things like CGI and 3D Models came to mind. I understood the basic concepts of randomness and the vital roles it played across all disciples, however, it has never crossed me that these concepts of randomness and noise could be used to create intricate and unique artworks through supposedly ‘simple’ code.

Another part of the presentation that surprised me was the close resemblance Reas’ work had to an artwork of my own:

Casey Reas’ Work
My work

Though the similarities are quite obvious, Reas’ artwork had been generated by code that he had written. Mine was created physically. It seems that at times, randomness and noise can often prevail in the physical and digital worlds of media, and I believe Casey Reas’ presentation exclusively demonstrates the latter. This was even more evident as shown through his project in collaboration CHRONOGRAPH with Tal Rosner, where they took hundreds of images, and randomly compiled them to create unique artworks. The applications went even further when Reas’ demonstrated the artwork he had created where he collaborated to create a visual representation of how certain proteins communicate. Ultimately, it can be said that randomness is not merely a concept that is useful for coding or creating media, but it is one which runs our lives down to the individual atoms and cells.

“LIFE” (Assignment 2)

CONCEPT

After my first Thursday lecture, I had a concept of the work I wanted to create. I thought it would be the most straightforward piece of art I would make. But it wasn’t until Saturday that I realized how wrong I was.

On Saturday, I had the pleasure of visiting the Arts Center performance called “NOWISWHENWEARE”. It made me think a lot about life and our purpose as humans in general. To make you more familiar with the concept of the installation, there were more than 3 thousand lights all forming different shapes in complete darkness, where you can’t even see a hand near your face. It feels like you are entering another dimension where you can explore a new fabric. Hundreds of lights surround you while you’re listening to the mysterious voice talk about the lives of human beings.

All of these things made me think about telling the story of a human being through a piece of art.

THE SKETCH & DESCRIPTION

The sphere in the middle symbolizes the mind, and the circles symbolize the events and things happening to us. The more experiences we have, the more the sphere grows. But as we experience more and more new things, our sphere has less and less room to grow as most of the concepts seen in everyday life become very familiar to us.

Furthermore, in my work, I wanted to combine either randomly created shapes or those that followed the order. Just like in our lives, there are things we have control over, but at the same time, there are things that are out of our control. Nevertheless, they are essential parts of our experience.

HIGHLIGHT OF THE CODE

function net () {
  
  translate(350, 350);
  noFill();
  stroke('white');   
  
  rotate(angle_n)
  angle_n = angle_n + 1;
  arc(random(420,500),random(-500,700),600,600,0,360); 
  arc(500,0,600,600,0,360); 

}

It may not look complicated, but it took me a while to understand how the rotate function works. And funnily enough, it was one of my failures when I created a net of randomly created arcs, which later helped me create this project.

Reflection

This project helped me create a piece of art I would never have thought of in the first place. Moreover, I noticed how much influence things we experience (in my case, the Arts Center installation) can have on the way we produce art. Maybe it gives us a lens to look through, or maybe it just becomes a source of inspiration.

This is my first assignment after joining the class, and I feel that there are lots of things for me to learn and explore, which will help create more and more sophisticated projects.

 

 

 

Reading Reflection _ Week#2

Casey Reas’s lecture brought many new perspectives to my thought process when it comes to creating art through technology. It made me wonder in what ways would it be helpful to humanity to create such art forms. What particularly drew my attention was the artwork inspired by Valentino Braitenberg’s book, as shared by Reas. While the core concept of this work isn’t within my primary focus, it serves as a significant part of my ongoing quest to uncover the potential intersections of science and interactive technology. This presentation left a lasting impression on me, fueling my enthusiasm to experiment further with the tools at my disposal. It offered valuable insights into the functioning of the nervous system, highlighting the intricate interplay between order and chance.

Reas’s discourse significantly reshaped my perspective on digital art. I used to believe that art required a profound underlying message or purpose, that artists should embark on their creative journey armed with a well-defined plan and a clear destination in mind. Now, I am inclined to see art as an entity that need not be burdened with the obligation of conveying a deeper meaning. This newfound perspective grants artists the freedom to explore novel artifacts and unconventional methods, allowing art to emerge organically and inviting diverse interpretations. I would be contradicting myself by saying art becomes a canvas for personal experiences and individual thoughts that reflect how each of us is uniquely wired to perceive things differently, because how authentic and personal are digital art works? And how much can we interpret if the art piece is too abstract and lacks symmetry?

This brings me to the discussion of Fractal invaders in Reas’s lecture. While the demonstration initially unfolds as a display of pure randomness, it gradually reveals elements of symmetry and duplication. These emerging images prompted our imaginations, compelling us to find meaning in what was unfolding before us. This particular instance is just one among many that reinforced my belief that certain art projects don’t necessarily rely on strict rationality. Even if a piece of art doesn’t lead us directly to a specific thought or idea, it challenges us to construct our own interpretations and derive meaning from it but that’s not always the case.

Furthermore, Reas’s presentation challenged me to delve deeper into the artist’s unique vision. However, to what extent does randomness with no vision can be considered art ? Some art works that are considered abstract or some works that accidentally became a piece of “art”, make me contemplate on whether or not generative art is considered as an art project created with intention and authenticity.

Week 2: Chaotic Spirals of Randomness

Concept and Approach:

I have always been fascinated by spirals. I remember books on ‘mental illusions’ that would often consist of spirals that looked procedurally generated, but could seemingly trick you into believing anything. My work for this week is inspired by such spirals – but I wanted to go beyond the procedurally generated symmetries and explore combining movement, elements of randomness, and interactivity with such spirals.

A mental illusion eliciting spiral.
My initial static spiral made of circles and squares

The code design and the movement itself were pretty simple. Early on, I decided to have my spirals be made of circles and squares that would move. Later, I would randomly vary whether the next generated shape was a circle or square, and the size/color of each circle/square. I used Perlin Noise for colors so they would change relatively smoothly. Later, I also added spirals to the four corners of my canvas and made their colors change based on mouse clicks.

Still, after all this, perhaps one of the best decisions I took was making sure I kept my editable parameters as global variables which could be changed easily. Once I had my spiral effect in place, I started tweaking the ‘distance’ and ‘increment’ variables that tweaked the shape of my spiral – and chanced upon an artwork which I found even more satisfying than my initial vision!

Before tweaking the parameters.

Highlights:

My favorite part of the code has to be the actual calculation for having the shapes move in a spiral. It’s actually based on simple math. To be precise, when covering an angle from 0 to  theta across a circle. The new coordinates will be center_x+radius*cos(theta), center_y-radius*sin(theta). Moreover, since it’s a spiral we also increase the radius constantly.

for (let i = 0; i < shapes.length; i++) {
    let shape = shapes[i];
    offset+=0.1
    let x = shape.r * cos(shape.theta);
    let y = shape.r * sin(shape.theta);
    fill(shape.redval,shape.greenval,shape.blueval)
    if (shape.isCircle) {
      ellipse(x, y, shape.size);
    } else {
      rect(x, y, shape.size, shape.size);
    }

    // Update position
    shape.theta += increment;
    shape.r += distance;
    shape.r+=noise(offset)*0.1;
  }

Reflections and Future Work:

I think this project has a lot of scope for improvement. Firstly, the actual code is just the same loops duplicated multiple times. The code thus lacks any sort of modularization. This can be improved relatively simply and will enhance the readability and editability of the code by several times.

Second, there are several other interactive elements that can be added to the project. For example, the loop may get tough to look at for a longer period of time – so, a mouse click may be used to stop all the motion.

Lastly, even though my theme for this week’s assignment was ‘chaos’ I believe I can still improve this project’s aesthetics significantly, if I spend more time with it!

Viruses are everywhere

Concept

As I was looking through the ProgrammInformation21_PI21, I came across this piece by Felder mit Strichkonzentrationen, which instantly reminded me of the bacteria that surround us.

I decided that I want my piece to represent the issue of the abundance of viruses that has been relevant for us since 2019. I wanted to show the random movement of viruses in the air that we breathe and the water that we drink and use every day. I believe that it is very important to be aware of this and never forget about our safety and the safety of others.

Approach and Code Highlight

I wanted to make a relatively minimalist artwork using simple shapes. I decided on one particular shape which is a circle and used it to represent viruses, air, and water molecules. As air and water are molecular structures I decided to show them in a grid form, by using nested for loops that we learned in class. For water molecules, I used the same method but changed the color, opacity, and the arrangement of circles next to each other, so they would overlap, creating a grid pattern with no negative space. For the background to change as I pressed the mouse, I used if statement with a variable mouseIsPressed and an else statement, so that the grid of white circles would show anytime I did not press the mouse.

To create viruses, and specifically to show their movement, I decided to try a new method of creating random circles on the canvas. To know more about it, I watched this video by The Coding Train. As it was hard for me to understand how to create for loops, I think this part of the code is great. I used random function and manipulated variables of the circle to place them randomly on the canvas. I also decided to write the code fully in function draw(), so it was possible to show the movement of the virus circles.

// randomly arranged overlapping green circles

  frameRate(8);

  for (let circles = 0; circles < 75; circles++) {
    let xPosition = random(width);
    let yPosition = random(height);
    let radius = random(1, 50);

    fill(133, 182, 27, 200);
    noStroke();
    circle(xPosition, yPosition, radius);
  }

Reflection and Future Thoughts

I am proud that I was able to understand how conditionals work, specifically the else statement, which in combination with both would help me change the background of the piece. This was one of the problems I encountered in my work. It took me some time to figure out the order of where to put a conditional and a loop. I need to look at more examples of codes to understand better how to combine them.

Nevertheless, for this homework, I achieved the goal I had set for myself with success. I was able to effectively represent my idea using the combination of both simple shapes and loops/conditionals. As I was trying to represent particles of air, water, and viruses on the 2D surface, I now think it would be very interesting to see how to create the same artwork in 3D space.