What's new

Help me learn scripting :)

Yes, you would use play_note() two times, and store each one to a variable to get the event ID, which you can then use to set_event_par_arr(<event-ID>, $EVENT_PAR_ALLOW_GROUP, <value>, <group-idx>).
 
Yes, you would use play_note() two times, and store each one to a variable to get the event ID, which you can then use to set_event_par_arr(<event-ID>, $EVENT_PAR_ALLOW_GROUP, <value>, <group-idx>).
Ok thanks is there any example on how to do that? Have ist to ne different variables for each play Note()?
 
Another Question: Is there any possibility to let play samples of two different groups at the same time?
So like when you press one key it plays Sample 1 in Group 1 and Sample 2 in Group 2?
if both groups need to play the same notes..
and
if you don't use any allow_group code it will always play all groups that are loaded....

if you want to play 2 specific groups only (ex: group 22 and 32) only just do this:

on note
disallow_group(ALL_GROUPS)
allow_group(22)
allow_group(32)
end on

if you want to be able to select the groups to play and change them, just do 2 menus that contain all the available groups like:

declare ui_menu $layer1
declare ui_menu $layer2
i:=0
while(i<NUM_GROUPS)
add_menu_items($layer1,group_name(i),i)
add_menu_items($layer2,group_name(i),i)
inc(i)
end while

and then :

on note
disallow_group(ALL_GROUPS)
allow_group( $layer1)
allow_group( $layer2)
end on
 
Another Question: Is there any possibility to let play samples of two different groups at the same time?
So like when you press one key it plays Sample 1 in Group 1 and Sample 2 in Group 2?
of course, just load both groups.
 
if both groups need to play the same notes..
and
if you don't use any allow_group code it will always play all groups that are loaded....

if you want to play 2 specific groups only (ex: group 22 and 32) only just do this:

on note
disallow_group(ALL_GROUPS)
allow_group(22)
allow_group(32)
end on

if you want to be able to select the groups to play and change them, just do 2 menus that contain all the available groups like:

declare ui_menu $layer1
declare ui_menu $layer2
i:=0
while(i<NUM_GROUPS)
add_menu_items($layer1,group_name(i),i)
add_menu_items($layer2,group_name(i),i)
inc(i)
end while

and then :

on note
disallow_group(ALL_GROUPS)
allow_group( $layer1)
allow_group( $layer2)
end on
Hey thank you very much, would have taking me some hours for sure to figure that out. The 3rd approach is the nearest to what I'm aiming for. I want to have kind of Drop Down menus to control which groups are played when you hit one key. Do I have to define every group with add_menu_items ? Or is there a better way to do this?


So this would be my code to add the drop down menus:
How can I make it that per drop down menu 1 group is triggered and than both play when you press a key?

on init



declare $i
declare ui_menu $menu1
declare ui_menu $menu2

declare const $LAYER1_FIRST := 0
declare const $LAYER1_LAST := 1
declare const $LAYER2_FIRST := 2
declare const $LAYER2_LAST := 3


$i := $LAYER1_FIRST
while ($i<=$LAYER1_LAST)
add_menu_item($menu1,group_name($i),$i)
inc($i)
end while



$i:= $LAYER2_FIRST
while ($i<=$LAYER2_LAST)
add_menu_item($menu2,group_name($i),$i)
inc($i)
end while


end on
 
Last edited:
Do I have to define every group with add_menu_items ? Or is there a better way to do this?



How can I make it that per drop down menu 1 group is triggered and than both play when you press a key?
not sure i understand your question...


in this:
i:=0
while(i<NUM_GROUPS)
add_menu_items($layer1,group_name(i),i)
add_menu_items($layer2,group_name(i),i)
inc(i)
end while

the group_name refers to the name you write on each group and NUM_GROUPS is the total amount of groups you have
in my example i used add_menu_items in a while loop and both menus will be able to load all the groups (you would have to do a little trick to not load the same group in both, it would not work properly)
if you had 10 menus for ten layers at once, you could still use only one while loop to add all the groups names to each menu , i only used 2 menus...


