Category Archives: Creative Coding Lab

Project B: Sounds Familiar? – English in Shanghainese

Part 1

PROJECT DESCRIPTION

SOUNDS FAMILIAR? : ENGLISH IN SHANGHAINESE

by Jiasheng Li (Jason)

2023

Interactive Storytelling & Tool

link: https://jasonlee557.github.io/CCLab/project-b/

ELEVATOR PITCH

The project “Sounds Familiar?” uses an interactive story to engage the audience in the loanwords in Shanghainese from English. By exploring the story, the audience will have a general sense of Shanghainese words, take a quiz to check their learning outcome, and learn more in the dictionary. 

Abstract:

As a Shanghainese, I found out that a lot of peers cannot speak or forget Shanghainese after going to school due to the requirement of a Mandarin-speaking environment at school. I realized that it is important to preserve Shanghainese and engage more people to learn this dialect. Being at NYU Shanghai, I want to let more people participate in this project. Given that everyone knows English in this community, it inspired me to make this website based on English loanwords in Shanghainese. In other words, it might be easier for English users to start with words that sound similar to English pronunciation. To make the journey interesting, I made up a story based on six of the words. Hope you can learn these words with the quiz and learn more in the extra dictionary. Enjoy!

Open the Camera to be Joey & feel like a baby boss!
Take a quiz for what you just learned!
Eager learner? Six more words for you!

Part 2

1) Process: Design and Composition

VISUAL

The first page is a statement about the website and its goals. 

侬好Hello!

From page 2 to page 4 is the interactive story.

Skimming a series of Shanghainese loanwords from English, I picked six words [taxi(charter), dashing, biscuit, nougat, baby boss(kite), and slightly(a minimum)]. The six words were separated into three pages (taxi, bakery, and baby boss). Each page is a sentence with a pair of words. The sentences are connected. 

One day, Joey is in a taxi, feeling dashing as if on a limo.

Arriving at a bakery, Joey buys some biscuits and nougats.

Joey slightly feels like being a baby boss.

The visual designs are related to the storylines. Here is an example from the bakery page.

Arriving at a bakery, Joey buys some biscuits and nougats.

As for the quiz part, the red box is used as a visual cue for the audience to click on the dictation. The white box is used for the audience to input their answers. Lastly, the grey box is for the audience to submit their answers and get to the next exercise.

Quiz

Lastly, the dictionary is designed to show the original English word, the Shanghainese pronunciation, and its (new) meaning in Shanghainese.

Dictionary (English-Shanghainese-Meaning)

INTERACTION

The interaction within the story on each page is related to the scene on that page. Users can use buttons to go back and forth from different pages.

1)Sound

Generally, users can press ENTER to get the audio of the part of the story on that page. They can also press the first letter of the English word to get the sound of the Shanghainese, except for the bakery page where the interaction of the story and the sound play are mixed together. 

“t” for “taxi” on Taxi Page

2)Story Interaction

For the taxi page, the interaction is for the users to move the MOUSE to park the taxi at the bakery. It would stop when it is at the bakery. 

For the bakery page, users can use LEFT RIGHT UP DOWN to “eat” the items. LEFT and RIGHT are for eating the nougats while UP and DOWN are for eating the biscuit. The pronunciation of the eaten food would be played once it is eaten. The video below is a demonstration without sound.


 

For the baby boss page, users could open their cameras to be the baby boss. I specifically chose JOEY as the name, for its gender neutrality to bring more inclusion in the user engagement.

3)QUIZ

The quiz is designed for the users to click the red box to listen to the words that they just learned. They should type in the meaning of the Shanghainese. If they get the correct answer, the score will add one. The answer to the question will be shown in the next question. The video below is a demonstration without sound.

4)Dictionary
 Users can click the speaker token 📢 to get the sound of the Shanghainese.

2) Process: Technical

Website Structure

The website’s inner code structure is basically an HTML with other HTML.

I had problems with linking pages with each other because I individually created one folder for each sketch with their assets, JS, HTML, and CSS at first. The problems would be tedious and hard to call for the files, and the folder names would be like “page1/page2/page3/page4″ as if nesting dolls. It would cause errors if the folder being called is not the subfolder of the folder.

Therefore, I merged them into one folder, and directly called the HTML instead. 

</div> <button class="button1"><a href="index2.html">nougats</a> </button>

