# p5.js

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

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

**Page:** 82

---

## [Axidraw p5 clean webusb interface](https://discourse.processing.org/t/axidraw-p5-clean-webusb-interface/5689)

<div class="topic-metadata">

**Author:** [@TiborUdvari](https://discourse.processing.org/u/TiborUdvari)\
**Replies:** 1\
**Last updated:** [December 8, 2019, 9:08pm UTC](https://discourse.processing.org/t/axidraw-p5-clean-webusb-interface/5689 "2019-12-08T21:08:10Z")

</div>

I’m looking to create an API to control my axidraw through WebUSB (currently only working on Chrome) with p5. The communication works by sending simple serial messages. My idea is to have the usual functions like line , e…

---

## [Communication between p5js and processing](https://discourse.processing.org/t/communication-between-p5js-and-processing/1444)

<div class="topic-metadata">

**Author:** [@proxycase](https://discourse.processing.org/u/proxycase)\
**Replies:** 5\
**Last updated:** [December 8, 2019, 3:16am UTC](https://discourse.processing.org/t/communication-between-p5js-and-processing/1444 "2019-12-08T03:16:13Z")

</div>

Wondering if there’s a good solution for back and forth communication between a p5.js server running on node and a processing sketch that people think work pretty flawlessly. I’ve tried UDP/OSC but js has 2000 ways to d…

---

## [Persisting the console log](https://discourse.processing.org/t/persisting-the-console-log/15877)

<div class="topic-metadata">

**Author:** [@Dandada](https://discourse.processing.org/u/Dandada)\
**Replies:** 6\
**Last updated:** [December 8, 2019, 1:18am UTC](https://discourse.processing.org/t/persisting-the-console-log/15877 "2019-12-08T01:18:33Z")

</div>

Is there, or can an option be added, to persist the console log in p5js after stopping a program. It would greatly help with debugging.

---

## [Possible memory leak with video texture in WebGL renderer](https://discourse.processing.org/t/possible-memory-leak-with-video-texture-in-webgl-renderer/16088)

<div class="topic-metadata">

**Author:** [@bzSteve](https://discourse.processing.org/u/bzSteve)\
**Replies:** 4\
**Last updated:** [December 7, 2019, 9:24pm UTC](https://discourse.processing.org/t/possible-memory-leak-with-video-texture-in-webgl-renderer/16088 "2019-12-07T21:24:52Z")

</div>

Hi, I’m brand new to p5.js and I’m enjoying it quite a bit but now I’m experiencing a memory leak using a video texture with a WebGL renderer. I’m on a Mac running macOS 10.15.1 and I’ve tried Safari 13.0.3 and Chrome 7…

---

## [Regarding Understanding of codebase](https://discourse.processing.org/t/regarding-understanding-of-codebase/16180)

<div class="topic-metadata">

**Author:** [@RadheTians](https://discourse.processing.org/u/RadheTians)\
**Replies:** 1\
**Last updated:** [December 7, 2019, 5:42am UTC](https://discourse.processing.org/t/regarding-understanding-of-codebase/16180 "2019-12-07T05:42:58Z")

</div>

Hello Everyone, It’s stated that I Radhe Raman Tiwari is a Computer Science Student who is having a passion to work towards Open Source Community and the Processing Foundation is a great Community to do so. I have been …

---

## [Why p5 is called p5](https://discourse.processing.org/t/why-p5-is-called-p5/16084)

<div class="topic-metadata">

**Author:** [@mikolaskoa](https://discourse.processing.org/u/mikolaskoa)\
**Replies:** 3\
**Last updated:** [December 7, 2019, 5:27am UTC](https://discourse.processing.org/t/why-p5-is-called-p5/16084 "2019-12-07T05:27:46Z")

</div>

Hello, is it correct, that p5 is called so, because of p- rocessing and HTML-5? Best regards, Adriana

---

## [Share code processing IDE](https://discourse.processing.org/t/share-code-processing-ide/16070)

<div class="topic-metadata">

**Author:** [@Dima](https://discourse.processing.org/u/Dima)\
**Replies:** 2\
**Last updated:** [December 7, 2019, 1:48am UTC](https://discourse.processing.org/t/share-code-processing-ide/16070 "2019-12-07T01:48:54Z")

</div>

Hello, i am a software engineering student, and for my final project i want to develop a real time coding processing IDE, Like hello.processing but with the ability to code with multiply developers (like codeshare.io). C…

---

## [P5.js gui library slider control](https://discourse.processing.org/t/p5-js-gui-library-slider-control/16114)

<div class="topic-metadata">

**Author:** [@morgantp98](https://discourse.processing.org/u/morgantp98)\
**Replies:** 5\
**Last updated:** [December 6, 2019, 12:03pm UTC](https://discourse.processing.org/t/p5-js-gui-library-slider-control/16114 "2019-12-06T12:03:03Z")

</div>

I have a row of shapes which I have made, with a slider from the p5.gui library controlling the rotation speed of one of the shapes. I would like the “Fan” slider to be able to pick specific shapes so I can change the sp…

---

## [The Fault in my Stars (or drawing on top of looping background)](https://discourse.processing.org/t/the-fault-in-my-stars-or-drawing-on-top-of-looping-background/16162)

<div class="topic-metadata">

**Author:** [@AwkwardOwl17](https://discourse.processing.org/u/AwkwardOwl17)\
**Replies:** 2\
**Last updated:** [December 6, 2019, 7:26am UTC](https://discourse.processing.org/t/the-fault-in-my-stars-or-drawing-on-top-of-looping-background/16162 "2019-12-06T07:26:40Z")

</div>

Hello! I’m fairly new to p5.js and object-oriented programming (or programming in general), though I have been playing around in processing for a while. However, I have run into a problem with my code: What I’m trying …

---

## [Draw continuously animated line with FFT and amplitude](https://discourse.processing.org/t/draw-continuously-animated-line-with-fft-and-amplitude/16069)

<div class="topic-metadata">

**Author:** [@juju](https://discourse.processing.org/u/juju)\
**Replies:** 4\
**Last updated:** [December 6, 2019, 3:43am UTC](https://discourse.processing.org/t/draw-continuously-animated-line-with-fft-and-amplitude/16069 "2019-12-06T03:43:25Z")

</div>

Hi Processing community, I am trying to recreate the effect from this video (8:28 minutes in) which draw the song amplitude as a continuous animated line. I got to the point where I have dots flying around, but have hard…

---

## [Brightness with original background image](https://discourse.processing.org/t/brightness-with-original-background-image/15792)

<div class="topic-metadata">

**Author:** [@Fadelast](https://discourse.processing.org/u/Fadelast)\
**Replies:** 9\
**Last updated:** [December 5, 2019, 6:12pm UTC](https://discourse.processing.org/t/brightness-with-original-background-image/15792 "2019-12-05T18:12:35Z")

</div>

Hi to all, it is possible to modify the code for brightness, preserving the original color background ? https://p5js.org/examples/color-brightness.html In the example above, the image is only black and white,and i’m tr…

---

## [Function to change Background opacity to an image](https://discourse.processing.org/t/function-to-change-background-opacity-to-an-image/16112)

<div class="topic-metadata">

**Author:** [@Fadelast](https://discourse.processing.org/u/Fadelast)\
**Replies:** 1\
**Last updated:** [December 4, 2019, 6:30pm UTC](https://discourse.processing.org/t/function-to-change-background-opacity-to-an-image/16112 "2019-12-04T18:30:38Z")

</div>

Hi to all, I need a function to change the opacity of a canvas containing an image. How can i achieve this ? Thanks function preload() { img = loadImage("./asset/img/image.jpg"); } function setup() { var can…

---

## [Modifying line type in WebGL](https://discourse.processing.org/t/modifying-line-type-in-webgl/15339)

<div class="topic-metadata">

**Author:** [@AshaSato](https://discourse.processing.org/u/AshaSato)\
**Replies:** 7\
**Last updated:** [December 4, 2019, 11:45am UTC](https://discourse.processing.org/t/modifying-line-type-in-webgl/15339 "2019-12-04T11:45:56Z")

</div>

Hello! In the past to draw a dashed line I have used the following: drawingContext.setLineDash(\[5, 15\]); This does not appear to work with WebGL. Is there a simple way to get a dashed/dotted line with WebGL?

---

## [WEBGL vs P2D pros and cons](https://discourse.processing.org/t/webgl-vs-p2d-pros-and-cons/16073)

<div class="topic-metadata">

**Author:** [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Replies:** 0\
**Last updated:** [December 3, 2019, 10:27am UTC](https://discourse.processing.org/t/webgl-vs-p2d-pros-and-cons/16073 "2019-12-03T10:27:22Z")

</div>

I have little to no experience in p5.js. What are people’s thoughts on WEBGL vs P2D?

---

## [Taking Adob Illustrator Artboard and importing into Processing](https://discourse.processing.org/t/taking-adob-illustrator-artboard-and-importing-into-processing/16061)

<div class="topic-metadata">

**Author:** [@msw](https://discourse.processing.org/u/msw)\
**Replies:** 1\
**Last updated:** [December 3, 2019, 2:31am UTC](https://discourse.processing.org/t/taking-adob-illustrator-artboard-and-importing-into-processing/16061 "2019-12-03T02:31:06Z")

</div>

Hi there, so I am very new to processing and to be frank only using it for school. I’ve heard there is a way to take an adobe illustrator file and put it into processing (apologies if my wording isn’t right here). I can’…

---

## [How to loop sound generated within a p5 envelope](https://discourse.processing.org/t/how-to-loop-sound-generated-within-a-p5-envelope/15889)

<div class="topic-metadata">

**Author:** [@gjs](https://discourse.processing.org/u/gjs)\
**Replies:** 5\
**Last updated:** [December 3, 2019, 1:32am UTC](https://discourse.processing.org/t/how-to-loop-sound-generated-within-a-p5-envelope/15889 "2019-12-03T01:32:58Z")

</div>

In p5, I’m trying to loop sound generated within a p5 envelope in response to a mousePressed() function. Multiple attempts at inserting it within the following code, copied from p5 envelope reference and pasted below, ha…

---

## [Saving variables to global environment](https://discourse.processing.org/t/saving-variables-to-global-environment/16054)

<div class="topic-metadata">

**Author:** [@tanzor](https://discourse.processing.org/u/tanzor)\
**Replies:** 17\
**Last updated:** [December 3, 2019, 12:28am UTC](https://discourse.processing.org/t/saving-variables-to-global-environment/16054 "2019-12-03T00:28:03Z")

</div>

Hi! I’m programming a psychological experiment using labjs and I want to add p5 functionalities to some of the screens. My understanding is that in order for things not to break, I need to use p5’s instance mode to make…

---

## [What do you think about my program?](https://discourse.processing.org/t/what-do-you-think-about-my-program/16042)

<div class="topic-metadata">

**Author:** [@willianxz](https://discourse.processing.org/u/willianxz)\
**Replies:** 17\
**Last updated:** [December 2, 2019, 10:06pm UTC](https://discourse.processing.org/t/what-do-you-think-about-my-program/16042 "2019-12-02T22:06:41Z")

</div>

It’s an example of how to consume data from a JSON API using text and even 3D. I had a hard time putting the text () command together with the 3D “box”, because it gave a strange font error, so I ended up creating a gra…

---

## [Running multiple interact sketches](https://discourse.processing.org/t/running-multiple-interact-sketches/16044)

<div class="topic-metadata">

**Author:** [@otji](https://discourse.processing.org/u/otji)\
**Replies:** 2\
**Last updated:** [December 2, 2019, 5:09pm UTC](https://discourse.processing.org/t/running-multiple-interact-sketches/16044 "2019-12-02T17:09:25Z")

</div>

Hi there, I am beginning to use P5.JS to create a small experience and one of the things i’m trying to do is to have a sketch that runs another sketch when an icon is clicked. I’m pretty sure this is a basic function bu…

---

## [How to upload an image from a URL?](https://discourse.processing.org/t/how-to-upload-an-image-from-a-url/16020)

<div class="topic-metadata">

**Author:** [@willianxz](https://discourse.processing.org/u/willianxz)\
**Replies:** 8\
**Last updated:** [December 2, 2019, 11:24am UTC](https://discourse.processing.org/t/how-to-upload-an-image-from-a-url/16020 "2019-12-02T11:24:43Z")

</div>

Hi, I tried to upload an image from a URL, but from what I see it doesn’t work, only for images that I place locally. The purpose of uploading images using URL is because in the JSON I receive it contains their URL. Ex…

---

## [P5.js goes Virtual Reality](https://discourse.processing.org/t/p5-js-goes-virtual-reality/16002)

<div class="topic-metadata">

**Author:** [@kappaxbeta](https://discourse.processing.org/u/kappaxbeta)\
**Replies:** 1\
**Last updated:** [December 1, 2019, 12:52pm UTC](https://discourse.processing.org/t/p5-js-goes-virtual-reality/16002 "2019-12-01T12:52:40Z")

</div>

Hey folk, Im a Virtual Reality enthusiast and P5.js fan. For the future I think it would be great to also View our creation in the new Medias as Mixed Reality and Virtual Reality. https://www.w3.org/TR/webxr/ I wo…

---

## [Make object array move as one unit](https://discourse.processing.org/t/make-object-array-move-as-one-unit/15994)

<div class="topic-metadata">

**Author:** [@samm](https://discourse.processing.org/u/samm)\
**Replies:** 1\
**Last updated:** [December 1, 2019, 2:43am UTC](https://discourse.processing.org/t/make-object-array-move-as-one-unit/15994 "2019-12-01T02:43:08Z")

</div>

I am fairly new to P5.js and am trying to make an entity of lines move around the screen and rotate (like a twirling motion). I have the array of lines created but I can’t figure out how to make a statement that will app…

---

## [How to implement LowShelf filter or Bass Effect in P5.js?](https://discourse.processing.org/t/how-to-implement-lowshelf-filter-or-bass-effect-in-p5-js/15982)

<div class="topic-metadata">

**Author:** [@aadarshvelu](https://discourse.processing.org/u/aadarshvelu)\
**Replies:** 0\
**Last updated:** [November 30, 2019, 2:40pm UTC](https://discourse.processing.org/t/how-to-implement-lowshelf-filter-or-bass-effect-in-p5-js/15982 "2019-11-30T14:40:33Z")

</div>

Hi, I’m new to p5.js! and I’m looking to implement bass effect in project So I need a filter called “LowShelf” filter which exists in web audio API… There are filters like bandpass, lowpass, highpass which exists in p5.…

---

## [How to draw a triangle shape using for loop from array](https://discourse.processing.org/t/how-to-draw-a-triangle-shape-using-for-loop-from-array/15955)

<div class="topic-metadata">

**Author:** [@b001](https://discourse.processing.org/u/b001)\
**Replies:** 3\
**Last updated:** [November 29, 2019, 4:37pm UTC](https://discourse.processing.org/t/how-to-draw-a-triangle-shape-using-for-loop-from-array/15955 "2019-11-29T16:37:13Z")

</div>

var door=\[403, 402, 427, 646, 639, 830, 809, 844, 802, 683, 552, 629, 712, 783, 415, 561, 562, 751, 680, 626, 701, 838, 322, 468, 625\]; for(b=0; b\<door.length; b++) { triangle(x1,y1,x2,y2,x3,y3); } how do …

---

## [Save image created via createGraphics to server](https://discourse.processing.org/t/save-image-created-via-creategraphics-to-server/15940)

<div class="topic-metadata">

**Author:** [@rashuan](https://discourse.processing.org/u/rashuan)\
**Replies:** 1\
**Last updated:** [November 29, 2019, 7:59am UTC](https://discourse.processing.org/t/save-image-created-via-creategraphics-to-server/15940 "2019-11-29T07:59:29Z")

</div>

Hello, I’ve got a simple (probably not so simple) problem - sending an image generated via createGraphics function to an e-mail. So what I thought is - use a php script on the server to send an e-mail. So far so good, bu…

---

## [Sound won't work, AudioContext was not allowed to start?](https://discourse.processing.org/t/sound-wont-work-audiocontext-was-not-allowed-to-start/15921)

<div class="topic-metadata">

**Author:** [@coledeushane](https://discourse.processing.org/u/coledeushane)\
**Replies:** 3\
**Last updated:** [November 29, 2019, 3:58am UTC](https://discourse.processing.org/t/sound-wont-work-audiocontext-was-not-allowed-to-start/15921 "2019-11-29T03:58:36Z")

</div>

I can’t seem to get the p5.sound.js to work correctly. The console error I keep getting is: p5.sound.js:819 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. ht…

---

## [My rect() is not working](https://discourse.processing.org/t/my-rect-is-not-working/15894)

<div class="topic-metadata">

**Author:** [@Andererlets\_play](https://discourse.processing.org/u/Andererlets_play)\
**Replies:** 1\
**Last updated:** [November 27, 2019, 9:05pm UTC](https://discourse.processing.org/t/my-rect-is-not-working/15894 "2019-11-27T21:05:41Z")

</div>

At the bottom, the rect is not working. String display\[\]\[\]; int dificulty; int size; int position; int ammount; int margin; float randomcol1 \[\]; float randomcol2 \[\]; float randomcol3 \[\]; float displaycol1 \[\]\[\]; float di…

---

## [Why is the distance increasing when I draw objects in a line with while loop?](https://discourse.processing.org/t/why-is-the-distance-increasing-when-i-draw-objects-in-a-line-with-while-loop/15872)

<div class="topic-metadata">

**Author:** [@Hangmansraven](https://discourse.processing.org/u/Hangmansraven)\
**Replies:** 2\
**Last updated:** [November 27, 2019, 1:29pm UTC](https://discourse.processing.org/t/why-is-the-distance-increasing-when-i-draw-objects-in-a-line-with-while-loop/15872 "2019-11-27T13:29:18Z")

</div>

Dear community, I am quite new to coding and doing some typical beginner’s exercises to learn more. My current exercise is about repeatedly drawing objects by using while loops. Therefore I declared the variables posi…

---

## [How i extends class in p5.js?](https://discourse.processing.org/t/how-i-extends-class-in-p5-js/894)

<div class="topic-metadata">

**Author:** [@erkosone](https://discourse.processing.org/u/erkosone)\
**Replies:** 16\
**Last updated:** [November 27, 2019, 9:11am UTC](https://discourse.processing.org/t/how-i-extends-class-in-p5-js/894 "2019-11-27T09:11:10Z")

</div>

Hi, i try to extends class in p5.js sketch, but not works… How do you make this? Any simple example please?

---

## [Help with P5.js Project](https://discourse.processing.org/t/help-with-p5-js-project/15823)

<div class="topic-metadata">

**Author:** [@Sheikah](https://discourse.processing.org/u/Sheikah)\
**Replies:** 1\
**Last updated:** [November 26, 2019, 3:02am UTC](https://discourse.processing.org/t/help-with-p5-js-project/15823 "2019-11-26T03:02:21Z")

</div>

Hi, I’m new to coding and I’m struggling trying to get my code to do what I want it to. My idea was to have 4 different buttons that, when clicked, change the colour scheme of the composition and have a unique effect t…

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

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