Today:
sketch
//this is a comment
function setup(){
createCanvas(500,500);
}
function draw(){
//main loop
//each run of draw is a frame
}
Javascript is weakly typed
var x = 0;
let y = 0;
We covered setup and draw. There is also
function mousePressed(){}
function keyPressed(){}
function keyTyped(){}
function preload(){
//load media here
img = loadImage('assets/quality_meme.jpg');
}
Example code - preloading an image
ellipse(mouseX,mouseY,20);
Keypresses, mouse movement and clicks are examples of input and interaction
Similar to Processing/Java
for (var i = 0; i < 10; i++){
print(i) // will print 1, 2, 3...to 9 on separate lines
}
Don’t forget you may see let
instead of var
Arrays can be described literally. They always start with 0.
let array = ['zeroeth','first','second','last'];
console.log(array[0]); //will print zeroeth to console
let numArray = [0, 1, 2];
array.push(3);
array.push(4);
console.log(array); //will result [0, 1, 2, 3, 4]
//continuing from above
array.pop();
console.log(array); //will result [0, 1, 2, 3]
Using the Console
Code examples in p5js can be found here
A devlog is a way to capture our work in progress.
In this course we will be constantly experimenting. Our work may break. We may do dozens, perhaps hundreds, of iterations while we work. We may produce finished projects and these may serve as in-progress updates, or our projects may not come to fruition and instead live-out in posts with a screenshot or two or a research image and a few lines description and some code snippets.
Dev stands for development and refers to how we slowly over time work to develop our projects iteratively.
Why keep a devlog (beyond because I’m asking you to for our class)?
Writing about your projects helps you formulate ideas, struggle to find solutions, and let you reflect on choices you may have made intuitively. A devlog serves as a digital notebook that you can refer back to later (months, years?) when you need to re-learn how to do something you’ve forgotten. It’s also a way to organize your thoughts. It can turn into sources you refer to when building a portfolio. Or just serve as an internal way to see your own progress in learning and making. It can also be a way to share your own knowledge or art with others. And it may even lead to people getting in touch to talk about your ideas or art. It’s also a good practice to keep a devlog when working on longterm projects like one’s senior project.
These are example devlogs by artists, designers and programmers writing about their projects and especially their research and mid-stage projects:
I have attempted to simplify this process, but this is still a technical process.
lee's devlog
or whatever you want. I called mine algoraves
. Add a short description such as “My class devlog for Drawing, Moving, and Seeing with Code.”2021-02-11-your-filename.md
. It’s good practice to have the date and a name that refers to what you’re writing about. Let’s change this to 2021-02-11-algorithmic-walk.md
. The .md means this is a markdown file.[my algorithmic walk](2021-02-11-algorithmic-walk.md)
Then preview, save and commit.“… perhaps AARON would be better described as an expert’s system than as an expert system: not simply because I have served as both knowledge engineer and as resident expert, but because the program serves as a research tool for the expansion of my own expert knowledge rather than to encapsulate that knowledge for the use of others,” Cohen wrote in 1988.
Harold Cohen resisted ascribing human-like characteristics or the appearance of sentience to AARON. In the statement above, he describes AARON as a tool for the expansion of his own expert knowledge. This is a software tool. Describe an example of a theoretical tool (for you) that you could use to make an artwork (or dance, theater piece, music, film, etc - depending on your interest and creative practice). What would the tool do? What kind of functions would it have? What might it be called? What limit might it have that would require you to step in and collaborate with your software-tool to finish the piece?