Art 22 - Introduction to Computer Programming in the Arts, Fall 24

Instructor: Lisa Jevbratt
TA: Emily D'Achiardi
Emily's class page

Syllabus (pdf)
Class Description

Using a project-based approach, the basic components of web development and computer programming and are explored in different markup and programming languages such as HTML/CCS, JavaScript and P5.js. The class is intended to create an understanding of computer programming in general, its use and cultural implications, as well as providing a foundation for utilizing programming in a wide range of projects, from traditional to new media.
Students
Tyler Alexander
Yaeli Dukler
Haley Harcke
Hannah Helmy
Julianna Jacobs-Vargas
Catalina Landreau
Masayo Machii
Lara Love
Taneesha Panda
Benny Ruehlman
Taili Sherwood-Kong
Brooke Slovensky
Isabel Thornton
Nicole Trujillo
Lexie Tucker
Andy Zhai

Week 1:

Tue. 10/1) Class Introduction / HTML

In class:
Downloading/installing class software
Download the text editor Brackets (for writing code) and install it on your computer.

Download the SFTP program Cyberduck (for uploading files) and install it on your computer.
Lab working on basic html page.

Tutorials

W3 Schools HTML Basics
Thur. 10/3) HTML/CSS

In class: Lecture introducing more HTML/CSS.
Lab working on homepage.

Due: A basic webpage on our server
Make a very basic web page that shows "Hello World!" or something else in a web browser and save it to our server. (There is a tradition in the programming world making your first program write out "Hello World!")

Use Brackets to write your html code. Look at the examples on this page and at the tutorials.
  1. Use the HTML and the BODY tag.
  2. Save the file on your computer.
  3. Name the page 'hello.html'
To save your HTML file (and folder to put it in) on our class server:
  • In the SFTP software Cyberduck connect to our class server (File -> Open a connection ...)
  • Settings in Cyberduck:
    1. SFTP (SSH File Transfer Protocol)
    2. Server: 'class.arts.ucsb.edu'
    3. Username:'art22'
    4. Password: will give in class
    5. SSH Private Key: None
  • Navigate to 'Sites/f_24'
  • Create a folder (File->New Folder) in the 'f_24' folder called 'yourlastname_yourfirstname' all lower case.
  • Drag your html file from your computer to the folder
  • The url will be https://class.arts.ucsb.edu/~art22/f_24/​yourlastname_yourfirstname/hello.html

Tutorials etc.

W3 Schools HTML Elements
W3 Schools HTML CSS intro
W3 Schools HTML Links
W3 Schools HTML Images
W3 Schools HTML Div
W3 Schools CSS Intro
W3 Schools CSS Styling Links
W3 Schools CSS Fonts
W3 Schools HTML Entities
W3 Schools CSS Using Google Fonts
Google Fonts

Examples:

One image
One centered image
Several images
Same look as above but using a separate style file.
Linking
Google fonts and special characters
Google fonts 2
div and span

Week 2:

Tue. 10/8) p5.js Intro

Due: Homepage
  • Make a homepage in HTML that reveals something about you.
  • It should have an image of yourself, your name, and a link to a website you think is interesting.
  • The page should be named home.html
  • Use CSS to set the background color, text color, font etc.
  • The page should be readable both on your mobile device and on desktops.
  • Make sure you name your page correctly (if it does not show up when you click on your name under "students" above, you did not name it correctly.)

Examples

Simple shapes
Thur. 10/10) Examples of programming in arts, p5.js continued

Due: Art Example
  • Find an interesting artwork that was created using computer programming. It is not enough that it was created using video/image/sound software.
  • Make a webpage that has:
    • an image of the artwork
    • a paragraph you write about why you selected the work and how it uses computer programming.
    • a link to a website discussing the project.
  • Make a link to the page on your homepage. Use the number "1. Art Example" (i.e the part you click on should say "1. Art Example" )


Examples

Increment: changing stroke

Week 3:

Tue. 10/15) p5.js Variables, Increments

Due: Continue to work on drawing and watch code train videos

