# Libraries

**URL:** https://discourse.processing.org/c/p5js/p5js-libraries/20.md?page=4

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

**Page:** 5

---

## [How to add math.js to the p5js editor on browser](https://discourse.processing.org/t/how-to-add-math-js-to-the-p5js-editor-on-browser/35390)

<div class="topic-metadata">

**Author:** [@TheSynchronomicon](https://discourse.processing.org/u/TheSynchronomicon)\
**Replies:** 3\
**Last updated:** [February 23, 2022, 4:23pm UTC](https://discourse.processing.org/t/how-to-add-math-js-to-the-p5js-editor-on-browser/35390 "2022-02-23T16:23:08Z")

</div>

I need to use math.js to solve a system of equations but I honestly have no clue on how to add the math.js library to the browser editor for p5js. I have already tried creating a new sketch file and copying over the html…

---

## [\[p5.js\] Date search related](https://discourse.processing.org/t/p5-js-date-search-related/35196)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 8\
**Last updated:** [February 19, 2022, 12:49am UTC](https://discourse.processing.org/t/p5-js-date-search-related/35196 "2022-02-19T00:49:12Z")

</div>

Date search related. If you look at the image, you can select the date. within p5.js library If you have an example source code Do you have any content?

---

## [How can I set a dat.GUI panel anywhere on screen in OpenProcessing p5js](https://discourse.processing.org/t/how-can-i-set-a-dat-gui-panel-anywhere-on-screen-in-openprocessing-p5js/14423)

<div class="topic-metadata">

**Author:** [@rbytes](https://discourse.processing.org/u/rbytes)\
**Replies:** 11\
**Last updated:** [February 16, 2022, 12:46am UTC](https://discourse.processing.org/t/how-can-i-set-a-dat-gui-panel-anywhere-on-screen-in-openprocessing-p5js/14423 "2022-02-16T00:46:27Z")

</div>

0 I have seen similar questions on various websites, but the answers always require using HTML, CSS and p5js code to reposition a dat.GUI panel from its default location. I am working strictly in p5js on OpenProcessing,…

---

## [Refresh values in P5.gui](https://discourse.processing.org/t/refresh-values-in-p5-gui/27581)

<div class="topic-metadata">

**Author:** [@rbanks](https://discourse.processing.org/u/rbanks)\
**Replies:** 4\
**Last updated:** [February 15, 2022, 7:21pm UTC](https://discourse.processing.org/t/refresh-values-in-p5-gui/27581 "2022-02-15T19:21:00Z")

</div>

I’m using p5.gui to play with some variables and setting for my sketch. I want to change those variables both in the gui and in code. If I change the variables in code the p5.gui interface doesn’t update automatically to…

---

## [TypeError: Cannot read properties of undefined (reading '\_elements')](https://discourse.processing.org/t/typeerror-cannot-read-properties-of-undefined-reading-elements/34969)

<div class="topic-metadata">

**Author:** [@Errorbot1122](https://discourse.processing.org/u/Errorbot1122)\
**Replies:** 4\
**Last updated:** [February 14, 2022, 7:38pm UTC](https://discourse.processing.org/t/typeerror-cannot-read-properties-of-undefined-reading-elements/34969 "2022-02-14T19:38:21Z")

</div>

I tried to remove a div inside the set timeout function but it give me the error in the title. Here is the stack trace: TypeError: Cannot read properties of undefined (reading '\_elements') at f.default.Element.remo…

---

## [Online piano works but I want to eliminate static sound](https://discourse.processing.org/t/online-piano-works-but-i-want-to-eliminate-static-sound/35122)

<div class="topic-metadata">

**Author:** [@HFredrickson](https://discourse.processing.org/u/HFredrickson)\
**Replies:** 0\
**Last updated:** [February 12, 2022, 2:31am UTC](https://discourse.processing.org/t/online-piano-works-but-i-want-to-eliminate-static-sound/35122 "2022-02-12T02:31:00Z")

</div>

This code works(just copy and paste the sketch.js code below into the online p5.js editor: https://editor.p5js.org/ ) but every note plays emits a static-sound when the synth turns on. Can anyone suggest a way to elimina…

---

## [Hungry Flower Game: the buttons are not centered in browser, unlike they are in Brackets live preview](https://discourse.processing.org/t/hungry-flower-game-the-buttons-are-not-centered-in-browser-unlike-they-are-in-brackets-live-preview/35041)

<div class="topic-metadata">

**Author:** [@Persica](https://discourse.processing.org/u/Persica)\
**Replies:** 0\
**Last updated:** [February 8, 2022, 11:14am UTC](https://discourse.processing.org/t/hungry-flower-game-the-buttons-are-not-centered-in-browser-unlike-they-are-in-brackets-live-preview/35041 "2022-02-08T11:14:08Z")

</div>

Hey all, I made a game about a hungry flower here. The problem is that the buttons are no longer centered, nor the commanded size once placed on my website. To give an example I’ll attach how they appear in my brackets…

---

## [Incorrect .loop() behavior in p5.SoundFile](https://discourse.processing.org/t/incorrect-loop-behavior-in-p5-soundfile/34947)

<div class="topic-metadata">

**Author:** [@jaschanarveson](https://discourse.processing.org/u/jaschanarveson)\
**Replies:** 0\
**Last updated:** [February 3, 2022, 12:59am UTC](https://discourse.processing.org/t/incorrect-loop-behavior-in-p5-soundfile/34947 "2022-02-03T00:59:52Z")

</div>

The .loop() function in p5.SoundFile isn’t working correctly for me. Behavior: I set loop start and end points: it will start at the start point, but then loop back to 0 upon hitting the end point, instead of looping b…

---

## [LoadPixels() on SVG with P5.js](https://discourse.processing.org/t/loadpixels-on-svg-with-p5-js/34874)

<div class="topic-metadata">

**Author:** [@patricio1979](https://discourse.processing.org/u/patricio1979)\
**Replies:** 2\
**Last updated:** [January 31, 2022, 3:16pm UTC](https://discourse.processing.org/t/loadpixels-on-svg-with-p5-js/34874 "2022-01-31T15:16:21Z")

</div>

Hello, I’m working with \[OMSD\](https://opensheetmusicdisplay.github.io/) and the music score is rendered on a div element. How Can I get the image’s pixels. I only need this for counting the black ones. Some example co…

---

## [p5Gui and noLoop()](https://discourse.processing.org/t/p5gui-and-noloop/34903)

<div class="topic-metadata">

**Author:** [@goldorak](https://discourse.processing.org/u/goldorak)\
**Replies:** 0\
**Last updated:** [January 31, 2022, 12:32am UTC](https://discourse.processing.org/t/p5gui-and-noloop/34903 "2022-01-31T00:32:29Z")

</div>

Hello, I’m experimenting with p5Gui library. I’m trying to understand this example: p5.gui/sketch.js at master · bitcraftlab/p5.gui · GitHub I would like to create a drop down menu for experimenting with blend modes a…

---

## [Playing sound files in p5.js](https://discourse.processing.org/t/playing-sound-files-in-p5-js/28286)

<div class="topic-metadata">

**Author:** [@Annushka123](https://discourse.processing.org/u/Annushka123)\
**Replies:** 10\
**Last updated:** [January 23, 2022, 10:30pm UTC](https://discourse.processing.org/t/playing-sound-files-in-p5-js/28286 "2022-01-23T22:30:56Z")

</div>

Hi! I’m working through the p5.js course in Kadenze and I’m trying to play an audio sample while my mouse hovers over a section of my sketch: if (mouseX \> 600 && mouseX \<700){ sound\_out.play(); } else { sound\_out.st…

---

## [Background change based on music](https://discourse.processing.org/t/background-change-based-on-music/34794)

<div class="topic-metadata">

**Author:** [@Alix](https://discourse.processing.org/u/Alix)\
**Replies:** 3\
**Last updated:** [January 23, 2022, 3:56pm UTC](https://discourse.processing.org/t/background-change-based-on-music/34794 "2022-01-23T15:56:39Z")

</div>

Hey, I’ve been desperately searching for a solution. Is there any possibility that the background color changes from white to red, regarding the amplitude as how the circle does from black in this example? Thank you! …

---

## [How to connect/trigger elements in specific mouse-pressed combinations in p5.js (piano)](https://discourse.processing.org/t/how-to-connect-trigger-elements-in-specific-mouse-pressed-combinations-in-p5-js-piano/34758)

<div class="topic-metadata">

**Author:** [@Javrimir](https://discourse.processing.org/u/Javrimir)\
**Replies:** 11\
**Last updated:** [January 22, 2022, 4:42pm UTC](https://discourse.processing.org/t/how-to-connect-trigger-elements-in-specific-mouse-pressed-combinations-in-p5-js-piano/34758 "2022-01-22T16:42:56Z")

</div>

Hello everyone, I’m trying to visualize music in a concrete way: I built a keyboard with 60 keys, which I positioned at the bottom of the canvas. The whole visualization of every single key pressed, is supposed to be a…

---

## [Help in understanding the tensorflow error for mediapipe hands estimation](https://discourse.processing.org/t/help-in-understanding-the-tensorflow-error-for-mediapipe-hands-estimation/34638)

<div class="topic-metadata">

**Author:** [@Timo](https://discourse.processing.org/u/Timo)\
**Replies:** 15\
**Last updated:** [January 21, 2022, 12:01pm UTC](https://discourse.processing.org/t/help-in-understanding-the-tensorflow-error-for-mediapipe-hands-estimation/34638 "2022-01-21T12:01:58Z")

</div>

Hi, I have been trying to follow the mediapipe documentation and associated tutorial to check if the handpose estimation is working. I seem to get into the following error . I am unable to understand what is the reason f…

---

## [CodePen Problem - Finance library blocking P5](https://discourse.processing.org/t/codepen-problem-finance-library-blocking-p5/34279)

<div class="topic-metadata">

**Author:** [@rms2256](https://discourse.processing.org/u/rms2256)\
**Replies:** 6\
**Last updated:** [January 19, 2022, 7:37pm UTC](https://discourse.processing.org/t/codepen-problem-finance-library-blocking-p5/34279 "2022-01-19T19:37:43Z")

</div>

Programming a stock charting program with CodePen has not been without errors. My program (here), appears to be encountering an error with running both the Finance API (Finnhub.io) and P5. Particularly, only the financ…

---

## [Question about mouseX and mouseY](https://discourse.processing.org/t/question-about-mousex-and-mousey/34620)

<div class="topic-metadata">

**Author:** [@vasco](https://discourse.processing.org/u/vasco)\
**Replies:** 4\
**Last updated:** [January 18, 2022, 2:04am UTC](https://discourse.processing.org/t/question-about-mousex-and-mousey/34620 "2022-01-18T02:04:13Z")

</div>

hello guys Working on a project with p5js and getting a curious result with mouseX and mouseY So I have this code: if(tx \> 0 && tx \< 500 && ty \> 0 && ty \< 500 && myp5.mouseIsPressed && (pty != ty || ptx != tx)){ …

---

## [How to save your p5.js sketch as a GIF using CCapture.js](https://discourse.processing.org/t/how-to-save-your-p5-js-sketch-as-a-gif-using-ccapture-js/1264)

<div class="topic-metadata">

**Author:** [@okliis](https://discourse.processing.org/u/okliis)\
**Replies:** 7\
**Last updated:** [January 15, 2022, 11:26pm UTC](https://discourse.processing.org/t/how-to-save-your-p5-js-sketch-as-a-gif-using-ccapture-js/1264 "2022-01-15T23:26:51Z")

</div>

Hello everyone, I recently figured out how to save my canvas as a GIF using Ccapture.js - something I’ve been trying to do since I started using p5.js a few months ago - so I made a video on how to get it working with a…

---

## [How come that function getLevel() doesn't work: Uncaught TypeError: Cannot read properties of undefined (reading 'getLevel')](https://discourse.processing.org/t/how-come-that-function-getlevel-doesnt-work-uncaught-typeerror-cannot-read-properties-of-undefined-reading-getlevel/34588)

<div class="topic-metadata">

**Author:** [@Joeri](https://discourse.processing.org/u/Joeri)\
**Replies:** 3\
**Last updated:** [January 11, 2022, 11:45pm UTC](https://discourse.processing.org/t/how-come-that-function-getlevel-doesnt-work-uncaught-typeerror-cannot-read-properties-of-undefined-reading-getlevel/34588 "2022-01-11T23:45:31Z")

</div>

I started a project in VS code and at the beginning everything was working but now I get the TypeError. How come? Thanks

---

## [When will someone recreate some P5 functions with PROMISES](https://discourse.processing.org/t/when-will-someone-recreate-some-p5-functions-with-promises/34555)

<div class="topic-metadata">

**Author:** [@Errorbot1122](https://discourse.processing.org/u/Errorbot1122)\
**Replies:** 0\
**Last updated:** [January 10, 2022, 4:37am UTC](https://discourse.processing.org/t/when-will-someone-recreate-some-p5-functions-with-promises/34555 "2022-01-10T04:37:14Z")

</div>

Promises are almost always better than callbacks, so can someone replace almost all callbacks with Promises. Adding promises would actually shorten the functions by removing the error, and success callbacks, converting l…

---

## [Resize canvas in the DOM](https://discourse.processing.org/t/resize-canvas-in-the-dom/34365)

<div class="topic-metadata">

**Author:** [@yonmaor](https://discourse.processing.org/u/yonmaor)\
**Replies:** 0\
**Last updated:** [December 29, 2021, 9:40pm UTC](https://discourse.processing.org/t/resize-canvas-in-the-dom/34365 "2021-12-29T21:40:53Z")

</div>

Hey! I’m trying to embed a p5.js program into a website via the DOM. I want to place it in a CSS grid element that’s width is proportional to the window size. Is there a method similar to .position(x, y) that will allow …

---

## [Interaction between objects and 2D detector?](https://discourse.processing.org/t/interaction-between-objects-and-2d-detector/33374)

<div class="topic-metadata">

**Author:** [@Timo](https://discourse.processing.org/u/Timo)\
**Replies:** 5\
**Last updated:** [December 28, 2021, 10:30pm UTC](https://discourse.processing.org/t/interaction-between-objects-and-2d-detector/33374 "2021-12-28T22:30:09Z")

</div>

Hi community, I am currently exploring P5js with posenet 2D pose detector. I have currently fiddled around sketched by following objects in the canvas and doing a similar action. I was wondering how can one make some sim…

---

## [Libraries related - mappa Map style change does not work](https://discourse.processing.org/t/libraries-related-mappa-map-style-change-does-not-work/34326)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 0\
**Last updated:** [December 28, 2021, 1:06am UTC](https://discourse.processing.org/t/libraries-related-mappa-map-style-change-does-not-work/34326 "2021-12-28T01:06:36Z")

</div>

Reference site 1: Reference site 2: MapboxGL Example Reference site 3: Map style change does not work. Previous source code const options = { lat: 0, ng: 0, zoom: 4, style: 'mapbox://styles/mapbox…

---

## [\[p5.js\] How to use 'CryptoJS'](https://discourse.processing.org/t/p5-js-how-to-use-cryptojs/34185)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 0\
**Last updated:** [December 18, 2021, 2:51pm UTC](https://discourse.processing.org/t/p5-js-how-to-use-cryptojs/34185 "2021-12-18T14:51:56Z")

</div>

How to use ‘CryptoJS’ Add library \<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"\>\</script\> Add code var encrypted = CryptoJS.AES.encrypt(myString, myPassword); var decrypted…

---

## [Storing a one snapshot of value within a draw loop?](https://discourse.processing.org/t/storing-a-one-snapshot-of-value-within-a-draw-loop/33510)

<div class="topic-metadata">

**Author:** [@basicvisual](https://discourse.processing.org/u/basicvisual)\
**Replies:** 12\
**Last updated:** [December 11, 2021, 10:28pm UTC](https://discourse.processing.org/t/storing-a-one-snapshot-of-value-within-a-draw-loop/33510 "2021-12-11T22:28:12Z")

</div>

Hi I am exploring Ml5js posenet model to get the 2D keypoints. I am using these keypoints to calculate the angle around a joint area , for example shoulder joint. I am looking for a way to store the x and y co .ordinate…

---

## [\[p5.js\] Communication-related in 'P5', is UDP or TCP possible?](https://discourse.processing.org/t/p5-js-communication-related-in-p5-is-udp-or-tcp-possible/34012)

<div class="topic-metadata">

**Author:** [@GWAK](https://discourse.processing.org/u/GWAK)\
**Replies:** 2\
**Last updated:** [December 9, 2021, 6:11pm UTC](https://discourse.processing.org/t/p5-js-communication-related-in-p5-is-udp-or-tcp-possible/34012 "2021-12-09T18:11:04Z")

</div>

This is related to socket communication. p5.js, node.js, socket.io · processing/p5.js Wiki · GitHub node.js Node js를 이용하여 UDP Server와 Client 만들기 - SW 기술 블로그 (Q&A) Communication-related in ‘P5’, is UDP or TCP po…

---

## [Obj rigging in p5.js or combined with another lib?](https://discourse.processing.org/t/obj-rigging-in-p5-js-or-combined-with-another-lib/27088)

<div class="topic-metadata">

**Author:** [@ffd8](https://discourse.processing.org/u/ffd8)\
**Replies:** 3\
**Last updated:** [December 8, 2021, 11:18pm UTC](https://discourse.processing.org/t/obj-rigging-in-p5-js-or-combined-with-another-lib/27088 "2021-12-08T23:18:31Z")

</div>

Curious if anyone has tips/advice on how to do OBJ rigging (like animating the model from a skeleton) within p5.js? There was an abandoned issue on the topic some years ago… Found one of many tutorials using three.js – b…

---

## [P5.JS & jsPDF cant use 2.4.0 but 1.3.3 works](https://discourse.processing.org/t/p5-js-jspdf-cant-use-2-4-0-but-1-3-3-works/33792)

<div class="topic-metadata">

**Author:** [@24601](https://discourse.processing.org/u/24601)\
**Replies:** 3\
**Last updated:** [November 28, 2021, 7:55am UTC](https://discourse.processing.org/t/p5-js-jspdf-cant-use-2-4-0-but-1-3-3-works/33792 "2021-11-28T07:55:19Z")

</div>

Hello Trying to upgrade jsPDF library to the latest version but Currently using this \<script src="//cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.3/jspdf.min.js"\>\</script\> Swapping it out for this \<script src="https://un…

---

## [Using p5.distortion in p5.sound](https://discourse.processing.org/t/using-p5-distortion-in-p5-sound/33777)

<div class="topic-metadata">

**Author:** [@angeltapes](https://discourse.processing.org/u/angeltapes)\
**Replies:** 0\
**Last updated:** [November 26, 2021, 9:16pm UTC](https://discourse.processing.org/t/using-p5-distortion-in-p5-sound/33777 "2021-11-26T21:16:39Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I’ve been trying to use the p5.distortion extension of p5.effect to distort an oscillator. I don’t think it’s working, however. Does anyone have…

---

## [JavaScript w/ p5.js Editor: Figuring out how to modify my code for mouse over hover box and API display](https://discourse.processing.org/t/javascript-w-p5-js-editor-figuring-out-how-to-modify-my-code-for-mouse-over-hover-box-and-api-display/33566)

<div class="topic-metadata">

**Author:** [@cartopher](https://discourse.processing.org/u/cartopher)\
**Replies:** 1\
**Last updated:** [November 18, 2021, 12:07am UTC](https://discourse.processing.org/t/javascript-w-p5-js-editor-figuring-out-how-to-modify-my-code-for-mouse-over-hover-box-and-api-display/33566 "2021-11-18T00:07:53Z")

</div>

p5.js Web Editor I’m having difficulty figuring out how to modify my code so that when you hover over a point on the map, a box appears displaying the location’s name, in addition to displaying weather data from the wea…

---

## [Sound does not play](https://discourse.processing.org/t/sound-does-not-play/33546)

<div class="topic-metadata">

**Author:** [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)\
**Replies:** 1\
**Last updated:** [November 16, 2021, 8:24pm UTC](https://discourse.processing.org/t/sound-does-not-play/33546 "2021-11-16T20:24:52Z")

</div>

I tried to write a program that works on mobile (apple) devices. Everything works except for the sound. This is my code: // A sound file object var dingdong; function preload() { // Load the sound file. // We hav…

[Previous page](https://discourse.processing.org/c/p5js/p5js-libraries/20.md?page=3)

[Next page](https://discourse.processing.org/c/p5js/p5js-libraries/20.md?page=5)
