diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..93c4b27b4 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: processing +custom: https://processingfoundation.org/ diff --git a/.gitignore b/.gitignore index 367672981..27c953a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ about/ contrib_generate/contribs.txt # File now built on the server side; don't need to track here contrib_generate/contributions.txt # File now built on the server side; don't need to track here *~ +/bin/ diff --git a/README.md b/README.md index c0183179c..60a674da3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ +> ⚠️ This repository is now deprecated and will be archived soon. If you have any issues or want to submit a pull request, please direct them to the [processing-website](https://github.com/processing/processing-website) repo. Make sure to check the [README](https://github.com/processing/processing-website/blob/main/README.md) for information on how to contribute to the documentation. + + + Processing Documentation ========== -This is the official source code for the Processing reference, examples, tutorials, and [processing.org](http://processing.org) web site. +~~This is the official source code for the Processing reference, examples, tutorials, and [processing.org](http://processing.org) web site.~~ -If you have found an error in the Processing reference, examples, tutorials, or website you can file it here under the ["issues" tab](https://github.com/processing/processing-docs/issues). +~~If you have found an error in the Processing reference, examples, tutorials, or website you can file it here under the ["issues" tab](https://github.com/processing/processing-docs/issues).~~ -The [processing](https://github.com/processing/processing) repository contains the source code for Processing itself. (Please use that link to file issues regarding the Processing software.) +~~The [processing](https://github.com/processing/processing) repository contains the source code for Processing itself. (Please use that link to file issues regarding the Processing software.)~~ diff --git a/content/api_en/LIB_net/clientEvent.xml b/content/api_en/LIB_net/clientEvent.xml index b71892510..d831f37a4 100755 --- a/content/api_en/LIB_net/clientEvent.xml +++ b/content/api_en/LIB_net/clientEvent.xml @@ -19,25 +19,27 @@ int dataIn; void setup() { size(200, 200); myClient = new Client(this, "127.0.0.1", 5204); + noLoop(); } -void draw() { } // Empty draw keeps the program running +void draw() { + background(dataIn); +} -// ClientEvent message is generated when the server -// sends data to an existing client. +// ClientEvent message is generated when the +// server sends data to an existing client. void clientEvent(Client someClient) { print("Server Says: "); - dataIn = myClient.read(); + dataIn = someClient.read(); println(dataIn); - background(dataIn); - + redraw(); } ]]> diff --git a/content/api_en/LIB_sound/Waveform.xml b/content/api_en/LIB_sound/Waveform.xml new file mode 100644 index 000000000..4251ddd60 --- /dev/null +++ b/content/api_en/LIB_sound/Waveform.xml @@ -0,0 +1,107 @@ + + + +Waveform + +Sound + +Analyzer + +Application + + + + + + + + + + + + + + + + +input() +Define the audio input for the analyzer + + + +analyze() +Gets the last nsamples captured from the connected input sound source, writes them + into this Waveform's `data` array, and returns it. + + + +stop() +Stop the analyzer + + + +data +`float[]` of length nsamples, with the sample amplitudes between `-1` and `1` + + + +Waveform(parent) + + + +parent +PApplet: typically use "this" + + + + + + + +Object + +Library + + diff --git a/content/api_en/PImage_filter.xml b/content/api_en/PImage_filter.xml index 30df9a9da..f30582ad1 100755 --- a/content/api_en/PImage_filter.xml +++ b/content/api_en/PImage_filter.xml @@ -156,7 +156,7 @@ POSTERIZE
Limits each channel of the image to the number of colors specified as the parameter. The parameter can be set to values between 2 and 255, but results are most noticeable in the lower ranges.

BLUR
-Executes a Guassian blur with the level parameter specifying the extent of the blurring. If no parameter is used, the blur is equivalent to Guassian blur of radius 1. Larger values increase the blur.
+Executes a Gaussian blur with the level parameter specifying the extent of the blurring. If no parameter is used, the blur is equivalent to Gaussian blur of radius 1. Larger values increase the blur.

ERODE
Reduces the light areas. No parameter is used.
diff --git a/content/api_en/include/equality.xml b/content/api_en/include/equality.xml index bbb16aa3a..a47eac505 100755 --- a/content/api_en/include/equality.xml +++ b/content/api_en/include/equality.xml @@ -20,9 +20,10 @@ if (a == b) { +Determines if two values are equivalent. Please note the equality operator (==) is different from the assignment operator (=) and although they look similar, they have a different use. If you're comparing two variables, the equality operator (==) only works with primitive data types like int, boolean, and char. It doesn't work with composite data types like Array, Table, and PVector.
+
+Note that when comparing String objects, you must use the equals() method instead of ==. See the reference for String or the troubleshooting note for more explanation.

-Note that when comparing String objects, you must use the equals() method instead of == to compare their contents. See the reference for String or the troubleshooting note for more explanation. ]]>
diff --git a/content/api_en/include/intconvert.xml b/content/api_en/include/intconvert.xml index f14376165..56ba6ddb8 100755 --- a/content/api_en/include/intconvert.xml +++ b/content/api_en/include/intconvert.xml @@ -20,7 +20,7 @@ println(c + " : " + i); // Prints "E : 69" boolean, byte, char, color, float, int, or long) to its integer representation.
+Converts any value of a primitive data type (boolean, byte, char, color, float, int, or long) or String to its integer representation.