Examples:

Increment: changing stroke
Increment: movement and color
Thur. 10/17) p5.js variables, conditional statements

Due: 2. code drawing
  • Make an account at p5.js Editor
  • Make a drawing that reveals something about the world using only the 2D primitive shapes listed in the p5.js Reference (Shape -> 2D Primitives), color and movement (by incrementing a variable).
  • Use all the 2D primitive shapes listed
  • Use a lot of shapes
  • Make parts in your drawing move and change color/shape by incrementing variables.
  • Link to your sketch from your homepage:
    • In the p5.js editor go File->Share, copy the URL in the edit window
    • Use the URL you copied in the href attribute in your link.
    • Name the link "2. The World".

Examples

if, back to start and color change
if, timing

Week 4:

Tue. 10/22) p5.js conditional statements, mouseX/mouseY,createGraphics, random()

Due: 2b. Updated drawing
Make a copy of your drawing sketch due last week. Make changes to the copy:
  • Use if statements to make visible changes to the drawing
  • Link to the sketch from your homepage. Name the link "2b. p5 Drawing Updated"

Examples

mouseX, mouseY
createGraphics 1
Simple Random
Random
Random words (and array)
if, mouseX
if and, mouseX and mouseY
if, Bouncing Ball
if/else
if/else, pattern

Video Tutorials:

The Coding Train p5.js: Intro
The Coding Train p5.js: Editor
The Coding Train p5.js: Shapes and Drawing
The Coding Train p5.js: Color
The Coding Train p5.js: Errors
The Coding Train: Defining Variables
The Coding Train: Incrementing Values
The Coding Train p5.js: Conditional Statements
The Coding Train p5.js: Conditional Statements 2
The Coding Train p5.js: createGraphics
The Coding Train: Variables - Mouse Input
Thur. 10/24) p5 conditional statements, mouseX/mouseY,createGraphics, random() continued, putting your sketches on our server
createGraphics 2
if/else, pattern 2
the above sketch as a separate HTML file

Week 5:

Tue. 10/29) Exercise 3 crit. p5.js Loops, Arrays, Data Visualization.

Due: 3. Interact
Make a p5.js sketch that uses interactivity in an interesting way. In addition, the sketch should use conditional statements to determine how it looks and functions. You have to use:
  • mouseX, mouseY
  • if/if else/else if
  • random()
  • IMPORTANT Do not copy code from outside sources if you don't understand it completely.
  • Make a link to the sketch on your homepage. Use the number "3." in the link
  • OPTIONAL - Make a webpage with the sketch, link to the webpage from your homepage. Use the number 3 in your link.


References

W3 Schools JavaScript: For Loop
p5.js: map() function

Tutorials

The Coding Train p5.js: While and For Loops
The Coding Train p5.js: Arrays
The Coding Train p5.js: Arrays and Loops
The Coding Train p5.js: map()

Examples

Array
For Loop
Array and For Loop
UFO Data 1 (Array, For, Map)
Thur. 10/31) p5.js Loops, Arrays, Data Visualization.

Due: 4a. Array/Loop

Modify one of the examples shown in class on Tuesday. Try to understand how for/array/map (whatever your chosen example use) works. Make a link to the sketch (in the editor) on your homepage. Use "4a." in your link.
Examples:
UFO Data 2 (Array, For, If, Map)
UFO Data 3 (Array, For, If, Map)
earthquake data realtime simple (JSON)
earthquake data realtime (JSON, for loop)
earthquake data realtime coordinates (JSON, for loop)

Week 6:

Tue. 11/5) p5.js Loops, Arrays, Data Visualization.

Examples:
p5 sketch in HTML page
p5 sketch in HTML page modified
Thur. 11/7) Crit and p5.js: large scale images and SVG files for printing and laser cutting

Due: 4. Data Visualization