the allow_group code i pasted is the one to use to permit the chosen groups to play

on note
disallow_group(ALL_GROUPS)
allow_group( $layer1)
allow_group( $layer2)
end on

when you select a different group in layer_1 menu, the value will be carried out in the layer_1 variable in allow_group, so it will allow the chosen group...

but on ui_control( $layer1)

you will have to purge (unload) all samples and then load only the chosen ones by the menu,

on ui_control( $layer1)
i:=0
while(i<NUM_GROUPS)
purge_group(i,0) {this purge all groups}
inc(i)
end while
purge_group($layer1) {this will re-load layer 1 samples}
purge_group($layer2) {this will re-load layer 2 samples}
end on

and the same on layer2 control
 
not sure i understand your question...


in this:
i:=0
while(i<NUM_GROUPS)
add_menu_items($layer1,group_name(i),i)
add_menu_items($layer2,group_name(i),i)
inc(i)
end while

the group_name refers to the name you write on each group and NUM_GROUPS is the total amount of groups you have
in my example i used add_menu_items in a while loop and both menus will be able to load all the groups (you would have to do a little trick to not load the same group in both, it would not work properly)
if you had 10 menus for ten layers at once, you could still use only one while loop to add all the groups names to each menu , i only used 2 menus...


the allow_group code i pasted is the one to use to permit the chosen groups to play

on note
disallow_group(ALL_GROUPS)
allow_group( $layer1)
allow_group( $layer2)
end on

when you select a different group in layer_1 menu, the value will be carried out in the layer_1 variable in allow_group, so it will allow the chosen group...

but on ui_control( $layer1)

you will have to purge (unload) all samples and then load only the chosen ones by the menu,

on ui_control( $layer1)
i:=0
while(i<NUM_GROUPS)
purge_group(i,0) {this purge all groups}
inc(i)
end while
purge_group($layer1) {this will re-load layer 1 samples}
purge_group($layer2) {this will re-load layer 2 samples}
end on

and the same on layer2 control
Hey thank you so much for the detailed comments helps me really to understand whats going on. What I'm basically going for is a kind of preset browser like you find in in Native Instruments Analog Dreams 2.0 or Pharlight, Straylight and so on. So at the end i want to be able to choose two different sounds to mix between /manipulate.

Also on question according to the code you already sent - I'm getting error messages with the "i" is it meant to be a variable ($i) or something like that?

Thanks so much for helping me, it really makes my coding journey enjoyfull cause I know I can get help when I'm stuck again. :D Of course also thanks to all others helping me.
 
if you use sublime text all the variables will be compiled correctly so out of speed i almost never use $ % etc... so yes you would have to declare $i
 
if you use sublime text all the variables will be compiled correctly so out of speed i almost never use $ % etc... so yes you would have to declare $i
Ok thanks. Also another question is there any way to "highlight" buttons when hovering over them with the mouse?
 
Hey I created a waveform control. Is there a way to move the position of it in pixels?
 
Yes, it's possible ...

 
Yes, it's possible ...

Thank you that really helped. Now I wanted to make several buttons to select the right zones, is this possible? I don't want a selector menu cause they look a little ugly. XD
 
Hey I need some help again: I have multiple groups and I want to creat buttons (previous and next) with which you can select the next or previous group. Anyone knows how to do that whitout having to use a ui_menu?
I just want to be able to for example select the next group and unload or mute all the non selected ones.
Anyone can help me with that?
Thanks. :)
 
Found with the forums search engine; when you don't know, this method with the right keywords will become your friend.

 
Found with the forums search engine; when you don't know, this method with the right keywords will become your friend.

I already know this post, but it's not what I'm searching for. Of course I want to control my groups but without creating a ui_menu. Just to clarify that again.
I just want to be able to have 2 Buttons Previous and Next with which I can cycle trough the groups. But I dont want a ui_menu where you can select specific groups.
 
Yes, I understand: but you can take inspiration from this data by deleting the menu and thus achieve what you want..
 
Top Bottom