diff --git a/README.md b/README.md index c1f906e04e..ba1ea3301d 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Once you've setup the site, type `npm run watch` to run the website. This should ## File structure -* __See note about what to include in pull requests [here](https://github.com/processing/p5.js-website/wiki/Pull-requests).__ +* __See note about what to include in pull requests [here](https://github.com/processing/p5.js/blob/main/contributor_docs/preparing_a_pull_request.md).__ * `src/` – All the pieces for generating the built site. __Edits should be made here.__ * `assets/` – All static files (imgs, css, fonts, js, p5_featured homepage sketches) * Note: if you make edits here you must restart the server to see your changes. To see changes immediately, you can edit the assets files in the dist directory, but need to copy and paste your updated work here for it to be saved. diff --git a/i18n-tracking.yml b/i18n-tracking.yml index 36b202a268..3384b5e9f7 100644 --- a/i18n-tracking.yml +++ b/i18n-tracking.yml @@ -1,5 +1,12 @@ es: src/data/en.yml: + line 114: ' environment15' + line 113: ' environment14' + line 115: ' environment16' + line 102: ' download8' + line 103: ' download9' + line 104: ' download10' + line 105: ' download11' line 256: ' , the organization that supports p5.js.' line 251: ' We need your help! p5.js is free, open-source software. We want to make our community as open' line 269: ' Your donation supports software development for p5.js, education resources' @@ -12,7 +19,6 @@ es: line 277: ' support-5' line 37: Editor line 55: footer5 - line 114: ' acknowledge that not everyone has the time, financial means, or capacity to' line 123: ' p3xh2' line 41: Reference line 118: ' p2x3' @@ -35,8 +41,6 @@ es: line 61: tagline6 line 111: ' identity and expression, sexual orientation, race, ethnicity, language,' line 112: ' neuro-type, size, disability, class, religion, culture, subculture,' - line 113: ' political opinion, age, skill level, occupation, and background. We' - line 115: ' actively participate, but we recognize and encourage involvement of all' line 116: ' kinds. We facilitate and foster access and empowerment. We are all learners.' line 117: ' p2x2' line 119: ' p2x4' @@ -153,10 +157,6 @@ es: line 129: ' p3xp6' line 148: ' The p5.js library is free software; you can redistribute it and/or modify it' line 46: Community - line 102: ' software, and the tools to learn it, should be accessible to everyone.' - line 103: ' p1x2' - line 104: ' Using the metaphor of a sketch, p5.js has a full set of drawing' - line 105: ' functionality. However, you’re not limited to your drawing canvas. You can' line 133: ' p4xp3' line 134: ' p4xp4' line 141: ' project-a-2-5-phuong' @@ -1819,6 +1819,13 @@ es: line 2557: ' teach-case12-content5-2' ko: src/data/en.yml: + line 114: ' environment15' + line 113: ' environment14' + line 115: ' environment16' + line 102: ' download8' + line 103: ' download9' + line 104: ' download10' + line 105: ' download11' line 251: ' We need your help! p5.js is free, open-source software. We want to make our community as open' line 256: ' , the organization that supports p5.js.' line 269: ' Your donation supports software development for p5.js, education resources' @@ -1831,7 +1838,6 @@ ko: line 277: ' support-5' line 37: Editor line 55: footer5 - line 114: ' acknowledge that not everyone has the time, financial means, or capacity to' line 123: ' p3xh2' line 41: Reference line 118: ' p2x3' @@ -1854,8 +1860,6 @@ ko: line 61: tagline6 line 111: ' identity and expression, sexual orientation, race, ethnicity, language,' line 112: ' neuro-type, size, disability, class, religion, culture, subculture,' - line 113: ' political opinion, age, skill level, occupation, and background. We' - line 115: ' actively participate, but we recognize and encourage involvement of all' line 116: ' kinds. We facilitate and foster access and empowerment. We are all learners.' line 117: ' p2x2' line 119: ' p2x4' @@ -1973,10 +1977,6 @@ ko: line 129: ' p3xp6' line 148: ' The p5.js library is free software; you can redistribute it and/or modify it' line 46: Community - line 102: ' software, and the tools to learn it, should be accessible to everyone.' - line 103: ' p1x2' - line 104: ' Using the metaphor of a sketch, p5.js has a full set of drawing' - line 105: ' functionality. However, you’re not limited to your drawing canvas. You can' line 133: ' p4xp3' line 134: ' p4xp4' line 141: ' project-a-2-5-phuong' @@ -3638,6 +3638,13 @@ ko: line 2557: ' teach-case12-content5-2' zh-Hans: src/data/en.yml: + line 114: ' environment15' + line 113: ' environment14' + line 115: ' environment16' + line 102: ' download8' + line 103: ' download9' + line 104: ' download10' + line 105: ' download11' line 251: ' We need your help! p5.js is free, open-source software. We want to make our community as open' line 256: ' , the organization that supports p5.js.' line 269: ' Your donation supports software development for p5.js, education resources' @@ -3650,7 +3657,6 @@ zh-Hans: line 277: ' support-5' line 37: Editor line 55: footer5 - line 114: ' acknowledge that not everyone has the time, financial means, or capacity to' line 123: ' p3xh2' line 41: Reference line 118: ' p2x3' @@ -3672,8 +3678,6 @@ zh-Hans: line 61: tagline6 line 111: ' identity and expression, sexual orientation, race, ethnicity, language,' line 112: ' neuro-type, size, disability, class, religion, culture, subculture,' - line 113: ' political opinion, age, skill level, occupation, and background. We' - line 115: ' actively participate, but we recognize and encourage involvement of all' line 116: ' kinds. We facilitate and foster access and empowerment. We are all learners.' line 117: ' p2x2' line 119: ' p2x4' @@ -3791,10 +3795,6 @@ zh-Hans: line 129: ' p3xp6' line 148: ' The p5.js library is free software; you can redistribute it and/or modify it' line 46: Community - line 102: ' software, and the tools to learn it, should be accessible to everyone.' - line 103: ' p1x2' - line 104: ' Using the metaphor of a sketch, p5.js has a full set of drawing' - line 105: ' functionality. However, you’re not limited to your drawing canvas. You can' line 133: ' p4xp3' line 134: ' p4xp4' line 141: ' project-a-2-5-phuong' diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 804e29c2ef..427dd401bc 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -294,7 +294,7 @@ textarea { #skip-to-content { position: absolute; left: 0px; - top: 0px; + top: 40px; z-index: 5; background-color: #ed225d; color: white; @@ -582,7 +582,7 @@ div.reference-subgroup { position: relative; left: 1em; padding-top: 0; - margin-top: 0; + margin-top: 1rem; border: none; width: 30.5em; max-width: 100%; @@ -634,6 +634,7 @@ div.reference-subgroup { top: 0.5em; left: 120px; width: 30.5em; + padding-top: 1.5rem; display: none; } @@ -666,7 +667,8 @@ div.reference-subgroup { /*to make ref example responsive*/ @media (max-width: 600px) { .example-content .example_code { - left: 0; + margin-top: 0.2rem; + left: 0.5rem; } .example-content .example_container { @@ -833,7 +835,7 @@ a.code.addon { height: 100px; position: relative; background: white; - /* margin-top: 1.5em; temp promo */ + margin-top: 1.5em; /* temp promo */ } #navi, @@ -1597,7 +1599,6 @@ h2.featuring { #teach-page .case span { color: #ed225d; - font-color: #ed225d; font: 900 1.4rem "Montserrat", sans-serif; } @@ -1605,7 +1606,6 @@ h2.featuring { #teach-page .case p.lead-name{ font: 900 Italic 1.2rem "Montserrat", sans-serif; color: #ed225d; - font-color: #ed225d; line-height: 1.4em; border-bottom: 1.4em; } @@ -1643,7 +1643,6 @@ h2.featuring { font: 400 1rem "Montserrat", sans-serif; color: #ed225d; - font-color: #ffe8e8; line-height: 1.4em; border-bottom: 0.1em dashed rgba(237, 34, 93, 0.15); } @@ -2266,7 +2265,7 @@ footer { @media (min-width: 780px) { .container { width: 49em !important; - margin: 10em auto; /* temp promo, 11.5em */ + margin: 11.5em auto; /* temp promo, 10.0em */ } main { width: 36em; @@ -2279,7 +2278,7 @@ footer { @media (min-width: 780px) { .container { - margin: 10em auto; /* temp promo, 11.5em */ + margin: 11.5em auto; /* temp promo, 10.0em */ width: 100%; padding: 0.8em 0 0 0; height: auto; @@ -2304,7 +2303,7 @@ footer { } #i18n-btn { position: absolute; - top: 2.5em; /* temp promo, 4.0em */ + top: 4.0em; /* temp promo, 2.5em */ right: 1em; } #i18n-btn a { @@ -2331,14 +2330,14 @@ footer { margin: 0 0 1em 0; text-align: right; } - #menu li:last-child { - /* margin: 0;*/ - } - #menu .other-link::after { - /* content:"\2192"; - margin-right: -0.98em; */ - /*content:" »";*/ - } + /* #menu li:last-child { + margin: 0; + } */ + /* #menu .other-link::after { + content:"\2192"; + margin-right: -0.98em; + content:" »"; + } */ #menu li:nth-child(11) { margin-top: 3em; padding-top: 0.5em; diff --git a/src/assets/js/init.js b/src/assets/js/init.js index f44764e4d3..0e50e982bd 100644 --- a/src/assets/js/init.js +++ b/src/assets/js/init.js @@ -88,7 +88,7 @@ window.onload = function() { var tmp = w.navigator.languages && w.navigator.languages[0] || w.navigator.language || w.navigator.userLanguage; tmp = tmp.split('-')[0]; - for (var i=0, l=langs; i < l; i++) { + for (var i = 0; i < langs.length; i++) { if (tmp == langs[i]) { return langs[i]; } @@ -99,7 +99,7 @@ window.onload = function() { var get_loc_lang = function(w) { if ((w.location.pathname == '/') === false) { - for (var i=0, l=langs.length; i < l; i++) { + for (var i = 0; i < langs.length; i++) { if (w.location.pathname.indexOf('/' + langs[i] + '/') !== -1) { if (can_store) { window.localStorage.setItem('lang', langs[i]); @@ -149,7 +149,7 @@ window.onload = function() { var els = document.getElementsByClassName('js-lang'); var el = null; if (window.lang != 'en') { - for (var i=0, l=els.length; i < l; i++) { + for (var i = 0; i < els.length; i++) { el = els[i]; el.innerHTML = el.getAttribute('data-' + window.lang); } @@ -163,14 +163,18 @@ window.onload = function() { var evt_type = typeof document.addEventListener !== 'undefined' ? 'click' : 'onclick'; var click_action = function(e) { var new_lang = this.getAttribute('data-lang'); + //loc is defined second time below because while navigating from /reference/ to /reference/#/p5/displayWidth + //the page is not refreshing, so even if the page navigates properly to /reference/#/p5/displayWidth + //the window.location.hash remains empty + loc = String(window.location.pathname + window.location.hash); if (new_lang == 'en') { - for (var j=0, l=langs.length; j < l; j++) { + for (var j = 0; j < langs.length; j++) { if (langs[j] != 'en') { loc = loc.replace('\/' + langs[j] + '\/', '/'); } } } else { - for (var j=0, l=langs.length; j < l; j++) { + for (var j = 0; j < langs.length; j++) { loc = loc.replace('\/' + langs[j] + '\/', '/'); } loc = '/' + new_lang + loc; @@ -180,7 +184,7 @@ window.onload = function() { } window.location = loc; }; - for (var i=0, l=btns.length; i < l; i++) { + for (var i = 0; i < btns.length; i++) { var btn_lang = btns[i].getAttribute('data-lang'); if (loc_lang == btn_lang) { $(btns[i]).addClass('disabled'); diff --git a/src/assets/js/reference.js b/src/assets/js/reference.js index affcb1f9a4..37150da749 100644 --- a/src/assets/js/reference.js +++ b/src/assets/js/reference.js @@ -4404,7 +4404,7 @@ define('menuView',[ }); -define('text!tpl/library.html',[],function () { return '