When an array of values is passed in, then an int array of the same length is returned. ]]>
diff --git a/content/api_en/noSmooth.xml b/content/api_en/noSmooth.xml index aa1ceec8d..d40dd92e6 100755 --- a/content/api_en/noSmooth.xml +++ b/content/api_en/noSmooth.xml @@ -38,7 +38,7 @@ void draw() { smooth() is active by default, so it is necessary to call noSmooth() to disable smoothing of geometry, fonts, and images. Since the release of Processing 3.0, the noSmooth() function can only be run once for each sketch, either at the top of a sketch without a setup(), or after the size() function when used in a sketch with setup(). See the examples above for both scenarios. +Draws all geometry and fonts with jagged (aliased) edges and images with hard edges between the pixels when enlarged rather than interpolating pixels. Note that smooth() is active by default, so it is necessary to call noSmooth() to disable smoothing of geometry, fonts, and images. Since the release of Processing 3.0, the noSmooth() function can only be run once for each sketch, either at the top of a sketch without a setup(), or after the size() function when used in a sketch with setup(). See the examples above for both scenarios. ]]> diff --git a/content/api_en/textFont.xml b/content/api_en/textFont.xml index 30b9bb236..ebf06c7d6 100755 --- a/content/api_en/textFont.xml +++ b/content/api_en/textFont.xml @@ -14,7 +14,7 @@ PFont mono; // The font "andalemo.ttf" must be located in the // current sketch's "data" directory to load successfully -mono = loadFont("andalemo.ttf", 32); +mono = createFont("andalemo.ttf", 32); background(0); textFont(mono); text("word", 12, 60); diff --git a/content/api_en/textWidth.xml b/content/api_en/textWidth.xml index 7d5db2aea..b2adacc25 100755 --- a/content/api_en/textWidth.xml +++ b/content/api_en/textWidth.xml @@ -4,7 +4,7 @@ Typography -Attributes +Metrics diff --git a/content/examples/Basics/Form/RegularPolygon/RegularPolygon.pde b/content/examples/Basics/Form/RegularPolygon/RegularPolygon.pde index 09379230c..52d8f81af 100644 --- a/content/examples/Basics/Form/RegularPolygon/RegularPolygon.pde +++ b/content/examples/Basics/Form/RegularPolygon/RegularPolygon.pde @@ -24,7 +24,7 @@ void draw() { pushMatrix(); translate(width*0.5, height*0.5); rotate(frameCount / 50.0); - polygon(0, 0, 80, 20); // Icosahedron + polygon(0, 0, 80, 20); // Icosagon popMatrix(); pushMatrix(); diff --git a/content/examples/Basics/Structure/Coordinates/Coordinates.pde b/content/examples/Basics/Structure/Coordinates/Coordinates.pde index 222ab50d6..dce834d05 100644 --- a/content/examples/Basics/Structure/Coordinates/Coordinates.pde +++ b/content/examples/Basics/Structure/Coordinates/Coordinates.pde @@ -4,9 +4,9 @@ * All shapes drawn to the screen have a position that is * specified as a coordinate. All coordinates are measured * as the distance from the origin in units of pixels. - * The origin [0, 0] is the coordinate is in the upper left + * The origin (0, 0) is the coordinate is in the upper left * of the window and the coordinate in the lower right is - * [width-1, height-1]. + * (width-1, height-1). */ // Sets the screen to be 640 pixels wide and 360 pixels high @@ -16,11 +16,11 @@ size(640, 360); background(0); noFill(); -// The two parameters of the point() method each specify coordinates. -// The first parameter is the x-coordinate and the second is the Y +// The two parameters of the point() function define its location. +// The first parameter is the x-coordinate and the second is the y-coordinate stroke(255); -point(width * 0.5, height * 0.5); -point(width * 0.5, height * 0.25); +point(320, 180); +point(320, 90); // Coordinates are used for drawing all shapes, not just points. // Parameters for different functions are used for different purposes. @@ -28,10 +28,10 @@ point(width * 0.5, height * 0.25); // the coordinates of the first endpoint and the second two parameters // specify the second endpoint stroke(0, 153, 255); -line(0, height*0.33, width, height*0.33); +line(0, 120, 640, 120); -// By default, the first two parameters to rect() are the -// coordinates of the upper-left corner and the second pair -// is the width and height +// The first two parameters to rect() are the coordinates of the +// upper-left corner and the second pair is the width and height +// of the rectangle stroke(255, 153, 0); -rect(width*0.25, height*0.1, width * 0.5, height * 0.8); +rect(160, 36, 320, 288); diff --git a/content/examples/Basics/Structure/Loop/Loop.pde b/content/examples/Basics/Structure/Loop/Loop.pde index 1ad323f34..4c9ae5574 100644 --- a/content/examples/Basics/Structure/Loop/Loop.pde +++ b/content/examples/Basics/Structure/Loop/Loop.pde @@ -1,14 +1,13 @@ /** * Loop. * - * The loop() function causes draw() to execute - * continuously. If noLoop is called in setup() - * the draw() is only executed once. In this example - * click the mouse to execute loop(), which will - * cause the draw() the execute continuously. + * If noLoop() is run in setup(), the code in draw() + * is only run once. In this example, click the mouse + * to run the loop() function to cause the draw() the + * run continuously. */ -float y = 100; +float y = 180; // The statements in the setup() function // run once when the program begins @@ -16,18 +15,11 @@ void setup() { size(640, 360); // Size should be the first statement stroke(255); // Set stroke color to white noLoop(); - - y = height * 0.5; } -// The statements in draw() are run until the -// program is stopped. Each statement is run in -// sequence and after the last line is read, the first -// line is run again. void draw() { - background(0); // Set the background to black + background(0); // Set the background to black line(0, y, width, y); - y = y - 1; if (y < 0) { y = height; diff --git a/content/examples/Basics/Structure/NoLoop/NoLoop.pde b/content/examples/Basics/Structure/NoLoop/NoLoop.pde index 595de53ea..9fc29afcf 100644 --- a/content/examples/Basics/Structure/NoLoop/NoLoop.pde +++ b/content/examples/Basics/Structure/NoLoop/NoLoop.pde @@ -1,34 +1,26 @@ /** * No Loop. * - * The noLoop() function causes draw() to only - * execute once. Without calling noLoop(), the - * code inside draw() is run continually. + * The noLoop() function causes draw() to only run once. + * Without calling noLoop(), the code inside draw() is + * run continually. */ -float y; +float y = 180; -// The statements in the setup() function -// execute once when the program begins -void setup() -{ +// The statements in the setup() block +// run once when the program begins +void setup() { size(640, 360); // Size should be the first statement - stroke(255); // Set line drawing color to white + stroke(255); // Set line drawing color to white noLoop(); - - y = height * 0.5; } -// The statements in draw() are executed until the -// program is stopped. Each statement is executed in -// sequence and after the last line is read, the first -// line is executed again. -void draw() -{ +// In this example, the code in the draw() block +// runs only once because of the noLoop() in setup() +void draw() { background(0); // Set the background to black + line(0, y, width, y); y = y - 1; if (y < 0) { y = height; } - line(0, y, width, y); } - - diff --git a/content/examples/Basics/Structure/SetupDraw/SetupDraw.pde b/content/examples/Basics/Structure/SetupDraw/SetupDraw.pde index 5c46b53d3..53e73d576 100644 --- a/content/examples/Basics/Structure/SetupDraw/SetupDraw.pde +++ b/content/examples/Basics/Structure/SetupDraw/SetupDraw.pde @@ -2,28 +2,28 @@ * Setup and Draw. * * The code inside the draw() function runs continuously - * from top to bottom until the program is stopped. + * from top to bottom until the program is stopped. The + * code in setup() is run once when the program starts. */ -int y = 100; +int y = 180; -// The statements in the setup() function -// execute once when the program begins +// The statements in the setup() block run once +// when the program begins void setup() { size(640, 360); // Size must be the first statement - stroke(255); // Set line drawing color to white - frameRate(30); + stroke(255); // Set line drawing color to white } -// The statements in draw() are executed until the -// program is stopped. Each statement is executed in -// sequence and after the last line is read, the first -// line is executed again. + +// The statements in draw() are run until the program +// is stopped. Each statement is run in sequence from top +// to bottom and after the last line is read, the +// first line is run again. void draw() { - background(0); // Clear the screen with a black background + background(0); // Clear the screen with a black background + line(0, y, width, y); y = y - 1; if (y < 0) { - y = height; - } - line(0, y, width, y); + y = height; + } } - diff --git a/content/examples/Basics/Typography/TextRotation/TextRotation.pde b/content/examples/Basics/Typography/TextRotation/TextRotation.pde new file mode 100644 index 000000000..8ed649178 --- /dev/null +++ b/content/examples/Basics/Typography/TextRotation/TextRotation.pde @@ -0,0 +1,55 @@ +/** + * Text Rotation. + * + * Draws letters to the screen and rotates them at different angles. + */ + +PFont f; +float angleRotate = 0.0; + +void setup() { + size(640, 360); + background(0); + + // Create the font from the .ttf file in the data folder + f = createFont("SourceCodePro-Regular.ttf", 18); + textFont(f); +} + +void draw() { + background(0); + + strokeWeight(1); + stroke(153); + + pushMatrix(); + float angle1 = radians(45); + translate(100, 180); + rotate(angle1); + text("45 DEGREES", 0, 0); + line(0, 0, 150, 0); + popMatrix(); + + pushMatrix(); + float angle2 = radians(270); + translate(200, 180); + rotate(angle2); + text("270 DEGREES", 0, 0); + line(0, 0, 150, 0); + popMatrix(); + + pushMatrix(); + translate(440, 180); + rotate(radians(angleRotate)); + text(int(angleRotate) % 360 + " DEGREES", 0, 0); + line(0, 0, 150, 0); + popMatrix(); + + angleRotate += 0.25; + + stroke(255, 0, 0); + strokeWeight(4); + point(100, 180); + point(200, 180); + point(440, 180); +} diff --git a/content/examples/Basics/Typography/TextRotation/data/SourceCodePro-Regular.ttf b/content/examples/Basics/Typography/TextRotation/data/SourceCodePro-Regular.ttf new file mode 100644 index 000000000..b2cff928e Binary files /dev/null and b/content/examples/Basics/Typography/TextRotation/data/SourceCodePro-Regular.ttf differ diff --git a/content/examples/Topics/Simulate/Chain/Chain.pde b/content/examples/Topics/Simulate/Chain/Chain.pde deleted file mode 100644 index 75b7ea36d..000000000 --- a/content/examples/Topics/Simulate/Chain/Chain.pde +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Chain. - * - * One mass is attached to the mouse position and the other - * is attached the position of the other mass. The gravity - * in the environment pulls down on both. - */ - - -Spring2D s1, s2; - -float gravity = 9.0; -float mass = 2.0; - -void setup() { - size(640, 360); - fill(255, 126); - // Inputs: x, y, mass, gravity - s1 = new Spring2D(0.0, width/2, mass, gravity); - s2 = new Spring2D(0.0, width/2, mass, gravity); -} - -void draw() { - background(0); - s1.update(mouseX, mouseY); - s1.display(mouseX, mouseY); - s2.update(s1.x, s1.y); - s2.display(s1.x, s1.y); -} - -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 30; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/content/examples/Topics/Simulate/Spring/Spring.pde b/content/examples/Topics/Simulate/Spring/Spring.pde deleted file mode 100644 index 1e28a40b5..000000000 --- a/content/examples/Topics/Simulate/Spring/Spring.pde +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Spring. - * - * Click, drag, and release the horizontal bar to start the spring. - */ - -// Spring drawing constants for top bar -int springHeight = 32; // Height -int left; // Left position -int right; // Right position -int max = 200; // Maximum Y value -int min = 100; // Minimum Y value -boolean over = false; // If mouse over -boolean move = false; // If mouse down and over - -// Spring simulation constants -float M = 0.8; // Mass -float K = 0.2; // Spring constant -float D = 0.92; // Damping -float R = 150; // Rest position - -// Spring simulation variables -float ps = R; // Position -float vs = 0.0; // Velocity -float as = 0; // Acceleration -float f = 0; // Force - - -void setup() { - size(640, 360); - rectMode(CORNERS); - noStroke(); - left = width/2 - 100; - right = width/2 + 100; -} - -void draw() { - background(102); - updateSpring(); - drawSpring(); -} - -void drawSpring() { - - // Draw base - fill(0.2); - float baseWidth = 0.5 * ps + -8; - rect(width/2 - baseWidth, ps + springHeight, width/2 + baseWidth, height); - - // Set color and draw top bar - if(over || move) { - fill(255); - } else { - fill(204); - } - rect(left, ps, right, ps + springHeight); -} - - -void updateSpring() { - // Update the spring position - if(!move) { - f = -K * (ps - R); // f=-ky - as = f / M; // Set the acceleration, f=ma == a=f/m - vs = D * (vs + as); // Set the velocity - ps = ps + vs; // Updated position - } - if(abs(vs) < 0.1) { - vs = 0.0; - } - - // Test if mouse is over the top bar - if(mouseX > left && mouseX < right && mouseY > ps && mouseY < ps + springHeight) { - over = true; - } else { - over = false; - } - - // Set and constrain the position of top bar - if(move) { - ps = mouseY - springHeight/2; - ps = constrain(ps, min, max); - } -} - -void mousePressed() { - if(over) { - move = true; - } -} - -void mouseReleased() { - move = false; -} diff --git a/content/examples/Topics/Simulate/Springs/Springs.pde b/content/examples/Topics/Simulate/Springs/Springs.pde deleted file mode 100644 index 877e79e26..000000000 --- a/content/examples/Topics/Simulate/Springs/Springs.pde +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Springs. - * - * Move the mouse over one of the circles and click to re-position. - * When you release the mouse, it will snap back into position. - * Each circle has a slightly different behavior. - */ - - -int num = 3; -Spring[] springs = new Spring[num]; - -void setup() { - size(640, 360); - noStroke(); - springs[0] = new Spring(240, 260, 40, 0.98, 8.0, 0.1, springs, 0); - springs[1] = new Spring(320, 210, 120, 0.95, 9.0, 0.1, springs, 1); - springs[2] = new Spring(180, 170, 200, 0.90, 9.9, 0.1, springs, 2); -} - -void draw() { - background(51); - - for (Spring spring : springs) { - spring.update(); - spring.display(); - } -} - -void mousePressed() { - for (Spring spring : springs) { - spring.pressed(); - } -} - -void mouseReleased() { - for (Spring spring : springs) { - spring.released(); - } -} - -class Spring { - // Screen values - float xpos, ypos; - float tempxpos, tempypos; - int size = 20; - boolean over = false; - boolean move = false; - - // Spring simulation constants - float mass; // Mass - float k = 0.2; // Spring constant - float damp; // Damping - float rest_posx; // Rest position X - float rest_posy; // Rest position Y - - // Spring simulation variables - //float pos = 20.0; // Position - float velx = 0.0; // X Velocity - float vely = 0.0; // Y Velocity - float accel = 0; // Acceleration - float force = 0; // Force - - Spring[] friends; - int me; - - // Constructor - Spring(float x, float y, int s, float d, float m, - float k_in, Spring[] others, int id) { - xpos = tempxpos = x; - ypos = tempypos = y; - rest_posx = x; - rest_posy = y; - size = s; - damp = d; - mass = m; - k = k_in; - friends = others; - me = id; - } - - void update() { - if (move) { - rest_posy = mouseY; - rest_posx = mouseX; - } - - force = -k * (tempypos - rest_posy); // f=-ky - accel = force / mass; // Set the acceleration, f=ma == a=f/m - vely = damp * (vely + accel); // Set the velocity - tempypos = tempypos + vely; // Updated position - - force = -k * (tempxpos - rest_posx); // f=-ky - accel = force / mass; // Set the acceleration, f=ma == a=f/m - velx = damp * (velx + accel); // Set the velocity - tempxpos = tempxpos + velx; // Updated position - - - if ((overEvent() || move) && !otherOver() ) { - over = true; - } else { - over = false; - } - } - - // Test to see if mouse is over this spring - boolean overEvent() { - float disX = tempxpos - mouseX; - float disY = tempypos - mouseY; - if (sqrt(sq(disX) + sq(disY)) < size/2 ) { - return true; - } else { - return false; - } - } - - // Make sure no other springs are active - boolean otherOver() { - for (int i=0; i Letters Words + Text Rotation Embedded Links diff --git a/content/examples_p5/Basics/Typography/TextRotation/TextRotation.js b/content/examples_p5/Basics/Typography/TextRotation/TextRotation.js new file mode 100644 index 000000000..85f54e5ed --- /dev/null +++ b/content/examples_p5/Basics/Typography/TextRotation/TextRotation.js @@ -0,0 +1,65 @@ +/** + * Text Rotation. + * + * Draws letters to the screen and rotates them at different angles. + */ + +var f; +var angleRotate = 0.0; + +function setup() { + var canvas = createCanvas(640, 360); + canvas.parent("p5container"); + background(0); + + // Create the font from the .ttf file in the data folder + textFont("Source Code Pro", 18); +} + +function draw() { + background(0); + + + push(); + var angle1 = radians(45); + translate(100, 180); + rotate(angle1); + noStroke(); + fill(255); + text("45 DEGREES", 0, 0); + strokeWeight(1); + stroke(153); + line(0, 0, 150, 0); + pop(); + + push(); + var angle2 = radians(270); + translate(200, 180); + rotate(angle2); + noStroke(); + fill(255); + text("270 DEGREES", 0, 0); + strokeWeight(1); + stroke(153); + line(0, 0, 150, 0); + pop(); + + push(); + translate(440, 180); + rotate(radians(angleRotate)); + noStroke(); + fill(255); + text(int(angleRotate) % 360 + " DEGREES", 0, 0); + strokeWeight(1); + stroke(153); + line(0, 0, 150, 0); + pop(); + + angleRotate += 0.25; + + stroke(255, 0, 0); + strokeWeight(4); + point(100, 180); + point(200, 180); + point(440, 180); +} \ No newline at end of file diff --git a/content/examples_topics.xml b/content/examples_topics.xml index c46525d49..35e20f85f 100755 --- a/content/examples_topics.xml +++ b/content/examples_topics.xml @@ -75,15 +75,12 @@ Texture Cube - Spring - Springs - Chain - Soft Body - Flocking Simple Particle System Multiple Particle Systems Forces With Vectors Smoke Particle System + Flocking + Soft Body Bouncing Ball diff --git a/content/static/books.html b/content/static/books.html index e935e82db..fa7778968 100755 --- a/content/static/books.html +++ b/content/static/books.html @@ -3,7 +3,6 @@

