New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spatial panning WIP #198

Merged
merged 32 commits into from Aug 15, 2017

Conversation

Projects
None yet
3 participants
@jvntf
Copy link
Contributor

jvntf commented Jul 6, 2017

Added a new class called Spatializer as an interface for spatial panning and listening

This PR :

  • removes Panner3D() from panner.js
  • Spatializer can be constructed with a type argument (accepts 'listener' or defaults to 'panner')
  • Using the alternate constructors p5.Panner3D() or p5.Listener3D() (prototypal inheritance) yield equivalent results
@b2renger

This comment has been minimized.

Copy link
Member

b2renger commented Jul 6, 2017

@jvntf That's cool ! (aswell as your awesome work on effetcts)
Let me know when you think it's ready for testing, I wanted to work on 3D audio on this flocking algo : https://b2renger.github.io/Introduction_p5js/06_webgl_05/index.html

Can't wait to try all those new features you're adding

@jvntf

This comment has been minimized.

Copy link
Contributor Author

jvntf commented Jul 6, 2017

@b2renger test away! i've just included a very basic test in the examples folder (examples/spatial_panning)-- i'm not 100% sure that the positionZ movement is sounding as it should. looking forward to hearing it with the flocking alg!

@b2renger

This comment has been minimized.

Copy link
Member

b2renger commented Jul 7, 2017

@jvntf there's a small typo in your example : jvntf@87218c2

Hard to tell if the z-position movement is right with this example though. Maybe my experiments with flocking will help us hear better.

There is an issue with the creation of a listener though, I created a pull request on your fork in the spatialPanning branch, if you want to check out the broken example
it's here : jvntf#1

@jvntf jvntf force-pushed the jvntf:spatialPanning branch from 87218c2 to 71bfbec Jul 7, 2017

@jvntf

This comment has been minimized.

Copy link
Contributor Author

jvntf commented Jul 7, 2017

The Listener3D object can be constructed now-- changing the listener param only has an effect on objects connected to a Panner3D

@b2renger

This comment has been minimized.

Copy link
Member

b2renger commented Jul 8, 2017

@jvntf great thanks, I've updated the flock example in the pr. The position seems to work, but I can't seem to be able to call the orientation methods.

@b2renger

This comment has been minimized.

Copy link
Member

b2renger commented Jul 16, 2017

@jvntf the spatial listenning example is still broken it seems that now we have a problem with position again

I got this :
"
p5.sound.js:8223 Uncaught TypeError: Cannot read property 'positionX' of undefined
at p5.Listener3D.positionX (p5.sound.js:8223)
at p5.Listener3D.position (p5.sound.js:8207)
at draw (sketch.js:62)
at p5.redraw (p5.js:17205)
at p5. (p5.js:12931)
at _runIfPreloadsAreDone (p5.js:12848)
at p5._decrementPreload (p5.js:12855)
at p5.sound.js:889
at p5.sound.js:922
"
are those examples running for you ?

@jvntf jvntf force-pushed the jvntf:spatialPanning branch from 93329d3 to 1beb02c Jul 16, 2017

@jvntf

This comment has been minimized.

Copy link
Contributor Author

jvntf commented Jul 16, 2017

thanks @b2renger ! had forgotten to change a variable name when i separated panner3d and listener3d into different files.

@b2renger

This comment has been minimized.

Copy link
Member

b2renger commented Jul 16, 2017

@jvntf it looks nice ! I'm playing a bit but the results with the flocking algorithm are a bit disappointing. I'm trying to make each boid have it's own synthesized sound now.

One thing we might miss is the possibility to set those :

panner.maxDistance
panner.rolloffFactor

@jvntf jvntf changed the title Spatial panning Spatial panning WIP Jul 17, 2017

* @param {[Number]} yVal
* @param {[Number]} zVal
* @param {[Number]} time
* @return {[Array]} [Updated x, y, z values as an array]

This comment has been minimized.

@therewasaguy

therewasaguy Jul 20, 2017

Member

square brackets are for optional parameters, like this

@param {Number} [time]

@therewasaguy

This comment has been minimized.

Copy link
Member

therewasaguy commented Jul 20, 2017

looking good, I'm sorry I haven't dug in as deep as I would like to yet. Talking with @jvntf about long term plan for the listener, we should look into integrating Listener3d into the p5.soundOut (and do a better job of exposing that to users). There's only one listener, and only one soundOut, so they can live together.

A possible solution in the meantime is to merge this but leave out documentation for the listener, which we can move to soundOut in a separate branch

@b2renger

This comment has been minimized.

Copy link
Member

b2renger commented Jul 21, 2017

Yes I agree with you jason, the listener should be in the p5.soundOut it totally makes sense.

@jvntf jvntf force-pushed the jvntf:spatialPanning branch from 469e9ed to 76c5638 Jul 24, 2017

@jvntf

This comment has been minimized.

Copy link
Contributor Author

jvntf commented Jul 24, 2017

i agree that listener should go to soundOut! for now, this PR commented out the doc of listener3d, and includes a simple 3d panning example, moving a sound through space.

@therewasaguy therewasaguy force-pushed the processing:master branch from cd47e8f to ba48038 Jul 28, 2017

add p5.EQ (#183)
* started writing compressor.js

* rough structure of compressor

* draft of compressor

* updated gruntfile, added restrictions and error logging to compressor

* removed range error checking

* compressor test

* started draft of EQ

* assigned bands to EQ

* added band mod functions to eq

* added to gruntfile

* eq adjusting band levels based on filter.output.amp()

* eq works based on p5.Filter.biquad.gain.value

* added control points to eq example

* spline curve in example, next: toggle band

* using p5.Filter for bands makes EQ innacurate; handled by deleting output nodes of each filter

* much better results using a raw biquad filter

* added comments to eq.js

* improved example

* toggle works

* added example to eq.js

* fixed the example

* reverted to pre-merge state

* eq changed to have 2 sizes, 3 and 8 band

* finished EQ with options of 3 or 8 bands

* started secondary eq example

* dj mixer working but EQ is connected wrong

* dj mixer example complete with EQs

* ToneJs is not getting imported correctly here

* added tests for eq

* finished both examples and cleaned up

* added doc

* refactored EQ to use a lightweight p5.Filter

* added .gain() to p5.Filter, allows control of Biquad gain attribute

* cleaned up

* added return p5.EQ

* fixed preoload() problem in eq_dj_mixer example

* added a toggle function to p5.Filter()

* reset this._untoggledType when calling .setType()

* corrected some variable name inconsistencies

* updated eq tests to use correct API, corrected some errors

* added .addBand() and filter disconnection on dispose

* changed .freq to .freq()

* draw FFT logarithmically

* added freq and gain labels to eq cntrl points

* adjusted labels

* added to index.html

* added EQ.set() and fixed test

* eslint --fix src/eq.js

* update eq.js

- create eqFilter class with a proper dispose method and overrides of invalid methods
- comment out the set method
- update comments

* added more override methods tp EQFilter.js

* added a few methods to eqFilter

* added inline example to EQ
@therewasaguy

This comment has been minimized.

Copy link
Member

therewasaguy commented Aug 9, 2017

let's fix the merge conflicts, merge this, and then I'm up for doing listener as part of p5.soundOut in a separate PR (and I'll ask for your review)

@jvntf jvntf merged commit aec4fcd into processing:master Aug 15, 2017

@jvntf jvntf referenced this pull request Aug 15, 2017

Merged

Revert "Spatial panning WIP" #213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment