# p5.js

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

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

**Page:** 75

---

## [P5.sound problem with chrome and opera](https://discourse.processing.org/t/p5-sound-problem-with-chrome-and-opera/19500)

<div class="topic-metadata">

**Author:** [@iana](https://discourse.processing.org/u/iana)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 10:22am UTC](https://discourse.processing.org/t/p5-sound-problem-with-chrome-and-opera/19500 "2020-04-14T10:22:57Z")

</div>

function setup(){ } It seems that any p5.js code (as above) in combination with loading any p5.sound library results in an error in latest versions of Chrome and Opera when run on a http web server (Apache linux). Run…

---

## [Changing target positions of vehicles](https://discourse.processing.org/t/changing-target-positions-of-vehicles/19738)

<div class="topic-metadata">

**Author:** [@poppyseeds](https://discourse.processing.org/u/poppyseeds)\
**Replies:** 4\
**Last updated:** [April 14, 2020, 9:42am UTC](https://discourse.processing.org/t/changing-target-positions-of-vehicles/19738 "2020-04-14T09:42:26Z")

</div>

In this project, I have used the text to point function to create vehicles which exhibit the seek, arrive and flee behaviours. Currently, the vehicles form the word ‘SWIMMY’ which is the start and target position. On cli…

---

## [Can not load images/files easily like before?!](https://discourse.processing.org/t/can-not-load-images-files-easily-like-before/19760)

<div class="topic-metadata">

**Author:** [@megarou](https://discourse.processing.org/u/megarou)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 1:38am UTC](https://discourse.processing.org/t/can-not-load-images-files-easily-like-before/19760 "2020-04-14T01:38:22Z")

</div>

Hello there, i’m having an big issues/problems in loading & inserting images in to p5.js, lately the new editing of the program, it ask you to enter the file’s name, & when i entered the file/image’s name; it doesn’t acc…

---

## [How can i get a line to move in a curve to a specific region on the canvas?](https://discourse.processing.org/t/how-can-i-get-a-line-to-move-in-a-curve-to-a-specific-region-on-the-canvas/19656)

<div class="topic-metadata">

**Author:** [@yasinyer](https://discourse.processing.org/u/yasinyer)\
**Replies:** 3\
**Last updated:** [April 13, 2020, 1:04pm UTC](https://discourse.processing.org/t/how-can-i-get-a-line-to-move-in-a-curve-to-a-specific-region-on-the-canvas/19656 "2020-04-13T13:04:29Z")

</div>

Hi guys! I’m a newbie in programming and could really use the help of you experts for my bachelor project. What I already have is a line that moves in a curve when turning, based on the arrowkeys. This line is only abl…

---

## [Buttons on my canvas move as I resize or maximize the browser window. How do I stop this?](https://discourse.processing.org/t/buttons-on-my-canvas-move-as-i-resize-or-maximize-the-browser-window-how-do-i-stop-this/19687)

<div class="topic-metadata">

**Author:** [@Bassam](https://discourse.processing.org/u/Bassam)\
**Replies:** 5\
**Last updated:** [April 12, 2020, 8:54pm UTC](https://discourse.processing.org/t/buttons-on-my-canvas-move-as-i-resize-or-maximize-the-browser-window-how-do-i-stop-this/19687 "2020-04-12T20:54:52Z")

</div>

The buttons that I’ve added to my sketch are not really positioned on my canvas. I think they’re actually floating. I need them to be in fixed spots on my canvas. How do I accomplish this? I think my centerCanvas() func…

---

## [loadSound for a user uploaded file](https://discourse.processing.org/t/loadsound-for-a-user-uploaded-file/19407)

<div class="topic-metadata">

**Author:** [@Trumpet63](https://discourse.processing.org/u/Trumpet63)\
**Replies:** 2\
**Last updated:** [April 12, 2020, 1:43am UTC](https://discourse.processing.org/t/loadsound-for-a-user-uploaded-file/19407 "2020-04-12T01:43:01Z")

</div>

I’m building a rhythm game in TypeScript, and I need to let the user upload a sound file, load it, and then play it on demand. I know this is possible in vanilla JS, but I want to do it “the P5 way” so my code is cleaner…

---

## [How much memory does a p5.Vector variable take up compared to an integer variable?](https://discourse.processing.org/t/how-much-memory-does-a-p5-vector-variable-take-up-compared-to-an-integer-variable/19681)

<div class="topic-metadata">

**Author:** [@Bassam](https://discourse.processing.org/u/Bassam)\
**Replies:** 1\
**Last updated:** [April 12, 2020, 12:42am UTC](https://discourse.processing.org/t/how-much-memory-does-a-p5-vector-variable-take-up-compared-to-an-integer-variable/19681 "2020-04-12T00:42:19Z")

</div>

I’m writing something that involves image manipulation. I decided to use an array of p5.Vectors because I could store the x and y coordinates of pixels more easily. I could just as easily create 2 integer arrays (coordin…

---

## [Unable to position my object at a specific location](https://discourse.processing.org/t/unable-to-position-my-object-at-a-specific-location/19646)

<div class="topic-metadata">

**Author:** [@Bassam](https://discourse.processing.org/u/Bassam)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 11:02pm UTC](https://discourse.processing.org/t/unable-to-position-my-object-at-a-specific-location/19646 "2020-04-11T23:02:56Z")

</div>

I’ve created an object myCanvas but I’m unable to position it on the main canvas. I think it just gets added to 0,0. I would like to put it at a specific location on the canvas that’s created in setup(). So maybe at 100,…

---

## [Can you make a graph go in a spiral? (instead of horizontal)](https://discourse.processing.org/t/can-you-make-a-graph-go-in-a-spiral-instead-of-horizontal/19670)

<div class="topic-metadata">

**Author:** [@allyn](https://discourse.processing.org/u/allyn)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 10:02pm UTC](https://discourse.processing.org/t/can-you-make-a-graph-go-in-a-spiral-instead-of-horizontal/19670 "2020-04-11T22:02:24Z")

</div>

I’ve got a graph mapping the amplitude of a song (titled AYNIL.mp3 in the code) but I want it to travel in a spiral starting from the center rather than along the canvas width. (so it creates this weird spiral made of am…

---

## [Triplets on a p5.phrase #p5.sound](https://discourse.processing.org/t/triplets-on-a-p5-phrase-p5-sound/19507)

<div class="topic-metadata">

**Author:** [@alfonsofonso](https://discourse.processing.org/u/alfonsofonso)\
**Replies:** 3\
**Last updated:** [April 11, 2020, 7:00pm UTC](https://discourse.processing.org/t/triplets-on-a-p5-phrase-p5-sound/19507 "2020-04-11T19:00:34Z")

</div>

Hi everyone! I’m trying to do some triplets in a p5.phrase… I’ve tried to nest arrays but nope… any idea? cheers

---

## [How do I save an image that has been shrunk using the image function?](https://discourse.processing.org/t/how-do-i-save-an-image-that-has-been-shrunk-using-the-image-function/19651)

<div class="topic-metadata">

**Author:** [@Bassam](https://discourse.processing.org/u/Bassam)\
**Replies:** 1\
**Last updated:** [April 11, 2020, 4:49am UTC](https://discourse.processing.org/t/how-do-i-save-an-image-that-has-been-shrunk-using-the-image-function/19651 "2020-04-11T04:49:50Z")

</div>

I’m using image(photo1, xpos, ypos, newWidth, newHeight) to shrink a large image. My question is, how do I save that new shrunken image into a variable so that I can manipulate it further? I want to be able to modify th…

---

## [Embedding Mp3 files hosted elsewhere in my p5 sketch](https://discourse.processing.org/t/embedding-mp3-files-hosted-elsewhere-in-my-p5-sketch/19567)

<div class="topic-metadata">

**Author:** [@isasasa](https://discourse.processing.org/u/isasasa)\
**Replies:** 1\
**Last updated:** [April 9, 2020, 2:50pm UTC](https://discourse.processing.org/t/embedding-mp3-files-hosted-elsewhere-in-my-p5-sketch/19567 "2020-04-09T14:50:06Z")

</div>

So basically I am trying to get a project running on Wordpress that had two sound files in it. I’ve loaded the whole project folder into my c-panel and tried using a short code to run the project but the audio didn’t see…

---

## [Smoke from Perlin noise](https://discourse.processing.org/t/smoke-from-perlin-noise/19462)

<div class="topic-metadata">

**Author:** [@segu](https://discourse.processing.org/u/segu)\
**Replies:** 9\
**Last updated:** [April 9, 2020, 1:38pm UTC](https://discourse.processing.org/t/smoke-from-perlin-noise/19462 "2020-04-09T13:38:15Z")

</div>

Hi everybody, I recently got mesmerized by this sketch found on openprocessing.org. I wanted to tip my toe into p5 so I decided to try to adapt the code and here is my shot: let x; let t = 0; let w = 255; let m = 0; l…

---

## [Mouse interaction with 3D objects / objects on 3D plane](https://discourse.processing.org/t/mouse-interaction-with-3d-objects-objects-on-3d-plane/19499)

<div class="topic-metadata">

**Author:** [@Furu](https://discourse.processing.org/u/Furu)\
**Replies:** 5\
**Last updated:** [April 7, 2020, 7:16pm UTC](https://discourse.processing.org/t/mouse-interaction-with-3d-objects-objects-on-3d-plane/19499 "2020-04-07T19:16:52Z")

</div>

Hi, I’m looking for a way to interact (preferably mouseOver) with ellipses here: http://dev.furu.studio/sandbox/p5js/ . I tried using libraries from https://p5js.org/libraries/ but they do not work with 3d. I tried usi…

---

## [Problem with delay()](https://discourse.processing.org/t/problem-with-delay/19491)

<div class="topic-metadata">

**Author:** [@Velouria](https://discourse.processing.org/u/Velouria)\
**Replies:** 3\
**Last updated:** [April 7, 2020, 1:31pm UTC](https://discourse.processing.org/t/problem-with-delay/19491 "2020-04-07T13:31:51Z")

</div>

Hello, i’m trying to implement this example: https://p5js.org/reference/#/p5.Image/delay in a sketch, but when I run it i get the message “bg1.delay is not a function”. I believe my code is exactly the same as in the ex…

---

## [My enemy "Script error. (:line 0)"](https://discourse.processing.org/t/my-enemy-script-error-line-0/19372)

<div class="topic-metadata">

**Author:** [@Adelta\_21](https://discourse.processing.org/u/Adelta_21)\
**Replies:** 4\
**Last updated:** [April 7, 2020, 8:21am UTC](https://discourse.processing.org/t/my-enemy-script-error-line-0/19372 "2020-04-07T08:21:36Z")

</div>

Hello girls and guys, Since i started using the P5js web editor to introduce myself to imperative programming in javascript, I’ve often stumbled upon the following problem: p5.js doesn’t give any information whatsoever…

---

## [Referencing p5js online libraries: location?](https://discourse.processing.org/t/referencing-p5js-online-libraries-location/19475)

<div class="topic-metadata">

**Author:** [@Peter\_61](https://discourse.processing.org/u/Peter_61)\
**Replies:** 2\
**Last updated:** [April 6, 2020, 8:31pm UTC](https://discourse.processing.org/t/referencing-p5js-online-libraries-location/19475 "2020-04-06T20:31:20Z")

</div>

I am looking for an online location(s) /address where p5 libraries are maintained or located and can be referenced directly from within the browser without having to download or install the library in my own server. Reg…

---

## [Recursive Problem](https://discourse.processing.org/t/recursive-problem/19405)

<div class="topic-metadata">

**Author:** [@JudgeJesse](https://discourse.processing.org/u/JudgeJesse)\
**Replies:** 2\
**Last updated:** [April 6, 2020, 1:16pm UTC](https://discourse.processing.org/t/recursive-problem/19405 "2020-04-06T13:16:08Z")

</div>

Howdy! I’m trying to make a Sudoku Solver and I can’t seem to figure out this bug. I’ve got too many console.logs in here but you should be able see what’s happening. I use a recursive function to try all possible number…

---

## [Vertices from model](https://discourse.processing.org/t/vertices-from-model/19449)

<div class="topic-metadata">

**Author:** [@pallavi24](https://discourse.processing.org/u/pallavi24)\
**Replies:** 1\
**Last updated:** [April 6, 2020, 1:00pm UTC](https://discourse.processing.org/t/vertices-from-model/19449 "2020-04-06T13:00:22Z")

</div>

Is there any way to get vertices from a model (an obj uploaded to p5.js)

---

## [Optimising sine wave animation performance](https://discourse.processing.org/t/optimising-sine-wave-animation-performance/19188)

<div class="topic-metadata">

**Author:** [@feyelaf](https://discourse.processing.org/u/feyelaf)\
**Replies:** 1\
**Last updated:** [April 5, 2020, 7:29pm UTC](https://discourse.processing.org/t/optimising-sine-wave-animation-performance/19188 "2020-04-05T19:29:44Z")

</div>

Hi I have generated a sine wave animation from some of the p5 examples files and it is pretty much exactly how I would like it to animate. However I have noticed it does generate quite heavy processor usage. So I am gene…

---

## [blendMode rendering issues p5.js](https://discourse.processing.org/t/blendmode-rendering-issues-p5-js/19179)

<div class="topic-metadata">

**Author:** [@artforart](https://discourse.processing.org/u/artforart)\
**Replies:** 1\
**Last updated:** [April 5, 2020, 6:41pm UTC](https://discourse.processing.org/t/blendmode-rendering-issues-p5-js/19179 "2020-04-05T18:41:32Z")

</div>

I keep running into performance issues trying to visualize some simplex noise – using about 1700 circle objects. Setting the blendMode(MULTIPLY) in the setup function has been producing some laggy results. See this co…

---

## [Why does the error comes even though the function is defined?](https://discourse.processing.org/t/why-does-the-error-comes-even-though-the-function-is-defined/19440)

<div class="topic-metadata">

**Author:** [@Rohit](https://discourse.processing.org/u/Rohit)\
**Replies:** 1\
**Last updated:** [April 5, 2020, 6:01pm UTC](https://discourse.processing.org/t/why-does-the-error-comes-even-though-the-function-is-defined/19440 "2020-04-05T18:01:40Z")

</div>

here is the link to my project https://editor.p5js.org/rohitgokul817/sketches/yhOcLU2KX please help me to figure out the error the function is defined buti am getting the error Uncaught ReferenceError: antsweets is not …

---

## [P5 manager -- customizing files](https://discourse.processing.org/t/p5-manager-customizing-files/19148)

<div class="topic-metadata">

**Author:** [@r8th](https://discourse.processing.org/u/r8th)\
**Replies:** 5\
**Last updated:** [April 5, 2020, 4:53pm UTC](https://discourse.processing.org/t/p5-manager-customizing-files/19148 "2020-04-05T16:53:26Z")

</div>

hi! I’ve been exploring p5 Manager. Does anyone know if there is a way to get it to create a customized files? For example, I’d like to use it to create a separate CSS file rather than have it write the style into the h…

---

## [noStroke() affects shapes above and below](https://discourse.processing.org/t/nostroke-affects-shapes-above-and-below/19412)

<div class="topic-metadata">

**Author:** [@jrobthehuman](https://discourse.processing.org/u/jrobthehuman)\
**Replies:** 3\
**Last updated:** [April 5, 2020, 4:12pm UTC](https://discourse.processing.org/t/nostroke-affects-shapes-above-and-below/19412 "2020-04-05T16:12:40Z")

</div>

Hello everyone. Absolute beginner here, and I appreciate your help already. I’m using the Make: Getting Started with p5.js book, and I’m confused about example 3-15. Using noStroke() affects all the shapes, when I belie…

---

## [Facing error "Failed to load resource: the server responded with a status of 404 (Not Found)" in web browse console](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433)

<div class="topic-metadata">

**Author:** [@satyamgaba](https://discourse.processing.org/u/satyamgaba)\
**Replies:** 22\
**Last updated:** [April 5, 2020, 11:43am UTC](https://discourse.processing.org/t/facing-error-failed-to-load-resource-the-server-responded-with-a-status-of-404-not-found-in-web-browse-console/2433 "2020-04-05T11:43:09Z")

</div>

I was trying to follow this tutorial. At ‘10:40’ I see the blank page in web browser. My server is running like the tutorial. When I checked the console of the webpage in the web browser. I saw that following errors: …

---

## [How to solve problems with CORS?](https://discourse.processing.org/t/how-to-solve-problems-with-cors/16048)

<div class="topic-metadata">

**Author:** [@willianxz](https://discourse.processing.org/u/willianxz)\
**Replies:** 3\
**Last updated:** [April 4, 2020, 11:26pm UTC](https://discourse.processing.org/t/how-to-solve-problems-with-cors/16048 "2020-04-04T23:26:43Z")

</div>

When you use: loadImage ('urldeoutrohost.jpg', img =\> { image (img, 0.0); }); It ends up giving CORS error if you are not using a CORS extension. I would like to know if there is any way to solve this ?, why didn’…

---

## [Sharing variables between different instance mode sketches](https://discourse.processing.org/t/sharing-variables-between-different-instance-mode-sketches/19264)

<div class="topic-metadata">

**Author:** [@calornorte](https://discourse.processing.org/u/calornorte)\
**Replies:** 2\
**Last updated:** [April 4, 2020, 10:20pm UTC](https://discourse.processing.org/t/sharing-variables-between-different-instance-mode-sketches/19264 "2020-04-04T22:20:23Z")

</div>

or having a global variable that could be accessed by different instance mode sketches. I have been looking around but I don’t seem to understand how to do it, any example that could illuminate me? best!

---

## [Multiple Volume Controls on Multiple Sound Files](https://discourse.processing.org/t/multiple-volume-controls-on-multiple-sound-files/19360)

<div class="topic-metadata">

**Author:** [@tia\_nooling123](https://discourse.processing.org/u/tia_nooling123)\
**Replies:** 1\
**Last updated:** [April 4, 2020, 1:11am UTC](https://discourse.processing.org/t/multiple-volume-controls-on-multiple-sound-files/19360 "2020-04-04T01:11:32Z")

</div>

Hello! I’m fairly new to p5.js and am trying to create a very simple audio crossfader that allows you to listen to 2 sound files at once, and control the mix by moving the mouse along the X axis. I am getting stuck whe…

---

## [Stuck on Loading](https://discourse.processing.org/t/stuck-on-loading/19370)

<div class="topic-metadata">

**Author:** [@corisco](https://discourse.processing.org/u/corisco)\
**Replies:** 4\
**Last updated:** [April 3, 2020, 6:57pm UTC](https://discourse.processing.org/t/stuck-on-loading/19370 "2020-04-03T18:57:35Z")

</div>

Hi. I’m trying to get familiar with JS using p5.js. I downloaded p5.js complete, headed to the Get Started page and, as described, typed ellipse(50, 50, 80, 80); in my (desktop) editor to test it out. In Firefox, the…

---

## [I need help making the pictures stay until next is pressed](https://discourse.processing.org/t/i-need-help-making-the-pictures-stay-until-next-is-pressed/19273)

<div class="topic-metadata">

**Author:** [@stacy](https://discourse.processing.org/u/stacy)\
**Replies:** 1\
**Last updated:** [April 3, 2020, 6:26pm UTC](https://discourse.processing.org/t/i-need-help-making-the-pictures-stay-until-next-is-pressed/19273 "2020-04-03T18:26:39Z")

</div>

Can someone please help Heres the code: var drop = \[\]; let images = \["images (9).jpeg","images (10).jpeg", "images (8).jpeg", "images (7).jpeg", "images (5).jpeg", "images (6).jpeg" \]; let current = 1; function setu…

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

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