Setting variation on activation

#1

sigh…somehow i am still such a newbie…

i want my rackspace to switch to variation 1 (of 4) when it is activated. why does this script, which complies successfully, not work?

On Activate
    SetVariation(1)
End

i’m also trying to get buttons on my controller (yay! new softstep2 replaced my heavy-as-a-tank fc-300!) to switch to different variations, but that is not working either. for example, when i step on one key of my soft step, which i have named Button1, i want it to switch to Variation 2, and then back to the variation it was originally on when i step on the button again:

On WidgetValueChanged(newValue : double) from Button1
        CurVar = GetCurrentVariation()
        
            If newValue > 0.5
            then
                SetVariation(2)
            Else
                SetVariation(CurVar)
            end
end

again, this is from a script that compiles successfully (variables, widgets, and blocks properly declared), and i have successfully written other scripts using these buttons. but when i step on Button1, nothing happens at all. i can paste the whole script if needed, but i am wondering if there is something i am not understanding about these functions, or how they relate to variations. do i have to give the variations their index numbers in some way?

TIA,

tony

#2

The 1st Variation has number 0

#3

thanks, pianopaul - that definitely helps! also, ticking the “Ignore Variations” box helps.

and…i figured out the second half of the first script! i needed to use the On Variation function.

On Variation(oldVariation : integer, newVariation : integer)
    CurVar = oldVariation


End
       
    
On WidgetValueChanged(newValue : double) from Button1

        
            If newValue > 0.5
            then
                SetVariation(1)
            Else
               SetVariation(CurVar)
            end
        
end
1 Like
#4

The script is OK, you nailed it!