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

 

I found Casey Reas’s talk on randomness and its role in computer programming and generative art to be incredibly captivating and thought-provoking. At first, I was hesitant about the length of the video, but as I started watching, time flew by, and I became deeply reflective of his ideas.

Reas begins by discussing the idea that artists bring order to the chaos of nature. While this statement initially puzzled me, I realized that it highlights the artist’s role in organizing and interpreting the world around them, rather than implying that nature is purely chaotic. It led me to think about how art connects with nature.

One of the key takeaways for me was the concept of “noise” or controlled randomness. Reas’s demonstration of adding noise to a set of lines converging on a target was illuminating. Without noise, the lines would form a perfect circle, but with it, each line took a unique and unpredictable path to reach the target. This demonstrated how randomness can introduce individuality and complexity into art, making it more compelling and engaging.

The personal reflection on the presentation resonated with me, particularly the idea that randomness adds an element of surprise and intrigue to art. It reminded me that not everything needs to be meticulously planned and that embracing controlled randomness can lead to more dynamic and captivating creative outcomes.The reflection also raised thought-provoking questions about the line between order and chaos in art. Where should the boundary be drawn, and how do individual perceptions influence this distinction? 

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)

Reading Reflection 2, Casey Reas:

Response:

One thing that caught my attention during the speech was the idea that embracing chance can lead to novel and unexpected outcomes in art and design. By introducing elements of randomness into the creative process, artists and designers can break away from the constraints of their own preconceived notions and habits, allowing for the emergence of truly unique and innovative works. This notion challenges the traditional idea of the artist as a deliberate and controlled creator, highlighting the beauty and potential of spontaneity.

However, even with this, I personally felt that the artwork as it may seem uncontrolled, actually is controlled on a large scale or a micro-scale. The use of algorithms to program art introduces randomness in a controlled manner, providing artists with structured ways to explore chance operations. This approach not only encourages experimentation but also raises questions about the relationship between human intention and the role of code in shaping creative outcomes.

The use of randomness in a controlled manner encourages artists and designers to embrace chance as a source of inspiration and innovation, and it challenges us to explore the boundaries between intention and serendipity in our work.

Week 2 – Assignment – Geometric Panels

The assignment for this week was to use concepts of conditional statements and loops to produce a simple work of art. I initially decided to build upon the example of nested loops discussed in class to create an illusion using squares. This includes three nested ‘for’ loops for the pattern to repeat along the x and y coordinates and result in the decreasing size of the squares. To make it more visually appealing, the random function has been used within fill() creating a colorful effect.

https://editor.p5js.org/rujulm/sketches/K0Ubc62Yn

I decided to further explore the functions with something more challenging. This is when I thought of trying to replicate the design of the geometric panels of the Al Bahar Towers in Abu Dhabi. Built to combat the harsh weather in the UAE, these computerized panels are built with a technology that allows them to detect the position of the sun and open and close accordingly, thus reducing the amount of heat absorbed.


To create a similar geometric design, I began by sketching a pattern based on a 400×400 canvas size. This helped me estimate the coordinates to get the exact shape.


The entire design has been made using a combination of triangles of different sizes. I have used two separate nested loops to implement the inversion of the triangles.

for (let x=0 ; x<=width ; x+=100){
    fill(209,192,20,mouseX);
    
    for (let y=100 ; y<=height ; y+=100)
      //The if condition is used to alter the coordinates of the triangles depending on the row
      
      if (y==100 || y==300){ //executes for first and third row
        triangle(x-50,y,x,y-100,x,y-30);
        triangle(x+50,y,x,y-100,x,y-30);
        triangle(x-50,y,x,y-30,x+50,y);
      } else { //executes for second and fourth row
        triangle(x,y,x+50,y-100,x+50,y-30);
        triangle(x+100,y,x+50,y-100,x+50,y-30);
        triangle(x,y,x+50,y-30,x+100,y);
      }
  }
  
//The second for loop given below works exactly like the first one and has been used to create the inverted triangles
  
  for (let x=0 ; x<=width ; x+=100){
    fill(205,175,64,mouseX);
    
    for (let y=100 ; y<=height ; y+=100)
      if (y==100 || y==300){
        triangle(x+50,y,x,y-100,x+50,y-70);
        triangle(x+50,y,x+100,y-100,x+50,y-70);
        triangle(x,y-100,x+50,y-70,x+100,y-100);
      } else {
        triangle(x,y,x-50,y-100,x,y-70);
        triangle(x,y,x+50,y-100,x,y-70);
        triangle(x-50,y-100,x,y-70,x+50,y-100);
      }
  }

To make it more realistic, I wanted to include both the closed and open images of the panels. I have done this using the built-in Boolean variable mouseIsPressed, such that when the mouse is clicked a different view of the building is visible, as would be seen once the sun sets. I have also used the mouseX variable to change the opacity of the triangles, giving the panels a glistening effect.

I thoroughly enjoyed doing this assignment and feel that I have achieved what I had initially imagined. Reflecting on the possible improvements, I want to discover new ways to include more interactivity such that the user can choose the panels to be closed using the movement of the mouse.

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.

Assignment 2: The Moving dot

Concept:

When I saw animation and art I thought of how a point from a pen-ball or a dot from the tip of a brush can be manipulated to create beautiful artworks so I decided to recreate this.

Highlight:

Deciding on the artwork was challenging until I thought of my name. I don’t know where I would end with this brush tip but I would love for my first work of art to be my name. I decided to create a kind of intro to my first assignment using this idea.

Every artwork is made of lines and curves so I had to discover how to use my brush tip to create these. The line creation was very simple but the curves was a challenge. Initially I was thinking of just drawing curves as a whole using the arc function but then that would mean I am going against my words to use the brush tip idea. 

After watching some videos (https://youtu.be/uRd5iKBpsUA?si=4025fr-zmeL18zha) I was able to find a way to make this possible. This part of the art is what took most of my time. After getting these, I started to draw. 

if(r4==true){
     a=220+sin(angle3)*55;
     b=290+cos(angle3)*80;
     circle(a,b,10);
     angle3+=speed;
     if(a<225){
       r4=false;
     }

 

The most challenging part of my work was joining a line and curve as I had to calculate the angle but this made me appreciate my work the more because, a slight change in the angle ruins the whole piece. 

Art:

At the end of the intro I just decided to add my portrait but spice it up a bit by adding some form of simple animation.

Reflection and Ideas for Future Work:

After completing my first artwork, I plan to draw something else using my brush tip . I hope to find better was of drawing curves such that slight change in angle will not affect my work and maybe add the element of randomness to see the unique arts that will be created by the computer.