scratchfoundation / scratch-audio

Web Audio-based audio engine for Scratch 3.0
BSD 3-Clause "New" or "Revised" License
60 stars 87 forks source link

How to handle processor intensive audio effects? #22

Open ericrosenbaum opened 7 years ago

ericrosenbaum commented 7 years ago

Ideally, all the audio effects would be applied at the level of each sprite or clone. In audio terms, each sprite or clone would have its own audio effects chain that includes all of the active audio effects, with its own settings for its own sounds.

Unfortunately, some of the audio effects are processor intensive: echo, reverb, fuzz, and robot. Instantiating them all for each of a potentially large number of sprites or clones would quickly cause audio dropouts or other glitches.

Right now, as a workaround, the AudioEngine creates a single instance of each of these four effects, through which all sounds are played. Any sprite or clone can set, change, or clear them, but the results affect all sounds.

(The pitch effect and pan effect are less processor intensive and so are instantiated by the AudioPlayer for each sprite or clone).

Some questions:

SharkPool-SP commented 1 month ago

why not just edit the sourcenode values instead of reinstating them