Skip to content
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

make SidechainCompressor class for sidechain compression #7

Closed
DBraun opened this issue Aug 15, 2020 · 1 comment
Closed

make SidechainCompressor class for sidechain compression #7

DBraun opened this issue Aug 15, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@DBraun
Copy link
Owner

DBraun commented Aug 15, 2020

https://en.wikipedia.org/wiki/Dynamic_range_compression#Side-chaining

https://github.com/DanielRudrich/SimpleCompressor

Check out DawDreamer’s AddProcessor.h class for how it sums multiple buffers together. The input buffer will have four channels. We need to calculate a sidechain amount from channels 2 and 3 to apply to channels 0 and 1.

sidechain = engine.make_sidechain_compressor_processor("my_bus")
sidechain.threshold = -6. # threshold in dB
sidechain.ratio = 2. # ratio
sidechain.attack = 2. # attack in milliseconds
sidechain.release = 50. # release in milliseconds

vocals = engine.make_playback_processor("vocals", vocals_data)
drums = engine.make_playback_processor("drums", drums_data)

graph = [
    (vocals, []),
    (drums, []),
    (sidechain, ["vocals", "drums"])
]

# the first input "vocals" would be the primary signal. Its volume would be attenuated
# more when "drums" is louder.

engine.load_graph(graph)
engine.render(10)

Update 2020-12-08: I've confirmed that certain VST effects plugins can do sidechain compression if you pass two inputs. The second input will determine how much to compress. You should also make sure the VST parameters are configured to enable the secondary bus.

Update 2021-05-09: The new FaustProcessor would be great for this.

@DBraun DBraun added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 15, 2020
@DBraun DBraun self-assigned this Aug 15, 2020
@DBraun
Copy link
Owner Author

DBraun commented Jul 9, 2021

Closing because I think Faust does this reasonably well

"""Have the volume of the drums attenuate the volume of the bass."""

@DBraun DBraun closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant