# p5.js

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

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

**Page:** 6

---

## [Import class other file syntax error](https://discourse.processing.org/t/import-class-other-file-syntax-error/45358)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 18\
**Last updated:** [November 22, 2024, 10:43am UTC](https://discourse.processing.org/t/import-class-other-file-syntax-error/45358 "2024-11-22T10:43:15Z")

</div>

Im facing this error: SyntaxError: import declarations may only appear at top level of a module in Webstorm. When i have: sketch.js import Animal from "path to animal.js"; function setup() { const dog = new Animal…

---

## [In the book "Getting Started with p5.js" - missing media.zip](https://discourse.processing.org/t/in-the-book-getting-started-with-p5-js-missing-media-zip/8925)

<div class="topic-metadata">

**Author:** [@dougouverson](https://discourse.processing.org/u/dougouverson)\
**Replies:** 6\
**Last updated:** [November 13, 2024, 11:23pm UTC](https://discourse.processing.org/t/in-the-book-getting-started-with-p5-js-missing-media-zip/8925 "2024-11-13T23:23:52Z")

</div>

Hello, Not sure if this is the place to share, but the media.zip are missing at https://p5js.org/learn/books/media.zip Get a 404 Not Found. KInd regards,

---

## [Help with noise](https://discourse.processing.org/t/help-with-noise/45315)

<div class="topic-metadata">

**Author:** [@Stoli](https://discourse.processing.org/u/Stoli)\
**Replies:** 5\
**Last updated:** [November 13, 2024, 6:47pm UTC](https://discourse.processing.org/t/help-with-noise/45315 "2024-11-13T18:47:41Z")

</div>

I found this image and it looks like it was generated using noise. I’ve tried a bunch of different variations on the noise() function and have come up with some very interesting images but can’t seem to achieve anyth…

---

## [Convolution example doesn't work in p5 editor](https://discourse.processing.org/t/convolution-example-doesnt-work-in-p5-editor/45212)

<div class="topic-metadata">

**Author:** [@Chloros](https://discourse.processing.org/u/Chloros)\
**Replies:** 9\
**Last updated:** [November 8, 2024, 10:06pm UTC](https://discourse.processing.org/t/convolution-example-doesnt-work-in-p5-editor/45212 "2024-11-08T22:06:15Z")

</div>

Hi, I want to customize the image convolution example from the archive web site (https://archive.p5js.org/examples/image-convolution.html) but it doesn’t work outside the example page. When I paste it in the p5 editor w…

---

## [Help in P5.js (for fun program)](https://discourse.processing.org/t/help-in-p5-js-for-fun-program/45249)

<div class="topic-metadata">

**Author:** [@Epcrftr292](https://discourse.processing.org/u/Epcrftr292)\
**Replies:** 6\
**Last updated:** [November 6, 2024, 1:45am UTC](https://discourse.processing.org/t/help-in-p5-js-for-fun-program/45249 "2024-11-06T01:45:51Z")

</div>

Hello! I am having trouble with creating a stopwatch, timer, and decade clock in one program. I am currently having trouble with setting the years, months, etc. Down to milliseconds and have it count down on the timer pa…

---

## [I know react and javascript can i contribute ? if so please guide me](https://discourse.processing.org/t/i-know-react-and-javascript-can-i-contribute-if-so-please-guide-me/45259)

<div class="topic-metadata">

**Author:** [@Mangangcha](https://discourse.processing.org/u/Mangangcha)\
**Replies:** 1\
**Last updated:** [November 2, 2024, 8:32am UTC](https://discourse.processing.org/t/i-know-react-and-javascript-can-i-contribute-if-so-please-guide-me/45259 "2024-11-02T08:32:42Z")

</div>

i know react and javascript can i contribute ? if so please guide me…

---

## [Revamp the Friendly Error System for p5.js 2.0](https://discourse.processing.org/t/revamp-the-friendly-error-system-for-p5-js-2-0/45257)

<div class="topic-metadata">

**Author:** [@miaoye](https://discourse.processing.org/u/miaoye)\
**Replies:** 0\
**Last updated:** [November 1, 2024, 2:45am UTC](https://discourse.processing.org/t/revamp-the-friendly-error-system-for-p5-js-2-0/45257 "2024-11-01T02:45:27Z")

</div>

Hi everyone! My name is Miaoye Que, and I’m one of the pr05 grantees in the inaugural cohort of the pr05 program. My project is Revamp the Friendly Error System for p5.js 2.0, which consisted of two major areas: Parame…

---

## [Can i contribute as a frontend developer](https://discourse.processing.org/t/can-i-contribute-as-a-frontend-developer/44678)

<div class="topic-metadata">

**Author:** [@Mangangcha](https://discourse.processing.org/u/Mangangcha)\
**Replies:** 3\
**Last updated:** [October 30, 2024, 6:45am UTC](https://discourse.processing.org/t/can-i-contribute-as-a-frontend-developer/44678 "2024-10-30T06:45:17Z")

</div>

i know frontend development. can i contribute on this?

---

## [Passing data to shader using texture](https://discourse.processing.org/t/passing-data-to-shader-using-texture/44446)

<div class="topic-metadata">

**Author:** [@ekez](https://discourse.processing.org/u/ekez)\
**Replies:** 2\
**Last updated:** [October 25, 2024, 12:13am UTC](https://discourse.processing.org/t/passing-data-to-shader-using-texture/44446 "2024-10-25T00:13:27Z")

</div>

Hi there, I want to pass timeseries data into a shader. Because the data is potentially quite long, I am trying to do so by writing the data to a texture, then passing the texture to my shader. I’m finding the texture d…

---

## [Boolean operation in polygons](https://discourse.processing.org/t/boolean-operation-in-polygons/23439)

<div class="topic-metadata">

**Author:** [@mmatty](https://discourse.processing.org/u/mmatty)\
**Replies:** 15\
**Last updated:** [October 6, 2024, 7:05pm UTC](https://discourse.processing.org/t/boolean-operation-in-polygons/23439 "2024-10-06T19:05:26Z")

</div>

Hi, wondering if anyone came across a solution to merge/union/intersect polygons? Not just drawing them with the same fill color, but actually creating a new shape which is a fusion of other arbitrary shapes. I can do …

---

## [How to detect if 2 instances of one function are the same (aka how to detect a twin)?](https://discourse.processing.org/t/how-to-detect-if-2-instances-of-one-function-are-the-same-aka-how-to-detect-a-twin/45128)

<div class="topic-metadata">

**Author:** [@willemr](https://discourse.processing.org/u/willemr)\
**Replies:** 10\
**Last updated:** [October 5, 2024, 5:24pm UTC](https://discourse.processing.org/t/how-to-detect-if-2-instances-of-one-function-are-the-same-aka-how-to-detect-a-twin/45128 "2024-10-05T17:24:20Z")

</div>

First of all, sorry for the confusing title. My sketch will make it clearer. I have written a function that makes faces that are composed of seperate but overlayed facial elements (which are png’s): -head shape -nose …

---

## [P5js - Why can't I apply this specific invert clip to a shape?](https://discourse.processing.org/t/p5js-why-cant-i-apply-this-specific-invert-clip-to-a-shape/45132)

<div class="topic-metadata">

**Author:** [@pedromgoncalves](https://discourse.processing.org/u/pedromgoncalves)\
**Replies:** 2\
**Last updated:** [October 4, 2024, 9:16am UTC](https://discourse.processing.org/t/p5js-why-cant-i-apply-this-specific-invert-clip-to-a-shape/45132 "2024-10-04T09:16:30Z")

</div>

Hi :slight\_smile: I’m trying to apply an invert clip to a shape, but, for this specific clip shape, the clip is not being applied to the shape. It works if the clip is not inverted, and it works with other clips, such a…

---

## [I want to control 'scroll' through 'p5' 'mouseWheel' function](https://discourse.processing.org/t/i-want-to-control-scroll-through-p5-mousewheel-function/45127)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 10\
**Last updated:** [October 3, 2024, 10:33pm UTC](https://discourse.processing.org/t/i-want-to-control-scroll-through-p5-mousewheel-function/45127 "2024-10-03T22:33:40Z")

</div>

I want to control ‘scroll’ through ‘p5’ ‘mouseWheel’ function. Hello. Nice to meet you. Please refer to the picture. I want to control up and down through ‘function mouseWheel(event)’. Can I control scroll through…

---

## [Is it possible to pause functions?](https://discourse.processing.org/t/is-it-possible-to-pause-functions/45120)

<div class="topic-metadata">

**Author:** [@dom](https://discourse.processing.org/u/dom)\
**Replies:** 2\
**Last updated:** [October 2, 2024, 7:16am UTC](https://discourse.processing.org/t/is-it-possible-to-pause-functions/45120 "2024-10-02T07:16:02Z")

</div>

I want to create a series of overlapping videos using P5JS, each one slightly more delayed than the previous and with delays that change their values. The issue I am finding is that there does not appear to be an easy wa…

---

## [Anyone noticing that autosave sometimes goes inactive for more than 20 minutes. Is this expected behavior?](https://discourse.processing.org/t/anyone-noticing-that-autosave-sometimes-goes-inactive-for-more-than-20-minutes-is-this-expected-behavior/45072)

<div class="topic-metadata">

**Author:** [@chileed](https://discourse.processing.org/u/chileed)\
**Replies:** 1\
**Last updated:** [September 21, 2024, 4:11pm UTC](https://discourse.processing.org/t/anyone-noticing-that-autosave-sometimes-goes-inactive-for-more-than-20-minutes-is-this-expected-behavior/45072 "2024-09-21T16:11:46Z")

</div>

---

## [createCapture() captures video but can only draw first frame](https://discourse.processing.org/t/createcapture-captures-video-but-can-only-draw-first-frame/45015)

<div class="topic-metadata">

**Author:** [@weeklyd3](https://discourse.processing.org/u/weeklyd3)\
**Replies:** 3\
**Last updated:** [September 1, 2024, 12:58am UTC](https://discourse.processing.org/t/createcapture-captures-video-but-can-only-draw-first-frame/45015 "2024-09-01T00:58:24Z")

</div>

I’m trying to draw video from the webcam on a canvas: function update() { draw.clear(); draw.image(camera.get(), 0, 0); } var s = function(sketch) { sketch.setup = function() { sketch.createCanvas(640, 480); came…

---

## [Is there an auto grader / test cases for mouse / keyboard interactims?](https://discourse.processing.org/t/is-there-an-auto-grader-test-cases-for-mouse-keyboard-interactims/44997)

<div class="topic-metadata">

**Author:** [@the](https://discourse.processing.org/u/the)\
**Replies:** 0\
**Last updated:** [August 26, 2024, 7:13pm UTC](https://discourse.processing.org/t/is-there-an-auto-grader-test-cases-for-mouse-keyboard-interactims/44997 "2024-08-26T19:13:56Z")

</div>

Is there a way to include test cases inp5js that use mouse and keyboard interactions for auto-grading?

---

## [Simple Perlin noise random walk behavior in C++](https://discourse.processing.org/t/simple-perlin-noise-random-walk-behavior-in-c/44975)

<div class="topic-metadata">

**Author:** [@Tilman](https://discourse.processing.org/u/Tilman)\
**Replies:** 1\
**Last updated:** [August 22, 2024, 4:27pm UTC](https://discourse.processing.org/t/simple-perlin-noise-random-walk-behavior-in-c/44975 "2024-08-22T16:27:14Z")

</div>

We are trying to get this same random walk behaviour from the simple perlin noise random walk as in the p5.js sketch below. But for us in C++ with openFrameworks Perlin Noise we get a behaviour where the dot is always dr…

---

## [Problems with capturing webm using CCapture.js library](https://discourse.processing.org/t/problems-with-capturing-webm-using-ccapture-js-library/44965)

<div class="topic-metadata">

**Author:** [@J\_Silva](https://discourse.processing.org/u/J_Silva)\
**Replies:** 1\
**Last updated:** [August 20, 2024, 4:19pm UTC](https://discourse.processing.org/t/problems-with-capturing-webm-using-ccapture-js-library/44965 "2024-08-20T16:19:34Z")

</div>

Hi. I have a small code that rotates a textured sphere. My goal is to record this sketch. I tried the saveGif() function but it did not give a smooth result; so, I am trying the CCapture.js library because it’s said to b…

---

## [Export SVG file from p5.js?](https://discourse.processing.org/t/export-svg-file-from-p5-js/38400)

<div class="topic-metadata">

**Author:** [@dirka](https://discourse.processing.org/u/dirka)\
**Replies:** 14\
**Last updated:** [August 11, 2024, 7:48pm UTC](https://discourse.processing.org/t/export-svg-file-from-p5-js/38400 "2024-08-11T19:48:39Z")

</div>

Hello, I am brand new to p5.js having only reached video #13 from the Coding Train. I’m already having fun creating things and now I would like to save what the canvas looks like into a .svg file. Is there an “easy way…

---

## [Problem with a variable that doesn't work well between class definition and global variables](https://discourse.processing.org/t/problem-with-a-variable-that-doesnt-work-well-between-class-definition-and-global-variables/44905)

<div class="topic-metadata">

**Author:** [@rasabh](https://discourse.processing.org/u/rasabh)\
**Replies:** 1\
**Last updated:** [August 7, 2024, 11:52am UTC](https://discourse.processing.org/t/problem-with-a-variable-that-doesnt-work-well-between-class-definition-and-global-variables/44905 "2024-08-07T11:52:36Z")

</div>

i have a problem with the variable that i defined named ‘ballSpeed’ that i expected that it should become a greater number when mouse is pressed but it’s speed won’t change. on the other hand, other variables such as col…

---

## [Processing should define Array just like it has Vector](https://discourse.processing.org/t/processing-should-define-array-just-like-it-has-vector/44840)

<div class="topic-metadata">

**Author:** [@project\_2501](https://discourse.processing.org/u/project_2501)\
**Replies:** 24\
**Last updated:** [July 30, 2024, 10:50pm UTC](https://discourse.processing.org/t/processing-should-define-array-just-like-it-has-vector/44840 "2024-07-30T22:50:47Z")

</div>

Working with 2-dimensional is a very common scenario in creative coding. Processing should define an Array and how it can be used (methods?) - just like it has with Vector. The level of support without Processing manda…

---

## [Multiple readback operations](https://discourse.processing.org/t/multiple-readback-operations/44760)

<div class="topic-metadata">

**Author:** [@AlexAbS](https://discourse.processing.org/u/AlexAbS)\
**Replies:** 1\
**Last updated:** [July 26, 2024, 12:18pm UTC](https://discourse.processing.org/t/multiple-readback-operations/44760 "2024-07-26T12:18:23Z")

</div>

Hello. I am using p5.js and notice chrome notification about “Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true”. How can I pass in p5js canvas a context option …

---

## [HSL 210 hue should be in blue but rendering green](https://discourse.processing.org/t/hsl-210-hue-should-be-in-blue-but-rendering-green/44788)

<div class="topic-metadata">

**Author:** [@Leo\_Aguiar](https://discourse.processing.org/u/Leo_Aguiar)\
**Replies:** 1\
**Last updated:** [July 20, 2024, 11:49pm UTC](https://discourse.processing.org/t/hsl-210-hue-should-be-in-blue-but-rendering-green/44788 "2024-07-20T23:49:48Z")

</div>

Hi I’m making a plot of different colors on a 2d mapping of hsl color space. I think I have something wrong. The hue value of 210 should give a blue color but what is being drawn is green. let dim = 100; let mult = 5; …

---

## [Loading bar for loading image](https://discourse.processing.org/t/loading-bar-for-loading-image/44636)

<div class="topic-metadata">

**Author:** [@bulbx](https://discourse.processing.org/u/bulbx)\
**Replies:** 13\
**Last updated:** [July 16, 2024, 3:50pm UTC](https://discourse.processing.org/t/loading-bar-for-loading-image/44636 "2024-07-16T15:50:52Z")

</div>

Hello everyone (medium level in p5 / English is not my native language…) I am currently making my website in p5, it is almost finished. It’s quite simple, a sort of slideshow. I would like to have a loading bar for l…

---

## [Unable to setup p5js web editor locally](https://discourse.processing.org/t/unable-to-setup-p5js-web-editor-locally/44730)

<div class="topic-metadata">

**Author:** [@faisu](https://discourse.processing.org/u/faisu)\
**Replies:** 5\
**Last updated:** [July 15, 2024, 3:33pm UTC](https://discourse.processing.org/t/unable-to-setup-p5js-web-editor-locally/44730 "2024-07-15T15:33:28Z")

</div>

When I run npm start in my p5js-web-editor repo. I get this error: /Users/faisal\_imtiyaz/Desktop/openSource/p5.js-web-editor/server/server.js:44 var MongoStore = (0, \_connectMongo\["default"\])(\_expressSession\["default"\])…

---

## [Poll - p5js.org Search Bar Improvements](https://discourse.processing.org/t/poll-p5js-org-search-bar-improvements/19380)

<div class="topic-metadata">

**Author:** [@codengame](https://discourse.processing.org/u/codengame)\
**Replies:** 3\
**Last updated:** [July 6, 2024, 6:39pm UTC](https://discourse.processing.org/t/poll-p5js-org-search-bar-improvements/19380 "2024-07-06T18:39:25Z")

</div>

Hey fellow p5.js users! This topic is regarding possible changes that can be made to the search bar that is present on the p5.js main website - https://p5js.org/. Feel free to comment your views/suggestions on this topi…

---

## [Having trouble getting p5.SoundRecorder to work](https://discourse.processing.org/t/having-trouble-getting-p5-soundrecorder-to-work/44626)

<div class="topic-metadata">

**Author:** [@ASKproduKtion](https://discourse.processing.org/u/ASKproduKtion)\
**Replies:** 3\
**Last updated:** [June 26, 2024, 6:06am UTC](https://discourse.processing.org/t/having-trouble-getting-p5-soundrecorder-to-work/44626 "2024-06-26T06:06:00Z")

</div>

I have a p5.js sketch that integrates some Tone.js music functions adapted from @mattdesl I have added a p5.SoundRecorder from reference | p5.js following is the p5.js project \>\> p5.js Web Editor my intention is to ma…

---

## [How to do this programmatically (Combinatorics?)](https://discourse.processing.org/t/how-to-do-this-programmatically-combinatorics/38847)

<div class="topic-metadata">

**Author:** [@vkbr](https://discourse.processing.org/u/vkbr)\
**Replies:** 9\
**Last updated:** [June 17, 2024, 12:16pm UTC](https://discourse.processing.org/t/how-to-do-this-programmatically-combinatorics/38847 "2024-06-17T12:16:39Z")

</div>

A math question. Sorry if it’s a dumb one, but I couldn’t solve it. I wrote this with this for four points. All possibles lines, no repeating. pvline(p0, p1); pvline(p0, p2); pvline(p0, p3); …

---

## [I can't make my lorenz attractor balls opaque help pls](https://discourse.processing.org/t/i-cant-make-my-lorenz-attractor-balls-opaque-help-pls/44599)

<div class="topic-metadata">

**Author:** [@mayara](https://discourse.processing.org/u/mayara)\
**Replies:** 3\
**Last updated:** [June 15, 2024, 1:10am UTC](https://discourse.processing.org/t/i-cant-make-my-lorenz-attractor-balls-opaque-help-pls/44599 "2024-06-15T01:10:37Z")

</div>

I want to make the balls in this code opaque but whenever I try the balls stop appearing help plssssssssss im going crazyyyyy :anguished: :anguished: :sob: :sob: :cry: :confounded: :confounded: \<let o = 10; let p = 28…

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

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