</div> <button class="button2"><a href="quiz.html">quiz</a> </button>
 
Text Position
 
For CSS, styling, I struggled with the position of the text. At first, I used “px” to sign the position, but it sometimes worked as I expected it to be only on my device. Later on, I reviewed the course slides and changed it into “%”
.text {

position: fixed;

top: 10%;
left: 50%;
background-color: #f0d7a7;
text-align: center;
padding-top: 100px;
padding-bottom: 100px;
width: 50%;

}
 
P5 Sketch
For the first sketch, the position moves with the mouseX.
 
I tried to stop the taxi at the bakery by using Boolean variables namely True and False, but it didn’t work. Then I used a counter which would be more than 0 if it is over the ScreenWidth. Lastly, if the counter is more than one, the position will be fixed. 
let carX = 0;
let check = 0;

carX = mouseX;

if (mouseX > width – 10) {
check = check + 1;
}
if (check > 0) {
carX = width – 10;
}

The smoke is made by randomness and transparency

//smoke
push();
translate(width-100, height / 2);
fill(255,255,255,150);
noStroke();
arc(0, -51, 25, 20, 0, PI);
triangle(-12.5, -50, 12.5, -50, 0, random(-300,-150));
pop();

The taxi is made through function for the convenience of moving as a whole.

function drawCar(xPos, yPos, name) {
push();
translate(xPos, yPos);
scale(3);

// light
c1 = "white";
fill("c1");
ellipse(-10, -40, 10, 20);

// body
fill("green");
rect(-20, -40, 40, 40);
rect(-60, 0, 120, 40);

// decoration
fill("white");
rect(-60, 20, 120, 5);
rect(-60, 25, 120, 5);

fill(255);
textSize(20);
text(name, -50, 20);

// wheels
fill(0);
drawWheel(-25, 40);
drawWheel(25, 40);
pop();

function drawWheel(xPos, yPos) {
push();
translate(xPos, yPos);

fill(50);
ellipse(0, 0, 35, 32);

pop();
}
}

The bakery scene is an example of how the sound is played. It first checks whether the key is pressed and then whether the sound is being played. By checking whether the sound is played or not, the interaction avoids the annoying echoes. 

function draw() {
if (keyIsPressed) {
// eat left
if (keyCode == LEFT_ARROW&&nougat.isPlaying() == false) {
fill("white");
noStroke();
rect(0, 0, candy.width*0.25/2, height);
nougat.play();
}
// eat right
if (keyCode == RIGHT_ARROW && biscuit.isPlaying()==false) {
fill("white");
noStroke();
rect((2 * width) / 3, 0, width / 3, height);
biscuit.play();
}
// eat mid
if (keyCode == UP_ARROW) {
fill("white");
noStroke();
rect(width / 3, 0, width / 6, height);
}
if (keyCode == DOWN_ARROW) {
fill("white");
noStroke();
rect(width / 2, 0, width / 6, height);
}
// story sound
if (keyCode == ENTER && story2.isPlaying() == false) {
story2.play();
}
}
}

For the baby boss sketch, the main issue is to add another layer for the camera to float on the baby boss cartoon. It is done by Graphics.

function setup() {

createCanvas(355, 530);
// float on the pic
pg = createGraphics(300, 300);
cam = createCapture(VIDEO);
cam.hide();

}
function draw() {

background(245);

image(img, 0, 0, img.width, img.height);
translate(width,0);
scale(-1, 1);
//zoom in the user's face
pg.image(cam, -200, 0);
//display
image(pg, 65, 30, 230, 250);

For the quiz, I used the list to keep track of the question-answer-sound. 

let questions = [
"1.What is the sound in the red?",
"2.What is the sound?(answer1:taxi)",
"3.What is the sound?(answer2:dashing)",
"4.What is the sound?(answer3:biscuit)",
"5.What is the sound?(answer4:nougat)",
"6.babyboss(answer5:slightly)",
"Click the button at the bottom",
];
let answers = ["taxi", "dashing", "biscuit", "nougat", "slightly", "babyboss"];
let s = [];
function draw() {
clear();
textSize(20);
fill(0);
text(score, 10, 20);
text(questions[counter], width / 2 - 100, height / 2 - 50);
push();
fill("red");
rect(width / 4, height / 2, 50, 50);
pop();
if (
mouseIsPressed &&
mouseX > width / 4 &&
mouseX < width / 4 + 50 &&
mouseY > height / 2 &&
mouseY < height / 2 + 50 &&
s[counter].isPlaying() == false
) {
s[counter].play();
}
}

3) Reflection and Future Development

