# Libraries

**URL:** https://discourse.processing.org/c/p5js/p5js-libraries/20.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

---

## [How to rotate or setState of easycam during mouse wheel zooming?](https://discourse.processing.org/t/how-to-rotate-or-setstate-of-easycam-during-mouse-wheel-zooming/14925)

<div class="topic-metadata">

**Author:** [@hmdeif](https://discourse.processing.org/u/hmdeif)\
**Replies:** 6\
**Last updated:** [November 3, 2019, 2:54am UTC](https://discourse.processing.org/t/how-to-rotate-or-setstate-of-easycam-during-mouse-wheel-zooming/14925 "2019-11-03T02:54:15Z")

</div>

Currently I’m trying to rotate a cube if the camera approaches it at a certain distance (300). But all rotation or setState functions are not working properly as it seems they are not interrupting the current zoom proces…

---

## [P5js audio array loop issues](https://discourse.processing.org/t/p5js-audio-array-loop-issues/15044)

<div class="topic-metadata">

**Author:** [@Indieminor](https://discourse.processing.org/u/Indieminor)\
**Replies:** 5\
**Last updated:** [October 30, 2019, 11:04pm UTC](https://discourse.processing.org/t/p5js-audio-array-loop-issues/15044 "2019-10-30T23:04:53Z")

</div>

Hi all, I am building an audio/visual project where I have a visual and background change on click and I want a sound to play every time the mouse is clicked. So click once, animation/track1, click again, animation/track…

---

## [Teaching p5js - what to do about svg?](https://discourse.processing.org/t/teaching-p5js-what-to-do-about-svg/14830)

<div class="topic-metadata">

**Author:** [@grhabyt](https://discourse.processing.org/u/grhabyt)\
**Replies:** 3\
**Last updated:** [October 27, 2019, 9:28pm UTC](https://discourse.processing.org/t/teaching-p5js-what-to-do-about-svg/14830 "2019-10-27T21:28:24Z")

</div>

I teach p5js to undergraduates as part of a Screen-Based Interaction Design course. It’s great until we get to intermediate data visualization. Importing json and drawing circles is fine, but what everyone wants to do, e…

---

## [Added sound to a program and now it crashes chrome](https://discourse.processing.org/t/added-sound-to-a-program-and-now-it-crashes-chrome/14946)

<div class="topic-metadata">

**Author:** [@Mike](https://discourse.processing.org/u/Mike)\
**Replies:** 13\
**Last updated:** [October 26, 2019, 3:38am UTC](https://discourse.processing.org/t/added-sound-to-a-program-and-now-it-crashes-chrome/14946 "2019-10-26T03:38:54Z")

</div>

Hey, I am making a project for my son who loves trains. It is all working decent at this time but as soon as i added the sound to the project and im running one of the mouse presses with the sound on it crashes chrome. …

---

## [Stop() method for p5.Part not working?](https://discourse.processing.org/t/stop-method-for-p5-part-not-working/14618)

<div class="topic-metadata">

**Author:** [@leobrooks](https://discourse.processing.org/u/leobrooks)\
**Replies:** 0\
**Last updated:** [October 11, 2019, 9:07pm UTC](https://discourse.processing.org/t/stop-method-for-p5-part-not-working/14618 "2019-10-11T21:07:35Z")

</div>

Hello, I’m working on a program where the p5.Part and p5.Phrases are at the core of what I want it to be able to do. However, the stop() method, which says it should reset the Part to step 0 doesn’t seem to work. I know…

---

## [Two microphone inputs](https://discourse.processing.org/t/two-microphone-inputs/14321)

<div class="topic-metadata">

**Author:** [@l3ehfar](https://discourse.processing.org/u/l3ehfar)\
**Replies:** 3\
**Last updated:** [October 11, 2019, 8:40pm UTC](https://discourse.processing.org/t/two-microphone-inputs/14321 "2019-10-11T20:40:11Z")

</div>

I wanna know how to get two mic inputs in my p5js code. actually my sound card has two input channels and I wanna process each channel’s signal separated from the other in my code.

---

## [Switching from localhost to nodejs and express](https://discourse.processing.org/t/switching-from-localhost-to-nodejs-and-express/14377)

<div class="topic-metadata">

**Author:** [@Kent](https://discourse.processing.org/u/Kent)\
**Replies:** 4\
**Last updated:** [October 8, 2019, 3:44am UTC](https://discourse.processing.org/t/switching-from-localhost-to-nodejs-and-express/14377 "2019-10-08T03:44:53Z")

</div>

I’m trying to learn more about p5.js by following the working with data tutorials The code for both the fetch csv exercise(https://github.com/CodingTrain/Intro-to-Data-APIs-JS/tree/source/module1/02\_fetch\_csv\_exercise\_…

---

## [Preciso de ajuda processing audio desenho](https://discourse.processing.org/t/preciso-de-ajuda-processing-audio-desenho/14468)

<div class="topic-metadata">

**Author:** [@delucasouz](https://discourse.processing.org/u/delucasouz)\
**Replies:** 3\
**Last updated:** [October 8, 2019, 1:52am UTC](https://discourse.processing.org/t/preciso-de-ajuda-processing-audio-desenho/14468 "2019-10-08T01:52:53Z")

</div>

I need to develop a processing.js code that allows anyone to speak through the microphone to draw anything on the screen in a random, colorful way. Here’s an example: https://www.openprocessing.org/sketch/579128 Please …

---

## [Audio Issue: Safari and iOS](https://discourse.processing.org/t/audio-issue-safari-and-ios/7485)

<div class="topic-metadata">

**Author:** [@djw](https://discourse.processing.org/u/djw)\
**Replies:** 2\
**Last updated:** [October 4, 2019, 1:45am UTC](https://discourse.processing.org/t/audio-issue-safari-and-ios/7485 "2019-10-04T01:45:28Z")

</div>

I’ve just been working on a simple p5.js script and thought it was working well as in Chrome things are fine: now.danieljwilson.com However I just get Loading... when I try to view it on Safari or on Chrome on my iPad. …

---

## [How to play sound on muted iPhone?](https://discourse.processing.org/t/how-to-play-sound-on-muted-iphone/12870)

<div class="topic-metadata">

**Author:** [@epignosis567](https://discourse.processing.org/u/epignosis567)\
**Replies:** 2\
**Last updated:** [September 28, 2019, 8:35pm UTC](https://discourse.processing.org/t/how-to-play-sound-on-muted-iphone/12870 "2019-09-28T20:35:48Z")

</div>

Hi. I alluded to this elsewhere in a post but I can’t figure out why P5 won’t play sound on a muted iPhone. I’m new to coding but it seems like a lot of other javascript will play sounds on muted iPhones. Here’s a post f…

---

## [Audio Example not working](https://discourse.processing.org/t/audio-example-not-working/14188)

<div class="topic-metadata">

**Author:** [@philspitler](https://discourse.processing.org/u/philspitler)\
**Replies:** 15\
**Last updated:** [September 28, 2019, 4:46pm UTC](https://discourse.processing.org/t/audio-example-not-working/14188 "2019-09-28T16:46:09Z")

</div>

Hi, I’m a total noob to p5 although I have done a fair amount of Processing work over the years. I am trying to get the “hello amplitude” sketch to work but keep getting errors… I took the files from here. https://the…

---

## [Save Image as SVG](https://discourse.processing.org/t/save-image-as-svg/14108)

<div class="topic-metadata">

**Author:** [@mikolaskoa](https://discourse.processing.org/u/mikolaskoa)\
**Replies:** 0\
**Last updated:** [September 22, 2019, 2:22pm UTC](https://discourse.processing.org/t/save-image-as-svg/14108 "2019-09-22T14:22:13Z")

</div>

Hello, I would like to save the canvas as SVG. I found this: https://editor.p5js.org/dannyrozin/sketches/r1djoVow7 But it does not work for Canvas content created as Image f.e. http://www.mikolaskova.cz/testscreen/10/ …

---

## [Speech recognition library issues (P5.speech)](https://discourse.processing.org/t/speech-recognition-library-issues-p5-speech/14014)

<div class="topic-metadata">

**Author:** [@feelthemall](https://discourse.processing.org/u/feelthemall)\
**Replies:** 1\
**Last updated:** [September 17, 2019, 2:10am UTC](https://discourse.processing.org/t/speech-recognition-library-issues-p5-speech/14014 "2019-09-17T02:10:58Z")

</div>

The stop() method is not working in my scetch. The console throws out this message: sketch.js:28 Uncaught TypeError: myRec.stop is not a function and it doesn’t matter where I’m using it inside the scetch, the result i…

---

## [Sound crackles when using the amp method](https://discourse.processing.org/t/sound-crackles-when-using-the-amp-method/14032)

<div class="topic-metadata">

**Author:** [@thiblejack](https://discourse.processing.org/u/thiblejack)\
**Replies:** 0\
**Last updated:** [September 17, 2019, 8:25pm UTC](https://discourse.processing.org/t/sound-crackles-when-using-the-amp-method/14032 "2019-09-17T20:25:21Z")

</div>

Hi, I’m trying to implement a polyphonic synthesizer with polyphonic aftertouch. But when I route the aftertouch events to the amplitude of my sine, it crackles a lot. I guess it’s happening because this method is not i…

---

## [P5.js library and sound issue (bug?)](https://discourse.processing.org/t/p5-js-library-and-sound-issue-bug/13923)

<div class="topic-metadata">

**Author:** [@gaborpszti](https://discourse.processing.org/u/gaborpszti)\
**Replies:** 0\
**Last updated:** [September 11, 2019, 9:58am UTC](https://discourse.processing.org/t/p5-js-library-and-sound-issue-bug/13923 "2019-09-11T09:58:48Z")

</div>

I copied a code from p5.js website ( https://p5js.org/examples/sound-oscillator-frequency.html ) on oscillator example. It runs perfectly on official online p5.js editor, however when I paste it in my Brackets editor it…

---

## [\[ SOLVED \] How to import Collide2D](https://discourse.processing.org/t/solved-how-to-import-collide2d/13713)

<div class="topic-metadata">

**Author:** [@MrShawn](https://discourse.processing.org/u/MrShawn)\
**Replies:** 4\
**Last updated:** [August 31, 2019, 5:27pm UTC](https://discourse.processing.org/t/solved-how-to-import-collide2d/13713 "2019-08-31T17:27:45Z")

</div>

Hello, I am trying to import Collide2D by @bmoren into my p5js project. I added the rawgithubcontent link to the minified library in my index.html, but it didn’t import properly. How do I properly import it? Here is my …

---

## [P5.ble.js - Does It Work With All Browsers?](https://discourse.processing.org/t/p5-ble-js-does-it-work-with-all-browsers/13675)

<div class="topic-metadata">

**Author:** [@jgavlik](https://discourse.processing.org/u/jgavlik)\
**Replies:** 1\
**Last updated:** [August 28, 2019, 7:30pm UTC](https://discourse.processing.org/t/p5-ble-js-does-it-work-with-all-browsers/13675 "2019-08-28T19:30:07Z")

</div>

Can p5.ble.js work with more than the Chrome browser… like FireFox??

---

## [Dragging canvas out of the browser (as an image)](https://discourse.processing.org/t/dragging-canvas-out-of-the-browser-as-an-image/13183)

<div class="topic-metadata">

**Author:** [@thirstydude](https://discourse.processing.org/u/thirstydude)\
**Replies:** 7\
**Last updated:** [August 21, 2019, 6:27pm UTC](https://discourse.processing.org/t/dragging-canvas-out-of-the-browser-as-an-image/13183 "2019-08-21T18:27:22Z")

</div>

Hi everyone! this is my first post and i hope i am in the right section here. Also, i am very new to p5 and coding in general so please bear with me :slight\_smile: i am kind of stuck in a very simple project i’m doing.…

---

## [Question about openprocessing.org functionality](https://discourse.processing.org/t/question-about-openprocessing-org-functionality/13181)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 6\
**Last updated:** [August 8, 2019, 5:18pm UTC](https://discourse.processing.org/t/question-about-openprocessing-org-functionality/13181 "2019-08-08T17:18:46Z")

</div>

Hello all, If I place a sound in the setup function it will play when I hit the play button. However, if I navigate to the page through a link on my openprocessing.org homepage, then the sound won’t play. In that same s…

---

## [Rotate the video created by createCapture](https://discourse.processing.org/t/rotate-the-video-created-by-createcapture/13189)

<div class="topic-metadata">

**Author:** [@Skim464](https://discourse.processing.org/u/Skim464)\
**Replies:** 2\
**Last updated:** [August 7, 2019, 9:00pm UTC](https://discourse.processing.org/t/rotate-the-video-created-by-createcapture/13189 "2019-08-07T21:00:50Z")

</div>

Hello. I am doing a posenet implementation of ml5 and p5.js Typical setup for the ML5 Posenet is as following: function setup() { const canvas = createCanvas(640, 480); canvas.parent(‘videoContainer’); video = cre…

---

## [Sound in setup doesn't play from openprocessing](https://discourse.processing.org/t/sound-in-setup-doesnt-play-from-openprocessing/13185)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 0\
**Last updated:** [August 4, 2019, 2:57pm UTC](https://discourse.processing.org/t/sound-in-setup-doesnt-play-from-openprocessing/13185 "2019-08-04T14:57:00Z")

</div>

Here’s another interesting finding. Can anyone crack this puzzle? If I place a sound in the setup function it will play when I hit the play button. However, if I navigate to the page through a link on my openprocessing.o…

---

## [Can't play sound](https://discourse.processing.org/t/cant-play-sound/13130)

<div class="topic-metadata">

**Author:** [@SheCurvesMobius](https://discourse.processing.org/u/SheCurvesMobius)\
**Replies:** 5\
**Last updated:** [August 4, 2019, 1:45pm UTC](https://discourse.processing.org/t/cant-play-sound/13130 "2019-08-04T13:45:05Z")

</div>

Hello, I’m just learning to work with sound and I can’t get my sketch to work. Here’s the code: let mySound; function preload() { soundFormats('mp3'); mySound = loadSound('doorbell.mp3'); } function setup() { …

---

## [Start image in center then follow mouse?](https://discourse.processing.org/t/start-image-in-center-then-follow-mouse/12834)

<div class="topic-metadata">

**Author:** [@epignosis567](https://discourse.processing.org/u/epignosis567)\
**Replies:** 15\
**Last updated:** [August 3, 2019, 11:21am UTC](https://discourse.processing.org/t/start-image-in-center-then-follow-mouse/12834 "2019-08-03T11:21:21Z")

</div>

Hi. How could I edit this code so that when a person loads the page the image is in the center but then once they click/touch the image follows the mouse cursor/finger? Currently the image follows the cursor but that mea…

---

## [Wrapping preload(), setup() and draw() in an ES6 class](https://discourse.processing.org/t/wrapping-preload-setup-and-draw-in-an-es6-class/13071)

<div class="topic-metadata">

**Author:** [@kenny83](https://discourse.processing.org/u/kenny83)\
**Replies:** 7\
**Last updated:** [August 3, 2019, 12:42am UTC](https://discourse.processing.org/t/wrapping-preload-setup-and-draw-in-an-es6-class/13071 "2019-08-03T00:42:18Z")

</div>

Hi all, Apologies if this has been discussed before; I did a quick search across Google and this forum but didn’t find much. Please point me in the right direction if this is a duplicate question :slight\_smile: So what…

---

## [P5.js music and drawing](https://discourse.processing.org/t/p5-js-music-and-drawing/12950)

<div class="topic-metadata">

**Author:** [@amstaff](https://discourse.processing.org/u/amstaff)\
**Replies:** 3\
**Last updated:** [July 28, 2019, 12:10am UTC](https://discourse.processing.org/t/p5-js-music-and-drawing/12950 "2019-07-28T00:10:47Z")

</div>

Is it possible to play music with p5 and the program will draw a picture depending on the beat? Are there any examples how the whole thing should look like?

---

## [Can't get audio to play when loading](https://discourse.processing.org/t/cant-get-audio-to-play-when-loading/10567)

<div class="topic-metadata">

**Author:** [@Indieminor](https://discourse.processing.org/u/Indieminor)\
**Replies:** 4\
**Last updated:** [July 22, 2019, 7:27pm UTC](https://discourse.processing.org/t/cant-get-audio-to-play-when-loading/10567 "2019-07-22T19:27:21Z")

</div>

Hey all, I would love to use p5.js for my audio/visual project, but I am having a hard time even getting a sound to load on setup. Here is my code: let song; function preload() { song = loadSound('sounds\\Changing i…

---

## [Pls critique my code!](https://discourse.processing.org/t/pls-critique-my-code/12855)

<div class="topic-metadata">

**Author:** [@epignosis567](https://discourse.processing.org/u/epignosis567)\
**Replies:** 4\
**Last updated:** [July 21, 2019, 8:06pm UTC](https://discourse.processing.org/t/pls-critique-my-code/12855 "2019-07-21T20:06:21Z")

</div>

Hi. I’m having a lot of problems with things not working the way they should, and things not working the way other people say they should. Can you please critique my code? I’m new to coding and just hacking things togeth…

---

## [When I Retrieve The Amplitudes From An Audio Source - The Data Often Comes Back Different. Whats The Best Way To Regulate The Data So I Get The Same Numbers Consistently?](https://discourse.processing.org/t/when-i-retrieve-the-amplitudes-from-an-audio-source-the-data-often-comes-back-different-whats-the-best-way-to-regulate-the-data-so-i-get-the-same-numbers-consistently/12865)

<div class="topic-metadata">

**Author:** [@JacksonEnnis](https://discourse.processing.org/u/JacksonEnnis)\
**Replies:** 2\
**Last updated:** [July 21, 2019, 7:17pm UTC](https://discourse.processing.org/t/when-i-retrieve-the-amplitudes-from-an-audio-source-the-data-often-comes-back-different-whats-the-best-way-to-regulate-the-data-so-i-get-the-same-numbers-consistently/12865 "2019-07-21T19:17:09Z")

</div>

Hello friendos! I have just finished my first hackathon project and… it was grueling. The official end is tonight. Pretty much, the project takes an audio file, and allows the user to select a “cut” from it. This cut h…

---

## [Webpage slides around in mobile browser](https://discourse.processing.org/t/webpage-slides-around-in-mobile-browser/12832)

<div class="topic-metadata">

**Author:** [@epignosis567](https://discourse.processing.org/u/epignosis567)\
**Replies:** 5\
**Last updated:** [July 21, 2019, 3:05am UTC](https://discourse.processing.org/t/webpage-slides-around-in-mobile-browser/12832 "2019-07-21T03:05:58Z")

</div>

Hi. I’ve made my first P5 webpage but it slides around a lot. It’s a big problem on the Chrome mobile browser because dragging down causes the page to refresh. I’ve tried researching ways to prevent it from sliding aroun…

---

## [Sound not playing on mouseMoved](https://discourse.processing.org/t/sound-not-playing-on-mousemoved/12802)

<div class="topic-metadata">

**Author:** [@epignosis567](https://discourse.processing.org/u/epignosis567)\
**Replies:** 8\
**Last updated:** [July 19, 2019, 9:41pm UTC](https://discourse.processing.org/t/sound-not-playing-on-mousemoved/12802 "2019-07-19T21:41:21Z")

</div>

Hi. I have the following code that I edited from an example. It worked in the example window but won’t work in dreamweaver or when I upload it to my server. Everything works except the sound effect, it won’t play. Are th…

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

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