Tonejs / Tone.js

A Web Audio framework for making interactive music in the browser.
https://tonejs.github.io
MIT License
13.52k stars 983 forks source link

Feature Request: Allow panning and 3D audio nodes to be connected to Tone Objects #867

Closed frastlin closed 3 years ago

frastlin commented 3 years ago

The feature you'd like I would like to have my synths or samples positioned in 3D audio, or panned from left to right. It would also be very useful if there was a way to have a sound moved from one position to another over a period of time.

Any alternatives you've considered WadJS allows this functionality for its oscillators, but it doesn't have sampling.

Additional context I would like this for adding sound sources around a game landscape.

tambien commented 3 years ago

Tone.js has Tone.Panner and Tone.Panner3D which i think should accomplish what you're looking for. Both support parameter automations so you could schedule the pan to move over some period of time, or even connect an oscillator to control the panning.

Here's an example using the 3D panner: https://tonejs.github.io/examples/spatialPanner