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:
    1,278
    Likes Received:
    518
    Location:
    CBGB omfug
    A little backstory would help.
     
  4. Melodic Reality

    Melodic Reality Rock Star

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

    stopped Platinum Record

    Joined:
    Mar 22, 2016
    Messages:
    585
    Likes Received:
    209
  7. saccamano

    saccamano Audiosexual

    Joined:
    Mar 26, 2023
    Messages:
    1,278
    Likes Received:
    518
    Location:
    CBGB omfug
  8. Lois Lane

    Lois Lane Audiosexual

    Joined:
    Jan 16, 2019
    Messages:
    4,850
    Likes Received:
    4,768
    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:
    109
    Likes Received:
    70
    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
Please Help, I have become a victim of employee stalking or thieves Lounge Yesterday at 10:58 AM
Please help me identify name of Nexus Expansion title Presets, Patches Dec 4, 2024
Need help please Computer Hardware Nov 4, 2024
please help me identify this omnisphere patch Omnisphere Oct 26, 2024
Looking for Halion 3.5 air Please help!!! Software Aug 26, 2024
Loading...