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
929 stars 66 forks source link

Warning: Signals will be skipped. #116

Closed Centauria closed 2 years ago

Centauria commented 2 years ago

I have code below:

inst1 = engine.make_plugin_processor(n1, 'xxx')
...
inst5 = engine.make_plugin_processor(n5, 'xxx')

mix = engine.make_add_processor('mix', [1, 1, 1, 1, 1])
engine.load_graph([
  (inst1, []),
  (inst2, []),
  (inst3, []),
  (inst4, []),
  (inst5, []),
  (mix, [inst1, ... inst5])
]
engine.render(time)
w = engine.get_audio()

it gives me warning below:

Warning: Signals will be skipped. Processor named mix expects 10 input signals, but you are trying to connect 32 signals.
Warning: Unable to connect Gunshot channel 10 to mix channel 10
Warning: Unable to connect Gunshot channel 11 to mix channel 11
Warning: Unable to connect Gunshot channel 12 to mix channel 12
Warning: Unable to connect Gunshot channel 13 to mix channel 13
Warning: Unable to connect Gunshot channel 14 to mix channel 14
Warning: Unable to connect Gunshot channel 15 to mix channel 15
Warning: Unable to connect Gunshot channel 16 to mix channel 16
Warning: Unable to connect Gunshot channel 17 to mix channel 17
Warning: Unable to connect Gunshot channel 18 to mix channel 18
Warning: Unable to connect Gunshot channel 19 to mix channel 19
Warning: Unable to connect Gunshot channel 20 to mix channel 20
Warning: Unable to connect Gunshot channel 21 to mix channel 21
Warning: Unable to connect Gunshot channel 22 to mix channel 22
Warning: Unable to connect Gunshot channel 23 to mix channel 23
Warning: Unable to connect Overdriven Guitar channel 0 to mix channel 24
Warning: Unable to connect Overdriven Guitar channel 1 to mix channel 25
Warning: Unable to connect Acoustic Bass channel 0 to mix channel 26
Warning: Unable to connect Acoustic Bass channel 1 to mix channel 27
Warning: Unable to connect Piccolo channel 0 to mix channel 28
Warning: Unable to connect Piccolo channel 1 to mix channel 29
Warning: Unable to connect Electric Guitar (muted) channel 0 to mix channel 30
Warning: Unable to connect Electric Guitar (muted) channel 1 to mix channel 31

what confuses me is that I have not connected any Gunshot plugin in the code. And the result audio contains only first track I've added.

I searched for the doc but only got the signature of the make_add_processor. So did I miss anything?

DBraun commented 2 years ago

The add processor is meant for stereo inputs, but I think your first input isn't stereo. I think if you did inst1.get_num_output_channels() you would get 24. The remaining 4 instruments are probably 2 each, so that makes a total of 32.

You could try

# 0 inputs and 2 outputs
if inst1.can_set_bus(0, 2):
    inst1.set_bus(0, 2)
    print('changed bus!')

Then build the graph and your code might work.

Otherwise, you can use a Faust processor to prune the channels of any processor. See this example: https://faustide.grame.fr/?autorun=1&voices=0&name=untitled2&inline=aW1wb3J0KCJzdGRmYXVzdC5saWIiKTsNCg0KcHJvY2VzcyA9IHNpLmJ1cygyNCkgPDogYmEuc2VsZWN0b3IoMCwgMjQpLCBiYS5zZWxlY3RvcigxLCAyNCk7

inst1 = engine.make_plugin_processor(n1, 'xxx')
...
inst5 = engine.make_plugin_processor(n5, 'xxx')

inst1_stereo = engine.make_faust_processor("faust")
C = inst1.get_num_output_channels()
# take the first 2 channels of C channels
inst1_stereo.set_dsp_string(f"process = si.bus({C}) <: ba.selector(0, {C}), ba.selector(1, {C});")

mix = engine.make_add_processor('mix', [1, 1, 1, 1, 1])
engine.load_graph([
  (inst1, []),
  (inst1_stereo , [inst1.get_name()]),
  (inst2, []),
  (inst3, []),
  (inst4, []),
  (inst5, []),
  (mix, [inst1_stereo.get_name(), inst2.get_name(), ... inst5.get_name()])
]
engine.render(time)
w = engine.get_audio()
Centauria commented 2 years ago

That's exactly the case.

The plugin has 24 output channels and won't support change to 2. Then the faust converter worked. Thank you!