-
Notifications
You must be signed in to change notification settings - Fork 5
Homework Ellen 07
ICM Section 07 • Meeting Mondays 12:20PM - 2:50PM ET in Room 410
- Contact Ellen
- About Our Course
- Week 1 • Sept 13 • Introduction and Drawing in p5.js (p5)
- Week 2 • Sept 20 • Animation with Variables and Objects
- Week 3 • Sept 27 • Interaction with Conditionals
- Week 4 • Oct 4 • Arrays / Repetition with Loops and Over Time
- Week 5 • Oct 12 (Tues) • Arrays / Organization with Functions
- Week 6 • Oct 18 • More Repetition with Classes
- Week 7 • Oct 25 • The DOM: HTML and CSS / Present Final Exercises
- Email [email protected], and I'll do my best to respond within 24 hours except on the weekends, which might be longer.
- Office Hours in Zoom (so we can see our faces!) Tuesdays and Fridays from 10:00AM - 12:00PM Sign up here
- If no appointments are available or you need a different time, please email me with three good times for you, and I'll send you a calendar invite with a Zoom link.
Here is the description for ICM from the ITP Schedule.
Upon completion of the first half of the ICM course, Code, we will be able to:
- describe possibilities of computational thinking and coding for creative applications;
- recognize p5.js as a Javascript framework for drawing graphics and working with media on the HTML Canvas element of a web page;
- identify fundamental coding concepts, such as variables, conditionals, iteration (loops), arrays, functions, and objects;
- identify approaches to debug errors in our code, including how to interpret error messages and print messages to the Console of the p5.js web editor;
- practice and apply these coding concepts and debugging approaches in our creative work using p5.js.
ICM Code is a seven-week course that meets once a week in person at the scheduled time. (After Code, ICM Media meets for another seven weeks at the same time and place.) We will have assignments to do before each Code class, and these assignments will build towards a final exercise to share at the end of the seven weeks.
This course embraces an active-learning approach with the belief that programming is best understood by doing. In keeping with this approach, class time will be structured as a workshop and seminar instead of a lecture, relying heavily on group discussion and participation. Weekly video tutorials to watch before class sessions will introduce fundamental coding concepts. During class, supplemental code examples will be presented and discussed before hands-on work together. Time will also be allotted to share our weekly assignments. Examples and assignments will iteratively build upon lessons learned in preceding classes.
You are encouraged to reach out to me outside of class to ask questions, share ideas/feedback, and discuss topics in detail.
Before class, watch the video tutorials about the fundamental coding concepts that we will practice together when we meet.
There are also weekly programming assignments that are relevant to the material from previous classes. Assignments are due on Sundays at 11:59pm the day before our class so that I have a chance to review your questions before we meet.
All assignments are expected to be submitted by the stated deadline, and you should be prepared to show and talk about them in class. If you anticipate any challenges meeting the deadline, please reach out to me so that we can consider your options together.
A big part of learning at ITP is learning from each other. Share your work and in return you'll see everyone else's!
- Weekly Practice Questions. There are questions (linked below) to practice the concepts introduced in this course. You are expected to add links to your p5 sketches directly to our weekly exercise documents*.
-
Weekly Creative Exercise and Blog Post.** Each week there is an open-ended, freestyle creative exercise to apply the concepts that we practice. You are expected to add links to your blog posts directly to our weekly exercise documents* (linked below). Include a link to your p5 sketch in your blog post and answer these questions:
- What did you do?
- What worked?
- What didn’t work, and what steps did you take to try to solve the issue?
- Did any code-related questions come up for you?
*Log in to your NYU account to access the documents.
**If you are struggling with your weekly exercise sketches, put your energy into writing about what didn't work and how you tried to solve it. It is totally okay to vent your frustrations. Writing a blog post helps to remember and synthesize what you did and tried to do. Think of it as writing a reference guide for your future self.
- Our class Miro board
- ICM Code syllabus (overview, grading and attendance policies, and statements)
- p5 Resources
- p5 creative coding library: Reference | Web Editor
- Video tutorials
- Written tutorials
- Allison Parrish’s Creative Coding Notes
- Lauren Lee McCarthy's Getting Started with p5.js online at NYU Library | Amazon
- HappyCoding.io
- Digital Harbor's Creative Programming Course
- Coding for Designers Demystifying Code and Learning JavaScript
- Processing Foundation Discourse: A forum for asking / answering Processing and p5 questions
- If you find yourself struggling, there are many forms of support at ITP:
- Look out for the residents' office hours and help sessions.
- Visit The Coding Lab to ask ITP student mentors about your code.
- Here are some examples of how to ask code-related questions.
In class:
- Welcome! and introductions
- Safety precautions and communicating in class
- Course overview
- What is p5?
- p5 web editor
- p5 functions
- Coding strategies
- Syllabus / schedule
Examples:
- Week 1 syllabus resources
- HTML, CSS, JavaScript / p5.js Website Demos | Code
- Our first sketch
Homework assignment due Sunday, Sept 19, at 11:59pm:
- DO
- Create a p5 web editor account.
- Have a place online to post your homework with the ability for me to provide support and feedback comments. This could be a website / blog or even a Google document. If you’re not sure what to use, please reach out to me so I can help. I will comment directly on your website / blog / Google document only, instead of email or another means, so please ensure to enable a commenting feature.
- WATCH (BEFORE EXERCISES) • Coding Train Videos 1.1-1.6 about p5, the web editor, drawing with p5, errors in the console, and code comments ~1hr 20min
- TEST YOURSELF • Complete the practice questions in Week 1 Exercises.
- CREATE • What are ways that we can draw on the HTML Canvas element with p5?
- Use 2D primitive shapes and basic color setting functions to create your own p5 screen drawing: a self-portrait, alien, animal, etc. Be sure to consult the p5 Reference!
- Add comments to your code to describe the different parts, e.g. eyes, nose, mouth, etc.
- Write a blog post that includes a link to your sketch.
- In the same post, describe how computation applies to your interests. This could be a subject you've studied, a job you've worked, a personal hobby, or a cause you care about. What projects do you imagine making this term? Are there projects that you love? Here are some examples to explore for inspiration if you need them.
- Submit your post in Week 1 Exercises.
- WATCH (AFTER EXERCISES) • Coding Train Videos 2.1-2.5 about variables,
random()
, andmap()
~1hr
In class:
- Share our homework assignments
- p5 functions
setup()
anddraw()
- Introduction to variables
- Create our own variables
- Introduction to object literals
- p5 system variables
Examples:
- Week 2 syllabus resources
- Interactive Bézier curve demos (scroll down in these resources):
- Scope: global and local variables
- Moving circles with direction and speed variables
- Object literal
- Responsive rect (size and position)
- Responsive position (bird nest and tree)
- Ellen's portrait animated with
random()
andmap()
Homework assignment due Sunday, Sept 26, at 11:59pm:
- TEST YOURSELF • Complete the practice questions in Week 2 Exercises
- WATCH (OPTIONAL)
-
Coding Train Videos 16.1-16.2 about keywords
let
,var
, andconst
~20 min - Coding Train Videos 9.1-9.3 about more p5 drawing functions, including rotation ~1hr
- Coding Train Coding Challenge #163 on Bézier curves ~23 min
-
Coding Train Videos 16.1-16.2 about keywords
- CREATE • How can we start to make our sketches more expressive? Experiment with a sketch that includes all of these:
- One element controlled by the mouse.
- One element that changes over time, independently of the mouse.
- One element that is different every time you run the sketch.
- For example, you could try refactoring your Week 1 sketch by removing all the hard-coded numbers except for
createCanvas()
. Have some of the elements follow the mouse. Move some independently. Move some at random. Or you could do the above but change color, alpha, and/or strokeWeight instead of position. Or do something completely different! - Write a blog post that includes a link to your sketch.
- Submit your post in Week 2 Exercises.
- WATCH • Coding Train Videos 3.1-3.4 about conditional statements ~1hr
In class:
- Share our homework
- Introduction to conditional statements
- With relational expressions
- With Boolean variables
- Combining expressions
Examples:
- Week 3 syllabus resources
translate()
androtate()
translate()
androtate()
withpush
andpop
- Introduction to conditionals
- Hover over 3 columns
- Boolean variables with if statements
- Toggle the switch
- Bouncing ball
Homework assignment due Sunday, Oct 3, at 11:59pm:
- TEST YOURSELF • Complete the practice questions in Week 3 Exercises
- CREATE • START IN PAIRS: In general this week, you should work with rule-based animation, motion, and interaction. You can use the ideas below or invent your own!
- Try making a rollover, button, or slider from scratch that controls the visual design or behavior of other elements in the sketch.
- And / or try working with keyboard events:
keyIsPressed
,key
,keyCode
,keyPressed()
,keyReleased()
,keyTyped()
, andkeyIsDown()
. - Can you divide an idea into two parts and combine those parts? For example, one of you codes the input behaviors and the other one codes the output behaviors.
- You can swap sketches and riff off of your partner's work.
- Or you can start and complete the assignment together or break off and finish individually.
- Everyone should write their own blog post describing their work and code contribution with link to a sketch.
- Submit your post in Week 3 Exercises.
- WATCH • Coding Train Videos 4.1-4.2 about loops and The Modulo Operator with Golan Levin ~45min
In class:
- Introduction to arrays
- Share our homework
- Introduction to loops
- Timing events
- Creative coding examples
- Anonymous check-in survey
Examples:
- Week 4 syllabus resources
- For loop introduction
- Drawing columns with a loop
- Modulo operation %
- Timing events
- Columns, rows, and grids in the wild: Test Pattern by Ryoji Ikeda, video | Generative Digital by Tyler Hobbs | Generative Art from Vera Molnar, journal | Daily Art from Saskia Freeke | Shimmer by Dave Whyte | Quarantena generativa {2020} by Anna Carreras | Works by Anni Albers | Works by Manfred Mohr | A Generative Movement Exhibit | Generative Design, Creative Coding on the Web
Homework assignment due Monday, Oct 11, at 11:59pm:
- TEST YOURSELF • Complete the practice questions in Week 4 Exercises.
- CREATE • What repeats in your life or is cyclical? What patterns do you find in nature, architecture, textiles, conversations? Make a sketch with a lot of repetition, more than you want to hand-code. Some ideas to get started:
- You might take a previous sketch with a lot of repetition, and re-write it with a loop. For example, instead of needing 30 lines of code to call
rect()
, callrect()
once inside of a loop that goes around 30 times. Look for a pattern. How do you need to rework the way you position thatrect()
inside the loop? - Try creating an algorithmic design with simple parameters. One example is to invent your own 10PRINT design. See Coding Train Coding Challenge: 10PRINT and the example code. A related source of inspiration: Sol Lewitt's Wall Drawings.
- Make a mini-calendar. Use iteration to render a row of visual elements for each of the days of the current month. All of the elements should be drawn identically, except for the one whose index corresponds to the current day. Differentiate this element in some way. Consider using p5's
day()
function. (Source: Code as a Creative Medium.) - Write a blog post that includes a link to your sketch.
- Submit your post in Week 4 Exercises.
- You might take a previous sketch with a lot of repetition, and re-write it with a loop. For example, instead of needing 30 lines of code to call
- WATCH • Coding Train Videos 5.1-5.2 about functions and Videos 7.1-7.2 about arrays ~50 min
In class:
- Update our random name generator
- Share our homework
- More with arrays
- Index positions
- Use a loop to iterate through array values
- Introduction to functions
- Writing functions
- Calling them with and without arguments
Examples:
- Week 5 syllabus resources
- Random name generator updated
- Iterating through array values
- The Great Balloon Race
- Refactored portrait
- RGB vs HSB vs HSL color modes
- HSB vs HSL color wheels
Homework assignment due Sunday, Oct 17, at 11:59pm:
- TEST YOURSELF • Complete the practice questions in Week 5 Exercises.
- CREATE • We can organize our code into discrete code blocks, functions, to reuse over and over, such as to create different expressions of similar elements (e.g. position, size, speed, color). The idea for this week is to practice writing and using your own functions.
- It is 100% legitimate to turn in a version of a previous assignment where nothing changes for the end user, but the code has been restructured (refactored) into functions.
- You can also try a new experiment from scratch! For example, can you draw a landscape of varying plants by calling the “plant function” with different arguments? Or create a family of varying creatures? Or draw the same design multiple times but with different characteristics?
- For either option, aim to keep
setup()
anddraw()
as clean as possible, and do everything (all calculations, drawing, etc.) in functions that you create yourself. Try to incorporate the following:- Break the code out of
setup()
anddraw()
into functions. - Call at least one of your functions multiple times with different arguments.
- For anything that repeats and you notice a pattern, use a loop to make it happen.
- Break the code out of
- Write a blog post that includes a link to your sketch.
- Submit your post in Week 5 Exercises.
- WATCH • Coding Train Videos 6.2 - 6.3 and 7.3-7.7 on making lots of objects with a class (a special function) and Video 6.4 on organizing your code into separate files ~2hr
In class:
- Update our random name generator (again!)
- Share our homework
- Introduction to classes to make objects
- Using classes (and objects) with arrays and loops
- Mouse interaction with objects
- Communication between objects
- Creative coding examples
Examples:
- Week 6 syllabus resources
- Week 6 remix of syllabus resources by John Henry
- p5 demos:
- Additional resources:
- Coding Train Video 7.8 on adding images to objects 17min
- Nature of Code Video 3.4: Polar Coordinates (don't worry about the vectors) ~17min
- Nature of Code Video 5.7: Path Following (this material is about midway through the course, and it would be useful to watch the preceding videos for context) ~16 min
- Possible inspiration: Arrels by Anna Carreras | uneasy dream by Manolo Gamboa Naon and more work! | Cyber Forest by Lilian | Delicate Boundaries by Chris Sugrue | Keyfleas by Miles Hiroo Peyton | Coding Train Coding Challenge #124: Flocking Simulation | boxcard2d
Homework assignment due Sunday, Oct 24, at 11:59pm:
- TEST YOURSELF • Complete the practice questions in Week 6 Exercises.
- CREATE • We can scale our programs by writing classes to create multiple objects, each with their own properties and behaviors, instead coding them all by hand. The idea this week is to practice designing a sketch in an object-oriented fashion, or a drawing program.
- Part 1: Here are some ideas to get started, but you can also create something from scratch! Try making a game, generate a calming or energetic visualization, grow a garden of “plant” objects, create a scene with weather, or design a drawing program.
-
Part 2: Write a blog post that includes a link to your sketch.
- What was your goal or inspiration?
- What does your sketch do? If it's interactive, deconstruct the interaction(s) to produce the effect(s).
- Explain what you did in your code to produce the results.
- Practice any new vocabulary you’ve acquired for describing technical work.
- What code-related questions came up for you?
- Part 3: Prepare a 5-minute presentation to share with the class to introduce your sketch, choose one interaction to demo (which one is the most interesting to you?), and walk us through the related code. Use your blog post as an outline to help you plan out everything you want to share.
- Submit your post in Week 6 Exercises.
- WATCH
- Method 1 • Coding Train Video 8.1 on creating HTML elements on a webpage with HTML tags ~13min
- Method 2 • Videos 8.2 and 8.4 on creating HTML elements with p5 ~20min
- (OPTIONAL) Videos 8.3 and 8.5-8.10 for more on HTML and CSS with p5 ~1hr 45min
In class:
- Introduction to the Document Object Model (DOM)
- Adding HTML elements, tags vs. p5
- Styling HTML elements
- Present final exercises
Examples:
- Week 7 syllabus resources
- MDN Web Docs:
- Introduction to the DOM
- HTML Elements Reference (a list of all possible tags)
- Intro to CSS
- Best Website Ever v1 (HTML elements added with tags)
- Best Website Ever v2 (HTML elments added with JavaScript (p5))
- Best Website Ever v3 (Styling separated into style.css)
- DOM elements with p5 (links TBA):
Homework assignment due Sunday, Oct 31, at 11:59pm:
- TEST YOURSELF • Complete the practice questions in Week 7 Exercises.
- POST • Write a short blog post reflecting on this week's practice questions and the topics from the first half of the semester:
- What do you feel confident about?
- What would you like to practice more?
- Is there anything else that you would like to learn more about, including and beyond our weekly topics so far?
- Submit your post in Week 7 Exercises.
- READ • Allison Parrish's Media: Images
- WATCH • Coding Train Video on Uploading Media Files in the p5.js web editor, Video 7.8 on adding images to objects, and Video 11.3 on the pixel array ~40 min
👉 Starting Week 8 (Nov 1) we'll use the ICM-2021-Media Homework Ellen 07 Wiki