SNEX nodes parameters



  • @Christoph-Hart

    SNEX node parameters

    • is it possible to change their order afterwards? I tried to modify their indexes, but compiling resets everything in the code editor: (changes only apply when modifying the SNEX code itself)
    snex_osc1.setParameterT(0, 1.);  // core::snex_osc::Speed
    snex_osc1.setParameterT(1, 0.);  // core::snex_osc::Mode
    snex_osc1.setParameterT(2, 20.); // core::snex_osc::Frequency
    snex_osc1.setParameterT(3, 1.);  // core::snex_osc::PitchMultiplier
    snex_osc1.setParameterT(4, 1.);  // core::snex_osc::Level
    
    // TRYING TO JUST GET THIS:
    
    snex_osc1.setParameterT(0, 1.);  // core::snex_osc::Speed
    snex_osc1.setParameterT(1, 0.);  // core::snex_osc::Mode
    snex_osc1.setParameterT(2, 1.);  // core::snex_osc::Level
    

    I don't understand how they've been mixed, and if you open it in Hise the order is not the same...
    EDIT: I just had to modify the order in the XML 🙄

    • Is it possible to remove Frequency and/or PitchMultiplier sliders if we don't need them? If yes, how? If removed from the XML, they are back in as soon as you reopen the project... I think they are inherently attached to the osc_node

    • Is there a way to pass a string value instead of the value itself to a parameter? Like the Mode slider in the filter showing LowPass and consorts instead of 1, 2, 3, 4... Yeah I know, it's just tweaking stuff 🙄



  • Is it possible to remove Frequency and/or PitchMultiplier sliders if we don't need them?

    No, they are hardcoded into the snex_osc node and they will determine the frequency of your oscillator so removing them would make the entire node pointless. Just use the generic snex_node if you don't want to create an oscillator.

    Is there a way to pass a string value instead of the value itself to a parameter?

    No, there are no Strings in SNEX. If you don't like magic numbers, use an enum:

    enum FilterType
    {
        LowPass,
        HighPass
    };
    
    void setFilterType(int type, float value)
    {
        if(type == FilterType::LowPass)
            doSomething();
        if(type == FilterType::HighPass)
            doSomethingElse();
    }
    


  • @Christoph-Hart thanks
    Yeah I already use enum for parameters, it was just about displaying the string aside the knob but it's not important…

    That's what I thought for the hardcoded knobs. The fact is that frequency doesn't mean much because I've made a random oscillator so it's more a speed factor than a freq… but here too, it's not important anyway


Log in to reply
 

12
Online

1.6k
Users

4.6k
Topics

42.5k
Posts