1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Sample drop & On Note

Discussion in 'Scripting Workshop' started by Reylon, Dec 13, 2021.

  1. Reylon

    Reylon NI Product Owner

    Messages:
    124
    Hi guys,

    I am using my own script and the "single sample drop" script.
    My script is using on note callback but as soon as I add the on note section the sample drop doesn't play any samples.

    here is the on note code.
    Code:
    on note
        disallow_group($ALL_GROUPS)
        if ($Combi_On_1 = 0)
          allow_group($Combi_Menu1)
        end if
        if ($Combi_On_2 = 0)
          allow_group($Combi_Menu2)
        end if
        if ($Combi_On_3 = 0)
          allow_group($Combi_Menu3)
        end if
        if ($Combi_On_4 = 0)
          allow_group($Combi_Menu4)
        end if
        if ($Combi_On_5 = 0)
          allow_group($Combi_Menu5)
        end if
        if ($Combi_On_6 = 0)
          allow_group($Combi_Menu6)
        end if
        if ($Combi_On_7 = 0)
          allow_group($Combi_Menu7)
        end if
            disallow_group(0)
    end on
    
    Any help is highly appreciated! :)
     
  2. corbo-billy

    corbo-billy NI Product Owner

    Messages:
    652
    Hi _

    Rather write the group number instead of its name.
     
    • Like Like x 1
  3. Reylon

    Reylon NI Product Owner

    Messages:
    124
    Hi,

    Thank you for your answer. Hmm I did that and nothing seems to change.
     
  4. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    AFAIK Single Sample Drop script only works with first group (ID 0).
     
    • Like Like x 1
  5. Reylon

    Reylon NI Product Owner

    Messages:
    124
    Hi ED,

    Thank you for your reply.

    I think with this line I'm able to choose in which group it will play
    set_zone_par(%NI_USER_ZONE_IDS[61],$ZONE_PAR_GROUP,3)
    But I'm not sure how to implement that on the "on note" part

    EDIT: My above comment is right. You can choose which group sample drop uses.
    So my question is now, if group 8 (starting from 0) is using the sample drop, how could I implement it on the on note callback?
     
    Last edited: Dec 14, 2021
  6. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    You shouldn't add it to the on note callback! It should be added in the ui_mouse_area's UI callback, where dropping the sample on it is processed.
     
    • Like Like x 1
  7. Reylon

    Reylon NI Product Owner

    Messages:
    124
    That’s true and I did that already but I have on note disabled all groups which means it will disable also the sample drop. I just need to know how to activate that particular group even if all groups are disabled.

    as soon as I delete the on note section, everything works
     
  8. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Well just allow_group(whichever group you dropped the sample to) after that disallow_group($ALL_GROUPS).
     
    • Like Like x 1
  9. Reylon

    Reylon NI Product Owner

    Messages:
    124
    Thank you ED, got it working ;)