Independent EFX control from PangoScript

Discussion in 'PangoScript, Universe and Midi Templates' started by hitekvoop, Aug 19, 2015.

  1. hitekvoop

    hitekvoop Well-Known Member

    I have a scenario where I want to control multiple effects discretely.

    Right now, I can use only 1 effect per line from Pangoscript because the only way I can stop an effect is:

    setfx <line>,0

    If I have two effects on one line playing, I cannot stop one without the other?

    I tried to make more layers but maximum is 6. Is there a better way to control effects now that 4 per line is available?

    Thanks,

    -Rick
     
  2. ENOT

    ENOT Software Developer Staff Member

    Hi Rick,

    Good question. Technically, there is no such thing as stop (in this case). The FX is array of effect indexes in QuickFX table. We can set it to -1, what means nothing or to 0..N-1, what means effect index. To add command is a minute or two. Any ideas about syntax/functionality?

    Regards,
    Alexey
     
  3. hitekvoop

    hitekvoop Well-Known Member

    It would seem that allowing more than one efx per line to execute effectively means you're dividing the array like:

    Code:
    setfx 1[1-4], [1,100] //eg setfx 1[1], 5  execute first (of 4) on line 1 effect in cell 5
    This is not very pretty.

    Here is what I am doing: I like to directly set effects to zones. Such as a toggle button in universe that does:

    Code:
    OnMousedown:
    if (value<0.5) goto StartAction:
    StoreZoneSelection
    UnSelectAllZones
    SelectZone 1,7
    ControlSelZones
    SetFx 2,0
    RestoreZoneSelection
    exit
    
    StartAction:
    StoreZoneSelection
    UnSelectAllZones
    SelectZone 1,7
    ControlSelZones
    SetFx 2,5
    ReStoreZoneSelection
    exit
    This gives me ability to override the color information (for instance) contained within the cue, perhaps if I want to set a color "mood". But if I use quickfx line 2-4 then any "zone" fx I run will share with quickfx that are mapped to APC-40 (perhaps I wish to use APC mapped efx at master context) so it is nice if I can put cues out of the way. individual control could be allowed by creating many additional lines (layers?) with only single value (instead of array) but today max lines (layers?) is 6 on grid configuration menu.

    Maybe I like efx too much, but I can do wondrous things with just statics and the universe I built.
     
  4. ENOT

    ENOT Software Developer Staff Member

    Hi Rick,

    Command SetFX is "overloaded", and may have from 2 to 5 arguments
    SetFX LineIndex, First Eff index, 2nd, 3rd, 4th
    I think it should work in 699 too. This is a way to set FX indexes of the line.

    Sometimes it might be handy to use script to OSC gateway:

    /beyond/zone/0/setfx 1,1,2,3,4

    here 0 is index of zone, counting from 0. And, 1 - line index, 1,2,3,4 indexes of FX in one line.

    Command based version:
    ControlZone 1
    SetFX 1, 1,2,3,4

    It is OK to use zone selection, but in your case, when zones are known, then ControlZone is better. Yes, one by one might be optimal.

    Regards,
    Alexey
     
  5. hitekvoop

    hitekvoop Well-Known Member

    I liked the ability to do it all in one action.

    If I want to select 7 zones, can I iterate through a loop with your way or do I need to control them one by one?
     
  6. hitekvoop

    hitekvoop Well-Known Member

    I meant to ask... now that I have 80 or so buttons to edit, is there a way to gain bulk access and mass edit?
     
  7. ENOT

    ENOT Software Developer Staff Member

    Rick,

    Command may be sent to one zone or selected zones. If you want operate with selected zones, then use selection oriented commands.

    Mass edit... hehe. If you talk about properties in Object Inspector then it works, select multiple buttons, and change left, caption, etc. What is the problem?

    Regards,
    Alexey
     
  8. hitekvoop

    hitekvoop Well-Known Member

    so my choice is either (for instance):

    Code:
    SelectZone 1,7
    ControlSelZones
    SetFx 1,1
    or

    Code:
    ControlZone 1
    SetFx 1,1
    ControlZone 7
    SetFx 1,1
    If I had something like:

    Code:
    SelectZone 1,2,3,5,6,7
    ControlSelZones
    SetFx 1,1
    Now I have:

    Code:
    ControlZone 1
    SetFx 1,1
    ControlZone 2
    SetFx 1,1
    ControlZone 3
    SetFx 1,1
    ControlZone 5
    SetFx 1,1
    ControlZone 6
    SetFx 1,1
    ControlZone 7
    SetFx 1,1
    
    As for mass operations, yes, very handy for Object Inspector, I use that already. Now I have all this PangoScript attached to objects that needs to be bulk edited... Do I have to do one by one?

    Thanks,

    -Rick
     
  9. ENOT

    ENOT Software Developer Staff Member

    Rick,your code work right now, try it:

    SelectZone 1,2,3,5,6,7
    ControlSelZones
    SetFx 1,1

    Mass editing of scripts, well... it is not a problem to assign a string to multiple selected objects. It seems more like "dangerous", perhaps a wrong word. In what situation you have same script in multiple components?

    Regards,
    Alexey
     
  10. hitekvoop

    hitekvoop Well-Known Member

    Alexey,

    I'm aware that both examples are working properly. when I initially posted the code for one (of the 80) buttons I have in my universe, you mentioned that ControlZone would be a better option than ControlSelZones when zones are known. My approach uses ControlSelZones so that my script may be shorter than selecting the zones individually and applying the same settings.

    i do not have identical code on all the buttons, but there is a significant commonality between each of the buttons. The Unix admin in me wants to use something like 'sed' and regular expressions to edit all the script in a single line. Useful in the case where I might want to switch from using the "ControlSelZones" method to "ControlZone" method...

    I currently have 80 buttons that basically do this:

    Code:
    OnMousedown:
    if (value<0.5) goto StartAction:
    StoreZoneSelection
    UnSelectAllZones
    SelectZone 1,7
    ControlSelZones
    SetFx 2,0
    RestoreZoneSelection
    exit
    
    StartAction:
    StoreZoneSelection
    UnSelectAllZones
    SelectZone 1,7
    ControlSelZones
    SetFx 2,5
    ReStoreZoneSelection
    exit
    The variables are the SelectZone and SetFx parameters, the rest is common code. Now that I know SetFx is an overloaded operator, I might go back and re-architect the way I'm using effects currently. At some point I will post my universe publicly, but I want to make sure I'm doing things in an efficient manner before I do.
     

Share This Page