# p5.js

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

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

**Page:** 15

---

## [Cannot read properties of undefined (reading 'copy')](https://discourse.processing.org/t/cannot-read-properties-of-undefined-reading-copy/41019)

<div class="topic-metadata">

**Author:** [@bdooley](https://discourse.processing.org/u/bdooley)\
**Replies:** 1\
**Last updated:** [February 23, 2023, 11:13am UTC](https://discourse.processing.org/t/cannot-read-properties-of-undefined-reading-copy/41019 "2023-02-23T11:13:25Z")

</div>

Hi, I am working on a sketch with rectangles and circles slowly falling to the bottom of the screen at random angles, colliding with each other and the ground and walls. https://editor.p5js.org/bdooley7/sketches/RBeFV1…

---

## ['move() function is a reserved name' warning](https://discourse.processing.org/t/move-function-is-a-reserved-name-warning/40953)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 2\
**Last updated:** [February 21, 2023, 5:55pm UTC](https://discourse.processing.org/t/move-function-is-a-reserved-name-warning/40953 "2023-02-21T17:55:19Z")

</div>

Hi everyone, I’ve been defining and using in one of my sketch for year a move() function as this one: function move(){ print('hello'); } I’ve just updated p5js library used by this sketch (the previous one was…

---

## [Code was working not anymore](https://discourse.processing.org/t/code-was-working-not-anymore/40974)

<div class="topic-metadata">

**Author:** [@Mem](https://discourse.processing.org/u/Mem)\
**Replies:** 0\
**Last updated:** [February 21, 2023, 10:58am UTC](https://discourse.processing.org/t/code-was-working-not-anymore/40974 "2023-02-21T10:58:50Z")

</div>

Hi Guys, my code was working perfectly in p5js editor since 3 days ago, not sure why ? I was recording mouvement several time and save as preset, but it’s recording only the last record and and what ever preset play the …

---

## [Multiplying small numbers in shader causes strange behaviour](https://discourse.processing.org/t/multiplying-small-numbers-in-shader-causes-strange-behaviour/40949)

<div class="topic-metadata">

**Author:** [@jvolker](https://discourse.processing.org/u/jvolker)\
**Replies:** 4\
**Last updated:** [February 18, 2023, 10:30am UTC](https://discourse.processing.org/t/multiplying-small-numbers-in-shader-causes-strange-behaviour/40949 "2023-02-18T10:30:08Z")

</div>

Hi, I’m trying to create a fading effect on a masked image/graphics. I’ve implemented it here: p5.js Web Editor I’m trying to slow down the effect even more. Unfortunately, the shader behaves a little strangely when in…

---

## [Sketch crashing as soon as it starts playing](https://discourse.processing.org/t/sketch-crashing-as-soon-as-it-starts-playing/40955)

<div class="topic-metadata">

**Author:** [@bdooley](https://discourse.processing.org/u/bdooley)\
**Replies:** 5\
**Last updated:** [February 17, 2023, 9:39pm UTC](https://discourse.processing.org/t/sketch-crashing-as-soon-as-it-starts-playing/40955 "2023-02-17T21:39:25Z")

</div>

Hi, I am trying to make a sketch with falling squares and circles that collide with each other as well as the right and left wall and ground, but am having trouble with the sketch crashing as soon as pressing play, with…

---

## [How to create a 3D geometry with faceted reflection of light (sphere)](https://discourse.processing.org/t/how-to-create-a-3d-geometry-with-faceted-reflection-of-light-sphere/40932)

<div class="topic-metadata">

**Author:** [@peskythisdot](https://discourse.processing.org/u/peskythisdot)\
**Replies:** 7\
**Last updated:** [February 16, 2023, 1:10pm UTC](https://discourse.processing.org/t/how-to-create-a-3d-geometry-with-faceted-reflection-of-light-sphere/40932 "2023-02-16T13:10:04Z")

</div>

My goal is to create a 3d geometry with many facets, where each facet reflects light differently–a disco ball may be a good visual for what I want to say. I created a primitive 3d sphere with low numbers of detailX and …

---

## [P5js and RNBO - looking for an example](https://discourse.processing.org/t/p5js-and-rnbo-looking-for-an-example/40744)

<div class="topic-metadata">

**Author:** [@jaeho](https://discourse.processing.org/u/jaeho)\
**Replies:** 1\
**Last updated:** [February 13, 2023, 10:01am UTC](https://discourse.processing.org/t/p5js-and-rnbo-looking-for-an-example/40744 "2023-02-13T10:01:42Z")

</div>

I am attempting to utilize the brand-new RNBO from Cycling74 with p5js. Combining RNBO, which allows exporting MaxMSP patches to WebAudio, with p5js could give us a convenient way to create audio-visual works for the we…

---

## [Make Array of Objects Move](https://discourse.processing.org/t/make-array-of-objects-move/40902)

<div class="topic-metadata">

**Author:** [@Chigoz](https://discourse.processing.org/u/Chigoz)\
**Replies:** 4\
**Last updated:** [February 12, 2023, 6:42pm UTC](https://discourse.processing.org/t/make-array-of-objects-move/40902 "2023-02-12T18:42:22Z")

</div>

I am having a very hard time to make these array of objects that was parsed from a midi file to move, please him me out. This is the link to the code. Thanks in advance.

---

## [Using P5 on OffscreenCanvas?](https://discourse.processing.org/t/using-p5-on-offscreencanvas/40848)

<div class="topic-metadata">

**Author:** [@JohnC](https://discourse.processing.org/u/JohnC)\
**Replies:** 2\
**Last updated:** [February 10, 2023, 4:23pm UTC](https://discourse.processing.org/t/using-p5-on-offscreencanvas/40848 "2023-02-10T16:23:45Z")

</div>

Is there a way to manipulate OffscreenCanvas with p5? As far as I understand the source code, createGraphics does not use it.

---

## [P5js coding editor (own server) for iOS?](https://discourse.processing.org/t/p5js-coding-editor-own-server-for-ios/40869)

<div class="topic-metadata">

**Author:** [@Pastel](https://discourse.processing.org/u/Pastel)\
**Replies:** 1\
**Last updated:** [February 8, 2023, 6:47am UTC](https://discourse.processing.org/t/p5js-coding-editor-own-server-for-ios/40869 "2023-02-08T06:47:07Z")

</div>

At the moment I’m coding in openprocessing.org or ln my server through ssh. The first one can only edit files stored on its platform, the second solution isn’t comfortable. Any recommendations for an editor app with se…

---

## [Like OPC outside of Openprocessing.org?](https://discourse.processing.org/t/like-opc-outside-of-openprocessing-org/40837)

<div class="topic-metadata">

**Author:** [@Pastel](https://discourse.processing.org/u/Pastel)\
**Replies:** 2\
**Last updated:** [February 7, 2023, 12:10pm UTC](https://discourse.processing.org/t/like-opc-outside-of-openprocessing-org/40837 "2023-02-07T12:10:40Z")

</div>

I enjoy the easy usage of OPC in openprocessing.org. Is there a similar library that has adjustable sliders and switches in a collapsible and expandable area to use for p5js on my own pages? Thank you.

---

## [How to add a text as .txt file?](https://discourse.processing.org/t/how-to-add-a-text-as-txt-file/40839)

<div class="topic-metadata">

**Author:** [@Davo](https://discourse.processing.org/u/Davo)\
**Replies:** 10\
**Last updated:** [February 7, 2023, 10:21am UTC](https://discourse.processing.org/t/how-to-add-a-text-as-txt-file/40839 "2023-02-07T10:21:03Z")

</div>

Hola! Totally new here. I just want to change the text in this generative design text: How can I change this “faust\_kurz.txt” for my own text and include it as a .txt file?? …Just have no clue… function preload() { …

---

## [Relative file path formatting (Windows 11)](https://discourse.processing.org/t/relative-file-path-formatting-windows-11/40838)

<div class="topic-metadata">

**Author:** [@LuisGranados](https://discourse.processing.org/u/LuisGranados)\
**Replies:** 3\
**Last updated:** [February 6, 2023, 6:01pm UTC](https://discourse.processing.org/t/relative-file-path-formatting-windows-11/40838 "2023-02-06T18:01:41Z")

</div>

I want my P5.js sketch to be able to load images from a (very large) subdirectory of jpg files elsewhere on my laptop rather than from a subfolder of the P5 sketch folder. This code works, where I have a subdirectory cal…

---

## [Collision detection sketch running extremely slow](https://discourse.processing.org/t/collision-detection-sketch-running-extremely-slow/40844)

<div class="topic-metadata">

**Author:** [@bdooley](https://discourse.processing.org/u/bdooley)\
**Replies:** 0\
**Last updated:** [February 6, 2023, 1:33pm UTC](https://discourse.processing.org/t/collision-detection-sketch-running-extremely-slow/40844 "2023-02-06T13:33:43Z")

</div>

Hi, I’m working on a sketch drawing circles and squares that slowly fall to the bottom of the window and begin to stack. I first got things to work using matter.js here: https://editor.p5js.org/bdooley7/sketches/yY5Ej6…

---

## [Is there documentation geared toward a programmer of a structured language?](https://discourse.processing.org/t/is-there-documentation-geared-toward-a-programmer-of-a-structured-language/40830)

<div class="topic-metadata">

**Author:** [@skeletor53818](https://discourse.processing.org/u/skeletor53818)\
**Replies:** 3\
**Last updated:** [February 5, 2023, 2:31pm UTC](https://discourse.processing.org/t/is-there-documentation-geared-toward-a-programmer-of-a-structured-language/40830 "2023-02-05T14:31:44Z")

</div>

Hello I recently discovered the https://p5js.org website and have been playing around a bit but I feel a bit adrift. Is there some documentation on how this all works. My exact questions are: 1.) What computer languag…

---

## [How to start a sketch with full screen?](https://discourse.processing.org/t/how-to-start-a-sketch-with-full-screen/40824)

<div class="topic-metadata">

**Author:** [@adrinalino](https://discourse.processing.org/u/adrinalino)\
**Replies:** 3\
**Last updated:** [February 4, 2023, 1:06pm UTC](https://discourse.processing.org/t/how-to-start-a-sketch-with-full-screen/40824 "2023-02-04T13:06:21Z")

</div>

I’ve been trying multiple tactics to let my sketch open with a full screen. With processing you just put fullScreen(); in setup and the sketch occupies the entire screen. With p5js this does not work. The only way I ma…

---

## [P5.sound.min.js -\> could not load content for p5.sound.min.js.map](https://discourse.processing.org/t/p5-sound-min-js-could-not-load-content-for-p5-sound-min-js-map/40737)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.processing.org/u/Laurent)\
**Replies:** 0\
**Last updated:** [January 29, 2023, 3:45pm UTC](https://discourse.processing.org/t/p5-sound-min-js-could-not-load-content-for-p5-sound-min-js-map/40737 "2023-01-29T15:45:19Z")

</div>

Hi everyone, I’ve just updated p5js libraries of a sketch with the latest versions of p5.min.js and p5.sound.min.js files I’ve found on: https://p5js.org/download/. As I didn’t had updated those files for more than 3 ye…

---

## [Lint is giving error](https://discourse.processing.org/t/lint-is-giving-error/40694)

<div class="topic-metadata">

**Author:** [@AdityaShrivastav](https://discourse.processing.org/u/AdityaShrivastav)\
**Replies:** 1\
**Last updated:** [January 24, 2023, 10:05am UTC](https://discourse.processing.org/t/lint-is-giving-error/40694 "2023-01-24T10:05:27Z")

</div>

in every file i am getting i am getting this error by eslint, as you can see in the picture above the red color on the scroll bar. I found some solution for this on stackoverflow but could not find the most appropria…

---

## [New to Contributing!](https://discourse.processing.org/t/new-to-contributing/40685)

<div class="topic-metadata">

**Author:** [@dekuxdseek](https://discourse.processing.org/u/dekuxdseek)\
**Replies:** 1\
**Last updated:** [January 23, 2023, 6:05pm UTC](https://discourse.processing.org/t/new-to-contributing/40685 "2023-01-23T18:05:46Z")

</div>

Hey , I am Swastik , and I really want to contribute to p5.js library. As of now I am beginner in Javascript , I doubt if I have the required skill set to contribute, that's why I'd be glad if you may recommend some re…

---

## [Grab Midi Data from a parsed Midi File](https://discourse.processing.org/t/grab-midi-data-from-a-parsed-midi-file/40650)

<div class="topic-metadata">

**Author:** [@Chigoz](https://discourse.processing.org/u/Chigoz)\
**Replies:** 10\
**Last updated:** [January 22, 2023, 12:40pm UTC](https://discourse.processing.org/t/grab-midi-data-from-a-parsed-midi-file/40650 "2023-01-22T12:40:21Z")

</div>

Hi , I am trying to grab midi information from a parsed midi file, the code easily parses any midi file to JSON using tone.js but I don’t know how they extracted the midi information like note, velocity, time etc. I want…

---

## [Color change for overlapping objects](https://discourse.processing.org/t/color-change-for-overlapping-objects/40645)

<div class="topic-metadata">

**Author:** [@Pastel](https://discourse.processing.org/u/Pastel)\
**Replies:** 1\
**Last updated:** [January 19, 2023, 9:01am UTC](https://discourse.processing.org/t/color-change-for-overlapping-objects/40645 "2023-01-19T09:01:43Z")

</div>

With two objects (circles, rectangles, …) overlapping I’d like to color them in another color on the overlapping part. For example two objects are blue and the overlapping part is orange. Could this be done by any fil…

---

## [Position algorithm problem in for loop](https://discourse.processing.org/t/position-algorithm-problem-in-for-loop/40604)

<div class="topic-metadata">

**Author:** [@niuuin](https://discourse.processing.org/u/niuuin)\
**Replies:** 5\
**Last updated:** [January 19, 2023, 8:25am UTC](https://discourse.processing.org/t/position-algorithm-problem-in-for-loop/40604 "2023-01-19T08:25:41Z")

</div>

The current state is as shown in the figure, with “a” as the axis of movement, how to move with “d” as the axis in the current cycle? Here’s the current code, thanks for your help! function setup() { createCanvas(4…

---

## [Need Help with Running Local tests](https://discourse.processing.org/t/need-help-with-running-local-tests/40637)

<div class="topic-metadata">

**Author:** [@AdityaShrivastav](https://discourse.processing.org/u/AdityaShrivastav)\
**Replies:** 2\
**Last updated:** [January 19, 2023, 8:04am UTC](https://discourse.processing.org/t/need-help-with-running-local-tests/40637 "2023-01-19T08:04:59Z")

</div>

I need help with running tests on my computer. recently I was making changes to the project p5.js. when i read the contibuters guideline page there there were mentioned some tests which can be run through npm test or npm…

---

## [CCapture setup issue maybe chrome related?](https://discourse.processing.org/t/ccapture-setup-issue-maybe-chrome-related/40638)

<div class="topic-metadata">

**Author:** [@Tilman](https://discourse.processing.org/u/Tilman)\
**Replies:** 2\
**Last updated:** [January 18, 2023, 10:02pm UTC](https://discourse.processing.org/t/ccapture-setup-issue-maybe-chrome-related/40638 "2023-01-18T22:02:00Z")

</div>

Hi, today I tried many attempts to get the Ccapture library running without any luck. What makes me think it might be Chrome related is that I always get the buggy console feedback with any of my attempts. This is how t…

---

## [Is it possible to get an array of p5.Vectors from SVG file?](https://discourse.processing.org/t/is-it-possible-to-get-an-array-of-p5-vectors-from-svg-file/40609)

<div class="topic-metadata">

**Author:** [@grshch](https://discourse.processing.org/u/grshch)\
**Replies:** 2\
**Last updated:** [January 16, 2023, 10:13pm UTC](https://discourse.processing.org/t/is-it-possible-to-get-an-array-of-p5-vectors-from-svg-file/40609 "2023-01-16T22:13:00Z")

</div>

I see that p5js does not support SVG, but is there a known way to somehow extract data from an SVG file? Probably some library like Geomerative for Processing? I am building an online tool and I want it to work with use…

---

## [Transparency in background Processing vs P5.js](https://discourse.processing.org/t/transparency-in-background-processing-vs-p5-js/40570)

<div class="topic-metadata">

**Author:** [@adrinalino](https://discourse.processing.org/u/adrinalino)\
**Replies:** 1\
**Last updated:** [January 12, 2023, 11:03pm UTC](https://discourse.processing.org/t/transparency-in-background-processing-vs-p5-js/40570 "2023-01-12T23:03:23Z")

</div>

Hi there, I wanted my moving particles to leave a trail. In “The coding train” I noticed that this can me done in P5.js by calling “background(0,20);” 20 Being the transparency of the background. This does not work i…

---

## [Flappy bird p5.js](https://discourse.processing.org/t/flappy-bird-p5-js/40521)

<div class="topic-metadata">

**Author:** [@ctremblay](https://discourse.processing.org/u/ctremblay)\
**Replies:** 17\
**Last updated:** [January 12, 2023, 7:47pm UTC](https://discourse.processing.org/t/flappy-bird-p5-js/40521 "2023-01-12T19:47:02Z")

</div>

i’m trying to make an ai version of flappy birds, but when i go to save the bird it cant find the saved score. it keeps saying undefined when i console.log. sketch.js var bird = \[\]; var saved = \[\]; var paused = false; …

---

## [Calculate bob vector to a floor in 3D WEBGL](https://discourse.processing.org/t/calculate-bob-vector-to-a-floor-in-3d-webgl/40556)

<div class="topic-metadata">

**Author:** [@Tilman](https://discourse.processing.org/u/Tilman)\
**Replies:** 2\
**Last updated:** [January 12, 2023, 11:17am UTC](https://discourse.processing.org/t/calculate-bob-vector-to-a-floor-in-3d-webgl/40556 "2023-01-12T11:17:33Z")

</div>

Hi I try to visualize: Object (Red Sphere) can be dragged with the mouse in relation to a listeners head (White Sphere). And there is a floor (Grey rotated rectangle) The white lines indicate the direct sound wave to …

---

## [Audio INPUT via NDI](https://discourse.processing.org/t/audio-input-via-ndi/40524)

<div class="topic-metadata">

**Author:** [@salvier](https://discourse.processing.org/u/salvier)\
**Replies:** 1\
**Last updated:** [January 11, 2023, 10:25pm UTC](https://discourse.processing.org/t/audio-input-via-ndi/40524 "2023-01-11T22:25:41Z")

</div>

Hi, I am trying to do a music visualization (oscilloscope like) in p5js. The audio signal comes from vmix program using NDI protocol. I need to input this audio signal into p5js sketch in order to draw the visualitzat…

---

## [Apply gradient shader to a torus](https://discourse.processing.org/t/apply-gradient-shader-to-a-torus/40491)

<div class="topic-metadata">

**Author:** [@Tilman](https://discourse.processing.org/u/Tilman)\
**Replies:** 12\
**Last updated:** [January 11, 2023, 8:45pm UTC](https://discourse.processing.org/t/apply-gradient-shader-to-a-torus/40491 "2023-01-11T20:45:35Z")

</div>

Hi! I would like to color a torus red on the left half and blue on the right half surely with a transition. Best check my next post below as I made a mockup of what I want to accomplish. ↓↓↓

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

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