p5.js-sound icon indicating copy to clipboard operation
p5.js-sound copied to clipboard

p5.PolySynth example returns error

Open mattshu opened this issue 2 years ago • 2 comments

Actual Behaviour

Browsing the p5.PolySynth docs and attempted to use the provided example object click to play

Expected Behaviour

A music chord should play

Steps to reproduce it

CLick the click to play box

Screenshots of the issue

This is what shows in the console upon loading:

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. <URL>
index.js:569 Uncaught TypeError: Cannot read properties of undefined (reading 'colorScheme')
    at index.js:569:25
    at index.js:570:7
    at index.js:6165:3
(anonymous) @ index.js:569
(anonymous) @ index.js:570
(anonymous) @ index.js:6165
frame.js:1 Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
    at frame.js:1:15
(anonymous) @ frame.js:1
DevTools failed to load source map: Could not load content for https://p5js.org/assets/js/p5.sound.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

This happens when pressing the object:

p5.sound.min.js?v=f067ef:2 Uncaught ReferenceError: oldestNote is not defined
    at n.value (p5.sound.min.js?v=f067ef:2:194994)
    at n.value (p5.sound.min.js?v=f067ef:2:194331)
    at d.default.Renderer2D.playSynth (eval at s (render.js?v=b98ef7:241:13), <anonymous>:26:13)
    at d.default.Renderer2D.<anonymous> (p5.min.js?v=3af01e:3:435211)

Would you like to work on the issue?

I would if I knew how :(

mattshu avatar Mar 09 '22 13:03 mattshu

hey @mattshu i would love to work on this issue

rinkydevi avatar Mar 09 '22 23:03 rinkydevi

I'm seeing the same issue, on Firefox and Edge, when there are too many notes played in a short interval.

For example (apologies for the messy code): https://editor.p5js.org/fs_/sketches/EssUnKJ2Q

If you increase the amount of notes played by uncommenting line 9 ( scale = [...scale, ...scale];) and press play, the exception oldestNote is not defined is thrown.

Oddly enough, running this same code inside electron does not cause this exception.

filipesabella avatar Mar 15 '22 15:03 filipesabella