Generally, I am proud that I recorded all the Shanghainese pronunciations myself because I didn’t find useable resources online for me to embed into the website. I completed the project with an interactive story, a quiz, and a dictionary. And during the presentation day, everyone was engaged in my project. I would like to thank them for repeating the Shanghainese with me.

I felt a sense of satisfaction when people asked me about Shanghainese during the Q&A session. Presentation makes impression; visibility emerges opportunity. I really appreciate the questions about whether Shanghainese is about to extinct and the difference between the Shanghai dialect and Mandarin raised by Ethan and Professor Moon. They recognized and sublimated the value of the project.

There is also a lot of constructive advice that I received throughout the whole process. I have appropriated them in the updated version.

At first, I only chose the topic of Shanghainese for the input of sound and then Professor Godoy told me to narrow down it to a specific part. I realized that the project should have a more nuanced angle. Also, she pointed out that taxis can just drive horizontally instead of driving from top to bottom. It is an obvious and natural thing but I didn’t notice that in my hand-written sketch at the beginning. 

After skimming a list of Shanghainese loanwords, I came up with the story. During the pitch presentation, Joey suggested that I add a camera for the user to see themselves speaking Shanghainese. I changed it into the interaction that everyone could be Joey and feel like a baby boss.

During the presentation day, IMA Fellow Carrot and Professor Godoy suggested I add a quiz for people to test what they just learned. I added them later on in the updated version.

For future development, I think the most important parts are the aesthetics and making the interactions more seamless as Professor Moon advised. Currently, the cartoons are a bit childish and the interactions are more separated within each individual page. Even though I added a “bakery” with a chimney in the updated version, there is still more that could be done for continuity. 

As for the quiz and dictionary, I believe they could be better developed in terms of interface. For now, they are just in a simple version. Images could be added to make them more colorful.

4)Credits

The topic, Shanghainese, is inspired by Mia Fan’s Dialect Protection in China in IMA Capstone Show 2023 at NYU Shanghai. The format, interactive storytelling, is introduced by XKCD. The Shanghainese words and further details are from an article called: Tracing the Heritage of Pidgin English in Mainland China: The Influences of Yangjingbang English on Contemporary Culture and Language in Shanghai by Jian Li published online by Cambridge University Press: 03 January 2017.

As the project went on, I was unclear about the loading issues. Professor Godoy said that it would be better to call assets online instead of calling things locally. I thought that would be the same case for inserting the sketches into HTML. Fortunately, with the help of the professor, I changed the website links of p5 sketches to js files.

To add the camera as another layer, Professor Godoy taught me how to use Graphics. 

I learned how to set up the input box and the button in p5 through YouTube video “How to make a Quiz in P5 JavaScript“. 

Lastly, thank the IMA community for the support and companionship. The caring and non-competitive environment generated a lot of helpful feedback and inspiration. 

Reading 3: New Media Art

New Media Art:

The authors defined New Media Art as projects that use emerging media technologies and are concerned with culture, politics, and aesthetics. In other words, it is the intersection of arts, media, and technologies. In my opinion, New Media Art refers to projects that use emerging technologies to not only translate artworks from other forms into new media but also to realize certain functions and effects that are exclusive to new media and are hard to achieve via “old media”. Nowadays, technologies and concepts have developed for 16 years since the text was published. The hype of VR, AR, and metaverse takes people’s sensorial experience to a new domain and era. However, the accessibility is concerning for the hardware requirements to create and appreciate these kinds of artwork.

Art Historical Antecedents, Themes, Tendencies:

· Before 2000:

http://numeral.com/projects/web/everyIcon/everyIcon.php

Description:

This is Every Icon by John F. Simon Jr. in 1996. It is an icon described by a 32 X 32 grid, which allows any element of the grid to be colored black or white. It would be unstoppable to display all the possible while technically it would cost more than a person’s life to see all the possibilities.

Artist:

John F. Simon Jr. is a new media artist who works with LCD screens and computer programming. He currently lives and works in Warwick, New York. He once said, “My feeling is that an artist’s state of mind when making a work is critical to what the work transmits to the viewer. I have always worked to improve on methods, technique, and materials, but only recently have I found that I can also improve the inner workings; I can develop the mental aspects of my art practice.” I think it pointed out the importance of expression and content in an artwork instead of mechanical techniques.

