processing / p5.js

p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing. http://twitter.com/p5xjs —
http://p5js.org/
GNU Lesser General Public License v2.1
21.7k stars 3.34k forks source link

Does p5.Panner3D work? #6939

Open tas509 opened 7 months ago

tas509 commented 7 months ago

Most appropriate sub-area of p5.js?

p5.js version

No response

Web browser and version

No response

Operating system

No response

Steps to reproduce this

P5.Panner has no documentation to speak of.

There are small typos "sorce" and .rollof()

There is no example working.

I've tried to make a polar butterfly pan according to the plot... and I can't hear any difference. It seems like the audio isn't being panned at all... I kind of got a dummy working using an osc and reducing the volume and frequency based on vector distance but that defeats the purpose I think.

Here is my crappy code. https://editor.p5js.org/tom.smith/sketches/N6SR16nYB

Any help gratefully received, I'd like this to be used to explain a polar butterflies shape to a blind person (we'll do a relief print, but it'd nice to have the temporal aspect).

Thanks for any pointers received,

Tom p.s If this is the wrong place, sorry, I followed the link in the P5 docs.

welcome[bot] commented 7 months ago

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

tas509 commented 7 months ago

p5.js version - whatever is on editor.p5js.org (probably not relevant)

Web browser and version - Chrome latest (probably not relevant)

Operating system -Ventura 13.5.1 (22G90) (probably not relevant)

Steps to reproduce this -- er, run the sketch listed

tas509 commented 7 months ago

I maybe have begun to understand it a bit more... this now seems to produce lefty/righty sound, but not fronty/backy

https://editor.p5js.org/tom.smith/sketches/N6SR16nYB

limzykenneth commented 7 months ago

@tas509 I don't use p5.Sound very much myself so can't really provide detailed help, the example you shared seem to be working as far as I understand though. p5.Sound is currently being revamp as well and something we draw a lot of inspiration from is Tone.js, you can check it out and see if it gives you better results at this stage.

tas509 commented 7 months ago

Thanks @limzykenneth , I was trying to avoid Tone.js :-) I struggle to use libraries sometimes when there is documentation that doesn't include working examples ... like...

thisFunction(number, number)

but doesn't explain what the numbers might realistically be... 0 to 1 or 0 to 255 or frequencies... etc.

Thanks for your help.

limzykenneth commented 7 months ago

@tas509 No worries, we will have an opportunity to look into this further. p5.Panner3D probably needs better documentation as you mentioned anyway.

Forchapeatl commented 2 months ago

Hi @tas509 , your app is very relaxing. It's just therapy I needed :) on line 122. panner.set(vec.x, vec.y, vec.y, 0.1); This means that any movement in the vertical direction is mirrored as a change in distance, making it harder to distinguish between up-down and front-back movement. I believe this will give you the expected effect panner.set(vec.x, vec.y, vec.z, 0.1);

Forchapeatl commented 2 months ago

Hi @limzykenneth , may I take the documentation of p5.panner3D . I have been investigating and experimenting with the p5.panner3D for a while.

limzykenneth commented 2 months ago

@Forchapeatl Thanks for your interest, as mentioned in my comment above, we currently have a new version of p5.Sound already in the works and it is currently in the final testing phase. The work in progress can be seen here. If you like @tmartinez88, can send you a version of the new library to test.