# Libraries

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

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

**Page:** 14

---

## ['Unable to set input source' p5.AudioIn()](https://discourse.processing.org/t/unable-to-set-input-source-p5-audioin/17373)

<div class="topic-metadata">

**Author:** [@Lucca](https://discourse.processing.org/u/Lucca)\
**Replies:** 0\
**Last updated:** [January 27, 2020, 1:09pm UTC](https://discourse.processing.org/t/unable-to-set-input-source-p5-audioin/17373 "2020-01-27T13:09:40Z")

</div>

I am trying to grab my speakers/headphones audio in a p5 sketch I am writing to analyze the sound playing on my system. I can use the AudioIn.getSources() method to return an array of sources, the first of which is liste…

---

## [P5.js and arduino using serial.js](https://discourse.processing.org/t/p5-js-and-arduino-using-serial-js/17364)

<div class="topic-metadata">

**Author:** [@ACBRrobotics](https://discourse.processing.org/u/ACBRrobotics)\
**Replies:** 0\
**Last updated:** [January 27, 2020, 8:00am UTC](https://discourse.processing.org/t/p5-js-and-arduino-using-serial-js/17364 "2020-01-27T08:00:00Z")

</div>

Hello! So I have been trying to reverse engineer this great example from the google team about interfacing TensorFlow models created in “teachable machine”, then using a p5.js sketch and the WebUSB library to send seria…

---

## [React P5 loading image question. How do I pass prop values to preload image?](https://discourse.processing.org/t/react-p5-loading-image-question-how-do-i-pass-prop-values-to-preload-image/16961)

<div class="topic-metadata">

**Author:** [@eagle3y3z](https://discourse.processing.org/u/eagle3y3z)\
**Replies:** 4\
**Last updated:** [January 25, 2020, 12:15am UTC](https://discourse.processing.org/t/react-p5-loading-image-question-how-do-i-pass-prop-values-to-preload-image/16961 "2020-01-25T00:15:20Z")

</div>

I am relatively new to P5 and I just don’t quite understand how to load an image using react p5-wrapper and the prop values together. I’m gettting an error that my img variable is not being read and is undefined. The onl…

---

## [Variable pollution across objects from class](https://discourse.processing.org/t/variable-pollution-across-objects-from-class/17221)

<div class="topic-metadata">

**Author:** [@marloguer](https://discourse.processing.org/u/marloguer)\
**Replies:** 0\
**Last updated:** [January 21, 2020, 11:46am UTC](https://discourse.processing.org/t/variable-pollution-across-objects-from-class/17221 "2020-01-21T11:46:59Z")

</div>

Hello, Im new to p5.js but am using it via the react-p5-wrapper for data-visualisation within a react webapp… I can successfully render ‘strings’ to screen such that a string starts off-screen-right at a random yPositio…

---

## [Draw elements in foreground vs background](https://discourse.processing.org/t/draw-elements-in-foreground-vs-background/17197)

<div class="topic-metadata">

**Author:** [@criacuervos](https://discourse.processing.org/u/criacuervos)\
**Replies:** 5\
**Last updated:** [January 21, 2020, 12:19am UTC](https://discourse.processing.org/t/draw-elements-in-foreground-vs-background/17197 "2020-01-21T00:19:18Z")

</div>

Hi all, I’m working with p5js on a shared drawing canvas where 2 people can collaborate on a drawing. I want to draw stars on the canvas that cannot be drawn over. I’m having trouble figuring out if this can be done. I …

---

## [Distorted sound when loading multiple MP3s](https://discourse.processing.org/t/distorted-sound-when-loading-multiple-mp3s/17178)

<div class="topic-metadata">

**Author:** [@twin\_tone](https://discourse.processing.org/u/twin_tone)\
**Replies:** 4\
**Last updated:** [January 19, 2020, 3:05am UTC](https://discourse.processing.org/t/distorted-sound-when-loading-multiple-mp3s/17178 "2020-01-19T03:05:31Z")

</div>

Hi all, I’m trying to make an interface that crossfades between audio files depending on mouse position. The thing is, the sound is sounding terrible - like it’s being time stretched or something. Any ideas why this mig…

---

## [P5.play - Create Sprite on a drawing canvas](https://discourse.processing.org/t/p5-play-create-sprite-on-a-drawing-canvas/17111)

<div class="topic-metadata">

**Author:** [@criacuervos](https://discourse.processing.org/u/criacuervos)\
**Replies:** 8\
**Last updated:** [January 16, 2020, 3:45am UTC](https://discourse.processing.org/t/p5-play-create-sprite-on-a-drawing-canvas/17111 "2020-01-16T03:45:29Z")

</div>

Hi everyone, I’m trying to figure out if it is possible to use createSprite/makeSprite from the p5.play library and render that on top of a drawing canvas I already have. Right now I call drawSprites() inside the draw(…

---

## [Difficulties in starting out with p5.sound.js](https://discourse.processing.org/t/difficulties-in-starting-out-with-p5-sound-js/16637)

<div class="topic-metadata">

**Author:** [@roy05](https://discourse.processing.org/u/roy05)\
**Replies:** 3\
**Last updated:** [January 8, 2020, 8:38am UTC](https://discourse.processing.org/t/difficulties-in-starting-out-with-p5-sound-js/16637 "2020-01-08T08:38:43Z")

</div>

So I’m recently starting out with p5.sound.js to make an audio visualizer. However, I find myself stuck at the very first step and I would really appreciate any help. Errors: The AudioContext was not allowed to start. …

---

## [Sound triggered by buttons](https://discourse.processing.org/t/sound-triggered-by-buttons/16831)

<div class="topic-metadata">

**Author:** [@marianne91](https://discourse.processing.org/u/marianne91)\
**Replies:** 7\
**Last updated:** [January 5, 2020, 1:38pm UTC](https://discourse.processing.org/t/sound-triggered-by-buttons/16831 "2020-01-05T13:38:14Z")

</div>

Hi there, Does anyone have an idea of how to trigger sounds with buttons on processing? I have found a tutorial for this for p5.js but can’t make it translate to processing… Ultimately want to use buttons to trigger vi…

---

## [Recording a sketch](https://discourse.processing.org/t/recording-a-sketch/16789)

<div class="topic-metadata">

**Author:** [@lnp](https://discourse.processing.org/u/lnp)\
**Replies:** 4\
**Last updated:** [January 3, 2020, 4:14pm UTC](https://discourse.processing.org/t/recording-a-sketch/16789 "2020-01-03T16:14:23Z")

</div>

Hi there and happy new year! What’s the easiest way to a record real video from a P5 sketch? In Processing Python mode I was using Syphon and Soundflower. I’ve found in the past that stitching screenshots together works…

---

## [How to change object size upon bouncing in p5.play](https://discourse.processing.org/t/how-to-change-object-size-upon-bouncing-in-p5-play/16540)

<div class="topic-metadata">

**Author:** [@blkpanther](https://discourse.processing.org/u/blkpanther)\
**Replies:** 4\
**Last updated:** [December 21, 2019, 4:34am UTC](https://discourse.processing.org/t/how-to-change-object-size-upon-bouncing-in-p5-play/16540 "2019-12-21T04:34:17Z")

</div>

I don’t know how to change the length of an object upon bouncing interaction in p5.play. In the code below, I wish to make the bar shorter from the top upon every hit, but don’t know what keyword to search for in the ref…

---

## [Use p5 on existing canvas](https://discourse.processing.org/t/use-p5-on-existing-canvas/16307)

<div class="topic-metadata">

**Author:** [@tanzor](https://discourse.processing.org/u/tanzor)\
**Replies:** 4\
**Last updated:** [December 17, 2019, 8:49pm UTC](https://discourse.processing.org/t/use-p5-on-existing-canvas/16307 "2019-12-17T20:49:31Z")

</div>

Hey community! Is there a way to sketch with p5 within an existing javascript canvas? (i.e., one that was not opened using p5)? Thanks, Tan

---

## [Problem with using Firebase in online P5 Editor](https://discourse.processing.org/t/problem-with-using-firebase-in-online-p5-editor/11642)

<div class="topic-metadata">

**Author:** [@rsklarew](https://discourse.processing.org/u/rsklarew)\
**Replies:** 3\
**Last updated:** [December 17, 2019, 11:44am UTC](https://discourse.processing.org/t/problem-with-using-firebase-in-online-p5-editor/11642 "2019-12-17T11:44:52Z")

</div>

Firebase realtime database works fine in the old offline P5 editor. But when I use the same code in the new online editor, the variable firebase is not recognized: \*"Uncaught ReferenceError: firebase is not defi…

---

## [Ml5 NetworkError](https://discourse.processing.org/t/ml5-networkerror/16191)

<div class="topic-metadata">

**Author:** [@coco](https://discourse.processing.org/u/coco)\
**Replies:** 8\
**Last updated:** [December 10, 2019, 8:51am UTC](https://discourse.processing.org/t/ml5-networkerror/16191 "2019-12-10T08:51:13Z")

</div>

I’m trying to get the Image Classifier demo to work (using a local server) but I keep getting a “NetworkError when attempting to fetch resource” error… It apparently has something to do with CORS but I can’t seem to a…

---

## [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…

---

## [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…

---

## [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…

---

## [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…

---

## [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.…

---

## [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…

---

## [Issues classifying a drawing with ml5.js](https://discourse.processing.org/t/issues-classifying-a-drawing-with-ml5-js/14827)

<div class="topic-metadata">

**Author:** [@ishback](https://discourse.processing.org/u/ishback)\
**Replies:** 4\
**Last updated:** [November 24, 2019, 11:17pm UTC](https://discourse.processing.org/t/issues-classifying-a-drawing-with-ml5-js/14827 "2019-11-24T23:17:33Z")

</div>

Hello, I’m trying to classify drawings with a custom model generated by Teachable Machine. To do so I’m storing the doodle in a p5.Renderer object using createGraphics(), and sending that object to the classifier. I no…

---

## [Beat unstable in graphic animation](https://discourse.processing.org/t/beat-unstable-in-graphic-animation/15493)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 33\
**Last updated:** [November 23, 2019, 11:34am UTC](https://discourse.processing.org/t/beat-unstable-in-graphic-animation/15493 "2019-11-23T11:34:12Z")

</div>

Dear p5 community, https://editor.p5js.org/byxx/sketches/EuJCp1iVI Although the basic functionality is there, it seems that the beat is not really(!) stable, which I considered to be cared for by p5 accurately… thanks…

---

## [Reloading a JSON in p5](https://discourse.processing.org/t/reloading-a-json-in-p5/15520)

<div class="topic-metadata">

**Author:** [@sdsu2020](https://discourse.processing.org/u/sdsu2020)\
**Replies:** 2\
**Last updated:** [November 18, 2019, 6:41am UTC](https://discourse.processing.org/t/reloading-a-json-in-p5/15520 "2019-11-18T06:41:11Z")

</div>

Hello. I’m currently working with geocoding API with Mapquest. I have this code written in setup right now. function setup(){ canvas = createCanvas(840,840); myMap = mappa.tileMap(options); myMap.overlay(canvas)…

---

## [Spectrum analyzer graphic problem](https://discourse.processing.org/t/spectrum-analyzer-graphic-problem/15576)

<div class="topic-metadata">

**Author:** [@ercank](https://discourse.processing.org/u/ercank)\
**Replies:** 1\
**Last updated:** [November 17, 2019, 2:46pm UTC](https://discourse.processing.org/t/spectrum-analyzer-graphic-problem/15576 "2019-11-17T14:46:16Z")

</div>

Hi, I’m new to coding. I’m sorry to keep you busy with something simple. I paste and run a sample code on the P5.JS online ditor (sound spectrum analyzer). I download “empty-example” with the library from the site and r…

---

## [P5 Sound Issues](https://discourse.processing.org/t/p5-sound-issues/15573)

<div class="topic-metadata">

**Author:** [@seanzshow](https://discourse.processing.org/u/seanzshow)\
**Replies:** 4\
**Last updated:** [November 17, 2019, 1:13pm UTC](https://discourse.processing.org/t/p5-sound-issues/15573 "2019-11-17T13:13:40Z")

</div>

Hi can anyone tell me where I am going wrong here? It appears that the p5 sound library is not being read - hence it doesn’t understand things like loop. However it is linked to in the HTML as a default and Ive not chang…

---

## [FFT within a Object](https://discourse.processing.org/t/fft-within-a-object/15408)

<div class="topic-metadata">

**Author:** [@alexandr56](https://discourse.processing.org/u/alexandr56)\
**Replies:** 1\
**Last updated:** [November 14, 2019, 4:00pm UTC](https://discourse.processing.org/t/fft-within-a-object/15408 "2019-11-14T16:00:42Z")

</div>

I’m working on a project and i have my audio files being put into an audio object in order for it to be played and created but when I try to analyze the frequency using FFT it doesn’t pick anything up here’s the code for…

---

## [Scale of image in a group affects gravity when a collider is applied](https://discourse.processing.org/t/scale-of-image-in-a-group-affects-gravity-when-a-collider-is-applied/15192)

<div class="topic-metadata">

**Author:** [@DavidJonesADA](https://discourse.processing.org/u/DavidJonesADA)\
**Replies:** 1\
**Last updated:** [November 12, 2019, 10:39pm UTC](https://discourse.processing.org/t/scale-of-image-in-a-group-affects-gravity-when-a-collider-is-applied/15192 "2019-11-12T22:39:58Z")

</div>

Greetings Processing forum, I am trying to make a simple game to dodge moving sprites in a group using the p5.js and the p5.play libraries. However, I have come upon an issue where now I want to detect if there is a col…

---

## [P5 - Starting out music website - accessing mp3s correctly](https://discourse.processing.org/t/p5-starting-out-music-website-accessing-mp3s-correctly/15102)

<div class="topic-metadata">

**Author:** [@byxx](https://discourse.processing.org/u/byxx)\
**Replies:** 9\
**Last updated:** [November 11, 2019, 4:33pm UTC](https://discourse.processing.org/t/p5-starting-out-music-website-accessing-mp3s-correctly/15102 "2019-11-11T16:33:37Z")

</div>

Dear Community, I would like to know if I can create a homepage with lots of mp3s in P5. I don´t know if its a good idea to incorporate a Data Bank like mysql or how I could access a data bank. It is probable, that I c…

---

## [setVolume: rampTime and timeFromNow Mystery?](https://discourse.processing.org/t/setvolume-ramptime-and-timefromnow-mystery/15376)

<div class="topic-metadata">

**Author:** [@unofficial](https://discourse.processing.org/u/unofficial)\
**Replies:** 4\
**Last updated:** [November 11, 2019, 9:51am UTC](https://discourse.processing.org/t/setvolume-ramptime-and-timefromnow-mystery/15376 "2019-11-11T09:51:41Z")

</div>

Hi there I am a veteran audio engineer and novice programmer, it is humbling to understand audio so well and yet be so mystified by coding it… Anyway I was just playing around with the setVolume function and to my chagr…

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

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