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 Audiosexual

    Joined:
    Mar 26, 2023
    Messages:
    2,273
    Likes Received:
    950
    Location:
    CBGB omfug
    A little backstory would help.
     
  4. Melodic Reality

    Melodic Reality Audiosexual

    Joined:
    Feb 18, 2023
    Messages:
    931
    Likes Received:
    600
    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,648
    Likes Received:
    2,990
    Location:
    Planet Earth
    I'm here for the Beatles song.
     
  6. stopped

    stopped Rock Star

    Joined:
    Mar 22, 2016
    Messages:
    843
    Likes Received:
    315
  7. saccamano

    saccamano Audiosexual

    Joined:
    Mar 26, 2023
    Messages:
    2,273
    Likes Received:
    950
    Location:
    CBGB omfug
  8. Lois Lane

    Lois Lane Audiosexual

    Joined:
    Jan 16, 2019
    Messages:
    6,298
    Likes Received:
    6,285
    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 Producer

    Joined:
    Feb 9, 2024
    Messages:
    172
    Likes Received:
    120
    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
Help choosing a second hand new computer, please Computer Hardware Monday at 11:22 AM
Multiple issues with KLU, Kontakt Library Utility, please help Kontakt Apr 1, 2026
WAVES 16 MAC fix Please Help Software Mar 30, 2026
Help with Ripx please Software Jan 9, 2026
Please help me find an old forgotten vsti that had a ribbon controller. Samplers, Synthesizers Dec 14, 2025
Loading...