New User Menu scripting woes

Discuss problems and solutions.
Post Reply
nbdy
Newbie
Posts: 5
Joined: 08 Nov 2016 19:29

New User Menu scripting woes

Post by nbdy »

Hello All,
I'm a new user and struggling with the Menu item. I have downloaded
and looked at quite a few projects searching for an example.
Have also read thru the pertinent parts of the manual.

My question is...

I have a simple menu with 2 items.
I want to send a different OSC command on selection of
each one of those 2 choices.

Thanks,
nbdy
oldgearguy
Regular
Posts: 315
Joined: 02 Nov 2013 11:19

Re: New User Menu scripting woes

Post by oldgearguy »

you need to create a script that executes "on expression" selection.
selection is where the menu object stores your choice. 0 = first choice, 1 = second, etc.

so something like:

if (selection == 0) {
// do these things
} else if (selection == 1) {
// do these other things
}
nbdy
Newbie
Posts: 5
Joined: 08 Nov 2016 19:29

Re: New User Menu scripting woes

Post by nbdy »

Thanks oldgearguy
nbdy
Newbie
Posts: 5
Joined: 08 Nov 2016 19:29

Re: New User Menu scripting woes

Post by nbdy »

Thought I had this figured out but perhaps my syntax is incorrect.
The script is still all in red.

my script...
Execution: On Expression, selection

if (selection==0){
oscout (0,'/Server/showcontrol/fadein/')
} else if (selection == 1){
oscout (0,'/server/showcontrol/fadeout/')
}

What am I doing wrong?
Any help would be appreciated

nbdy
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: New User Menu scripting woes

Post by Phil999 »

oscout needs three inputs, target, address, and args[]. You forgot the args[].
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
nbdy
Newbie
Posts: 5
Joined: 08 Nov 2016 19:29

Re: New User Menu scripting woes

Post by nbdy »

ya know Phill999 as I have been reading on the forums and the manual I have seen ARGS[]

what would my ARGS be in this case?

the OSC commands to make this work are as stated in the scout lines of my script.

in my project I have 2 separate CustomButtons that do what I am trying with the menu.
those buttons just send the osc commands

/Server/showcontrol/fadein/
/Server/showcontrol/fadeout/

I'm missing something here.

Thanks,
nbdy
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: New User Menu scripting woes

Post by Phil999 »

I would try with values 0 and 1. That could work for a switch. But we cannot know, it depends on the receiving application.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Post Reply