multi input for sidechain/ducking



  • Is it possible to compile an fx plugin with 2 stereo/ 4 mono audio inputs?



  • @giftlift I don't think we have access to the additional busses yet



  • @dustbro ohh, I didnt know if there was a compilation flag or something. Thanks(:



  • I managed to compile a vst with 4 inputs, but the second stereo input doesn't pass audio through the compiled plugin.

    I changed 2 lines in "hi_dsp\plugin_parameter\PluginParameterProcessor.h"
    (You can edit this file without having to recompile hise)

    adding this to the end of line 81
    .withInput("Sidechain", AudioChannelSet::stereo());

    and changing line 110 from this
    return (layouts.getMainInputChannels() == 2 && layouts.getMainOutputChannels() == 2);

    to this
    return (layouts.getMainInputChannels() == 4 && layouts.getMainOutputChannels() == 2);

    Now I just need to get the extra inputs to map to inputs 3 and 4 of the master chain. Like the first two are mapped to channels 1 and 2.

    I'm only trying this with fx plugin generation.

    Any ideas or a pointer or anything would be much appreciated... ~help



  • Can you direct input 3 to output into input 1, and input 4 to output into input 2?



  • I am happy to report that I got it working!! 4 inputs into a compiled vst and did processing and interaction on/between both channels!! Testing some things and I'll have more to post 🙂



  • @giftlift That's fantastic! What additional steps did you take after changing the code as detailed in your previous comment?



  • @giftlift well done! Post a snip so we can check it out



  • Sorry its taken so long to get back, my girly is 38 weeks pregnant, so yay!
    I changed a lot of stuff, and I've been going through and seeing what is necessary and what isn't, but that's taking a long time. So here is what I have so far.
    I'll update this as/if I figure more things out: Naming channels, dif input/output configs n stuff like that.

    I'm using scriptnode standalone
    only compiling fx plugins as vst3s

    Again not sure if every edit is necessary but this is working right now

    In "hi_core\hi\core\MainController.cpp"
    change line 745 to this

    const bool isUsingMultiChannel = multiChannelBuffer.getNumChannels() > 4;
    

    And add these two lines after line 754

    FloatVectorOperations::copy(thisMultiChannelBuffer.getWritePointer(2), buffer.getReadPointer(2), numSamplesThisBlock);
    FloatVectorOperations::copy(thisMultiChannelBuffer.getWritePointer(3), buffer.getReadPointer(3), numSamplesThisBlock);
    

    Then add these two lines after line 764

    FloatVectorOperations::add(buffer.getWritePointer(2), thisMultiChannelBuffer.getReadPointer(2), numSamplesThisBlock);
    FloatVectorOperations::add(buffer.getWritePointer(3), thisMultiChannelBuffer.getReadPointer(3), numSamplesThisBlock);
    

    And these two after 788

    FloatVectorOperations::copy(multiChannelBuffer.getWritePointer(2, 0), previewBuffer.getReadPointer(2, previewBufferIndex), numToPlay);
    FloatVectorOperations::copy(multiChannelBuffer.getWritePointer(3, 0), previewBuffer.getReadPointer(3, previewBufferIndex), numToPlay);
    

    Then these two after 831

    FloatVectorOperations::add(buffer.getWritePointer(2), thisMultiChannelBuffer.getReadPointer(2), numSamplesThisBlock);
    FloatVectorOperations::add(buffer.getWritePointer(3), thisMultiChannelBuffer.getReadPointer(3), numSamplesThisBlock);
    

    Then change line 985 to this

    getMainSynthChain()->getMatrix().setNumDestinationChannels(4);
    

    Now save that file and open "hi_core\LibConfig.h"
    change line 45 to this

    #define HISE_NUM_PLUGIN_CHANNELS 4
    

    Save that file and open "hi_dsp\routing.cpp"
    change line 37 to this

    numSourceChannels(4),
    

    Save that and re/compile hise

    This last file you can change without having to recompile hise
    Ignore the edits to this file in my previous post, just
    open "hi_dsp\plugin_parameter\PluginParameterProcessor.h"
    and change line 110 to

    return true;
    

    Save that and your ready to go.

    For routing the master chain is connected like this
    routing.jpg
    And I've only tested this so far in scriptnode and SNEX,
    make sure your node channels are set to 4.

    Update us if any of y'all figure out anything new
    ~thanks~



  • @giftlift Amazing mate. I'm gonna try this asap!! Excellent work 🙂


Log in to reply
 

4
Online

552
Users

2.1k
Topics

16.4k
Posts