Context:

John F. Simon Jr. is one of the New Media artists who consciously reflect art history in their works. Every Icon revisits Paul Klee’s experimental use of the Cartesian grid. It is a piece of conceptual art realized in software by showing the potential of canvas. Although it takes only 1.36 years to display all of the variations along the first line, it takes an exponentially longer 5.85 billion years to complete the second line. Even in the limited visual space, there are more images created than humans could perceive. The concept penetrates technology, software coding, and the digital world. 

· After 2000:

https://www.aftersherrielevine.com/

Description: 

After Sherrie Levine is a new media work created by Michael Mandiberg in 2001. The artist scanned Sherrie Levine’s re-photographing of Walker Evans’s classic Depression-era photographs of an Alabama sharecropper family in 1979. Then he posted them on the Web at AfterSherrieLevine.com. 

Artist: 

Michael Mandiberg is an American artist, programmer, designer and educator. One of his noticeable works is Print Wikipedia, a visualization of how big Wikipedia is, which is a collection of printed-out content with pdfs uploaded online and available for printing.

Context:

This work is an example of how new media artworks feature “appropriation”. In my opinion, it is an extension of existing works. The reproduction, changes in sequence and collage could even influence the audience better than the “original” source. In this case, the photos were appropriated but still conveyed authenticity. The work has a certain “cultured value but little economic value”. This kind of appropriation develops with the progress in New Media Arts, which simulates the intellectual laws and open sources development later.

Mini Project 6: Object Dancers – Candle Dancer

Project Title: Candle Dancer

link:https://editor.p5js.org/jl14064/sketches/nsa8tytad

Description:

The candle dances with flames.

The flames get stronger if the mouse is pressed.

Candle Dancer is inspired by Lumiere from Beauty and the Beast (1991)

Coding:

In this mini project, IMA Fellow Carrot helped me with the rotation by pointing out how to use map() in the update function. It is my first time using a map() in my project. The following code also includes sin() display(), which fulfills one of the challenging options.

update() {
// update properties here to achieve
// your dancer's desired moves and behaviour
this.angle = map(sin(frameCount * 0.03), -1, 1, -PI / 8, PI / 8);
}
.....
//candle
display() {
......
push();
translate(0, -15);
rotate(this.angle);
//tray
noStroke();
fill(251, 200, 135);
arc(0, 0, 30, 50, 0, PI);
//white candle
noStroke();
fill("white");
rect(-15, -50, 30, 50);
//melt
noStroke();
fill("black");
arc(0, -51, 30, 20, 0, PI);
//fire
fill(255, 141, 0);
noStroke();
arc(0, -51, 25, 20, 0, this.range);
triangle(-12.5, -50, 12.5, -50, 0, this.flame);
pop();
......
}

The randomness was included to create the flame effect. To make it interactive, I used the if condition to make the flames stronger by pressing the mouse.

this.flame = random(-60, -55);
this.flameside = random(-45, -35);
//make it stronger
if (mouseIsPressed) {
this.flame = random(-70, -60);
this.flameside = random(-55, -45);
}

Speaking of the arms, Professor Godoy suggested I should make the lines into “little circles” and utilize sin() to make the movement smooth. Later, I figured out that the “circles” are actually Points. 

 //arms
push();
translate(0, 15);
stroke(251, 200, 135);
strokeWeight(8);
//double
for (let i = 0; i < 2; i++) {
rotate(i * PI);
//rolling arms
for (let x = 10; x < 45; x += 0.1) {
this.arm = sin(x * 0.1 + frameCount * 0.1) * this.amp;
point(x, this.arm);
}
}
pop();

