godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.07k stars 69 forks source link

Implement the ability to send audio sources to multiple buses #1836

Open ShawkMusic opened 3 years ago

ShawkMusic commented 3 years ago

Describe the project you are working on: I'm trying to process one audio stream through 2 different effect chains (AKA busses)

Describe the problem or limitation you are having in your project: I can only send an audio source to one bus at a time

Describe the feature / enhancement and how it helps to overcome the problem or limitation: When I click on the "bus" property in an AudioStreamPlayer or the "send" under a Bus, instead of bringing a dropdown menu that only allows me to select one bus at a time, it should give each bus option a checkbox, so that I can send the audio to multiple busses at once.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

Before and after, on an AudioStreamPlayer's Bus property: Screenshot (123) edited

Before and after, on a bus's send: Screenshot (124) edited

If this enhancement will not be used often, can it be worked around with a few lines of script?: No

Is there a reason why this should be core and not an add-on in the asset library?: It would most likely need to change how the Bus and Send properties work, which I don't think is possible to do with addons.

golddotasksquestions commented 3 years ago

The way I have it set up is to have a master bus, a music bus and a gameFX bus and uiFX bus. If turbulence, noise and fire are all game FX, I would have them feed into the gameFX bus which then feeds into the master bus.

While the UI for managing all those buses is certainly not the best, I personally don't understand the need to send sources to multiple buses. Can you elaborate more on why you would need that? Maybe a practical example?

benjarmstrong commented 3 years ago

Digital audio workstations generally allow music producers to achieve the same result via audio mixer channels having multiple "send" options. I mocked up the following in the Fl Studio mixer based on "how it should be" in your second image:

mixer_example

Note the green lines at the bottom that show the 'SfxTurbulence' channel is being sent to both 'Turbulence' and 'Noise' channels for further processing.

Pros:

Cons:

@golddotasksquestions

I personally don't understand the need to send sources to multiple buses. Can you elaborate more on why you would need that? Maybe a practical example?

One benefit could be reduced CPU time spent on audio processing. For example let's say you have the two mixer channels: 'Distant World' and 'Near World'. You want 'Distant World' to have reverb + echo, but 'Near World' should only have reverb, so you route 'Near World' to a 'World Reverb' channel, and route 'Distant World' to 'World Echo' and 'World Reverb' channel. This means the same reverb CPU time is used for both.

Additionally:

Having said all that, I'll admit you would need to have a very effect-heavy mixer for CPU usage to become a problem and audio latency doesn't seem to be a huge priority for most game developers.

robbertzzz commented 3 years ago

@Calinou the name for this proposal is wrong, this has nothing to do with side chaining. Side chaining means you use the audio from a different track to drive an effect. In EDM this is how the pumping synths are created, the bass drum drives the compressor on the synth, causing the compressor to close (and thereby limiting the output of the synth) everytime the bass drum hits. This has nothing to do with sending audio to multiple buses. This is also not a duplicate of #2180, where the creator does want to have side chaining added. That proposal should be reopened.

Calinou commented 3 years ago

@Calinou the name for this proposal is wrong, this has nothing to do with side chaining.

What should this proposal be renamed to?

robbertzzz commented 3 years ago

@Calinou the name for this proposal is wrong, this has nothing to do with side chaining.

What should this proposal be renamed to?

Just removing the (side-chaining) part should do it. To be fair, #2180 was pretty badly worded. I'll comment there too in a minute.

golddotasksquestions commented 3 years ago

@benjarmstrong Thank you a lot for the explanation! Audio latency is a big issue for rhythm games. See this talk by a Godot dev.

RichardEllicott commented 2 years ago

i would also say this would be very useful

for example, i find i cannot lowpass my reverbs wet effect without also lowpassing the tail ... this results in a metallic tin noise that is caused by what would be ring modulation from the high frequencies being repeated in the reverb (this tinny noise actually isn't so illogical indoors)

what i really would want to do is try lowpassing the wet output, this is what i'd do in a DAW..... here if i had multiple channels i could set up one for dry and another for wet, allow the reverb with only wet to lowpass the tail

i'm currently still trying to figure out how to make a good outside sounding reverb, i'm not sure it's possible so i will likely batch process my audio externally, it would have been nice to save the memory

faserg1 commented 6 months ago

I would really enjoy this feature. It will help me to easy configure music output to OBS (through plugin) from Godot Audio Bus. image and not by OBS itself, for example. image