# p5.js

**URL:** https://discourse.processing.org/c/p5js/10.md?page=44

[Latest](https://discourse.processing.org/latest.md) · [Categories](https://discourse.processing.org/categories.md) · [Tags](https://discourse.processing.org/tags.md)

**Page:** 45

---

## [P5.js copy function slow performance since version 0.10.0](https://discourse.processing.org/t/p5-js-copy-function-slow-performance-since-version-0-10-0/30007)

<div class="topic-metadata">

**Author:** [@Esi](https://discourse.processing.org/u/Esi)\
**Replies:** 2\
**Last updated:** [May 10, 2021, 12:15pm UTC](https://discourse.processing.org/t/p5-js-copy-function-slow-performance-since-version-0-10-0/30007 "2021-05-10T12:15:19Z")

</div>

Hey everyone, my question is about the copy function. As many before I tried to recreate the tutorial of Tim Rodenbröcker about kinetic typography with p5. It runs very slow (3fps) in the current p5 version 1.3.1, but w…

---

## [Easiest way to save a canvas for access on the next webpage?](https://discourse.processing.org/t/easiest-way-to-save-a-canvas-for-access-on-the-next-webpage/29985)

<div class="topic-metadata">

**Author:** [@Gershy13](https://discourse.processing.org/u/Gershy13)\
**Replies:** 7\
**Last updated:** [May 10, 2021, 7:55am UTC](https://discourse.processing.org/t/easiest-way-to-save-a-canvas-for-access-on-the-next-webpage/29985 "2021-05-10T07:55:48Z")

</div>

If i needed to save the p5 canvas as an image file to somewhere on the webserver, and then have the next page pick it up and display it as a standard html image? How would I do this? I’m assuming i need to use PHP or som…

---

## [Arc in layer. How to put an arc() in a layer](https://discourse.processing.org/t/arc-in-layer-how-to-put-an-arc-in-a-layer/29991)

<div class="topic-metadata">

**Author:** [@patricio1979](https://discourse.processing.org/u/patricio1979)\
**Replies:** 9\
**Last updated:** [May 9, 2021, 10:48pm UTC](https://discourse.processing.org/t/arc-in-layer-how-to-put-an-arc-in-a-layer/29991 "2021-05-09T22:48:25Z")

</div>

let botonito, indice=-1, segmentos=\[\], global\_layer; let a,b,c,d,e,f; function setup() { var ww = windowWidth, wh = windowHeight; var wwg = ww/20, whg = wh/20; let uno = \[wwg\*8,whg\*2,wwg\*8,whg,3.14,6.28\], dos = …

---

## [Generate editable drawing of audio waveform from audio file in p5js?](https://discourse.processing.org/t/generate-editable-drawing-of-audio-waveform-from-audio-file-in-p5js/29926)

<div class="topic-metadata">

**Author:** [@Gershy13](https://discourse.processing.org/u/Gershy13)\
**Replies:** 7\
**Last updated:** [May 9, 2021, 12:22pm UTC](https://discourse.processing.org/t/generate-editable-drawing-of-audio-waveform-from-audio-file-in-p5js/29926 "2021-05-09T12:22:12Z")

</div>

Can anyone help me? Im trying to draw a audio waveform of an mp3 file in p5js. Essentially like what you would see on the track in a DAW like LogicPro/Audacity/Adobe Audition. I want the full track to be generated as a d…

---

## [Text function wrapping - Hyphens vs Full word line break](https://discourse.processing.org/t/text-function-wrapping-hyphens-vs-full-word-line-break/29975)

<div class="topic-metadata">

**Author:** [@mikthelegend](https://discourse.processing.org/u/mikthelegend)\
**Replies:** 2\
**Last updated:** [May 9, 2021, 11:12am UTC](https://discourse.processing.org/t/text-function-wrapping-hyphens-vs-full-word-line-break/29975 "2021-05-09T11:12:02Z")

</div>

Hello! I’m having trouble using the text() function in p5.js. I understand that when you provide 5 inputs to the function, the last four describe a rectangle in which it will wrap your provided string. However, in some …

---

## [Using swipe with p5.js](https://discourse.processing.org/t/using-swipe-with-p5-js/24287)

<div class="topic-metadata">

**Author:** [@BSiemens](https://discourse.processing.org/u/BSiemens)\
**Replies:** 1\
**Last updated:** [May 9, 2021, 8:27am UTC](https://discourse.processing.org/t/using-swipe-with-p5-js/24287 "2021-05-09T08:27:13Z")

</div>

Does anyone know of an example of the proper implementation of swipe left/right/up/down on mobile?

---

## [Animate vertex shapes on p5.js](https://discourse.processing.org/t/animate-vertex-shapes-on-p5-js/29966)

<div class="topic-metadata">

**Author:** [@yaelmogyoros](https://discourse.processing.org/u/yaelmogyoros)\
**Replies:** 1\
**Last updated:** [May 8, 2021, 7:54pm UTC](https://discourse.processing.org/t/animate-vertex-shapes-on-p5-js/29966 "2021-05-08T19:54:24Z")

</div>

hello everybody I have difficulty doing my homework. I need to make the tears I created using the curveVertex disappear one after the other like a timer and I tried everything everything i learned and I can’t figure ou…

---

## [Using Vertex in for loop to generate a curve](https://discourse.processing.org/t/using-vertex-in-for-loop-to-generate-a-curve/29964)

<div class="topic-metadata">

**Author:** [@ChadKagan](https://discourse.processing.org/u/ChadKagan)\
**Replies:** 4\
**Last updated:** [May 8, 2021, 8:43pm UTC](https://discourse.processing.org/t/using-vertex-in-for-loop-to-generate-a-curve/29964 "2021-05-08T20:43:27Z")

</div>

Hello, We are trying to draw a curve based on a formula that takes control points clicked on a canvas and generates a cubic B Spline curve. Our functions generate a series of points that should lie on the curve, but the…

---

## [Anyone know how to Convert p5js to processing?](https://discourse.processing.org/t/anyone-know-how-to-convert-p5js-to-processing/29952)

<div class="topic-metadata">

**Author:** [@98Mabs](https://discourse.processing.org/u/98Mabs)\
**Replies:** 2\
**Last updated:** [May 8, 2021, 8:49am UTC](https://discourse.processing.org/t/anyone-know-how-to-convert-p5js-to-processing/29952 "2021-05-08T08:49:51Z")

</div>

Hi guys, could anyone help me converting this code into Processing please? i really dont know how to convert it, and when i do it with the processing manual it doesn’t work…

---

## [P5 pixel array to copy canvas region to Image object](https://discourse.processing.org/t/p5-pixel-array-to-copy-canvas-region-to-image-object/29946)

<div class="topic-metadata">

**Author:** [@mattobject](https://discourse.processing.org/u/mattobject)\
**Replies:** 4\
**Last updated:** [May 8, 2021, 12:23am UTC](https://discourse.processing.org/t/p5-pixel-array-to-copy-canvas-region-to-image-object/29946 "2021-05-08T00:23:19Z")

</div>

Working on a project that uses the webcam, lays some graphics on top of the cam image, then I need to store the cam image with the overlayed graphics in an Image object variable. Currently, my code works but the resultin…

---

## [How can I use p5.js sketch as loader for website?](https://discourse.processing.org/t/how-can-i-use-p5-js-sketch-as-loader-for-website/29890)

<div class="topic-metadata">

**Author:** [@cn13](https://discourse.processing.org/u/cn13)\
**Replies:** 10\
**Last updated:** [May 7, 2021, 5:46am UTC](https://discourse.processing.org/t/how-can-i-use-p5-js-sketch-as-loader-for-website/29890 "2021-05-07T05:46:35Z")

</div>

hi there, i have created a p5.js sketch and tried to implement it on my website as a loader… the problem is, that i have to load the p5.js sketch in the body part of my HTML because the sketch would still be visible aft…

---

## [What does p5.Geometry do and how to use it?](https://discourse.processing.org/t/what-does-p5-geometry-do-and-how-to-use-it/29919)

<div class="topic-metadata">

**Author:** [@heyitsabhi](https://discourse.processing.org/u/heyitsabhi)\
**Replies:** 2\
**Last updated:** [May 7, 2021, 3:06am UTC](https://discourse.processing.org/t/what-does-p5-geometry-do-and-how-to-use-it/29919 "2021-05-07T03:06:58Z")

</div>

Could you please guys tell me what p5.Geometry is doing ? I searched the GitHub and References but doesn’t understand. Can someone please post an example on Geometry. Please explain to me what it does please…

---

## [How to assign HTML input forms to p5 variables?](https://discourse.processing.org/t/how-to-assign-html-input-forms-to-p5-variables/29915)

<div class="topic-metadata">

**Author:** [@Gershy13](https://discourse.processing.org/u/Gershy13)\
**Replies:** 2\
**Last updated:** [May 7, 2021, 12:30am UTC](https://discourse.processing.org/t/how-to-assign-html-input-forms-to-p5-variables/29915 "2021-05-07T00:30:16Z")

</div>

Hi, so ive just integrated my p5 sketch into my website which already has the gui made (buttons, sliders, color pickers etc) using HTML5/ standard HTML input modes. Im trying to figure out a way to link those inputs to …

---

## [(javascript) - ignore this post](https://discourse.processing.org/t/javascript-ignore-this-post/29861)

<div class="topic-metadata">

**Author:** [@UnderratedGuitarGUY](https://discourse.processing.org/u/UnderratedGuitarGUY)\
**Replies:** 7\
**Last updated:** [May 5, 2021, 12:27am UTC](https://discourse.processing.org/t/javascript-ignore-this-post/29861 "2021-05-05T00:27:11Z")

</div>

please format code with \</\> button \* homework policy \* asking questions IGNORE THIS POST

---

## [I would love some help on this code I am extremely stuck](https://discourse.processing.org/t/i-would-love-some-help-on-this-code-i-am-extremely-stuck/29858)

<div class="topic-metadata">

**Author:** [@yoda9633](https://discourse.processing.org/u/yoda9633)\
**Replies:** 3\
**Last updated:** [May 4, 2021, 9:39pm UTC](https://discourse.processing.org/t/i-would-love-some-help-on-this-code-i-am-extremely-stuck/29858 "2021-05-04T21:39:10Z")

</div>

I can’t get the square to go with the coordinate. I don’t know why its not syncing.

---

## [How do I access outer class I made?](https://discourse.processing.org/t/how-do-i-access-outer-class-i-made/29848)

<div class="topic-metadata">

**Author:** [@Menchi](https://discourse.processing.org/u/Menchi)\
**Replies:** 4\
**Last updated:** [May 4, 2021, 5:27pm UTC](https://discourse.processing.org/t/how-do-i-access-outer-class-i-made/29848 "2021-05-04T17:27:40Z")

</div>

Hi, i’m newbie to p5.js, and I just want to reproduce this simple code : https://www.youtube.com/watch?v=17WoOqgXsRM I’ve set up my p5 environment on Atom editor with local server to see my results on browser. So I hav…

---

## [Cannot read property 'x' of undefined. Problem reading parameters of vector](https://discourse.processing.org/t/cannot-read-property-x-of-undefined-problem-reading-parameters-of-vector/29831)

<div class="topic-metadata">

**Author:** [@Kentucky](https://discourse.processing.org/u/Kentucky)\
**Replies:** 2\
**Last updated:** [May 4, 2021, 7:48am UTC](https://discourse.processing.org/t/cannot-read-property-x-of-undefined-problem-reading-parameters-of-vector/29831 "2021-05-04T07:48:13Z")

</div>

Hello everybody, this is my first post so I hope everything is correct. I’m having trouble with the function pathFunction() (towards the end). What I want to do is to store the vector this.pos in the array “path” and th…

---

## [Backbuffer in p5js](https://discourse.processing.org/t/backbuffer-in-p5js/29769)

<div class="topic-metadata">

**Author:** [@BigBigRed](https://discourse.processing.org/u/BigBigRed)\
**Replies:** 12\
**Last updated:** [May 3, 2021, 8:45pm UTC](https://discourse.processing.org/t/backbuffer-in-p5js/29769 "2021-05-03T20:45:57Z")

</div>

I found a shader on the GLSL Sandbox website that I want to use. (It might be their e#375.15.) This shader wants to use WebGL’s backbuffer feature. It seems from a Google search that p5js does not allow reference to bac…

---

## [Avoid csv overlaps for website project](https://discourse.processing.org/t/avoid-csv-overlaps-for-website-project/29723)

<div class="topic-metadata">

**Author:** [@OptOut](https://discourse.processing.org/u/OptOut)\
**Replies:** 14\
**Last updated:** [May 2, 2021, 3:42pm UTC](https://discourse.processing.org/t/avoid-csv-overlaps-for-website-project/29723 "2021-05-02T15:42:30Z")

</div>

Hi everybody, I am starting a project that I want to be able to do/be the following: A single web page with three columns and many (thousands) of rows and many cells. the text based information in each cell will be fr…

---

## [GSOD Application](https://discourse.processing.org/t/gsod-application/29717)

<div class="topic-metadata">

**Author:** [@santam](https://discourse.processing.org/u/santam)\
**Replies:** 0\
**Last updated:** [April 29, 2021, 6:02am UTC](https://discourse.processing.org/t/gsod-application/29717 "2021-04-29T06:02:13Z")

</div>

Hey @stalgiag, this is Santam. I am a sophomore and proficient with javascript and have been using p5.js for over one year now. I wish to contribute to the documentation of the p5.js in GSOD under the project “New Contri…

---

## [Don't know what is missing for to code to work (flappy bird)](https://discourse.processing.org/t/dont-know-what-is-missing-for-to-code-to-work-flappy-bird/29711)

<div class="topic-metadata">

**Author:** [@JustinChan613](https://discourse.processing.org/u/JustinChan613)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 11:03pm UTC](https://discourse.processing.org/t/dont-know-what-is-missing-for-to-code-to-work-flappy-bird/29711 "2021-04-28T23:03:17Z")

</div>

Hi it’s me again. Right now I am dealing with another game - flappy bird. I am making the function of counting is player losing. I use if-else statement to determine whether the player’s losing. The coding flow seems to …

---

## [Auto Save in p5js editor?](https://discourse.processing.org/t/auto-save-in-p5js-editor/29706)

<div class="topic-metadata">

**Author:** [@CGMSTeacher](https://discourse.processing.org/u/CGMSTeacher)\
**Replies:** 1\
**Last updated:** [April 28, 2021, 4:23pm UTC](https://discourse.processing.org/t/auto-save-in-p5js-editor/29706 "2021-04-28T16:23:15Z")

</div>

I’m a Middle School teacher new to p5js and using it with one of my 6th grade classes. My students seem to keep loosing their work despite my constant reminders to manually save. (They are in the bad habit of assuming e…

---

## [How to improve my sketch board?](https://discourse.processing.org/t/how-to-improve-my-sketch-board/29698)

<div class="topic-metadata">

**Author:** [@turtle](https://discourse.processing.org/u/turtle)\
**Replies:** 4\
**Last updated:** [April 28, 2021, 1:05pm UTC](https://discourse.processing.org/t/how-to-improve-my-sketch-board/29698 "2021-04-28T13:05:34Z")

</div>

Yes, I am creating one sketch board for my students. At this moment, the sketch board is so simple just with Stroke, ColorPicker, Eraser, and one Clear button, the code is following: document.oncontextmenu=new Functio…

---

## [orbitControl() only works after a double tap (mobile)](https://discourse.processing.org/t/orbitcontrol-only-works-after-a-double-tap-mobile/29661)

<div class="topic-metadata">

**Author:** [@andypurbrick](https://discourse.processing.org/u/andypurbrick)\
**Replies:** 6\
**Last updated:** [April 28, 2021, 11:12am UTC](https://discourse.processing.org/t/orbitcontrol-only-works-after-a-double-tap-mobile/29661 "2021-04-28T11:12:21Z")

</div>

I have a sketch with a rotating cube that uses the orbitControl() to allow it to be moved on its X axis, however, orbit controls only work if I double tap the screen. As far as I’m aware this is not expected behaviour f…

---

## [Trig question re line/circle intersections](https://discourse.processing.org/t/trig-question-re-line-circle-intersections/29671)

<div class="topic-metadata">

**Author:** [@psemme](https://discourse.processing.org/u/psemme)\
**Replies:** 5\
**Last updated:** [April 28, 2021, 7:17am UTC](https://discourse.processing.org/t/trig-question-re-line-circle-intersections/29671 "2021-04-28T07:17:23Z")

</div>

I never really grok’d trig in school but have enjoyed learning it now as I’m older. And I stumble onto things that I really feel should have simple solutions but I end up staring at them for hours because I don’t have t…

---

## [How to change image on mouse click](https://discourse.processing.org/t/how-to-change-image-on-mouse-click/29692)

<div class="topic-metadata">

**Author:** [@ccotto](https://discourse.processing.org/u/ccotto)\
**Replies:** 6\
**Last updated:** [April 28, 2021, 12:12am UTC](https://discourse.processing.org/t/how-to-change-image-on-mouse-click/29692 "2021-04-28T00:12:32Z")

</div>

How do I change an image (of fruit) each time the user clicks on it with their mouse? This is for a drawing app where the user selects ‘brushes’ to draw on the screen with their mouse. /\* global createCanvas, resizeCanv…

---

## [Cant figure this out/help with code ASAP](https://discourse.processing.org/t/cant-figure-this-out-help-with-code-asap/29686)

<div class="topic-metadata">

**Author:** [@Astromdahl01](https://discourse.processing.org/u/Astromdahl01)\
**Replies:** 3\
**Last updated:** [April 27, 2021, 8:53pm UTC](https://discourse.processing.org/t/cant-figure-this-out-help-with-code-asap/29686 "2021-04-27T20:53:12Z")

</div>

Hello, I need Help with some code, I want The record to move around freely on the canvas and go to a random x and y and repeat constantly. is there a way I can do this? here is the link to y project https://editor.p5js.…

---

## [Need help with p5GUI in instance mode](https://discourse.processing.org/t/need-help-with-p5gui-in-instance-mode/29599)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 9\
**Last updated:** [April 27, 2021, 7:45pm UTC](https://discourse.processing.org/t/need-help-with-p5gui-in-instance-mode/29599 "2021-04-27T19:45:47Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I need to put in instance mode this code: ( sample of different p5gui examples) but i got an error of creategui… Here is my code: In basi…

---

## [P5 convolution does not decrease the sound amplitude](https://discourse.processing.org/t/p5-convolution-does-not-decrease-the-sound-amplitude/29452)

<div class="topic-metadata">

**Author:** [@fwullens](https://discourse.processing.org/u/fwullens)\
**Replies:** 7\
**Last updated:** [April 27, 2021, 10:07am UTC](https://discourse.processing.org/t/p5-convolution-does-not-decrease-the-sound-amplitude/29452 "2021-04-27T10:07:15Z")

</div>

Hi, I tried the nice example in the p5js.org examples page (examples | p5.js), though with my own sounds and reverb files. My goal is to make a convolution of an original signal with the impulse response of a filter whi…

---

## [All codes seem to be correct, but no response from system](https://discourse.processing.org/t/all-codes-seem-to-be-correct-but-no-response-from-system/29665)

<div class="topic-metadata">

**Author:** [@JustinChan613](https://discourse.processing.org/u/JustinChan613)\
**Replies:** 4\
**Last updated:** [April 27, 2021, 9:47am UTC](https://discourse.processing.org/t/all-codes-seem-to-be-correct-but-no-response-from-system/29665 "2021-04-27T09:47:22Z")

</div>

Still working on the tic tac toe, I have almost done the whole coding. Right now I am working on the random picking of players. When even the console.log is working, there is no response from the system. Would like to as…

[Previous page](https://discourse.processing.org/c/p5js/10.md?page=43)

[Next page](https://discourse.processing.org/c/p5js/10.md?page=45)