Books. Processing books cove

- @@ -38,7 +37,7 @@

Books. Processing books cove » Order Print/EBook from O'Reilly
» Order from Amazon.com
- This casual book is a concise introduction to Processing and interactive computer graphics. Written by the founders of Processing, it takes you through the learning process one step at a time to help you grasp core programming concepts. You'll learn how to sketch with code -- creating a program with a few lines of code, observing the result, and then adding to it. It was written to help reader: + This casual book is a concise introduction to Processing and interactive computer graphics. Written by the founders of Processing, it takes you through the learning process one step at a time to help you grasp core programming concepts. You'll learn how to sketch with code -- creating a program with a few lines of code, observing the result, and then adding to it. It was written to help readers:
  • Quickly learn programming basics, from variables to objects
  • Understand the fundamentals of computer graphics
  • @@ -97,7 +96,7 @@

    Books. Processing books cove

    If you are an educator, you can request a desk/exam copy from the Elsevier website.
    -

    +

@@ -120,9 +119,61 @@

Books. Processing books cove How can we capture the unpredictable evolutionary and emergent properties of nature in software? How can understanding the mathematical principles behind our physical world help us to create digital worlds? This book focuses on a range of programming strategies and techniques behind computer simulations of natural systems, from elementary concepts in mathematics and physics to more advanced algorithms that enable sophisticated visual results. Readers will progress from building a basic physics engine to creating intelligent moving objects and complex systems, setting the foundation for further experiments in generative design. Subjects covered include forces, trigonometry, fractals, cellular automata, self-organization, and genetic algorithms. - + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -139,10 +190,9 @@

Books. Processing books cove The O'Reilly website says, "How you can take advantage of data that you might otherwise never use? With the help of a powerful new programming environment [Processing], this book helps you represent data accurately on the Web and elsewhere, complete with user interaction, animation, and more. You'll learn basic visualization principles, how to choose the right kind of display for your purposes, and how to provide interactive features to design entire interfaces around large, complex data sets."

Martin Wattenberg from the IBM Watson Research Center says, "This wonderfully detailed guide, by one of the masters of modern data graphics, tells you everything you need to know to code your own visualizations from scratch. Perhaps most valuable are the many examples where Fry demonstrates how to refine a bare-bones concept into a beautiful, effective finished piece. Read this book, and you'll never again be dependent on someone else's view of your data."
-

+ -

@@ -154,14 +204,14 @@

Books. Processing books cove

+ @@ -187,7 +237,7 @@

