please help me

Discussion in 'Education' started by berrahem, Jun 14, 2024.

  1. berrahem

    berrahem Newbie

    Joined:
    Jun 5, 2023
    Messages:
    1
    Likes Received:
    0
    Is it possible to manipulate the individual voice collectively for each voice separately? I have this script with some errors, can you please help me find a solution for these errors?

    Code:
    on init
        declare ui_knob $TUNE (-36, 36, 1)
        declare ui_knob $REVERB (0, 1200, 100)
        declare ui_knob $VOLUME (0, 100, 1)
        declare ui_knob $PAN (-100, 100, 1)
    
        declare const $TUNE_DEFAULT := 0
        declare const $REVERB_DEFAULT := 600
        declare const $VOLUME_DEFAULT := 50
        declare const $PAN_DEFAULT := 0
    
        $TUNE := $TUNE_DEFAULT
        $REVERB := $REVERB_DEFAULT
        $VOLUME := $VOLUME_DEFAULT
        $PAN := $PAN_DEFAULT
    
        make_persistent($TUNE)
        make_persistent($REVERB)
        make_persistent($VOLUME)
        make_persistent($PAN)
    
        set_ui_height_px(100)
    
        message("Initialized")
    end on
    
    on ui_control($TUNE)
        declare $i := 0
        while ($i < 100)
            set_engine_par($ENGINE_PAR_TUNE, $TUNE * 1000, $i, -1, -1)
            $i := $i + 1
        end while
    end on
    
    on ui_control($REVERB)
        declare $i := 0
        while ($i < 100)
            set_engine_par($ENGINE_PAR_SEND_EFFECT_OUTPUT_GAIN, $REVERB * 100, $i, 1, -1)
            $i := $i + 1
        end while
    end on
    
    on ui_control($VOLUME)
        declare $i := 0
        while ($i < 100)
            set_engine_par($ENGINE_PAR_VOLUME, $VOLUME * 14400 - 1440000, $i, -1, -1)
            $i := $i + 1
        end while
    end on
    
    on ui_control($PAN)
        declare $i := 0
        while ($i < 100)
            set_engine_par($ENGINE_PAR_PAN, $PAN * 10000, $i, -1, -1)
            $i := $i + 1
        end while
    end on
     
  2.  
  3. saccamano

    saccamano Rock Star

    Joined:
    Mar 26, 2023
    Messages:
    1,022
    Likes Received:
    403
    Location:
    uranus
    A little backstory would help.
     
  4. Melodic Reality

    Melodic Reality Rock Star

    Joined:
    Feb 18, 2023
    Messages:
    544
    Likes Received:
    349
    I noticed a potential issue in your script: you're iterating over 100 steps to set the parameters for each voice. However, if you're dealing with a variable number of voices, this might not be the best approach. Additionally, the way you're calculating the parameter values might not be correct.
     
  5. Zenarcist

    Zenarcist Audiosexual

    Joined:
    Jan 1, 2012
    Messages:
    4,117
    Likes Received:
    2,622
    Location:
    Planet Earth
    I'm here for the Beatles song.
     
  6. stopped

    stopped Producer

    Joined:
    Mar 22, 2016
    Messages:
    387
    Likes Received:
    128
  7. saccamano

    saccamano Rock Star

    Joined:
    Mar 26, 2023
    Messages:
    1,022
    Likes Received:
    403
    Location:
    uranus
  8. Lois Lane

    Lois Lane Audiosexual

    Joined:
    Jan 16, 2019
    Messages:
    4,422
    Likes Received:
    4,378
    Location:
    Somewhere Over The Rainbow
    At the end of Strawberry Fields Forever, John Lennon utters"I buried BobDule". Anyway, that's what I hear.
     
    Last edited: Jun 14, 2024
    • Funny Funny x 1
    • Creative Creative x 1
    • List
  9. Kelsier

    Kelsier Kapellmeister

    Joined:
    Feb 9, 2024
    Messages:
    82
    Likes Received:
    42
    Agreed, doing the same calculation in a loop is costly, those calculations have to be performed every iteration of the loop. A better approach is to perform the calculation once, outside of the loop
     
Loading...
Similar Threads - please help Forum Date
The VST3 plug-in could not be found (please help, I tried for days, this will ruin my old projects) Kontakt Jun 19, 2024
Please help me with Kontakt Kontakt Jun 5, 2024
Analog lab crashes, please help Software May 17, 2024
How can I activate UVI workstation soundbank? Please Help Mac / Hackintosh Mar 11, 2024
New to Mac, Please Help!:) Mac / Hackintosh Feb 29, 2024
Loading...