Reflections:

  • What is the benefit of your class not relying on any code outside of its own definition?
    • In my opinion, the benefit of my class not relying on any code outside of its own definition is the certainty of the module and the flexibility to be reused as a template. Since there is no code outside of its own definition, the variables change values without tedious manual adjustment. 
  • What makes it challenging to write code that has to harmonize with the code other people have written? 
    • To harmonize with the code other people have written, there are a lot of constraints such as the size and where to write the code. For this project particularly, I had to make my dancer smaller than 200×200 pixels and put all my code in the class. 
  • Describe the terms modularity and reusability using the example of your dancer class.
    • Modularity means it could be called as a whole to perform certain tasks. For instance, my dancer class could be called to display and update.
    • function setup() {
      // no adjustments in the setup function needed...
      createCanvas(windowWidth, windowHeight);
      // ...except to adjust the dancer's name on the next line:
      dancer = new Candle(width / 2, height / 2);
      }
      function draw() {
      // you don't need to make any adjustments inside the draw loop
      background(0);
      drawFloor(); // for reference only
      dancer.update();
      dancer.display();
      }

      Reusability means the convenience of being called and duplicated. In my dancer class Candle, this.x and this.y in the constructor could be changed by the parameters given to move the appearance of the candle.

    • function setup() {
      // no adjustments in the setup function needed...
      createCanvas(windowWidth, windowHeight);
      // ...except to adjust the dancer's name on the next line:
      dancer = new Candle(width / 2, height / 2);
      ......
      class Candle {
      constructor(startX, startY) {
      this.x = startX;
      this.y = startY;
      ......

Mini Project 4: Patterns

Project Title: Tilted Glasses

link:https://editor.p5js.org/jl14064/sketches/ZtAIqFvJt

Description:

 

This is nine “tilted glasses”. When we perceive the colorful world, all of us have our own lens. Sometimes, we might treat squares as circles and circles as squares. They might be false to some extent, but they are also our interpretation of the world.

Originally, I wanted to create nine sketches depicting the nine lives of a cat. Later Professor Godoy suggested I make the project more focus on shapes. I also want to thank Learning Assistant Jason for illustrating the goal and convenience of using “translate()” in static pictures. 

for (let x1 = i + s; x1 < i + 75; x1 += s) {
for (let y1 = j - 75 + s / 2; y1 <= j + 75; y1 += s) {
fill(random(255), random(255), random(255));
circle(x1, y1, s);
}
}

//left
for (let x2 = i - 75 + s / 2; x2 <= i; x2 += s) {
for (let y2 = j - 75 + s / 2; y2 <= j + 75; y2 += s) {
fill(random(255), random(255), random(255));
square(x2, y2, s);
}
}

//LINE
stroke("black");
strokeWeight(random(1, 8));
line(i - width / 12, j, i + width / 12, j);

//LEFT
stroke("black");
strokeWeight(random(1, 8));
fill(random(100), random(100), 100);
circle(i - width / 12, j, random(width / 12));

//RIGHT
fill(random(100), 100, 100);
square(i + width / 12, j, random(width / 12));

pop();

In this project, I tried out the use of loops to create the pattern in the background. In addition, the push() and pop() helped the iteration to continue. 

Reflection:

  • I think in this particular project, drawing in patterns when programming the computer, the artist can just make certain templates with various variants. If it is drawing by hand, the artist would have to do a tedious job to recreate similar features. But I do concede that when drawing by hand, the nuances in different appearances caused by the psyche could be enlightening. 
  • I manipulated the size, color and stroke weight in the repetition. I think the general set is well created and the changes are quite thriving. 
  • What makes a good generative pattern? My answer would be well-established strict rules with a loose end of interpretation. It is a combination of randomness and design.

Mini Project 3: Generative Motion

Project Title: Generative Motion Sketches

link1 leave: https://editor.p5js.org/jl14064/sketches/SywY_Hn52

link2 migration: https://editor.p5js.org/jl14064/sketches/EqWyVCbeS

link3 measles: https://editor.p5js.org/jl14064/sketches/WK0XCLZRI

Description:

These are the 3 sketches I made with linear, random, oscillation, circular, and angular motion.

I would like to thank Professor Godoy for the clarification of “a combination of (at least) two types of motion in a single sketch”. At first, I created two objects in one sketch with two different kinds of motions. However, Professor Godoy pointed out that it should be one object with two kinds of motions. From the misunderstanding, I started to have a deeper sense of generative art for its ambiguous description and interpretation.

1.LEAVE:

The first one is what I call “the leave”. It falls in a linear way while it twists in oscillation. This resembles the leaves falling in nature. 

x = x + 5*sin(ld);
y = y + random(5);

If the mouse is pressed, it will change its location rapidly as if a strong wind blows the leave away.

if (mouseIsPressed)
{ //wind
x = random(width)
y = y + random(5)
}

2.MIGRATION:

The second one is called “migration”. Inspired by birds’ migration, moving between two locations at different times, I combined the “reappearance” in linear motion with the circular motion.

if (x<=0||x>=width){
cx = width - cx
s = 0

Alternately, the lollipop vortex appears on the left side and right side of the canvas.

x = cx + cos(frameCount*0.1) * s;
y = cy + sin(frameCount*0.1) * s;
fill(random(255),random(255),random(255));
circle(x, y, random(50)); //initialize
s = s + 0.1

3. MEASLES

The third one is called “measles”. It is my first attempt to make an angular motion. It really took me a considerable amount of time to figure out the differences and functions among angleVel, angle and radDist. With random introduction, it demonstrates the unpleasant encounter with measles.

angleVel = random(5)
angle = angle + angleVel;

// calculate the position
x = width/2 + cos(angle) * radDist;
y = height/2 + sin(angle) * radDist;

// display the circle
circle(x, y, dia)
radDist = radDist + 1

Mini Project 2. Interactive Drawing:Boba

Project Title: Boba

link: https://editor.p5js.org/jl14064/sketches/rSURhuHVR

Description:

This is a cup of boba.

By default, it has little tea in it.

If you press “v”, the volume of the tea would rise.

If you click the mouse within the area of the tea, there would be some boba created.

If you press “s” afterward, there will be a boba “sipped” in the straw.

I was waiting for a food delivery of boba during the recitation session. That became my inspiration. After listening to my idea, Professor Godoy suggested I include the movement of a boba in it. 

In the future, I hope that I can learn how to use the loop in p5 to make the movement of boba duplicates instead of just being activated once.

Reflection:

I used many variables in this project for restraining the workplace for drawing and the storage of the color of “tea” and “boba” and the size of the “cup” and “straw”.  The control of the area of drawing makes the project reflect reality. The storage of the features helps me to call these elements more easily.

I used “if” to change the volume of the “tea”, add “boba” and “sip” the “boba” and “tea”. With the operation on keyboard and mouse, the interaction comes alive.

“Key” is used when the input is an ASCII key while “keycode” is used when the input is a non-ASCII key.

Code:

let x1 ;
let x2 ;
let y ;
let sx1;
let sx2;
let ty;
let my;
let bR;
let bG;
let bB;
let tR;
let tG;
let tB;

function setup() {
createCanvas(400, 400);
background(400);

//boba color set
bR = 94;
bG = 82;
bB = 71;

//tea color set
tR = 214;
tG = 201;
tB = 193;
ty = 3/4*height;

//volume line
x1 = width/4;
y = 3/4*height;
x2 = 3/4*width;

// body of the cup
rect(width/4, height/4, width/2, height/2);

//bottom of the cup
fill(tR,tG,tB);
stroke('black');
arc(width/2, y,width/2,height/4, 0, PI);

//hide the line
stroke(tR,tG,tB);
line(x1, y, x2, y);

//straw set
sx1 = width/2-20;
sx2 = width/2+20;
sy = 3/4*height;

//straw
stroke('black');
line(sx1, height/8, sx1, sy);
line(sx2, height/8, sx2, sy);
stroke('white');
line(sx1, height/4, sx2, height/4);

//MOVE BOBA
my = 3/4*height;

}

function draw() {

//tea line
stroke(tR, tG,tB);
line(x1+1, y, sx1-1, y) ;//left tea
line(sx2+1, y, x2-1, y) ;//right tea
line(sx1+1,ty, sx2-1, ty); //middle tea

//ADD some tea
if (keyIsPressed && key == "v") {
y = y - 1;
ty = ty - 1;
}
//full cup
if (y < width/4 + 15) {
y= width/4 + 15;
ty = width/4 + 15;
}

//ADD some boba
if (mouseIsPressed && mouseX<3/4*width-30 && mouseX>1/4*width+30 && mouseY>y+15 && mouseY<3/4*height+15 ) {
noStroke();
fill(bR,bG,bB);
ellipse(mouseX, mouseY, 30, 30);
}

//SIP tea
if(keyIsPressed && key == "s") {
//DECREASE tea
stroke('white');
line(x1+1/2, y, sx1-1/2, y) ;//left tea
line(sx2+1/2, y, x2-1/2, y) ;//right tea
y = y + 1;
ty = ty -1;

//RESTORE straw
stroke('black');
line(sx1, height/8, sx1, y);
line(sx2, height/8, sx2, y);

//SUMMON boba
noStroke();
fill(tR,tG,tB);
rectMode(CENTER);
rect(width/2,my,39,39);

//UP boba
noStroke();
fill(bR, bG, bB);
circle(width/2,my, 30);
my = my -1;

}

//bottom boundary
if (y > 3*width/4) {
y = 3*width/4;

fill(tR,tG,tB);
stroke('black');
arc(width/2, y,width/2,height/4, 0, PI);
}

fill(tR,tG, tB);
noStroke();
text("Press v to fill the cup \nClick to add boba \nPress s to sip at your tea", 10, 20);

}

Reading 1. Generative Art

I. Reading Reflection

After reading the article about Generative Art, I believe it refers to the artwork that unfolds under the artist’s instruction with ambiguous concepts and elusive outcomes. In retrospect,  In Creative Coding Lab, my Mini Project 1 is about drawing codes and the second one is about interactive drawing, which is similar to Generative Art but diverges in different ways. The results of my Mini Projects were partly envisioned before I coded the instructions while the actual coding could be various and the results were slightly different from what I expected. I think this is similar to PSEUDORANDOM as the author mentioned in the article though I didn’t introduce random() in my programs. However, both of my projects are based on objects in social life, a water jug and a cup of boba tea. On the other hand, the examples mentioned in the article are more abstract for their connections of shapes and nodes or mimesis of the natural world. I would wonder whether in Generative Art the aura of randomness itself outweighs the author’s expression. In other words, is it a kind of meta-art to some extent?

II. Instructions for Art

My instructions for art are as follows:

  1. Draw an eye
  2. Create another one with the same size and share the same “pupil” with a 45-degree rotation
  3. Repeat 2 until there is an overlap
  4. Connect the corner of the eyes with a circle and use the circle as a new and larger “pupil”
  5. Use the new “pupil” as you repeat 1

I was inspired by how my parents met each other in the first place, which could be my origin story. My grandpa, my mom’s dad, and my dad’s friend went to visit the same ophthalmologist for their poor lens. The expectation would be “eyes” connected to the same “pupil”. The instructions are open to interpretation when it comes to the position of the very first eye and the rotation and the angle of the first eye in a new loop. These are the randomness. But I didn’t realize the latter until the last loop that could be created on the paper. In fact, what I visualized in my head at the beginning would be identical loops with different sizes. In the end, I managed to control the basic elements of the final piece and leave the unpredictability to the rotation.

Mini Project 1: Drawing with Code

Project Title: Holy Water Jug

link: https://editor.p5js.org/jl14064/sketches/PqnDkIHJD

Description:

This is a water jug that I made digitally. Following the instructions, I took a photo of my dorm, a corner in the common space, and drew a sketch of it with ellipses and rectangles.

I chose this particularly because of the color and shape. The water jug and the machine contain blue and red, the foundational colors. The whole theme was mainly composed of rectangles and ellipses. They are useful when it comes to drawing with code.

There are two major differences between the sketch and my digital drawing, perspective and objects. I really appreciate the constructive suggestions from the IMA community.

During the recitation, I finished my work quickly due to the simplicity of my drawing. Professor Godoy suggested I make it “more complex”, prompting me to notice the polygons and translate them with the help of beginShape(). Then, I decided to make the digital version visually 3D with 2D primitives.

After I finished the white base of the water jug, I turned to IMA Fellow Carrot Liu for affirmation of complexity. Surprisingly, she advised that I should put only one water jug since “less is more”. In the later version, I deleted the water jug on the ground.

Reflection:

In this mini project, I prefer using the reference. The constraints unlock my creativity as guidance, supporting me to reconstruct the water jug in shapes rather than making me lost in the middle of nowhere. At the same time, I have to concede the thrills of curiosity I felt when I was testing the color for the “cold” button. Therefore, I believe using the reference benefits the conception of the structure while exploratory programming facilitates nuances in details.

Drawing on a piece of paper is easier because it mainly focuses on strokes with the freedom to end anytime. When drawing on a piece of paper, the painter can end the line easily and make curves arbitrarily. When drawing with codes, it would be mainly shapes. Shapes made by lines would be complicated to color.

On the other hand, writing the program makes it easier to adjust the size of the shapes and the fill of the color. The changes are made with code without any damage to the canvas. Drawing on a piece of paper is not mutable. It could also damage the canvas as a side effect of erasion.