multiple if statements??
Very new to Max, could someone tell me what i need to do to get this if statement working. i imagine its something very simple that i’m missing
----------begin_max5_patcher---------- 473.3oc0U9sSCBCEF+Z3o3jFubZnsLFXxtvmCiwzM5bUg1EnKN036t8OLEm3 FwfjrKnENsky22ONk9VX.ZgZGuFAWC2BAAuEFD3BYCDz7b.pjsaYAq1MMjba 4BdEZhenML8x0B4C2WwWp8uFJc1UQSfjjDa2zHaKwzB20rF0VcAWqeYC2u.j PpQS.zBl7AzmyRj6RmZwiWhwz84akRpkrR2JQ2TIXEsGoV7paDLwjTeXibER S5bhG+UPuHbQI1fuGFZalzWJve1nr84Vy24LORrBtPfg4ygrYfdMWBzHPUAs hm1DGeLDFQcrKyQRBkdZF9KfC+eBN7eAbmp7gjfstM1W3LHkOomIUOOwe4Xf gjYYAMso13po8DL+rqSJkLLTJpSJE+eTpL0uwHEmMXkJwmIkJRkladyG6eHY d3P7+FF+C3zx1jgw0zNcczv45R1SbqygjH.GYtNl+ScVd1LWm4HjSWcrpPwb 0GGbSmUJCCxh6DYzVHykbTgPd3wzNOai+cNVq1Vsbui97zS3Kamyq0BISKTx 1y5ayYsHOmKauctTjuQY19zHB3tN+p1aMk1GIgGYQcP99MUQGWUkzGQkNtZp GRhL5JB2CEgGOEE2SHQ9iRx7v6ge.zxhzZC -----------end_max5_patcher-----------
oh, 97 and 98 are the ASCII codes of ‘a’ and ‘b’ on the keyboard. so when i press a i want it to output 31 and b to output 32
ahhhhh, a select statement. thanks! that seems so obvious now.
If you’re dealing with larger sets of numbers, you also might want to have a look at [coll].
great, thanks for the help
for lots of ASCII key characters, I run it through [sprintf %c]. this way your select statement can be [sel a b c d e] etc. instead of ASCII numbers, more intuitive.
note that non-printing characters like space, tab, enter etc. won’t print out from the sprintf, it’s only for letters/numbers/symbols. but [sel 13 9 8] will react to Enter, Tab, Backspace, for example.
yep, select is basically a multiple "if" statement, or a "switch" statement. I don’t see or use the [if] statement in Max very much, but sometimes it helps for certain things.