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 b006f9e2d..27c953a9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,5 @@ exhibition/
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/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..9f20dd7ba
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,15 @@
+## Contributing to Processing
+
+Wow, thank you for helping us out!
+
+## Reporting Issues
+
+**[Here's how to report a bug with Processing.](https://github.com/processing/processing/wiki/Report-Bugs)**
+
+Before logging a new issue, please please please review [that document](https://github.com/processing/processing/wiki/Report-Bugs) closely. Processing is a complex project housed across several repositories. A quick read on your part now will save us all a lot of hassle later.
+
+## Other Contributions
+
+See the [Processing wiki](https://github.com/processing/processing/wiki#contribute) for how to contribute in other ways.
+
+Thank you!
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
new file mode 100644
index 000000000..71ae8ba7c
--- /dev/null
+++ b/ISSUE_TEMPLATE.md
@@ -0,0 +1,10 @@
+### Issue description
+
+
+
+### URL(s) of affected page(s)
+
+
+
+### Proposed fix
+
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/config-f.php b/config-f.php
deleted file mode 100644
index 500644b22..000000000
--- a/config-f.php
+++ /dev/null
@@ -1,47 +0,0 @@
- array('English', 'utf-8', true, $domain) //,
- //'zh' => array('Chinese Traditional', 'big5', false, $domain."zh/"),
- //'zh-cn' => array('Chinese Simplified', 'GB2312', false, $domain."zh-cn/"),
- //'fr' => array('French', 'utf-8', true, $domain."fr/"),
- //'id' => array('Indonesian', 'utf-8', false, $domain."id/"),
- //'it' => array('Italian', 'utf-8', true, $domain."it/"),
- //'jp' => array('Japanese', 'Shift_JIS', false, 'http://stage.itp.tsoa.nyu.edu/~tk403/proce55ing_reference_jp/'),
- //'kn' => array('Korean', 'utf-8', false, 'http://www.nabi.or.kr/processing/'),
- //'es' => array('Spanish', 'utf-8', true, $domain."es/"),
- //'tr' => array('Turkish', 'ISO-8859-9', true, $domain."tr/"),
- //'he' => array('Hebrew', 'Windows-1255', false, ''),
- //'ru' => array('Russian', 'ISO-8859-5', false, ''),
- //'pl' => array('Polish', 'ISO-8859-2', false, '')
- );
-// Langauges with finished references available to the public
-$FINISHED = array('en');
-
-// for reference index formatting
-$break_before = array('Shape', 'Color');
-
-?>
\ No newline at end of file
diff --git a/content/api_en/HALF_PI.xml b/content/api_en/HALF_PI.xml
index 3d83e4c53..723fb55e1 100755
--- a/content/api_en/HALF_PI.xml
+++ b/content/api_en/HALF_PI.xml
@@ -22,7 +22,7 @@ arc(x, y, d-60, d-60, 0, TWO_PI);
sin() and cos().
+HALF_PI is a mathematical constant with the value 1.5707964. It is half the ratio of the circumference of a circle to its diameter. It is useful in combination with the trigonometric functions sin() and cos().
]]>
diff --git a/content/api_en/IntDict.xml b/content/api_en/IntDict.xml
index 5e4942895..6754d239c 100644
--- a/content/api_en/IntDict.xml
+++ b/content/api_en/IntDict.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
noLoop();
fill(0);
diff --git a/content/api_en/IntDict_add.xml b/content/api_en/IntDict_add.xml
index ed55603fc..957008dc4 100755
--- a/content/api_en/IntDict_add.xml
+++ b/content/api_en/IntDict_add.xml
@@ -17,11 +17,11 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory); // There are 84 cds
- inventory.add("cds", 20);
+ inventory.add("cd", 20);
println(inventory); // There are 104 cds
}
diff --git a/content/api_en/IntDict_clear.xml b/content/api_en/IntDict_clear.xml
index a1bb4ffbf..64bab3194 100755
--- a/content/api_en/IntDict_clear.xml
+++ b/content/api_en/IntDict_clear.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
inventory.clear();
println(inventory);
diff --git a/content/api_en/IntDict_div.xml b/content/api_en/IntDict_div.xml
index d9512a15d..6547e706d 100755
--- a/content/api_en/IntDict_div.xml
+++ b/content/api_en/IntDict_div.xml
@@ -17,11 +17,11 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory); // There are 84 cds
- inventory.div("cds", 2);
+ inventory.div("cd", 2);
println(inventory); // There are 42 cds
}
diff --git a/content/api_en/IntDict_get.xml b/content/api_en/IntDict_get.xml
index 83690ac3a..0f8219442 100755
--- a/content/api_en/IntDict_get.xml
+++ b/content/api_en/IntDict_get.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
noLoop();
fill(0);
diff --git a/content/api_en/IntDict_hasKey.xml b/content/api_en/IntDict_hasKey.xml
index 08f3e5a23..baa643c45 100755
--- a/content/api_en/IntDict_hasKey.xml
+++ b/content/api_en/IntDict_hasKey.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
if (inventory.hasKey("records") == true) {
println("Yes, we have records.");
diff --git a/content/api_en/IntDict_increment.xml b/content/api_en/IntDict_increment.xml
index 73281b1e5..037d777fa 100755
--- a/content/api_en/IntDict_increment.xml
+++ b/content/api_en/IntDict_increment.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory); // There are 15 tapes
inventory.increment("tapes");
println(inventory); // There are now 16 tapes
diff --git a/content/api_en/IntDict_keyArray.xml b/content/api_en/IntDict_keyArray.xml
index cbb2b40a1..c873798a2 100755
--- a/content/api_en/IntDict_keyArray.xml
+++ b/content/api_en/IntDict_keyArray.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
String[] theKeys = inventory.keyArray();
println(theKeys);
diff --git a/content/api_en/IntDict_keys.xml b/content/api_en/IntDict_keys.xml
index 276530151..4289fd36d 100755
--- a/content/api_en/IntDict_keys.xml
+++ b/content/api_en/IntDict_keys.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
for (String k : inventory.keys()) {
println(k);
diff --git a/content/api_en/IntDict_mult.xml b/content/api_en/IntDict_mult.xml
index dbef3f741..8958e2c7a 100755
--- a/content/api_en/IntDict_mult.xml
+++ b/content/api_en/IntDict_mult.xml
@@ -17,11 +17,11 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory); // There are 84 cds
- inventory.mult("cds", 2);
+ inventory.mult("cd", 2);
println(inventory); // There are 168 cds
}
diff --git a/content/api_en/IntDict_remove.xml b/content/api_en/IntDict_remove.xml
index 28797c083..11aba2cad 100755
--- a/content/api_en/IntDict_remove.xml
+++ b/content/api_en/IntDict_remove.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory); // Full inventory
inventory.remove("tapes");
println(inventory); // Tapes are removed from list
diff --git a/content/api_en/IntDict_set.xml b/content/api_en/IntDict_set.xml
index 5fb16c82d..f35de32f4 100755
--- a/content/api_en/IntDict_set.xml
+++ b/content/api_en/IntDict_set.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
inventory.set("records", 90); // Fewer records
inventory.set("mp3s", 2054); // Add MP3s
diff --git a/content/api_en/IntDict_size.xml b/content/api_en/IntDict_size.xml
index 737f73f62..aae149256 100755
--- a/content/api_en/IntDict_size.xml
+++ b/content/api_en/IntDict_size.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
int s = inventory.size();
println(s);
diff --git a/content/api_en/IntDict_sortKeys.xml b/content/api_en/IntDict_sortKeys.xml
index 55bd28e1b..1401ed584 100755
--- a/content/api_en/IntDict_sortKeys.xml
+++ b/content/api_en/IntDict_sortKeys.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
inventory.sortKeys();
println(inventory);
diff --git a/content/api_en/IntDict_sortKeysReverse.xml b/content/api_en/IntDict_sortKeysReverse.xml
index e3bdd6c67..7f0a4236f 100755
--- a/content/api_en/IntDict_sortKeysReverse.xml
+++ b/content/api_en/IntDict_sortKeysReverse.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
inventory.sortKeysReverse();
println(inventory);
diff --git a/content/api_en/IntDict_sortValues.xml b/content/api_en/IntDict_sortValues.xml
index 1c692684a..ce792724a 100755
--- a/content/api_en/IntDict_sortValues.xml
+++ b/content/api_en/IntDict_sortValues.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
inventory.sortValues();
println(inventory);
diff --git a/content/api_en/IntDict_sortValuesReverse.xml b/content/api_en/IntDict_sortValuesReverse.xml
index baafe091c..1e22ebaf7 100755
--- a/content/api_en/IntDict_sortValuesReverse.xml
+++ b/content/api_en/IntDict_sortValuesReverse.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
inventory.sortValuesReverse();
println(inventory);
diff --git a/content/api_en/IntDict_sub.xml b/content/api_en/IntDict_sub.xml
index e1ecd80c2..231c78678 100755
--- a/content/api_en/IntDict_sub.xml
+++ b/content/api_en/IntDict_sub.xml
@@ -17,11 +17,11 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory); // There are 84 cds
- inventory.sub("cds", 20);
+ inventory.sub("cd", 20);
println(inventory); // There are 64 cds
}
diff --git a/content/api_en/IntDict_valueArray.xml b/content/api_en/IntDict_valueArray.xml
index 0d93df3c8..1a1502dd0 100755
--- a/content/api_en/IntDict_valueArray.xml
+++ b/content/api_en/IntDict_valueArray.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
int[] amounts = inventory.valueArray();
println(amounts);
diff --git a/content/api_en/IntDict_values.xml b/content/api_en/IntDict_values.xml
index 74af5c944..0a94d1e3f 100755
--- a/content/api_en/IntDict_values.xml
+++ b/content/api_en/IntDict_values.xml
@@ -17,9 +17,9 @@ IntDict inventory;
void setup() {
size(200, 200);
inventory = new IntDict();
- inventory.set("cd",84);
- inventory.set("tapes",15);
- inventory.set("records",102);
+ inventory.set("cd", 84);
+ inventory.set("tapes", 15);
+ inventory.set("records", 102);
println(inventory);
for (int i : inventory.values()) {
println(i);
diff --git a/content/api_en/LIB_io/GPIO_digitalRead.xml b/content/api_en/LIB_io/GPIO_digitalRead.xml
index 72f5799a1..4a8c8d36d 100755
--- a/content/api_en/LIB_io/GPIO_digitalRead.xml
+++ b/content/api_en/LIB_io/GPIO_digitalRead.xml
@@ -14,22 +14,21 @@
@@ -44,7 +44,7 @@ void pinEvent(int pin) {
-You can use noInterrupts() and interrupts() in tandem to make sure no interrupts are occuring while your sketch is doing a particular task. By default, interrupts are enabled.
+You can use noInterrupts() and interrupts() in tandem to make sure no interrupts are occuring while your sketch is doing a particular task. By default, interrupts are enabled.
]]>
diff --git a/content/api_en/LIB_io/GPIO_noInterrupts.xml b/content/api_en/LIB_io/GPIO_noInterrupts.xml
index 31bb5a57c..236c38b9a 100755
--- a/content/api_en/LIB_io/GPIO_noInterrupts.xml
+++ b/content/api_en/LIB_io/GPIO_noInterrupts.xml
@@ -27,7 +27,7 @@ void draw() {
}
void pinEvent(int pin) {
- noInterrupts();
+ GPIO.noInterrupts();
// no other interrupt will disturb us
println("Received interrupt on pin" + pin);
if (bgcolor == 0) {
@@ -35,7 +35,7 @@ void pinEvent(int pin) {
} else {
bgcolor = color(0);
}
- interrupts();
+ GPIO.interrupts();
}
]]>
diff --git a/content/api_en/LIB_io/GPIO_pinMode.xml b/content/api_en/LIB_io/GPIO_pinMode.xml
index 9bf715e70..be923c726 100755
--- a/content/api_en/LIB_io/GPIO_pinMode.xml
+++ b/content/api_en/LIB_io/GPIO_pinMode.xml
@@ -14,22 +14,21 @@
+Configures a pin to act either as input (INPUT), or input with internal pull-up resistor (INPUT_PULLUP), or input with internal pull-down resistor (INPUT_PULLDOWN) or output (OUTPUT)
Unlike on Arduino, where pins are implicitly set to inputs by default, it is necessary
-to call this function for any pin you want to access, including input pins.
+to call this function for any pin you want to access, including input pins.
+
+Pull-up and pull-down resistors are very useful when connecting buttons and switches, since they will force the value of the pin in a specified electrical state when no electrical connection is made, and the pin would otherwise be left "floating".
+
+The ability to set (and clear) pull-up and pull-down resistors is currently limited to the Raspberry Pi running the Raspbian distribution. On other systems, a warning will be shown.
]]>
diff --git a/content/api_en/LIB_io/GPIO_releasePin.xml b/content/api_en/LIB_io/GPIO_releasePin.xml
index ef9056364..0c25bd518 100755
--- a/content/api_en/LIB_io/GPIO_releasePin.xml
+++ b/content/api_en/LIB_io/GPIO_releasePin.xml
@@ -20,8 +20,6 @@ void setup() {
// On the Raspberry Pi, GPIO 4 is pin 7 on the pin header,
// located on the fourth row, above one of the ground pins
- // For this particular board one could also write:
- // GPIO.pinMode(RPI.PIN7, GPIO.OUTPUT);
frameRate(0.5);
}
diff --git a/content/api_en/LIB_io/GPIO_waitForInterrupt.xml b/content/api_en/LIB_io/GPIO_waitFor.xml
similarity index 58%
rename from content/api_en/LIB_io/GPIO_waitForInterrupt.xml
rename to content/api_en/LIB_io/GPIO_waitFor.xml
index 6bdc62287..d94c87a64 100755
--- a/content/api_en/LIB_io/GPIO_waitForInterrupt.xml
+++ b/content/api_en/LIB_io/GPIO_waitFor.xml
@@ -1,7 +1,7 @@
-waitForInterrupt()
+waitFor()I/O
@@ -20,14 +20,16 @@ void setup() {
// trigger a reset of an external device with GPIO 4
GPIO.digitalWrite(4, GPIO.HIGH);
+
// wait for the device signalling us that it's ready
// by pulling up our pin 5
- boolean success = GPIO.waitForInterrupt(5, GPIO.RISING, 1000);
- if (!success) {
- println("Device didn't wake up in time");
- exit();
- }
- // do something else...
+ GPIO.waitFor(5, GPIO.RISING, 1000);
+ // if this takes longer than 1000ms an exception will be raised
+
+ // GPIO.waitFor(5, GPIO.RISING);
+ // would alternatively wait indefinitely
+
+ // ...
}
]]>
@@ -36,14 +38,13 @@ void setup() {
-The mode parameter determines when the function will return: GPIO.FALLING occurs when the level changes from high to low, GPIO.RISING when the level changes from low
-to high, and GPIO.CHANGE when either occurs.
+The mode parameter determines when the function will return: GPIO.FALLING occurs when the level changes from high to low, GPIO.RISING when the level changes from low to high, and GPIO.CHANGE when either occurs.
-This function returns true if the change, false if the timeout occured.
+The optional timeout parameter determines how many milliseconds the function will wait at the most. If the value of the input pin hasn't changed at this point, an exception is raised for this line. Without a timeout parameter the function will wait indefinitely until the input pin has changed to the desired state.
]]>
-GPIO.waitForInterrupt()
+GPIO.waitFor()
diff --git a/content/api_en/LIB_io/LED.xml b/content/api_en/LIB_io/LED.xml
index 286d1c56b..12f9fa0f7 100755
--- a/content/api_en/LIB_io/LED.xml
+++ b/content/api_en/LIB_io/LED.xml
@@ -17,17 +17,20 @@ LED greenLed;
boolean ledOn = false;
void setup() {
+ // list all available LEDs
+ printArray(LED.list());
+
// the green LED is led0 on the Raspberry Pi
- greenLed = new LED(LED.list()[0]);
+ greenLed = new LED("led0");
frameRate(0.5);
}
void draw() {
ledOn = !ledOn;
if (ledOn) {
- greenLed.set(1.0);
+ greenLed.brightness(1.0);
} else {
- greenLed.set(0.0);
+ greenLed.brightness(0.0);
}
}
diff --git a/content/api_en/LIB_io/LED_brightness.xml b/content/api_en/LIB_io/LED_brightness.xml
index c6d5f675d..3696d5f7f 100755
--- a/content/api_en/LIB_io/LED_brightness.xml
+++ b/content/api_en/LIB_io/LED_brightness.xml
@@ -18,16 +18,16 @@ boolean ledOn = false;
void setup() {
// the green LED is led0 on the Raspberry Pi
- greenLed = new LED(LED.list()[0]);
+ greenLed = new LED("led0");
frameRate(0.5);
}
void draw() {
ledOn = !ledOn;
if (ledOn) {
- greenLed.set(1.0);
+ greenLed.brightness(1.0);
} else {
- greenLed.set(0.0);
+ greenLed.brightness(0.0);
}
}
diff --git a/content/api_en/LIB_io/LED_close.xml b/content/api_en/LIB_io/LED_close.xml
index 3b6d993a4..a49e9d1cf 100755
--- a/content/api_en/LIB_io/LED_close.xml
+++ b/content/api_en/LIB_io/LED_close.xml
@@ -18,16 +18,16 @@ boolean ledOn = false;
void setup() {
// the green LED is led0 on the Raspberry Pi
- greenLed = new LED(LED.list()[0]);
+ greenLed = new LED("led0");
frameRate(1);
}
void draw() {
ledOn = !ledOn;
if (ledOn) {
- greenLed.set(1.0);
+ greenLed.brightness(1.0);
} else {
- greenLed.set(0.0);
+ greenLed.brightness(0.0);
}
}
diff --git a/content/api_en/LIB_io/PWM_set.xml b/content/api_en/LIB_io/PWM_set.xml
index 5437657b2..f21b3bfba 100755
--- a/content/api_en/LIB_io/PWM_set.xml
+++ b/content/api_en/LIB_io/PWM_set.xml
@@ -17,7 +17,9 @@
+
+When no period is specified, a default 1 kHz (1000 Hz) is used.
]]>
diff --git a/content/api_en/LIB_io/RPI.xml b/content/api_en/LIB_io/RPI.xml
deleted file mode 100755
index 44a213b1f..000000000
--- a/content/api_en/LIB_io/RPI.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-RPI
-
-I/O
-
-
-
-Application
-
-
-
-
-
-
-
-
-
diff --git a/content/api_en/LIB_io/SoftwareServo.xml b/content/api_en/LIB_io/SoftwareServo.xml
new file mode 100644
index 000000000..1e5617ec2
--- /dev/null
+++ b/content/api_en/LIB_io/SoftwareServo.xml
@@ -0,0 +1,47 @@
+
+
+
+SoftwareServo
+
+I/O
+
+
+
+Application
+
+
+
+
+
+
+
+
+This library uses timers to control RC servo motors by means of pulse width
+modulation (PWM). While not as accurate as dedicated PWM hardware, it has
+shown to be sufficient for many applications.
+
+Connect the signal wire (typically colored yellow) to any available GPIO pin
+and control the servo's angle as shown in the example sketch.
+]]>
+
+
diff --git a/content/api_en/LIB_io/SoftwareServo_attach.xml b/content/api_en/LIB_io/SoftwareServo_attach.xml
new file mode 100644
index 000000000..cb889b7ad
--- /dev/null
+++ b/content/api_en/LIB_io/SoftwareServo_attach.xml
@@ -0,0 +1,65 @@
+
+
+
+attach()
+
+I/O
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+You must call this function before calling write(). Note that the
+servo motor will only be instructed to move after the first time
+write() is called.
+
+The optional parameters minPulse and maxPulse control the minimum
+and maximum pulse width durations. The default values, identical to
+those of Arduino's Servo class, should be compatible with most servo
+motors.
+]]>
+
+
+softwareservo.attach()
+
+
+
+
+
+
+
+
+1.0
+
+Method
+
+Library
+
+
diff --git a/content/api_en/LIB_io/SoftwareServo_attached.xml b/content/api_en/LIB_io/SoftwareServo_attached.xml
new file mode 100644
index 000000000..2c2362958
--- /dev/null
+++ b/content/api_en/LIB_io/SoftwareServo_attached.xml
@@ -0,0 +1,65 @@
+
+
+
+attached()
+
+I/O
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
+softwareservo.attached()
+
+
+
+
+
+
+
+
+1.0
+
+Method
+
+Library
+
+
diff --git a/content/api_en/LIB_io/SoftwareServo_detach.xml b/content/api_en/LIB_io/SoftwareServo_detach.xml
new file mode 100644
index 000000000..f92e9b3ec
--- /dev/null
+++ b/content/api_en/LIB_io/SoftwareServo_detach.xml
@@ -0,0 +1,64 @@
+
+
+
+detach()
+
+I/O
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+Calling this method will stop the servo from moving or trying to
+hold the current orientation.
+]]>
+
+
+softwareservo.detach()
+
+
+
+
+
+
+
+
+1.0
+
+Method
+
+Library
+
+
diff --git a/content/api_en/LIB_io/SoftwareServo_write.xml b/content/api_en/LIB_io/SoftwareServo_write.xml
new file mode 100644
index 000000000..02e1de275
--- /dev/null
+++ b/content/api_en/LIB_io/SoftwareServo_write.xml
@@ -0,0 +1,61 @@
+
+
+
+write()
+
+I/O
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+If you are using this class in combination with a continuous rotation
+servo, different angles will result in the servo rotating forward or
+backward at different speeds. For regular servo motors, this will
+instruct the servo to rotate to and hold a specific angle.
+]]>
+
+
+softwareservo.write()
+
+
+
+
+
+
+
+
+1.0
+
+Method
+
+Library
+
+
diff --git a/content/api_en/LIB_io/index.html b/content/api_en/LIB_io/index.html
index 87d7e9ccd..2637f8462 100755
--- a/content/api_en/LIB_io/index.html
+++ b/content/api_en/LIB_io/index.html
@@ -28,7 +28,7 @@
- The PWM class controls hardware Pulse-width modulation channels, if supported by your platform.
+ Use the SoftwareServo class below for the time being. Hardware PWM has yet to be made available by the hardware platforms we support.
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_pdf/index.html b/content/api_en/LIB_pdf/index.html
index b156f57db..71fdf7f61 100755
--- a/content/api_en/LIB_pdf/index.html
+++ b/content/api_en/LIB_pdf/index.html
@@ -45,11 +45,12 @@
line(0, 0, frameCount * 4, height);
PGraphicsPDF pdf = (PGraphicsPDF) g; // Get the renderer
- pdf.nextPage(); // Tell it to go to the next page
// When finished drawing, quit and save the file
if (frameCount == 100) {
exit();
+ } else {
+ pdf.nextPage(); // Tell it to go to the next page
}
}
@@ -256,6 +257,8 @@
If you want 3D data, use the DXF recording library instead.
+
Using hint(ENABLE_DEPTH_SORT) can improve the appearance of 3D geometry drawn to 2D file formats.
+
Images don't look great, mostly because of the difference of
expectations in how a PDF should look (scalable and high res) versus
what happens when image data is written to it at 72 dpi.
diff --git a/content/api_en/LIB_serial/Serial_last.xml b/content/api_en/LIB_serial/Serial_last.xml
index 07efee922..cbee0c6fd 100755
--- a/content/api_en/LIB_serial/Serial_last.xml
+++ b/content/api_en/LIB_serial/Serial_last.xml
@@ -36,7 +36,7 @@ void draw() {
diff --git a/content/api_en/LIB_serial/Serial_lastChar.xml b/content/api_en/LIB_serial/Serial_lastChar.xml
index 3bcd77f7e..455e50213 100755
--- a/content/api_en/LIB_serial/Serial_lastChar.xml
+++ b/content/api_en/LIB_serial/Serial_lastChar.xml
@@ -37,7 +37,7 @@ void draw() {
diff --git a/content/api_en/LIB_serial/Serial_readBytes.xml b/content/api_en/LIB_serial/Serial_readBytes.xml
index f3f9d0de7..ce01e36f4 100755
--- a/content/api_en/LIB_serial/Serial_readBytes.xml
+++ b/content/api_en/LIB_serial/Serial_readBytes.xml
@@ -42,7 +42,7 @@ void draw() {
byteBuffer parameter is more memory and time efficient. It grabs the data in the buffer and puts it into the byte array passed in and returns an int value for the number of bytes read. If more bytes are available than can fit into the byteBuffer, only those that fit are read.
+Reads a group of bytes from the buffer or null if there are none available. The version with no parameters returns a byte array of all data in the buffer. This is not efficient, but is easy to use. The version with the byteBuffer parameter is more memory and time efficient. It grabs the data in the buffer and puts it into the byte array passed in and returns an int value for the number of bytes read. If more bytes are available than can fit into the byteBuffer, only those that fit are read.
]]>
diff --git a/content/api_en/LIB_serial/Serial_readBytesUntil.xml b/content/api_en/LIB_serial/Serial_readBytesUntil.xml
index d4c9583d8..fb7773582 100755
--- a/content/api_en/LIB_serial/Serial_readBytesUntil.xml
+++ b/content/api_en/LIB_serial/Serial_readBytesUntil.xml
@@ -43,7 +43,7 @@ void draw() {
byteBuffer parameter returns a byte array of all data up to and including the interesting byte. This is not efficient, but is easy to use. The version with the byteBuffer parameter is more memory and time efficient. It grabs the data in the buffer and puts it into the byte array passed in and returns an int value for the number of bytes read. If the byte buffer is not large enough, -1 is returned and an error is printed to the message area. If nothing is in the buffer, 0 is returned.
+Reads from the port into a buffer of bytes up to and including a particular character. If the character isn't in the buffer, null is returned. The version with without the byteBuffer parameter returns a byte array of all data up to and including the interesting byte. This is not efficient, but is easy to use. The version with the byteBuffer parameter is more memory and time efficient. It grabs the data in the buffer and puts it into the byte array passed in and returns an int value for the number of bytes read. If the byte buffer is not large enough, -1 is returned and an error is printed to the message area. If nothing is in the buffer, 0 is returned.
]]>
diff --git a/content/api_en/LIB_serial/Serial_readString.xml b/content/api_en/LIB_serial/Serial_readString.xml
index 0178be9b3..6a960337e 100755
--- a/content/api_en/LIB_serial/Serial_readString.xml
+++ b/content/api_en/LIB_serial/Serial_readString.xml
@@ -38,7 +38,7 @@ void draw() {
null if there is nothing available. This method assumes the incoming characters are ASCII. If you want to transfer Unicode data, first convert the String to a byte stream in the representation of your choice (i.e. UTF8 or two-byte Unicode data), and send it as a byte array.
]]>
diff --git a/content/api_en/LIB_sound/Amplitude.xml b/content/api_en/LIB_sound/Amplitude.xml
index 4373d59c2..0822d6d93 100755
--- a/content/api_en/LIB_sound/Amplitude.xml
+++ b/content/api_en/LIB_sound/Amplitude.xml
@@ -38,33 +38,5 @@ void draw() {
This is a volume analyzer. It calculates the root mean square of the amplitude of each audio block and returns that value.
]]>
-
diff --git a/content/api_en/LIB_sound/Amplitude_stop.xml b/content/api_en/LIB_sound/Amplitude_stop.xml
index 066804f75..5cbc938da 100755
--- a/content/api_en/LIB_sound/Amplitude_stop.xml
+++ b/content/api_en/LIB_sound/Amplitude_stop.xml
@@ -33,7 +33,6 @@ void draw() {
void mousePressed() {
in.stop();
- amp.stop();
}
]]>
diff --git a/content/api_en/LIB_sound/AudioDevice.xml b/content/api_en/LIB_sound/AudioDevice.xml
index 5bb214dba..1172dc020 100755
--- a/content/api_en/LIB_sound/AudioDevice.xml
+++ b/content/api_en/LIB_sound/AudioDevice.xml
@@ -4,7 +4,7 @@
Sound
-I/O
+ConfigurationApplication
@@ -29,16 +29,6 @@ void draw() {
Audio Device allows for configuring the audio server. If you need a low latency server you can reduce the buffer size. Allowed values are power of 2. For changing the sample rate pass the appropriate value in the constructor.
]]>
-
-
-
-
-
-
-
-
-
-
AudioDevice(parent, samplerate, buffersize)
@@ -57,10 +47,8 @@ AudioDevice(parent, samplerate, buffersize)
int: buffersize (i.e. 32/64/128 ..)
-
-
-
+Sound
1.0
diff --git a/content/api_en/LIB_sound/AudioIn_add.xml b/content/api_en/LIB_sound/AudioIn_add.xml
index dbd9db629..13f7472f9 100755
--- a/content/api_en/LIB_sound/AudioIn_add.xml
+++ b/content/api_en/LIB_sound/AudioIn_add.xml
@@ -23,6 +23,7 @@ void setup() {
in = new AudioIn(this, 0);
in.start();
in.add(0.2);
+ in.play();
}
void draw() {
diff --git a/content/api_en/LIB_sound/AudioSample.xml b/content/api_en/LIB_sound/AudioSample.xml
new file mode 100755
index 000000000..053be266c
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample.xml
@@ -0,0 +1,49 @@
+
+
+AudioSample
+
+Sound
+
+Audio Files
+
+Application
+
+
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_amp.xml b/content/api_en/LIB_sound/AudioSample_amp.xml
new file mode 100644
index 000000000..7a1181b3e
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_amp.xml
@@ -0,0 +1,42 @@
+
+
+
+play()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_channels.xml b/content/api_en/LIB_sound/AudioSample_channels.xml
new file mode 100755
index 000000000..af430a14d
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_channels.xml
@@ -0,0 +1,40 @@
+
+
+
+channels()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_cue.xml b/content/api_en/LIB_sound/AudioSample_cue.xml
new file mode 100755
index 000000000..c4eae7ace
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_cue.xml
@@ -0,0 +1,37 @@
+
+
+
+cue()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_duration.xml b/content/api_en/LIB_sound/AudioSample_duration.xml
new file mode 100755
index 000000000..b083d3e47
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_duration.xml
@@ -0,0 +1,38 @@
+
+
+
+duration()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_frames.xml b/content/api_en/LIB_sound/AudioSample_frames.xml
new file mode 100755
index 000000000..c58a3c077
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_frames.xml
@@ -0,0 +1,36 @@
+
+
+
+frames()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_isPlaying.xml b/content/api_en/LIB_sound/AudioSample_isPlaying.xml
new file mode 100755
index 000000000..9a7ab422b
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_isPlaying.xml
@@ -0,0 +1,45 @@
+
+
+
+isPlaying()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_jump.xml b/content/api_en/LIB_sound/AudioSample_jump.xml
new file mode 100755
index 000000000..290eb7cfd
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_jump.xml
@@ -0,0 +1,36 @@
+
+
+
+jump()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_loop.xml b/content/api_en/LIB_sound/AudioSample_loop.xml
new file mode 100644
index 000000000..f95b7e484
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_loop.xml
@@ -0,0 +1,40 @@
+
+
+
+loop()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_pan.xml b/content/api_en/LIB_sound/AudioSample_pan.xml
new file mode 100755
index 000000000..7b2b176db
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_pan.xml
@@ -0,0 +1,38 @@
+
+
+
+pan()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_pause.xml b/content/api_en/LIB_sound/AudioSample_pause.xml
new file mode 100755
index 000000000..67ece9ab7
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_pause.xml
@@ -0,0 +1,51 @@
+
+
+
+pause()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_play.xml b/content/api_en/LIB_sound/AudioSample_play.xml
new file mode 100755
index 000000000..d1584ae38
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_play.xml
@@ -0,0 +1,40 @@
+
+
+
+play()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_rate.xml b/content/api_en/LIB_sound/AudioSample_rate.xml
new file mode 100755
index 000000000..fbe8dc446
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_rate.xml
@@ -0,0 +1,47 @@
+
+
+
+rate()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_read.xml b/content/api_en/LIB_sound/AudioSample_read.xml
new file mode 100755
index 000000000..b21fc039a
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_read.xml
@@ -0,0 +1,56 @@
+
+
+
+read()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
+AudioSample.frames()
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_resize.xml b/content/api_en/LIB_sound/AudioSample_resize.xml
new file mode 100755
index 000000000..d326abdc6
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_resize.xml
@@ -0,0 +1,40 @@
+
+
+
+resize()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_sampleRate.xml b/content/api_en/LIB_sound/AudioSample_sampleRate.xml
new file mode 100755
index 000000000..b67c1fb85
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_sampleRate.xml
@@ -0,0 +1,37 @@
+
+
+
+sampleRate()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/AudioSample_write.xml b/content/api_en/LIB_sound/AudioSample_write.xml
new file mode 100755
index 000000000..e8cfbeb4c
--- /dev/null
+++ b/content/api_en/LIB_sound/AudioSample_write.xml
@@ -0,0 +1,49 @@
+
+
+
+write()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
+AudioSample.read
+
+
diff --git a/content/api_en/LIB_sound/BandPass.xml b/content/api_en/LIB_sound/BandPass.xml
index 0a5c6a62d..4eef4cc78 100755
--- a/content/api_en/LIB_sound/BandPass.xml
+++ b/content/api_en/LIB_sound/BandPass.xml
@@ -41,6 +41,7 @@ This is a band pass filter.
]]>
+
diff --git a/content/api_en/LIB_sound/BandPass_bw.xml b/content/api_en/LIB_sound/BandPass_bw.xml
index 5dee3cc97..d761114ac 100755
--- a/content/api_en/LIB_sound/BandPass_bw.xml
+++ b/content/api_en/LIB_sound/BandPass_bw.xml
@@ -32,8 +32,8 @@ void setup() {
bandPass.process(noise);
// Change the cutoff frequency and bandwidth of the filter
- bandpass.bw(bw);
- bandpass.freq(freq);
+ bandPass.bw(bw);
+ bandPass.freq(freq);
}
void draw() {
diff --git a/content/api_en/LIB_sound/BandPass_freq.xml b/content/api_en/LIB_sound/BandPass_freq.xml
index 1fc7efc92..de6f9b28d 100755
--- a/content/api_en/LIB_sound/BandPass_freq.xml
+++ b/content/api_en/LIB_sound/BandPass_freq.xml
@@ -31,7 +31,7 @@ void setup() {
bandPass.process(noise);
// Change the cutoff frequency of the filter
- bandpass.freq(freq);
+ bandPass.freq(freq);
}
void draw() {
diff --git a/content/api_en/LIB_sound/BandPass_stop.xml b/content/api_en/LIB_sound/BandPass_stop.xml
index cf78196e6..7e7143aeb 100755
--- a/content/api_en/LIB_sound/BandPass_stop.xml
+++ b/content/api_en/LIB_sound/BandPass_stop.xml
@@ -37,8 +37,8 @@ void draw() {
void mousePressed() {
//stop the noise generator and the filter
- noise.stop();
- bandpass.stop();
+ //noise.stop();
+ bandPass.stop();
}
]]>
diff --git a/content/api_en/LIB_sound/BrownNoise.xml b/content/api_en/LIB_sound/BrownNoise.xml
index 72c8fe79b..f8b95cac7 100755
--- a/content/api_en/LIB_sound/BrownNoise.xml
+++ b/content/api_en/LIB_sound/BrownNoise.xml
@@ -29,66 +29,7 @@ void draw() {
-
-
-
-
-
-
-
-
-play()
-Start the generator
-
-
-
-stop()
-Stop the generator
-
-
-
-amp()
-Change the amplitude/volume of the generator
-
-
-
-add()
-Offset the output of the generator by given value
-
-
-
-pan()
-Move the sound in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-BrownNoise(parent)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
diff --git a/content/api_en/LIB_sound/BrownNoise_add.xml b/content/api_en/LIB_sound/BrownNoise_add.xml
index ec5550347..d00869e8d 100755
--- a/content/api_en/LIB_sound/BrownNoise_add.xml
+++ b/content/api_en/LIB_sound/BrownNoise_add.xml
@@ -35,19 +35,4 @@ void draw() {
The .add() method is useful for modulating other audio signals.
]]>
-
-noise.add(add)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/BrownNoise_amp.xml b/content/api_en/LIB_sound/BrownNoise_amp.xml
index edb349c7d..4264c2f4b 100755
--- a/content/api_en/LIB_sound/BrownNoise_amp.xml
+++ b/content/api_en/LIB_sound/BrownNoise_amp.xml
@@ -35,24 +35,4 @@ void draw() {
Changes the amplitude/volume of the noise generator. Allowed values are between 0.0 and 1.0.
]]>
-
-noise.amp(vol)
-
-
-
-
-
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/BrownNoise_pan.xml b/content/api_en/LIB_sound/BrownNoise_pan.xml
index 71043d021..6644626fd 100755
--- a/content/api_en/LIB_sound/BrownNoise_pan.xml
+++ b/content/api_en/LIB_sound/BrownNoise_pan.xml
@@ -36,19 +36,4 @@ void draw() {
Pan the generator in a stereo panorama. -1.0 pans to the left channel and 1.0 to the right channel.
]]>
-
-noise.pan(pos)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/BrownNoise_play.xml b/content/api_en/LIB_sound/BrownNoise_play.xml
index 9a1c30f40..915d8cfcb 100755
--- a/content/api_en/LIB_sound/BrownNoise_play.xml
+++ b/content/api_en/LIB_sound/BrownNoise_play.xml
@@ -34,19 +34,4 @@ void draw() {
Starts the Brown Noise generator.
]]>
-
-noise.play()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/BrownNoise_set.xml b/content/api_en/LIB_sound/BrownNoise_set.xml
index 1ace27281..a24a1c3ef 100755
--- a/content/api_en/LIB_sound/BrownNoise_set.xml
+++ b/content/api_en/LIB_sound/BrownNoise_set.xml
@@ -41,19 +41,4 @@ void mousePressed() {
Sets amplitude, add and pan position with one method.
]]>
-
-noise.set(amp, add, pos)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/BrownNoise_stop.xml b/content/api_en/LIB_sound/BrownNoise_stop.xml
index 93c88a426..6111b73ae 100755
--- a/content/api_en/LIB_sound/BrownNoise_stop.xml
+++ b/content/api_en/LIB_sound/BrownNoise_stop.xml
@@ -1,7 +1,7 @@
-play()
+stop()Noise
@@ -38,19 +38,4 @@ void mousePressed() {
Stops the Brown Noise generator.
]]>
-
-noise.stop()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/FFT_analyze.xml b/content/api_en/LIB_sound/FFT_analyze.xml
index 6c05e7396..4bd4c1bfa 100755
--- a/content/api_en/LIB_sound/FFT_analyze.xml
+++ b/content/api_en/LIB_sound/FFT_analyze.xml
@@ -41,34 +41,14 @@ void draw() {
for(int i = 0; i < bands; i++){
// The result of the FFT is normalized
// draw the line for frequency band i scaling it up by 5 to get more amplitude.
- line( i, height, i, height - spectrum[i]*height*5 );
+ line(i, height, i, height - spectrum[i]*height*5 );
}
}
]]>
-
-amp.analyze()
-
-
-
-
-
-
-
-float
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/FFT_stop.xml b/content/api_en/LIB_sound/FFT_stop.xml
index ea7b4e6dc..c58f7b983 100755
--- a/content/api_en/LIB_sound/FFT_stop.xml
+++ b/content/api_en/LIB_sound/FFT_stop.xml
@@ -47,7 +47,6 @@ void draw() {
void mousePressed() {
in.stop();
- fft.stop();
}
]]>
diff --git a/content/api_en/LIB_sound/HighPass_freq.xml b/content/api_en/LIB_sound/HighPass_freq.xml
index 9c0b81216..499ef5f6d 100755
--- a/content/api_en/LIB_sound/HighPass_freq.xml
+++ b/content/api_en/LIB_sound/HighPass_freq.xml
@@ -31,7 +31,7 @@ void setup() {
highPass.process(noise);
// Change the cutoff frequency of the filter
- highpass.freq(freq);
+ highPass.freq(freq);
}
void draw() {
diff --git a/content/api_en/LIB_sound/HighPass_stop.xml b/content/api_en/LIB_sound/HighPass_stop.xml
index 94a64a8f4..9f9eb1b0b 100755
--- a/content/api_en/LIB_sound/HighPass_stop.xml
+++ b/content/api_en/LIB_sound/HighPass_stop.xml
@@ -17,8 +17,6 @@ import processing.sound.*;
WhiteNoise noise;
HighPass highPass;
-float amp=0.0;
-
void setup() {
size(640,360);
background(255);
diff --git a/content/api_en/LIB_sound/LowPass_freq.xml b/content/api_en/LIB_sound/LowPass_freq.xml
index aed66f36d..f4fd2d8ef 100755
--- a/content/api_en/LIB_sound/LowPass_freq.xml
+++ b/content/api_en/LIB_sound/LowPass_freq.xml
@@ -31,7 +31,7 @@ void setup() {
lowPass.process(noise);
// Change the cutoff frequency of the filter
- highpass.freq(freq);
+ lowPass.freq(freq);
}
void draw() {
diff --git a/content/api_en/LIB_sound/LowPass_stop.xml b/content/api_en/LIB_sound/LowPass_stop.xml
index 13cda1c39..96423bbea 100755
--- a/content/api_en/LIB_sound/LowPass_stop.xml
+++ b/content/api_en/LIB_sound/LowPass_stop.xml
@@ -17,8 +17,6 @@ import processing.sound.*;
WhiteNoise noise;
LowPass lowPass;
-float amp=0.0;
-
void setup() {
size(640,360);
background(255);
diff --git a/content/api_en/LIB_sound/PinkNoise.xml b/content/api_en/LIB_sound/PinkNoise.xml
index 59f26ae9a..fd74f29e5 100755
--- a/content/api_en/LIB_sound/PinkNoise.xml
+++ b/content/api_en/LIB_sound/PinkNoise.xml
@@ -29,66 +29,7 @@ void draw() {
-
-
-
-
-
-
-
-
-play()
-Start the generator
-
-
-
-stop()
-Stop the generator
-
-
-
-amp()
-Change the amplitude/volume of the generator
-
-
-
-add()
-Offset the output of the generator by given value
-
-
-
-pan()
-Move the sound in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-WhiteNoise(parent)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
diff --git a/content/api_en/LIB_sound/PinkNoise_add.xml b/content/api_en/LIB_sound/PinkNoise_add.xml
index 999b05183..28de64b97 100755
--- a/content/api_en/LIB_sound/PinkNoise_add.xml
+++ b/content/api_en/LIB_sound/PinkNoise_add.xml
@@ -35,19 +35,4 @@ void draw() {
The .add() method is useful for modulating other audio signals.
]]>
-
-noise.add(add)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/PinkNoise_amp.xml b/content/api_en/LIB_sound/PinkNoise_amp.xml
index 14e8a8745..67e87cc56 100755
--- a/content/api_en/LIB_sound/PinkNoise_amp.xml
+++ b/content/api_en/LIB_sound/PinkNoise_amp.xml
@@ -35,24 +35,4 @@ void draw() {
Changes the amplitude/volume of the noise generator. Allowed values are between 0.0 and 1.0.
]]>
-
-noise.amp(vol)
-
-
-
-
-
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/PinkNoise_pan.xml b/content/api_en/LIB_sound/PinkNoise_pan.xml
index d786b649b..10bb0cf09 100755
--- a/content/api_en/LIB_sound/PinkNoise_pan.xml
+++ b/content/api_en/LIB_sound/PinkNoise_pan.xml
@@ -36,19 +36,4 @@ void draw() {
Pan the generator in a stereo panorama. -1.0 pans to the left channel and 1.0 to the right channel.
]]>
-
-noise.pan(pos)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/PinkNoise_play.xml b/content/api_en/LIB_sound/PinkNoise_play.xml
index 9cf795d7d..c40593f4d 100755
--- a/content/api_en/LIB_sound/PinkNoise_play.xml
+++ b/content/api_en/LIB_sound/PinkNoise_play.xml
@@ -34,19 +34,4 @@ void draw() {
Starts the Pink Noise generator.
]]>
-
-noise.play()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/PinkNoise_set.xml b/content/api_en/LIB_sound/PinkNoise_set.xml
index ff84919dc..9914d239f 100755
--- a/content/api_en/LIB_sound/PinkNoise_set.xml
+++ b/content/api_en/LIB_sound/PinkNoise_set.xml
@@ -41,19 +41,4 @@ void mousePressed() {
Sets amplitude, add and pan position with one method.
]]>
-
-noise.set(amp, add, pos)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/PinkNoise_stop.xml b/content/api_en/LIB_sound/PinkNoise_stop.xml
index 1d99c7db8..f9bc7dca5 100755
--- a/content/api_en/LIB_sound/PinkNoise_stop.xml
+++ b/content/api_en/LIB_sound/PinkNoise_stop.xml
@@ -1,7 +1,7 @@
-play()
+stop()Noise
@@ -38,19 +38,4 @@ void mousePressed() {
Stops the Pink Noise generator.
]]>
-
-noise.stop()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/Pulse.xml b/content/api_en/LIB_sound/Pulse.xml
index 2bae58c81..e1b4402cd 100755
--- a/content/api_en/LIB_sound/Pulse.xml
+++ b/content/api_en/LIB_sound/Pulse.xml
@@ -9,7 +9,7 @@
Application
-
+../../../images/LIB_sound_Pulse.png
-
-
-
-
-
-
-
-
-play()
-Start the oscillator
-
-
-
-stop()
-Stop the oscillator
-
-
-
-freq()
-Change the frequency of the oscillator
-
-
-
-width()
-Change the pulse width of the oscillator
-
-
-
-amp()
-Change the amplitude/volume of the oscillator
-
-
-
-add()
-Offset the output of the oscillator by given value
-
-
-
-pan()
-Move the sound in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-Pulse(parent)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
diff --git a/content/api_en/LIB_sound/Pulse_set.xml b/content/api_en/LIB_sound/Pulse_set.xml
index 0f3d893e0..0e5935e7f 100755
--- a/content/api_en/LIB_sound/Pulse_set.xml
+++ b/content/api_en/LIB_sound/Pulse_set.xml
@@ -29,11 +29,11 @@ void draw() {
void mousePressed() {
float freq=200;
- float width=0.5;
+ float plswidth=0.5;
float amp=0.5;
float add=0.0;
float pos=1;
- pulse.set(freq, width, amp, add, pos);
+ pulse.set(freq, plswidth, amp, add, pos);
}
]]>
diff --git a/content/api_en/LIB_sound/Reverb.xml b/content/api_en/LIB_sound/Reverb.xml
index 8d34c05ce..6697df3b9 100755
--- a/content/api_en/LIB_sound/Reverb.xml
+++ b/content/api_en/LIB_sound/Reverb.xml
@@ -28,6 +28,7 @@ void setup() {
// start the input stream
in.play();
+ reverb.process(in);
}
void draw() {
diff --git a/content/api_en/LIB_sound/Reverb_stop.xml b/content/api_en/LIB_sound/Reverb_stop.xml
index 8d2fe420d..574071bfc 100755
--- a/content/api_en/LIB_sound/Reverb_stop.xml
+++ b/content/api_en/LIB_sound/Reverb_stop.xml
@@ -32,14 +32,14 @@ void setup() {
// Patch the reverb
reverb.process(in, 5);
- reverb.time(0.5);
+ //reverb.damp(0.5);
}
void draw() {
}
void mousePressed() {
- in.stop();
+ //in.stop();
reverb.stop();
}
diff --git a/content/api_en/LIB_sound/SawOsc.xml b/content/api_en/LIB_sound/SawOsc.xml
index 514326e8f..979ca1bb5 100755
--- a/content/api_en/LIB_sound/SawOsc.xml
+++ b/content/api_en/LIB_sound/SawOsc.xml
@@ -9,7 +9,7 @@
Application
-
+../../../images/LIB_sound_SawOsc.png
-
-
-
-
-
-
-
-
-play()
-Start the oscillator
-
-
-
-stop()
-Stop the oscillator
-
-
-
-freq()
-Change the frequency of the oscillator
-
-
-
-amp()
-Change the amplitude/volume of the oscillator
-
-
-
-add()
-Offset the output of the oscillator by given value
-
-
-
-pan()
-Move the sound in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-SqrOsc(parent)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
diff --git a/content/api_en/LIB_sound/SinOsc.xml b/content/api_en/LIB_sound/SinOsc.xml
index 1f6c8ad1e..abec47858 100755
--- a/content/api_en/LIB_sound/SinOsc.xml
+++ b/content/api_en/LIB_sound/SinOsc.xml
@@ -9,7 +9,7 @@
Application
-
+../../../images/LIB_sound_SinOsc.png
-
-
-
-
-
-
-
-
-play()
-Start the oscillator
-
-
-
-stop()
-Stop the oscillator
-
-
-
-freq()
-Change the frequency of the oscillator
-
-
-
-amp()
-Change the amplitude/volume of the oscillator
-
-
-
-add()
-Offset the output of the oscillator by given value
-
-
-
-pan()
-Move the sound in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-SinOsc(parent)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
diff --git a/content/api_en/LIB_sound/SinOsc_play.xml b/content/api_en/LIB_sound/SinOsc_play.xml
index 31761bad6..4c89cd172 100755
--- a/content/api_en/LIB_sound/SinOsc_play.xml
+++ b/content/api_en/LIB_sound/SinOsc_play.xml
@@ -13,7 +13,7 @@
+
+Sound
+
+Sound
+
+Configuration
+
+Application
+
+
+
+
+
+
+
+
+AudioIn
+
+
+
\ No newline at end of file
diff --git a/content/api_en/LIB_sound/SoundFile.xml b/content/api_en/LIB_sound/SoundFile.xml
index db860e881..c6eb0d03c 100755
--- a/content/api_en/LIB_sound/SoundFile.xml
+++ b/content/api_en/LIB_sound/SoundFile.xml
@@ -9,7 +9,6 @@
Application
-
-
-
-
-
-
-
-
-
-play()
-Play the soundfile
-
-
-
-loop()
-Loop the soundfile
-
-
-
-cue()
-Set the starting position of the soundfile
-
-
-
-jump()
-Jump to a specific position in the file while continuing to play
-
-
-
-stop()
-Stop the soundfile
-
-
-
-rate()
-Change the playback rate of the soundfile
-
-
-
-amp()
-Change the amplitude/volume of the player
-
-
-
-add()
-Offset the output of the player by given value
-
-
-
-pan()
-Move the soundfile in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-duration()
-Returns the duration of the soundfile
-
-
-
-sampleRate()
-Returns the sample rate of the soundfile
-
-
-
-frames()
-Returns the number of frames/samples of the soundfile
-
-
-
-channels()
-Returns the number of channels of the soundfile
-
-
-
-SoundFile(parent, path)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-path
-Full Path to file or filename for data path
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
diff --git a/content/api_en/LIB_sound/SoundFile_add.xml b/content/api_en/LIB_sound/SoundFile_add.xml
index 28df56508..2b92734e5 100755
--- a/content/api_en/LIB_sound/SoundFile_add.xml
+++ b/content/api_en/LIB_sound/SoundFile_add.xml
@@ -18,12 +18,12 @@ SoundFile file;
void setup() {
size(640, 360);
background(255);
-
+
// Load a soundfile from the /data folder of the sketch and play it back
file = new SoundFile(this, "sample.mp3");
file.play();
file.add(0.1);
-}
+}
void draw() {
}
@@ -32,7 +32,7 @@ void draw() {
diff --git a/content/api_en/LIB_sound/SoundFile_amp.xml b/content/api_en/LIB_sound/SoundFile_amp.xml
index 8fed77f35..34002bbd2 100755
--- a/content/api_en/LIB_sound/SoundFile_amp.xml
+++ b/content/api_en/LIB_sound/SoundFile_amp.xml
@@ -21,8 +21,8 @@ void setup() {
// Load a soundfile from the /data folder of the sketch and play it back
file = new SoundFile(this, "sample.mp3");
- file.play();
file.amp(0.5);
+ file.play();
}
void draw() {
diff --git a/content/api_en/LIB_sound/SoundFile_channels.xml b/content/api_en/LIB_sound/SoundFile_channels.xml
index 2e371f9e2..ace503d83 100755
--- a/content/api_en/LIB_sound/SoundFile_channels.xml
+++ b/content/api_en/LIB_sound/SoundFile_channels.xml
@@ -18,11 +18,11 @@ SoundFile file;
void setup() {
size(640, 360);
background(255);
-
+
// Load a soundfile from the /data folder of the sketch and get the number of channels
file = new SoundFile(this, "sample.mp3");
println(file.channels());
-}
+}
void draw() {
}
@@ -31,22 +31,7 @@ void draw() {
-
-file.channels()
-
-
-int
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_cue.xml b/content/api_en/LIB_sound/SoundFile_cue.xml
index 347d45dc4..bded003ce 100755
--- a/content/api_en/LIB_sound/SoundFile_cue.xml
+++ b/content/api_en/LIB_sound/SoundFile_cue.xml
@@ -21,33 +21,17 @@ void setup() {
// Load a soundfile from the /data folder of the sketch and play it back
file = new SoundFile(this, "sample.mp3");
- file.cue(15);
+ file.cue(3.5);
file.play();
}
void draw() {
}
-
]]>second parameter supports only integer values.
+Cues the playhead to a fixed position in the soundfile. Note that cue() only affects the playhead for future calls to play(), but not to loop().
]]>
-
-file.cue(second)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_duration.xml b/content/api_en/LIB_sound/SoundFile_duration.xml
index ca9e0e073..969d68a02 100755
--- a/content/api_en/LIB_sound/SoundFile_duration.xml
+++ b/content/api_en/LIB_sound/SoundFile_duration.xml
@@ -21,32 +21,16 @@ void setup() {
// Load a soundfile from the data folder of the sketch and get the duration of the file
file = new SoundFile(this, "sample.mp3");
- println("SFDuration= " + file.duration() + " seconds");
+ println("Duration= " + file.duration() + " seconds");
}
void draw() {
}
-
]]>
-
-file.duration()
-
-
-float
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_frames.xml b/content/api_en/LIB_sound/SoundFile_frames.xml
index 5125a8b83..f4a66de1a 100755
--- a/content/api_en/LIB_sound/SoundFile_frames.xml
+++ b/content/api_en/LIB_sound/SoundFile_frames.xml
@@ -18,10 +18,10 @@ SoundFile file;
void setup() {
size(640, 360);
background(255);
-
- // Load a soundfile from the data folder of the sketch and get the number of channels
+
+ // Load a soundfile from the data folder of the sketch and get the number of frames
file = new SoundFile(this, "sample.mp3");
- println("SFSamples= " + soundfile.frames() + " samples");
+ println("Frames= " + file.frames() + " frames");
}
void draw() {
@@ -31,22 +31,7 @@ void draw() {
-
-file.frames()
-
-
-int
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_isPlaying.xml b/content/api_en/LIB_sound/SoundFile_isPlaying.xml
new file mode 100755
index 000000000..fb5ec3082
--- /dev/null
+++ b/content/api_en/LIB_sound/SoundFile_isPlaying.xml
@@ -0,0 +1,45 @@
+
+
+
+isPlaying()
+
+Sound Files
+
+
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/SoundFile_jump.xml b/content/api_en/LIB_sound/SoundFile_jump.xml
index caa6a01a9..23bb57fa1 100755
--- a/content/api_en/LIB_sound/SoundFile_jump.xml
+++ b/content/api_en/LIB_sound/SoundFile_jump.xml
@@ -21,32 +21,16 @@ void setup() {
// Load a soundfile from the /data folder of the sketch and play it back
file = new SoundFile(this, "sample.mp3");
- file.jump(15.3);
+ file.jump(3.5);
}
void draw() {
}
-
]]>
-
-file.jump(second)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_loop.xml b/content/api_en/LIB_sound/SoundFile_loop.xml
index d66e81a83..8f42ae4d9 100755
--- a/content/api_en/LIB_sound/SoundFile_loop.xml
+++ b/content/api_en/LIB_sound/SoundFile_loop.xml
@@ -31,7 +31,7 @@ void draw() {
diff --git a/content/api_en/LIB_sound/SoundFile_pan.xml b/content/api_en/LIB_sound/SoundFile_pan.xml
index 52fc29f6b..44e6f2746 100755
--- a/content/api_en/LIB_sound/SoundFile_pan.xml
+++ b/content/api_en/LIB_sound/SoundFile_pan.xml
@@ -19,7 +19,7 @@ void setup() {
size(640, 360);
background(255);
- // Load a soundfile from the data folder of the sketch and play it back
+ // Load a MONO soundfile from the data folder of the sketch and play it back
file = new SoundFile(this, "sample.mp3");
file.play();
}
@@ -32,22 +32,7 @@ void draw() {
-
-file.pan()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_sampleRate.xml b/content/api_en/LIB_sound/SoundFile_pause.xml
similarity index 51%
rename from content/api_en/LIB_sound/SoundFile_sampleRate.xml
rename to content/api_en/LIB_sound/SoundFile_pause.xml
index 4f24779e3..abfe629ae 100755
--- a/content/api_en/LIB_sound/SoundFile_sampleRate.xml
+++ b/content/api_en/LIB_sound/SoundFile_pause.xml
@@ -1,7 +1,7 @@
-sampleRate()
+pause()Sound Files
@@ -18,35 +18,27 @@ SoundFile file;
void setup() {
size(640, 360);
background(255);
-
- // Load a soundfile from the data folder of the sketch and get the number of channels
+
+ // Load a soundfile from the /data folder of the sketch and play it back
file = new SoundFile(this, "sample.mp3");
- println("SFSampleRate= " + sample.sampleRate() + " Hz");
-}
+ file.play();
+}
void draw() {
}
+void mousePressed() {
+ if (file.isPlaying()) {
+ file.pause();
+ } else {
+ file.play();
+ }
+}
]]>
-
-file.sampleRate()
-
-
-int
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_play.xml b/content/api_en/LIB_sound/SoundFile_play.xml
index 95f493497..f3bb129ef 100755
--- a/content/api_en/LIB_sound/SoundFile_play.xml
+++ b/content/api_en/LIB_sound/SoundFile_play.xml
@@ -22,31 +22,15 @@ void setup() {
// Load a soundfile from the /data folder of the sketch and play it back
file = new SoundFile(this, "sample.mp3");
file.play();
-}
+}
void draw() {
}
-
]]>
-
-file.play()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_rate.xml b/content/api_en/LIB_sound/SoundFile_rate.xml
index 48ef77737..953ca579d 100755
--- a/content/api_en/LIB_sound/SoundFile_rate.xml
+++ b/content/api_en/LIB_sound/SoundFile_rate.xml
@@ -21,34 +21,17 @@ void setup() {
// Load a soundfile from the data folder of the sketch and play it back double the speed
file = new SoundFile(this, "sample.mp3");
- file.play();
+ file.loop();
file.rate(2);
}
void draw() {
}
-
]]>
-
-file.rate()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/SoundFile_set.xml b/content/api_en/LIB_sound/SoundFile_set.xml
index e77c0dd64..b9f42ee74 100755
--- a/content/api_en/LIB_sound/SoundFile_set.xml
+++ b/content/api_en/LIB_sound/SoundFile_set.xml
@@ -19,27 +19,26 @@ void setup() {
size(640, 360);
background(255);
- // Load a soundfile from the data folder of the sketch and get the number of channels
+ // Load a soundfile from the data folder of the sketch
file = new SoundFile(this, "sample.mp3");
- println("SFSampleRate= " + sample.sampleRate() + " Hz");
}
void draw() {
}
void mousePressed() {
- float rate=3;
- float pos=0.5;
- float amp=0.5;
- float add=0;
- file.set(freq, amp, add, pos);
+ float rate = 3;
+ float pos = 0.5;
+ float amp = 0.5;
+ float add = 0;
+ file.set(rate, pos, amp, add);
}
]]>
diff --git a/content/api_en/LIB_sound/SoundFile_stop.xml b/content/api_en/LIB_sound/SoundFile_stop.xml
index 044fea7dd..d4b3830e7 100755
--- a/content/api_en/LIB_sound/SoundFile_stop.xml
+++ b/content/api_en/LIB_sound/SoundFile_stop.xml
@@ -15,23 +15,26 @@
import processing.sound.*;
SoundFile file;
- void setup() {
+void setup() {
size(640, 360);
background(255);
-
+
// Load a soundfile from the /data folder of the sketch and play it back
file = new SoundFile(this, "sample.mp3");
file.play();
- }
-
- void mousePressed() {
+}
+
+void draw() {
+}
+
+void mousePressed() {
file.stop();
- }
+}
]]>
diff --git a/content/api_en/LIB_sound/Sound_inputDevice.xml b/content/api_en/LIB_sound/Sound_inputDevice.xml
new file mode 100755
index 000000000..e09498aac
--- /dev/null
+++ b/content/api_en/LIB_sound/Sound_inputDevice.xml
@@ -0,0 +1,36 @@
+
+
+
+inputDevice()
+
+Sound
+
+Configuration
+
+Web & Application
+
+
+
+
+
+
+
+
+
+AudioIn
+
+
+
diff --git a/content/api_en/LIB_sound/Sound_list.xml b/content/api_en/LIB_sound/Sound_list.xml
new file mode 100755
index 000000000..80644eb01
--- /dev/null
+++ b/content/api_en/LIB_sound/Sound_list.xml
@@ -0,0 +1,28 @@
+
+
+
+Sound.list()
+
+Sound
+
+Configuration
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/Sound_outputDevice.xml b/content/api_en/LIB_sound/Sound_outputDevice.xml
new file mode 100755
index 000000000..3f26b40eb
--- /dev/null
+++ b/content/api_en/LIB_sound/Sound_outputDevice.xml
@@ -0,0 +1,33 @@
+
+
+
+outputDevice()
+
+Sound
+
+Configuration
+
+Web & Application
+
+
+
+
+
+
+
+
+
+AudioIn
+
+
+
diff --git a/content/api_en/LIB_sound/Sound_sampleRate.xml b/content/api_en/LIB_sound/Sound_sampleRate.xml
new file mode 100755
index 000000000..0e37ce728
--- /dev/null
+++ b/content/api_en/LIB_sound/Sound_sampleRate.xml
@@ -0,0 +1,31 @@
+
+
+sampleRate()
+
+Sound
+
+Configuration
+
+Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/Sound_volume.xml b/content/api_en/LIB_sound/Sound_volume.xml
new file mode 100755
index 000000000..96d9e6700
--- /dev/null
+++ b/content/api_en/LIB_sound/Sound_volume.xml
@@ -0,0 +1,46 @@
+
+
+
+volume()
+
+Sound
+
+Configuration
+
+Web & Application
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/LIB_sound/SqrOsc.xml b/content/api_en/LIB_sound/SqrOsc.xml
index d1d0c096f..f4ff7ec2f 100755
--- a/content/api_en/LIB_sound/SqrOsc.xml
+++ b/content/api_en/LIB_sound/SqrOsc.xml
@@ -9,7 +9,7 @@
Application
-
+../../../images/LIB_sound_SqrOsc.png
-
-
-
-
-
-
-
-
-play()
-Start the oscillator
-
-
-
-stop()
-Stop the oscillator
-
-
-
-freq()
-Change the frequency of the oscillator
-
-
-
-amp()
-Change the amplitude/volume of the oscillator
-
-
-
-add()
-Offset the output of the oscillator by given value
-
-
-
-pan()
-Move the sound in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-SqrOsc(parent)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
diff --git a/content/api_en/LIB_sound/TriOsc.xml b/content/api_en/LIB_sound/TriOsc.xml
index 2ca49c832..d504de89a 100755
--- a/content/api_en/LIB_sound/TriOsc.xml
+++ b/content/api_en/LIB_sound/TriOsc.xml
@@ -9,7 +9,7 @@
Application
-
+../../../images/LIB_sound_TriOsc.png
-
-
-
-
-
-
-
-
-play()
-Start the oscillator
-
-
-
-stop()
-Stop the oscillator
-
-
-
-freq()
-Change the frequency of the oscillator
-
-
-
-amp()
-Change the amplitude/volume of the oscillator
-
-
-
-add()
-Offset the output of the oscillator by given value
-
-
-
-pan()
-Move the sound in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-TriOsc(parent)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
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/LIB_sound/WhiteNoise.xml b/content/api_en/LIB_sound/WhiteNoise.xml
index 0f67dfb46..ba8d252c2 100755
--- a/content/api_en/LIB_sound/WhiteNoise.xml
+++ b/content/api_en/LIB_sound/WhiteNoise.xml
@@ -29,66 +29,7 @@ void draw() {
-
-
-
-
-
-
-
-
-play()
-Start the generator
-
-
-
-stop()
-Stop the generator
-
-
-
-amp()
-Change the amplitude/volume of the generator
-
-
-
-add()
-Offset the output of the generator by given value
-
-
-
-pan()
-Move the sound in a stereo panorama
-
-
-
-set()
-Set multiple parameters at once
-
-
-
-WhiteNoise(parent)
-
-
-
-parent
-PApplet: typically use "this"
-
-
-
-
-
-
-
-1.0
-
-Object
-
-Library
-
diff --git a/content/api_en/LIB_sound/WhiteNoise_add.xml b/content/api_en/LIB_sound/WhiteNoise_add.xml
index 1876dc1ab..a6da5916b 100755
--- a/content/api_en/LIB_sound/WhiteNoise_add.xml
+++ b/content/api_en/LIB_sound/WhiteNoise_add.xml
@@ -34,19 +34,4 @@ void draw() {
The .add() method is useful for modulating other audio signals.
]]>
-
-noise.add(add)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/WhiteNoise_amp.xml b/content/api_en/LIB_sound/WhiteNoise_amp.xml
index 98ea36777..83eef598a 100755
--- a/content/api_en/LIB_sound/WhiteNoise_amp.xml
+++ b/content/api_en/LIB_sound/WhiteNoise_amp.xml
@@ -35,24 +35,4 @@ void draw() {
Changes the amplitude/volume of the noise generator. Allowed values are between 0.0 and 1.0.
]]>
-
-noise.amp(vol)
-
-
-
-
-
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/WhiteNoise_pan.xml b/content/api_en/LIB_sound/WhiteNoise_pan.xml
index 3bcfab0ec..ffb68b7cf 100755
--- a/content/api_en/LIB_sound/WhiteNoise_pan.xml
+++ b/content/api_en/LIB_sound/WhiteNoise_pan.xml
@@ -36,19 +36,4 @@ void draw() {
Pan the generator in a stereo panorama. -1.0 pans to the left channel and 1.0 to the right channel.
]]>
-
-noise.pan(pos)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/WhiteNoise_play.xml b/content/api_en/LIB_sound/WhiteNoise_play.xml
index c25d29486..9dd12d80d 100755
--- a/content/api_en/LIB_sound/WhiteNoise_play.xml
+++ b/content/api_en/LIB_sound/WhiteNoise_play.xml
@@ -34,19 +34,4 @@ void draw() {
Starts the White Noise generator.
]]>
-
-noise.play()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/WhiteNoise_set.xml b/content/api_en/LIB_sound/WhiteNoise_set.xml
index a4d965129..6ecf74ca1 100755
--- a/content/api_en/LIB_sound/WhiteNoise_set.xml
+++ b/content/api_en/LIB_sound/WhiteNoise_set.xml
@@ -41,19 +41,4 @@ void mousePressed() {
Sets amplitude, add and pan position with one method.
]]>
-
-noise.set(amp, add, pos)
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/WhiteNoise_stop.xml b/content/api_en/LIB_sound/WhiteNoise_stop.xml
index c7a0a65d3..783fa8a36 100755
--- a/content/api_en/LIB_sound/WhiteNoise_stop.xml
+++ b/content/api_en/LIB_sound/WhiteNoise_stop.xml
@@ -1,7 +1,7 @@
-play()
+stop()Noise
@@ -38,19 +38,4 @@ void mousePressed() {
Stops the White Noise generator.
]]>
-
-noise.stop()
-
-
-
-
-
-
-1.0
-
-Method
-
-Library
-
-
diff --git a/content/api_en/LIB_sound/index.html b/content/api_en/LIB_sound/index.html
index 007b42f79..5bee0974e 100755
--- a/content/api_en/LIB_sound/index.html
+++ b/content/api_en/LIB_sound/index.html
@@ -1,71 +1,75 @@
-
-
Sound
-
-
-
- The new Sound library for Processing 3 provides a simple way to work with audio. It can play, analyze, and synthesize sound. The library comes with a collection of oscillators for basic wave forms, a variety of noise generators, and effects and filters to alter sound files and other generated sounds. The syntax is minimal to make it easy to patch one sound object into another.
-
-
- The source code is available on the processing-sound GitHub repository. Please report bugs here. This library is only compatible with Processing 3.0+.
-
+ The new Sound library for Processing 3 provides a simple way to work with audio. It can play, analyze, and synthesize sound. It provides a collection of oscillators for basic wave forms, a variety of noise generators, and effects and filters to play and alter sound files and other generated sounds. The syntax is minimal to make it easy to patch one sound object into another. The library also comes with example sketches covering many use cases to help you get started.
+
+
+ The source code is available on the processing-sound GitHub repository. Please report bugs here. This library is only compatible with Processing 3.0+.
+
diff --git a/content/api_en/LIB_svg/index.html b/content/api_en/LIB_svg/index.html
new file mode 100644
index 000000000..24737df1d
--- /dev/null
+++ b/content/api_en/LIB_svg/index.html
@@ -0,0 +1,167 @@
+
+
SVG Export
+
+
+
The SVG library makes it possible to write SVG files directly from Processing. These vector graphics files can be scaled to any size and output at very high resolutions. The SVG library can flatten 3D data into a 2D vector file, but to export 3D data, use the DXF library. The source code is available on the Processing GitHub repository. Please report bugs here.
+
+ This library can be used with the core Processing function size(), or createGraphics(). See the examples below for different techniques.
+
+
+
+
+SVG Export (No Screen Display)
+
+This example draws a single frame to a SVG file and quits. (Note that no display window will open; this helps when you're trying to create massive SVG images that are far larger than the screen size.)
+
+
import processing.svg.*;
+
+void setup() {
+ size(400, 400, SVG, "filename.svg");
+}
+
+void draw() {
+ // Draw something good here
+ line(0, 0, width/2, height);
+
+ // Exit the program
+ println("Finished.");
+ exit();
+}
+
+
+
SVG Export (With Screen Display)
+
+To draw to the screen while also saving an SVG beginRecord()
+and endRecord() functions. Unlike the PDF renderer, the SVG renderer will only save the final frame of a sequence. This is slower, but is useful when you need to
+see what you're working on as it saves.
Single Frame from an Animation (With Screen Display)
+It's also possible to save one frame from a program with moving elements.
+Create a boolean variable to turn the SVG recording process on and off
+
+
import processing.svg.*;
+
+boolean record;
+
+void setup() {
+ size(400, 400);
+}
+
+void draw() {
+ if (record) {
+ // Note that #### will be replaced with the frame number. Fancy!
+ beginRecord(SVG, "frame-####.svg");
+ }
+
+ // Draw something good here
+ background(255);
+ line(mouseX, mouseY, width/2, height/2);
+
+ if (record) {
+ endRecord();
+ record = false;
+ }
+}
+
+// Use a keypress so thousands of files aren't created
+void mousePressed() {
+ record = true;
+}
+
+
+
SVG Files from 3D Geometry (With Screen Display)
+
+To create vectors from 3D data, use the beginRaw() and endRaw() commands.
+These commands will grab the shape data just before it is rendered to the screen.
+At this stage, your entire scene is nothing but a long list of lines and triangles.
+This means that a shape created with sphere() method will be made up of hundreds of
+triangles, rather than a single object.
+
+
When using beginRaw() and endRaw(), it's possible to write to either a 2D or 3D renderer.
+For instance, beginRaw() with the SVG library will write the geometry as flattened triangles
+and lines.
+
+
import processing.svg.*;
+
+boolean record;
+
+void setup() {
+ size(500, 500, P3D);
+}
+
+void draw() {
+ if (record) {
+ beginRaw(SVG, "output.svg");
+ }
+
+ // Do all your drawing here
+ background(204);
+ translate(width/2, height/2, -200);
+ rotateZ(0.2);
+ rotateY(mouseX/500.0);
+ box(200);
+
+ if (record) {
+ endRaw();
+ record = false;
+ }
+}
+
+// Hit 'r' to record a single frame
+void keyPressed() {
+ if (key == 'r') {
+ record = true;
+ }
+}
+
+
+
Using createGraphics() to Create an SVG File
+
+To write a SVG file using only the createGraphics() command, rather than as
+part of a sketch, it's necessary to call dispose() on the PGraphicsSVG object.
+This is the same as calling exit(), but it won't quit the sketch.
If you want 3D data, use the DXF recording library instead.
+
+
Using hint(ENABLE_DEPTH_SORT) can improve the appearance of 3D geometry drawn to 2D file formats.
+
+
Many methods, particularly pixel-based methods, don't make sense for SVG renderers. This includes: loadPixels, updatePixels, get, set, mask, filter, copy, blend, save, and image
+
+
Again, exit() is really important when using SVG with size().
+
+
+
+
+
+
diff --git a/content/api_en/PI.xml b/content/api_en/PI.xml
index d8de1ba8e..9567f9521 100755
--- a/content/api_en/PI.xml
+++ b/content/api_en/PI.xml
@@ -22,7 +22,7 @@ arc(x, y, d-60, d-60, 0, TWO_PI);
sin() and cos().
+PI is a mathematical constant with the value 3.1415927. It is the ratio of the circumference of a circle to its diameter. It is useful in combination with the trigonometric functions sin() and cos().
]]>
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/PImage_loadPixels.xml b/content/api_en/PImage_loadPixels.xml
index 5e84cfc90..a9c353f84 100644
--- a/content/api_en/PImage_loadPixels.xml
+++ b/content/api_en/PImage_loadPixels.xml
@@ -34,8 +34,6 @@ void draw() {
pixels[] array. This function must always be called before reading from or writing to pixels[].
-
-Certain renderers may or may not seem to require loadPixels() or updatePixels(). However, the rule is that any time you want to manipulate the pixels[] array, you must first call loadPixels(), and after changes have been made, call updatePixels(). Even if the renderer may not seem to use this function in the current Processing release, this will always be subject to change.
]]>
diff --git a/content/api_en/PImage_pixels.xml b/content/api_en/PImage_pixels.xml
index 1ec84949f..1f2a363e2 100755
--- a/content/api_en/PImage_pixels.xml
+++ b/content/api_en/PImage_pixels.xml
@@ -31,7 +31,9 @@ void draw() {
index value defines the position of a value within the array. For example, the statement color b = img.pixels[230] will set the variable b equal to the value at that location in the array. Before accessing this array, the data must loaded with the loadPixels() method. After the array data has been modified, the updatePixels() method must be run to update the changes. Without loadPixels(), running the code may (or will in future releases) result in a NullPointerException.
+The pixels[] array contains the values for all the pixels in the image. These values are of the color datatype. This array is the size of the image, meaning if the image is 100 x 100 pixels, there will be 10,000 values and if the window is 200 x 300 pixels, there will be 60,000 values.
+
+Before accessing this array, the data must loaded with the loadPixels() method. Failure to do so may result in a NullPointerException. After the array data has been modified, the updatePixels() method must be run to update the content of the display window.
]]>
diff --git a/content/api_en/PImage_save.xml b/content/api_en/PImage_save.xml
index d485f5cc8..0c6830b00 100755
--- a/content/api_en/PImage_save.xml
+++ b/content/api_en/PImage_save.xml
@@ -29,7 +29,7 @@ newImage.save("outputImage.jpg");
filename parameter. For example, "image.tif" will have a TIFF image and "image.png" will save a PNG image. If no extension is included in the filename, the image will save in TIFF format and .tif will be added to the name. These files are saved to the sketch's folder, which may be opened by selecting "Show sketch folder" from the "Sketch" menu. It is not possible to use save() while running the program in a web browser.
To save an image created within the code, rather than through loading, it's necessary to make the image with the createImage() function so it is aware of the location of the program and can therefore save the file to the right place. See the createImage() reference for more information.
+Saves the image into a file. Append a file extension to the name of the file, to indicate the file format to be used: either TIFF (.tif), TARGA (.tga), JPEG (.jpg), or PNG (.png). If no extension is included in the filename, the image will save in TIFF format and .tif will be added to the name. These files are saved to the sketch's folder, which may be opened by selecting "Show sketch folder" from the "Sketch" menu.
To save an image created within the code, rather than through loading, it's necessary to make the image with the createImage() function so it is aware of the location of the program and can therefore save the file to the right place. See the createImage() reference for more information.
]]>
diff --git a/content/api_en/PImage_updatePixels.xml b/content/api_en/PImage_updatePixels.xml
index 7e713fffd..470c33d07 100644
--- a/content/api_en/PImage_updatePixels.xml
+++ b/content/api_en/PImage_updatePixels.xml
@@ -34,10 +34,6 @@ void draw() {
pixels[] array. Use in conjunction with loadPixels(). If you're only reading pixels from the array, there's no need to call updatePixels().
-
-Certain renderers may or may not seem to require loadPixels() or updatePixels(). However, the rule is that any time you want to manipulate the pixels[] array, you must first call loadPixels(), and after changes have been made, call updatePixels(). Even if the renderer may not seem to use this function in the current Processing release, this will always be subject to change.
-
-Currently, none of the renderers use the additional parameters to updatePixels(), however this may be implemented in the future.
]]>
diff --git a/content/api_en/PShape.xml b/content/api_en/PShape.xml
index e98472031..5626a04da 100644
--- a/content/api_en/PShape.xml
+++ b/content/api_en/PShape.xml
@@ -47,7 +47,7 @@ void draw() {
loadShape() or created with the createShape(). The shape() function is used to draw the shape to the display window. Processing can currently load and display SVG (Scalable Vector Graphics) and OBJ shapes. OBJ files can only be opened using the P3D renderer. The loadShape() function supports SVG files created with Inkscape and Adobe Illustrator. It is not a full SVG implementation, but offers some straightforward support for handling vector data.
-The PShape object contains a group of methods that can operate on the shape data. Some of the methods are listed below, but the full list used for creating and modifying shapes is available here in the Processing Javadoc.
+The PShape object contains a group of methods that can operate on the shape data. Some of the methods are listed below, but the full list used for creating and modifying shapes is available here in the Processing Javadoc.
To create a new shape, use the createShape() function. Do not use the syntax new PShape().
]]>
diff --git a/content/api_en/PShape_addChild.xml b/content/api_en/PShape_addChild.xml
index 3d69836a8..36dcc867a 100644
--- a/content/api_en/PShape_addChild.xml
+++ b/content/api_en/PShape_addChild.xml
@@ -11,13 +11,13 @@
path, rectangle, and circle are added to a parent PShape variable named house that is a GROUP.
]]>
diff --git a/content/api_en/PShape_beginContour.xml b/content/api_en/PShape_beginContour.xml
index fefc7d7d1..510cf16f1 100644
--- a/content/api_en/PShape_beginContour.xml
+++ b/content/api_en/PShape_beginContour.xml
@@ -14,12 +14,12 @@
PShape s;
void setup() {
- size(100, 100);
+ size(200, 200, P2D);
// Make a shape
s = createShape();
s.beginShape();
- s.noStroke();
+ //s.noStroke();
// Exterior part of shape
s.vertex(-50,-50);
@@ -36,11 +36,11 @@ void setup() {
s.endContour();
// Finish off shape
- s.endShape();
+ s.endShape(CLOSE);
}
void draw() {
- background(52);
+ background(204);
translate(width/2, height/2);
s.rotate(0.01);
shape(s);
diff --git a/content/api_en/PShape_endContour.xml b/content/api_en/PShape_endContour.xml
index b88cd4c3f..43119b0ea 100644
--- a/content/api_en/PShape_endContour.xml
+++ b/content/api_en/PShape_endContour.xml
@@ -14,12 +14,12 @@
PShape s;
void setup() {
- size(100, 100);
+ size(200, 200, P2D);
// Make a shape
s = createShape();
s.beginShape();
- s.noStroke();
+ //s.noStroke();
// Exterior part of shape
s.vertex(-50,-50);
@@ -36,11 +36,11 @@ void setup() {
s.endContour();
// Finish off shape
- s.endShape();
+ s.endShape(CLOSE);
}
void draw() {
- background(52);
+ background(204);
translate(width/2, height/2);
s.rotate(0.01);
shape(s);
diff --git a/content/api_en/PVector_mult.xml b/content/api_en/PVector_mult.xml
index 7f273994d..778c37a24 100644
--- a/content/api_en/PVector_mult.xml
+++ b/content/api_en/PVector_mult.xml
@@ -46,7 +46,7 @@ void draw() {
diff --git a/content/api_en/QUARTER_PI.xml b/content/api_en/QUARTER_PI.xml
index 0ae6805d5..66ceae319 100644
--- a/content/api_en/QUARTER_PI.xml
+++ b/content/api_en/QUARTER_PI.xml
@@ -22,7 +22,7 @@ arc(x, y, d-60, d-60, 0, TWO_PI);
sin() and cos().
+QUARTER_PI is a mathematical constant with the value 0.7853982. It is one quarter the ratio of the circumference of a circle to its diameter. It is useful in combination with the trigonometric functions sin() and cos().
]]>
diff --git a/content/api_en/StringList_hasValue.xml b/content/api_en/StringList_hasValue.xml
index 764dfa9d9..c864feb07 100755
--- a/content/api_en/StringList_hasValue.xml
+++ b/content/api_en/StringList_hasValue.xml
@@ -21,8 +21,8 @@ void setup() {
inventory.append("flour");
inventory.append("tea");
println(inventory);
- if (inventory.hasValue("tea") == true) {
- println("Yes, we have a tea");
+ if (inventory.hasValue("tea")) {
+ println("Yes, we have tea");
} else {
println("Sorry, no tea");
}
diff --git a/content/api_en/TAU.xml b/content/api_en/TAU.xml
index 7c62e975c..ba3fe363a 100644
--- a/content/api_en/TAU.xml
+++ b/content/api_en/TAU.xml
@@ -22,7 +22,7 @@ arc(x, y, d-60, d-60, 0, TAU);
sin() and cos().
+TAU is a mathematical constant with the value 6.2831855. It is the circle constant relating the circumference of a circle to its linear dimension, the ratio of the circumference of a circle to its radius. It is useful in combination with trigonometric functions such as sin() and cos().
]]>
diff --git a/content/api_en/TWO_PI.xml b/content/api_en/TWO_PI.xml
index 86843be6c..50388e870 100755
--- a/content/api_en/TWO_PI.xml
+++ b/content/api_en/TWO_PI.xml
@@ -22,7 +22,7 @@ arc(x, y, d-60, d-60, 0, TWO_PI);
sin() and cos().
+TWO_PI is a mathematical constant with the value 6.2831855. It is twice the ratio of the circumference of a circle to its diameter. It is useful in combination with the trigonometric functions sin() and cos().
]]>
diff --git a/content/api_en/Table.xml b/content/api_en/Table.xml
index dd0071150..1df13c6cd 100755
--- a/content/api_en/Table.xml
+++ b/content/api_en/Table.xml
@@ -37,7 +37,10 @@ void setup() {
Table objects store data with multiple rows and columns, much like in a traditional spreadsheet. Tables can be generated from scratch, dynamically, or using data from an existing file. Tables can also be output and saved to disk, as in the example above.
+Table objects store data with multiple rows and columns, much like in a traditional spreadsheet. Tables can be generated from scratch, dynamically, or using data from an existing file. Tables can also be output and saved to disk, as in the example above.
+
+Additional Table methods are documented in the Processing Table Javadoc.
+
]]>
diff --git a/content/api_en/TableRow.xml b/content/api_en/TableRow.xml
index aaf992285..f6510325e 100755
--- a/content/api_en/TableRow.xml
+++ b/content/api_en/TableRow.xml
@@ -35,7 +35,9 @@ void setup() {
TableRow object represents a single row of data values, stored in columns, from a table.
+A TableRow object represents a single row of data values, stored in columns, from a table.
+
+Additional TableRow methods are documented in the Processing Data Javadoc.
]]>
diff --git a/content/api_en/TableRow_getColumnCount.xml b/content/api_en/TableRow_getColumnCount.xml
new file mode 100755
index 000000000..f43d72856
--- /dev/null
+++ b/content/api_en/TableRow_getColumnCount.xml
@@ -0,0 +1,36 @@
+
+
+
+getColumnCount()
+
+TableRow
+
+Method
+
+method
+
+
+
+
+
+
+TableRow.
+]]>
+
+
diff --git a/content/api_en/TableRow_getColumnTitle.xml b/content/api_en/TableRow_getColumnTitle.xml
new file mode 100755
index 000000000..51c7502a8
--- /dev/null
+++ b/content/api_en/TableRow_getColumnTitle.xml
@@ -0,0 +1,38 @@
+
+
+
+getColumnTitle()
+
+TableRow
+
+Method
+
+method
+
+
+
+
+
+
+TableRow based on its ID (e.g. 0, 1, 2, etc.)
+]]>
+
+
diff --git a/content/api_en/Table_sort.xml b/content/api_en/Table_sort.xml
new file mode 100755
index 000000000..6ef191f52
--- /dev/null
+++ b/content/api_en/Table_sort.xml
@@ -0,0 +1,91 @@
+
+
+
+sort()
+
+Table
+
+Method
+
+method
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/content/api_en/ambientLight.xml b/content/api_en/ambientLight.xml
index 8f2ed792f..029c8dcf4 100755
--- a/content/api_en/ambientLight.xml
+++ b/content/api_en/ambientLight.xml
@@ -41,7 +41,7 @@ sphere(30);
draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop. The v1, v2, and v3 parameters are interpreted as either RGB or HSB values, depending on the current color mode.
+Adds an ambient light. Ambient light doesn't come from a specific direction, the rays of light have bounced around so much that objects are evenly lit from all sides. Ambient lights are almost always used in combination with other types of lights. Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop. The v1, v2, and v3 parameters are interpreted as either RGB or HSB values, depending on the current color mode.
]]>
diff --git a/content/api_en/append.xml b/content/api_en/append.xml
index d9fc3aecc..fea9cc952 100755
--- a/content/api_en/append.xml
+++ b/content/api_en/append.xml
@@ -23,7 +23,7 @@ println(sa2);
element parameter must be the same as the datatype of the array.
+Expands a one-dimensional array by one element and adds data to the new position. The datatype of the element parameter must be the same as the datatype of the array.
When using an array of objects, the data returned from the function must be cast to the object array's data type. For example: SomeClass[] items = (SomeClass[]) append(originalArray, element)
]]>
diff --git a/content/api_en/arc.xml b/content/api_en/arc.xml
index 742e7391f..071891848 100755
--- a/content/api_en/arc.xml
+++ b/content/api_en/arc.xml
@@ -37,10 +37,10 @@ arc(50, 50, 80, 80, 0, PI+QUARTER_PI, PIE);
a, b, c, and d parameters. The origin of the arc's ellipse may be changed with the ellipseMode() function. Use the start and stop parameters to specify the angles (in radians) at which to draw the arc.
-
-There are three ways to draw an arc; the rendering technique used is defined by the optional seventh parameter. The three options, depicted in the above examples, are PIE, OPEN, and CHORD. The default mode is the OPEN stroke with a PIE fill.
-
+Draws an arc to the screen. Arcs are drawn along the outer edge of an ellipse defined by the a, b, c, and d parameters. The origin of the arc's ellipse may be changed with the ellipseMode() function. Use the start and stop parameters to specify the angles (in radians) at which to draw the arc. The start/stop values must be in clockwise order.
+
+There are three ways to draw an arc; the rendering technique used is defined by the optional seventh parameter. The three options, depicted in the above examples, are PIE, OPEN, and CHORD. The default mode is the OPEN stroke with a PIE fill.
+
In some cases, the arc() function isn't accurate enough for smooth drawing. For example, the shape may jitter on screen when rotating slowly. If you're having an issue with how arcs are rendered, you'll need to draw the arc yourself with beginShape()/endShape() or a PShape.
]]>
diff --git a/content/api_en/arrayCopy.xml b/content/api_en/arrayCopy.xml
index 1d0d41ef7..1b5165a10 100644
--- a/content/api_en/arrayCopy.xml
+++ b/content/api_en/arrayCopy.xml
@@ -41,7 +41,7 @@ Copies an array (or part of an array) to another array. The src array is
The simplified version with only two arguments — arrayCopy(src, dst) — copies an entire array to another of the same size. It is equivalent to arrayCopy(src, 0, dst, 0, src.length).
-Using this function is far more efficient for copying array data than iterating through a for() loop and copying each element individually. This function only copies references, which means that for most purposes it only copies one-dimensional arrays (a single set of brackets). If used with a two (or three or more) dimensional array, it will only copy the references at the first level, because a two dimensional array is simply an "array of arrays". This does not produce an error, however, because this is often the desired behavior. Internally, this function calls Java's System.arraycopy() method, so most things that apply there are inherited.
+Using this function is far more efficient for copying array data than iterating through a for() loop and copying each element individually. This function only copies references, which means that for most purposes it only copies one-dimensional arrays (a single set of brackets). If used with a two (or three or more) dimensional array, it will only copy the references at the first level, because a two dimensional array is simply an "array of arrays". This does not produce an error, however, because this is often the desired behavior. Internally, this function calls Java's System.arraycopy() method, so most things that apply there are inherited.
]]>
diff --git a/content/api_en/attrib.xml b/content/api_en/attrib.xml
new file mode 100644
index 000000000..3d21bc538
--- /dev/null
+++ b/content/api_en/attrib.xml
@@ -0,0 +1,63 @@
+
+
+
+attrib()
+
+Rendering
+
+
+
+
+
+
+
+
+
+
+attrib() function attaches custom values to each vertex in the scene. By default, Processing handles several per-vertex attributes: position, color, normal, texture coordinates, etc. These attributes are used by the renderer to determine how the geometry will look on the screen as result of applying the built-in shaders that compute texture, lighting, etc. However, if the coder sets a custom shader that does some additional rendering calculations, then she might need to pass additional information to the the shader in the form of custom attributes. These attributes can be of three types: position, normal, color, and other. The first three are meant to specify xyz coordinates, normal coordinates, and color components, respectively. The third type can be use to pass any kind of attribute value.
+]]>
+
+
diff --git a/content/api_en/beginRaw.xml b/content/api_en/beginRaw.xml
index 17a899383..caaeb869c 100755
--- a/content/api_en/beginRaw.xml
+++ b/content/api_en/beginRaw.xml
@@ -38,7 +38,7 @@ When using beginRaw() and endRaw(), it's possible to write to eith
If you want a background to show up in your files, use rect(0, 0, width, height) after setting the fill() to the background color. Otherwise the background will not be rendered to the file because the background is not shape.
-Using hint(ENABLE_DEPTH_SORT) can improve the appearance of 3D geometry drawn to 2D file formats. See the hint() reference for more details.
+Using hint(ENABLE_DEPTH_SORT) can improve the appearance of 3D geometry drawn to 2D file formats.
See examples in the reference for the PDF and DXF libraries for more information.
]]>
diff --git a/content/api_en/blend.xml b/content/api_en/blend.xml
index d10a95f76..59d8431c9 100755
--- a/content/api_en/blend.xml
+++ b/content/api_en/blend.xml
@@ -52,15 +52,15 @@ blend(img, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST);
-BLEND - linear interpolation of colours: C = A*factor + B
+BLEND - linear interpolation of colors: C = A*factor + B
ADD - additive blending with white clip: C = min(A*factor + B, 255)
SUBTRACT - subtractive blending with black clip: C = max(B - A*factor, 0)
-DARKEST - only the darkest colour succeeds: C = min(A*factor, B)
+DARKEST - only the darkest color succeeds: C = min(A*factor, B)
-LIGHTEST - only the lightest colour succeeds: C = max(A*factor, B)
+LIGHTEST - only the lightest color succeeds: C = max(A*factor, B)
DIFFERENCE - subtract colors from underlying image.
diff --git a/content/api_en/blendMode.xml b/content/api_en/blendMode.xml
index 26e3285a2..a3c309cb1 100755
--- a/content/api_en/blendMode.xml
+++ b/content/api_en/blendMode.xml
@@ -35,17 +35,17 @@ line(75, 25, 25, 75);
+Blends the pixels in the display window according to a defined mode. There is a choice of the following modes to blend the source pixels (A) with the ones of pixels already in the display window (B). Each pixel's final color is the result of applying one of the blend modes with each channel of (A) and (B) independently. The red channel is compared with red, green with green, and blue with blue.
-BLEND - linear interpolation of colours: C = A*factor + B. This is the default blending mode.
+BLEND - linear interpolation of colors: C = A*factor + B. This is the default.
ADD - additive blending with white clip: C = min(A*factor + B, 255)
SUBTRACT - subtractive blending with black clip: C = max(B - A*factor, 0)
-DARKEST - only the darkest colour succeeds: C = min(A*factor, B)
+DARKEST - only the darkest color succeeds: C = min(A*factor, B)
-LIGHTEST - only the lightest colour succeeds: C = max(A*factor, B)
+LIGHTEST - only the lightest color succeeds: C = max(A*factor, B)
DIFFERENCE - subtract colors from underlying image.
diff --git a/content/api_en/circle.xml b/content/api_en/circle.xml
new file mode 100755
index 000000000..0e1d9adfb
--- /dev/null
+++ b/content/api_en/circle.xml
@@ -0,0 +1,23 @@
+
+
+circle()
+
+Shape
+
+2D Primitives
+
+
+
+
+ellipse_.png
+
+
+
+ellipseMode() function.
+]]>
+
+
+
diff --git a/content/api_en/clear.xml b/content/api_en/clear.xml
index c0a2d9e5e..4db47b198 100644
--- a/content/api_en/clear.xml
+++ b/content/api_en/clear.xml
@@ -15,21 +15,25 @@ PGraphics pg;
void setup() {
size(200, 200);
- pg = createGraphics(100, 100);
+ pg = createGraphics(width, height);
}
void draw() {
background(204);
- pg.beginDraw();
- pg.stroke(0, 102, 153);
- pg.line(0, 0, mouseX, mouseY);
- pg.endDraw();
- image(pg, 50, 50);
-}
-
-// Click to clear the PGraphics object
-void mousePressed() {
- pg.clear();
+
+ // Clear the PGraphics when the mouse is pressed
+ if (mousePressed == true) {
+ pg.beginDraw();
+ pg.clear();
+ pg.endDraw();
+ } else {
+ pg.beginDraw();
+ pg.stroke(0, 102, 153);
+ pg.line(width/2, height/2, mouseX, mouseY);
+ pg.endDraw();
+ }
+
+ image(pg, 0, 0);
}
]]>
diff --git a/content/api_en/createGraphics.xml b/content/api_en/createGraphics.xml
index 64ab9244c..2eb84e5bc 100755
--- a/content/api_en/createGraphics.xml
+++ b/content/api_en/createGraphics.xml
@@ -30,11 +30,13 @@ void draw() {
PGraphics object. Use this class if you need to draw into an off-screen graphics buffer. The first two parameters define the width and height in pixels. The third, optional parameter specifies the renderer. It can be defined as P2D, P3D, or PDF. If the third parameter isn't used, the default renderer is set. The PDF renderer requires the filename parameter.
+Creates and returns a new PGraphics object. Use this class if you need to draw into an off-screen graphics buffer. The first two parameters define the width and height in pixels. The third, optional parameter specifies the renderer. It can be defined as P2D, P3D, PDF, or SVG. If the third parameter isn't used, the default renderer is set. The PDF and SVG renderers require the filename parameter.
-It's important to consider the renderer used with createGraphics() in relation to the main renderer specified in size(). For example, it's only possible to use P2D or P3D with createGraphics() when one of them is defined in size(). Unlike Processing 1.0, P2D and P3D use OpenGL for drawing, and when using an OpenGL renderer it's necessary for the main drawing surface to be OpenGL-based. If P2D or P3D are used as the renderer in size(), then any of the options can be used with createGraphics(). If the default renderer is used in size(), then only the default or PDF can be used with createGraphics().
+It's important to consider the renderer used with createGraphics() in relation to the main renderer specified in size(). For example, it's only possible to use P2D or P3D with createGraphics() when one of them is defined in size(). Unlike Processing 1.0, P2D and P3D use OpenGL for drawing, and when using an OpenGL renderer it's necessary for the main drawing surface to be OpenGL-based. If P2D or P3D are used as the renderer in size(), then any of the options can be used with createGraphics(). If the default renderer is used in size(), then only the default, PDF, or SVG can be used with createGraphics().
-It's important to call any drawing functions between beginDraw() and endDraw() statements. This is also true for any functions that affect drawing, such as smooth() or colorMode().
+It's important to run all drawing functions between the beginDraw() and endDraw(). As the exception to this rule, smooth() should be run on the PGraphics object before beginDraw(). See the reference for smooth() for more detail.
+
+The createGraphics() function should almost never be used inside draw() because of the memory and time needed to set up the graphics. One-time or occasional use during draw() might be acceptable, but code that calls createGraphics() at 60 frames per second might run out of memory or freeze your sketch.
Unlike the main drawing surface which is completely opaque, surfaces created with createGraphics() can have transparency. This makes it possible to draw into a graphics and maintain the alpha channel. By using save() to write a PNG or TGA file, the transparency of the graphics object will be honored.
]]>
diff --git a/content/api_en/createReader.xml b/content/api_en/createReader.xml
index 497241c94..5ffe8049a 100644
--- a/content/api_en/createReader.xml
+++ b/content/api_en/createReader.xml
@@ -11,37 +11,33 @@
BufferedReader object that can be used to read files line-by-line as individual String objects. This is the complement to the createWriter() function.
-
+Creates a BufferedReader object that can be used to read files line-by-line as individual String objects. This is the complement to the createWriter() function. For more information about the BufferedReader class and its methods like readLine() and close used in the above example, please consult a Java reference.
+
Starting with Processing release 0134, all files loaded and saved by the Processing API use UTF-8 encoding. In previous releases, the default encoding for your platform was used, which causes problems when files are moved to other platforms.
]]>
diff --git a/content/api_en/createShape.xml b/content/api_en/createShape.xml
index 644deb0a5..4469495e8 100755
--- a/content/api_en/createShape.xml
+++ b/content/api_en/createShape.xml
@@ -91,6 +91,7 @@ void setup() {
alien = createShape(GROUP);
// Make two shapes
+ ellipseMode(CORNER);
head = createShape(ELLIPSE, -25, 0, 50, 50);
head.setFill(color(255));
body = createShape(RECT, -25, 45, 50, 40);
@@ -111,7 +112,7 @@ void draw() {
createShape() function is used to define a new shape. Once created, this shape can be drawn with the shape() function. The basic way to use the function defines new primitive shapes. One of the following parameters are used as the first parameter: ELLIPSE, RECT, ARC, TRIANGLE, SPHERE, BOX, QUAD, or LINE. The parameters for each of these different shapes are the same as their corresponding functions: ellipse(), rect(), arc(), triangle(), sphere(), box(), and line(). The first example above clarifies how this works.
+The createShape() function is used to define a new shape. Once created, this shape can be drawn with the shape() function. The basic way to use the function defines new primitive shapes. One of the following parameters are used as the first parameter: ELLIPSE, RECT, ARC, TRIANGLE, SPHERE, BOX, QUAD, or LINE. The parameters for each of these different shapes are the same as their corresponding functions: ellipse(), rect(), arc(), triangle(), sphere(), box(), quad(), and line(). The first example above clarifies how this works.
Custom, unique shapes can be made by using createShape() without a parameter. After the shape is started, the drawing attributes and geometry can be set directly to the shape within the beginShape() and endShape() methods. See the second example above for specifics, and the reference for beginShape() for all of its options.
diff --git a/content/api_en/cursor.xml b/content/api_en/cursor.xml
index 3b3e9b0a3..81499ab44 100755
--- a/content/api_en/cursor.xml
+++ b/content/api_en/cursor.xml
@@ -14,8 +14,11 @@
// Move the mouse left and right across the image
// to see the cursor change from a cross to a hand
-void draw()
-{
+void setup() {
+ size(100, 100);
+}
+
+void draw() {
if (mouseX < 50) {
cursor(CROSS);
} else {
@@ -26,10 +29,10 @@ void draw()
x and y must be less than the dimensions of the image.
-
+Sets the cursor to a predefined symbol or an image, or makes it visible if already hidden. If you are trying to set an image as the cursor, the recommended size is 16x16 or 32x32 pixels. The values for parameters x and y must be less than the dimensions of the image.
+
Setting or hiding the cursor does not generally work with "Present" mode (when running full-screen).
-
+
With the P2D and P3D renderers, a generic set of cursors are used because the OpenGL renderer doesn't have access to the default cursor images for each platform (Issue 3791).
]]>
diff --git a/content/api_en/curvePoint.xml b/content/api_en/curvePoint.xml
index 8c9a6e011..c38a07c22 100755
--- a/content/api_en/curvePoint.xml
+++ b/content/api_en/curvePoint.xml
@@ -30,7 +30,7 @@ for (int i = 0; i <= steps; i++) {
t for points a, b, c, d. The parameter t may range from 0 (the start of the curve) and 1 (the end of the curve). a and d are points on the curve, and b and c are the control points. This can be used once with the x coordinates and a second time with the y coordinates to get the location of a curve at t.
+Evaluates the curve at point t for points a, b, c, d. The parameter t may range from 0 (the start of the curve) and 1 (the end of the curve). a and d are the control points, and b and c are points on the curve. As seen in the example above, this can be used once with the x coordinates and a second time with the y coordinates to get the location of a curve at t.
]]>
diff --git a/content/api_en/displayDensity.xml b/content/api_en/displayDensity.xml
index bbc7c867f..1eabe02e9 100644
--- a/content/api_en/displayDensity.xml
+++ b/content/api_en/displayDensity.xml
@@ -13,8 +13,7 @@
setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called. draw() is called automatically and should never be called explicitly.
+Called directly after setup(), the draw() function continuously executes the lines of code contained inside its block until the program is stopped or noLoop() is called. draw() is called automatically and should never be called explicitly. All Processing programs update the screen at the end of draw(), never earlier.
-It should always be controlled with noLoop(), redraw() and loop(). If noLoop() is used to stop the code in draw() from executing, then redraw() will cause the code inside draw() to be executed a single time, and loop() will cause the code inside draw() to resume executing continuously.
+To stop the code inside of draw() from running continuously, use noLoop(), redraw() and loop(). If noLoop() is used to stop the code in draw() from running, then redraw() will cause the code inside draw() to run a single time, and loop() will cause the code inside draw() to resume running continuously.
The number of times draw() executes in each second may be controlled with the frameRate() function.
-It is common to call background() near the beginning of the draw() loop to clear the contents of the window, as shown in the first example above. Since pixels drawn to the window are cumulative, omitting background() may result in unintended results, especially when drawing anti-aliased shapes or text.
-
+It is common to call background() near the beginning of the draw() loop to clear the contents of the window, as shown in the first example above. Since pixels drawn to the window are cumulative, omitting background() may result in unintended results.
+
There can only be one draw() function for each sketch, and draw() must exist if you want the code to run continuously, or to process events such as mousePressed(). Sometimes, you might have an empty call to draw() in your program, as shown in the second example above.
]]>
diff --git a/content/api_en/endShape.xml b/content/api_en/endShape.xml
index a6c604615..eaa2d1e05 100755
--- a/content/api_en/endShape.xml
+++ b/content/api_en/endShape.xml
@@ -28,7 +28,7 @@ endShape();
endShape() function is the companion to beginShape() and may only be called after beginShape(). When endshape() is called, all of image data defined since the previous call to beginShape() is written into the image buffer. The constant CLOSE as the value for the MODE parameter to close the shape (to connect the beginning and the end).
+The endShape() function is the companion to beginShape() and may only be called after beginShape(). When endShape() is called, all of image data defined since the previous call to beginShape() is written into the image buffer. The constant CLOSE as the value for the MODE parameter to close the shape (to connect the beginning and the end).
]]>
diff --git a/content/api_en/environment/index.html b/content/api_en/environment/index.html
index a65cc2def..5d92731eb 100644
--- a/content/api_en/environment/index.html
+++ b/content/api_en/environment/index.html
@@ -100,7 +100,7 @@
- Additional commands are found within the five menus: File, Edit, Sketch, Debug, Tools, Help.
+ Additional commands are found within the six menus: File, Edit, Sketch, Debug, Tools, Help.
The menus are context sensitive which means only those items relevant to the work currently
being carried out are available.
@@ -112,8 +112,6 @@
File
"sketch_YYMMDDa".
Open...
Open a sketch in a new window.
-
Sketchbook
- Open a sketch from the sketchbook folder.
Open Recent
Select a sketch to open from the list of recently closed sketches.
Sketchbook...
@@ -533,8 +531,8 @@
Android Mode
Sketches written in this mode can be exported to run on Android phones and tablets.
- This mode is documented on the
- Processing for Android page of the Processing Wiki. To add this mode, click on
+ This mode is documented on the
+ Processing for Android page. To add this mode, click on
the mode button in the upper-right corner of the PDE and select "Add Mode..."
diff --git a/content/api_en/exit.xml b/content/api_en/exit.xml
index 1df2bb8a0..e6ee94323 100755
--- a/content/api_en/exit.xml
+++ b/content/api_en/exit.xml
@@ -22,7 +22,7 @@ void mousePressed() {
draw() function exit automatically after the last line has run, but programs with draw() run continuously until the program is manually stopped or exit() is run.
+Quits/stops/exits the program. Programs without a draw() function stop automatically after the last line has run, but programs with draw() run continuously until the program is manually stopped or exit() is run.
Rather than terminating immediately, exit() will cause the sketch to exit after draw() has completed (or after setup() completes if called during the setup() function).
diff --git a/content/api_en/expand.xml b/content/api_en/expand.xml
index 30c9d4afe..f0f020319 100755
--- a/content/api_en/expand.xml
+++ b/content/api_en/expand.xml
@@ -32,7 +32,7 @@ println(imgs.length); // Prints "64"
newSize parameter provides precise control over the increase in size.
+Increases the size of a one-dimensional array. By default, this function doubles the size of the array, but the optional newSize parameter provides precise control over the increase in size.
When using an array of objects, the data returned from the function must be cast to the object array's data type. For example: SomeClass[] items = (SomeClass[]) expand(originalArray)
]]>
diff --git a/content/api_en/frustum.xml b/content/api_en/frustum.xml
index 5469e611d..f9645bd5a 100755
--- a/content/api_en/frustum.xml
+++ b/content/api_en/frustum.xml
@@ -25,7 +25,7 @@ Sets a perspective matrix as defined by the parameters.
A frustum is a geometric form: a pyramid with its top cut off. With the viewer's eye at the imaginary top of the pyramid, the six planes of the frustum act as clipping planes when rendering a 3D view. Thus, any form inside the clipping planes is rendered and visible; anything outside those planes is not visible.
-Setting the frustum has the effect of changing the perspective with which the scene is rendered. This can be acheived more simply in many cases by using perspective().
+Setting the frustum has the effect of changing the perspective with which the scene is rendered. This can be achieved more simply in many cases by using perspective().
Note that the near value must be greater than zero (as the point of the frustum "pyramid" cannot converge "behind" the viewer). Similarly, the far value must be greater than the near value (as the "far" plane of the frustum must be "farther away" from the viewer than the near plane).
diff --git a/content/api_en/fullScreen.xml b/content/api_en/fullScreen.xml
index eb1fea958..e75bfd541 100755
--- a/content/api_en/fullScreen.xml
+++ b/content/api_en/fullScreen.xml
@@ -34,7 +34,7 @@ void draw() {
setup(). The first parameter defines the renderer to use and the second defines either an individual screen to display to or to open a full-screen window across all of the attached displays if there are more than one.
+This function is new for Processing 3.0. It opens a sketch using the full size of the computer's display. This function must be the first line in setup(). The size() and fullScreen() functions cannot both be used in the same program, just choose one.
-The size() and fullScreen() methods cannot both be used in the same program, just choose one. Prior to Processing 3.0, a full-screen program was defined with size(displayWidth, displayHeight).
+When fullScreen() is used without a parameter, it draws the sketch to the screen currently selected inside the Preferences window. When it is used with a single parameter, this number defines the screen to display to program on (e.g. 1, 2, 3...). When used with two parameters, the first defines the renderer to use (e.g. P2D) and the second defines the screen. The SPAN parameter can be used in place of a screen number to draw the sketch as a full-screen window across all of the attached displays if there are more than one.
+
+Prior to Processing 3.0, a full-screen program was defined with size(displayWidth, displayHeight).
]]>
diff --git a/content/api_en/get.xml b/content/api_en/get.xml
index c1307b3cd..be56dc889 100755
--- a/content/api_en/get.xml
+++ b/content/api_en/get.xml
@@ -31,10 +31,12 @@ rect(25, 25, 50, 50);
x and y parameters to get the value of one pixel. Get a section of the display window by specifying additional w and h parameters. When getting an image, the x and y parameters define the coordinates for the upper-left corner of the image, regardless of the current imageMode().
-
+Reads the color of any pixel or grabs a section of an image. If no parameters are specified, the entire image is returned. Use the x and y parameters to get the value of one pixel. Get a section of the display window by specifying additional w and h parameters. When getting an image, the x and y parameters define the coordinates for the upper-left corner of the image, regardless of the current imageMode().
+
If the pixel requested is outside of the image window, black is returned. The numbers returned are scaled according to the current color ranges, but only RGB values are returned by this function. For example, even though you may have drawn a shape with colorMode(HSB), the numbers returned will be in RGB format.
+If a width and a height are specified, get(x, y, w, h) returns a PImage corresponding to the part of the original PImage where the top left pixel is at the (x, y) position with a width of w a height of h.
+
Getting the color of a single pixel with get(x, y) is easy, but not as fast as grabbing the data directly from pixels[]. The equivalent statement to get(x, y) using pixels[] is pixels[y*width+x]. See the reference for pixels[] for more information.
]]>
diff --git a/content/api_en/green.xml b/content/api_en/green.xml
index 7d3ff0566..f1c38fe88 100755
--- a/content/api_en/green.xml
+++ b/content/api_en/green.xml
@@ -27,8 +27,8 @@ Extracts the green value from a color, scaled to match current colorMode()
The green() function is easy to use and understand, but it is slower than a technique called bit shifting. When working in colorMode(RGB, 255), you can acheive the same results as green() but with greater speed by using the right shift operator (>>) with a bit mask. For example, the following two lines of code are equivalent means of getting the green value of the color value c:
-
float r1 = green(c); // Simpler, but slower to calculate
-float r2 = c >> 8 & 0xFF; // Very fast to calculate
+
float g1 = green(c); // Simpler, but slower to calculate
+float g2 = c >> 8 & 0xFF; // Very fast to calculate
]]>
diff --git a/content/api_en/include/ArrayList.xml b/content/api_en/include/ArrayList.xml
index ea63b6262..8feb4dc3a 100644
--- a/content/api_en/include/ArrayList.xml
+++ b/content/api_en/include/ArrayList.xml
@@ -50,7 +50,7 @@ println(particles.size()); // Now one less!
// then you cannot use the enhanced loop syntax.
// In addition, when deleting in order to hit all elements,
// you should loop through it backwards, as shown here:
-for (int i = particles.size - 1; i >= 0; i--) {
+for (int i = particles.size() - 1; i >= 0; i--) {
Particle part = particles.get(i);
if (part.finished()) {
particles.remove(i);
@@ -64,7 +64,7 @@ An ArrayList stores a variable number of objects. This is similar to maki
An ArrayList is a resizable-array implementation of the Java List interface. It has many methods used to control and search its contents. For example, the length of the ArrayList is returned by its size() method, which is an integer value for the total number of elements in the list. An element is added to an ArrayList with the add() method and is deleted with the remove() method. The get() method returns the element at the specified position in the list. (See the above example for context.)
-For a list of the numerous ArrayList features, please read the Java reference description.
+For a list of the numerous ArrayList features, please read the Java reference description.
]]>
diff --git a/content/api_en/include/BufferedReader.xml b/content/api_en/include/BufferedReader.xml
index 354daa453..c7ef0855d 100644
--- a/content/api_en/include/BufferedReader.xml
+++ b/content/api_en/include/BufferedReader.xml
@@ -45,17 +45,14 @@ A BufferedReader object is used to read files line-by-line as individual
Starting with Processing release 0134, all files loaded and saved by the Processing API use UTF-8 encoding. In previous releases, the default encoding for your platform was used, which causes problems when files are moved to other platforms.
]]>
+
+
readLine()returns a String that is the current line in the text file
-
-
-
-
-
-
+
@@ -67,8 +64,9 @@ catch
1.0
-Function
+Object
+
+PDE
-Core
diff --git a/content/api_en/include/HashMap.xml b/content/api_en/include/HashMap.xml
index 56ba42897..493e893de 100644
--- a/content/api_en/include/HashMap.xml
+++ b/content/api_en/include/HashMap.xml
@@ -22,7 +22,7 @@ hm.put("Ava", 1);
hm.put("Cait", 35);
hm.put("Casey", 36);
-// Using an enhanced loop to interate over each entry
+// Using an enhanced loop to iterate over each entry
for (Map.Entry me : hm.entrySet()) {
print(me.getKey() + " is ");
println(me.getValue());
@@ -39,7 +39,7 @@ println("Casey is " + val);
HashMap stores a collection of objects, each referenced by a key. This is similar to an Array, only instead of accessing elements with a numeric index, a String is used. (If you are familiar with associative arrays from other languages, this is the same idea.) The above example covers basic use, but there's a more extensive example included with the Processing examples. In addition, for simple pairings of Strings and integers, Strings and floats, or Strings and Strings, you can now use the simpler IntDict, FloatDict, and StringDict classes.
-For a list of the numerous HashMap features, please read the Java reference description.
+For a list of the numerous HashMap features, please read the Java reference description.
]]>
diff --git a/content/api_en/include/Object.xml b/content/api_en/include/Object.xml
index 46ff0c441..c2b5dc9dd 100755
--- a/content/api_en/include/Object.xml
+++ b/content/api_en/include/Object.xml
@@ -35,7 +35,7 @@ class HLine {
}
void update() {
ypos += speed;
- if (ypos > width) {
+ if (ypos > height) {
ypos = 0;
}
line(0, ypos, width, ypos);
diff --git a/content/api_en/include/String.xml b/content/api_en/include/String.xml
index e4c4a9625..2febbe7de 100755
--- a/content/api_en/include/String.xml
+++ b/content/api_en/include/String.xml
@@ -24,12 +24,9 @@ println(str2); // Prints "CCCP" to the console
@@ -46,11 +43,11 @@ println(quoted); // This one has "quotes"
String includes methods for examining individual characters, comparing strings, searching strings, extracting parts of strings, and for converting an entire string uppercase and lowercase. Strings are always defined inside double quotes ("Abc"), and characters are always defined inside single quotes ('A').
-To compare the contents of two Strings, use the equals() method, as in if (a.equals(b)), instead of if (a == b). A String is an Object, so comparing them with the == operator only compares whether both Strings are stored in the same memory location. Using the equals() method will ensure that the actual contents are compared. (The troubleshooting reference has a longer explanation.)
+To compare the contents of two Strings, use the equals() method, as in if (a.equals(b)), instead of if (a == b). A String is an Object, so comparing them with the == operator only compares whether both Strings are stored in the same memory location. Using the equals() method will ensure that the actual contents are compared. (The troubleshooting reference has a longer explanation.)
Because a String is defined between double quotation marks, to include such marks within the String itself you must use the \ (backslash) character. (See the third example above.) This is known as an escape sequence. Other escape sequences include \t for the tab character and \n for new line. Because backslash is the escape character, to include a single backslash within a String, you must use two consecutive backslashes, as in: \\
-There are more string methods than those linked from this page. Additional documentation is located online in the official Java documentation.
+There are more string methods than those linked from this page. Additional documentation is located online in the official Java documentation.
]]>
@@ -110,7 +107,6 @@ String(data, offset, length)
int: number of characters
-
@@ -124,6 +120,4 @@ text()
PDE
-
-
diff --git a/content/api_en/include/String_substring.xml b/content/api_en/include/String_substring.xml
index 0514f23ae..40813a34c 100755
--- a/content/api_en/include/String_substring.xml
+++ b/content/api_en/include/String_substring.xml
@@ -16,8 +16,8 @@ String str1 = "CCCP";
String str2 = "Rabbit";
String ss1 = str1.substring(2); // Returns "CP"
String ss2 = str2.substring(3); // Returns "bit"
-String ss3 = str1.substring(0, 2); // Returns "CC"
-println(ss1 + ":" + ss2 + ":" + ss3); // Prints "CP:bit:CC"
+String ss3 = str2.substring(0, 2); // Returns "Ra"
+println(ss1 + ":" + ss2 + ":" + ss3); // Prints "CP:bit:Ra"
]]>
diff --git a/content/api_en/include/class.xml b/content/api_en/include/class.xml
index 45eedd292..5f1e84cab 100755
--- a/content/api_en/include/class.xml
+++ b/content/api_en/include/class.xml
@@ -46,7 +46,7 @@ class HLine {
Object-Oriented Programming is hosted on the Oracle website.
+Keyword used to indicate the declaration of a class. A class is a composite of fields (data) and methods (functions that are a part of the class) which may be instantiated as objects. The first letter of a class name is usually uppercase to separate it from other kinds of variables. A related tutorial on Object-Oriented Programming is hosted on the Oracle website.
]]>
diff --git a/content/api_en/include/color_datatype.xml b/content/api_en/include/color_datatype.xml
index 2b501bf56..0f0b7b8f0 100755
--- a/content/api_en/include/color_datatype.xml
+++ b/content/api_en/include/color_datatype.xml
@@ -23,7 +23,7 @@ rect(50, 0, 50, 100);
get() and color() or they may be specified directly using hexadecimal notation such as #FFCC00 or 0xFFFFCCOO.
+Datatype for storing color values. Colors may be assigned with get() and color() or they may be specified directly using hexadecimal notation such as #FFCC00 or 0xFFFFCC00.
Using print() or println() on a color will produce strange results (usually negative numbers) because of the way colors are stored in memory. A better technique is to use the hex() function to format the color data, or use the red(), green(), and blue() functions to get individual values and print those. The hue(), saturation(), and brightness() functions work in a similar fashion. To extract red, green, and blue values more quickly (for instance when analyzing an image or a frame of video), use bit shifting.
diff --git a/content/api_en/include/curlybraces.xml b/content/api_en/include/curlybraces.xml
index f4f1898c9..e9984f0d7 100755
--- a/content/api_en/include/curlybraces.xml
+++ b/content/api_en/include/curlybraces.xml
@@ -26,7 +26,7 @@ void draw() {
for and if structures. Curly braces are also used for defining inital values in array declarations.
+Define the beginning and end of functions blocks and statement blocks such as the for and if structures. Curly braces are also used for defining initial values in array declarations.
]]>
diff --git a/content/api_en/include/doccomment.xml b/content/api_en/include/doccomment.xml
index bb4331414..fa036a032 100755
--- a/content/api_en/include/doccomment.xml
+++ b/content/api_en/include/doccomment.xml
@@ -22,7 +22,9 @@ line(50, 0, 50, 100);
+Doc comments may be converted into browseable documentation using external editors and tools such as the command line javadoc, doc generators such as Doxygen, or IDEs such as Eclipse, Netbeans, or IntelliJ IDEA.
]]>
diff --git a/content/api_en/include/double.xml b/content/api_en/include/double.xml
index 75ce6f466..24942764e 100644
--- a/content/api_en/include/double.xml
+++ b/content/api_en/include/double.xml
@@ -11,11 +11,11 @@
diff --git a/content/api_en/include/equality.xml b/content/api_en/include/equality.xml
index 4ddfbd69a..a47eac505 100755
--- a/content/api_en/include/equality.xml
+++ b/content/api_en/include/equality.xml
@@ -14,15 +14,16 @@
int a = 23;
int b = 23;
if (a == b) {
- println("variables a and b are equal");
+ println("the values of variables 'a' and 'b' are the same");
}
]]>
+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/float.xml b/content/api_en/include/float.xml
index 964d946e6..134cb33f4 100755
--- a/content/api_en/include/float.xml
+++ b/content/api_en/include/float.xml
@@ -41,7 +41,7 @@ Data type for floating-point numbers, e.g. numbers that have a decimal point.
Floats are not precise, so adding small values (such as 0.0001) may not always increment precisely due to rounding errors. If you want to increment a value in small intervals, use an int, and divide by a float value before using it. (See the second example above.)
-Floating-point numbers can be as large as 3.40282347E+38 and as low as -3.40282347E+38. They are stored as 32 bits (4 bytes) of information. The float data type is inherited from Java; you can read more about the technical details here and here.
+Floating-point numbers can be as large as 3.40282347E+38 and as low as -3.40282347E+38. They are stored as 32 bits (4 bytes) of information. The float data type is inherited from Java; you can read more about the technical details here and here.
Processing supports the double datatype from Java as well. However, none of the Processing functions use double values, which use more memory and are typically overkill for most work created in Processing. We do not plan to add support for double values, as doing so would require increasing the number of API functions significantly.
]]>
diff --git a/content/api_en/hint.xml b/content/api_en/include/hint.xml
similarity index 82%
rename from content/api_en/hint.xml
rename to content/api_en/include/hint.xml
index 5a9f2dac9..a48311069 100644
--- a/content/api_en/hint.xml
+++ b/content/api_en/include/hint.xml
@@ -6,7 +6,27 @@
-
+function
+
+
+
+
+hint() to allow people to tune the settings for their particular sketch. Implementing a hint() is a last resort that's used when a more elegant solution cannot be found. Some options might graduate to standard features instead of hints over time, or be added and removed between (major) releases.
@@ -20,6 +40,9 @@ Fixes a problem with shapes that have a stroke and are rendered using small step
Hints for use with P2D and P3D:
+DISABLE_ASYNC_SAVEFRAME
+save() and saveFrame() will not use separate threads for saving and will block until the image is written to the drive. This was the default behavior in 3.0b7 and before. To enable, call hint(ENABLE_ASYNC_SAVEFRAME).
+
DISABLE_OPENGL_ERRORS
Speeds up the P3D renderer setting by not checking for errors while running.
@@ -45,4 +68,27 @@ Forces the P3D renderer to draw each shape (including its strokes) separately, i
Enables stroke geometry (lines and points) to be affected by the perspective, meaning that they will look smaller as they move away from the camera.
]]>
+
+hint(which)
+
+
+
+
+
+
+
+void
+
+
+PGraphics
+createGraphics()
+size()
+
+
+1.0
+
+Function
+
+PDE
+
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/include/long.xml b/content/api_en/include/long.xml
index 4d69236c5..e336fb63b 100644
--- a/content/api_en/include/long.xml
+++ b/content/api_en/include/long.xml
@@ -11,16 +11,18 @@
long integer has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (stored as 64 bits). Use this datatype when you need a number to have a greater magnitude than can be stored within an int. Processing functions don't use this datatype, so while they work in the language, you'll usually have to convert to a int using the (int) syntax before passing into a function.
+Datatype for large integers. While integers can be as large as 2,147,483,647 and as low as -2,147,483,648 (stored as 32 bits), a long integer has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (stored as 64 bits). Use this datatype when you need a number to have a greater magnitude than can be stored within an int. When assigning literal values that are larger than this magnitude, it is necessary to also append the qualifier "L" to the number, as shown in the example above. Processing functions don't use this datatype, so while they work in the language, you'll usually have to convert to a int using the (int) syntax before passing into a function.
]]>
diff --git a/content/api_en/include/multilinecomment.xml b/content/api_en/include/multilinecomment.xml
index bd88002cb..a1c9dd6a1 100755
--- a/content/api_en/include/multilinecomment.xml
+++ b/content/api_en/include/multilinecomment.xml
@@ -22,7 +22,7 @@ line(50, 0, 50, 100);
diff --git a/content/api_en/include/multiply.xml b/content/api_en/include/multiply.xml
index 20c71bb1f..a125ad6fd 100755
--- a/content/api_en/include/multiply.xml
+++ b/content/api_en/include/multiply.xml
@@ -37,7 +37,7 @@ Multiplies the values of the two parameters. Multiplication is equivalent to a s
-+ (add)
++ (addition)
/ (divide)
@@ -48,10 +48,4 @@ Multiplies the values of the two parameters. Multiplication is equivalent to a s
PDE
-
-
-
-
-
-
diff --git a/content/api_en/include/rightshift.xml b/content/api_en/include/rightshift.xml
index 27526643b..06437e001 100755
--- a/content/api_en/include/rightshift.xml
+++ b/content/api_en/include/rightshift.xml
@@ -37,7 +37,7 @@ rect(30, 20, 55, 55);
Bit shifting is helpful when using the color data type. A right shift can extract red, green, blue, and alpha values from a color. A left shift can be used to quickly reassemble a color value (more quickly than the color() function).
]]>
diff --git a/content/api_en/include/setLocation.xml b/content/api_en/include/setLocation.xml
new file mode 100644
index 000000000..c54f0ee04
--- /dev/null
+++ b/content/api_en/include/setLocation.xml
@@ -0,0 +1,60 @@
+
+
+setLocation()
+
+Structure
+
+
+
+function
+
+
+
+
+
+
+setLocation() function defines the position of the Processing sketch in relation to the upper-left corner of the computer screen.
+
+There are more features of PSurface documented in the Processing JavaDoc.
+]]>
+
+
+surface.setLocation(x, y)
+
+
+
+
+
+
+
+
+
+
+
+
+void
+
+
+
+
+3.0
+
+Function
+
+PDE
+
+
diff --git a/content/api_en/include/setResizable.xml b/content/api_en/include/setResizable.xml
new file mode 100644
index 000000000..3b4261790
--- /dev/null
+++ b/content/api_en/include/setResizable.xml
@@ -0,0 +1,55 @@
+
+
+setResizable()
+
+Structure
+
+
+
+function
+
+
+
+
+
+
+surface.setResizable(true) is used within a sketch, the window can be resized while it's running.
+
+There are more features of PSurface documented in the Processing JavaDoc.
+]]>
+
+
+surface.setResizable(resizable)
+
+
+
+
+
+
+
+void
+
+
+
+
+3.0
+
+Function
+
+PDE
+
+
diff --git a/content/api_en/include/setTitle.xml b/content/api_en/include/setTitle.xml
new file mode 100644
index 000000000..1c18e6d22
--- /dev/null
+++ b/content/api_en/include/setTitle.xml
@@ -0,0 +1,55 @@
+
+
+setTitle()
+
+Structure
+
+
+
+function
+
+
+
+
+
+
+setTitle() function defines the title to appear at the top of the sketch window.
+
+There are more features of PSurface documented in the Processing JavaDoc.
+]]>
+
+
+surface.setTitle(title)
+
+
+
+
+
+
+
+void
+
+
+
+
+3.0
+
+Function
+
+PDE
+
+
diff --git a/content/api_en/include/strconvert.xml b/content/api_en/include/strconvert.xml
index 2126306f9..e81be07c5 100755
--- a/content/api_en/include/strconvert.xml
+++ b/content/api_en/include/strconvert.xml
@@ -29,7 +29,7 @@ println(sb); // Prints 'false-28R-32.61024'
boolean, byte, char, color, double, float, int, or long) to its String representation. For example, converting an integer with str(3) will return the String value of "3", converting a float with str(-12.6) will return "-12.6", and converting a boolean with str(true) will return "true".
+Converts a value of a primitive data type (boolean, byte, char, int, or float) to its String representation. For example, converting an integer with str(3) will return the String value of "3", converting a float with str(-12.6) will return "-12.6", and converting a boolean with str(true) will return "true".
When an array of values is passed in, then a String array of the same length is returned.
]]>
diff --git a/content/api_en/key.xml b/content/api_en/key.xml
index 282186f52..0b7d3bde0 100755
--- a/content/api_en/key.xml
+++ b/content/api_en/key.xml
@@ -30,7 +30,7 @@ void draw() {
key always contains the value of the most recent key on the keyboard that was used (either pressed or released).
-For non-ASCII keys, use the keyCode variable. The keys included in the ASCII specification (BACKSPACE, TAB, ENTER, RETURN, ESC, and DELETE) do not require checking to see if they key is coded, and you should simply use the key variable instead of keyCode If you're making cross-platform projects, note that the ENTER key is commonly used on PCs and Unix and the RETURN key is used instead on Macintosh. Check for both ENTER and RETURN to make sure your program will work for all platforms.
+For non-ASCII keys, use the keyCode variable. The keys included in the ASCII specification (BACKSPACE, TAB, ENTER, RETURN, ESC, and DELETE) do not require checking to see if the key is coded, and you should simply use the key variable instead of keyCode If you're making cross-platform projects, note that the ENTER key is commonly used on PCs and Unix and the RETURN key is used instead on Macintosh. Check for both ENTER and RETURN to make sure your program will work for all platforms.
There are issues with how keyCode behaves across different renderers and operating systems. Watch out for unexpected behavior as you switch renderers and operating systems.
]]>
diff --git a/content/api_en/keyCode.xml b/content/api_en/keyCode.xml
index b11ea3ca0..8a3cd3d2f 100755
--- a/content/api_en/keyCode.xml
+++ b/content/api_en/keyCode.xml
@@ -39,9 +39,11 @@ When checking for these keys, it can be useful to first check if the key is code
The keys included in the ASCII specification (BACKSPACE, TAB, ENTER, RETURN, ESC, and DELETE) do not require checking to see if the key is coded; for those keys, you should simply use the key variable directly (and not keyCode). If you're making cross-platform projects, note that the ENTER key is commonly used on PCs and Unix, while the RETURN key is used on Macs. Make sure your program will work on all platforms by checking for both ENTER and RETURN.
-For those familiar with Java, the values for UP and DOWN are simply shorter versions of Java's KeyEvent.VK_UP and KeyEvent.VK_DOWN. Other keyCode values can be found in the Java KeyEvent reference.
+For those familiar with Java, the values for UP and DOWN are simply shorter versions of Java's KeyEvent.VK_UP and KeyEvent.VK_DOWN. Other keyCode values can be found in the Java KeyEvent reference.
There are issues with how keyCode behaves across different renderers and operating systems. Watch out for unexpected behavior as you switch renderers and operating systems and you are using keys are aren't mentioned in this reference entry.
+
+If you are using P2D or P3D as your renderer, use the NEWT KeyEvent constants.
]]>
diff --git a/content/api_en/keyPressed.xml b/content/api_en/keyPressed.xml
index 224ed7da8..9cc506b40 100755
--- a/content/api_en/keyPressed.xml
+++ b/content/api_en/keyPressed.xml
@@ -41,6 +41,8 @@ Because of how operating systems handle key repeats, holding down a key may caus
Note that there is a similarly named boolean variable called keyPressed. See its reference page for more information.
Mouse and keyboard events only work when a program has draw(). Without draw(), the code is only run once and then stops listening for events.
+
+With the release of macOS Sierra, Apple changed how key repeat works, so keyPressed may not function as expected. See here for details of the problem and how to fix it.
]]>
diff --git a/content/api_en/launch.xml b/content/api_en/launch.xml
index 464902f0a..87b86e389 100755
--- a/content/api_en/launch.xml
+++ b/content/api_en/launch.xml
@@ -27,36 +27,14 @@ void mousePressed() {
]]>
-
-
-
-
-
-
filename parameter is a String specifying the file name and location. The location parameter must be a full path name, or the name of an executable in the system's PATH. In most cases, using a full path is the best option, rather than relying on the system PATH. Be sure to make the file executable before attempting to open it (chmod +x).
-
-The argv parameter is a String or String array which is passed to the command line. If you have multiple parameters, e.g. an application and a document, or a command with multiple switches, use the version that takes a String array, and place each individual item in a separate element.
-
-If argv is a String (not an array), then it can only be a single file or application with no parameters. It's not the same as executing that String using a shell. For instance, open("jikes -help") will not work properly.
-
-This function behaves differently on each platform. On Windows, the parameters are sent to the Windows shell via "cmd /c". On Mac OS X, the "open" command is used (type "man open" in Terminal.app for documentation). On Linux, it first tries gnome-open, then kde-open, but if neither are available, it sends the command to the shell without any alterations.
-
-For users familiar with Java, this is not quite the same as Runtime.exec(), because the launcher command is prepended. Instead, the exec(String[]) function is a shortcut for Runtime.getRuntime.exec(String[]).
+Attempts to open an application or file using your platform's launcher. The filename parameter is a String specifying the file name and location. The location parameter must be a full path name, or the name of an executable in the system's PATH. In most cases, using a full path is the best option, rather than relying on the system PATH. Be sure to make the file executable before attempting to open it (chmod +x).
+
+This function (roughly) emulates what happens when you double-click an application or document in the macOS Finder, the Windows Explorer, or your favorite Linux file manager. If you're trying to run command line functions directly, use the exec() function instead (see below).
+
+This function behaves differently on each platform. On Windows, the parameters are sent to the Windows shell via "cmd /c". On Mac OS X, the "open" command is used (type "man open" in Terminal.app for documentation). On Linux, it first tries gnome-open, then kde-open, but if neither are available, it sends the command to the shell and prays that something useful happens.
+
+For users familiar with Java, this is not the same as Runtime.exec(), because the launcher command is prepended. Instead, the exec(String[]) function is a shortcut for Runtime.getRuntime.exec(String[]). The exec() function is documented in the JavaDoc in the PApplet class.
]]>
diff --git a/content/api_en/lerpColor.xml b/content/api_en/lerpColor.xml
index 07e24aa29..99ab9f4f4 100755
--- a/content/api_en/lerpColor.xml
+++ b/content/api_en/lerpColor.xml
@@ -29,7 +29,7 @@ rect(70, 20, 20, 60);
amt parameter is the amount to interpolate between the two values where 0.0 equal to the first point, 0.1 is very near the first point, 0.5 is halfway in between, etc.
+Calculates a color between two colors at a specific increment. The amt parameter is the amount to interpolate between the two values where 0.0 is equal to the first point, 0.1 is very near the first point, 0.5 is halfway in between, etc.
An amount below 0 will be treated as 0. Likewise, amounts above 1 will be capped at 1. This is different from the behavior of lerp(), but necessary because otherwise numbers outside the range will produce strange and unexpected colors.
]]>
diff --git a/content/api_en/libraries/index.html b/content/api_en/libraries/index.html
index 11cc19e54..e507a7c8b 100644
--- a/content/api_en/libraries/index.html
+++ b/content/api_en/libraries/index.html
@@ -16,7 +16,12 @@
Send data between Processing and external hardware through serial communication (RS-232).
diff --git a/content/api_en/loadJSONArray.xml b/content/api_en/loadJSONArray.xml
index d7b7444ac..da22530e9 100755
--- a/content/api_en/loadJSONArray.xml
+++ b/content/api_en/loadJSONArray.xml
@@ -13,24 +13,26 @@
pixels[] array. This function must always be called before reading from or writing to pixels[].
-
-Certain renderers may or may not seem to require loadPixels() or updatePixels(). However, the rule is that any time you want to manipulate the pixels[] array, you must first call loadPixels(), and after changes have been made, call updatePixels(). Even if the renderer may not seem to use this function in the current Processing release, this will always be subject to change.
+Loads the pixel data of the current display window into the pixels[] array. This function must always be called before reading from or writing to pixels[]. Subsequent changes to the display window will not be reflected in pixels until loadPixels() is called again.
]]>
diff --git a/content/api_en/loadStrings.xml b/content/api_en/loadStrings.xml
index 50a71d6cf..321fa0140 100755
--- a/content/api_en/loadStrings.xml
+++ b/content/api_en/loadStrings.xml
@@ -11,7 +11,7 @@
If the file contains a header row, include "header" in the options parameter. If the file does not have a header row, then simply omit the "header" option.
-When specifying both a header and the file type as the options parameter, separate the options with commas, as in: loadTable("data.csv", "header, tsv")
+Some CSV files contain newline (CR or LF) characters inside cells. This is rare, but adding the "newlines" option will handle them properly. (This is not enabled by default because the parsing code is much slower.)
+
+When specifying multiple options, separate them with commas, as in: loadTable("data.csv", "header, tsv")
All files loaded and saved by the Processing API use UTF-8 encoding.
]]>
diff --git a/content/api_en/match.xml b/content/api_en/match.xml
index 1db3a9f3a..92d1b2fdf 100755
--- a/content/api_en/match.xml
+++ b/content/api_en/match.xml
@@ -51,7 +51,7 @@ To use the function, first check to see if the result is null. If the result is
If there are groups (specified by sets of parentheses) in the regular expression, then the contents of each will be returned in the array. Element [0] of a regular expression match returns the entire matching string, and the match groups start at element [1] (the first group is [1], the second [2], and so on).
-The syntax can be found in the reference for Java's Pattern class. For regular expression syntax, read the Java Tutorial on the topic.
+The syntax can be found in the reference for Java's Pattern class. For regular expression syntax, read the Java Tutorial on the topic.
]]>
diff --git a/content/api_en/matchAll.xml b/content/api_en/matchAll.xml
index 56feb6b5b..4f0345fbe 100644
--- a/content/api_en/matchAll.xml
+++ b/content/api_en/matchAll.xml
@@ -33,7 +33,7 @@ To use the function, first check to see if the result is null. If the result is
If there are groups (specified by sets of parentheses) in the regular expression, then the contents of each will be returned in the array. Assuming a loop with counter variable i, element [i][0] of a regular expression match returns the entire matching string, and the match groups start at element [i][1] (the first group is [i][1], the second [i][2], and so on).
-The syntax can be found in the reference for Java's Pattern class. For regular expression syntax, read the Java Tutorial on the topic.
+The syntax can be found in the reference for Java's Pattern class. For regular expression syntax, read the Java Tutorial on the topic.
]]>
diff --git a/content/api_en/mouseWheel.xml b/content/api_en/mouseWheel.xml
index 02c01cd7a..0a2344176 100755
--- a/content/api_en/mouseWheel.xml
+++ b/content/api_en/mouseWheel.xml
@@ -26,7 +26,7 @@ void mouseWheel(MouseEvent event) {
mouseWheel() function returns positive values when the mouse wheel is rotated down (toward the user), and negative values for the other direction (up or away from the user). On OS X with "natural" scrolling enabled, the values are opposite.
+The code within the mouseWheel() event function is run when the mouse wheel is moved. (Some mice don't have wheels and this function is only applicable with mice that have a wheel.) The getCount() function used within mouseWheel() returns positive values when the mouse wheel is rotated down (toward the user), and negative values for the other direction (up or away from the user). On OS X with "natural" scrolling enabled, the values are opposite.
Mouse and keyboard events only work when a program has draw(). Without draw(), the code is only run once and then stops listening for events.
]]>
diff --git a/content/api_en/nf.xml b/content/api_en/nf.xml
index f1e6123dd..295db43ac 100755
--- a/content/api_en/nf.xml
+++ b/content/api_en/nf.xml
@@ -26,11 +26,16 @@ String se = nf(e, 5, 3);
println(se); // Prints "00040.200"
String sf = nf(f, 3, 5);
println(sf); // Prints "009.01200"
+
+String sf2 = nf(f, 0, 5);
+println(sf2); // Prints "9.01200"
+String sf3 = nf(f, 0, 2);
+println(sf3); // Prints "9.01"
]]>digits, left, and right parameters should always be positive integers.
As shown in the above example, nf() is used to add zeros to the left and/or right of a number. This is typically for aligning a list of numbers. To remove digits from a floating-point number, use the int(), ceil(), floor(), or round() functions.
+Utility function for formatting numbers into strings. There are two versions: one for formatting floats, and one for formatting ints. The values for the digits and right parameters should always be positive integers. The left parameter should be positive or 0. If it is zero, only the right side is formatted.
As shown in the above example, nf() is used to add zeros to the left and/or right of a number. This is typically for aligning a list of numbers. To remove digits from a floating-point number, use the int(), ceil(), floor(), or round() functions.
]]>
diff --git a/content/api_en/nfc.xml b/content/api_en/nfc.xml
index 7eb3d6803..c65a5886b 100755
--- a/content/api_en/nfc.xml
+++ b/content/api_en/nfc.xml
@@ -21,9 +21,24 @@ println(fi); // Prints "42,525.34"
]]>
+
+
+
+
+
right parameter should always be a positive integer.
-
+Utility function for formatting numbers into strings and placing appropriate commas to mark units of 1000. There are four versions: one for formatting ints, one for formatting an array of ints, one for formatting floats, and one for formatting an array of floats.
+
+The value for the right parameter should always be a positive integer.
+
For a non-US locale, this will insert periods instead of commas, or whatever is apprioriate for that region.
]]>
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/noiseDetail.xml b/content/api_en/noiseDetail.xml
index b770659f0..dfd0d0633 100755
--- a/content/api_en/noiseDetail.xml
+++ b/content/api_en/noiseDetail.xml
@@ -31,7 +31,7 @@ void draw() {
+Adjusts the character and level of detail produced by the Perlin noise function. Similar to harmonics in physics, noise is computed over several octaves. Lower octaves contribute more to the output signal and as such define the overall intensity of the noise, whereas higher octaves create finer-grained details in the noise sequence.
By default, noise is computed over 4 octaves with each octave contributing exactly half than its predecessor, starting at 50% strength for the first octave. This falloff amount can be changed by adding an additional function parameter. For example, a falloff factor of 0.75 means each octave will now have 75% impact (25% less) of the previous lower octave. While any number between 0.0 and 1.0 is valid, note that values greater than 0.5 may result in noise() returning values greater than 1.0.
diff --git a/content/api_en/parseJSONArray.xml b/content/api_en/parseJSONArray.xml
index f4cbb0b98..cdb4a4832 100755
--- a/content/api_en/parseJSONArray.xml
+++ b/content/api_en/parseJSONArray.xml
@@ -11,7 +11,7 @@
size() in a program without a setup() and used within setup() when a program has one. The pixelDensity() should only be used with hardcoded numbers (in almost all cases this number will be 2) or in combination with displayDensity() as in the third example above.
-
+
+When the pixel density is set to more than 1, it changes all of the pixel operations including the way get(), set(), blend(), copy(), and updatePixels() all work. See the reference for pixelWidth and pixelHeight for more information.
+
To use variables as the arguments to pixelDensity() function, place the pixelDensity() function within the settings() function. There is more information about this on the settings() reference page.
-
]]>
diff --git a/content/api_en/pixelHeight.xml b/content/api_en/pixelHeight.xml
index 8be6e94d4..1a2e15e63 100755
--- a/content/api_en/pixelHeight.xml
+++ b/content/api_en/pixelHeight.xml
@@ -8,10 +8,41 @@
+
+
+
+
diff --git a/content/api_en/pixelWidth.xml b/content/api_en/pixelWidth.xml
index 45ab35d9e..5f88fa136 100755
--- a/content/api_en/pixelWidth.xml
+++ b/content/api_en/pixelWidth.xml
@@ -8,10 +8,41 @@
+
+
+
+
diff --git a/content/api_en/pixels.xml b/content/api_en/pixels.xml
index 5a5607c69..536f50338 100755
--- a/content/api_en/pixels.xml
+++ b/content/api_en/pixels.xml
@@ -21,9 +21,9 @@ updatePixels();
index value defines the position of a value within the array. For example, the statement color b = pixels[230] will set the variable b to be equal to the value at that location in the array.
-
-Before accessing this array, the data must loaded with the loadPixels() function. After the array data has been modified, the updatePixels() function must be run to update the changes. Without loadPixels(), running the code may (or will in future releases) result in a NullPointerException.
+The pixels[] array contains the values for all the pixels in the display window. These values are of the color datatype. This array is defined by the size of the display window. For example, if the window is 100 x 100 pixels, there will be 10,000 values and if the window is 200 x 300 pixels, there will be 60,000 values. When the pixel density is set to higher than 1 with the pixelDensity() function, these values will change. See the reference for pixelWidth or pixelHeight for more information.
+
+Before accessing this array, the data must loaded with the loadPixels() function. Failure to do so may result in a NullPointerException. Subsequent changes to the display window will not be reflected in pixels until loadPixels() is called again. After pixels has been modified, the updatePixels() function must be run to update the content of the display window.
]]>
diff --git a/content/api_en/point.xml b/content/api_en/point.xml
index ef1900aa8..6034c7f82 100755
--- a/content/api_en/point.xml
+++ b/content/api_en/point.xml
@@ -33,6 +33,12 @@ point(30, 75, -50);
z parameter requires the P3D parameter in combination with size() as shown in the above example.
+
+Use stroke() to set the color of a point().
+
+Point appears round with the default strokeCap(ROUND) and square with strokeCap(PROJECT). Points are invisible with strokeCap(SQUARE) (no cap).
+
+Using point() with strokeWeight(1) or smaller may draw nothing to the screen, depending on the graphics settings of the computer. Workarounds include setting the pixel using set() or drawing the point using either circle() or square().
]]>
diff --git a/content/api_en/pop.xml b/content/api_en/pop.xml
new file mode 100644
index 000000000..743748933
--- /dev/null
+++ b/content/api_en/pop.xml
@@ -0,0 +1,51 @@
+
+
+pop()
+
+Structure
+
+
+
+
+
+
+popMatrix_.png
+
+
+
+
+popStyle_0.png
+
+
+
+pop() function restores the previous drawing style settings and transformations after push() has changed them. Note that these functions are always used together. They allow you to change the style and transformation settings and later return to what you had. When a new state is started with push(), it builds on the current style and transform information.
+
+push() stores information related to the current transformation state and style settings controlled by the following functions: rotate(), translate(), scale(), fill(), stroke(), tint(), strokeWeight(), strokeCap(), strokeJoin(), imageMode(), rectMode(), ellipseMode(), colorMode(), textAlign(), textFont(), textMode(), textSize(), textLeading().
+
+The push() and pop() functions were added with Processing 3.5. They can be used in place of pushMatrix(), popMatrix(), pushStyles(), and popStyles(). The difference is that push() and pop() control both the transformations (rotate, scale, translate) and the drawing styles at the same time.
+]]>
+
+
diff --git a/content/api_en/push.xml b/content/api_en/push.xml
new file mode 100644
index 000000000..e926650fb
--- /dev/null
+++ b/content/api_en/push.xml
@@ -0,0 +1,51 @@
+
+
+push()
+
+Structure
+
+
+
+
+
+
+pushMatrix_.png
+
+
+
+
+pushStyle_0.png
+
+
+
+push() function saves the current drawing style settings and transformations, while pop() restores these settings. Note that these functions are always used together. They allow you to change the style and transformation settings and later return to what you had. When a new state is started with push(), it builds on the current style and transform information.
+
+push() stores information related to the current transformation state and style settings controlled by the following functions: rotate(), translate(), scale(), fill(), stroke(), tint(), strokeWeight(), strokeCap(), strokeJoin(), imageMode(), rectMode(), ellipseMode(), colorMode(), textAlign(), textFont(), textMode(), textSize(), textLeading().
+
+The push() and pop() functions were added with Processing 3.5. They can be used in place of pushMatrix(), popMatrix(), pushStyles(), and popStyles(). The difference is that push() and pop() control both the transformations (rotate, scale, translate) and the drawing styles at the same time.
+]]>
+
+
diff --git a/content/api_en/quadraticVertex.xml b/content/api_en/quadraticVertex.xml
index 1cf51f929..c3dd03bc5 100644
--- a/content/api_en/quadraticVertex.xml
+++ b/content/api_en/quadraticVertex.xml
@@ -35,7 +35,7 @@ endShape();
quadraticVertex() defines the position of one control points and one anchor point of a Bezier curve, adding a new segment to a line or shape. The first time quadraticVertex() is used within a beginShape() call, it must be prefaced with a call to vertex() to set the first anchor point. This function must be used between beginShape() and endShape() and only when there is no MODE parameter specified to beginShape(). Using the 3D version requires rendering with P3D (see the Environment reference for more information).
+Specifies vertex coordinates for quadratic Bezier curves. Each call to quadraticVertex() defines the position of one control point and one anchor point of a Bezier curve, adding a new segment to a line or shape. The first time quadraticVertex() is used within a beginShape() call, it must be prefaced with a call to vertex() to set the first anchor point. This function must be used between beginShape() and endShape() and only when there is no MODE parameter specified to beginShape(). Using the 3D version requires rendering with P3D (see the Environment reference for more information).
]]>
diff --git a/content/api_en/resetMatrix.xml b/content/api_en/resetMatrix.xml
index 733a2803b..fb1c6ac42 100755
--- a/content/api_en/resetMatrix.xml
+++ b/content/api_en/resetMatrix.xml
@@ -9,7 +9,7 @@
-resetMatrix_.png
+scale(2.0) increases the dimension of a shape by 200%.
-Transformations apply to everything that happens after and subsequent calls to the function multiply the effect. For example, calling scale(2.0) and then scale(1.5) is the same as scale(3.0). If scale() is called within draw(), the transformation is reset when the loop begins again. Using this fuction with the z parameter requires using P3D as a parameter for size(), as shown in the third example above. This function can be further controlled with pushMatrix() and popMatrix().
+Transformations apply to everything that happens after and subsequent calls to the function multiply the effect. For example, calling scale(2.0) and then scale(1.5) is the same as scale(3.0). If scale() is called within draw(), the transformation is reset when the loop begins again. Using this function with the z parameter requires using P3D as a parameter for size(), as shown in the third example above. This function can be further controlled with pushMatrix() and popMatrix().
]]>
diff --git a/content/api_en/shorten.xml b/content/api_en/shorten.xml
index 82961260a..41746c5ad 100755
--- a/content/api_en/shorten.xml
+++ b/content/api_en/shorten.xml
@@ -20,7 +20,7 @@ println(sa2); // 'sa2' now contains OH, NY
When using an array of objects, the data returned from the function must be cast to the object array's data type. For example: SomeClass[] items = (SomeClass[]) shorten(originalArray)
]]>
diff --git a/content/api_en/size.xml b/content/api_en/size.xml
index 91b88ce52..bd6f4c1b0 100755
--- a/content/api_en/size.xml
+++ b/content/api_en/size.xml
@@ -51,25 +51,31 @@ box(35);
setup() function, the size() function must be the first line of code inside setup().
+Defines the dimension of the display window width and height in units of pixels. In a program that has the setup() function, the size() function must be the first line of code inside setup(), and the setup() function must appear in the code tab with the same name as your sketch folder.
-The system variables width and height are set by the parameters passed to this function. For example, running size(640, 480) will assign 640 to the width variable and 480 to the height variable. If size() is not used, the window will be given a default size of 100 x 100 pixels.
+The built-in variables width and height are set by the parameters passed to this function. For example, running size(640, 480) will assign 640 to the width variable and 480 to the height variable. If size() is not used, the window will be given a default size of 100 x 100 pixels.
The size() function can only be used once inside a sketch, and it cannot be used for resizing.
-As of Processing 3.0, to run a sketch at the full dimensions of a screen, use the fullScreen() function, rather than the older way of using size(displayWidth, displayHeight).
+As of Processing 3, to run a sketch at the full dimensions of a screen, use the fullScreen() function, rather than the older way of using size(displayWidth, displayHeight).
The maximum width and height is limited by your operating system, and is usually the width and height of your actual screen. On some machines it may simply be the number of pixels on your current screen, meaning that a screen of 800 x 600 could support size(1600, 300), since that is the same number of pixels. This varies widely, so you'll have to try different rendering modes and sizes until you get what you're looking for. If you need something larger, use createGraphics to create a non-visible drawing surface.
+The minimum width and height is around 100 pixels in each direction. This is the smallest that is supported across Windows, macOS, and Linux. We enforce the minimum size so that sketches will run identically on different machines.
+
The renderer parameter selects which rendering engine to use. For example, if you will be drawing 3D shapes, use P3D. In addition to the default renderer, other renderers are:
P2D (Processing 2D): 2D graphics renderer that makes use of OpenGL-compatible graphics hardware.
P3D (Processing 3D): 3D graphics renderer that makes use of OpenGL-compatible graphics hardware.
+FX2D (JavaFX 2D): A 2D renderer that uses JavaFX, which may be faster for some applications, but has some compatibility quirks.
+ PDF: The PDF renderer draws 2D graphics directly to an Acrobat PDF file. This produces excellent results when you need vector shapes for high-resolution output or printing. You must first use Import Library → PDF to make use of the library. More information can be found in the PDF library reference.
-As of Processing 3.0, to use variables as the parameters to size() function, place the size() function within the settings() function. There is more information about this on the settings() reference page.
+SVG: The SVG renderer draws 2D graphics directly to an SVG file. This is great for importing into other vector programs or using for digital fabrication. You must first use Import Library → SVG Export to make use of the library.
+
+As of Processing 3.0, to use variables as the parameters to size() function, place the size() function within the settings() function (instead of setup()). There is more information about this on the settings() reference page.
]]>
diff --git a/content/api_en/smooth.xml b/content/api_en/smooth.xml
index 6b82e35b5..c19f7a303 100755
--- a/content/api_en/smooth.xml
+++ b/content/api_en/smooth.xml
@@ -28,6 +28,8 @@ void draw() {
+
+
+
+
+
smooth() only needs to be used when a program needs to set the smoothing in a different way. The level parameter increases the level of smoothness. This is the level of over sampling applied to the graphics buffer.
-
-With the P2D and P3D renderers, smooth(2) is the default, this is called "2x anti-aliasing." The code smooth(4) is used for 4x anti-aliasing and smooth(8) is specified for 8x anti-aliasing. The maximum anti-aliasing level is determined by the hardware of the machine that is running the software, so smooth(4) and smooth(8) will not work with every computer.
-
-The default renderer uses smooth(3) by default. This is bicubic smoothing. The other option for the default renderer is smooth(2), which is bilinear smoothing.
-
+Draws all geometry with smooth (anti-aliased) edges. This behavior is the default, so smooth() only needs to be used when a program needs to set the smoothing in a different way. The level parameter increases the amount of smoothness. This is the level of over sampling applied to the graphics buffer.
+
+With the P2D and P3D renderers, smooth(2) is the default, this is called "2x anti-aliasing." The code smooth(4) is used for 4x anti-aliasing and smooth(8) is specified for "8x anti-aliasing." The maximum anti-aliasing level is determined by the hardware of the machine that is running the software, so smooth(4) and smooth(8) will not work with every computer.
+
+The default renderer uses smooth(3) by default. This is bicubic smoothing. The other option for the default renderer is smooth(2), which is bilinear smoothing.
+
With Processing 3.0, smooth() is different than before. It was common to use smooth() and noSmooth() to turn on and off antialiasing within a sketch. Now, because of how the software has changed, smooth() can only be set once within a sketch. It can be used either at the top of a sketch without a setup(), or after the size() function when used in a sketch with setup(). The noSmooth() function also follows the same rules.
+
+When smooth() is used with a PGraphics object, it should be run right after the object is created with createGraphics(), as shown in the Reference in the third example.
]]>
diff --git a/content/api_en/splice.xml b/content/api_en/splice.xml
index c62c959e8..a9f5358c6 100755
--- a/content/api_en/splice.xml
+++ b/content/api_en/splice.xml
@@ -39,7 +39,7 @@ println(a);
+Inserts a value or an array of values into an existing array. The first two parameters must be arrays of the same datatype. The first parameter specifies the initial array to be modified, and the second parameter defines the data to be inserted. The third parameter is an index value which specifies the array position from which to insert data. (Remember that array index numbering starts at zero, so the first position is 0, the second position is 1, and so on.)
When splicing an array of objects, the data returned from the function must be cast to the object array's data type. For example: SomeClass[] items = (SomeClass[]) splice(array1, array2, index)
]]>
diff --git a/content/api_en/split.xml b/content/api_en/split.xml
index 13841d3ba..5b01ca9f2 100755
--- a/content/api_en/split.xml
+++ b/content/api_en/split.xml
@@ -38,7 +38,7 @@ String[] list = split(men, " ] ");
split() function breaks a String into pieces using a character or string as the delimiter. The delim parameter specifies the character or characters that mark the boundaries between each piece. A String[] array is returned that contains each of the pieces.
-If the result is a set of numbers, you can convert the String[] array to to a float[] or int[] array using the datatype conversion functions int() and float(). (See the second example above.)
+If the result is a set of numbers, you can convert the String[] array to a float[] or int[] array using the datatype conversion functions int() and float(). (See the second example above.)
The splitTokens() function works in a similar fashion, except that it splits using a range of characters instead of a specific character or sequence.
Reference for Processing version 1.5. If you have a previous version, use the reference included with your software.If you see any errors or have suggestions, please let us know.
- If you prefer a more technical reference, visit the Processing Javadoc.
+ If you prefer a more technical reference, visit the Processing Javadoc.
diff --git a/content/api_en/trim.xml b/content/api_en/trim.xml
index 4b91885ed..68afbfec6 100755
--- a/content/api_en/trim.xml
+++ b/content/api_en/trim.xml
@@ -18,7 +18,7 @@ println(s2); // Prints "Somerville MA"
String[] a1 = { " inconsistent ", " spacing" }; // Note spaces
String[] a2 = trim(a1);
-println(a2);
+printArray(a2);
// Prints the following array contents to the console:
// [0] "inconsistent"
// [1] "spacing"
diff --git a/content/api_en/updatePixels.xml b/content/api_en/updatePixels.xml
index 200667c22..fb3ba9af1 100755
--- a/content/api_en/updatePixels.xml
+++ b/content/api_en/updatePixels.xml
@@ -24,10 +24,6 @@ updatePixels();
pixels[] array. Use in conjunction with loadPixels(). If you're only reading pixels from the array, there's no need to call updatePixels() — updating is only necessary to apply changes.
-
-Certain renderers may or may not seem to require loadPixels() or updatePixels(). However, the rule is that any time you want to manipulate the pixels[] array, you must first call loadPixels(), and after changes have been made, call updatePixels(). Even if the renderer may not seem to use this function in the current Processing release, this will always be subject to change.
-
-Currently, while none of the renderers use the additional parameters to updatePixels(), this may be implemented in the future.
]]>
diff --git a/content/api_media/LIB_sound_Pulse.png b/content/api_media/LIB_sound_Pulse.png
new file mode 100644
index 000000000..6104e4931
Binary files /dev/null and b/content/api_media/LIB_sound_Pulse.png differ
diff --git a/content/api_media/LIB_sound_SawOsc.png b/content/api_media/LIB_sound_SawOsc.png
new file mode 100644
index 000000000..845db35d1
Binary files /dev/null and b/content/api_media/LIB_sound_SawOsc.png differ
diff --git a/content/api_media/LIB_sound_SinOsc.png b/content/api_media/LIB_sound_SinOsc.png
new file mode 100644
index 000000000..f510c14ed
Binary files /dev/null and b/content/api_media/LIB_sound_SinOsc.png differ
diff --git a/content/api_media/LIB_sound_SqrOsc.png b/content/api_media/LIB_sound_SqrOsc.png
new file mode 100644
index 000000000..1e6941c6e
Binary files /dev/null and b/content/api_media/LIB_sound_SqrOsc.png differ
diff --git a/content/api_media/LIB_sound_TriOsc.png b/content/api_media/LIB_sound_TriOsc.png
new file mode 100644
index 000000000..a7d89b40d
Binary files /dev/null and b/content/api_media/LIB_sound_TriOsc.png differ
diff --git a/content/api_media/text_2.png b/content/api_media/text_2.png
index 464217613..841e5e16d 100644
Binary files a/content/api_media/text_2.png and b/content/api_media/text_2.png differ
diff --git a/content/curated.xml b/content/curated.xml
index a586b7166..87029364a 100755
--- a/content/curated.xml
+++ b/content/curated.xml
@@ -1,6 +1,119 @@
+
+ images/pour.jpg
+
+ ‘Pour Reception’ is a playful radio that uses machine learning and tangible computing to challenge our cultural understanding of what an interface is and can be. Two glasses of water are turned into a digital material for the user to explore and appropriate.
+ http://www.toreknudsen.dk/work/pour-reception/
+ Tore Knudsen
+
+
+
+ images/digits.jpg
+
+ Gysin-Vanetti are an artist duo exploring images and patterns using the type geometries of multipurpose displays. Using only prevailing forms, Gysin-Vanetti build images, animations and generate patterns.
+ https://www.creativeapplications.net/processing/gysin-vanetti-o-is-not-a-letter-its-a-circle/
+ Gysin&Vanetti
+ CreativeApplications.Net
+
+
+
+ images/volume.jpg
+
+ Created by NY based art and architecture collective Softlab, ‘Volume’ is an interactive cube of responsive mirrors that redirect light and sound to spatialize and reflect the excitement of surrounding festival goers.
+ http://softlabnyc.com/portfolio/volume/
+ Softlab
+
+
+
+ images/komorebi.jpg
+
+ komorebi is a platform that uses a robotic projector and generative projections to replicate the natural reflections and shadows of sunlight. komorebi can create sunlight filtering through leaves or a dance of light and shadow.
+ http://komorebi.studio/
+ Leslie Nooteboom
+
+
+
+ images/particleflow.jpg
+
+ Particle Flow is a physical installation comprised of granules driven by gravity and topography forming an analogue particle system. A moving slanted plane and a grid of motorized stamps control the elements to form infinite variations of behaviours and patterns.
+ http://neoanalog.io/particle-flow/
+ NEOANALOG
+ CreativeApplications.Net
+
+
+
+ images/objectifier.jpg
+
+ Objectifier empowers people to train objects in their daily environment to respond to their unique behaviours. Interacting with Objectifier is much like training a pet and it sees and understands its environment.
+ https://bjoernkarmann.dk/objectifier
+ Bjørn Karmann
+ CreativeApplications.Net
+
+
+
+ images/random.jpg
+
+ Created by Berlin based Ralf Baecker, Random Access Memory is a fully functional digital memory. Instead of operating on semi-conducting components to represent either the binary states of 0 (zero) or 1 (one), the memory uses grains of sand as storage material.
+ http://www.rlfbckr.org/work/random-access-memory/
+ Ralf Baecker
+ CreativeApplications.Net
+
+
+
+ images/aadrl.jpg
+
+ The AADRL is a post-professional graduate design programme at the Architectural Association School of Architecture in London. Their research is focused on architectural design that is proto-typical, scenario driven and uses behaviour robotics as a design enquiry.
+ http://www.creativeapplications.net/processing/aadrl-behavioural-complexity/
+ AADRL
+ CreativeApplications.Net
+
+
+
+ images/terrapattern.jpg
+
+ Terrapattern is a visual search tool for satellite imagery. The project provides journalists, citizen scientists, and other researchers with the ability to quickly scan large geographical regions for specific visual features.
+ http://www.terrapattern.com
+ Terrapattern
+
+
+
+ images/FluidLeaves.jpg
+
+ A generative approach to pattern design, which in combination with variable printing results in a unique design each time. The project grew out of an identity investigation for tea boutique, ‘Tee & Cupp’ in Xian.
+
+ http://reinoudvanlaar.nl/project/leavespattern/
+ Reinoud van Laar
+
+
+
+ images/cfcityflows.jpg
+
+ cf.city flows is a comparative visualization environment of urban bike mobility designed to help citizens casually analyze three bike-sharing systems in the context of a public exhibition space.
+
+ https://uclab.fh-potsdam.de/cf/
+ cf.city flows
+
+
+
+ images/autoorchestra.jpg
+
+ The Automatic Orchestra is an audio installation exploring algorithmic composition and networked music. The perpetual interaction among the devices and the interpretation of encoded musical messages blurs the distinctiveness between structured composition and performative improvisation.
+
+ http://digitalmedia-bremen.de/en/project/automatic-orchestra/
+ Digital Media Bremen
+
+
+
+ images/possible.jpg
+
+ Possible, Plausible, Potential is a set of three series of isometric drawings generated by code and printed with colored markers on a plotter machine. In these drawings, Miguel explores a bridge between the iterative aspect of algorithms and the utopian aspect of modern architecture. Each drawing is a unique variation of the same set of rules and carefully placed random decisions.
+
+ http://superficie.ink/
+ Miguel Nóbrega
+
+
images/stewart.jpg
@@ -8,17 +121,17 @@
http://felixros.com
Felix Ros
-
+
images/traces.jpg
- Traces project explores the concept of programming everyday materials where objects are “made to act” by re-forming following a set of specific instructions. Dana developed 12 processed-folding objects series, using Processing and various physical techniques – printing, twisting, laser-cutting, knotting and framing.
+ Traces project explores the concept of programming everyday materials where objects are “made to act” by re-forming following a set of specific instructions. Dana developed 12 processed-folding objects series, using Processing and various physical techniques – printing, twisting, laser-cutting, knotting and framing.
https://vimeo.com/133662815
Vimeo
More Info
-
+
images/pixtil.jpg
@@ -28,8 +141,8 @@
http://pixtil.fr/php/produits/accueil.php?page=2#debut
Pixtil
More Info
-
-
+
+
images/lightkinetics.jpg
@@ -37,19 +150,19 @@
http://espadaysantacruz.com/Light-kinetics
Light Kinetics
-
-
+
+
images/pathfinder.jpg
- Created by Princemio in collaboration with onformative and presented at Choreographic Coding laboratory in Frankfurt 2013, the Pathfinder project was created with aim to contribute to the creative processes of choreographic development.
+ Created by Princemio in collaboration with onformative and presented at Choreographic Coding laboratory in Frankfurt 2013, the Pathfinder project was created with aim to contribute to the creative processes of choreographic development.
http://princemio.net/portfolio/pathfinder/
Pathfinder
Motionbank
Onformative
-
+
images/dextro.jpg
@@ -59,7 +172,7 @@
Dextro
Vimeo
-
+
images/rc4.jpg
@@ -69,7 +182,7 @@
GAD – RC4
CreativeApplications.Net
-
+
images/filament.jpg
@@ -79,7 +192,7 @@
http://www.liaworks.com/theprojects/filament-sculptures/
Lia
liasomething.tumblr.com
-
+
images/Phantogram.jpg
@@ -90,16 +203,16 @@
Timothy Saccenti
Joshua Davis
Watch Video
-
+
images/keyflies.jpg
Created by Miles Peyton, first year student at the Carnegie Mellon University, Keyfleas is an experiment in interactive augmented projection. Miles used Processing and Box2D to create an augmented projection on the keyboard. As the user types, the “fleas” swarm around the pressed key, avoiding the letters.
- http://cmuems.com/2013/a/miles/10/17/keyfleas/
- CMU / Electronic Media Studio 2
-
+ https://vimeo.com/151334392
+ CMU / Electronic Media Studio 2
+
images/petting.jpg
@@ -108,7 +221,7 @@
http://minimaforms.com/#item=petting-zoo-frac-2
Minimaforms
-
+
images/fragmented.jpg
@@ -117,8 +230,8 @@
http://phillipstearns.wordpress.com/fragmented-memory/
Phillip Stearns
-
-
+
+
images/avena.jpg
@@ -126,7 +239,7 @@
http://benedikt-gross.de/log/2013/06/avena-test-bed_agricultural-printing-and-altered-landscapes/
Benedikt Groß
-
+
images/kinograph.jpg
@@ -136,7 +249,7 @@
http://mepler.com/Kinograph
Kinograph
-
+
images/fluid.jpg
@@ -145,7 +258,7 @@
http://cargocollective.com/hnx/fluid
Hannes Jung
-
+
images/3dprintedrecord.jpg
@@ -154,7 +267,7 @@
http://www.instructables.com/id/3D-Printed-Record/
Instructables
-
+
images/digitalnatives.jpg
@@ -163,7 +276,7 @@
http://www.plummerfernandez.com/Digital-Natives
Matthew Plummer-Fernandez
-
+
images/stonespray.jpg
@@ -172,7 +285,7 @@
http://www.stonespray.com
Petr Novikov, Inder Shergill and Anna Kulik
-
+
images/citysymphonies.jpg
@@ -180,9 +293,8 @@
http://markmckeague.com/work/city-symphonies/
Mark McKeague
- More on CreativeApplications.Net
-
+
images/silenc2.png
@@ -190,9 +302,8 @@
http://www.flickr.com/photos/kennethaleksander/sets/72157629659743887
Flick Page
- CreativeApplications.Net
-
+
images/unnamed.jpg
@@ -201,7 +312,7 @@
http://wearechopchop.com/%E2%80%9Cunnamed-soundsculpture%E2%80%9D/
We Are Chopchop
-
+
images/soundmachines.jpg
@@ -209,9 +320,8 @@
http://www.the-product.org/soundmachines
The Product
- CreativeApplications.Net
-
+
images/visualeditions.jpg
@@ -220,7 +330,7 @@
http://www.visual-editions.com
Visual Editions
-
+
images/maxplanck.jpg
@@ -229,7 +339,7 @@
http://max-planck-research-networks.net/
Max Planck Reasearch Networks
-
+
images/creators.jpg
@@ -238,7 +348,7 @@
http://www.thecreators.tv
The Creators
-
+
images/golberg.jpg
@@ -247,7 +357,7 @@
http://www.the-product.org/rube-goldberg-processor
The Product
-
+
images/prototyp0.jpg
@@ -255,8 +365,8 @@
http://www.yannickmathey.com/prototyp
Yannick Mathey
-
-
+
+
images/nytcascade.jpg
@@ -265,7 +375,7 @@
http://nytlabs.com/projects/cascade.html
NYTimes R&D Lab
-
+
images/mitidentity.jpg
@@ -274,7 +384,7 @@
http://www.thegreeneyl.com/mit-media-lab-identity-1
TheGreenEyl
-
+
images/continuum.jpg
@@ -283,7 +393,7 @@
http://www.rhymeandreasoncreative.com/portfolio/index.php?project=continuum
Mary Huang
-
+
-
+
images/casey_pc.jpg
@@ -305,7 +415,7 @@
Download from CAN
Casey Reas
-
+
images/108.jpg
@@ -314,7 +424,7 @@
http://nilsvoelker.com/content/onehundredandeight/index.html
Nils Völker
-
+
images/privacy.jpg
@@ -323,7 +433,7 @@
http://www.niklasroy.com/project/88/my-little-piece-of-privacy/
Niklas Roy
-
+
images/strata.jpg
@@ -332,7 +442,7 @@
http://www.quayola.com/selectedartworks/strata3/
Quayola
-
+
images/shakespeare.jpg
@@ -341,7 +451,7 @@
http://www.understanding-shakespeare.com
Stephan Thiel
-
+
images/one-perfect-cube.jpg
@@ -350,7 +460,7 @@
http://florianjenett.de/one-perfect-cube-making-of/
FlorianJenett.de
-
+
images/feltron.jpg
@@ -360,7 +470,7 @@
2009 Report and Processing
Feltron.com
-
+
images/computing-kaizen.jpg
@@ -370,7 +480,7 @@
Proxy
GSAPP
-
+
images/finecollection.jpg
@@ -380,7 +490,7 @@
geschoir.de
theplacetofindme.de
-
+
images/justlanded.jpg
@@ -389,7 +499,7 @@
http://blog.blprnt.com/blog/blprnt/just-landed-processing-twitter-metacarta-hidden-data
blprnt.com
-
+
images/johnhenry.jpg
@@ -398,7 +508,7 @@
http://brysonian.com/john-henry-von-neumann
brysonian.com
-
+
images/intheair.jpg
@@ -408,7 +518,7 @@
Victor Viña
Nerea Calvillo
-
+
images/silica.jpg
@@ -418,17 +528,17 @@
tadar.net
tadar Flickr
-
+
images/mycelium.png
- A simulation of fungal hyphae growth using images as food.
+ A simulation of fungal hyphae growth using images as food.
http://onecm.com/projects/mycelium/
onecm.com
onecm Flickr
-
+
images/nyx.jpg
@@ -437,7 +547,7 @@
http://vimeo.com/3872857
NYX Blog
-
+
images/golan_cards.jpg
@@ -457,7 +567,7 @@
shiftcontrol
NR2154
-
+
images/branching.jpg
@@ -469,7 +579,7 @@
Andrew Lucia
Jones Lab
-
+
images/realtime.jpg
@@ -479,7 +589,7 @@
Zum Kuckuck
Atelier Markgraph
-
+
images/wf3.png
@@ -489,7 +599,7 @@
benhem.com
RogueBasin
-
+
images/mud.jpg
@@ -499,7 +609,7 @@
tomgerhardt.com
NYU ITP
-
+
images/mos.gif
@@ -510,7 +620,7 @@
ComputationalPile
Arcade
-
+
images/terre.jpg
@@ -523,7 +633,7 @@
Michael Doherty
Hans-Christoph Steiner
-
+
images/mtv.gif
@@ -533,7 +643,7 @@
Dmtr.org
Piloto
-
+
images/camp.jpg
@@ -542,7 +652,7 @@
http://www.field.io/project/interim-camp
field
-
+
images/aeolab.jpg
@@ -551,7 +661,7 @@
http://www.aeolab.com/projects/peoplemover/applet/
Aeolab
-
+
images/balldroppings.gif
@@ -561,7 +671,7 @@
BallDroppings
JTNimoy.net
-
+
images/oasis.gif
@@ -570,7 +680,7 @@
http://everyware.kr/portfolio/contents/09_oasis/
everyware
-
+
images/platonic.jpg
@@ -580,47 +690,47 @@
Michael Hansmeyer
Subdivision Flickr Set
-
+
images/monsters.gif
- Black and white, reactive monsters created by the Processing community.
+ Black and white, reactive monsters created by the Processing community.
http://www.rmx.cz/monsters/
Rmx
-
+
images/itp2.jpg
- For the second year, Dan Shiffman's NYU students write software for a 120 by 12
- foot video wall at IAC's world headquarters in NYC.
+ For the second year, Dan Shiffman's NYU students write software for a 120 by 12
+ foot video wall at IAC's world headquarters in NYC.
http://gizmodo.com/5110633/120-feet-of-video-art-final-exams-at-nyus-big-screens-class
Shiffman.net
-
+
images/emergence.jpg
- Realtime art installation that explores how complex systems and patterns arise out of
+ Realtime art installation that explores how complex systems and patterns arise out of
a multiplicity of simple interactions.
http://emergenceproject.org/blog/?page_id=180
The Emergence Project
Daniel Sauter
-
+
images/roots.jpg
- An interactive installation where participants engage in making generative / semi-generative / and or
+ An interactive installation where participants engage in making generative / semi-generative / and or
composed music by moving their fingers and objects around the Brick multi-touch surface.
http://flipmu.com/work/bricktable/what-is-roots/
Memo.tv
-
+
images/npz.gif
@@ -633,18 +743,18 @@
Banas' design
Banas' oceanography
-
+
images/maeve.jpg
- Provides visual and tangible access to the conceptual networks behind architectural projects.
+ Provides visual and tangible access to the conceptual networks behind architectural projects.
The installation is part of the 11th International Architecture Exhibition of the Venice Biennale.
http://portal.mace-project.eu/maeve/
FH Potsdam
MACE
-
+
images/ymyi.jpg
@@ -654,7 +764,7 @@
Joao Martinho Moura
Master in Technology and Digital Art
-
+
images/bodynavigation.jpg
@@ -674,7 +784,7 @@
http://casualdata.com/newsknitter
Mahir M. Yavuz
-
+
images/cho.jpg
@@ -684,26 +794,26 @@
Typotopo.com
Pcho.net
-
+
images/muth.jpg
- A generative video piece with music by Hiaz.
+ A generative video piece with music by Hiaz.
http://www.davidmuth.net/videos/counterclockwise/
DavidMuth.net
-
+
images/proximity.gif
- Generative, parameterized images and sound.
+ Generative, parameterized images and sound.
http://www.proximityofneeds.org/
strangethingshappen.org
-
-
+
+
images/houck.jpg
@@ -712,19 +822,19 @@
http://www.johnhouck.com/p/
JohnHouck.com
-
+
images/itp.jpg
Dan Shiffman's NYU students write software for a 120 by 12 foot video wall
- at IAC's world headquarters designed by Frank Gehry.
+ at IAC's world headquarters designed by Frank Gehry.
http://www.flickr.com/photos/shiffman/sets/72157601572932676/
Shiffman.net
-
+
images/nervous.jpg
@@ -734,18 +844,18 @@
http://www.n-e-r-v-o-u-s.com/play_and_learn.php
Nervous System
-
+
images/mit.jpg
- Shows the global exchange of information by visualizing volumes of data flowing
+ Shows the global exchange of information by visualizing volumes of data flowing
in and out of New York City.
http://senseable.mit.edu/nyte/
SENSEable City Lab
AaronKoblin.com
-
+
images/cascade.jpg
@@ -754,17 +864,17 @@
http://www.trsp.net/cow/
Transparent
-
+
images/mypocket.jpg
- Discloses the artist's personal financial records by exploring and revealing essential
+ Discloses the artist's personal financial records by exploring and revealing essential
patterns in daily transactions.
http://transition.turbulence.org/Works/mypocket/
Burak-Arikan.com
-
+
images/taobot.jpg
@@ -774,7 +884,7 @@
Taobot
Michael Fakesch
-
+
images/whiteglove.jpg
@@ -784,7 +894,7 @@
Evan Roth
Ben Engebreth
-
+
images/foxmovies.jpg
@@ -794,7 +904,7 @@
Flight404
Nervo
-
+
images/firstborn.jpg
@@ -803,7 +913,7 @@
http://www.firstborn.com/#/our-portfolio/1007/
Firstborn
-
+
images/simdiv.jpg
@@ -813,19 +923,19 @@
Philipp Steinweber
Andreas Koller
-
+
-
+
images/sheep.gif
@@ -837,7 +947,7 @@
Aaron Koblin
-
+
images/catanese.jpg
@@ -848,7 +958,7 @@
http://www.paulcatanese.com/artwork/celestial/process.html
PaulCatanese.com
-
+
images/any.gif
@@ -857,7 +967,7 @@
http://carohorn.de/anymails/
CaroHorn.de
-
+
images/hehe.jpg
@@ -867,7 +977,7 @@
http://hehe.org.free.fr/hehe/champsdozone/
HeHe
-
+
images/carden.jpg
@@ -876,7 +986,7 @@
http://www.tom-carden.co.uk/p5/tube_map_travel_times/applet/
Tom Carden
-
+
images/proto.jpg
@@ -885,27 +995,27 @@
http://www.fidgt.com/visualize/
Protohaus
-
+
images/lovebytes.png
- A population of unique friendly furry faces to appear across all festival literature for Lovebytes 2007.
+ A population of unique friendly furry faces to appear across all festival literature for Lovebytes 2007.
http://universaleverything.com/#/UE205
Universal Everything
-
+
images/house.jpg
- An environment constructed from thousands of low tech components that can be reconfigured by its occupants.
+ An environment constructed from thousands of low tech components that can be reconfigured by its occupants.
http://house.propositions.org.uk/
Haque
Aether
Reorient
-
+
images/muon.jpg
@@ -914,7 +1024,7 @@
http://www.movingbrands.com/?category_name=kef-work#experience
Moving Brands
-
+
images/universe.gif
@@ -923,18 +1033,18 @@
http://www.number27.org/universe.html
Jonathan Harris
-
+
-
+
images/suzung.jpg
@@ -943,27 +1053,27 @@
http://www.suzung.com/body/2006/Kaleido/display.htm
Studio Site Suzung
-
+
images/stateoftheunion.gif
- Provides access to the corpus of all the State of the Union addresses from 1790 to 2006.
+ Provides access to the corpus of all the State of the Union addresses from 1790 to 2006.
http://stateoftheunion.onetwothree.net/
onetwothree
-
+
-
+
images/juani.jpg
@@ -973,7 +1083,7 @@
Onionlab
Yo soy la Juani
-
+
images/spies.gif
@@ -983,7 +1093,7 @@
Pentagram
JamesNSears.com
-
+
images/mutualism.jpg
@@ -1041,7 +1151,7 @@
Motion Theory
-->
-
+
images/wefeelfine.jpg
@@ -1150,7 +1260,7 @@
images/aqueous.jpg
- Aqueous is a meditative space that encourages perception of small things. Water droplets fall from the ceiling through the space into water-filled tubes approximately tuned in a scale spanning two octaves.
+ Aqueous is a meditative space that encourages perception of small things. Water droplets fall from the ceiling through the space into water-filled tubes approximately tuned in a scale spanning two octaves.
works/aqueous/
Zehao.com
@@ -1244,7 +1354,7 @@
haohao/haohao.pde
-->
-
+
-
+
images/timescape.jpg
@@ -1267,7 +1377,7 @@
Phantasian
Gone
-
+
images/ortho.gif
@@ -1277,7 +1387,7 @@
ortho/orthotype.pde
Ortho-type
-
+
images/acoustic.jpg
@@ -1288,22 +1398,22 @@
Acoustic Cartography
Zum Kuckuck
-
+
images/min_mod.gif
- A sound phenomenon represented through a spatial distribution of minimal elements, creating a sensitive environment influenced by the sounds generated in the surrounding space.
+ A sound phenomenon represented through a spatial distribution of minimal elements, creating a sensitive environment influenced by the sounds generated in the surrounding space.
http://www.limiteazero.com/min_mod/min_mod/min_mod.pde
Limiteazero
-
+
-
+
images/chronodraw.gif
@@ -1321,18 +1431,18 @@
chronodraw/chronodraw.txt
www.ertdfgcvb.ch
-
+
images/papa.jpg
- Software for Papa Roach's "Getting Away with Murder" music video by Motion Theory
+ Software for Papa Roach's "Getting Away with Murder" music video by Motion Theory
works/papa/index.htmlpapa/ticker_applet.txt
Quilime
Motion Theory
-
+
-
+
images/ecstasy.gif
@@ -1355,18 +1465,18 @@
ecstasy/n_e_13.pde
Machinatus
-
+
images/d5lv.jpg
- Exploring volume and emotional texture with simple generative geometry.
+ Exploring volume and emotional texture with simple generative geometry.
Interaction and randomness modify the structure.
works/d5lv/index.htmld5lv/D5LV.pde
W:Mute
-
+
images/discom.jpg
@@ -1380,7 +1490,7 @@
Justin Manor
SOSOlimited
-
+
images/pachinko.jpg
@@ -1392,7 +1502,7 @@
c505
Pretendster
-
+
images/tokyo.jpg
@@ -1402,7 +1512,7 @@
tokyo/Tokyo.pde
SMS
-
+
images/katya.jpg
@@ -1413,7 +1523,7 @@
lab5769
lab5769 portraits
-
+
images/ttc.gif
@@ -1424,7 +1534,7 @@
Chronotext
Chronotext Devices
-
+
images/liquid.jpg
@@ -1435,7 +1545,7 @@
Quasimondo Incubator
Quasimondo
-
+
images/relations.gif
@@ -1446,7 +1556,7 @@
Abstract-Codex
Ghost Agency
-
+
images/nudemengarden.gif
@@ -1457,7 +1567,7 @@
db-db
Experimental Vision
-
+
images/starnursery.jpg
@@ -1468,7 +1578,7 @@
Ryan Alexander
Motion Theory
-
+
images/techsupport.gif
@@ -1478,7 +1588,7 @@
techsupport/tech_support.pde
Coin-Operated
-
+
images/base26.gif
@@ -1490,7 +1600,7 @@
Toxi processing work
Toxi blog
-
+
images/superhero.gif
@@ -1501,7 +1611,7 @@
Beyond Three
Processing @ Beyond Three
-
+
images/redux.jpg
@@ -1511,7 +1621,7 @@
redux/moviemap3.pde
Brendan Dawes
-
+
images/872a_jogan.gif
@@ -1520,7 +1630,7 @@
works/versionb/index.htmlversionb/mmj_project_FINALd.pde
-
+
images/872a_stanat.gif
@@ -1529,7 +1639,7 @@
works/bees/index.htmlbees/bees6.pde
-
+
-
+
-
+
images/chamber.gif
@@ -1566,7 +1676,7 @@
Bubble Chamber
Levitated.net
-
+
images/jackolantern.jpg
@@ -1576,7 +1686,7 @@
jackolantern/jackolantern.pde
LCD modules
-
+
images/sonicwire.gif
@@ -1587,7 +1697,7 @@
Pitaru.com
InsertSilence
-
+
images/tracking.jpg
@@ -1597,7 +1707,7 @@
tracking/tracking.pde
Flight404
-
+
images/juhuu.gif
@@ -1607,7 +1717,7 @@
juhuu/juhuu.pde
Juhuu.nu
-
+
images/ricochet.gif
@@ -1618,7 +1728,7 @@
JTNimoy
Potatoland
-
+
images/skyline.gif
@@ -1628,7 +1738,7 @@
skyline/skyline.pde
Lightcycle
-
+
images/wiggle.gif
@@ -1638,7 +1748,7 @@
wiggle/wiggle.pde
Uncontrol
-
+
images/withouttitle.jpg
@@ -1649,7 +1759,7 @@
Re-Move
Wofbot
-
+
images/articulate.gif
@@ -1659,7 +1769,7 @@
articulate/articulate.pde
GroupC
-
+
images/sodaprocessing.gif
@@ -1670,18 +1780,18 @@
Soda
SodaPlay
-
+
images/c_drawer.jpg
- Like drawing with a bunch of crayons in one hand.
+ Like drawing with a bunch of crayons in one hand.
Simple and messy, but fun.
works/cdrawer/index.htmlcdrawer/cdrawer.pde
Evolution Zone
-
+
images/inequality.gif
@@ -1692,7 +1802,7 @@
They Rule
Future Farmers
-
+
images/pond.gif
@@ -1703,7 +1813,7 @@
Metaphorical
Royal College of Art
-
+
images/hinundher.gif
@@ -1713,7 +1823,7 @@
hinundher/hinundher.pde
Esono
-
+
images/yellowtail.gif
@@ -1724,7 +1834,7 @@
Yellowtail
Flong
-
+
images/004.gif
@@ -1735,7 +1845,7 @@
Alphabot
ACG
-
+
images/europa.gif
@@ -1746,7 +1856,7 @@
Glen Murphy
Body Tag
-
+
images/003.gif
@@ -1757,7 +1867,7 @@
Schoenerwissen
Minitasking
-
+
images/002.gif
@@ -1766,7 +1876,7 @@
002/code.html
kramdesign
-
+
images/001.gif
@@ -1777,5 +1887,5 @@
Genomic Cartography
ACG
-
+
diff --git a/content/curated_images/FluidLeaves.jpg b/content/curated_images/FluidLeaves.jpg
new file mode 100644
index 000000000..9d483098f
Binary files /dev/null and b/content/curated_images/FluidLeaves.jpg differ
diff --git a/content/curated_images/FluidLeaves@2x.jpg b/content/curated_images/FluidLeaves@2x.jpg
new file mode 100644
index 000000000..fa2964263
Binary files /dev/null and b/content/curated_images/FluidLeaves@2x.jpg differ
diff --git a/content/curated_images/aadrl.jpg b/content/curated_images/aadrl.jpg
new file mode 100644
index 000000000..2c5348d9f
Binary files /dev/null and b/content/curated_images/aadrl.jpg differ
diff --git a/content/curated_images/aadrl@2x.jpg b/content/curated_images/aadrl@2x.jpg
new file mode 100644
index 000000000..39a09ccee
Binary files /dev/null and b/content/curated_images/aadrl@2x.jpg differ
diff --git a/content/curated_images/autoorchestra.jpg b/content/curated_images/autoorchestra.jpg
new file mode 100644
index 000000000..0d09ca9bb
Binary files /dev/null and b/content/curated_images/autoorchestra.jpg differ
diff --git a/content/curated_images/autoorchestra@2x.jpg b/content/curated_images/autoorchestra@2x.jpg
new file mode 100644
index 000000000..315ede249
Binary files /dev/null and b/content/curated_images/autoorchestra@2x.jpg differ
diff --git a/content/curated_images/cfcityflows.jpg b/content/curated_images/cfcityflows.jpg
new file mode 100644
index 000000000..fec63eb3b
Binary files /dev/null and b/content/curated_images/cfcityflows.jpg differ
diff --git a/content/curated_images/cfcityflows@2x.jpg b/content/curated_images/cfcityflows@2x.jpg
new file mode 100644
index 000000000..9f05a006d
Binary files /dev/null and b/content/curated_images/cfcityflows@2x.jpg differ
diff --git a/content/curated_images/digits.jpg b/content/curated_images/digits.jpg
new file mode 100644
index 000000000..ce85f5658
Binary files /dev/null and b/content/curated_images/digits.jpg differ
diff --git a/content/curated_images/digits@2x.jpg b/content/curated_images/digits@2x.jpg
new file mode 100644
index 000000000..4210c3068
Binary files /dev/null and b/content/curated_images/digits@2x.jpg differ
diff --git a/content/curated_images/komorebi.jpg b/content/curated_images/komorebi.jpg
new file mode 100644
index 000000000..2ac8c3e54
Binary files /dev/null and b/content/curated_images/komorebi.jpg differ
diff --git a/content/curated_images/komorebi@2x.jpg b/content/curated_images/komorebi@2x.jpg
new file mode 100644
index 000000000..051402f92
Binary files /dev/null and b/content/curated_images/komorebi@2x.jpg differ
diff --git a/content/curated_images/objectifier.jpg b/content/curated_images/objectifier.jpg
new file mode 100644
index 000000000..3ee65e4ca
Binary files /dev/null and b/content/curated_images/objectifier.jpg differ
diff --git a/content/curated_images/objectifier@2x.jpg b/content/curated_images/objectifier@2x.jpg
new file mode 100644
index 000000000..654ad9dec
Binary files /dev/null and b/content/curated_images/objectifier@2x.jpg differ
diff --git a/content/curated_images/particleflow.jpg b/content/curated_images/particleflow.jpg
new file mode 100644
index 000000000..67775c29c
Binary files /dev/null and b/content/curated_images/particleflow.jpg differ
diff --git a/content/curated_images/particleflow@2x.jpg b/content/curated_images/particleflow@2x.jpg
new file mode 100644
index 000000000..efa22981f
Binary files /dev/null and b/content/curated_images/particleflow@2x.jpg differ
diff --git a/content/curated_images/possible.jpg b/content/curated_images/possible.jpg
new file mode 100644
index 000000000..fe89a9c80
Binary files /dev/null and b/content/curated_images/possible.jpg differ
diff --git a/content/curated_images/possible@2x.jpg b/content/curated_images/possible@2x.jpg
new file mode 100644
index 000000000..ceb5b5913
Binary files /dev/null and b/content/curated_images/possible@2x.jpg differ
diff --git a/content/curated_images/pour.jpg b/content/curated_images/pour.jpg
new file mode 100644
index 000000000..2ba0d0b6c
Binary files /dev/null and b/content/curated_images/pour.jpg differ
diff --git a/content/curated_images/pour@2x.jpg b/content/curated_images/pour@2x.jpg
new file mode 100644
index 000000000..3abdca466
Binary files /dev/null and b/content/curated_images/pour@2x.jpg differ
diff --git a/content/curated_images/random.jpg b/content/curated_images/random.jpg
new file mode 100644
index 000000000..8585738d9
Binary files /dev/null and b/content/curated_images/random.jpg differ
diff --git a/content/curated_images/random@2x.jpg b/content/curated_images/random@2x.jpg
new file mode 100644
index 000000000..fa423c542
Binary files /dev/null and b/content/curated_images/random@2x.jpg differ
diff --git a/content/curated_images/terrapattern.jpg b/content/curated_images/terrapattern.jpg
new file mode 100644
index 000000000..0db5a3f80
Binary files /dev/null and b/content/curated_images/terrapattern.jpg differ
diff --git a/content/curated_images/terrapattern@2x.jpg b/content/curated_images/terrapattern@2x.jpg
new file mode 100644
index 000000000..fe130d3a7
Binary files /dev/null and b/content/curated_images/terrapattern@2x.jpg differ
diff --git a/content/curated_images/volume.jpg b/content/curated_images/volume.jpg
new file mode 100644
index 000000000..1233bc741
Binary files /dev/null and b/content/curated_images/volume.jpg differ
diff --git a/content/curated_images/volume@2x.jpg b/content/curated_images/volume@2x.jpg
new file mode 100644
index 000000000..ddd536094
Binary files /dev/null and b/content/curated_images/volume@2x.jpg differ
diff --git a/content/examples/Basics/Arrays/Array/Array.pde b/content/examples/Basics/Arrays/Array/Array.pde
index 1fd43308e..57f4ce959 100644
--- a/content/examples/Basics/Arrays/Array/Array.pde
+++ b/content/examples/Basics/Arrays/Array/Array.pde
@@ -5,7 +5,7 @@
* is identified by an index number representing its position in
* the array. Arrays are zero based, which means that the first
* element in the array is [0], the second element is [1], and so on.
- * In this example, an array named "coswav" is created and
+ * In this example, an array named "coswave" is created and
* filled with the cosine values. This data is displayed three
* separate ways on the screen.
*/
@@ -47,4 +47,4 @@ void draw() {
line(i, y1, i, y2);
}
-}
\ No newline at end of file
+}
diff --git a/content/examples/Basics/Color/Brightness/Brightness.pde b/content/examples/Basics/Color/Brightness/Brightness.pde
index 261fdce38..7f0e4093a 100644
--- a/content/examples/Basics/Color/Brightness/Brightness.pde
+++ b/content/examples/Basics/Color/Brightness/Brightness.pde
@@ -11,7 +11,7 @@ int lastBar = -1;
void setup() {
size(640, 360);
- colorMode(HSB, width, 100, width);
+ colorMode(HSB, width, 100, height);
noStroke();
background(0);
}
diff --git a/content/examples/Basics/Color/RadialGradient/RadialGradient.pde b/content/examples/Basics/Color/RadialGradient/RadialGradient.pde
index ed358a1e5..62df103d8 100644
--- a/content/examples/Basics/Color/RadialGradient/RadialGradient.pde
+++ b/content/examples/Basics/Color/RadialGradient/RadialGradient.pde
@@ -1,7 +1,7 @@
/**
* Radial Gradient.
*
- * Draws are series of concentric circles to create a gradient
+ * Draws a series of concentric circles to create a gradient
* from one color to another.
*/
diff --git a/content/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde b/content/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde
index 1c2a398c9..ee7e74daf 100644
--- a/content/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde
+++ b/content/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde
@@ -16,7 +16,7 @@ textFont(createFont("SourceCodePro-Regular.ttf",24));
char c; // Chars are used for storing alphanumeric symbols
float f; // Floats are decimal numbers
int i; // Integers are values between 2,147,483,647 and -2147483648
-byte b; // Bytes are values between -128 and 128
+byte b; // Bytes are values between -128 and 127
c = 'A';
f = float(c); // Sets f = 65.0
diff --git a/content/examples/Basics/Form/PieChart/PieChart.pde b/content/examples/Basics/Form/PieChart/PieChart.pde
index 915a1ef7e..0dd505e0e 100644
--- a/content/examples/Basics/Form/PieChart/PieChart.pde
+++ b/content/examples/Basics/Form/PieChart/PieChart.pde
@@ -23,8 +23,8 @@ void pieChart(float diameter, int[] data) {
for (int i = 0; i < data.length; i++) {
float gray = map(i, 0, data.length, 0, 255);
fill(gray);
- arc(width/2, height/2, diameter, diameter, lastAngle, lastAngle+radians(angles[i]));
- lastAngle += radians(angles[i]);
+ arc(width/2, height/2, diameter, diameter, lastAngle, lastAngle+radians(data[i]));
+ lastAngle += radians(data[i]);
}
}
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/Input/KeyboardFunctions/KeyboardFunctions.pde b/content/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde
index f29106535..7e70c2f0b 100644
--- a/content/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde
+++ b/content/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde
@@ -27,7 +27,7 @@ void setup() {
noStroke();
colorMode(HSB, numChars);
background(numChars/2);
- // Set a gray value for each key
+ // Set a hue value for each key
for(int i = 0; i < numChars; i++) {
colors[i] = color(i, numChars, numChars);
}
@@ -58,11 +58,11 @@ void keyPressed()
if(key <= 'Z') {
keyIndex = key-'A';
letterHeight = maxHeight;
- fill(colors[key-'A']);
+ fill(colors[keyIndex]);
} else {
keyIndex = key-'a';
letterHeight = minHeight;
- fill(colors[key-'a']);
+ fill(colors[keyIndex]);
}
} else {
fill(0);
@@ -84,4 +84,4 @@ void keyPressed()
if( y > height - letterHeight) {
y = 0; // reset y to 0
}
-}
\ No newline at end of file
+}
diff --git a/content/examples/Basics/Input/MouseSignals/MouseSignals.pde b/content/examples/Basics/Input/MouseSignals/MouseSignals.pde
index c4776751d..32824354d 100644
--- a/content/examples/Basics/Input/MouseSignals/MouseSignals.pde
+++ b/content/examples/Basics/Input/MouseSignals/MouseSignals.pde
@@ -11,8 +11,7 @@ int[] xvals;
int[] yvals;
int[] bvals;
-void setup()
-{
+void setup() {
size(640, 360);
noSmooth();
xvals = new int[width];
@@ -22,11 +21,10 @@ void setup()
int arrayindex = 0;
-void draw()
-{
+void draw() {
background(102);
- for(int i = 1; i < width; i++) {
+ for (int i = 1; i < width; i++) {
xvals[i-1] = xvals[i];
yvals[i-1] = yvals[i];
bvals[i-1] = bvals[i];
@@ -34,22 +32,28 @@ void draw()
// Add the new values to the end of the array
xvals[width-1] = mouseX;
yvals[width-1] = mouseY;
- if(mousePressed) {
+
+ if (mousePressed == true) {
bvals[width-1] = 0;
} else {
- bvals[width-1] = 255;
+ bvals[width-1] = height/3;
}
fill(255);
noStroke();
rect(0, height/3, width, height/3+1);
- for(int i=1; i allFiles = listFilesRecursive(path);
-
- for (File f: allFiles) {
+
+ for (File f : allFiles) {
println("Name: " + f.getName());
println("Full path: " + f.getAbsolutePath());
println("Is directory: " + f.isDirectory());
@@ -52,7 +53,6 @@ void setup() {
// Nothing is drawn in this program and the draw() doesn't loop because
// of the noLoop() in setup()
void draw() {
-
}
// This function returns all the files in a directory as an array of Strings
@@ -82,9 +82,9 @@ File[] listFiles(String dir) {
// Function to get a list of all files in a directory and all subdirectories
ArrayList listFilesRecursive(String dir) {
- ArrayList fileList = new ArrayList();
- recurseDir(fileList,dir);
- return fileList;
+ ArrayList fileList = new ArrayList();
+ recurseDir(fileList, dir);
+ return fileList;
}
// Recursive function to traverse subdirectories
@@ -96,9 +96,9 @@ void recurseDir(ArrayList a, String dir) {
File[] subfiles = file.listFiles();
for (int i = 0; i < subfiles.length; i++) {
// Call this function on all files in this directory
- recurseDir(a,subfiles[i].getAbsolutePath());
+ recurseDir(a, subfiles[i].getAbsolutePath());
}
} else {
a.add(file);
}
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/File IO/SaveFile1/SaveFile1.pde b/content/examples/Topics/File IO/SaveFile1/SaveFile1.pde
index 9bcdbec18..510bdb8de 100644
--- a/content/examples/Topics/File IO/SaveFile1/SaveFile1.pde
+++ b/content/examples/Topics/File IO/SaveFile1/SaveFile1.pde
@@ -4,8 +4,7 @@
* Saving files is a useful way to store data so it can be viewed after a
* program has stopped running. The saveStrings() function writes an array
* of strings to a file, with each string written to a new line. This file
- * is saved to the sketch's folder. This example won't work in a web browser
- * because of Java security restrictions.
+ * is saved to the sketch's folder.
*/
int[] x = new int[0];
diff --git a/content/examples/Topics/File IO/SaveFile2/SaveFile2.pde b/content/examples/Topics/File IO/SaveFile2/SaveFile2.pde
index f47265063..6a41c58f1 100644
--- a/content/examples/Topics/File IO/SaveFile2/SaveFile2.pde
+++ b/content/examples/Topics/File IO/SaveFile2/SaveFile2.pde
@@ -3,8 +3,7 @@
*
* This file a PrintWriter object to write data continuously to a file
* while the mouse is pressed. When a key is pressed, the file closes
- * itself and the program is stopped. This example won't work in a web browser
- * because of Java security restrictions.
+ * itself and the program is stopped.
*/
PrintWriter output;
diff --git a/content/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde b/content/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde
index 1c82c6ca4..58a3b3d01 100644
--- a/content/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde
+++ b/content/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde
@@ -1,7 +1,8 @@
/**
* The Mandelbrot Set
* by Daniel Shiffman.
- *
+ * (slight modification by l8l)
+ *
* Simple rendering of the Mandelbrot set.
*/
@@ -13,7 +14,7 @@ background(255);
// A different range will allow us to "zoom" in or out on the fractal
// It all starts with the width, try higher or lower values
-float w = 5;
+float w = 4;
float h = (w * height) / width;
// Start at negative half the width and height
@@ -43,21 +44,30 @@ for (int j = 0; j < height; j++) {
float x = xmin;
for (int i = 0; i < width; i++) {
- // Now we test, as we iterate z = z^2 + cm does z tend towards infinity?
+ // Now we test, as we iterate z = z^2 + c does z tend towards infinity?
float a = x;
float b = y;
int n = 0;
+ float max = 4.0; // Infinity in our finite world is simple, let's just consider it 4
+ float absOld = 0.0;
+ float convergeNumber = maxiterations; // this will change if the while loop breaks due to non-convergence
while (n < maxiterations) {
+ // We suppose z = a+ib
float aa = a * a;
float bb = b * b;
- float twoab = 2.0 * a * b;
- a = aa - bb + x;
- b = twoab + y;
- // Infinty in our finite world is simple, let's just consider it 16
- if (aa + bb > 16.0) {
+ float abs = sqrt(aa + bb);
+ if (abs > max) { // |z| = sqrt(a^2+b^2)
+ // Now measure how much we exceeded the maximum:
+ float diffToLast = (float) (abs - absOld);
+ float diffToMax = (float) (max - absOld);
+ convergeNumber = n + diffToMax/diffToLast;
break; // Bail
}
+ float twoab = 2.0 * a * b;
+ a = aa - bb + x; // this operation corresponds to z -> z^2+c where z=a+ib c=(x,y)
+ b = twoab + y;
n++;
+ absOld = abs;
}
// We color each pixel based on how long it takes to get to infinity
@@ -66,7 +76,8 @@ for (int j = 0; j < height; j++) {
pixels[i+j*width] = color(0);
} else {
// Gosh, we could make fancy colors here if we wanted
- pixels[i+j*width] = color(n*16 % 255);
+ float norm = map(convergeNumber, 0, maxiterations, 0, 1);
+ pixels[i+j*width] = color(map(sqrt(norm), 0, 1, 0, 255));
}
x += dx;
}
diff --git a/content/examples/Topics/GUI/Button/Button.pde b/content/examples/Topics/GUI/Button/Button.pde
index 4b8a536cc..041bb594d 100644
--- a/content/examples/Topics/GUI/Button/Button.pde
+++ b/content/examples/Topics/GUI/Button/Button.pde
@@ -1,7 +1,7 @@
/**
* Button.
*
- * Click on one of the colored squares in the
+ * Click on one of the colored shapes in the
* center of the image to change the color of
* the background.
*/
diff --git a/content/examples/Topics/Motion/CircleCollision/Ball.pde b/content/examples/Topics/Motion/CircleCollision/Ball.pde
index 7cb12eb8c..a3618b3e2 100644
--- a/content/examples/Topics/Motion/CircleCollision/Ball.pde
+++ b/content/examples/Topics/Motion/CircleCollision/Ball.pde
@@ -2,14 +2,14 @@ class Ball {
PVector position;
PVector velocity;
- float r, m;
+ float radius, m;
Ball(float x, float y, float r_) {
position = new PVector(x, y);
velocity = PVector.random2D();
velocity.mult(3);
- r = r_;
- m = r*.1;
+ radius = r_;
+ m = radius*.1;
}
void update() {
@@ -17,35 +17,41 @@ class Ball {
}
void checkBoundaryCollision() {
- if (position.x > width-r) {
- position.x = width-r;
+ if (position.x > width-radius) {
+ position.x = width-radius;
velocity.x *= -1;
- }
- else if (position.x < r) {
- position.x = r;
+ } else if (position.x < radius) {
+ position.x = radius;
velocity.x *= -1;
- }
- else if (position.y > height-r) {
- position.y = height-r;
+ } else if (position.y > height-radius) {
+ position.y = height-radius;
velocity.y *= -1;
- }
- else if (position.y < r) {
- position.y = r;
+ } else if (position.y < radius) {
+ position.y = radius;
velocity.y *= -1;
}
}
void checkCollision(Ball other) {
- // get distances between the balls components
- PVector bVect = PVector.sub(other.position, position);
+ // Get distances between the balls components
+ PVector distanceVect = PVector.sub(other.position, position);
- // calculate magnitude of the vector separating the balls
- float bVectMag = bVect.mag();
+ // Calculate magnitude of the vector separating the balls
+ float distanceVectMag = distanceVect.mag();
- if (bVectMag < r + other.r) {
- // get angle of bVect
- float theta = bVect.heading();
+ // Minimum distance before they are touching
+ float minDistance = radius + other.radius;
+
+ if (distanceVectMag < minDistance) {
+ float distanceCorrection = (minDistance-distanceVectMag)/2.0;
+ PVector d = distanceVect.copy();
+ PVector correctionVector = d.normalize().mult(distanceCorrection);
+ other.position.add(correctionVector);
+ position.sub(correctionVector);
+
+ // get angle of distanceVect
+ float theta = distanceVect.heading();
// precalculate trig values
float sine = sin(theta);
float cosine = cos(theta);
@@ -54,23 +60,23 @@ class Ball {
just need to worry about bTemp[1] position*/
PVector[] bTemp = {
new PVector(), new PVector()
- };
+ };
- /* this ball's position is relative to the other
- so you can use the vector between them (bVect) as the
- reference point in the rotation expressions.
- bTemp[0].position.x and bTemp[0].position.y will initialize
- automatically to 0.0, which is what you want
- since b[1] will rotate around b[0] */
- bTemp[1].x = cosine * bVect.x + sine * bVect.y;
- bTemp[1].y = cosine * bVect.y - sine * bVect.x;
+ /* this ball's position is relative to the other
+ so you can use the vector between them (bVect) as the
+ reference point in the rotation expressions.
+ bTemp[0].position.x and bTemp[0].position.y will initialize
+ automatically to 0.0, which is what you want
+ since b[1] will rotate around b[0] */
+ bTemp[1].x = cosine * distanceVect.x + sine * distanceVect.y;
+ bTemp[1].y = cosine * distanceVect.y - sine * distanceVect.x;
// rotate Temporary velocities
PVector[] vTemp = {
new PVector(), new PVector()
- };
+ };
- vTemp[0].x = cosine * velocity.x + sine * velocity.y;
+ vTemp[0].x = cosine * velocity.x + sine * velocity.y;
vTemp[0].y = cosine * velocity.y - sine * velocity.x;
vTemp[1].x = cosine * other.velocity.x + sine * other.velocity.y;
vTemp[1].y = cosine * other.velocity.y - sine * other.velocity.x;
@@ -80,7 +86,7 @@ class Ball {
the final velocity along the x-axis. */
PVector[] vFinal = {
new PVector(), new PVector()
- };
+ };
// final rotated velocity for b[0]
vFinal[0].x = ((m - other.m) * vTemp[0].x + 2 * other.m * vTemp[1].x) / (m + other.m);
@@ -100,7 +106,7 @@ class Ball {
// rotate balls
PVector[] bFinal = {
new PVector(), new PVector()
- };
+ };
bFinal[0].x = cosine * bTemp[0].x - sine * bTemp[0].y;
bFinal[0].y = cosine * bTemp[0].y + sine * bTemp[0].x;
@@ -121,11 +127,9 @@ class Ball {
}
}
-
void display() {
noStroke();
fill(204);
- ellipse(position.x, position.y, r*2, r*2);
+ ellipse(position.x, position.y, radius*2, radius*2);
}
-}
-
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Shaders/DomeProjection/DomeProjection.pde b/content/examples/Topics/Shaders/DomeProjection/DomeProjection.pde
index 2c39c08cc..863133e49 100644
--- a/content/examples/Topics/Shaders/DomeProjection/DomeProjection.pde
+++ b/content/examples/Topics/Shaders/DomeProjection/DomeProjection.pde
@@ -6,6 +6,8 @@
*
* Based on the FullDomeTemplate code from Christopher Warnow:
* https://github.com/mphasize/FullDome
+ *
+ * Note: This example needs desktop-class graphics to function.
*
*/
diff --git a/content/examples/Topics/Shaders/InfiniteTiles/InfiniteTiles.pde b/content/examples/Topics/Shaders/InfiniteTiles/InfiniteTiles.pde
new file mode 100644
index 000000000..ae0af484f
--- /dev/null
+++ b/content/examples/Topics/Shaders/InfiniteTiles/InfiniteTiles.pde
@@ -0,0 +1,26 @@
+//-------------------------------------------------------------
+// Display endless moving background using a tile texture.
+// Contributed by martiSteiger
+//-------------------------------------------------------------
+
+PImage tileTexture;
+PShader tileShader;
+
+void setup() {
+ size(640, 480, P2D);
+ textureWrap(REPEAT);
+ tileTexture = loadImage("penrose.jpg");
+ loadTileShader();
+}
+
+void loadTileShader() {
+ tileShader = loadShader("scroller.glsl");
+ tileShader.set("resolution", float(width), float(height));
+ tileShader.set("tileImage", tileTexture);
+}
+
+void draw() {
+ tileShader.set("time", millis() / 1000.0);
+ shader(tileShader);
+ rect(0, 0, width, height);
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Shaders/InfiniteTiles/data/penrose.jpg b/content/examples/Topics/Shaders/InfiniteTiles/data/penrose.jpg
new file mode 100644
index 000000000..94e10607f
Binary files /dev/null and b/content/examples/Topics/Shaders/InfiniteTiles/data/penrose.jpg differ
diff --git a/content/examples/Topics/Shaders/InfiniteTiles/data/scroller.glsl b/content/examples/Topics/Shaders/InfiniteTiles/data/scroller.glsl
new file mode 100644
index 000000000..0717bea3c
--- /dev/null
+++ b/content/examples/Topics/Shaders/InfiniteTiles/data/scroller.glsl
@@ -0,0 +1,17 @@
+//---------------------------------------------------------
+// Display endless moving background using a tile texture.
+// Contributed by martiSteiger
+//---------------------------------------------------------
+
+uniform float time;
+uniform vec2 resolution;
+uniform sampler2D tileImage;
+
+#define TILES_COUNT_X 4.0
+
+void main() {
+ vec2 pos = gl_FragCoord.xy - vec2(4.0 * time);
+ vec2 p = (resolution - TILES_COUNT_X * pos) / resolution.x;
+ vec3 col = texture2D (tileImage, p).xyz;
+ gl_FragColor = vec4 (col, 1.0);
+}
\ No newline at end of file
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/Flocking/Boid.pde b/content/examples/Topics/Simulate/Flocking/Boid.pde
index a7f425451..fbcc177c5 100644
--- a/content/examples/Topics/Simulate/Flocking/Boid.pde
+++ b/content/examples/Topics/Simulate/Flocking/Boid.pde
@@ -2,7 +2,7 @@
class Boid {
- PVector location;
+ PVector position;
PVector velocity;
PVector acceleration;
float r;
@@ -19,7 +19,7 @@ class Boid {
float angle = random(TWO_PI);
velocity = new PVector(cos(angle), sin(angle));
- location = new PVector(x, y);
+ position = new PVector(x, y);
r = 2.0;
maxspeed = 2;
maxforce = 0.03;
@@ -52,13 +52,13 @@ class Boid {
applyForce(coh);
}
- // Method to update location
+ // Method to update position
void update() {
// Update velocity
velocity.add(acceleration);
// Limit speed
velocity.limit(maxspeed);
- location.add(velocity);
+ position.add(velocity);
// Reset accelertion to 0 each cycle
acceleration.mult(0);
}
@@ -66,7 +66,7 @@ class Boid {
// A method that calculates and applies a steering force towards a target
// STEER = DESIRED MINUS VELOCITY
PVector seek(PVector target) {
- PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target
+ PVector desired = PVector.sub(target, position); // A vector pointing from the position to the target
// Scale to maximum speed
desired.normalize();
desired.mult(maxspeed);
@@ -89,7 +89,7 @@ class Boid {
fill(200, 100);
stroke(255);
pushMatrix();
- translate(location.x, location.y);
+ translate(position.x, position.y);
rotate(theta);
beginShape(TRIANGLES);
vertex(0, -r*2);
@@ -101,10 +101,10 @@ class Boid {
// Wraparound
void borders() {
- if (location.x < -r) location.x = width+r;
- if (location.y < -r) location.y = height+r;
- if (location.x > width+r) location.x = -r;
- if (location.y > height+r) location.y = -r;
+ if (position.x < -r) position.x = width+r;
+ if (position.y < -r) position.y = height+r;
+ if (position.x > width+r) position.x = -r;
+ if (position.y > height+r) position.y = -r;
}
// Separation
@@ -115,11 +115,11 @@ class Boid {
int count = 0;
// For every boid in the system, check if it's too close
for (Boid other : boids) {
- float d = PVector.dist(location, other.location);
+ float d = PVector.dist(position, other.position);
// If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)
if ((d > 0) && (d < desiredseparation)) {
// Calculate vector pointing away from neighbor
- PVector diff = PVector.sub(location, other.location);
+ PVector diff = PVector.sub(position, other.position);
diff.normalize();
diff.div(d); // Weight by distance
steer.add(diff);
@@ -153,7 +153,7 @@ class Boid {
PVector sum = new PVector(0, 0);
int count = 0;
for (Boid other : boids) {
- float d = PVector.dist(location, other.location);
+ float d = PVector.dist(position, other.position);
if ((d > 0) && (d < neighbordist)) {
sum.add(other.velocity);
count++;
@@ -178,21 +178,21 @@ class Boid {
}
// Cohesion
- // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location
+ // For the average position (i.e. center) of all nearby boids, calculate steering vector towards that position
PVector cohesion (ArrayList boids) {
float neighbordist = 50;
- PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all locations
+ PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all positions
int count = 0;
for (Boid other : boids) {
- float d = PVector.dist(location, other.location);
+ float d = PVector.dist(position, other.position);
if ((d > 0) && (d < neighbordist)) {
- sum.add(other.location); // Add location
+ sum.add(other.position); // Add position
count++;
}
}
if (count > 0) {
sum.div(count);
- return seek(sum); // Steer towards the location
+ return seek(sum); // Steer towards the position
}
else {
return new PVector(0, 0);
diff --git a/content/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde b/content/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde
index 12d2588b1..46b268189 100644
--- a/content/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde
+++ b/content/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde
@@ -27,12 +27,12 @@ void setup() {
void draw() {
background(0);
-
+
// Draw water
liquid.display();
for (Mover mover : movers) {
-
+
// Is the Mover in the liquid?
if (liquid.contains(mover)) {
// Calculate drag force
@@ -45,16 +45,15 @@ void draw() {
PVector gravity = new PVector(0, 0.1*mover.mass);
// Apply gravity
mover.applyForce(gravity);
-
+
// Update and display
mover.update();
mover.display();
mover.checkEdges();
}
-
+
fill(255);
- text("click mouse to reset",10,30);
-
+ text("click mouse to reset", 10, 30);
}
void mousePressed() {
@@ -66,4 +65,4 @@ void reset() {
for (int i = 0; i < movers.length; i++) {
movers[i] = new Mover(random(0.5, 3), 40+i*70, 0);
}
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde b/content/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde
index c7d4652fe..2f5b93bc4 100644
--- a/content/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde
+++ b/content/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde
@@ -6,13 +6,13 @@
* Bodies experience gravity continuously
* Bodies experience fluid resistance when in "water"
*/
-
- // Liquid class
- class Liquid {
-
+// Liquid class
+class Liquid {
+
+
// Liquid is a rectangle
- float x,y,w,h;
+ float x, y, w, h;
// Coefficient of drag
float c;
@@ -23,18 +23,17 @@
h = h_;
c = c_;
}
-
+
// Is the Mover in the Liquid?
boolean contains(Mover m) {
- PVector l = m.location;
+ PVector l = m.position;
if (l.x > x && l.x < x + w && l.y > y && l.y < y + h) {
return true;
- }
- else {
+ } else {
return false;
}
}
-
+
// Calculate drag force
PVector drag(Mover m) {
// Magnitude is coefficient * speed squared
@@ -44,16 +43,15 @@
// Direction is inverse of velocity
PVector drag = m.velocity.copy();
drag.mult(-1);
-
+
// Scale according to magnitude
drag.setMag(dragMagnitude);
return drag;
}
-
+
void display() {
noStroke();
fill(127);
- rect(x,y,w,h);
+ rect(x, y, w, h);
}
-
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/ForcesWithVectors/Mover.pde b/content/examples/Topics/Simulate/ForcesWithVectors/Mover.pde
index b14754b71..2dd51116c 100644
--- a/content/examples/Topics/Simulate/ForcesWithVectors/Mover.pde
+++ b/content/examples/Topics/Simulate/ForcesWithVectors/Mover.pde
@@ -10,17 +10,17 @@
class Mover {
- // location, velocity, and acceleration
- PVector location;
+ // position, velocity, and acceleration
+ PVector position;
PVector velocity;
PVector acceleration;
-
+
// Mass is tied to size
float mass;
Mover(float m, float x, float y) {
mass = m;
- location = new PVector(x, y);
+ position = new PVector(x, y);
velocity = new PVector(0, 0);
acceleration = new PVector(0, 0);
}
@@ -35,30 +35,28 @@ class Mover {
}
void update() {
-
+
// Velocity changes according to acceleration
velocity.add(acceleration);
- // Location changes by velocity
- location.add(velocity);
+ // position changes by velocity
+ position.add(velocity);
// We must clear acceleration each frame
acceleration.mult(0);
}
-
+
// Draw Mover
void display() {
stroke(255);
strokeWeight(2);
fill(255, 200);
- ellipse(location.x, location.y, mass*16, mass*16);
+ ellipse(position.x, position.y, mass*16, mass*16);
}
-
+
// Bounce off bottom of window
void checkEdges() {
- if (location.y > height) {
+ if (position.y > height) {
velocity.y *= -0.9; // A little dampening when hitting the bottom
- location.y = height;
+ position.y = height;
}
}
-}
-
-
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde b/content/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde
index ae8be2537..ec93bde8d 100644
--- a/content/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde
+++ b/content/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde
@@ -4,30 +4,30 @@
// A class for an orbiting Planet
class Planet {
-
- // Basic physics model (location, velocity, acceleration, mass)
- PVector location;
+
+ // Basic physics model (position, velocity, acceleration, mass)
+ PVector position;
PVector velocity;
PVector acceleration;
float mass;
Planet(float m, float x, float y, float z) {
mass = m;
- location = new PVector(x,y,z);
- velocity = new PVector(1,0); // Arbitrary starting velocity
- acceleration = new PVector(0,0);
+ position = new PVector(x, y, z);
+ velocity = new PVector(1, 0); // Arbitrary starting velocity
+ acceleration = new PVector(0, 0);
}
-
+
// Newton's 2nd Law (F = M*A) applied
void applyForce(PVector force) {
- PVector f = PVector.div(force,mass);
+ PVector f = PVector.div(force, mass);
acceleration.add(f);
}
// Our motion algorithm (aka Euler Integration)
void update() {
velocity.add(acceleration); // Velocity changes according to acceleration
- location.add(velocity); // Location changes according to velocity
+ position.add(velocity); // position changes according to velocity
acceleration.mult(0);
}
@@ -36,10 +36,8 @@ class Planet {
noStroke();
fill(255);
pushMatrix();
- translate(location.x,location.y,location.z);
+ translate(position.x, position.y, position.z);
sphere(mass*8);
popMatrix();
}
-}
-
-
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde b/content/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde
index 10fcc0373..b8ea25956 100644
--- a/content/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde
+++ b/content/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde
@@ -5,20 +5,20 @@
class Sun {
float mass; // Mass, tied to size
- PVector location; // Location
+ PVector position; // position
float G; // Universal gravitational constant (arbitrary value)
Sun() {
- location = new PVector(0,0);
+ position = new PVector(0, 0);
mass = 20;
G = 0.4;
}
PVector attract(Planet m) {
- PVector force = PVector.sub(location,m.location); // Calculate direction of force
+ PVector force = PVector.sub(position, m.position); // Calculate direction of force
float d = force.mag(); // Distance between objects
- d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects
+ d = constrain(d, 5.0, 25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects
float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude
force.setMag(strength); // Get force vector --> magnitude * direction
return force;
@@ -29,10 +29,8 @@ class Sun {
stroke(255);
noFill();
pushMatrix();
- translate(location.x,location.y,location.z);
+ translate(position.x, position.y, position.z);
sphere(mass*2);
popMatrix();
}
-}
-
-
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde b/content/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde
index 9c77dc6e3..f18d04ee6 100644
--- a/content/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde
+++ b/content/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde
@@ -30,11 +30,10 @@ class CrazyParticle extends Particle {
super.display();
// Then add a rotating line
pushMatrix();
- translate(location.x,location.y);
+ translate(position.x, position.y);
rotate(theta);
- stroke(255,lifespan);
- line(0,0,25,0);
+ stroke(255, lifespan);
+ line(0, 0, 25, 0);
popMatrix();
}
-
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde b/content/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde
index 5bc038e7d..605f1a9d5 100644
--- a/content/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde
+++ b/content/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde
@@ -3,7 +3,7 @@
* by Daniel Shiffman.
*
* Click the mouse to generate a burst of particles
- * at mouse location.
+ * at mouse position.
*
* Each burst is one instance of a particle system
* with Particles and CrazyParticles (a subclass of Particle)
@@ -19,7 +19,7 @@ void setup() {
void draw() {
background(0);
- for (ParticleSystem ps: systems) {
+ for (ParticleSystem ps : systems) {
ps.run();
ps.addParticle();
}
@@ -32,4 +32,4 @@ void draw() {
void mousePressed() {
systems.add(new ParticleSystem(1, new PVector(mouseX, mouseY)));
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde b/content/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde
index 078ef23c5..a3d0b8780 100644
--- a/content/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde
+++ b/content/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde
@@ -1,15 +1,15 @@
// A simple Particle class
class Particle {
- PVector location;
+ PVector position;
PVector velocity;
PVector acceleration;
float lifespan;
Particle(PVector l) {
- acceleration = new PVector(0,0.05);
- velocity = new PVector(random(-1,1),random(-2,0));
- location = l.get();
+ acceleration = new PVector(0, 0.05);
+ velocity = new PVector(random(-1, 1), random(-2, 0));
+ position = l.copy();
lifespan = 255.0;
}
@@ -18,23 +18,22 @@ class Particle {
display();
}
- // Method to update location
+ // Method to update position
void update() {
velocity.add(acceleration);
- location.add(velocity);
+ position.add(velocity);
lifespan -= 2.0;
}
// Method to display
void display() {
- stroke(255,lifespan);
- fill(255,lifespan);
- ellipse(location.x,location.y,8,8);
+ stroke(255, lifespan);
+ fill(255, lifespan);
+ ellipse(position.x, position.y, 8, 8);
}
// Is the particle still useful?
boolean isDead() {
return (lifespan < 0.0);
}
-
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde b/content/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde
index e4deac945..8db8462ed 100644
--- a/content/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde
+++ b/content/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde
@@ -7,7 +7,7 @@ class ParticleSystem {
ParticleSystem(int num, PVector v) {
particles = new ArrayList(); // Initialize the arraylist
- origin = v.get(); // Store the origin point
+ origin = v.copy(); // Store the origin point
for (int i = 0; i < num; i++) {
particles.add(new Particle(origin)); // Add "num" amount of particles to the arraylist
}
diff --git a/content/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde b/content/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde
index b6fa0c02d..6d949c725 100644
--- a/content/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde
+++ b/content/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde
@@ -1,15 +1,15 @@
// A simple Particle class
class Particle {
- PVector location;
+ PVector position;
PVector velocity;
PVector acceleration;
float lifespan;
Particle(PVector l) {
- acceleration = new PVector(0,0.05);
- velocity = new PVector(random(-1,1),random(-2,0));
- location = l.get();
+ acceleration = new PVector(0, 0.05);
+ velocity = new PVector(random(-1, 1), random(-2, 0));
+ position = l.copy();
lifespan = 255.0;
}
@@ -18,20 +18,20 @@ class Particle {
display();
}
- // Method to update location
+ // Method to update position
void update() {
velocity.add(acceleration);
- location.add(velocity);
+ position.add(velocity);
lifespan -= 1.0;
}
// Method to display
void display() {
- stroke(255,lifespan);
- fill(255,lifespan);
- ellipse(location.x,location.y,8,8);
+ stroke(255, lifespan);
+ fill(255, lifespan);
+ ellipse(position.x, position.y, 8, 8);
}
-
+
// Is the particle still useful?
boolean isDead() {
if (lifespan < 0.0) {
@@ -40,4 +40,4 @@ class Particle {
return false;
}
}
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde b/content/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde
index bd5937e77..94a528abf 100644
--- a/content/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde
+++ b/content/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde
@@ -5,8 +5,8 @@ class ParticleSystem {
ArrayList particles;
PVector origin;
- ParticleSystem(PVector location) {
- origin = location.get();
+ ParticleSystem(PVector position) {
+ origin = position.copy();
particles = new ArrayList();
}
@@ -23,4 +23,4 @@ class ParticleSystem {
}
}
}
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde b/content/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde
index 9b46822f1..e198edbac 100644
--- a/content/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde
+++ b/content/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde
@@ -7,18 +7,16 @@
* A ParticleSystem object manages a variable size (ArrayList)
* list of particles.
*/
-
+
ParticleSystem ps;
void setup() {
- size(640,360);
- ps = new ParticleSystem(new PVector(width/2,50));
+ size(640, 360);
+ ps = new ParticleSystem(new PVector(width/2, 50));
}
void draw() {
background(0);
ps.addParticle();
ps.run();
-}
-
-
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde b/content/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde
index 40b980ffa..a0948b478 100644
--- a/content/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde
+++ b/content/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde
@@ -8,12 +8,12 @@ class Particle {
float lifespan;
PImage img;
- Particle(PVector l,PImage img_) {
- acc = new PVector(0,0);
+ Particle(PVector l, PImage img_) {
+ acc = new PVector(0, 0);
float vx = randomGaussian()*0.3;
float vy = randomGaussian()*0.3 - 1.0;
- vel = new PVector(vx,vy);
- loc = l.get();
+ vel = new PVector(vx, vy);
+ loc = l.copy();
lifespan = 100.0;
img = img_;
}
@@ -22,14 +22,14 @@ class Particle {
update();
render();
}
-
+
// Method to apply a force vector to the Particle object
// Note we are ignoring "mass" here
void applyForce(PVector f) {
acc.add(f);
}
- // Method to update location
+ // Method to update position
void update() {
vel.add(acc);
loc.add(vel);
@@ -40,8 +40,8 @@ class Particle {
// Method to display
void render() {
imageMode(CENTER);
- tint(255,lifespan);
- image(img,loc.x,loc.y);
+ tint(255, lifespan);
+ image(img, loc.x, loc.y);
// Drawing a circle instead
// fill(255,lifespan);
// noStroke();
@@ -56,4 +56,4 @@ class Particle {
return false;
}
}
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde b/content/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde
index 9dd4ca62a..ba77243d7 100644
--- a/content/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde
+++ b/content/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde
@@ -6,10 +6,10 @@ class ParticleSystem {
ArrayList particles; // An arraylist for all the particles
PVector origin; // An origin point for where particles are birthed
PImage img;
-
+
ParticleSystem(int num, PVector v, PImage img_) {
particles = new ArrayList(); // Initialize the arraylist
- origin = v.get(); // Store the origin point
+ origin = v.copy(); // Store the origin point
img = img_;
for (int i = 0; i < num; i++) {
particles.add(new Particle(origin, img)); // Add "num" amount of particles to the arraylist
@@ -25,18 +25,16 @@ class ParticleSystem {
}
}
}
-
+
// Method to add a force vector to all particles currently in the system
void applyForce(PVector dir) {
// Enhanced loop!!!
- for (Particle p: particles) {
+ for (Particle p : particles) {
p.applyForce(dir);
}
-
}
void addParticle() {
- particles.add(new Particle(origin,img));
+ particles.add(new Particle(origin, img));
}
-
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde b/content/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde
index 32683de91..3b1e51fec 100644
--- a/content/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde
+++ b/content/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde
@@ -9,17 +9,17 @@
ParticleSystem ps;
void setup() {
- size(640,360);
+ size(640, 360);
PImage img = loadImage("texture.png");
- ps = new ParticleSystem(0,new PVector(width/2,height-60),img);
+ ps = new ParticleSystem(0, new PVector(width/2, height-60), img);
}
void draw() {
background(0);
// Calculate a "wind" force based on mouse horizontal position
- float dx = map(mouseX,0,width,-0.2,0.2);
- PVector wind = new PVector(dx,0);
+ float dx = map(mouseX, 0, width, -0.2, 0.2);
+ PVector wind = new PVector(dx, 0);
ps.applyForce(wind);
ps.run();
for (int i = 0; i < 2; i++) {
@@ -27,24 +27,23 @@ void draw() {
}
// Draw an arrow representing the wind force
- drawVector(wind, new PVector(width/2,50,0),500);
-
+ drawVector(wind, new PVector(width/2, 50, 0), 500);
}
-// Renders a vector object 'v' as an arrow and a location 'loc'
+// Renders a vector object 'v' as an arrow and a position 'loc'
void drawVector(PVector v, PVector loc, float scayl) {
pushMatrix();
float arrowsize = 4;
- // Translate to location to render vector
- translate(loc.x,loc.y);
+ // Translate to position to render vector
+ translate(loc.x, loc.y);
stroke(255);
// Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate
rotate(v.heading());
// Calculate length of vector & scale it to be bigger or smaller if necessary
float len = v.mag()*scayl;
// Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction)
- line(0,0,len,0);
- line(len,0,len-arrowsize,+arrowsize/2);
- line(len,0,len-arrowsize,-arrowsize/2);
+ line(0, 0, len, 0);
+ line(len, 0, len-arrowsize, +arrowsize/2);
+ line(len, 0, len-arrowsize, -arrowsize/2);
popMatrix();
-}
+}
\ No newline at end of file
diff --git a/content/examples/Topics/Simulate/SoftBody/SoftBody.pde b/content/examples/Topics/Simulate/SoftBody/SoftBody.pde
index b0eb8f826..e3d0d266f 100644
--- a/content/examples/Topics/Simulate/SoftBody/SoftBody.pde
+++ b/content/examples/Topics/Simulate/SoftBody/SoftBody.pde
@@ -46,7 +46,7 @@ void draw() {
}
void drawShape() {
- // calculate node starting locations
+ // calculate node starting positions
for (int i=0; i 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; iIntegers and Floats
True/FalseCharacters and Strings
- Variable Scope
+ Variable ScopeDatatype Conversion
@@ -65,14 +65,14 @@
RelativityLinear GradientRadial Gradient
- Wave Gradient
+ Wave GradientIncrement/DecrementOperator PrecedenceDistance 1DDistance 2D
- Map
+ MapSineSine and CosineSine Wave
@@ -120,6 +120,7 @@
LettersWords
+ Text RotationEmbedded Links
diff --git a/content/examples_p5/Basics/Color/RadialGradient/RadialGradient.js b/content/examples_p5/Basics/Color/RadialGradient/RadialGradient.js
index f571de60b..f79678a9d 100644
--- a/content/examples_p5/Basics/Color/RadialGradient/RadialGradient.js
+++ b/content/examples_p5/Basics/Color/RadialGradient/RadialGradient.js
@@ -1,7 +1,7 @@
/**
* Radial Gradient.
*
- * Draws are series of concentric circles to create a gradient
+ * Draws a series of concentric circles to create a gradient
* from one color to another.
*/
diff --git a/content/examples_p5/Basics/Color/WaveGradient/WaveGradient.js b/content/examples_p5/Basics/Color/WaveGradient/WaveGradient.js
index faa060f3d..eb5afa1c1 100644
--- a/content/examples_p5/Basics/Color/WaveGradient/WaveGradient.js
+++ b/content/examples_p5/Basics/Color/WaveGradient/WaveGradient.js
@@ -12,16 +12,19 @@ var frequency = 0;
var fillGap = 2.5;
var c;
+var gradient;
+
function setup() {
- devicePixelScaling(false);
var canvas = createCanvas(640, 360);
+ pixelDensity(1);
canvas.parent("p5container");
background(200);
+ gradient = createImage(width, height, RGB);
noLoop();
}
function draw() {
- //loadPixels();
+ gradient.loadPixels();
for (var i =- 75; i < height+75; i++){
// Reset angle to 0, so waves stack properly
angle = 0;
@@ -30,14 +33,37 @@ function draw() {
for (var j = 0; j < width+75; j++){
py = i + sin(radians(angle)) * amplitude;
angle += frequency;
- c = color(abs(py-i)*255/amplitude, 255-abs(py-i)*255/amplitude, j*(255.0/(width+50)));
+ // c = color(abs(py-i)*255/amplitude;, 255-abs(py-i)*255/amplitude, j*(255.0/(width+50)));
+ var r = int(abs(py-i)*255/amplitude);
+ var g = int(255-abs(py-i)*255/amplitude);
+ var b = int(j*(255.0/(width+50)));
+
// Hack to fill gaps. Raise value of fillGap if you increase frequency
for (var filler = 0; filler < fillGap; filler++){
- set(int(j-filler), int(py)-filler, c);
- set(int(j), int(py), c);
- set(int(j+filler), int(py)+filler, c);
+ var x = int(j-filler);
+ var y = int(py)-filler;
+
+ var index = (x + y * width)*4;
+ gradient.pixels[index] = r; gradient.pixels[index+1] = g; gradient.pixels[index+2] = b; gradient.pixels[index+3] = 255;
+
+ x = int(j);
+ y = int(py);
+ index = (x + y * width)*4;
+ gradient.pixels[index] = r; gradient.pixels[index+1] = g; gradient.pixels[index+2] = b; gradient.pixels[index+3] = 255;
+
+ x = int(j+filler);
+ y = int(py)+filler;
+ index = (x + y * width)*4;
+ gradient.pixels[index] = r; gradient.pixels[index+1] = g; gradient.pixels[index+2] = b; gradient.pixels[index+3] = 255;
+
+ //set(int(j-filler), int(py)-filler, c);
+ //set(int(j), int(py), c);
+ //set(int(j+filler), int(py)+filler, c);
}
}
}
- updatePixels();
+ gradient.updatePixels();
+ image(gradient, 0, 0);
+ noLoop();
+ //console.log('complete');
}
diff --git a/content/examples_p5/Basics/Image/Alphamask/Alphamask.js b/content/examples_p5/Basics/Image/Alphamask/Alphamask.js
index 95e7cd8f8..c0ea76172 100644
--- a/content/examples_p5/Basics/Image/Alphamask/Alphamask.js
+++ b/content/examples_p5/Basics/Image/Alphamask/Alphamask.js
@@ -13,8 +13,8 @@ var img;
var imgMask;
function preload() {
- img = loadImage("data/moonwalk.jpg");
- imgMask = loadImage("data/mask.png");
+ img = loadImage("moonwalk.jpg");
+ imgMask = loadImage("mask.png");
}
function setup() {
diff --git a/content/examples_p5/Basics/Image/BackgroundImage/BackgroundImage.js b/content/examples_p5/Basics/Image/BackgroundImage/BackgroundImage.js
index cbe6ca44c..06e439c28 100644
--- a/content/examples_p5/Basics/Image/BackgroundImage/BackgroundImage.js
+++ b/content/examples_p5/Basics/Image/BackgroundImage/BackgroundImage.js
@@ -16,7 +16,7 @@ function preload() {
// The background image must be the same size as the parameters
// into the size() method. In this program, the size of the image
// is 640 x 360 pixels.
- bg = loadImage("data/moonwalk.jpg");
+ bg = loadImage("moonwalk.jpg");
}
function setup() {
diff --git a/content/examples_p5/Basics/Image/LoadDisplayImage/LoadDisplayImage.js b/content/examples_p5/Basics/Image/LoadDisplayImage/LoadDisplayImage.js
index 8c038b9f3..32805b06b 100644
--- a/content/examples_p5/Basics/Image/LoadDisplayImage/LoadDisplayImage.js
+++ b/content/examples_p5/Basics/Image/LoadDisplayImage/LoadDisplayImage.js
@@ -5,15 +5,12 @@
* or any other size.
*/
-// The next line is needed if running in JavaScript Mode with Processing.js
-/* @pjs preload="moonwalk.jpg"; */
-
var img; // Declare variable "a" of type PImage
function preload() {
// The image file must be in the data folder of the current sketch
// to load successfully
- img = loadImage("data/moonwalk.jpg");
+ img = loadImage("moonwalk.jpg");
}
function setup() {
@@ -26,4 +23,5 @@ function draw() {
image(img, 0, 0);
// Displays the image at point (0, height/2) at half of its size
image(img, 0, height/2, img.width/2, img.height/2);
+ noLoop();
}
diff --git a/content/examples_p5/Basics/Image/Pointillism/Pointillism.js b/content/examples_p5/Basics/Image/Pointillism/Pointillism.js
index 3c6ad8dfe..a17f0a564 100644
--- a/content/examples_p5/Basics/Image/Pointillism/Pointillism.js
+++ b/content/examples_p5/Basics/Image/Pointillism/Pointillism.js
@@ -14,7 +14,7 @@ var img;
var smallPoint, largePoint;
function preload() {
- img = loadImage("data/moonwalk.jpg");
+ img = loadImage("moonwalk.jpg");
}
@@ -33,6 +33,6 @@ function draw() {
var x = int(random(img.width));
var y = int(random(img.height));
var pix = img.get(x, y);
- fill(pix, 128);
+ fill(pix[0], pix[1], pix[2], 128);
ellipse(x, y, pointillize, pointillize);
}
diff --git a/content/examples_p5/Basics/Image/RequestImage/RequestImage.js b/content/examples_p5/Basics/Image/RequestImage/RequestImage.js
index 9103fc6cc..4e158f445 100644
--- a/content/examples_p5/Basics/Image/RequestImage/RequestImage.js
+++ b/content/examples_p5/Basics/Image/RequestImage/RequestImage.js
@@ -28,7 +28,7 @@ function setup() {
// Load images asynchronously
for (var i = 0; i < imgCount; i++){
- imageLoader("data/PT_anim"+nf(i, 4)+".gif",i);
+ imageLoader("PT_anim"+nf(i, 4)+".gif",i);
}
}
diff --git a/content/examples_p5/Basics/Image/Transparency/Transparency.js b/content/examples_p5/Basics/Image/Transparency/Transparency.js
index bbeb3a31b..0b0963e39 100644
--- a/content/examples_p5/Basics/Image/Transparency/Transparency.js
+++ b/content/examples_p5/Basics/Image/Transparency/Transparency.js
@@ -14,7 +14,7 @@ var offset = 0;
var easing = 0.05;
function preload() {
- img = loadImage("data/moonwalk.jpg"); // Load an image into the program
+ img = loadImage("moonwalk.jpg"); // Load an image into the program
}
function setup() {
diff --git a/content/examples_p5/Basics/Input/KeyboardFunctions/KeyboardFunctions.js b/content/examples_p5/Basics/Input/KeyboardFunctions/KeyboardFunctions.js
index 27a88b505..bee464c7e 100644
--- a/content/examples_p5/Basics/Input/KeyboardFunctions/KeyboardFunctions.js
+++ b/content/examples_p5/Basics/Input/KeyboardFunctions/KeyboardFunctions.js
@@ -1,8 +1,3 @@
-// Need these resolved first:
-// https://github.com/lmccart/p5.js/issues/537
-// https://github.com/lmccart/p5.js/issues/536
-
-
// /**
// * Keyboard Functions.
// * Modified from code by Martin.
@@ -14,88 +9,88 @@
// * function that is called when a key is released.
// */
-// var maxHeight = 40;
-// var minHeight = 20;
-// var letterHeight = maxHeight; // Height of the letters
-// var letterWidth = 20; // Width of the letter
+var maxHeight = 40;
+var minHeight = 20;
+var letterHeight = maxHeight; // Height of the letters
+var letterWidth = 20; // Width of the letter
-// var x = -letterWidth; // X position of the letters
-// var y = 0; // Y position of the letters
+var x = -letterWidth; // X position of the letters
+var y = 0; // Y position of the letters
-// var newletter;
+var newletter;
-// var numChars = 26; // There are 26 characters in the alphabet
-// var colors = [];
+var numChars = 26; // There are 26 characters in the alphabet
+var colors = [];
-// function setup()
-// {
-// var canvas = createCanvas(640, 360);
+function setup()
+{
+ var canvas = createCanvas(640, 360);
canvas.parent("p5container");
-// noStroke();
-// //colorMode(HSB, numChars);
-// background(numChars/2);
-// // Set a gray value for each key
-// for(var i = 0; i < numChars; i++) {
-// colors[i] = color(i, numChars, numChars);
-// }
+ noStroke();
+ colorMode(HSB, numChars);
+ background(numChars/2);
+ // Set a gray value for each key
+ for(var i = 0; i < numChars; i++) {
+ colors[i] = color(i, numChars, numChars);
+ }
-// }
+}
-// function draw()
-// {
-// if(newletter == true) {
-// // Draw the "letter"
-// var y_pos;
-// if (letterHeight == maxHeight) {
-// y_pos = y;
-// rect( x, y_pos, letterWidth, letterHeight );
-// } else {
-// y_pos = y + minHeight;
-// rect( x, y_pos, letterWidth, letterHeight );
-// fill(numChars/2);
-// rect( x, y_pos-minHeight, letterWidth, letterHeight );
-// }
-// console.log(letterWidth,letterHeight);
-// newletter = false;
-// println(letterWidth,letterHeight);
+function draw()
+{
+ if(newletter == true) {
+ // Draw the "letter"
+ var y_pos;
+ if (letterHeight == maxHeight) {
+ y_pos = y;
+ rect( x, y_pos, letterWidth, letterHeight );
+ } else {
+ y_pos = y + minHeight;
+ rect( x, y_pos, letterWidth, letterHeight );
+ fill(numChars/2);
+ rect( x, y_pos-minHeight, letterWidth, letterHeight );
+ }
+ console.log(letterWidth,letterHeight);
+ newletter = false;
+ println(letterWidth,letterHeight);
-// }
-// }
+ }
+}
-// function keyPressed() {
-// console.log(key);
-// var keyVal = key.charCodeAt(0);
-// println(keyVal);
-// // If the key is between 'A'(65) to 'Z' and 'a' to 'z'(122)
-// if((keyVal >= 'A'.charCodeAt(0) && keyVal <= 'Z'.charCodeAt(0)) || (keyVal >= 'a'.charCodeAt(0) && keyVal <= 'z'.charCodeAt(0))) {
-// var keyIndex = 0;
-// if(keyVal <= 'Z'.charCodeAt(0)) {
-// keyIndex = keyVal-'A'.charCodeAt(0);
-// letterHeight = maxHeight;
-// fill(colors[keyVal-'A'.charCodeAt(0)]);
-// } else {
-// keyIndex = keyVal-'a'.charCodeAt(0);
-// letterHeight = minHeight;
-// fill(colors[keyVal-'a'.charCodeAt(0)]);
-// }
-// } else {
-// fill(0);
-// letterHeight = 10;
-// }
+function keyTyped() {
+ console.log(key);
+ var keyVal = key.charCodeAt(0);
+ println(keyVal);
+ // If the key is between 'A'(65) to 'Z' and 'a' to 'z'(122)
+ if((keyVal >= 'A'.charCodeAt(0) && keyVal <= 'Z'.charCodeAt(0)) || (keyVal >= 'a'.charCodeAt(0) && keyVal <= 'z'.charCodeAt(0))) {
+ var keyIndex = 0;
+ if(keyVal <= 'Z'.charCodeAt(0)) {
+ keyIndex = keyVal-'A'.charCodeAt(0);
+ letterHeight = maxHeight;
+ fill(colors[keyVal-'A'.charCodeAt(0)]);
+ } else {
+ keyIndex = keyVal-'a'.charCodeAt(0);
+ letterHeight = minHeight;
+ fill(colors[keyVal-'a'.charCodeAt(0)]);
+ }
+ } else {
+ fill(0);
+ letterHeight = 10;
+ }
-// newletter = true;
+ newletter = true;
-// // Update the "letter" position
-// x = ( x + letterWidth );
+ // Update the "letter" position
+ x = ( x + letterWidth );
-// // Wrap horizontally
-// if (x > width - letterWidth) {
-// x = 0;
-// y+= maxHeight;
-// }
+ // Wrap horizontally
+ if (x > width - letterWidth) {
+ x = 0;
+ y+= maxHeight;
+ }
-// // Wrap vertically
-// if( y > height - letterHeight) {
-// y = 0; // reset y to 0
-// }
-// }
+ // Wrap vertically
+ if( y > height - letterHeight) {
+ y = 0; // reset y to 0
+ }
+}
diff --git a/content/examples_p5/Basics/Input/MouseSignals/MouseSignals.js b/content/examples_p5/Basics/Input/MouseSignals/MouseSignals.js
index b8f7941ee..43889de8d 100644
--- a/content/examples_p5/Basics/Input/MouseSignals/MouseSignals.js
+++ b/content/examples_p5/Basics/Input/MouseSignals/MouseSignals.js
@@ -51,10 +51,10 @@ function draw() {
for(var i=1; i 10) {
@@ -85,7 +86,7 @@ function mousePressed() {
}
// Writing the CSV back to the same file
- // saveTable(table, "data/data.csv");
+ // saveTable(table, "/data.csv");
// And reloading it
loadData();
}
diff --git a/content/examples_p5/Topics/Advanced Data/LoadSaveXML/LoadSaveXML.js b/content/examples_p5/Topics/Advanced Data/LoadSaveXML/LoadSaveXML.js
index 90cba56b4..92618b264 100644
--- a/content/examples_p5/Topics/Advanced Data/LoadSaveXML/LoadSaveXML.js
+++ b/content/examples_p5/Topics/Advanced Data/LoadSaveXML/LoadSaveXML.js
@@ -31,14 +31,14 @@ var bubbles = [];
var xml;
function preload() {
- xml = loadXML("data/data.xml");
+ xml = loadXML("/data.xml");
}
function setup() {
var canvas = createCanvas(640, 360);
canvas.parent("p5container");
loadData();
- loadXML("data/data.xml",test);
+ loadXML("/data.xml",test);
}
function test(xml) {
@@ -62,7 +62,7 @@ function draw() {
function loadData() {
// Load XML file
- // xml = loadXML("data.xml");
+ // xml = loadXML(".xml");
// // Get all the child nodes named "bubble"
// XML[] children = xml.getChildren("bubble");
@@ -124,7 +124,7 @@ function mousePressed() {
// }
// // Save a new XML file
- // saveXML(xml,"data/data.xml");
+ // saveXML(xml,"/data.xml");
// // reload the new data
// loadData();
diff --git a/content/examples_p5/Topics/Advanced Data/XMLYahooWeather/XMLYahooWeather.js b/content/examples_p5/Topics/Advanced Data/XMLYahooWeather/XMLYahooWeather.js
index f8d53513e..2801407f4 100644
--- a/content/examples_p5/Topics/Advanced Data/XMLYahooWeather/XMLYahooWeather.js
+++ b/content/examples_p5/Topics/Advanced Data/XMLYahooWeather/XMLYahooWeather.js
@@ -11,27 +11,29 @@
// We're going to store the temperature
var temperature = 0;
// We're going to store text about the weather
-String weather = "";
+var weather = "";
// The zip code we'll check for
-String zip = "10003";
+var zip = "10003";
-PFont font;
+var xml;
+
+function preload() {
+ var url = "http://xml.weather.yahoo.com/forecastrss?p=" + zip;
+ // Load the XML document
+ xml = loadXML(url);
+
+}
function setup() {
createCanvas(600, 360);
- font = createFont("Merriweather-Light.ttf", 28);
- textFont(font);
+ textFont("Merriweather Light", 28);
// The URL for the XML document
- String url = "http://xml.weather.yahoo.com/forecastrss?p=" + zip;
-
- // Load the XML document
- XML xml = loadXML(url);
// Grab the element we want
- XML forecast = xml.getChild("channel/item/yweather:forecast");
+ var forecast = xml.getChild("channel/item/yweather:forecast");
// Get the attributes we want
temperature = forecast.getInt("high");
diff --git a/content/examples_p5/Topics/Animation/AnimatedSprite/Animation.js b/content/examples_p5/Topics/Animation/AnimatedSprite/Animation.js
index 9eb9a3a65..bc54af5f9 100644
--- a/content/examples_p5/Topics/Animation/AnimatedSprite/Animation.js
+++ b/content/examples_p5/Topics/Animation/AnimatedSprite/Animation.js
@@ -8,7 +8,7 @@ function Animation(imagePrefix, count) {
for (var i = 0; i < this.imageCount; i++) {
// Use nf() to number format 'i' into four digits
- var filename = 'data/' + imagePrefix + nf(i, 4) + ".gif";
+ var filename = imagePrefix + nf(i, 4) + ".gif";
this.images[i] = loadImage(filename);
}
diff --git a/content/examples_p5/Topics/Animation/Sequential/Sequential.js b/content/examples_p5/Topics/Animation/Sequential/Sequential.js
index 4dbd8af13..a34076e9d 100644
--- a/content/examples_p5/Topics/Animation/Sequential/Sequential.js
+++ b/content/examples_p5/Topics/Animation/Sequential/Sequential.js
@@ -17,18 +17,18 @@ var currentFrame = 0;
var images = [];
function preload() {
- images[0] = loadImage("data/PT_anim0000.gif");
- images[1] = loadImage("data/PT_anim0001.gif");
- images[2] = loadImage("data/PT_anim0002.gif");
- images[3] = loadImage("data/PT_anim0003.gif");
- images[4] = loadImage("data/PT_anim0004.gif");
- images[5] = loadImage("data/PT_anim0005.gif");
- images[6] = loadImage("data/PT_anim0006.gif");
- images[7] = loadImage("data/PT_anim0007.gif");
- images[8] = loadImage("data/PT_anim0008.gif");
- images[9] = loadImage("data/PT_anim0009.gif");
- images[10] = loadImage("data/PT_anim0010.gif");
- images[11] = loadImage("data/PT_anim0011.gif");
+ images[0] = loadImage("PT_anim0000.gif");
+ images[1] = loadImage("PT_anim0001.gif");
+ images[2] = loadImage("PT_anim0002.gif");
+ images[3] = loadImage("PT_anim0003.gif");
+ images[4] = loadImage("PT_anim0004.gif");
+ images[5] = loadImage("PT_anim0005.gif");
+ images[6] = loadImage("PT_anim0006.gif");
+ images[7] = loadImage("PT_anim0007.gif");
+ images[8] = loadImage("PT_anim0008.gif");
+ images[9] = loadImage("PT_anim0009.gif");
+ images[10] = loadImage("PT_anim0010.gif");
+ images[11] = loadImage("PT_anim0011.gif");
// If you don't want to load each image separately
// and you know how many frames you have, you
diff --git a/content/examples_p5/Topics/Cellular Automata/GameOfLife/GameOfLife.js b/content/examples_p5/Topics/Cellular Automata/GameOfLife/GameOfLife.js
index 447dc007c..083afbba8 100644
--- a/content/examples_p5/Topics/Cellular Automata/GameOfLife/GameOfLife.js
+++ b/content/examples_p5/Topics/Cellular Automata/GameOfLife/GameOfLife.js
@@ -94,7 +94,7 @@ function draw() {
}
// Create new cells manually on pause
- if (pause && mousePressed) {
+ if (pause && mouseIsPressed) {
// Map and avoid out of bound errors
var xCellOver = int(map(mouseX, 0, width, 0, width/cellSize));
xCellOver = constrain(xCellOver, 0, width/cellSize-1);
@@ -111,7 +111,7 @@ function draw() {
fill(alive); // Fill alive color
}
}
- else if (pause && !mousePressed) { // And then save to buffer once mouse goes up
+ else if (pause && !mouseIsPressed) { // And then save to buffer once mouse goes up
// Save cells to buffer (so we opeate with one array keeping the other intact)
for (var x=0; x
-
-
+
+
+