How do you link the output of one plugin to the input of another plugin? #96
-
I'm trying to run an mp3 file through two different .dll plugins then render/write the output audio. However, the audio doesn't sound like I expect it to; since when I do the same process in FL Studio 20 (another DAW), I get a different result. Specifically, I'm trying to bass boost the audio then put a soft clipper on it, which should result in an extremely distorted audio file. However, when I do the process through dawdreamer, the file isn't nearly as distorted as it should be. Here's my code, does anything look off?: import dawdreamer as daw
from os import chdir, walk
import numpy as np
import librosa
from scipy.io import wavfile
SAMPLE_RATE = 44100
BUFFER_SIZE = 512
DURATION = 20
SOFT_CLIPPER_PLUGIN = r'C:/Users/samlb/Documents/CAR_MIX/Initial Clipper.dll'
SOFT_CLIPPER_PRESETS = r'C:/Users/samlb/Documents/CAR_MIX/PRESETS/SOFT_CLIPPER'
BASS_BOOST_PLUGIN = r'C:/Users/samlb/Documents/CAR_MIX/BarkOfDog2.dll'
BASS_BOOST_PRESETS = r'C:/Users/samlb/Documents/CAR_MIX/PRESETS/BASS_BOOST'
SONG_FOLDER = r'C:/Users/samlb/Documents/megaMe'
SONG_FILE = r'C:/Users/samlb/Documents/megaMe/ericdoa - cheap liquor (Official Audio).mp3'
def load_audio_file(file_path, duration=None):
chdir(SONG_FOLDER)
sig, rate = librosa.load(file_path, duration=duration, mono=False, sr=SAMPLE_RATE)
assert(rate == SAMPLE_RATE)
return sig
engine = daw.RenderEngine(SAMPLE_RATE, BUFFER_SIZE)
chdir(BASS_BOOST_PRESETS)
bass_boost = engine.make_plugin_processor("my_bass_boost", BASS_BOOST_PLUGIN)
assert bass_boost.get_name() == "my_bass_boost"
bass_boost.load_state(BASS_BOOST_PRESETS+'/preset1')
chdir(SOFT_CLIPPER_PRESETS)
soft_clipper = engine.make_plugin_processor("my_soft_clipper", SOFT_CLIPPER_PLUGIN)
assert soft_clipper.get_name() == "my_soft_clipper"
soft_clipper.load_state(SOFT_CLIPPER_PRESETS+'/preset1')
song = load_audio_file(SONG_FILE)
playback_processor = engine.make_playback_processor("playback", song)
graph = [
(playback_processor, []),
(bass_boost, ["playback"])
(soft_clipper, ["playback"])
]
engine.load_graph(graph)
engine.render(107)
audio = engine.get_audio()
chdir(r'C:\Users\samlb\Documents\iveBeenMegaed')
wavfile.write('MEGA CHEAP LIQUOR.wav', SAMPLE_RATE, audio.transpose()) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Looks ok, but assuming you want to connect the output of the bass boost to the input of the soft clipper, the graph should be different. graph = [
(playback_processor, []),
(bass_boost, ["playback"])
(soft_clipper, ["my_bass_boost"])
]
# or
graph = [
(playback_processor, []),
(bass_boost, [playback_processor.get_name()])
(soft_clipper, [bass_boost.get_name()])
] Also, I see you copied |
Beta Was this translation helpful? Give feedback.
Looks ok, but assuming you want to connect the output of the bass boost to the input of the soft clipper, the graph should be different.
Also, I see you copied
assert soft_clipper.get_name() == "my_soft_clipper"
. This was in the README just to showget_name()
, but you don't have to bother checking it in production code.