<%= module.name %> library

\n\n

<%= module.description %>

\n\n
\n\n<% var t = 0; col = 0; %>\n\n<% _.each(groups, function(group){ %>\n <% if (t == 0) { %> \n
\n <% } %>\n <% if (group.name !== module.name && group.name !== \'p5\') { %>\n <% if (group.hash) { %> class="core"<% } %>><% } %> \n

<%=group.name%>

\n <% if (group.hash) { %>

<% } %>\n <% } %>\n <% _.each(group.items.filter(function(item) {return item.access !== \'private\'}), function(item) { %>\n class="core"<% } %>><%=item.name%><% if (item.itemtype === \'method\') { %>()<%}%>
\n <% t++; %>\n <% }); %>\n <% if (t >= Math.floor(totalItems/4)) { col++; t = 0; %>\n
\n <% } %>\n<% }); %>\n
\n';}); +define('text!tpl/library.html',[],function () { return '

<%= module.name %> library

\n\n

<%= module.description %>

\n\n
\n\n<% var t = 0; col = 0; %>\n\n<% _.each(groups, function(group){ %>\n <% if (t == 0) { %> \n
\n <% } %>\n <% if (group.name !== module.name && group.name !== \'p5\') { %>\n <% if (group.hash) { %> class="core"<% } %>><% } %> \n

<%=group.name%>

\n <% if (group.hash) { %>

<% } %>\n <% } %>\n <% _.each(group.items.filter(function(item) {return item.access !== \'private\'}), function(item) { %>\n class="core"<% } %>><%=item.name%><% if (item.itemtype === \'method\') { %>()<%}%>
\n <% t++; %>\n <% }); %>\n <% if (t >= Math.floor(totalItems/4)) { col++; t = 0; %>\n
\n <% } %>\n<% }); %>\n
\n';}); define( 'libraryView',[ diff --git a/src/data/en.yml b/src/data/en.yml index bbc1a804f8..9b8e89572e 100644 --- a/src/data/en.yml +++ b/src/data/en.yml @@ -99,6 +99,10 @@ get started: download1: 'The easiest way to start is by using the empty example that comes with the ' download2: p5.js complete download3: ' download.' + download8: 'After download, you need to set up a local server. See instructions ' + download9: here + download10: '. Run your local server within the downloaded folder and on your browser, go to ' + download11: 'http://localhost:{your-port-num}/empty-example' download4: >- If you look in index.html, you'll notice that it links to the file p5.js. If you would like to use the minified version (compressed for faster page @@ -133,6 +137,9 @@ get started: Open the index.html file in your browser by double clicking on it in your file manager or type: environment12: 'file:///the/file/path/to/your/html' + environment14: ' (or ' + environment15: 'http://localhost:{your-port-num}/empty-example' + environment16: ' if you are using a local server)' environment13: ' in the address bar to view your sketch.' your-first-sketch-title: Your First Sketch your-first-sketch-intro1: 'In the ' diff --git a/src/data/es.yml b/src/data/es.yml index 0e998fe8f8..9a447579cc 100644 --- a/src/data/es.yml +++ b/src/data/es.yml @@ -100,6 +100,12 @@ get started: download1: La manera más simple de empezar es usando el ejemplo en blanco incluido en download2: p5.js completo download3: disponible en el sitio. + download8: 'After download, you need to set up a local server. See instructions ' + download9: here + download10: >- + . Run your local server within the downloaded folder and on your browser, go + to + download11: 'http://localhost:{your-port-num}/empty-example' download4: >- Si revisas el archivo index.html, te darás cuenta que tiene un enlace al archivo p5.js. Si estás buscando usar la versión reducida (comprimida para @@ -135,6 +141,9 @@ get started: Abre el archivo index.html en tu navegador haciendo doble click en él o escribiendo: environment12: 'file:///la/ubicacion/de/tu/archivo/html' + environment14: ' (or ' + environment15: 'http://localhost:{your-port-num}/empty-example' + environment16: ' if you are using a local server)' environment13: ' en la barra de direcciones de tu navegador para ver tu bosquejo.' your-first-sketch-title: Tu primer bosquejo your-first-sketch-intro1: 'En el ' diff --git a/src/data/examples/assets/rover_wide.jpg b/src/data/examples/assets/rover_wide.jpg new file mode 100644 index 0000000000..793781a3be Binary files /dev/null and b/src/data/examples/assets/rover_wide.jpg differ diff --git a/src/data/examples/build_examples/build.js b/src/data/examples/build_examples/build.js index 1205598ad7..7d82ac1557 100644 --- a/src/data/examples/build_examples/build.js +++ b/src/data/examples/build_examples/build.js @@ -3,7 +3,7 @@ var verbose = false; // now load the modules we need var ejs = require('ejs'); // library for turning .ejs templates into .html files var fs = require('fs'); // node.js library for reading and writing files -var path = require('upath'); // platform indepedent file paths +var path = require('upath'); // platform independent file paths // make sure EJS is configured to use curly braces for templates // ejs.open = '<%'; diff --git a/src/data/examples/en/05_Image/07_EdgeDetection.js b/src/data/examples/en/05_Image/07_EdgeDetection.js new file mode 100644 index 0000000000..5eff38c2d2 --- /dev/null +++ b/src/data/examples/en/05_Image/07_EdgeDetection.js @@ -0,0 +1,93 @@ +/* + * @name Edge Detection + * @description A high-pass filter sharpens an image. This program analyzes every pixel in an image in relation to the neighboring pixels to sharpen the image. + *

This example is ported from the Edge Detection example + * on the Processing website + */ +// this program analyzes every pixel in an image +// in relation to the neighbouring pixels +// to sharpen the image + +// to consider all neighboring pixels we use a 3x3 array +// and normalize these values +// kernel is the 3x3 matrix of normalized values +let kernel = [[-1, -1, -1 ], [ -1, 9, -1 ], [-1, -1, -1 ]]; + +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// if loadImage() is called in setup(), the image won't appear +// since noLoop() restricts draw() to execute only once +// (one execution of draw() is not enough time for the image to load), +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover.png"); +} + +// setup() runs after preload, once() +function setup() { + // create canvas + createCanvas(710, 400); + // noLoop() makes draw() run only once, not in a loop + noLoop(); +} + +// draw() runs after setup(), normally on a loop +// in this case it runs only once, because of noDraw() +function draw() { + + // place the original image on the upper left corner + image(img, 0, 0); + + // create a new image, same dimensions as img + edgeImg = createImage(img.width, img.height); + + // load its pixels + edgeImg.loadPixels(); + + + // two for() loops, to iterate in x axis and y axis + // since the kernel assumes that the pixel + // has pixels above, under, left, and right + // we need to skip the first and last column and row + // x then goes from 1 to width - 1 + // y then goes from 1 to height - 1 + + for (let x = 1; x < img.width - 1; x++) { + for (let y = 1; y < img.height - 1; y++) { + // kernel sum for the current pixel starts as 0 + let sum = 0; + + // kx, ky variables for iterating over the kernel + // kx, ky have three different values: -1, 0, 1 + for (kx = -1; kx <= 1; kx++) { + for (ky = -1; ky <= 1; ky++) { + + let xpos = x + kx; + let ypos = y + ky; + let pos = (y + ky)*img.width + (x + kx); + // since our image is grayscale, + // RGB values are identical + // we retrieve the red value for this example + let val = red(img.get(xpos, ypos)); + // accumulate the kernel sum + // kernel is a 3x3 matrix + // kx and ky have values -1, 0, 1 + // if we add 1 to kx and ky, we get 0, 1, 2 + // with that we can use it to iterate over kernel + // and calculate the accumulated sum + sum += kernel[ky+1][kx+1] * val; + } + } + + // set the pixel value of the edgeImg + edgeImg.set(x, y, color(sum, sum, sum)); + } + } + + // updatePixels() to write the changes on edgeImg + edgeImg.updatePixels(); + + // draw edgeImg at the right of the original image + image(edgeImg, img.width, 0); +} \ No newline at end of file diff --git a/src/data/examples/en/05_Image/08_Brightness.js b/src/data/examples/en/05_Image/08_Brightness.js new file mode 100644 index 0000000000..3c58a98876 --- /dev/null +++ b/src/data/examples/en/05_Image/08_Brightness.js @@ -0,0 +1,63 @@ +/* + * @name Brightness + * @description This program adjusts the brightness of a part of the image by calculating the distance of each pixel to the mouse. + *

This example is ported from the Brightness example + * on the Processing website + */ +// This program adjusts the brightness +// of a part of the image by +// calculating the distance of +// each pixel to the mouse. +let img; +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover_wide.jpg"); +} +// setup() runs after preload, once() +function setup() { + createCanvas(710, 400); + pixelDensity(1); + frameRate(30); +} + +function draw() { + image(img,0,0); + // Only need to load the pixels[] array once, because we're only + // manipulating pixels[] inside draw(), not drawing shapes. + loadPixels(); + // We must also call loadPixels() on the PImage since we are going to read its pixels. + img.loadPixels(); + for (let x = 0; x < img.width; x++) { + for (let y = 0; y < img.height; y++ ) { + // Calculate the 1D location from a 2D grid + let loc = (x + y*img.width)*4; + // Get the R,G,B values from image + let r,g,b; + r = img.pixels[loc]; + // g = img.pixels[loc+1]; + // b = img.pixels[loc+2]; + // Calculate an amount to change brightness based on proximity to the mouse + // The closer the pixel is to the mouse, the lower the value of "distance" + let maxdist = 50;//dist(0,0,width,height); + let d = dist(x, y, mouseX, mouseY); + let adjustbrightness = 255*(maxdist-d)/maxdist; + r += adjustbrightness; + // g += adjustbrightness; + // b += adjustbrightness; + // Constrain RGB to make sure they are within 0-255 color range + r = constrain(r, 0, 255); + // g = constrain(g, 0, 255); + // b = constrain(b, 0, 255); + // Make a new color and set pixel in the window + let pixloc = (y*width + x)*4; + pixels[pixloc] = r; + pixels[pixloc+1] = r; + pixels[pixloc+2] = r; + pixels[pixloc+3] = 255; // Always have to set alpha + } + } + updatePixels(); +} \ No newline at end of file diff --git a/src/data/examples/es/05_Image/07_EdgeDetection.js b/src/data/examples/es/05_Image/07_EdgeDetection.js new file mode 100644 index 0000000000..2c0509d44b --- /dev/null +++ b/src/data/examples/es/05_Image/07_EdgeDetection.js @@ -0,0 +1,93 @@ +/* + * @name Edge Detection + * @description A high-pass filter sharpens an image. This program analyzes every pixel in an image in relation to the neighboring pixels to sharpen the image. + *

This example is ported from the Edge Detection example + * on the Processing website + */ +// this program analyzes every pixel in an image +// in relation to the neighbouring pixels +// to sharpen the image + +// to consider all neighboring pixels we use a 3x3 array +// and normalize these values +// kernel is the 3x3 matrix of normalized values +let kernel = [[-1, -1, -1 ], [ -1, 9, -1 ], [-1, -1, -1 ]]; + +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// if loadImage() is called in setup(), the image won't appear +// since noLoop() restricts draw() to execute only once +// (one execution of draw() is not enough time for the image to load), +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover.png"); +} + +// setup() runs after preload, once() +function setup() { + // create canvas + createCanvas(710, 400); + // noLoop() makes draw() run only once, not in a loop + noLoop(); +} + +// draw() runs after setup(), normally on a loop +// in this case it runs only once, because of noDraw() +function draw() { + + // place the original image on the upper left corner + image(img, 0, 0); + + // create a new image, same dimensions as img + edgeImg = createImage(img.width, img.height); + + // load its pixels + edgeImg.loadPixels(); + + + // two for() loops, to iterate in x axis and y axis + // since the kernel assumes that the pixel + // has pixels above, under, left, and right + // we need to skip the first and last column and row + // x then goes from 1 to width - 1 + // y then goes from 1 to height - 1 + + for (let x = 1; x < img.width - 1; x++) { + for (let y = 1; y < img.height - 1; y++) { + // kernel sum for the current pixel starts as 0 + let sum = 0; + + // kx, ky variables for iterating over the kernel + // kx, ky have three different values: -1, 0, 1 + for (kx = -1; kx <= 1; kx++) { + for (ky = -1; ky <= 1; ky++) { + + let xpos = x + kx; + let ypos = y + ky; + let pos = (y + ky)*img.width + (x + kx); + // since our image is grayscale, + // RGB values are identical + // we retrieve the red value for this example + let val = red(img.get(xpos, ypos)); + // accumulate the kernel sum + // kernel is a 3x3 matrix + // kx and ky have values -1, 0, 1 + // if we add 1 to kx and ky, we get 0, 1, 2 + // with that we can use it to iterate over kernel + // and calculate the accumulated sum + sum += kernel[ky+1][kx+1] * val; + } + } + + // set the pixel value of the edgeImg + edgeImg.set(x, y, color(sum, sum, sum)); + } + } + + // updatePixels() to write the changes on edgeImg + edgeImg.updatePixels(); + + // draw edgeImg at the right of the original image + image(edgeImg, img.width, 0); +} diff --git a/src/data/examples/es/05_Image/08_Brightness.js b/src/data/examples/es/05_Image/08_Brightness.js new file mode 100644 index 0000000000..3c58a98876 --- /dev/null +++ b/src/data/examples/es/05_Image/08_Brightness.js @@ -0,0 +1,63 @@ +/* + * @name Brightness + * @description This program adjusts the brightness of a part of the image by calculating the distance of each pixel to the mouse. + *

This example is ported from the Brightness example + * on the Processing website + */ +// This program adjusts the brightness +// of a part of the image by +// calculating the distance of +// each pixel to the mouse. +let img; +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover_wide.jpg"); +} +// setup() runs after preload, once() +function setup() { + createCanvas(710, 400); + pixelDensity(1); + frameRate(30); +} + +function draw() { + image(img,0,0); + // Only need to load the pixels[] array once, because we're only + // manipulating pixels[] inside draw(), not drawing shapes. + loadPixels(); + // We must also call loadPixels() on the PImage since we are going to read its pixels. + img.loadPixels(); + for (let x = 0; x < img.width; x++) { + for (let y = 0; y < img.height; y++ ) { + // Calculate the 1D location from a 2D grid + let loc = (x + y*img.width)*4; + // Get the R,G,B values from image + let r,g,b; + r = img.pixels[loc]; + // g = img.pixels[loc+1]; + // b = img.pixels[loc+2]; + // Calculate an amount to change brightness based on proximity to the mouse + // The closer the pixel is to the mouse, the lower the value of "distance" + let maxdist = 50;//dist(0,0,width,height); + let d = dist(x, y, mouseX, mouseY); + let adjustbrightness = 255*(maxdist-d)/maxdist; + r += adjustbrightness; + // g += adjustbrightness; + // b += adjustbrightness; + // Constrain RGB to make sure they are within 0-255 color range + r = constrain(r, 0, 255); + // g = constrain(g, 0, 255); + // b = constrain(b, 0, 255); + // Make a new color and set pixel in the window + let pixloc = (y*width + x)*4; + pixels[pixloc] = r; + pixels[pixloc+1] = r; + pixels[pixloc+2] = r; + pixels[pixloc+3] = 255; // Always have to set alpha + } + } + updatePixels(); +} \ No newline at end of file diff --git a/src/data/examples/ko/05_Image/06_Blur.js b/src/data/examples/ko/05_Image/06_Blur.js new file mode 100644 index 0000000000..2374bc0345 --- /dev/null +++ b/src/data/examples/ko/05_Image/06_Blur.js @@ -0,0 +1,89 @@ +/* + * @name Blur + * @description A low-pass filter that blurs an image. This program analyzes every pixel in an image and blends it with all the neighboring pixels to blur the image. + *

This example is ported from the Blur example + * on the Processing website + */ +// to consider all neighboring pixels we use a 3x3 array +// and normalize these values +// v is the normalized value +let v = 1.0 / 9.0; +// kernel is the 3x3 matrix of normalized values +let kernel = [[ v, v, v ], [ v, v, v ], [ v, v, v ]]; + +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// if loadImage() is called in setup(), the image won't appear +// since noLoop() restricts draw() to execute only once +// (one execution of draw() is not enough time for the image to load), +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover.png"); +} + +// setup() runs once after preload +function setup() { + // create canvas + createCanvas(710, 400); + // noLoop() makes draw() run only once, not in a loop + noLoop(); +} + + +// draw() runs after setup(), normally on a loop +// in this case it runs only once, because of noDraw() +function draw() { + // place the original image on the upper left corner + image(img, 0, 0); + + // create a new image, same dimensions as img + edgeImg = createImage(img.width, img.height); + + // load its pixels + edgeImg.loadPixels(); + + // two for() loops, to iterate in x axis and y axis + // since the kernel assumes that the pixel + // has pixels above, under, left, and right + // we need to skip the first and last column and row + // x then goes from 1 to width - 1 + // y then goes from 1 to height - 1 + for (let x = 1; x < img.width; x++) { + for (let y = 1; y < img.height; y++) { + // kernel sum for the current pixel starts as 0 + let sum = 0; + + // kx, ky variables for iterating over the kernel + // kx, ky have three different values: -1, 0, 1 + for (kx = -1; kx <= 1; kx++) { + for (ky = -1; ky <= 1; ky++) { + let xpos = x + kx; + let ypos = y + ky; + + // since our image is grayscale, + // RGB values are identical + // we retrieve the red value for this example + // (green and blue work as well) + let val = red(img.get(xpos, ypos)); + + // accumulate the kernel sum + // kernel is a 3x3 matrix + // kx and ky have values -1, 0, 1 + // if we add 1 to kx and ky, we get 0, 1, 2 + // with that we can use it to iterate over kernel + // and calculate the accumulated sum + sum += kernel[kx+1][ky+1] * val; + } + } + + // set the value of the edgeImg pixel to the kernel sum + edgeImg.set(x, y, color(sum)); + } + } + // updatePixels() to write the changes on edgeImg + edgeImg.updatePixels(); + + // draw edgeImg at the right of the original image + image(edgeImg, img.width, 0); +} \ No newline at end of file diff --git a/src/data/examples/ko/05_Image/07_EdgeDetection.js b/src/data/examples/ko/05_Image/07_EdgeDetection.js new file mode 100644 index 0000000000..5eff38c2d2 --- /dev/null +++ b/src/data/examples/ko/05_Image/07_EdgeDetection.js @@ -0,0 +1,93 @@ +/* + * @name Edge Detection + * @description A high-pass filter sharpens an image. This program analyzes every pixel in an image in relation to the neighboring pixels to sharpen the image. + *

This example is ported from the Edge Detection example + * on the Processing website + */ +// this program analyzes every pixel in an image +// in relation to the neighbouring pixels +// to sharpen the image + +// to consider all neighboring pixels we use a 3x3 array +// and normalize these values +// kernel is the 3x3 matrix of normalized values +let kernel = [[-1, -1, -1 ], [ -1, 9, -1 ], [-1, -1, -1 ]]; + +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// if loadImage() is called in setup(), the image won't appear +// since noLoop() restricts draw() to execute only once +// (one execution of draw() is not enough time for the image to load), +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover.png"); +} + +// setup() runs after preload, once() +function setup() { + // create canvas + createCanvas(710, 400); + // noLoop() makes draw() run only once, not in a loop + noLoop(); +} + +// draw() runs after setup(), normally on a loop +// in this case it runs only once, because of noDraw() +function draw() { + + // place the original image on the upper left corner + image(img, 0, 0); + + // create a new image, same dimensions as img + edgeImg = createImage(img.width, img.height); + + // load its pixels + edgeImg.loadPixels(); + + + // two for() loops, to iterate in x axis and y axis + // since the kernel assumes that the pixel + // has pixels above, under, left, and right + // we need to skip the first and last column and row + // x then goes from 1 to width - 1 + // y then goes from 1 to height - 1 + + for (let x = 1; x < img.width - 1; x++) { + for (let y = 1; y < img.height - 1; y++) { + // kernel sum for the current pixel starts as 0 + let sum = 0; + + // kx, ky variables for iterating over the kernel + // kx, ky have three different values: -1, 0, 1 + for (kx = -1; kx <= 1; kx++) { + for (ky = -1; ky <= 1; ky++) { + + let xpos = x + kx; + let ypos = y + ky; + let pos = (y + ky)*img.width + (x + kx); + // since our image is grayscale, + // RGB values are identical + // we retrieve the red value for this example + let val = red(img.get(xpos, ypos)); + // accumulate the kernel sum + // kernel is a 3x3 matrix + // kx and ky have values -1, 0, 1 + // if we add 1 to kx and ky, we get 0, 1, 2 + // with that we can use it to iterate over kernel + // and calculate the accumulated sum + sum += kernel[ky+1][kx+1] * val; + } + } + + // set the pixel value of the edgeImg + edgeImg.set(x, y, color(sum, sum, sum)); + } + } + + // updatePixels() to write the changes on edgeImg + edgeImg.updatePixels(); + + // draw edgeImg at the right of the original image + image(edgeImg, img.width, 0); +} \ No newline at end of file diff --git a/src/data/examples/ko/05_Image/08_Brightness.js b/src/data/examples/ko/05_Image/08_Brightness.js new file mode 100644 index 0000000000..3c58a98876 --- /dev/null +++ b/src/data/examples/ko/05_Image/08_Brightness.js @@ -0,0 +1,63 @@ +/* + * @name Brightness + * @description This program adjusts the brightness of a part of the image by calculating the distance of each pixel to the mouse. + *

This example is ported from the Brightness example + * on the Processing website + */ +// This program adjusts the brightness +// of a part of the image by +// calculating the distance of +// each pixel to the mouse. +let img; +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover_wide.jpg"); +} +// setup() runs after preload, once() +function setup() { + createCanvas(710, 400); + pixelDensity(1); + frameRate(30); +} + +function draw() { + image(img,0,0); + // Only need to load the pixels[] array once, because we're only + // manipulating pixels[] inside draw(), not drawing shapes. + loadPixels(); + // We must also call loadPixels() on the PImage since we are going to read its pixels. + img.loadPixels(); + for (let x = 0; x < img.width; x++) { + for (let y = 0; y < img.height; y++ ) { + // Calculate the 1D location from a 2D grid + let loc = (x + y*img.width)*4; + // Get the R,G,B values from image + let r,g,b; + r = img.pixels[loc]; + // g = img.pixels[loc+1]; + // b = img.pixels[loc+2]; + // Calculate an amount to change brightness based on proximity to the mouse + // The closer the pixel is to the mouse, the lower the value of "distance" + let maxdist = 50;//dist(0,0,width,height); + let d = dist(x, y, mouseX, mouseY); + let adjustbrightness = 255*(maxdist-d)/maxdist; + r += adjustbrightness; + // g += adjustbrightness; + // b += adjustbrightness; + // Constrain RGB to make sure they are within 0-255 color range + r = constrain(r, 0, 255); + // g = constrain(g, 0, 255); + // b = constrain(b, 0, 255); + // Make a new color and set pixel in the window + let pixloc = (y*width + x)*4; + pixels[pixloc] = r; + pixels[pixloc+1] = r; + pixels[pixloc+2] = r; + pixels[pixloc+3] = 255; // Always have to set alpha + } + } + updatePixels(); +} \ No newline at end of file diff --git a/src/data/examples/ko/05_Image/09_Convolution.js b/src/data/examples/ko/05_Image/09_Convolution.js new file mode 100644 index 0000000000..eb953c6729 --- /dev/null +++ b/src/data/examples/ko/05_Image/09_Convolution.js @@ -0,0 +1,91 @@ +/* + * @name Convolution + * @description Applies a convolution matrix to a portion of an image. Move mouse to apply filter to different parts of the image. This example is a port of Dan Shiffman's example for Processing. Original comments written by Dan unless otherwise specified. + *

To run this example locally, you will need an + * image file, and a running + * local server.

+ */ + +let img; +let w = 80; + +// It's possible to convolve the image with many different +// matrices to produce different effects. This is a high-pass +// filter; it accentuates the edges. +const matrix = [ [ -1, -1, -1 ], + [ -1, 9, -1 ], + [ -1, -1, -1 ] ]; + +function preload() { + img = loadImage('assets/moonwalk.jpg'); +} + +function setup() { + createCanvas(720, 400); + img.loadPixels(); + + // pixelDensity(1) for not scaling pixel density to display density + // for more information, check the reference of pixelDensity() + pixelDensity(1); +} + +function draw() { + // We're only going to process a portion of the image + // so let's set the whole image as the background first + background(img); + + // Calculate the small rectangle we will process + const xstart = constrain(mouseX - w/2, 0, img.width); + const ystart = constrain(mouseY - w/2, 0, img.height); + const xend = constrain(mouseX + w/2, 0, img.width); + const yend = constrain(mouseY + w/2, 0, img.height); + const matrixsize = 3; + + loadPixels(); + // Begin our loop for every pixel in the smaller image + for (let x = xstart; x < xend; x++) { + for (let y = ystart; y < yend; y++ ) { + let c = convolution(x, y, matrix, matrixsize, img); + + // retrieve the RGBA values from c and update pixels() + let loc = (x + y*img.width) * 4; + pixels[loc] = red(c); + pixels[loc + 1] = green(c); + pixels[loc + 2] = blue(c); + pixels[loc + 3] = alpha(c); + } + } + updatePixels(); +} + +function convolution(x, y, matrix, matrixsize, img) { + let rtotal = 0.0; + let gtotal = 0.0; + let btotal = 0.0; + const offset = Math.floor(matrixsize / 2); + for (let i = 0; i < matrixsize; i++){ + for (let j = 0; j < matrixsize; j++){ + + // What pixel are we testing + const xloc = (x + i - offset); + const yloc = (y + j - offset); + let loc = (xloc + img.width * yloc) * 4; + + // Make sure we haven't walked off our image, we could do better here + loc = constrain(loc, 0 , img.pixels.length - 1); + + // Calculate the convolution + // retrieve RGB values + rtotal += (img.pixels[loc]) * matrix[i][j]; + gtotal += (img.pixels[loc + 1]) * matrix[i][j]; + btotal += (img.pixels[loc + 2]) * matrix[i][j]; + } + } + // Make sure RGB is within range + rtotal = constrain(rtotal, 0, 255); + gtotal = constrain(gtotal, 0, 255); + btotal = constrain(btotal, 0, 255); + + // Return the resulting color + return color(rtotal, gtotal, btotal); +} \ No newline at end of file diff --git a/src/data/examples/ko/05_Image/10_Copy_Method.js b/src/data/examples/ko/05_Image/10_Copy_Method.js new file mode 100644 index 0000000000..8fc5ba179d --- /dev/null +++ b/src/data/examples/ko/05_Image/10_Copy_Method.js @@ -0,0 +1,20 @@ +/* + * @name Copy() method + * @frame 600,400 + * @description An example of how to simulate coloring image with the copy() method. + */ +let draft, ready; +function preload() { + ready = loadImage("assets/parrot-color.png"); + draft = loadImage("assets/parrot-bw.png"); +} +function setup() { + createCanvas(600, 400); + noCursor(); + cursor("assets/brush.png", 20, -10); + image(ready, 0, 0); + image(draft, 0, 0); +} +function mouseDragged() { + copy(ready, mouseX, mouseY, 20, 20, mouseX, mouseY, 20, 20); +} diff --git a/src/data/examples/zh-Hans/05_Image/07_EdgeDetection.js b/src/data/examples/zh-Hans/05_Image/07_EdgeDetection.js new file mode 100644 index 0000000000..2c0509d44b --- /dev/null +++ b/src/data/examples/zh-Hans/05_Image/07_EdgeDetection.js @@ -0,0 +1,93 @@ +/* + * @name Edge Detection + * @description A high-pass filter sharpens an image. This program analyzes every pixel in an image in relation to the neighboring pixels to sharpen the image. + *

This example is ported from the Edge Detection example + * on the Processing website + */ +// this program analyzes every pixel in an image +// in relation to the neighbouring pixels +// to sharpen the image + +// to consider all neighboring pixels we use a 3x3 array +// and normalize these values +// kernel is the 3x3 matrix of normalized values +let kernel = [[-1, -1, -1 ], [ -1, 9, -1 ], [-1, -1, -1 ]]; + +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// if loadImage() is called in setup(), the image won't appear +// since noLoop() restricts draw() to execute only once +// (one execution of draw() is not enough time for the image to load), +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover.png"); +} + +// setup() runs after preload, once() +function setup() { + // create canvas + createCanvas(710, 400); + // noLoop() makes draw() run only once, not in a loop + noLoop(); +} + +// draw() runs after setup(), normally on a loop +// in this case it runs only once, because of noDraw() +function draw() { + + // place the original image on the upper left corner + image(img, 0, 0); + + // create a new image, same dimensions as img + edgeImg = createImage(img.width, img.height); + + // load its pixels + edgeImg.loadPixels(); + + + // two for() loops, to iterate in x axis and y axis + // since the kernel assumes that the pixel + // has pixels above, under, left, and right + // we need to skip the first and last column and row + // x then goes from 1 to width - 1 + // y then goes from 1 to height - 1 + + for (let x = 1; x < img.width - 1; x++) { + for (let y = 1; y < img.height - 1; y++) { + // kernel sum for the current pixel starts as 0 + let sum = 0; + + // kx, ky variables for iterating over the kernel + // kx, ky have three different values: -1, 0, 1 + for (kx = -1; kx <= 1; kx++) { + for (ky = -1; ky <= 1; ky++) { + + let xpos = x + kx; + let ypos = y + ky; + let pos = (y + ky)*img.width + (x + kx); + // since our image is grayscale, + // RGB values are identical + // we retrieve the red value for this example + let val = red(img.get(xpos, ypos)); + // accumulate the kernel sum + // kernel is a 3x3 matrix + // kx and ky have values -1, 0, 1 + // if we add 1 to kx and ky, we get 0, 1, 2 + // with that we can use it to iterate over kernel + // and calculate the accumulated sum + sum += kernel[ky+1][kx+1] * val; + } + } + + // set the pixel value of the edgeImg + edgeImg.set(x, y, color(sum, sum, sum)); + } + } + + // updatePixels() to write the changes on edgeImg + edgeImg.updatePixels(); + + // draw edgeImg at the right of the original image + image(edgeImg, img.width, 0); +} diff --git a/src/data/examples/zh-Hans/05_Image/08_Brightness.js b/src/data/examples/zh-Hans/05_Image/08_Brightness.js new file mode 100644 index 0000000000..3c58a98876 --- /dev/null +++ b/src/data/examples/zh-Hans/05_Image/08_Brightness.js @@ -0,0 +1,63 @@ +/* + * @name Brightness + * @description This program adjusts the brightness of a part of the image by calculating the distance of each pixel to the mouse. + *

This example is ported from the Brightness example + * on the Processing website + */ +// This program adjusts the brightness +// of a part of the image by +// calculating the distance of +// each pixel to the mouse. +let img; +// preload() runs once, before setup() +// loadImage() needs to occur here instead of setup() +// preload() makes sure image is loaded before anything else occurs +function preload() { + // load the original image + img = loadImage("assets/rover_wide.jpg"); +} +// setup() runs after preload, once() +function setup() { + createCanvas(710, 400); + pixelDensity(1); + frameRate(30); +} + +function draw() { + image(img,0,0); + // Only need to load the pixels[] array once, because we're only + // manipulating pixels[] inside draw(), not drawing shapes. + loadPixels(); + // We must also call loadPixels() on the PImage since we are going to read its pixels. + img.loadPixels(); + for (let x = 0; x < img.width; x++) { + for (let y = 0; y < img.height; y++ ) { + // Calculate the 1D location from a 2D grid + let loc = (x + y*img.width)*4; + // Get the R,G,B values from image + let r,g,b; + r = img.pixels[loc]; + // g = img.pixels[loc+1]; + // b = img.pixels[loc+2]; + // Calculate an amount to change brightness based on proximity to the mouse + // The closer the pixel is to the mouse, the lower the value of "distance" + let maxdist = 50;//dist(0,0,width,height); + let d = dist(x, y, mouseX, mouseY); + let adjustbrightness = 255*(maxdist-d)/maxdist; + r += adjustbrightness; + // g += adjustbrightness; + // b += adjustbrightness; + // Constrain RGB to make sure they are within 0-255 color range + r = constrain(r, 0, 255); + // g = constrain(g, 0, 255); + // b = constrain(b, 0, 255); + // Make a new color and set pixel in the window + let pixloc = (y*width + x)*4; + pixels[pixloc] = r; + pixels[pixloc+1] = r; + pixels[pixloc+2] = r; + pixels[pixloc+3] = 255; // Always have to set alpha + } + } + updatePixels(); +} \ No newline at end of file diff --git a/src/data/ko.yml b/src/data/ko.yml index ff4a468173..5e13b4fda9 100644 --- a/src/data/ko.yml +++ b/src/data/ko.yml @@ -87,6 +87,12 @@ get started: download1: '' download2: p5.js complete download3: 를 다운받아 시작하는 것이 가장 쉽고 간편한 방법입니다. + download8: 'After download, you need to set up a local server. See instructions ' + download9: here + download10: >- + . Run your local server within the downloaded folder and on your browser, go + to + download11: 'http://localhost:{your-port-num}/empty-example' download4: >- 그 중 index.html 파일에는 p5.js 링크가 적혀있습니다. 불러오는 시간을 단축하려면, p5.js 링크를 그 간략 버전인 p5.min.js로 아래와 같이 변경하면 됩니다. @@ -113,6 +119,9 @@ get started: index.html 파일을 브라우저에서 열어볼까요? 파일 관리 시스템에서 index.html 파일을 더블 클릭하거나 브라우저 주소창에 다음을 입력하세요: environment12: 'file:///나의/html/경로' + environment14: ' (or ' + environment15: 'http://localhost:{your-port-num}/empty-example' + environment16: ' if you are using a local server)' environment13: ' ' your-first-sketch-title: 나의 첫 스케치 your-first-sketch-intro1: '기존 프로세싱 사용자라면 다음의 페이지를 읽어보세요: ' diff --git a/src/data/reference/en.json b/src/data/reference/en.json index 483e4ede85..524db96e3b 100644 --- a/src/data/reference/en.json +++ b/src/data/reference/en.json @@ -392,7 +392,7 @@ }, "triangle": { "description": [ - "Draws a trangle to the canvas. A triangle is a plane created by connecting three points. The first two arguments specify the first point, the middle two arguments specify the second point, and the last two arguments specify the third point." + "Draws a triangle to the canvas. A triangle is a plane created by connecting three points. The first two arguments specify the first point, the middle two arguments specify the second point, and the last two arguments specify the third point." ], "params": { "x1": "Number: x-coordinate of the first point", @@ -425,7 +425,7 @@ "description": [ "Modifies the location from which rectangles are drawn by changing the way in which parameters given to rect() are interpreted. ", "The default mode is CORNER, which interprets the first two parameters as the upper-left corner of the shape, while the third and fourth parameters are its width and height. ", - "rectMode(CORNERS) interprets the first two parameters as the location of one of the corner, and the third and fourth parameters as the location of the diagonally opposite corner. Note, the rectangle is drawn between the coordinates, so it is not neccesary that the first corner be the upper left corner. ", + "rectMode(CORNERS) interprets the first two parameters as the location of one of the corner, and the third and fourth parameters as the location of the diagonally opposite corner. Note, the rectangle is drawn between the coordinates, so it is not necessary that the first corner be the upper left corner. ", "rectMode(CENTER) interprets the first two parameters as the shape's center point, while the third and fourth parameters are its width and height. ", "rectMode(RADIUS) also uses the first two parameters as the shape's center point, but uses the third and fourth parameters to specify half of the shapes's width and height respectively. ", "The parameter to this method must be written in ALL CAPS because they are predefined as constants in ALL CAPS and Javascript is a case-sensitive language." @@ -578,7 +578,7 @@ "a": "Number: coordinate of first control point", "b": "Number: coordinate of first point on the curve", "c": "Number: coordinate of second point on the curve", - "d": "Number: coordinate of second conrol point", + "d": "Number: coordinate of second control point", "t": "Number: value between 0 and 1" } }, @@ -709,12 +709,12 @@ }, "DEGREES": { "description": [ - "Constant to be used with angleMode() function, to set the mode which p5.js interprates and calculates angles (either DEGREES or RADIANS)." + "Constant to be used with angleMode() function, to set the mode which p5.js interprets and calculates angles (either DEGREES or RADIANS)." ] }, "RADIANS": { "description": [ - "Constant to be used with angleMode() function, to set the mode which p5.js interprates and calculates angles (either RADIANS or DEGREES)." + "Constant to be used with angleMode() function, to set the mode which p5.js interprets and calculates angles (either RADIANS or DEGREES)." ] }, "CORNER": {}, @@ -1028,7 +1028,7 @@ "function": { "description": [ "Creates and names a function. A function is a set of statements that perform a task. ", - "Optionally, functions can have parameters. Parameters are variables that are scoped to the function, that can be assigned a value when calling the function.Multiple parameters can be given by seperating them with commmas. ", + "Optionally, functions can have parameters. Parameters are variables that are scoped to the function, that can be assigned a value when calling the function.Multiple parameters can be given by separating them with commas. ", "From the MDN entry: Declares a function with the specified parameters." ] }, @@ -1072,7 +1072,7 @@ "for": { "description": [ "for creates a loop that is useful for executing one section of code multiple times. ", - "A 'for loop' consists of three different expressions inside of a parenthesis, all of which are optional.These expressions are used to control the number of times the loop is run.The first expression is a statement that is used to set the initial state for the loop.The second expression is a condition that you would like to check before each loop. If this expression returns false then the loop will exit.The third expression is executed at the end of each loop. These expression are seperated by ; (semi-colon).In case of an empty expression, only a semi-colon is written. ", + "A 'for loop' consists of three different expressions inside of a parenthesis, all of which are optional.These expressions are used to control the number of times the loop is run.The first expression is a statement that is used to set the initial state for the loop.The second expression is a condition that you would like to check before each loop. If this expression returns false then the loop will exit.The third expression is executed at the end of each loop. These expression are separated by ; (semi-colon).In case of an empty expression, only a semi-colon is written. ", "The code inside of the loop body (in between the curly braces) is executed between the evaluation of the second and third expression. ", "As with any loop, it is important to ensure that the loop can 'exit', or that the test condition will eventually evaluate to false. The test condition with a for loop is the second expression detailed above. Ensuring that this expression can eventually become false ensures that your loop doesn't attempt to run an infinite amount of times, which can crash your browser. ", "From the MDN entry: Creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once." @@ -1219,7 +1219,7 @@ "rotate": { "description": [ "Rotates a shape by the amount specified by the angle parameter. This function accounts for angleMode, so angles can be entered in either RADIANS or DEGREES. ", - "Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). All tranformations are reset when draw() begins again. ", + "Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotate(HALF_PI) and then rotate(HALF_PI) is the same as rotate(PI). All transformations are reset when draw() begins again. ", "Technically, rotate() multiplies the current transformation matrix by a rotation matrix. This function can be further controlled by the push() and pop()." ], "params": { @@ -1230,7 +1230,7 @@ "rotateX": { "description": [ "Rotates a shape around X axis by the amount specified in angle parameter. The angles can be entered in either RADIANS or DEGREES. ", - "Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. All tranformations are reset when draw() begins again." + "Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. All transformations are reset when draw() begins again." ], "params": { "angle": "Number: the angle of rotation, specified in radians or degrees, depending on current angleMode" @@ -1239,7 +1239,7 @@ "rotateY": { "description": [ "Rotates a shape around Y axis by the amount specified in angle parameter. The angles can be entered in either RADIANS or DEGREES. ", - "Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. All tranformations are reset when draw() begins again." + "Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. All transformations are reset when draw() begins again." ], "params": { "angle": "Number: the angle of rotation, specified in radians or degrees, depending on current angleMode" @@ -1249,7 +1249,7 @@ "description": [ "Rotates a shape around Z axis by the amount specified in angle parameter. The angles can be entered in either RADIANS or DEGREES. ", "This method works in WEBGL mode only. ", - "Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. All tranformations are reset when draw() begins again." + "Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. All transformations are reset when draw() begins again." ], "params": { "angle": "Number: the angle of rotation, specified in radians or degrees, depending on current angleMode" @@ -5711,7 +5711,7 @@ }, "p5.MonoSynth": { "description": [ - "A MonoSynth is used as a single voice for sound synthesis. This is a class to be used in conjunction with the PolySynth class. Custom synthetisers should be built inheriting from this class." + "A MonoSynth is used as a single voice for sound synthesis. This is a class to be used in conjunction with the PolySynth class. Custom synthesizers should be built inheriting from this class." ], "play": { "description": [ @@ -5908,7 +5908,7 @@ "SoundFile object with a path to a file. ", "The p5.SoundFile may not be available immediately because it loads the file information asynchronously. ", "To do something with the sound as soon as it loads pass the name of a function as the second parameter. ", - "Only one file path is required. However, audio file formats (i.e. mp3, ogg, wav and m4a/aac) are not supported by all web browsers. If you want to ensure compatability, instead of a single file path, you may include an Array of filepaths, and the browser will choose a format that works." + "Only one file path is required. However, audio file formats (i.e. mp3, ogg, wav and m4a/aac) are not supported by all web browsers. If you want to ensure compatibility, instead of a single file path, you may include an Array of filepaths, and the browser will choose a format that works." ], "params": { "path": "String|Array: path to a sound file (String). Optionally, you may include multiple file formats in an array. Alternately, accepts an object from the HTML5 File API, or a p5.File.", @@ -6314,7 +6314,7 @@ "p5.Signal": { "description": [ "p5.Signal is a constant audio-rate signal used by p5.Oscillator and p5.Envelope for modulation math. ", - "This is necessary because Web Audio is processed on a seprate clock. For example, the p5 draw loop runs about 60 times per second. But the audio clock must process samples 44100 times per second. If we want to add a value to each of those samples, we can't do it in the draw loop, but we can do it by adding a constant-rate audio signal.tone.js." ], "returns": "Tone.Signal: A Signal object from the Tone.js library", @@ -6865,7 +6865,7 @@ }, "p5.Reverb": { "description": [ - "Reverb adds depth to a sound through a large number of decaying echoes. It creates the perception that sound is occurring in a physical space. The p5.Reverb has paramters for Time (how long does the reverb last) and decayRate (how much the sound decays with each echo) that can be set with the .set() or .process() methods. The p5.Convolver extends p5.Reverb allowing you to recreate the sound of actual physical spaces through convolution. ", + "Reverb adds depth to a sound through a large number of decaying echoes. It creates the perception that sound is occurring in a physical space. The p5.Reverb has parameters for Time (how long does the reverb last) and decayRate (how much the sound decays with each echo) that can be set with the .set() or .process() methods. The p5.Convolver extends p5.Reverb allowing you to recreate the sound of actual physical spaces through convolution. ", "This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available." ], "process": { @@ -6995,7 +6995,7 @@ ], "params": { "steps": "Number: (Optional) Steps in the part", - "tatums": "Number: (Optional) Divisions of a beat, e.g. use 1/4, or 0.25 for a quater note (default is 1/16, a sixteenth note)" + "tatums": "Number: (Optional) Divisions of a beat, e.g. use 1/4, or 0.25 for a quarter note (default is 1/16, a sixteenth note)" }, "setBPM": { "description": [ @@ -7207,7 +7207,7 @@ }, "p5.Compressor": { "description": [ - "Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on indivudal sound sources in addition to the master output. ", + "Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on individual sound sources in addition to the master output. ", "This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available." ], "compressor": { @@ -7230,7 +7230,7 @@ }, "set": { "description": [ - "Set the paramters of a compressor." + "Set the parameters of a compressor." ], "params": { "attack": "Number: The amount of time (in seconds) to reduce the gain by 10dB, default = .003, range 0 - 1", @@ -7362,7 +7362,7 @@ }, "p5.Gain": { "description": [ - "A gain node is usefull to set the relative volume of sound. It's typically used to build mixers." + "A gain node is useful to set the relative volume of sound. It's typically used to build mixers." ], "setInput": { "description": [ diff --git a/src/data/reference/es.json b/src/data/reference/es.json index 3643f51a12..4b95f42988 100644 --- a/src/data/reference/es.json +++ b/src/data/reference/es.json @@ -709,12 +709,12 @@ }, "DEGREES": { "description": [ - "Constant to be used with angleMode() function, to set the mode which p5.js interprates and calculates angles (either DEGREES or RADIANS)." + "Constant to be used with angleMode() function, to set the mode which p5.js interprets and calculates angles (either DEGREES or RADIANS)." ] }, "RADIANS": { "description": [ - "Constant to be used with angleMode() function, to set the mode which p5.js interprates and calculates angles (either RADIANS or DEGREES)." + "Constant to be used with angleMode() function, to set the mode which p5.js interprets and calculates angles (either RADIANS or DEGREES)." ] }, "CORNER": {}, @@ -1028,7 +1028,7 @@ "function": { "description": [ "Creates and names a function. A function is a set of statements that perform a task. ", - "Optionally, functions can have parameters. Parameters are variables that are scoped to the function, that can be assigned a value when calling the function.Multiple parameters can be given by seperating them with commmas. ", + "Optionally, functions can have parameters. Parameters are variables that are scoped to the function, that can be assigned a value when calling the function.Multiple parameters can be given by seperating them with commas. ", "From the MDN entry: Declares a function with the specified parameters." ] }, @@ -1072,7 +1072,7 @@ "for": { "description": [ "for creates a loop that is useful for executing one section of code multiple times. ", - "A 'for loop' consists of three different expressions inside of a parenthesis, all of which are optional.These expressions are used to control the number of times the loop is run.The first expression is a statement that is used to set the initial state for the loop.The second expression is a condition that you would like to check before each loop. If this expression returns false then the loop will exit.The third expression is executed at the end of each loop. These expression are seperated by ; (semi-colon).In case of an empty expression, only a semi-colon is written. ", + "A 'for loop' consists of three different expressions inside of a parenthesis, all of which are optional.These expressions are used to control the number of times the loop is run.The first expression is a statement that is used to set the initial state for the loop.The second expression is a condition that you would like to check before each loop. If this expression returns false then the loop will exit.The third expression is executed at the end of each loop. These expression are separated by ; (semi-colon).In case of an empty expression, only a semi-colon is written. ", "The code inside of the loop body (in between the curly braces) is executed between the evaluation of the second and third expression. ", "As with any loop, it is important to ensure that the loop can 'exit', or that the test condition will eventually evaluate to false. The test condition with a for loop is the second expression detailed above. Ensuring that this expression can eventually become false ensures that your loop doesn't attempt to run an infinite amount of times, which can crash your browser. ", "From the MDN entry: Creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once." @@ -5696,7 +5696,7 @@ }, "p5.MonoSynth": { "description": [ - "A MonoSynth is used as a single voice for sound synthesis. This is a class to be used in conjunction with the PolySynth class. Custom synthetisers should be built inheriting from this class." + "A MonoSynth is used as a single voice for sound synthesis. This is a class to be used in conjunction with the PolySynth class. Custom synthesizers should be built inheriting from this class." ], "play": { "description": [ @@ -5893,7 +5893,7 @@ "SoundFile object with a path to a file. ", "The p5.SoundFile may not be available immediately because it loads the file information asynchronously. ", "To do something with the sound as soon as it loads pass the name of a function as the second parameter. ", - "Only one file path is required. However, audio file formats (i.e. mp3, ogg, wav and m4a/aac) are not supported by all web browsers. If you want to ensure compatability, instead of a single file path, you may include an Array of filepaths, and the browser will choose a format that works." + "Only one file path is required. However, audio file formats (i.e. mp3, ogg, wav and m4a/aac) are not supported by all web browsers. If you want to ensure compatibility, instead of a single file path, you may include an Array of filepaths, and the browser will choose a format that works." ], "params": { "path": "String|Array: path to a sound file (String). Optionally, you may include multiple file formats in an array. Alternately, accepts an object from the HTML5 File API, or a p5.File.", @@ -6299,7 +6299,7 @@ "p5.Signal": { "description": [ "p5.Signal is a constant audio-rate signal used by p5.Oscillator and p5.Envelope for modulation math. ", - "This is necessary because Web Audio is processed on a seprate clock. For example, the p5 draw loop runs about 60 times per second. But the audio clock must process samples 44100 times per second. If we want to add a value to each of those samples, we can't do it in the draw loop, but we can do it by adding a constant-rate audio signal.tone.js." ], "returns": "Tone.Signal: A Signal object from the Tone.js library", @@ -6850,7 +6850,7 @@ }, "p5.Reverb": { "description": [ - "Reverb adds depth to a sound through a large number of decaying echoes. It creates the perception that sound is occurring in a physical space. The p5.Reverb has paramters for Time (how long does the reverb last) and decayRate (how much the sound decays with each echo) that can be set with the .set() or .process() methods. The p5.Convolver extends p5.Reverb allowing you to recreate the sound of actual physical spaces through convolution. ", + "Reverb adds depth to a sound through a large number of decaying echoes. It creates the perception that sound is occurring in a physical space. The p5.Reverb has parameters for Time (how long does the reverb last) and decayRate (how much the sound decays with each echo) that can be set with the .set() or .process() methods. The p5.Convolver extends p5.Reverb allowing you to recreate the sound of actual physical spaces through convolution. ", "This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available." ], "process": { @@ -6980,7 +6980,7 @@ ], "params": { "steps": "Number: (Optional) Steps in the part", - "tatums": "Number: (Optional) Divisions of a beat, e.g. use 1/4, or 0.25 for a quater note (default is 1/16, a sixteenth note)" + "tatums": "Number: (Optional) Divisions of a beat, e.g. use 1/4, or 0.25 for a quarter note (default is 1/16, a sixteenth note)" }, "setBPM": { "description": [ @@ -7192,7 +7192,7 @@ }, "p5.Compressor": { "description": [ - "Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on indivudal sound sources in addition to the master output. ", + "Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on individual sound sources in addition to the master output. ", "This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available." ], "compressor": { @@ -7215,7 +7215,7 @@ }, "set": { "description": [ - "Set the paramters of a compressor." + "Set the parameters of a compressor." ], "params": { "attack": "Number: The amount of time (in seconds) to reduce the gain by 10dB, default = .003, range 0 - 1", @@ -7347,7 +7347,7 @@ }, "p5.Gain": { "description": [ - "A gain node is usefull to set the relative volume of sound. It's typically used to build mixers." + "A gain node is useful to set the relative volume of sound. It's typically used to build mixers." ], "setInput": { "description": [ diff --git a/src/data/reference/ko.json b/src/data/reference/ko.json index a0cca51cbf..1e81bc85f5 100644 --- a/src/data/reference/ko.json +++ b/src/data/reference/ko.json @@ -5696,7 +5696,7 @@ }, "p5.MonoSynth": { "description": [ - "A MonoSynth is used as a single voice for sound synthesis. This is a class to be used in conjunction with the PolySynth class. Custom synthetisers should be built inheriting from this class." + "A MonoSynth is used as a single voice for sound synthesis. This is a class to be used in conjunction with the PolySynth class. Custom synthesizers should be built inheriting from this class." ], "play": { "description": [ @@ -5893,7 +5893,7 @@ "SoundFile object with a path to a file. ", "The p5.SoundFile may not be available immediately because it loads the file information asynchronously. ", "To do something with the sound as soon as it loads pass the name of a function as the second parameter. ", - "Only one file path is required. However, audio file formats (i.e. mp3, ogg, wav and m4a/aac) are not supported by all web browsers. If you want to ensure compatability, instead of a single file path, you may include an Array of filepaths, and the browser will choose a format that works." + "Only one file path is required. However, audio file formats (i.e. mp3, ogg, wav and m4a/aac) are not supported by all web browsers. If you want to ensure compatibility, instead of a single file path, you may include an Array of filepaths, and the browser will choose a format that works." ], "params": { "path": "String|Array: path to a sound file (String). Optionally, you may include multiple file formats in an array. Alternately, accepts an object from the HTML5 File API, or a p5.File.", @@ -6299,7 +6299,7 @@ "p5.Signal": { "description": [ "p5.Signal is a constant audio-rate signal used by p5.Oscillator and p5.Envelope for modulation math. ", - "This is necessary because Web Audio is processed on a seprate clock. For example, the p5 draw loop runs about 60 times per second. But the audio clock must process samples 44100 times per second. If we want to add a value to each of those samples, we can't do it in the draw loop, but we can do it by adding a constant-rate audio signal.tone.js." ], "returns": "Tone.Signal: A Signal object from the Tone.js library", @@ -6850,7 +6850,7 @@ }, "p5.Reverb": { "description": [ - "Reverb adds depth to a sound through a large number of decaying echoes. It creates the perception that sound is occurring in a physical space. The p5.Reverb has paramters for Time (how long does the reverb last) and decayRate (how much the sound decays with each echo) that can be set with the .set() or .process() methods. The p5.Convolver extends p5.Reverb allowing you to recreate the sound of actual physical spaces through convolution. ", + "Reverb adds depth to a sound through a large number of decaying echoes. It creates the perception that sound is occurring in a physical space. The p5.Reverb has parameters for Time (how long does the reverb last) and decayRate (how much the sound decays with each echo) that can be set with the .set() or .process() methods. The p5.Convolver extends p5.Reverb allowing you to recreate the sound of actual physical spaces through convolution. ", "This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available." ], "process": { @@ -6980,7 +6980,7 @@ ], "params": { "steps": "Number: (Optional) Steps in the part", - "tatums": "Number: (Optional) Divisions of a beat, e.g. use 1/4, or 0.25 for a quater note (default is 1/16, a sixteenth note)" + "tatums": "Number: (Optional) Divisions of a beat, e.g. use 1/4, or 0.25 for a quarter note (default is 1/16, a sixteenth note)" }, "setBPM": { "description": [ @@ -7192,7 +7192,7 @@ }, "p5.Compressor": { "description": [ - "Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on indivudal sound sources in addition to the master output. ", + "Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on individual sound sources in addition to the master output. ", "This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available." ], "compressor": { @@ -7215,7 +7215,7 @@ }, "set": { "description": [ - "Set the paramters of a compressor." + "Set the parameters of a compressor." ], "params": { "attack": "Number: The amount of time (in seconds) to reduce the gain by 10dB, default = .003, range 0 - 1", @@ -7347,7 +7347,7 @@ }, "p5.Gain": { "description": [ - "A gain node is usefull to set the relative volume of sound. It's typically used to build mixers." + "A gain node is useful to set the relative volume of sound. It's typically used to build mixers." ], "setInput": { "description": [ diff --git a/src/data/reference/zh-Hans.json b/src/data/reference/zh-Hans.json index 4e4932c29a..a80dbe187d 100644 --- a/src/data/reference/zh-Hans.json +++ b/src/data/reference/zh-Hans.json @@ -1028,7 +1028,7 @@ "function": { "description": [ "Creates and names a function. A function is a set of statements that perform a task. ", - "Optionally, functions can have parameters. Parameters are variables that are scoped to the function, that can be assigned a value when calling the function.Multiple parameters can be given by seperating them with commmas. ", + "Optionally, functions can have parameters. Parameters are variables that are scoped to the function, that can be assigned a value when calling the function.Multiple parameters can be given by seperating them with commas. ", "From the MDN entry: Declares a function with the specified parameters." ] }, @@ -1072,7 +1072,7 @@ "for": { "description": [ "for creates a loop that is useful for executing one section of code multiple times. ", - "A 'for loop' consists of three different expressions inside of a parenthesis, all of which are optional.These expressions are used to control the number of times the loop is run.The first expression is a statement that is used to set the initial state for the loop.The second expression is a condition that you would like to check before each loop. If this expression returns false then the loop will exit.The third expression is executed at the end of each loop. These expression are seperated by ; (semi-colon).In case of an empty expression, only a semi-colon is written. ", + "A 'for loop' consists of three different expressions inside of a parenthesis, all of which are optional.These expressions are used to control the number of times the loop is run.The first expression is a statement that is used to set the initial state for the loop.The second expression is a condition that you would like to check before each loop. If this expression returns false then the loop will exit.The third expression is executed at the end of each loop. These expression are separated by ; (semi-colon).In case of an empty expression, only a semi-colon is written. ", "The code inside of the loop body (in between the curly braces) is executed between the evaluation of the second and third expression. ", "As with any loop, it is important to ensure that the loop can 'exit', or that the test condition will eventually evaluate to false. The test condition with a for loop is the second expression detailed above. Ensuring that this expression can eventually become false ensures that your loop doesn't attempt to run an infinite amount of times, which can crash your browser. ", "From the MDN entry: Creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once." @@ -5696,7 +5696,7 @@ }, "p5.MonoSynth": { "description": [ - "A MonoSynth is used as a single voice for sound synthesis. This is a class to be used in conjunction with the PolySynth class. Custom synthetisers should be built inheriting from this class." + "A MonoSynth is used as a single voice for sound synthesis. This is a class to be used in conjunction with the PolySynth class. Custom synthesizers should be built inheriting from this class." ], "play": { "description": [ @@ -5893,7 +5893,7 @@ "SoundFile object with a path to a file. ", "The p5.SoundFile may not be available immediately because it loads the file information asynchronously. ", "To do something with the sound as soon as it loads pass the name of a function as the second parameter. ", - "Only one file path is required. However, audio file formats (i.e. mp3, ogg, wav and m4a/aac) are not supported by all web browsers. If you want to ensure compatability, instead of a single file path, you may include an Array of filepaths, and the browser will choose a format that works." + "Only one file path is required. However, audio file formats (i.e. mp3, ogg, wav and m4a/aac) are not supported by all web browsers. If you want to ensure compatibility, instead of a single file path, you may include an Array of filepaths, and the browser will choose a format that works." ], "params": { "path": "String|Array: path to a sound file (String). Optionally, you may include multiple file formats in an array. Alternately, accepts an object from the HTML5 File API, or a p5.File.", @@ -6299,7 +6299,7 @@ "p5.Signal": { "description": [ "p5.Signal is a constant audio-rate signal used by p5.Oscillator and p5.Envelope for modulation math. ", - "This is necessary because Web Audio is processed on a seprate clock. For example, the p5 draw loop runs about 60 times per second. But the audio clock must process samples 44100 times per second. If we want to add a value to each of those samples, we can't do it in the draw loop, but we can do it by adding a constant-rate audio signal.tone.js." ], "returns": "Tone.Signal: A Signal object from the Tone.js library", @@ -6850,7 +6850,7 @@ }, "p5.Reverb": { "description": [ - "Reverb adds depth to a sound through a large number of decaying echoes. It creates the perception that sound is occurring in a physical space. The p5.Reverb has paramters for Time (how long does the reverb last) and decayRate (how much the sound decays with each echo) that can be set with the .set() or .process() methods. The p5.Convolver extends p5.Reverb allowing you to recreate the sound of actual physical spaces through convolution. ", + "Reverb adds depth to a sound through a large number of decaying echoes. It creates the perception that sound is occurring in a physical space. The p5.Reverb has parameters for Time (how long does the reverb last) and decayRate (how much the sound decays with each echo) that can be set with the .set() or .process() methods. The p5.Convolver extends p5.Reverb allowing you to recreate the sound of actual physical spaces through convolution. ", "This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available." ], "process": { @@ -6980,7 +6980,7 @@ ], "params": { "steps": "Number: (Optional) Steps in the part", - "tatums": "Number: (Optional) Divisions of a beat, e.g. use 1/4, or 0.25 for a quater note (default is 1/16, a sixteenth note)" + "tatums": "Number: (Optional) Divisions of a beat, e.g. use 1/4, or 0.25 for a quarter note (default is 1/16, a sixteenth note)" }, "setBPM": { "description": [ @@ -7192,7 +7192,7 @@ }, "p5.Compressor": { "description": [ - "Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on indivudal sound sources in addition to the master output. ", + "Compressor is an audio effect class that performs dynamics compression on an audio input source. This is a very commonly used technique in music and sound production. Compression creates an overall louder, richer, and fuller sound by lowering the volume of louds and raising that of softs. Compression can be used to avoid clipping (sound distortion due to peaks in volume) and is especially useful when many sounds are played at once. Compression can be used on individual sound sources in addition to the master output. ", "This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available." ], "compressor": { @@ -7215,7 +7215,7 @@ }, "set": { "description": [ - "Set the paramters of a compressor." + "Set the parameters of a compressor." ], "params": { "attack": "Number: The amount of time (in seconds) to reduce the gain by 10dB, default = .003, range 0 - 1", @@ -7347,7 +7347,7 @@ }, "p5.Gain": { "description": [ - "A gain node is usefull to set the relative volume of sound. It's typically used to build mixers." + "A gain node is useful to set the relative volume of sound. It's typically used to build mixers." ], "setInput": { "description": [ diff --git a/src/data/zh-Hans.yml b/src/data/zh-Hans.yml index eb63ba79d6..bdb16169f1 100644 --- a/src/data/zh-Hans.yml +++ b/src/data/zh-Hans.yml @@ -87,6 +87,12 @@ get started: download1: 最简易的起点是使用 download2: p5.js 完整版 download3: 下载所提供的空白范例。 + download8: 'After download, you need to set up a local server. See instructions ' + download9: here + download10: >- + . Run your local server within the downloaded folder and on your browser, go + to + download11: 'http://localhost:{your-port-num}/empty-example' download4: >- 查看 index.html 您可以发现其中有个 p5.js 的链接。如果您想要使用极简化的档案(以加速网页加载的速度),将链接档案名改为 p5.min.js @@ -112,6 +118,9 @@ get started: environment10: p5 starter code opened up in sublime editor. environment11: 在文件浏览器内双击 index.html 以在您的网页浏览器内开启该档案,或您也可以直接在网页浏览器内的网址栏输入: environment12: 'file:///html文件在硬盘上的位置/' + environment14: ' (or ' + environment15: 'http://localhost:{your-port-num}/empty-example' + environment16: ' if you are using a local server)' environment13: 以查看您的绘图。 your-first-sketch-title: Your First Sketch your-first-sketch-intro1: 'In the ' diff --git a/src/templates/pages/download/index.hbs b/src/templates/pages/download/index.hbs index f1c2c29357..d9ac8e4470 100644 --- a/src/templates/pages/download/index.hbs +++ b/src/templates/pages/download/index.hbs @@ -36,7 +36,7 @@ slug: download/ @@ -60,5 +60,5 @@ slug: / - + {{!-- --}} \ No newline at end of file diff --git a/src/templates/pages/showcase/featuring/phuong-ngo.hbs b/src/templates/pages/showcase/featuring/phuong-ngo.hbs index c9716e410e..db7bce4e4e 100644 --- a/src/templates/pages/showcase/featuring/phuong-ngo.hbs +++ b/src/templates/pages/showcase/featuring/phuong-ngo.hbs @@ -12,10 +12,7 @@ slug: showcase/featuring/

Project Info

-
- -
+ A screenshot of a poster of Airi Flies, a game to help Airi fly by saying pew.
diff --git a/src/templates/pages/showcase/featuring/qianqian-ye.hbs b/src/templates/pages/showcase/featuring/qianqian-ye.hbs index 531b9bc392..b0fb5f5eb4 100644 --- a/src/templates/pages/showcase/featuring/qianqian-ye.hbs +++ b/src/templates/pages/showcase/featuring/qianqian-ye.hbs @@ -12,10 +12,7 @@ slug: showcase/featuring/

Project Info

-
- -
+ A guest talk video (Guest Talk #1) on Qtv by Qianqian Ye, featuring Kaikai and Cheng Xu.
diff --git a/src/templates/partials/footer.hbs b/src/templates/partials/footer.hbs index fdf6ca2d12..978949b4d3 100644 --- a/src/templates/partials/footer.hbs +++ b/src/templates/partials/footer.hbs @@ -4,7 +4,7 @@ title: footer