Books. Processing books cove
  • Fetch weather data from the Web and build a custom weather dashboard
  • Create visualizations that change based on sound, light, and temperature readings
  • -

    +

    @@ -197,14 +247,14 @@

    Books. Processing books cove

    + alt="Processing: An Introduction to Programming"/> + @@ -261,13 +311,11 @@

    Books. Processing books cove This book has a different perspective from the others because of Glassner's deep experience in computer graphics. His bio reads, "Dr. Andrew Glassner is a writer-director, and a consultant in story structure, interactive fiction, and computer graphics. He started working in 3D computer graphics in 1978, and has carried out research at the NYIT Computer Graphics Lab, Case Western Reserve University, the IBM TJ Watson Research Lab, the Delft University of Technology, Bell Communications Research, Xerox PARC, and Microsoft Research... He is also a well-known writer, and has published numerous technical papers and books on topics ranging from 3D modeling, rendering, and animation to digital sound synthesis. His book '3D Computer Graphics: A Handbook for Artists and Designers' has taught a generation of artists through two editions and three languages. Glassner created and edited the 'Graphics Gems' series and created and wrote several chapters in the book 'An Introduction to Ray Tracing'. He wrote the two-volume text 'Principles of Digital Image Synthesis'."

    - - - + - - - - - + The O'Reilly website says, "Make cool stuff. If you're a designer or artist without a lot of programming experience, this book will teach you to work with 2D and 3D graphics, sound, physical interaction, and electronic circuitry to create all sorts of interesting and compelling experiences -- online and off. Programming Interactivity explains programming and electrical engineering basics, and introduces three freely available tools created specifically for artists and designers: Processing, Arduino, and OpenFrameworks." + + + @@ -348,7 +394,6 @@

    Books. Processing books cove

    - @@ -369,15 +414,12 @@

    Books. Processing books cove The Wiley website says, "this book offers a series of generic procedures that can function as building blocks and encourages you to then use those building blocks to experiment, explore, and channel your thoughts, ideas, and principles into potential solutions. The book covers such topics as structured shapes, solid geometry, networking and databases, physical computing, image processing, graphic user interfaces, and more."

    - - - - - - + - + @@ -446,7 +484,7 @@

    Books. Processing books cove -

    + @@ -533,20 +571,40 @@

    Books. Processing books cove

    - + + + + + + + + + + + @@ -564,7 +622,7 @@

    Books. Processing books cove Text in German.

    The OReilly.de site writes, "Processing ist eine auf Grafik, Simulation und Animation spezialisierte objektorientierte Programmiersprache, die besonders für Menschen mit wenig Programmiererfahrung geeignet ist. Deshalb eignet sie sich vor allem für Künstler, Bastler und Programmiereinsteiger. Die aus Java abgeleitete Sprache wurde geschaffen, um schnell und effektiv mit relativ wenig Aufwand zu beeindruckenden Ergebnissen zu kommen. Processing führt den Leser zügig in die Programmieressentials ein und geht dann unmittelbar zur Programmierung grafisch anspruchsvoller Anwendungen über. Spielerisch wird dem Leser die 2D- und 3D-Programierung, Textrendering, die Bildbearbeitung und sogar die Videomanipulation nahe gebracht." -

    + @@ -636,7 +694,8 @@

    Books. Processing books cove During the 50‘s ”era of cybernetics“, computer entered into the history of art simultaneously in different parts of the world. Art and science were in great turmoil. Science, with its theories and experiments, was approaching artificially mimicking both natural phenomena, such as light and sound, and the human phenomena of language and communication. Art, with its aesthetic and exhibitions, had transcended the boundaries of the avant-garde. Now, with the computer, it was confronting a reality that challenged ”the where“ and ”the how“ of doing art and the very meaning of ”masterpiece“. Antonio Rollo takes us on a tour of these seminal works from his unique perspective of the artist, through the code!

    - There's additional information on the publisher's website. + There's additional information on the publisher's website. + @@ -656,7 +715,8 @@

    Books. Processing books cove
    Note from Casey: "I received a copy of this book from the authors on a recent trip to Japan. It's a beautifully produced full-color book with sections introducing Processing, featuring work created with Processing (many are from the Exhibition section of the Processing website), and introducing programming through progressively complicated examples. The majority of the book is an introduction to programming. There are many good examples and the code is color-coded like in the Processing Environment. This book is less comprehensive than the Greenberg and Reas/Fry books, but it appears to be a good, brief introduction."

    - There's additional information on the publisher's website. + There's additional information on the publisher's website. + @@ -686,49 +746,5 @@

    Books. Processing books cove - - -

    - - - - - - -
    Processing: A Programming Handbook for Visual Designers (Second Edition)

     

     

    Coding Art: The Four Steps to Creative Programming with the Processing LanguageCoding Art: The Four Steps to Creative Programming with the Processing Language
    + Yu Zhang, Mathias Funk.
    + Published January 2021, Apress. 280 pages. Paperback.
    + » Order from Apress
    + » Order from Amazon +
    +
    + The authors write, "Finally, a book on creative programming, written directly for artists and designers! Rather than following a computer science curriculum, this book is aimed at creatives who are working in the intersection of design, art, and education. In this book you'll learn to apply computation into the creative process by following a four-step process, and through this, land in the cross section of coding and art, with a focus on practical examples and relevant work structures. You'll follow a real-world use case of computation art and see how it relates back to the four key pillars, and addresses potential pitfalls and challenges in the creative process. All code examples are presented in a fully integrated Processing example library, making it easy for readers to get started." +

     

     

    Pro Processing for Images and Computer Vision with OpenCVPro Processing for Images and Computer Vision with OpenCV
    + Bryan WC Chung.
    + Published 2017, APress. Paperback, eBook.
    + » Order from APress +

    + The Publisher writes, "Pro Processing for Images and Computer Vision with OpenCV is a step-by-step training tool that guides you through a series of worked examples in linear order. Each chapter begins with a basic demonstration, including the code to recreate it on your own system. Then comes a creative challenge by which to engage and develop mastery of the chapter’s topic. The book also includes hints and tips relating to visual arts, interaction design, and industrial best practices. This book is intended for any developer of artistic and otherwise visual applications, such as in augmented reality and digital effects, with a need to manipulate images, and to recognize and manipulate objects within those images. The book is specifically targeted at those making use of the Processing language that is common in artistic fields, and to Java programmers because of Processing’s easy integration into the Java programming environment." +

     

     

    Programming 101: The How and Why of Programming Revealed Using the Processing Programming LanguageProgramming 101: The How and Why of Programming Revealed Using the Processing Programming Language
    + Jeanine Meyer.
    + Published 2018, APress. Paperback, eBook.
    + » Order from Apress +

    + The Publisher writes, "Understand the importance of programming, even if you’ve never programmed before! This book will teach you the basics of programming using the Processing programming language. You will create your own Processing sketches, using personal images, themes, or hobbies that you enjoy. The chapters in the book will demonstrate the process of programming, starting with formulating an idea, planning, building on past projects, and refining the work, similar to writing an essay or composing a song. This approach will guide you to make use of logic and mathematics to produce beautiful effects. The term for program in Processing is sketch, though the sketches featured in this book are far more than static drawings; they incorporate interaction, animation, video, audio, and accessing files on the local computer and on the Web. Technical features are introduced and explained in the context of complete examples: games (Snake, Hangman, jigsaw, slingshot), making a collage of family images and video clips, preparing directions for folding an origami model, rotating objects in 3D, and others." +

     

     

     

     

    Generative Design
    Hartmut Bohnacker, Benedikt Gross, Julia Laub, and Claudius Lazzeroni.
    August 2012, Princeton Architectural Press. 472 pages.
    - Originally published in German November 2009, Schmidt Hermann Verlag. 500 pages.
    + Originally published in German November 2009, Schmidt Hermann Verlag. 500 pages.
    » Order from Amazon.com
    This book is extraordinary; the design is clear and the production quality is fantastic. This is the design book about Processing that we've hoped for. Unlike most other Processing books, it doesn't discuss programming basics so it's free to start with exciting examples. The publisher promotes, "Generative design is a revolutionary new method of creating artwork, models, and animations from sets of rules, or algorithms. By using accessible programming languages such as Processing, artists and designers are producing extravagant, crystalline structures that can form the basis of anything from patterned textiles and typography to lighting, scientific diagrams, sculptures, films, and even fantastical buildings. Opening with a gallery of thirty-five illustrated case studies, Generative Design takes users through specific, practical instructions on how to create their own visual experiments by combining simple-to-use programming codes with basic design principles. A detailed handbook of advanced strategies provides visual artists with all the tools to achieve proficiency. Both a how-to manual and a showcase for recent work in this exciting new field, Generative Design is the definitive study and reference book that designers have been waiting for."

    More information about buying this book in German, as well as the complete source code for the examples, are at the book's website.

    -

    The SparkFun Guide to Processing Processing: An Introduction to Programming
    Jeffrey L. Nyhoff, Larry R. Nyhoff.
    Published May 2017, CRC Press. 544 pages. eBook, Paperback.
    » Order from CRC Press
    » Order from Amazon.com -
    +

    The publisher writes, "The book uses Processing’s capabilities for graphics and interactivity in order to create examples that are simple, illustrative, interesting, and fun. It is designed to appeal to a broad range of readers, including those who want to learn to program to create digital art, as well as those who seek to learn to program to process numerical information or data. It can be used by students and instructors in a first course on programming, as well as by anyone eager to teach them self to program."

    The publisher lists: @@ -215,7 +265,7 @@

    Books. Processing books cove
  • Covers all of the standard programming constructs
  • Presents the material in a fun, conversational, and approachable way
  • -

     

     

    Processing: Creative Coding and Computational Art (Foundation) Processing: Creative Coding and Computational Art (Foundation)
    @@ -279,11 +327,10 @@

    Books. Processing books cove
    The Friends of Ed website says, "This book is written especially for artists, designers, and other creative professionals and students exploring code art, graphics programming, and computational aesthetics. The book provides a solid and comprehensive foundation in programming, including object-oriented principles, and introduces you to the easy-to-grasp Processing language, so no previous coding experience is necessary. The book then goes through using Processing to code lines, curves, shapes, and motion, continuing to the point where you'll have mastered Processing and can really start to unleash your creativity with realistic physics, interactivity, and 3D! In the final chapter, you'll even learn how to extend your Processing skills by working directly with the powerful Java programming language, the language Processing itself is built with." (Quote from the Friends of Ed website)

    -

     

     

    + Programming Interactivity: A Designer's Guide to Processing, Arduino, and openFrameworksProgramming Interactivity
    +
    Programming Interactivity
    Joshua Noble.
    Published January 2012, O'Reilly. 728 pages. Paperback.
    » Order from Amazon.com
    - The O'Reilly website says, "Make cool stuff. If you're a designer or artist without a lot of programming experience, this book will teach you to work with 2D and 3D graphics, sound, physical interaction, and electronic circuitry to create all sorts of interesting and compelling experiences -- online and off. Programming Interactivity explains programming and electrical engineering basics, and introduces three freely available tools created specifically for artists and designers: Processing, Arduino, and OpenFrameworks."

     

     

     

     

    Data-driven Graphic Design: Creative Coding for Visual Communication @@ -387,20 +429,16 @@

    Books. Processing books cove Andrew Richardson.
    Published January 2016, Bloomsbury. 224 Pages. Paperback.
    » Order from Amazon.com -
    +

    The book description reads, "Data-driven Graphic Design introduces the creative potential of computational data and how it can be used to inform and create everything from typography, print and moving graphics to interactive design and physical installations. Using code as a creative environment allows designers to step outside the boundaries of commercial software tools, and create a set of unique, digitally informed pieces of work. The use of code offers a new way of thinking about and creating design for the digital environment."

     

     

     

     

     

    O Código Transcendente: Uma Introdução Prática à Programação e Arte GerativaO Código Transcendente: Uma Introdução Prática à Programação e Arte Gerativa
    + Mateus Berruezo.
    + Published December 2019. 270 pages. PDF, Web.
    + Text in Portuguese.
    + » Download
    + » Read online +
    +
    + Este livro é um guia de programação com enfoque prático considerando o contexto da arte gerativa e do pensamento computacional. Ele conta com explicações e exemplos visuais cuidadosamente projetados para serem de valor tanto para programadores quanto artistas. As aplicações e estudos de caso foram direcionados para a linguagem Processing cuja própria filosofia segue o princípio da exploração do artístico através do código. +

     

     

    Einführung ins Programmieren mit Processing Einführung ins Programmieren mit Processing
    - Matthias Wolf.
    - Published August 2013. 178 pages. PDF, Paperback.
    - Text in German.
    - » Order Print/EBook from lulu.com
    -
    -

    Die eigenständige Programmiersprache Processing basiert auf Java und ähnelt diesem sehr, verbirgt aber gleichzeitig viel von dessen Komplexität. Dadurch ist Processing für den Programmieranfänger ideal geeignet, um sich Konzepte des Programmierens zu erschließen und bewahrt gleichzeitig die Möglichkeit eines späteren Umstiegs. Dennoch ist die Sprache keineswegs nur für triviale Anfängeraufgaben geeignet: speziell im Bereich der graphischen Datenverarbeitung spielt Processing seine Stärken aus.

    -

    Dieses Buch richtet sich in erster Linie an den Einsteiger, den es an die Bewältigung auch komplexerer Aufgaben heranführt, wobei grundlegende Konzepte der imperativen und der objektorientierten Programmierung vorgestellt werden. Auch notwendige theoretische Hintergründe kommen dabei nicht zu kurz. Ausführlich kommentierter Beispielcode erschließt Konzepte und Sprache. Aber auch der routinierte Programmierer, der sich "nur" eine neue Sprache erschließen will, wird fündig!

    -

    Aus dem Inhalt: Datentypen — Variablen — Arrays (ein- und mehrdiomensional) — Flusssteuerung — Methoden — Objektorientiertes Programmieren — 2D-Graphik — 3D-Graphik — Dateizugriff — PDF — QuickTimeTM — Arduino®-Mikrocontroller — Alphabetischer Index + Matthias Wolf.
    + Published August 2013. 178 pages. PDF, Paperback.
    + Text in German.
    + » Order Print/EBook from lulu.com
    +
    +

    Die eigenständige Programmiersprache Processing basiert auf Java und ähnelt diesem sehr, verbirgt aber gleichzeitig viel von dessen Komplexität. Dadurch ist Processing für den Programmieranfänger ideal geeignet, um sich Konzepte des Programmierens zu erschließen und bewahrt gleichzeitig die Möglichkeit eines späteren Umstiegs. Dennoch ist die Sprache keineswegs nur für triviale Anfängeraufgaben geeignet: speziell im Bereich der graphischen Datenverarbeitung spielt Processing seine Stärken aus.

    +

    Dieses Buch richtet sich in erster Linie an den Einsteiger, den es an die Bewältigung auch komplexerer Aufgaben heranführt, wobei grundlegende Konzepte der imperativen und der objektorientierten Programmierung vorgestellt werden. Auch notwendige theoretische Hintergründe kommen dabei nicht zu kurz. Ausführlich kommentierter Beispielcode erschließt Konzepte und Sprache. Aber auch der routinierte Programmierer, der sich "nur" eine neue Sprache erschließen will, wird fündig!

    +

    Aus dem Inhalt: Datentypen — Variablen — Arrays (ein- und mehrdiomensional) — Flusssteuerung — Methoden — Objektorientiertes Programmieren — 2D-Graphik — 3D-Graphik — Dateizugriff — PDF — QuickTimeTM — Arduino®-Mikrocontroller — Alphabetischer Index

     

     

     

    - Processing is also discussed through examples and projects in the following books: - -
    - -
    - - 10 PRINT CHR$(205.5+RND(1)); : GOTO 10
    By Nick Montfort, Patsy Baudoin, John Bell, Ian Bogost, Jeremy Douglass, Mark C. Marino, Michael Mateas, Casey Reas, Mark Sample, Noah Vawter. Examples use Processing to explore a modern interpretation of a 1982 Commodore 64 program.
    - -
    - - Make: Getting Started with Arduino
    By Massimo Banzi. Examples use Processing to communicate with an Arduino board.
    - -
    - - Building Wireless Sensor Networks: with ZigBee, XBee, Arduino, and Processing
    By Robert Faludi. Network examples use Processing.
    - -
    - - Physical Computing: Sensing and Controlling the Physical World with Computers
    - By Dan O'Sullivan and Tom Igoe. Examples using Processing for RS-232 communication and - computer vision.
    - -
    - - Aesthetic Computing.
    - Edited by Paul Fishwick. Casey Reas and Ben Fry contributed a chapter entitled - "Processing Code: Programming within the Context of Visual Art and Design."
    - -
    - - Hacking Roomba: ExtremeTech
    By Tod E. Kurt. Processing is introduced and used to design an application to control a Roomba (a robot vacuum cleaner).
    - -
    - Analog In, Digital Out
    By Brendan Dawes. Numerous projects created with Processing are illustrated and discussed.

    diff --git a/content/static/download.html b/content/static/download.html index a684aaf5b..122db5e30 100644 --- a/content/static/download.html +++ b/content/static/download.html @@ -9,19 +9,19 @@

    Download Processing. Process
    - 3.5.4 - (17 January 2020) + 4.0b1 + (9 August 2021)
    @@ -29,12 +29,12 @@

    Download Processing. Process
    - Read about the changes in 3.0. The list of revisions covers the differences between releases in detail. + Read about the changes in 4.0. The list of revisions covers the differences between releases in detail.
    @@ -42,6 +42,13 @@

    Download Processing. Process

    Stable Releases

    +
  • + 4.0b1 + (9 August 2021) + Windows 64 + Linux 64 + macOS +
  • 3.5.4 (17 January 2020) @@ -50,6 +57,7 @@

    Stable Releases

    Linux 64 Mac OS X
  • + + +
  • - 4.0 alpha 1 - (18 January 2020) - Win 64 - Linux 64 - Mac OS X + 4.0 alpha 6 + (10 July 2021) + Win 64 + Linux 64 + Mac OS X
  • +
  • + 4.0 alpha 1 + (18 January 2020) + Win 64 + Linux 64 + Mac OS X +
  • + --> - -

    The changes document covers incremental updates between 4.x releases, and is especially important to read for pre-releases.

    diff --git a/content/static/overview.html b/content/static/overview.html index aa6831a91..d5d3d30ff 100644 --- a/content/static/overview.html +++ b/content/static/overview.html @@ -7,16 +7,12 @@

    Overview. A short introducti

    For the past sixteen years, Processing has promoted software literacy, particularly within the visual arts, and visual literacy within technology. Initially created to serve as a software sketchbook and to teach programming fundamentals within a visual context, Processing has also evolved into a development tool for professionals. The Processing software is free and open source, and runs on the Mac, Windows, and GNU/Linux platforms. +

    Processing continues to be an alternative to proprietary software tools with restrictive and expensive licenses, making it accessible to schools and individual students. Its open source status encourages the community participation and collaboration that is vital to Processing’s growth. Contributors share programs, contribute code, and build libraries, tools, and modes to extend the possibilities of the software. The Processing community has written more than a hundred libraries to facilitate computer vision, data visualization, music composition, networking, 3D file exporting, and programming electronics.

    - -

    Education

    diff --git a/content/static/support.html b/content/static/support.html index 91cb0754f..2a8f77f05 100644 --- a/content/static/support.html +++ b/content/static/support.html @@ -1,67 +1,48 @@ -

    Processing is free, open-source software. Your donation supports our worldwide community. We need your help!

    + -

    - One way to donate is to become a Processing Foundation Member. Please become a member today to help us continue to provide access to quality, free, open-source software. +

    + We need your help! Please support Processing by making a donation to the Processing Foundation. Your donation contributes to software development, education resources like code examples and tutorials, Fellowships, and community events. +

    + + + + + + + + + +
    + +
    + + -

    - The Processing Foundation was founded in 2012 after more than a decade of work with the original Processing software. The Foundation’s mission is to promote software literacy within the visual arts, and visual literacy within technology-related fields — and to make these fields accessible to diverse communities. Our goal is to empower people of all interests and backgrounds to learn how to program and make creative work with code, especially those who might not otherwise have access to these tools and resources. -

    +

    + The Processing Foundation was established in 2012 after more than a decade of work with the Processing software. The Foundation’s mission is to promote software literacy within the visual arts, and visual literacy within technology-related fields — and to make these fields accessible to diverse communities. Our goal is to empower people of all interests and backgrounds to learn how to program and make creative work with code, especially those who might not otherwise have access to these tools and resources. You can read more about the history of Processing in the short essay "A Modern Prometheus." +

    diff --git a/content/static/tutorials/sound/index.html b/content/static/tutorials/sound/index.html index 20b03bc75..e1fada6b0 100644 --- a/content/static/tutorials/sound/index.html +++ b/content/static/tutorials/sound/index.html @@ -233,140 +233,140 @@

    Example 1, 2: Synthesizer

    -/**
    - * Processing Sound Library, Example 1
    - * 
    - * Five sine waves are layered to construct a cluster of frequencies. 
    - * This method is called additive synthesis. Use the mouse position 
    - * inside the display window to detune the cluster.
    - */
    -
    -import processing.sound.*;
    -
    -SinOsc[] sineWaves; // Array of sines
    -float[] sineFreq; // Array of frequencies
    -int numSines = 5; // Number of oscillators to use
    -
    -void setup() {  
    -  size(640, 360);
    -  background(255);
    -
    -  sineWaves = new SinOsc[numSines]; // Initialize the oscillators
    -  sineFreq = new float[numSines]; // Initialize array for Frequencies
    -
    -  for (int i = 0; i < numSines; i++) {
    -    // Calculate the amplitude for each oscillator
    -    float sineVolume = (1.0 / numSines) / (i + 1);
    -    // Create the oscillators
    -    sineWaves[i] = new SinOsc(this);
    -    // Start Oscillators
    -    sineWaves[i].play();
    -    // Set the amplitudes for all oscillators
    -    sineWaves[i].amp(sineVolume);
    -  }
    +/**
    + * Processing Sound Library, Example 1
    + * 
    + * Five sine waves are layered to construct a cluster of frequencies. 
    + * This method is called additive synthesis. Use the mouse position 
    + * inside the display window to detune the cluster.
    + */
    +
    +import processing.sound.*;
    +
    +SinOsc[] sineWaves; // Array of sines
    +float[] sineFreq; // Array of frequencies
    +int numSines = 5; // Number of oscillators to use
    +
    +void setup() {  
    +  size(640, 360);
    +  background(255);
    +
    +  sineWaves = new SinOsc[numSines]; // Initialize the oscillators
    +  sineFreq = new float[numSines]; // Initialize array for Frequencies
    +
    +  for (int i = 0; i < numSines; i++) {
    +    // Calculate the amplitude for each oscillator
    +    float sineVolume = (1.0 / numSines) / (i + 1);
    +    // Create the oscillators
    +    sineWaves[i] = new SinOsc(this);
    +    // Start Oscillators
    +    sineWaves[i].play();
    +    // Set the amplitudes for all oscillators
    +    sineWaves[i].amp(sineVolume);
    +  }
     }
     
    -void draw() {
    -  //Map mouseY from 0 to 1
    -  float yoffset = map(mouseY, 0, height, 0, 1);
    -  //Map mouseY logarithmically to 150 - 1150 to create a base frequency range
    -  float frequency = pow(1000, yoffset) + 150;
    -  //Use mouseX mapped from -0.5 to 0.5 as a detune argument
    -  float detune = map(mouseX, 0, width, -0.5, 0.5);
    -
    -  for (int i = 0; i < numSines; i++) { 
    -    sineFreq[i] = frequency * (i + 1 * detune);
    -    // Set the frequencies for all oscillators
    -    sineWaves[i].freq(sineFreq[i]);
    -  }
    +void draw() {
    +  //Map mouseY from 0 to 1
    +  float yoffset = map(mouseY, 0, height, 0, 1);
    +  //Map mouseY logarithmically to 150 - 1150 to create a base frequency range
    +  float frequency = pow(1000, yoffset) + 150;
    +  //Use mouseX mapped from -0.5 to 0.5 as a detune argument
    +  float detune = map(mouseX, 0, width, -0.5, 0.5);
    +
    +  for (int i = 0; i < numSines; i++) { 
    +    sineFreq[i] = frequency * (i + 1 * detune);
    +    // Set the frequencies for all oscillators
    +    sineWaves[i].freq(sineFreq[i]);
    +  }
     }
     	

    -/**
    - * Processing Sound Library, Example 2
    - * 
    - * This sketch shows how to use envelopes and oscillators. 
    - * Envelopes describe to course of amplitude over time. 
    - * The Sound library provides an ASR envelope which stands for 
    - * attack, sustain, release. 
    - * 
    - *       .________
    - *      .          ---
    - *     .              --- 
    - *    .                  ---
    - *    A       S        R 
    - */
    -
    -import processing.sound.*;
    -
    -// Oscillator and envelope 
    -TriOsc triOsc;
    -Env env; 
    -
    -// Times and levels for the ASR envelope
    -float attackTime = 0.001;
    -float sustainTime = 0.004;
    -float sustainLevel = 0.2;
    -float releaseTime = 0.2;
    -
    -// This is an octave in MIDI notes.
    -int[] midiSequence = { 
    -  60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72
    -}; 
    -
    -// Set the duration between the notes
    -int duration = 200;
    -// Set the note trigger
    -int trigger = 0; 
    -
    -// An index to count up the notes
    -int note = 0; 
    -
    -void setup() {
    -  size(640, 360);
    -  background(255);
    -
    -  // Create triangle wave and envelope 
    -  triOsc = new TriOsc(this);
    -  env  = new Env(this);
    +/**
    + * Processing Sound Library, Example 2
    + * 
    + * This sketch shows how to use envelopes and oscillators. 
    + * Envelopes describe to course of amplitude over time. 
    + * The Sound library provides an ASR envelope which stands for 
    + * attack, sustain, release. 
    + * 
    + *       .________
    + *      .          ---
    + *     .              --- 
    + *    .                  ---
    + *    A       S        R 
    + */
    +
    +import processing.sound.*;
    +
    +TriOsc triOsc;
    +Env env; 
    +
    +// Times and levels for the ASR envelope
    +float attackTime = 0.001;
    +float sustainTime = 0.004;
    +float sustainLevel = 0.3;
    +float releaseTime = 0.2;
    +
    +// This is an octave in MIDI notes.
    +int[] midiSequence = { 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 }; 
    +
    +// Play a new note every 200ms
    +int duration = 200;
    +
    +// This variable stores the point in time when the next note should be triggered
    +int trigger = millis(); 
    +
    +// An index to count up the notes
    +int note = 0; 
    +
    +void setup() {
    +  size(640, 360);
    +  background(255);
    +
    +  // Create triangle wave and start it
    +  triOsc = new TriOsc(this);
    +
    +  // Create the envelope 
    +  env = new Env(this);
     }
     
    -void draw() { 
    +void draw() { 
     
    -  // If value of trigger is equal to the computer clock and if not all 
    -  // notes have been played yet, the next note gets triggered.
    -  if ((millis() > trigger) && (note<midiSequence.length)) {
    +  // If the determined trigger moment in time matches up with the computer clock and
    +  // the sequence of notes hasn't been finished yet, the next note gets played.
    +  if ((millis() > trigger) && (note<midiSequence.length)) {
     
    -    // midiToFreq transforms the MIDI value into a frequency in Hz which we use 
    -    //to control the triangle oscillator with an amplitute of 0.8
    -    triOsc.play(midiToFreq(midiSequence[note]), 0.8);
    +    // midiToFreq transforms the MIDI value into a frequency in Hz which we use to
    +    // control the triangle oscillator with an amplitute of 0.5
    +    triOsc.play(midiToFreq(midiSequence[note]), 0.5);
     
    -    // The envelope gets triggered with the oscillator as input and the times and 
    -    // levels we defined earlier
    -    env.play(triOsc, attackTime, sustainTime, sustainLevel, releaseTime);
    +    // The envelope gets triggered with the oscillator as input and the times and
    +    // levels we defined earlier
    +    env.play(triOsc, attackTime, sustainTime, sustainLevel, releaseTime);
     
    -    // Create the new trigger according to predefined durations and speed
    -    trigger = millis() + duration;
    +    // Create the new trigger according to predefined duration
    +    trigger = millis() + duration;
     
    -    // Advance by one note in the midiSequence;
    -    note++; 
    +    // Advance by one note in the midiSequence;
    +    note++; 
     
    -    // Loop the sequence
    -    if (note == 12) {
    -      note = 0;
    -    }
    -  }
    -} 
    +    // Loop the sequence, notice the jitter
    +    if (note == 12) {
    +      note = 0;
    +    }
    +  }
    +} 
     
    -// This function calculates the respective frequency of a MIDI note
    -float midiToFreq(int note) {
    -  return (pow(2, ((note-69)/12.0)))*440;
    +// This helper function calculates the respective frequency of a MIDI note
    +float midiToFreq(int note) {
    +  return (pow(2, ((note-69)/12.0))) * 440;
     }
     
    -
    +
    @@ -380,97 +380,96 @@

    Example 3, 4: Sample playback

    -/**
    - * Processing Sound Library, Example 3
    - * 
    - * This example shows how to make a simple sampler and sequencer 
    - * with the Sound library. In this sketch, five different samples are 
    - * loaded and played back at different pitches, in this case five 
    - * different octaves. The sequencer triggers an event every 200-1000 
    - * milliseconds randomly. Each time a sound is played a colored 
    - * rect with a random color is displayed.
    - */
    -
    -import processing.sound.*;
    -
    -SoundFile[] files;
    -
    -// Create an array of values which represent the octaves. 
    -// 1.0 is playback at normal speed, 0.5 is half and therefore 
    -// one octave down. 2.0 is double so one octave up.
    -float[] octave = { 
    -  0.25, 0.5, 1.0, 2.0, 4.0
    -};
    -
    -// The playSound array is defining how many samples will be 
    -// played at each trigger event
    -int[] playSound = { 
    -  1, 1, 1, 1, 1
    -};
    -
    -// The trigger is an integer number in milliseconds so we 
    -// can schedule new events in the draw loop
    -int trigger=0;
    -
    -// This array holds the pixel positions of the rectangles 
    -// that are drawn each event
    -int[] posx = {
    -  0, 128, 256, 384, 512
    -};
    -
    -
    -void setup() {
    -  size(640, 360);
    -  background(255);
    -
    -  // Create an array of 5 empty soundfiles
    -  files = new SoundFile[5];
    -
    -  // Load 5 soundfiles from a folder in a for loop. By naming 
    -  // the files 1., 2., 3., [...], n.aif it is easy to iterate 
    -  // through the folder and load all files in one line of code.
    -  for (int i = 0; i < files.length; i++) {
    -    files[i] = new SoundFile(this, (i+1) + ".aif");
    -  }
    +/**
    + * Processing Sound Library, Example 3
    + * 
    + * This example shows how to make a simple sampler and sequencer 
    + * with the Sound library. In this sketch, five different samples are 
    + * loaded and played back at different pitches, in this case five 
    + * different octaves. The sequencer triggers an event every 200-1000 
    + * milliseconds randomly. Each time a sound is played a colored 
    + * rect with a random color is displayed.
    + * 
    + * Load this example with included sound files from the Processing Editor: 
    + * Examples > Libraries > Sound > Soundfile > Sampler 
    + */
    +
    +import processing.sound.*;
    +
    +SoundFile[] file;
    +
    +// Define the number of samples 
    +int numsounds = 5;
    +
    +// Create an array of values which represent the octaves. 
    +// 1.0 is playback at normal speed, 0.5 is half and 
    +// therefore one octave down. 2.0 is double so one octave up.
    +float[] octave = {0.25, 0.5, 1.0, 2.0, 4.0};
    +
    +// The playSound array is defining how many samples will 
    +// be played at each trigger event
    +int[] playSound = {1, 1, 1, 1, 1};
    +
    +// The trigger is an integer number in milliseconds so we 
    +// can schedule new events in the draw loop
    +int trigger;
    +
    +// This array holds the pixel positions of the rectangles 
    +// which are drawn each event
    +int[] posx = {0, 128, 256, 384, 512};
    +
    +
    +void setup() {
    +  size(640, 360);
    +  background(255);
    +
    +  // Create an array of empty soundfiles
    +  file = new SoundFile[numsounds];
    +
    +  // Load 5 soundfiles from a folder in a for loop. 
    +  // By naming the files 1., 2., 3., n.aif it is easy to iterate
    +  // through the folder and load all files in one line of code.
    +  for (int i = 0; i < numsounds; i++) {
    +    file[i] = new SoundFile(this, (i+1) + ".aif");
    +  }
    +
    +  // Create a trigger which will be the basis for our random sequencer. 
    +  trigger = millis();
     }
     
    -void draw() {
    -
    -  // If the determined trigger moment in time matches up with 
    -  // the computer clock events get triggered.
    -  if (millis() > trigger) {
    -
    -    // Redraw the background every time to erase old rects
    -    background(255);
    -
    -    // By iterating through the playSound array we check for 
    -    // 1 or 0, 1 plays a sound and draws a rect, for 0 nothing happens
    -
    -    for (int i = 0; i < files.length; i++) {      
    -      // Check which indexes are 1 and 0.
    -      if (playSound[i] == 1) {
    -        float rate;
    -        // Choose a random color and get set to noStroke()
    -        fill(int(random(255)), int(random(255)), int(random(255)));
    -        noStroke();
    -        // Draw the rect in the positions we defined earlier in posx
    -        rect(posx[i], 50, 128, 260);
    -        // Choose a random index of the octave array
    -        rate = octave[int(random(0, 5))];
    -        // Play the soundfile from the array with the respective 
    -        // rate and loop set to false
    -        files[i].play(rate, 1.0);
    -      }
    -
    -      // Renew the indexes of playSound so that at the next event 
    -      // the order is different and randomized.
    -      playSound[i] = int(random(0, 2));
    -    }
    -
    -    // Create a new triggertime in the future, with a random offset 
    -    // between 200 and 1000 milliseconds
    -    trigger = millis() + int(random(200, 1000));
    -  }
    +void draw() {
    +
    +  // If the determined trigger moment in time matches up with the 
    +  // computer clock events get triggered.
    +  if (millis() > trigger) {
    +    // Redraw the background every time to erase old rects
    +    background(255);
    +
    +    // By iterating through the playSound array we check for 1 or 0, 
    +    // 1 plays a sound and draws a rect, for 0 nothing happens.
    +
    +    for (int i = 0; i < numsounds; i++) {      
    +      // Check which indexes are 1 and 0.
    +      if (playSound[i] == 1) {
    +        float rate;
    +        // Choose a random color and get set to noStroke()
    +        fill(int(random(255)), int(random(255)), int(random(255)));
    +        noStroke();
    +        // Draw the rect in the positions we defined earlier in posx
    +        rect(posx[i], 50, 128, 260);
    +        // Choose a random index of the octave array
    +        rate = octave[int(random(0, 5))];
    +        // Play the soundfile from the array with the respective rate and loop set to false
    +        file[i].play(rate, 1.0);
    +      }
    +
    +      // Renew the indexes of playSound so that at the next event the order is different and randomized.
    +      playSound[i] = int(random(0, 2));
    +    }
    +
    +    // Create a new triggertime in the future, with a random offset between 200 and 1000 milliseconds
    +    trigger = millis() + int(random(200, 1000));
    +  }
     }
     
     
    @@ -478,81 +477,150 @@

    Example 3, 4: Sample playback


    -/**
    - * Processing Sound Library, Example 4
    - * 
    - * Five soundfiles are mapped to the numbers on the keyboard. 
    - * Numbers 1-5 are played back an octave lower and numbers
    - * 6-0 an octave higher.
    - */
    -
    -import processing.sound.*;
    -
    -AudioDevice device;
    -SoundFile[] file;
    -
    -int red, green, blue;
    -
    -void setup() {
    -  size(640, 360);
    -  background(255);
    -
    -  // Create an AudioDevice with low buffer size 
    -  // and create an array containing 5 empty soundfiles
    -  device = new AudioDevice(this, 48000, 32);
    -  file = new SoundFile[5];
    -
    -  // Load 5 soundfiles from a folder in a for loop. 
    -  for (int i = 0; i < file.length; i++) {
    -    file[i] = new SoundFile(this, (i+1) + ".aif");
    -  }
    +/**
    + * Processing Sound Library, Example 4
    + * 
    + * This example shows how to make a simple keyboard-triggered sampler with the Sound
    + * library. In this sketch 5 different short samples are loaded and played back at
    + * different speeds, which also changes their perceived pitch by one or two octaves.
    + * 
    + * Load this example with included sound files from the Processing Editor:  
    + * Examples > Libraries > Sound > Soundfile > Keyboard 
    + */
    +
    +import processing.sound.*;
    +
    +SoundFile[] file;
    +
    +// Define the number of samples 
    +int numsounds = 5;
    +
    +// Define a variable to store the randomly generated background color in
    +int backgroundColor[] = {255, 255, 255};
    +
    +void setup() {
    +  size(640, 360);
    +
    +  // Create a Sound renderer and an array of empty soundfiles
    +  file = new SoundFile[numsounds];
    +
    +  // Load 5 soundfiles from a folder in a for loop. By naming
    +  // the files 1.aif, 2.aif, 3.aif, ..., n.aif it is easy to iterate
    +  // through the folder and load all files in one line of code.
    +  for (int i = 0; i < numsounds; i++) {
    +    file[i] = new SoundFile(this, (i+1) + ".aif");
    +  }
     }
     
    -void draw() {
    -  background(red, green, blue);
    +void draw() {
    +  background(backgroundColor[0], backgroundColor[1], backgroundColor[2]);
     }
     
    -void keyPressed() {
    -  // Set a random background color each time you hit then number keys
    -  red=int(random(255));
    -  green=int(random(255));
    -  blue=int(random(255));
    -
    -  // Assign a sound to each number on your keyboard. 1-5 play at
    -  // an octave below the original pitch of the file, 6-0 play at
    -  // an octave above.
    -  switch(key) {
    -  case '1':
    -    file[0].play(0.5, 1.0);
    -    break;
    -  case '2':
    -    file[1].play(0.5, 1.0);
    -    break;
    -  case '3':
    -    file[2].play(0.5, 1.0);
    -    break;
    -  case '4':
    -    file[3].play(0.5, 1.0);
    -    break;
    -  case '5':
    -    file[4].play(0.5, 1.0);
    -    break;
    -  case '6':
    -    file[0].play(2.0, 1.0);
    -    break;
    -  case '7':
    -    file[1].play(2.0, 1.0);
    -    break;
    -  case '8':
    -    file[2].play(2.0, 1.0);
    -    break;
    -  case '9':
    -    file[3].play(2.0, 1.0);
    -    break;
    -  case '0':
    -    file[4].play(2.0, 1.0);
    -    break;
    -  }
    +void keyPressed() {
    +  // We use a boolean helper variable to determine whether one of the branches
    +  // of the switch-statement was activated or not
    +  boolean validKey = true;
    +
    +  switch(key) {
    +  case 'a':
    +    file[0].play(0.5, 1.0);
    +    break;
    +
    +  case 's':
    +    file[1].play(0.5, 1.0);
    +    break;
    +
    +  case 'd':
    +    file[2].play(0.5, 1.0);
    +    break;
    +
    +  case 'f':
    +    file[3].play(0.5, 1.0);
    +    break;
    +
    +  case 'g':
    +    file[4].play(0.5, 1.0);
    +    break;
    +
    +  case 'h':
    +    file[0].play(1.0, 1.0);
    +    break;
    +
    +  case 'j':
    +    file[1].play(1.0, 1.0);
    +    break;
    +
    +  case 'k':
    +    file[2].play(1.0, 1.0);
    +    break;
    +
    +  case 'l':
    +    file[3].play(1.0, 1.0);
    +    break;
    +
    +  case ';':
    +    file[4].play(1.0, 1.0);
    +    break;
    +
    +  case '\'':
    +    file[0].play(2.0, 1.0);
    +    break;
    +
    +  case 'q':
    +    file[1].play(2.0, 1.0);
    +    break;
    +
    +  case 'w':
    +    file[2].play(2.0, 1.0);
    +    break;    
    +
    +  case 'e':
    +    file[3].play(2.0, 1.0);
    +    break;
    +
    +  case 'r':
    +    file[4].play(2.0, 1.0);
    +    break; 
    +
    +  case 't':
    +    file[0].play(3.0, 1.0);
    +    break;
    +
    +  case 'y':
    +    file[1].play(3.0, 1.0);
    +    break;
    +
    +  case 'u':
    +    file[2].play(3.0, 1.0);
    +    break;    
    +
    +  case 'i':
    +    file[3].play(3.0, 1.0);
    +    break;
    +
    +  case 'o':
    +    file[4].play(3.0, 1.0);
    +    break;
    +
    +  case 'p':
    +    file[0].play(4.0, 1.0);
    +    break;    
    +
    +  case '[':
    +    file[1].play(4.0, 1.0);
    +    break;
    +
    +    // no valid key was pressed, store that information
    +  default:
    +    validKey = false;
    +  }
    +
    +  // If a new sample playback was triggered, change the background color
    +  if (validKey) {
    +    for (int i = 0; i < 3; i++) {
    +      backgroundColor[i] = int(random(255));
    +    }
    +  }
     }
     
     
    @@ -573,130 +641,134 @@

    Example 5, 6: Audio analysis

    -/**
    - * Processing Sound Library, Example 5
    - * 
    - * This sketch shows how to use the FFT class to analyze a stream  
    - * of sound. Change the variable bands to get more or less 
    - * spectral bands to work with. The smooth_factor variable determines 
    - * how much the signal will be smoothed on a scale form 0-1.
    - */
    -
    -import processing.sound.*;
    -
    -// Declare the processing sound variables 
    -SoundFile sample;
    -FFT fft;
    -AudioDevice device;
    -
    -// Declare a scaling factor
    -int scale = 5;
    -
    -// Define how many FFT bands we want
    -int bands = 128;
    -
    -// declare a drawing variable for calculating rect width
    -float r_width;
    -
    -// Create a smoothing vector
    -float[] sum = new float[bands];
    -
    -// Create a smoothing factor
    -float smooth_factor = 0.2;
    -
    -void setup() {
    -  size(640, 360);
    -  background(255);
    -
    -  // If the Buffersize is larger than the FFT Size, the FFT will fail
    -  // so we set Buffersize equal to bands
    -  device = new AudioDevice(this, 44000, bands);
    -
    -  // Calculate the width of the rects depending on how many bands we have
    -  r_width = width/float(bands);
    -
    -  // Load and play a soundfile and loop it. This has to be called 
    -  // before the FFT is created.
    -  sample = new SoundFile(this, "beat.aiff");
    -  sample.loop();
    -
    -  // Create and patch the FFT analyzer
    -  fft = new FFT(this, bands);
    -  fft.input(sample);
    -}      
    -
    -void draw() {
    -  // Set background color, noStroke and fill color
    -  background(204);
    -  fill(0, 0, 255);
    -  noStroke();
    -
    -  fft.analyze();
    -  for (int i = 0; i < bands; i++) {
    -    // Smooth the FFT data by smoothing factor
    -    sum[i] += (fft.spectrum[i] - sum[i]) * smooth_factor;
    -
    -    // Draw the rects with a scale factor
    -    rect( i*r_width, height, r_width, -sum[i]*height*scale );
    -  }
    +/**
    + * Processing Sound Library, Example 5
    + * 
    + * This sketch shows how to use the FFT class to analyze a stream
    + * of sound. Change the number of bands to get more spectral bands
    + * (at the expense of more coarse-grained time resolution of the spectrum).
    + * 
    + * Load this example with included sound files from the Processing Editor: 
    + * Examples > Libraries > Sound > Analysis > FFTSpectrum 
    + */
    +
    +import processing.sound.*;
    +
    +// Declare the sound source and FFT analyzer variables
    +SoundFile sample;
    +FFT fft;
    +
    +// Define how many FFT bands to use (this needs to be a power of two)
    +int bands = 128;
    +
    +// Define a smoothing factor which determines how much the spectrums of consecutive
    +// points in time should be combined to create a smoother visualisation of the spectrum.
    +// A smoothing factor of 1.0 means no smoothing (only the data from the newest analysis
    +// is rendered), decrease the factor down towards 0.0 to have the visualisation update
    +// more slowly, which is easier on the eye.
    +float smoothingFactor = 0.2;
    +
    +// Create a vector to store the smoothed spectrum data in
    +float[] sum = new float[bands];
    +
    +// Variables for drawing the spectrum:
    +// Declare a scaling factor for adjusting the height of the rectangles
    +int scale = 5;
    +// Declare a drawing variable for calculating the width of the 
    +float barWidth;
    +
    +public void setup() {
    +  size(640, 360);
    +  background(255);
    +
    +  // Calculate the width of the rects depending on how many bands we have
    +  barWidth = width/float(bands);
    +
    +  // Load and play a soundfile and loop it.
    +  sample = new SoundFile(this, "beat.aiff");
    +  sample.loop();
    +
    +  // Create the FFT analyzer and connect the playing soundfile to it.
    +  fft = new FFT(this, bands);
    +  fft.input(sample);
     }
     
    -
    - -
    - -
    -/**
    - * Processing Sound Library, Example 6
    - * 
    - * This sketch shows how to use the Amplitude class to analyze a
    - * stream of sound. In this case a sample is analyzed. The smoothFactor
    - * variable determines how much the signal will be smoothed on a scale
    - * from 0 - 1.
    - */
    -
    -import processing.sound.*;
    -
    -// Declare the processing sound variables 
    -SoundFile sample;
    -Amplitude rms;
    +public void draw() {
    +  // Set background color, noStroke and fill color
    +  background(125, 255, 125);
    +  fill(255, 0, 150);
    +  noStroke();
     
    -// Declare a scaling factor
    -float scale = 5.0;
    +  // Perform the analysis
    +  fft.analyze();
     
    -// Declare a smooth factor
    -float smoothFactor = 0.25;
    +  for (int i = 0; i < bands; i++) {
    +    // Smooth the FFT spectrum data by smoothing factor
    +    sum[i] += (fft.spectrum[i] - sum[i]) * smoothingFactor;
     
    -// Used for smoothing
    -float sum;
    -
    -void setup() {
    -  size(640, 360);
    -
    -  //Load and play a soundfile and loop it
    -  sample = new SoundFile(this, "beat.aiff");
    -  sample.loop();
    -
    -  // Create and patch the rms tracker
    -  rms = new Amplitude(this);
    -  rms.input(sample);
    -}      
    -
    -void draw() {
    -  // Set background color, noStroke and fill color
    -  background(0, 0, 255);
    -  noStroke();
    -  fill(255, 0, 150);
    +    // Draw the rectangles, adjust their height using the scale factor
    +    rect(i*barWidth, height, barWidth, -sum[i]*height*scale);
    +  }
    +}
     
    -  // Smooth the rms data by smoothing factor
    -  sum += (rms.analyze() - sum) * smoothFactor;  
    +
    -  // rms.analyze() return a value between 0 and 1. It's -  // scaled to height/2 and then multiplied by a scale factor -  float rmsScaled = sum * (height/2) * scale; +
    -  // Draw an ellipse at a size based on the audio analysis -  ellipse(width/2, height/2, rmsScaled, rmsScaled); +
    +/**
    + * Processing Sound Library, Example 6
    + * 
    + * This sketch shows how to use the Amplitude class to analyze the changing
    + * "loudness" of a stream of sound. In this case an audio sample is analyzed.
    + * 
    + * Load this example with included sound files from the Processing Editor: 
    + * Examples > Libraries > Sound > Analysis > PeakAmplitude 
    + */
    +
    +import processing.sound.*;
    +
    +// Declare the processing sound variables 
    +SoundFile sample;
    +Amplitude rms;
    +
    +// Declare a smooth factor to smooth out sudden changes in amplitude.
    +// With a smooth factor of 1, only the last measured amplitude is used for the
    +// visualisation, which can lead to very abrupt changes. As you decrease the
    +// smooth factor towards 0, the measured amplitudes are averaged across frames,
    +// leading to more pleasant gradual changes
    +float smoothingFactor = 0.25;
    +
    +// Used for storing the smoothed amplitude value
    +float sum;
    +
    +public void setup() {
    +  size(640, 360);
    +
    +  //Load and play a soundfile and loop it
    +  sample = new SoundFile(this, "beat.aiff");
    +  sample.loop();
    +
    +  // Create and patch the rms tracker
    +  rms = new Amplitude(this);
    +  rms.input(sample);
    +}      
    +
    +public void draw() {
    +  // Set background color, noStroke and fill color
    +  background(125, 255, 125);
    +  noStroke();
    +  fill(255, 0, 150);
    +
    +  // smooth the rms data by smoothing factor
    +  sum += (rms.analyze() - sum) * smoothingFactor;
    +
    +  // rms.analyze() return a value between 0 and 1. It's
    +  // scaled to height/2 and then multiplied by a fixed scale factor
    +  float rms_scaled = sum * (height/2) * 5;
    +
    +  // We draw a circle whose size is coupled to the audio analysis
    +  ellipse(width/2, height/2, rms_scaled, rms_scaled);
     }
     
     
    diff --git a/contrib_generate/sources.conf b/contrib_generate/sources.conf index 47e008191..8fc82f839 100644 --- a/contrib_generate/sources.conf +++ b/contrib_generate/sources.conf @@ -1,10 +1,10 @@ -# Next ID: 254 +# Next ID: 273 # Increment after assigning ID to new contribution [Library : 3D] 001 \ https://github.com/remixlab/proscene/releases/download/latest/proscene.txt 006 \ http://www.die-seite.ch/colladaloader/colladaLoader.txt -009 \ http://www.wblut.com/hemesh/hemesh.txt +# 009 \ http://www.wblut.com/hemesh/hemesh.txt 017 \ http://mrfeinberg.com/peasycam/peasycam.txt # 022 \ http://fluidforms.eu/processing/fluid-forms-libs/download/FluidFormsLibs.txt 032 \ http://n.clavaud.free.fr/processing/library/picking/download/Picking.txt @@ -39,6 +39,7 @@ 244 \ http://giftedapprentice.com/ewbIK/ewbIK.txt 245 \ https://github.com/VisualComputing/nub/releases/download/latest/nub.txt 253 \ https://ztdp.ca/projects/school/Green/Green.txt +272 \ https://fox-gieg.com/patches/processing/libraries/tiltProcessing/tiltProcessing.txt [Library : Compilation] 004 \ http://staff.city.ac.uk/~jwo/giCentre/utils/gicentreUtils.txt @@ -67,7 +68,7 @@ #404# 128 \ http://dasmithii.com/GNet.txt 133 \ https://raw.githubusercontent.com/nok/redis-processing/master/download/Redis.txt 135 \ https://temboo.com/files/temboo-processing.txt -137 \ http://shiffman.net/p5/libraries/httprequests_processing/httprequests_processing.txt +137 \ https://github.com/runemadsen/HTTP-Requests-for-Processing/releases/download/latest/httprequests_processing.txt 144 \ http://unfoldingmaps.org/Unfolding.txt 175 \ https://github.com/alexandrainst/processing_websockets/releases/download/latest/webSockets.txt 183 \ https://github.com/onlylemi/processing-android-capture/releases/download/latest/AndroidCaptureForProcessing.txt @@ -79,6 +80,9 @@ 230 \ https://github.com/cansik/artnet4j/releases/download/latest/artnet4j.txt 241 \ http://agathelenclen.fr/downloads/Squarify.txt 248 \ https://github.com/runwayml/processing-library/releases/download/latest/RunwayML.txt +262 \ https://github.com/SamuelAl/SQuelized-for-Processing/releases/latest/download/SQuelized.txt +267 \ https://github.com/cansik/deep-vision-processing/releases/download/contribution/deepvision.txt +270 \ https://ronghaoliang.page/Weka4P/download/Weka4P.txt [Library : Fabrication] # 078 \ http://s373.net/code/marchingcubes/download/marchingcubes.txt @@ -106,13 +110,14 @@ 180 \ http://interfascia.berg.industries/download/interfascia.txt 224 \ https://github.com/BillKujawa/meter/releases/download/latest/meter.txt 237 \ http://gicentre.org/handy/handy.txt +256 \ https://github.com/Milchreis/uibooster-for-processing/releases/latest/download/UiBooster.txt [Library : Hardware] 015 \ http://www.shiffman.net/p5/libraries/sms/sms.txt 024 \ https://github.com/firmata/processing/releases/download/latest/processing-arduino.txt 028 \ http://projects.formatlos.de/ambientlightsensor/download/AmbientLightSensor.txt # 064 \ http://www.muvium.com/frappuccino/frappuccino.txt -066 \ http://ketailibrary.org/ketai.txt +066 \ http://ketai.org/ketai.txt 071 \ http://motscousus.com/stuff/2011-01_dmxP512/dmxP512.txt 090 \ https://dl.dropbox.com/u/87680069/LeapMotion.txt # 102 \ http://s176381904.onlinehome.fr/processing/MoveLib/download/MoveLib.txt @@ -124,14 +129,16 @@ 188 \ http://developers.gausstoys.com/processing/GaussSense.txt 189 \ http://ciaron.net/hpglgraphics/download/hpglgraphics.txt 190 \ https://github.com/gohai/processing/releases/download/latest/io.txt -197 \ https://github.com/sgeigers/Phidgets-For-Processing/releases/download/latest/PhidgetsForProcessing.txt +# 197 \ https://github.com/sgeigers/Phidgets-For-Processing/releases/download/latest/PhidgetsForProcessing.txt 211 \ https://github.com/diwi/PS3Eye/releases/download/latest/PS3Eye.txt 218 \ https://github.com/cansik/sweep-processing/releases/download/latest/SweepProcessing.txt 219 \ https://teddavis.org/xyscope/download/XYscope.txt 224 \ https://github.com/BillKujawa/meter/releases/download/latest/meter.txt -225 \ http://hci.soc.napier.ac.uk/GazeTrack/GazeTrack.txt +225 \ http://web.tecnico.ulisboa.pt/augusto.esteves/GazeTrack/GazeTrack.txt 238 \ https://github.com/cansik/realsense-processing/releases/download/contributed/RealSenseProcessing.txt 239 \ http://skweezee.net/processing/download/SkweezeeForProcessing.txt +266 \ https://github.com/sgeigers/SimplePhidgets/releases/download/latest/SimplePhidgets.txt +268 \ http://github.com/jaysonh/Dmx4Artists/releases/latest/download/Dmx4Artists.txt [Library : I/O] 001 \ https://github.com/remixlab/proscene/releases/download/latest/proscene.txt @@ -148,7 +155,7 @@ 105 \ http://paulhertz.net/ignocodelib/download/IgnoCodeLib.txt 121 \ https://github.com/codeanticode/tablet/releases/download/latest/Tablet.txt 136 \ http://www.extrapixel.ch/processing/gifAnimation/gifAnimation.txt -139 \ http://erniejunior.github.io/VSync-for-Processing/download/VSync.txt +139 \ http://ernestum.github.io/VSync-for-Processing/download/VSync.txt 143 \ http://www.lagers.org.uk/processing/gamecontrol/GameControlPlus.txt 167 \ http://www.lagers.org.uk/processing3/gamecontrol/GameControlPlus.txt 168 \ http://transfluxus.github.io/SimpleHTTPServer/download/SimpleHTTPServer.txt @@ -167,6 +174,8 @@ 232 \ https://github.com/haschdl/pLaunchController/releases/download/latest/pLaunchController.txt 239 \ http://skweezee.net/processing/download/SkweezeeForProcessing.txt 247 \ https://github.com/orgicus/image-sequence-player/releases/download/latest/ImageSequencePlayer.txt +258 \ https://github.com/Transmedia-Gx/grab/releases/latest/download/Grab.txt +269 \ http://augmenta-tech.com/libs/processing/Augmenta.txt [Library : Language] 063 \ http://rednoise.org/rita/rita.txt @@ -207,6 +216,7 @@ 201 \ https://github.com/diwi/PixelFlow/releases/download/latest/PixelFlow.txt 216 \ https://github.com/diwi/LiquidFunProcessing/releases/download/latest/LiquidFunProcessing.txt 244 \ http://giftedapprentice.com/ewbIK/ewbIK.txt +261 \ https://github.com/dennisppaul/teilchen/releases/latest/download/teilchen.txt [Library : Sound] 153 \ https://github.com/processing/processing-sound/releases/download/latest/sound.txt @@ -219,6 +229,10 @@ 151 \ https://corajr.github.io/loom/download/loom.txt 170 \ https://github.com/shlomihod/cassette/releases/download/latest/cassette.txt 219 \ https://teddavis.org/xyscope/download/XYscope.txt +254 \ http://www.kramann.info/ComposingForEveryone.txt +260 \ https://github.com/sphaero/procmod/releases/latest/download/procmod.txt +264 \ https://github.com/dennisppaul/wellen/releases/latest/download/wellen.txt +271 \ https://www.robertesler.com/software/Pd4P3.txt [Library : Utilities] 001 \ https://github.com/remixlab/proscene/releases/download/latest/proscene.txt @@ -258,6 +272,9 @@ 245 \ https://github.com/VisualComputing/nub/releases/download/latest/nub.txt 246 \ https://github.com/federico-pepe/nice-color-palettes/releases/download/latest/NiceColorPalettes.txt 248 \ https://github.com/runwayml/processing-library/releases/download/latest/RunwayML.txt +255 \ https://bdhont.net/LiveBrush.txt +257 \ https://rect.dev/processing/infinidecimal/GRInfinidecimalCanvas.txt +258 \ https://github.com/Transmedia-Gx/grab/releases/latest/download/Grab.txt [Library : Typography] 038 \ http://www.ricardmarxer.com/geomerative/geomerative.txt @@ -295,6 +312,7 @@ 165 \ https://processing.org/handbook/handbook_2e.txt 166 \ https://processing.org/books/gswp_2e.txt 205 \ http://mad4j.github.io/book-mdpc/book-mdpc.txt +265 \ https://codingart-book.github.io/examples/CodingArtBookExamples.txt [Examples : ] 194 \ http://damellis.github.io/wovns-processing-examples/WOVNS.txt @@ -323,6 +341,7 @@ 233 \ https://github.com/jaewhyun/GettingStarted/releases/download/latest/GettingStarted.txt 234 \ https://github.com/jaewhyun/ReferenceTool/releases/download/latest/ReferenceTool.txt 242 \ https://jwilder4690.github.io/tools/ArtStation/ArtStation.txt +263 \ http://jonathan.dahlberg.media/processing2js/Processing2JSTool.txt [Mode : ] 070 \ http://bezier.de/processing/modes/CoffeeScriptMode.txt @@ -335,3 +354,4 @@ 169 \ https://py.processing.org/3/PythonMode.txt 199 \ https://github.com/fathominfo/processing-p5js-mode/releases/download/latest/p5jsMode.txt 220 \ https://github.com/processing-r/Processing.R/releases/latest/download/RLangMode.txt +250 \ https://github.com/Izza11/shader-mode/releases/download/latest/ShaderMode.txt diff --git a/css/style.css b/css/style.css index c392ef25a..65fd77ba4 100755 --- a/css/style.css +++ b/css/style.css @@ -1321,7 +1321,7 @@ div.examples-nav img { position: relative; top: 11px; } .donate-card h4 { line-height: 1.3; - margin: 0 0 0.5em 0; + margin: 0 0 0 0; color: #2c7bb5; } diff --git a/download/latest.txt b/download/latest.txt index 79efec774..98de25a15 100644 --- a/download/latest.txt +++ b/download/latest.txt @@ -1,2 +1,2 @@ -0270 +1276 diff --git a/exhibition/works/discom/Thumbs.db b/exhibition/works/discom/Thumbs.db deleted file mode 100644 index 93ae137df..000000000 Binary files a/exhibition/works/discom/Thumbs.db and /dev/null differ diff --git a/exhibition/works/superhero/img/Thumbs.db b/exhibition/works/superhero/img/Thumbs.db deleted file mode 100755 index 9f2257887..000000000 Binary files a/exhibition/works/superhero/img/Thumbs.db and /dev/null differ diff --git a/generate/keywords_base.txt b/generate/keywords_base.txt index a88aa2737..7757bb46f 100755 --- a/generate/keywords_base.txt +++ b/generate/keywords_base.txt @@ -252,6 +252,7 @@ double KEYWORD5 double float KEYWORD5 float int KEYWORD5 int long KEYWORD5 long +var KEYWORD5 # Flow structures diff --git a/img/cc.png b/img/cc.png new file mode 100644 index 000000000..4acf8c4ec Binary files /dev/null and b/img/cc.png differ diff --git a/img/learning/books/coding-art.jpg b/img/learning/books/coding-art.jpg new file mode 100644 index 000000000..79fa91e5a Binary files /dev/null and b/img/learning/books/coding-art.jpg differ diff --git a/img/learning/books/o-codigo.jpg b/img/learning/books/o-codigo.jpg new file mode 100644 index 000000000..e70fad0e9 Binary files /dev/null and b/img/learning/books/o-codigo.jpg differ diff --git a/img/learning/books/pro-processing.jpg b/img/learning/books/pro-processing.jpg new file mode 100644 index 000000000..25e7f6863 Binary files /dev/null and b/img/learning/books/pro-processing.jpg differ diff --git a/img/learning/books/programming-101.jpg b/img/learning/books/programming-101.jpg new file mode 100644 index 000000000..3749c36a2 Binary files /dev/null and b/img/learning/books/programming-101.jpg differ diff --git a/java_generate/templates/class.template.html b/java_generate/templates/class.template.html index 411377a94..96634b4c1 100644 --- a/java_generate/templates/class.template.html +++ b/java_generate/templates/class.template.html @@ -89,37 +89,8 @@ - diff --git a/java_generate/templates/generic.template.html b/java_generate/templates/generic.template.html index 4d31c053a..d8858a537 100644 --- a/java_generate/templates/generic.template.html +++ b/java_generate/templates/generic.template.html @@ -46,7 +46,7 @@ @@ -88,37 +88,8 @@ - diff --git a/java_generate/templates/index.template.html b/java_generate/templates/index.template.html index f78bdb5e9..12b460548 100644 --- a/java_generate/templates/index.template.html +++ b/java_generate/templates/index.template.html @@ -44,7 +44,7 @@ diff --git a/java_generate/templates/nav.web.template.html b/java_generate/templates/nav.web.template.html index a754b73e7..43f41939c 100644 --- a/java_generate/templates/nav.web.template.html +++ b/java_generate/templates/nav.web.template.html @@ -4,7 +4,7 @@ Download
    Donate

    - Exhibition

    + Reference
    Libraries
    @@ -13,7 +13,7 @@ Tutorials
    Examples
    - Books
    + Books

    Overview
    @@ -28,6 +28,6 @@ »Wiki
    »FAQ
    »Twitter
    - »Facebook
    + »Medium \ No newline at end of file diff --git a/templates/template.html b/templates/template.html index 334c27412..b3836287a 100755 --- a/templates/template.html +++ b/templates/template.html @@ -44,10 +44,9 @@ - diff --git a/templates/template.nav.php b/templates/template.nav.php index 92ba0e37d..01dd329bd 100755 --- a/templates/template.nav.php +++ b/templates/template.nav.php @@ -8,9 +8,9 @@ 'Learning' => array('/learning/', 1), 'Tutorials' => array('/tutorials/', 2), - 'Examples' => array('/examples/', 2), - 'Books' => array('/books/', 2), - 'Handbook' => array('/handbook/', 2), + 'Examples' => array('/examples/', 2), + 'Books' => array('/books/', 2), + 'Handbook' => array('/handbook/', 2), 'Reference' => array('/reference/', 1), @@ -21,7 +21,7 @@ 'Environment' => array('/reference/environment/', 2), 'Download' => array('/download/', 1), - 'Donate' => array('/download/support.html', 1), + 'Donate' => array('/download/support.html', 1), 'Shop' => array('/shop/', 1), @@ -58,7 +58,7 @@ function navigation($section = '') $html .= "\t\t\t\t\t" . l('Download', $section == 'Download') . "
    \n"; $html .= "\t\t\t\t\t" . l('Donate', $section == 'Donate') . "

    \n"; - $html .= "\t\t\t\t\t" . l('Exhibition', $section == 'Exhibition') . "

    \n"; + #$html .= "\t\t\t\t\t" . l('Exhibition', $section == 'Exhibition') . "

    \n"; $html .= "\t\t\t\t\t" . l('Reference', $section == 'Reference') . "
    \n"; $html .= "\t\t\t\t\t" . l('Libraries', $section == 'Libraries') . "
    \n"; @@ -82,7 +82,7 @@ function navigation($section = '') $html .= "\t\t\t\t\t" . "»Wiki
    \n"; $html .= "\t\t\t\t\t" . "»FAQ
    \n"; $html .= "\t\t\t\t\t" . "»Twitter
    \n"; - $html .= "\t\t\t\t\t" . "»Facebook
    \n"; + #$html .= "\t\t\t\t\t" . "»Facebook
    \n"; $html .= "\t\t\t\t\t" . "»Medium
    \n"; $html .= "\t\t\t\t\n";