DBraun / DawDreamer

Digital Audio Workstation with Python; VST instruments/effects, parameter automation, FAUST, JAX, Warp Markers, and JUCE processors
GNU General Public License v3.0
906 stars 66 forks source link

Only mono for vst3 #119

Open DaveScream opened 2 years ago

DaveScream commented 2 years ago
C:\Program Files\Vstplugins\Flux\LevelMagic.vst\Contents\x64\LevelMagic.dll
C:\Program Files\Vstplugins\Flux\SpatV3.vst\Contents\x64\SpatV3.dll
play = e.make_playback_processor("play", np.zeros((2, 1)))
print(play.get_num_output_channels())

show 2 channels

play.set_data(audio)
print(play.get_num_output_channels())

show 2 channels

vst_plugin = e.make_plugin_processor(vst_name, vst_path)
print(f"{vst_name} i:{vst_plugin.get_num_input_channels()} o:{vst_plugin.get_num_output_channels()}")

show 1 output 1 input channels

trying to set 2 input 2 output or 2,1 or 1,2

print(vst_plugin.can_set_bus(2,2)) # false
print(vst_plugin.can_set_bus(2,1)) # false
print(vst_plugin.can_set_bus(1,2)) # false
print(vst_plugin.can_set_bus(1,1)) # true

Incompatible VSTs?

DBraun commented 2 years ago

Seems like the rare case of a mono VST. You could try making sure audio is shaped (1, T) where T is the number of samples before passing it to play.set_data(audio). Let me know if that works.

You can also use Faust to mix N channels to mono.

faust = e.make_faust_processor("faust")
N = 2
faust.set_dsp_string(f"process = si.bus({N}) :> _;")
DaveScream commented 2 years ago

Seems like the rare case of a mono VST. You could try making sure audio is shaped (1, T) You can also use Faust to mix N channels to mono.

No no, I need stereo. On input I have stereo, playbackprocessor have stereo output, but when im load these VSTs they have only 1 channel, and I cant set_bus to (2,2) to get stereo.

I got some VST chain host "VSTForx" it allow to load multiple VST. And it shows that 2 problematic VSTs above have multiple inputs and multiple outputs, but even with VSTForx they dont work in stereo.

If I use them in other daws (Ableton, FL Studio) - they work okay in stereo. But in dawdreamer only mono(((

DBraun commented 2 years ago

This one is different than the last example.

Expand mono to N channels:

faust = e.make_faust_processor("faust")
N = 2
faust.set_dsp_string(f"process = _ <: si.bus({N});")

Then

graph = [
    (play, []),
    (vst_plugin, [play.get_name()]),
    (faust, [vst_plugin.get_name()])
]
e.load_graph(graph)

The output will then be VST_plugin's mono output duplicated into 2 channels. Is that what you'd want?

Or maybe the output of VST plugin is supposed to be multiplied by both channels of play? Then try


faust = e.make_faust_processor("faust")
N = 2
faust.set_dsp_string(f"process(x, y, z) = x*z, y*z;")

graph = [
    (play, []),
    (vst_plugin, [play.get_name()]),
    (faust, [play, vst_plugin.get_name()])
]
e.load_graph(graph)