Closed Centauria closed 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()
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!
I have code below:
it gives me warning below:
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?