Make an interesting visual representation of some data (at least 50 data points) stored in an array or read in from the internet. You can use my example data sets or find some data you are interested in. The data could be in JSON format or an array in your program. You can for example find data files on the "CORGIS" site. USGS have several different kinds of earthquake data in JSON format
  1. Make your own visualization, it should look very different from the visualizations in my examples.
  2. Make a separate html page with the sketch, make a link to that page on your homepage. Use the "4." in your link name.

Examples:

pixelDensity() and save() for printing images
Drawing tool
Drawing tool 2
Drawing tool 3
Simple loop in loop 1
Simple loop in loop 2
Basic sketch using sine/cosine
Circles: for loops, sine/cosine (PNG)

SVG (Scalable Vector Graphics) for laser cutting
Simple loop in loop, Cutting
Loop in loop with rotating squares, Cutting
Loop in loop with rotating squares 2, Cutting, (SVG)
Circles: for loops, sine/cosine 1, Cutting/Engraving
Circles: for loops, sine/cosine 2, Cutting/Engraving, ( SVG)

To create SVG images in p5, you have to include p5.svg.js in your project. The easiest way to do this is to make a copy of this or one of the SVG examples above and work from there. Or if you want to work on the script inside an html page you can start with this example.

Tutorials:
Coding train nested loops
For Loops and While Loops in p5.js: How to Code Generative Art
Translate and rotate in p5.js: How to Code Generative Art
Sine and Cosine in p5.js: How to Code Generative Art
More useful functions in p5.js: How to Code Generative Art

Week 7:

Tue. 11/12) p5.js: large scale images and SVG files for printing and laser cutting
Thur. 11/14) Lab

Week 8:

Tue. 11/19) Printing and laser cutting in M-Studio and the 3D Fabrication Lab, Final Project Introduced


DO NOT BE LATE! We will meet up only briefly in estudio.

Due: 5. Out of the computer
Select one of these options:

1. Make two high resolution "generative" images for color printing.
  • Make two (or more) generative drawings
  • You have to use loops and variables
  • Do not just mess with the numbers in my examples, make major changes to the actual code if you start with my examples (or anyone else's example).
  • You have to set the pixelDensity() to increase the resolution of your images
  • You will have two 13"x19" papers (matt premium presentation paper) to print on. The shortest side of your image should be 12" and the longest no longer than 18". Check in photoshop or other image software.
  • The resolution should be 150-300 dpi.
  • Be aware that highly saturated colors will be less saturated when printed.
  • Make a links to the p5.js sketches on your homepage. Include "5a. p5 sketch" and "5b. p5 sketch" in the link names
  • Make a links to the png files on your homepage. Include "5a. png" and "5b. png" in the link names

2. Make a drawing tool and produce two high resolution images for color printing.
  • Make a drawing tool, use it yourself to make one image and have someone else use it to make one image.
  • Do not just mess with the numbers in my examples, make major changes to the actual code if you start with my examples (or anyone else's example).
  • You have to set the pixelDensity() to increase the resolution of your images
  • You will have two 13"x19" papers (matt premium presentation paper) to print on. The shortest side of your image should be 12" and the longest no longer than 18". Check in photoshop or other image software.
  • The resolution should be 150-300 dpi.
  • Be aware that highly saturated colors will be less saturated when printed.
  • Make a links to the p5.js sketches on your homepage. Include "5a. p5 sketch" and "5b. p5 sketch" in the link names
  • Make a links to the png files on your homepage. Include "5a. png" and "5b. png" in the link names

3. Make one or more SVG files for laser cutting and engraving. The imagery should be generative.
  • The shapes for engraving and cutting should be generated by programming.
  • You have to use loops and variables.
  • You will have one 1/8 thick 10x10 inch bass wood sheet to cut and engrave, you can make one or several shapes.
  • Use a strokeWeight(1) red line, rgb(255,0,0), for lines to cut.
  • Use a a strokeWeight(1) blue line, rgb(0,0,255), for lines to engrave.
  • Use noFill() on all shapes.
  • Open your SVG in illustrator or Inkscape.
  • Check/change the size of the shapes.
  • Check/change the colors of the shapes, make sure they are as described above.
  • Change the width of your lines to be 0.1 pt. (You drew the thicker because it is harder to see very fine lines while you are working.)
  • Make it as complex as possible without having too many lines overlapping.
  • Make links to the code sketches/pages on your homepage. Label the links "5a. Laser Cutting" , "5b. Laser Cutting" etc.
  • Make links to the SVG files on your homepage. Label the links "5a. SVG", "5b. SVG" etc.

Thur. 11/21) Prints/cuts Crit. and Final project discussions and lab

Due:
1. Final Project Proposal
Look at the final project prompt in week 10. Come up with an idea. Write a proposal including written descriptions of:
  • What is the end medium: web based interactive program, prints, laser cut objects ...?
  • What will your program do? - Will it visualize data, transform user input etc.
  • Why you want to make this specific project?
  • What do you want your audience to experience/feel/think/learn/question and why?
Make a separate web page with the proposal. Make a link to the page on your homepage. Label the link "Final: Proposal"

Week 9:

Tue. 11/26) Final Project Lab
Due:
1. Final Project Technical Test
Make a test program(s) of the core programming features you will using in your final project. Do not focus on how it looks/sounds. This test is for you to understand how you will solve technical problems.
Make a link to the test on your homepage (to the p5 editor sketch or in a separate web page), label the link "Final: Test".

