Old 05-13-2022, 11:53 PM   #1
sockmonkey72
Human being with feelings
 
sockmonkey72's Avatar
 
Join Date: Sep 2021
Location: Berlin
Posts: 621
Default WALTER expression "bugs"

Here is a rudimentary theme & RPP to demonstrate some issues with expression evaluation in WALTER.

Here's the relevant stuff from the rtconfig.txt:

Code:
clear tcp.*
set tcp.size [406 100 254 0]

front tcp.fxparm tcp.io

; this works, but the syntax is one coord-list too long for the intention
set tcp.io tcp_fxparms>0 w<350 [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]

Layout "a - Standard"
  set tcp.label  .
EndLayout

Layout "b - AND"
	; this doesn't work, the & is apparently ignored
	; tcp_fxparms&w<350 is similarly incorrect
	set tcp.io tcp_fxparms>0&w<350 [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]
EndLayout

Layout "c - UserVar"
	; user variables are apparently always evaluated as 0
	set fxshown tcp_fxparms==0 0 w<350 0 1
	set tcp.io fxshown==1 [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]
EndLayout

Layout "d - Combo"
	; just trying, of course it doesn't work
	set wless w<350
	set tcp.io tcp_fxparms>0&wless [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]
EndLayout

Layout "e - Combo2"
	; just trying, of course it doesn't work
	set wcombo tcp_fxparms>0&w<350
	set tcp.io wcombo==1 [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]
EndLayout
Basically, various attempts to make WALTER a little less verbose and more easily maintainable are crashing against the rocks of evaluation. I don't know if these are bugs, or just limitations, but if they are bugs, I can move this over to the Bug Reports forum. Thank you.
__________________
ReaPack Repository: right-click and copy index URL
sockmonkey72 is offline   Reply With Quote
Old 05-14-2022, 01:01 AM   #2
sockmonkey72
Human being with feelings
 
sockmonkey72's Avatar
 
Join Date: Sep 2021
Location: Berlin
Posts: 621
Default

EDIT re: User Variables, I guess it's coords vs scalars, this appears to work:

Code:
	set fxshown tcp_fxparms==0 0 w<350 0 1
	set tcp.io fxshown{0}==1 [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]
__________________
ReaPack Repository: right-click and copy index URL

Last edited by sockmonkey72; 05-14-2022 at 01:58 AM.
sockmonkey72 is offline   Reply With Quote
Old 05-14-2022, 02:00 AM   #3
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,093
Default

See HERE for the full list of WALTER expressions. The & :

Code:
val1&val2     --   bitwise AND (if any bit is set in both val1 and val2)
..to date I have found more annoying than anything else, but that's just me.

Quote:
Originally Posted by sockmonkey72 View Post
and re: User Variables, if the problem were coords vs scalars, this should work:

Code:
	set fxshown tcp_fxparms==0 0 w<350 0 1
	set tcp.io fxshown[0]==1 [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]
But it doesn't...
Wrong brackets, do this:

Code:
	set fxshown tcp_fxparms==0 0 w<350 0 1
	set tcp.io fxshown{0}==1 [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]
Quote:
Originally Posted by sockmonkey72 View Post
Basically, various attempts to make WALTER a little less verbose and more easily maintainable are crashing against the rocks of evaluation. I don't know if these are bugs, or just limitations, but if they are bugs, I can move this over to the Bug Reports forum. Thank you.
Limitations, WALTER is extremely simple. But there are still lots of clean up things you can work with to get that done:

- You don't need to include entries in coordinate lists past the ones that have values. So, for example, if the four edge attachment numbers are zero:
Code:
set thing [5 5 20 20 0 0 0 0]
is the same as
set thing [5 5 20 20]
- I don't use the edge attachment numbers at all any more. IIRC never. I find the WALTER comes out neater and easier to debug if I do all my resizing myself, YMMV.

- \ backslash to break up long lines.

- If you're rewriting the same thing over and over, maybe turn it into a macro, even if its just one line.

- Double declare things. For example, I can't remember who (Bernstraw?) but someone used to set up themes like this:

Code:
set thing1 [1 2 3 4]
set thing2 [21 22 23 24]
set thing3 [31 32 33 34]

; w>200
set thing1 w>200 [5 6 7 8] .
set thing2 w>200 [25 26 27 28] .
set thing3 w>200 [35 36 37 38] .
there's lots of little things like that to try, see what floats your boat.
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 05-14-2022, 11:46 AM   #4
sockmonkey72
Human being with feelings
 
sockmonkey72's Avatar
 
Join Date: Sep 2021
Location: Berlin
Posts: 621
Default

Quote:
Originally Posted by White Tie View Post
See HERE for the full list of WALTER expressions. The & :

Code:
val1&val2     --   bitwise AND (if any bit is set in both val1 and val2)
..to date I have found more annoying than anything else, but that's just me.



Wrong brackets, do this:

Code:
	set fxshown tcp_fxparms==0 0 w<350 0 1
	set tcp.io fxshown{0}==1 [50 20 20 20 0 0 0 0] [10 20 20 20 0 0 0 0]


Limitations, WALTER is extremely simple. But there are still lots of clean up things you can work with to get that done:

- You don't need to include entries in coordinate lists past the ones that have values. So, for example, if the four edge attachment numbers are zero:
Code:
set thing [5 5 20 20 0 0 0 0]
is the same as
set thing [5 5 20 20]
- I don't use the edge attachment numbers at all any more. IIRC never. I find the WALTER comes out neater and easier to debug if I do all my resizing myself, YMMV.

- \ backslash to break up long lines.

- If you're rewriting the same thing over and over, maybe turn it into a macro, even if its just one line.

- Double declare things. For example, I can't remember who (Bernstraw?) but someone used to set up themes like this:

Code:
set thing1 [1 2 3 4]
set thing2 [21 22 23 24]
set thing3 [31 32 33 34]

; w>200
set thing1 w>200 [5 6 7 8] .
set thing2 w>200 [25 26 27 28] .
set thing3 w>200 [35 36 37 38] .
there's lots of little things like that to try, see what floats your boat.
AND would be really useful if it worked as documented! Anyway, I figured out that I was using the wrong bracket just before you mentioned it, thanks! That allows me to significantly simplify the WALTER.

As for WALTER being simple, that's a good thing. I wish AND worked, an OR would be useful, but now that I have understood how to compare user variables (coords) to scalars, neither are all that critical. The \ is a good organizational tool, as well...

Thanks again.
__________________
ReaPack Repository: right-click and copy index URL
sockmonkey72 is offline   Reply With Quote
Old 05-14-2022, 04:50 PM   #5
rncwalker
Human being with feelings
 
Join Date: Apr 2016
Location: South Fl.
Posts: 594
Default

Thank you Both sockmonkey72 and White tie!

This thread was very educational. I really like seeing things work out so well.

Robert
rncwalker is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.