I’m starting to see how the building blocks of p5.js will enable the creation of systems and thusly enable more complex programs to be written. There are however, a few concepts that still are a bit fuzzy. One of those is random(), I understand how this function works but I’m a bit lost as to why I can put it before the setup() so that it can have an affect on the code after it. I was able to find a work around unfortunately this creates a very long program to something I believe should be able to be done with far fewer lines of code.
You can see in the code below the video lines 22-41 and lines 52-70 are devoted to assigning a random color to the four circles. This seems like a lot of code to produce these changes. This is where I’m sure this is a better more compact way to do this.
The video is a screen recording of the behavior produced by this code. The circles which have an origin at the four corners has a random() assignment operation for location. The color of each circle is also is random() unless the (mouseButtonPressed) is used which changes each of the circles to red, green, blue, or black.
Two types of inputs and two very different approaches to gather input form the physical world.
Digital inputs are fairly straight forward for me, data can be broken down into 0’s or 1’s, some combination of these two integers will give the processor the information needed. Opening and closing a circuit in order to have some desired effect. Last week we looked at switches, I equate the digital input to a switch basically. In one state it sends a “1” and in the other state it sends a “0”. This can be used for many different types of actions. However, the real fun comes form the use of or addition of analog switches. In the video below a rotary potentiometer is used to adjust the brightness of an LED through changing the voltage, the rotary potentiometer is a variable resistor.
Now is when the everything falls apart breadboard √
Nano 33 √
Wiring √
LED’s √
Some analog inputs √
working IDE…
I made a few attempts to upload the sketch with he same result:
avrdude: ser_open(): can’t open device “.COM5”: Access is denied.
I swapped out the Nano 33Iot with another one, same result. I swapped the Nano for an Uno, same result. I then checked to make sure the USB-micro USB cord was able to send/receive data, it was. So at this point I figured it had to be software related, I started with drivers for USB ports, then moved onto checking how the COM ports were assigned, checked to see what programs were holding COM ports open, changed firewall and anti-virus settings. Nothing worked, thought it might be my desktop, switched to my laptop, same behavior.
Now that I was well frazzled it was time to reach out, hoped on discord and asked in anyone else was having the same issue. Luckily Tom Igeo was on and we started to troubleshoot some other ways.
Went through another couple of rounds with drivers and the like, when we finally decided to install an old version of the Arduino IDE, and BAM!! Upload successful.
After a few hours of fuss with the IDE, uploading was a non-issue. I was able to write I bit of code for a pair of force sensitive resistors (FSR) and they work for the most part. I may have used the wrong pulldown resistor, not calculated the remapping of the range correctly, or these FSRs always allow some amount of voltage through, bit thinking about it now, I might be able to adjust the low end of the range to avoid this behavior. I will try this out and put my results in the comments.
const int redLED = 10; // pin that the red LED is on
const int greenLED = 11; // pin that the green LED is on
int rightSensorValue = 0; // value read from the right analog sensor
int leftSensorValue = 0; // value read from the left analog sensor
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
// declare the led pins as outputs:
pinMode(redLED, OUTPUT);
pinMode(greenLED, OUTPUT);
}
void loop() {
rightSensorValue = analogRead(A0); // read the pot value
// map the sensor value from the input range (400 - 900, for example)
// to the output range (0-255). Change the values 400 and 900 below
// to match the range your analog input gives:
int brightness = rightSensorValue;
analogWrite(redLED, brightness); // set the LED brightness with the result
Serial.println(rightSensorValue); // print the sensor value back to the serial monitor
// now do the same for the other sensor and LED:
leftSensorValue = analogRead(A1); // read the pot value
// map the sensor value to the brightness again. No need to
// declare the variable again, since you did so above:
brightness = leftSensorValue;
analogWrite(greenLED, brightness); // set the LED brightness with the result
Serial.println(leftSensorValue); // print the sensor value back to the serial monitor
}
Create a virtual soundwalk using Unity to create an interactive OpenGL experience.
As a team we first approached this in a linear fashion with two options. One option consisted of discrete sound events and were buffered by some transitional sonic element, the other progressively added discrete element but layered them on top of each other to form a complete environment. These however, were not meant to be after realizing the soundwalk would need to have a visual component we pivoted and looked at journey that was non-linear. Starting in a central point and giving the choice to the user as to how the journey shaped out before them. Below is a visual representation of our first idea.
After the decision to create a user developed story we thought about how the environment would play a role in the development of the narrative for each user individually. We noted that dreams, nightmares, and memories all have a familiar and non-linear feeling associated with them. Depending on the user’s life experiences dictated the feeling the environment produced. You be the judge as to which you think this world is for me.
We each created two unique micro environments and used the dreamscape/memory lane idea to connect them together. Much like when in a dream your mind wonders for event to event with little to no transition, this world allows the user to expire this. There are a few elements that symbolize transition such as the rugs leading from the central start point. And the are many clues to show that this place is somewhat known but makes you feel uneasy or curious. Aesthetically all of the aforementioned elements play a role in defining the dreamscape/memory. Furthermore it was imperative that the micro environments feel inclusive so that all users can have some attachment to the space.
Distanced group work us something that is part of my everyday life as a contract industrial designer. The challenges such as time zone difference, scheduling conflicts , and work priorities were not an issues at all. The hardest part of group work was figuring out the best way to export and compile assets created individually. In all reality it only took a few hours for us as a group to figure out the best workflow to use.
Unity has an interesting workflow, I am intimately connected to 3D or CAD modeling and have been for some time, it took some time to develop an understanding of why Unity functions the way it does. There were a few issues I could not resolve, namely a clipping issue that did not render the terrain at mid-distances from the user. Near terrain and far terrain rendered as expected though.
I’m Excited to add Unity to my toolbox, I see great potential for using it to visualize spaces, create VR worlds, and hopefully being able to integrate its use into large scale immersive installations.
by Kevin Peter He, Brandon Roots, Phil Caridi, Sam Heckle, Akshita Bawa, Alina Liu, Dalit Steinbrecher, Eric Kalb, Jenny Wang, Natalie Fajardo, Sihan Zhang, Sumi Lee
A previous related project done by Kevin: an abstract narrative reflecting on our relationship with and complicity in nature, industrialization, and our general ecological surroundings. It’s 3:30 min and please watch with webcam and sound on https://icarusfilm.herokuapp.com/
The modern era brings us a global war on the environment — where humans, and more importantly corporations, act as parasites on this spaceship we call Earth, and the burden lies on art to harmonize technology, society, and culture with nature.
THE PARASITE, CAPITALISM
The United States is a frontrunner of a western, capitalist society, and is a worthwhile character in a conversation about capitalism. In 2009, the US Supreme Court received arguments whether or not corporations are citizens. The decision, delivered in early 2010, stated that corporations were eligible to receive rights from the Constitution. In this particular case, the ruling declared that corporations can receive First Amendment rights and freedom of speech (link). With no legal distinction between humans and corporations, do we lump ourselves together with the corporate collective? When an individual fails to recycle a single cardboard box, does that equate a corporation failing the same act on a tenfold-scale? The line is hard to draw, and we continue to rely on the Earth for a supply of resources that only appear endless. We need to close the loop on production. With the rise of global warming, the worldwide extinction of ecological habitats, with an increasing population and overall waste production, the future looks grim if we continue on this path.
On a global scale, even COVID-19 can be directly attributed to fiddling with the environment (link). Let’s talk about cell phones. They are made from a coltan, a mineral that is ultimately refined into tantalum, which is found in most, if not every, technological device. Any cell phone or computer owners are customers for this extremely rare mineral, which makes them (us) responsible for the miners of coltan. These miners may eat bushmeat while mining, and could come into contact with any new virus that might use the bushmeat as hosts (link). Consumerism, and an evolving society that relies on technology to function, brought us COVID and will bring future viruses. Unless we can mitigate our endless extraction of resources from the earth, and close the loop of resource gathering and waste production, we cannot find any harmony.
LIVING SYMBIOTICALLY AS A CULTURE
Although gloom and doom is pervasive, there are steps that can be taken to live symbiotically with the planet. Firstly, a cultural shift is required. Globally, we need to shift the conversation towards one that is more beneficial for the planet. Western socialist and eastern cultures focus more on the collective wellbeing, whereas western capitalist countries focus on the individual wellbeing of each person. The problem with the individualistic mentality is one that prioritizes greed. In a social aspect, individualist cultures are for their own gain. Additionally, due to supply chain and global resource gathering, individualism and capitalism are responsible for issues worldwide. For instance, in India where the start of the production line begins, worker compensation is extremely low for the amount of money that the product is retailed for (link). Workers make pennies for the hundreds of dollars items are sold for. All as a result of capitalism and corporate greed.
However, we can look at a smaller scale to find examples to shift the global conversation. Finland and Sweden, countries that are predominantly socialist, are an excellent example. They have the highest happiness index in the world (link). Prioritizing the wellbeing of the collective is inherent to their culture, and reflects in their policy-making process. We can also look at the Indigineous people of America, caring for the wellbeing of the earth and ensuring balance between humans and their surrounding environment. Creating a modern sustainable means of life will be extremely challenging, but it starts with a cultural shift to thinking about “we” and “us”.
VISIONARIES
Several attempts have been made to create the city of the future which can simultaneously fulfill the needs of both the community and the individual. Notable among them is EPCOT, the Disney theme park, originally conceived as a community 20,000 strong, and would be home to the staff of the yet to be built Walt Disney World. The Experimental Prototype Community of Tomorrow would have been a working city that tested new city planning concepts, technology, and materials, but the project was ultimately abandoned when Walt Disney died. Years later it would be reconceived as a theme park and would open in 1982 with Future World, and corporately sponsored attractions related to the future of Energy, Agriculture, Transportation, Space, Imagination. Maintaining a vision of the future ahead of our present proved difficult, and a theme park without thrill rides saw declining attendance, loss of sponsors and the eventual demolition of what remained of Walt’s vision. The icon of EPCOT, the large silver geodesic sphere is named “Spaceship Earth,” a term popularized by architect and futurist Buckminster Fuller. A few years earlier, Fuller worked on a project similar to Walt Disney’s original vision of EPCOT. A recent article in The New Yorker (link) documents the hope of the “Skyrise for Harlem,” a concept initiated by Black feminist writer and activist June Jordan in 1964, a gift to the community she loved in response to killing of a Black teenager by a white police officer. The concept was published in Esquire, redubbed “Instant Slum Clearance” by editors, a title antithetical to its original positive inspiration of rebirth of a community in decline (rather than the demolition of one). Nothing ever came of the project. These two projects share many things in common, key amongst them is the reason why they never happened: large change requires more than one visionary… many more. Zurkow spoke of Donella Meadows Iceberg Model “which depicts how what is under the surface is progressively more difficult to change, but not impossible, it requires increasing leverage – meaning in part analysis, time, and numbers of people with conviction.” The societal changes necessary for immediate course correction will be the only effective solution. Individuals can enact change, but it can only be achieved as a group.
SOLUTIONS
Much of our lives are ruled by “necrocacy,” a term used by Zurkow, which means “a government that still operates under the rules of a dead former leader.” Most of the rules, traditions, and conventions that control our daily lives were drafted by people who are dead, not just recently dead, but long dead. Some of these people have been dead for centuries, but despite more advanced awareness of science and technology, and evolved ethical practices, change is difficult and will require the efforts of a larger movement.
Fossil fuels are an example of something that we rely on, despite knowing the negative consequences of both harvesting and using it (and having more future-conscious alternatives). The infrastructure is already in place for us to rely on fossil fuels and the government is in the pocket of the oil companies, both factors that make the systemic adaptation necessary for a healthier planet near impossible.
The fate of our cities is in question at the moment for multiple reasons, the first is tied directly to fossil fuels and global warming: sea level rise. Fortunately/Unfortunately the rising sea levels do not care what color your state is on an electoral map. Studies have shown that several US cities will be at least partially underwater by the year 2100 (link). That will be in the lifetime of our children and/or grandchildren. The cities include New York, Boston, Miami, New Orleans, Houston, and Charleston. In “The Ecological Thought,” Timothy Norton recounts a story about the inhabitants of a Scottish village complaining that the turbines of a wind farm spoil their view. He questions whether they would rather have a pipeline. Residents of Lakewood, Colorado had similar sentiments regarding the installation of a solar array that would not look “natural.” Our wasteful needs have put us in this position and yet we still prioritize aesthetics over practicality. There is a certain amount of justice when erosion claims a mansion precariously built on the edge of a cliff.
Another reason for change in our cities is the exodus of their residents. Recently released census data has shown that population growth in major US cities had stagnated and been on the decline, even before the pandemic (link). The migration of New York City residents to the suburbs and summer rentals for the season may be more permanent than original estimates. With the pandemic expected to last well into 2021, and the ability of many to work remotely, residents of US cities may settle into permanent living arrangements elsewhere. Companies like REI sold off its newly built headquarters, and Facebook bought the site.
Does this mean the death of the big city (New York especially)? Although it is hard to predict, some have proposed that this exodus will drive down rent, allowing a more sustainable lifestyle for young professionals and artists, and revitalize culture created by young people in our cities. This is a possibility, but would require rent to be driven down to a reasonable level, and kept there. The opposing argument to this theory is that young artists have found outlets and communities through social media, and that the culture of young people has become geographically decentralized. The coasts no longer need to be the only hubs for media and the arts. Despite the numerous evils of social media, it has prioritized art and democratized culture, allowing demographics left voiceless in previous generations to have a platform of expression.
CONCLUSION
As parasites on earth, we must change to keep our host healthy enough to sustain us. This will require a tectonic shift in priorities in order to save both ourselves and our global neighbors.
At left is a diagram of the final 3 Step Switch. The main actions used to create this switch were opening a drawer, extending a desk lamp, and placing a cup on a coaster. But first lets talk about getting to the point where I could think of how to make this work.
The exercises outline in the syllabus were very clear and gave a good foundation about how the flow of electricity moves along a circuit. Understanding the breadboard and how it is constructed was a critical step in this process. After reading through the material I experimented with different configurations on the breadboard. One thing I noticed was how dim the output of the LED was, I originally used a 220k ohm resistor which made it very dim. I then removed the resistor completely, bingo!! Bright light, only problem was this allowed too much current for the LED and bam! I burnt a few up doing this. I did some measuring with the multimeter and confirmed the current was too great for the LED and decided on using a 220 ohm resistor. This gave me the desired light output from the LED and did not harm the LED.
I made a DC plug with header pins for use with the breadboard and covered any exposed wires with hot glue to ensure this adapter did not short out. I took this idea from one of the videos staring Tom Igoe.
The video shows one step one of the switch, the desk lamp is raised into working position. Two wires run up the back of the lamp and a patch of copper tape was applied to the top of the lamp arm. When the lamp arm is raised the wires contact the copper tape and complete the switch.
The next component is the drawer switch. When the drawer is opened the switch is closed completing the circuit. Again I used copper tape and wire to complete the switch, the copper take is placed along the top edge of the drawer leaving a gap of 1 inch at the front. This allows one wire to rest off the tape when the drawer is closed. When the drawer is opened the front wire to contact the copper tape and complete the circuit.
The next and final component is a pressure switch that is activated by placing a cup on a coaster. This video contains all three elements in the switch wired in a series so that all actions must be completed for the LED to light. For the most part this was a fairly simple project, the hardest parts was extrapolating out how the momentary push-button switch worked in terms of the current flow. (The video containing the success with the momentary switch is below.) After figuring this out it was just a batter of running the wires and assembling the final configuration.
Here you will find an assortment of images related to how I created this 3 Step Switch. Please comment and question.
This is week of learning to use p5.js, so far it’s not too bad. In fact I actually enjoy the process. There are some interesting features of this programming language. But we will get to that in a little bit.
Everything was fairly straight forward, starting with the body composed of lines with a
//body
background(0, 100, 66); strokeWeight(20) stroke(30, 30, 30) line(300, 300, 300, 400) //body line(250, 480, 300, 400) //left leg line(350, 480, 300, 400) //right leg line(300, 320, 260, 375) //left arm line(300, 320, 340, 375) //right arm
The head and nostrils were next, again fairly straight forward code to create these.
Now it’s time to for some oddity, remember earlier when I said “there are some interesting features to this programming language?” well take for instance rotate(), this transformation actually rotates the canvas around an object thus making all other objects after that rotate in the same manner. Using translate() in conjunction with rotate() allowed me to get the eyes angle the way I wanted. Now I’m sure there is a way to do this in a much simpler manner however, this is the way I figured it out with a bit of using the p5.js reference page. https://p5js.org/reference/
Notice that I didn’t reset the canvas so when I added the bezier() as the hairs the coordinates don’t follow the standard 0,0 being at the upper left had corner of the canvas.
In my opinion a website should be easy to navigate, view, and leave however building a website is none of the aforementioned. Unless you know all the code there is to know doing simple things can be unfortunately difficult. Please bare with me as I teach myself “all there is to know about building a website” in three days and please feel free to comment and point out things entities that are broken.
Today I being a journey of self-discovery enabled by ITP at NYU. If you are so inclined please follow along here. Questions, comments, and general interaction are greatly appreciated.