Examples:
Sound visualization, SVG
SVG drawing tool
dots on slope
Hauntings
SVG in HTML
Thur. 11/28) THANKSGIVING

Week 10:

Tue. 12/3) Final Project Lab
Due: Final Progress
Make a link to your latest file, label it "Final progress". Make a copy of the file and continue to work on the copy.
Thur. 12/5) Final Project Crit
Due: Final Project
Make an art project using p5.js. The project could take many different forms depending on your interests.

The project should be meaningful as an art project. Think about what you want to say, communicate, evoke. Depending on who you are as an artist and what is important for you as an artist and human, the project can be personal, political, humorous, serious, expressive, minimalistic, deal with a specific issue, be a formal aesthetic exploration etc...
You can build the project on something you already made but it has to be significantly more complex and different from the starting point.
The project could be:
  • A project displayed in a web page.
  • A series of prints
  • Laser cut objects
The program you write could:
  • Use various kinds of user input: clicks, mouse movements, but also sound, gestures, typing etc.
  • Create generative images/animations using loops.
  • Visualize data
  • Generate sound
  • Filter images
  • Be a tool
  • Etc...
If you choose to do a project that resides in a web page, make a link to the page on your homepage.
If you make prints or laser cut objects, bring prints/objects to class and document your project (including photos of laser cut work) on a web page and link to to it from your homepage.
Label the link "Final Project"

Text editor we will use:

Brackets, a basic free text editor (Mac/Windows/Linux)

SFTP client for uploading files to our server:

Cyberduck, sftp client (free)(Mac/Windows/Linux)

You can also try these text editors:
Sublime, a good text editor for Mac/Windows/Linux (free for some time, then you will be asked to pay but can continue to use for free)
Visual Studio Code, a good text editor for Mac/Windows/Linux
BBEdit, a good text editor for Mac (free version available)
Notepad ++, a popular text editor for Windows (free)

Free image editing software: Krita
Free vector image software: Incscape

Examples:

HTML

Programming Books/Tutorials/References:

HTML5
CSS
JavaScript
O'Reilly Computer Book Library (Free for UCSB students, use your credentials to log in)
HTML CSS and JavaScript for Beginners - A Web Design Course (log in on link above) Example files
The Essential Guide to HTML5 - Using Games to Learn HTML5 and JavaScript (log in on link above) Example files
p5.js Reference

Other Books/Tutorials/References:

Visual Patterns: Neuroscience Implications
Sine and Cosine Explained Visually

Tools:

CORGIS data (The Collection of Really Great, Interesting, Situated Datasets)
Kaggle Data, several kinds of data
HTML5 compatibility on mobile and tablet browsers
HTML Validation

History:

Top Secret Rosies: The Female Computers of WWII
The first website