# Libraries

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

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

**Page:** 7

---

## [Calculating the displacement of keypoints in pixels](https://discourse.processing.org/t/calculating-the-displacement-of-keypoints-in-pixels/31430)

<div class="topic-metadata">

**Author:** [@Timo](https://discourse.processing.org/u/Timo)\
**Replies:** 3\
**Last updated:** [July 31, 2021, 8:51pm UTC](https://discourse.processing.org/t/calculating-the-displacement-of-keypoints-in-pixels/31430 "2021-07-31T20:51:26Z")

</div>

Hi , I am exploring then ml5 and posenet . I am having some issues in calculating the displacement of keypoints ( nose , in my case) . I can get the keypoints logged out but my logic on calculating the displacement of n…

---

## [Sound.stop() not returning 0 on sound.currentTime()](https://discourse.processing.org/t/sound-stop-not-returning-0-on-sound-currenttime/31456)

<div class="topic-metadata">

**Author:** [@atagger](https://discourse.processing.org/u/atagger)\
**Replies:** 2\
**Last updated:** [July 29, 2021, 9:12pm UTC](https://discourse.processing.org/t/sound-stop-not-returning-0-on-sound-currenttime/31456 "2021-07-29T21:12:28Z")

</div>

I think there is something wrong / buggy in p5 sound. When you hit stop it should return zero for currentTime(), unless I am misunderstanding the intended behavior. I’m trying to change the sound playing using an array, …

---

## [How to play back my own voice?](https://discourse.processing.org/t/how-to-play-back-my-own-voice/31393)

<div class="topic-metadata">

**Author:** [@tony](https://discourse.processing.org/u/tony)\
**Replies:** 1\
**Last updated:** [July 22, 2021, 9:57pm UTC](https://discourse.processing.org/t/how-to-play-back-my-own-voice/31393 "2021-07-22T21:57:07Z")

</div>

Hey! Any p5.sound experts here? How would I make a sketch that lets me listen to my own audio, live? Not a “record a voice clip, then play it back” kind of deal, but a “speak into the mic, and listen to what I sound lik…

---

## [P5js AudioIn function not working on instance mode](https://discourse.processing.org/t/p5js-audioin-function-not-working-on-instance-mode/31179)

<div class="topic-metadata">

**Author:** [@Seriously](https://discourse.processing.org/u/Seriously)\
**Replies:** 1\
**Last updated:** [July 18, 2021, 7:41pm UTC](https://discourse.processing.org/t/p5js-audioin-function-not-working-on-instance-mode/31179 "2021-07-18T19:41:16Z")

</div>

I was converting my p5js code to instance mode to run 2 canvases in the same DOM but my p5.AudioIn() function is not working. The error I get is referencing Failed to construct 'AudioWorkletNode' . I have uploaded a scre…

---

## [\[p5.js Sound\] Setting time between which amp.getLevel returns values](https://discourse.processing.org/t/p5-js-sound-setting-time-between-which-amp-getlevel-returns-values/31297)

<div class="topic-metadata">

**Author:** [@acagastya](https://discourse.processing.org/u/acagastya)\
**Replies:** 1\
**Last updated:** [July 18, 2021, 7:24pm UTC](https://discourse.processing.org/t/p5-js-sound-setting-time-between-which-amp-getlevel-returns-values/31297 "2021-07-18T19:24:14Z")

</div>

Hi, I am trying to get the amplitude of an audio file, to render something similar to the attached screenshot. I want to show the amp every 100ms only. If I understand correctly, amp.getLevel is called every time a n…

---

## [Clone canvas to p5 creategraphics()](https://discourse.processing.org/t/clone-canvas-to-p5-creategraphics/31142)

<div class="topic-metadata">

**Author:** [@atagger](https://discourse.processing.org/u/atagger)\
**Replies:** 2\
**Last updated:** [July 9, 2021, 8:09pm UTC](https://discourse.processing.org/t/clone-canvas-to-p5-creategraphics/31142 "2021-07-09T20:09:14Z")

</div>

Is there a way to clone the entire p5 canvas to creategraphics? I’m trying to render a SVG using the p5.js-svg library, but I don’t want to set the entire canvas renderer to “SVG”, because I only need the output to happe…

---

## [403 error and sound files](https://discourse.processing.org/t/403-error-and-sound-files/31007)

<div class="topic-metadata">

**Author:** [@quargsgreene](https://discourse.processing.org/u/quargsgreene)\
**Replies:** 3\
**Last updated:** [July 3, 2021, 2:33am UTC](https://discourse.processing.org/t/403-error-and-sound-files/31007 "2021-07-03T02:33:37Z")

</div>

I was trying to add a sound file to a sketch on Open Processing and it started throwing a 403 error when I tried to trigger the sound. The files are all uploaded to the site and do not have to be accessed locally, so I w…

---

## [musicXML importing](https://discourse.processing.org/t/musicxml-importing/30742)

<div class="topic-metadata">

**Author:** [@patricio1979](https://discourse.processing.org/u/patricio1979)\
**Replies:** 3\
**Last updated:** [July 1, 2021, 1:44pm UTC](https://discourse.processing.org/t/musicxml-importing/30742 "2021-07-01T13:44:49Z")

</div>

Hello, I need to import a musicXML file into p5js por parsing I found this post https://forum.processing.org/two/discussion/22417/a-couple-of-processing-powered-music-vids Do you have any hints for doing this?

---

## [P5 fft data without .play()? Is it is possible?](https://discourse.processing.org/t/p5-fft-data-without-play-is-it-is-possible/30932)

<div class="topic-metadata">

**Author:** [@atagger](https://discourse.processing.org/u/atagger)\
**Replies:** 5\
**Last updated:** [June 27, 2021, 7:15pm UTC](https://discourse.processing.org/t/p5-fft-data-without-play-is-it-is-possible/30932 "2021-06-27T19:15:20Z")

</div>

Is there a function or way to use the fft object without playing the sound? For example, using a loop to get the data out of the audio source before a sound is played? I know there are tools out there that can generate .…

---

## [Load and play sound in p5.js](https://discourse.processing.org/t/load-and-play-sound-in-p5-js/30926)

<div class="topic-metadata">

**Author:** [@cashew](https://discourse.processing.org/u/cashew)\
**Replies:** 4\
**Last updated:** [June 27, 2021, 4:40am UTC](https://discourse.processing.org/t/load-and-play-sound-in-p5-js/30926 "2021-06-27T04:40:30Z")

</div>

Hey there, I am new to processing and programming in general. What I want to do is load a sound file in Processing P5.js and play it. Where do I have to put my sound file in, like is there a folder on my Mac I need to…

---

## [ABCjs music notation library](https://discourse.processing.org/t/abcjs-music-notation-library/30635)

<div class="topic-metadata">

**Author:** [@patricio1979](https://discourse.processing.org/u/patricio1979)\
**Replies:** 4\
**Last updated:** [June 11, 2021, 8:39am UTC](https://discourse.processing.org/t/abcjs-music-notation-library/30635 "2021-06-11T08:39:32Z")

</div>

Hello, how can I port this https://www.abcjs.net/ libraryto p5js? It is useful for importing ABC music files (there’s a corpus for musicology research). In the index.html \<script src="abcjs-basic-min.js" type="text/ja…

---

## [The command image() do not works](https://discourse.processing.org/t/the-command-image-do-not-works/30608)

<div class="topic-metadata">

**Author:** [@Kevincroos](https://discourse.processing.org/u/Kevincroos)\
**Replies:** 4\
**Last updated:** [June 10, 2021, 10:43pm UTC](https://discourse.processing.org/t/the-command-image-do-not-works/30608 "2021-06-10T22:43:19Z")

</div>

homework policy asking questions hello developers I had a problem with the image() command One answer is very important to me : \_ ( My image does not load on the screen, I check the console but I have no errors, my ima…

---

## [How to use the innerhtml in js and the issue with secens maneger](https://discourse.processing.org/t/how-to-use-the-innerhtml-in-js-and-the-issue-with-secens-maneger/30572)

<div class="topic-metadata">

**Author:** [@momo](https://discourse.processing.org/u/momo)\
**Replies:** 0\
**Last updated:** [June 8, 2021, 3:45pm UTC](https://discourse.processing.org/t/how-to-use-the-innerhtml-in-js-and-the-issue-with-secens-maneger/30572 "2021-06-08T15:45:18Z")

</div>

Hi, I’m using scene manage.js to manage my different p5 sketches, so I have one HTML. I have a typewriter effect on the first page, when it goes to the next scene, I hope the text will disappear with the first scene. Ho…

---

## [P5 Layout Questions](https://discourse.processing.org/t/p5-layout-questions/30453)

<div class="topic-metadata">

**Author:** [@karenmani](https://discourse.processing.org/u/karenmani)\
**Replies:** 5\
**Last updated:** [June 3, 2021, 7:30pm UTC](https://discourse.processing.org/t/p5-layout-questions/30453 "2021-06-03T19:30:36Z")

</div>

Hi, I’m working with a p5 video player and I’m not too familiar with CSS. I have a layout that’s consistent on Chrome and Firefox, but for some reason, it gets messed up in Safari and does not line up the way my button …

---

## [P5js sound, microphone stop doesn't stop the microphone input](https://discourse.processing.org/t/p5js-sound-microphone-stop-doesnt-stop-the-microphone-input/30283)

<div class="topic-metadata">

**Author:** [@cprieto](https://discourse.processing.org/u/cprieto)\
**Replies:** 1\
**Last updated:** [May 25, 2021, 9:42pm UTC](https://discourse.processing.org/t/p5js-sound-microphone-stop-doesnt-stop-the-microphone-input/30283 "2021-05-25T21:42:58Z")

</div>

I will expect the method stop will stop the microphone from capturing input in p5js, as the documentation states: Turn the AudioIn off. If the AudioIn is stopped, it cannot getLevel(). But that is not happening, even…

---

## [Error when trying to save output audio in P5js sound](https://discourse.processing.org/t/error-when-trying-to-save-output-audio-in-p5js-sound/30280)

<div class="topic-metadata">

**Author:** [@cprieto](https://discourse.processing.org/u/cprieto)\
**Replies:** 1\
**Last updated:** [May 25, 2021, 9:21pm UTC](https://discourse.processing.org/t/error-when-trying-to-save-output-audio-in-p5js-sound/30280 "2021-05-25T21:21:06Z")

</div>

The documentation for p5.SoundRecorder is pretty clear when it says what is going to record: Record sounds for playback and/or to save as a .wav file. The p5.SoundRecorder records all sound output from your sketch, or …

---

## [P5 panning with sliders and play video with button](https://discourse.processing.org/t/p5-panning-with-sliders-and-play-video-with-button/30255)

<div class="topic-metadata">

**Author:** [@karenmani](https://discourse.processing.org/u/karenmani)\
**Replies:** 6\
**Last updated:** [May 25, 2021, 1:38pm UTC](https://discourse.processing.org/t/p5-panning-with-sliders-and-play-video-with-button/30255 "2021-05-25T13:38:52Z")

</div>

Hi! I’m trying to create a website with p5 that plays a video back and then also uses a slider to pan a song that is simultaneously playing. I followed example code from the p5 website, however for some reason, my button…

---

## [Merge and trim audio files in p5Sound?](https://discourse.processing.org/t/merge-and-trim-audio-files-in-p5sound/30156)

<div class="topic-metadata">

**Author:** [@Gershy13](https://discourse.processing.org/u/Gershy13)\
**Replies:** 13\
**Last updated:** [May 21, 2021, 12:14am UTC](https://discourse.processing.org/t/merge-and-trim-audio-files-in-p5sound/30156 "2021-05-21T00:14:03Z")

</div>

Im building an audio visualization project with p5js, and was wondering if it was possible to merge multiple audio files together (and automatically trim them to the same length, maybe 10 seconds (just use the first 10 s…

---

## [P5.sound on google chrome - p5.sound.js:3191 Uncaught (in promise) TypeError: Cannot read property 'addModule' of undefined](https://discourse.processing.org/t/p5-sound-on-google-chrome-p5-sound-js-3191-uncaught-in-promise-typeerror-cannot-read-property-addmodule-of-undefined/29939)

<div class="topic-metadata">

**Author:** [@Discordanian](https://discourse.processing.org/u/Discordanian)\
**Replies:** 4\
**Last updated:** [May 16, 2021, 12:39am UTC](https://discourse.processing.org/t/p5-sound-on-google-chrome-p5-sound-js-3191-uncaught-in-promise-typeerror-cannot-read-property-addmodule-of-undefined/29939 "2021-05-16T00:39:01Z")

</div>

What I’m seeing is that I’m getting an error using p5.sound w/Chrome (seems to work fine in FireFox, haven’t tried it elsewhere). I’ve stubbed out a very small/simple example almost cribbed verbatim from the reference e…

---

## [Why Doesn't This Sketch Run in Desktop Editor?](https://discourse.processing.org/t/why-doesnt-this-sketch-run-in-desktop-editor/30098)

<div class="topic-metadata">

**Author:** [@cottonchipper](https://discourse.processing.org/u/cottonchipper)\
**Replies:** 2\
**Last updated:** [May 14, 2021, 5:59pm UTC](https://discourse.processing.org/t/why-doesnt-this-sketch-run-in-desktop-editor/30098 "2021-05-14T17:59:58Z")

</div>

I found a discussion thread with an example in the P5js web editor that runs in the web editor but not when I tried copying to the desktop editor. I’m relatively new to P5js and clueless as to why it won’t run on the des…

---

## [Get error message withP5.dom.min.js and min.js](https://discourse.processing.org/t/get-error-message-withp5-dom-min-js-and-min-js/30075)

<div class="topic-metadata">

**Author:** [@momo](https://discourse.processing.org/u/momo)\
**Replies:** 6\
**Last updated:** [May 14, 2021, 3:15am UTC](https://discourse.processing.org/t/get-error-message-withp5-dom-min-js-and-min-js/30075 "2021-05-14T03:15:14Z")

</div>

Hi, I’m using various js like P5.sound.js and dom js in my Html, try to work on show the sound wave on the page, and got errors: 1.amplitude is not defined 2.d.\_validateParameters is not a function #5242 please help me! …

---

## [React p5: So how do you pass a value generated in p5 back to a React component?](https://discourse.processing.org/t/react-p5-so-how-do-you-pass-a-value-generated-in-p5-back-to-a-react-component/24978)

<div class="topic-metadata">

**Author:** [@venn](https://discourse.processing.org/u/venn)\
**Replies:** 6\
**Last updated:** [May 13, 2021, 1:45pm UTC](https://discourse.processing.org/t/react-p5-so-how-do-you-pass-a-value-generated-in-p5-back-to-a-react-component/24978 "2021-05-13T13:45:02Z")

</div>

Hi there, so I’m using https://github.com/and-who/react-p5-wrapper I’m wondering if there’s a way to pass a value from the p5 Sketch file back into React? For example. I want to keep track of the label value generated…

---

## [Sketch to video efficiently with ffmpeg](https://discourse.processing.org/t/sketch-to-video-efficiently-with-ffmpeg/25522)

<div class="topic-metadata">

**Author:** [@JuanIrache](https://discourse.processing.org/u/JuanIrache)\
**Replies:** 8\
**Last updated:** [May 11, 2021, 12:23am UTC](https://discourse.processing.org/t/sketch-to-video-efficiently-with-ffmpeg/25522 "2021-05-11T00:23:40Z")

</div>

Hi all, I’ve got a project where I am drawing a sketch and saving the frames as a video using ffmpeg. My project is an ElectronJS desktop app, so I have access to both the browser and the operating system. The problem I…

---

## [How do i ensure preload() has finished?](https://discourse.processing.org/t/how-do-i-ensure-preload-has-finished/30006)

<div class="topic-metadata">

**Author:** [@whatsinausername](https://discourse.processing.org/u/whatsinausername)\
**Replies:** 7\
**Last updated:** [May 10, 2021, 3:23pm UTC](https://discourse.processing.org/t/how-do-i-ensure-preload-has-finished/30006 "2021-05-10T15:23:45Z")

</div>

i’m attempting to use p5.js for some audio processing and phaser.js for some game code. function phaser\_preload() { boop = loadSound('boop.wav'); } function phaser\_create() { fft = new p5.FFT(); boop.play();…

---

## [Generate editable drawing of audio waveform from audio file in p5js?](https://discourse.processing.org/t/generate-editable-drawing-of-audio-waveform-from-audio-file-in-p5js/29926)

<div class="topic-metadata">

**Author:** [@Gershy13](https://discourse.processing.org/u/Gershy13)\
**Replies:** 7\
**Last updated:** [May 9, 2021, 12:22pm UTC](https://discourse.processing.org/t/generate-editable-drawing-of-audio-waveform-from-audio-file-in-p5js/29926 "2021-05-09T12:22:12Z")

</div>

Can anyone help me? Im trying to draw a audio waveform of an mp3 file in p5js. Essentially like what you would see on the track in a DAW like LogicPro/Audacity/Adobe Audition. I want the full track to be generated as a d…

---

## [(javascript) - ignore this post](https://discourse.processing.org/t/javascript-ignore-this-post/29861)

<div class="topic-metadata">

**Author:** [@UnderratedGuitarGUY](https://discourse.processing.org/u/UnderratedGuitarGUY)\
**Replies:** 7\
**Last updated:** [May 5, 2021, 12:27am UTC](https://discourse.processing.org/t/javascript-ignore-this-post/29861 "2021-05-05T00:27:11Z")

</div>

please format code with \</\> button \* homework policy \* asking questions IGNORE THIS POST

---

## [Don't know what is missing for to code to work (flappy bird)](https://discourse.processing.org/t/dont-know-what-is-missing-for-to-code-to-work-flappy-bird/29711)

<div class="topic-metadata">

**Author:** [@JustinChan613](https://discourse.processing.org/u/JustinChan613)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 11:03pm UTC](https://discourse.processing.org/t/dont-know-what-is-missing-for-to-code-to-work-flappy-bird/29711 "2021-04-28T23:03:17Z")

</div>

Hi it’s me again. Right now I am dealing with another game - flappy bird. I am making the function of counting is player losing. I use if-else statement to determine whether the player’s losing. The coding flow seems to …

---

## [Need help with p5GUI in instance mode](https://discourse.processing.org/t/need-help-with-p5gui-in-instance-mode/29599)

<div class="topic-metadata">

**Author:** [@edufissure](https://discourse.processing.org/u/edufissure)\
**Replies:** 9\
**Last updated:** [April 27, 2021, 7:45pm UTC](https://discourse.processing.org/t/need-help-with-p5gui-in-instance-mode/29599 "2021-04-27T19:45:47Z")

</div>

please format code with \</\> button \* homework policy \* asking questions I need to put in instance mode this code: ( sample of different p5gui examples) but i got an error of creategui… Here is my code: In basi…

---

## [P5 convolution does not decrease the sound amplitude](https://discourse.processing.org/t/p5-convolution-does-not-decrease-the-sound-amplitude/29452)

<div class="topic-metadata">

**Author:** [@fwullens](https://discourse.processing.org/u/fwullens)\
**Replies:** 7\
**Last updated:** [April 27, 2021, 10:07am UTC](https://discourse.processing.org/t/p5-convolution-does-not-decrease-the-sound-amplitude/29452 "2021-04-27T10:07:15Z")

</div>

Hi, I tried the nice example in the p5js.org examples page (examples | p5.js), though with my own sounds and reverb files. My goal is to make a convolution of an original signal with the impulse response of a filter whi…

---

## [Two amplitude objects listening to two separate loaded sounds](https://discourse.processing.org/t/two-amplitude-objects-listening-to-two-separate-loaded-sounds/29361)

<div class="topic-metadata">

**Author:** [@fbrie002](https://discourse.processing.org/u/fbrie002)\
**Replies:** 3\
**Last updated:** [April 14, 2021, 5:03pm UTC](https://discourse.processing.org/t/two-amplitude-objects-listening-to-two-separate-loaded-sounds/29361 "2021-04-14T17:03:27Z")

</div>

Hi! I’m trying to figure out a way to have two separate sound files loaded and playing at the same time connect to two separate amplitude objects. At the moment all the sounds just go straight to the first amplitude obj…

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

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