Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Color Themes and Icon Sets

Reply
 
Thread Tools Display Modes
Old 08-15-2023, 08:20 AM   #1
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,593
Default Walter `def` and `define_parameter` together

Code:
define_parameter scalar_v1     'bla' 1 1 15
def var1 scalar_v1
This is not supposed to work?

More context, trying to modify (well hoping) V5 button order with this
Sexan is online now   Reply With Quote
Old 08-15-2023, 08:44 AM   #2
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,950
Default

Nope, there's nothing wrong with that. Though if you have warnings on you'll want...
Code:
def var1 scalar_v1{0}
...to stop it complaining. What's not working?
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 08-15-2023, 08:48 AM   #3
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,593
Default

Code:
define_parameter p_order_recarm     'order_recarm' 1 1 15
define_parameter p_order_label      'order_label' 2 1 15
define_parameter p_order_volume     'order_volume' 3 1 15
define_parameter p_order_io         'order_io' 4 1 15
define_parameter p_order_pan_width  'order_pan_width' 5 1 15
define_parameter p_order_mute       'order_mute' 6 1 15
define_parameter p_order_solo       'order_solo' 7 1 15
define_parameter p_order_fx         'order_fx' 8 1 15
define_parameter p_order_fxbyp      'order_fxbyp' 9 1 15
define_parameter p_order_phase      'order_phase' 10 1 15
define_parameter p_order_env        'order_env' 11 1 15
define_parameter p_order_recmode    'order_recmode' 12 1 15
define_parameter p_order_recmon     'order_recmon' 13 1 15
define_parameter p_order_fxin       'order_fxin' 14 1 15
define_parameter p_order_recinput   'order_recinput' 15 1 15

--- down the road

; order of controls (1-15)

def order_recarm      p_order_recarm
def order_label       p_order_label
def order_volume      p_order_volume
TCP is blank in this case (or in p_order_recarm{0} case also)



(just testing if there is other way to do it than original hack which writes to rtconfig file)

Last edited by Sexan; 08-15-2023 at 08:54 AM.
Sexan is online now   Reply With Quote
Old 08-15-2023, 11:40 AM   #4
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,593
Default

Ok got it working.. little awkward code for some reason but yeah can change order via theme adjuster now
Sexan is online now   Reply With Quote
Old 08-17-2023, 12:20 AM   #5
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,593
Default

Quote:
Originally Posted by White Tie View Post
Though if you have warnings on...
There is a way to have warnings/debug show?
Sexan is online now   Reply With Quote
Old 08-17-2023, 02:04 AM   #6
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,593
Default

Can I get some clarification here please?

Original line
Code:
def thing 1
Trying to modify it via script
Code:
define_parameter v1 'desc' 1 1 10
def thing v1 -- does something different
def thing v1{0} -- does something different also (should be same as original line??)
def thing v1==1 1 v1==2 2 v1==3 3 ... -- does something different
Whats the deal here? At least the last one (nested statements) should be equal to original line?

v1 parameter is scalar I assume so its doing [1 1 1 1 1 1] but should:
Code:
 v1{0} be same as def x 1?
I'm modifying V5 rtconfig element order code, but anything above breaks variance macro.
Managed to make it semi working with doing

Code:
define_parameter p_order_recarm     'order_recarm' 1 1 15

def order_recarm             p_order_recarm==1 e1 p_order_recarm==2 e2 p_order_recarm==3 e3 p_order_recarm==4 e4 ...
But need to modify variance macro in this case and I dont know what all ## are doing there?

Code:
macro variance loc v2 v3 v4 v5 sf
  set e##loc##_variance              [loc 0 v2 v3 v4 v5 sf]
endmacro
What is the output of this code? e1_variance if loc is 1?
Sexan is online now   Reply With Quote
Old 08-17-2023, 03:03 AM   #7
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,950
Default

Quote:
Originally Posted by Sexan View Post
There is a way to have warnings/debug show?
Its a pre-release thing that we shouldn't be talking about here...
Code:
v6.75+dev0209 - February 9 2023
  + WALTER: add warnings, enable via "warnings all" or "warnings pedantic" line, only functions when loading a non-zipped theme
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 08-17-2023, 03:54 AM   #8
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,593
Default

Talk about what?

Anyway could you give some insides what is happening above?

why these are not equal (x and thing)
Code:
def x 1

define_parameter v1 'desc' 1 1 10
def thing v1 -- does something different
def thing v1{0} -- does something different also (should be same as original line??)
def thing v1==1 1 v1==2 2 v1==3 3 ... -- does something different
Sexan is online now   Reply With Quote
Old 08-17-2023, 03:59 AM   #9
White Tie
Pixel Pusher
 
White Tie's Avatar
 
Join Date: Mar 2007
Location: Blighty
Posts: 4,950
Default

FWIW I myself don't know how to answer your questions about def because I don't know the truth of it and I don't want to put my guesses on public forum. I used to use def as a portable 'chunk of code' shorthand, to be dropped in later in various places once other values had been set, such as in macros. I wouldn't do it that way now.

WARNING : Designer potentially talking bollocks about code.
Everything that follows could be NONSENSE:

Code:
def order_recarm     1
..isn't a coordinate list, its not a vector, its not an integer, its not an index ...at least not how I saw it. Its 'if I now type 'order_recarm', act as if I type the text string '1'. So if you do:

Code:
def order_recarm    -big line of walter-
.. it doesn't evaluate that big line of WALTER. It just inserts that big line of WALTER into the next macro's input, which the macro isn't going to like. However,

Code:
set order_recarm    -big line of walter-
...would evaluate that big line WALETR using whatever values things were at that point in the rtconfig (not what you want), and set order_recarm to be that value.

I've just taken a look at the v5 macros ands woh brother, run away. I had never used macros before, they hadn't been in WALTER before, I had no documentation, I went down some pretty whacky roads. I mean, look at all the eA eB eC stuff - I had completely failed to grasp that this stuff was evaluated linearly, so I didn't need all that complication providing the previous/next elements. Previous element was the last thing we just did (doh!) and this element will be that to the next element. Lol.

Hey, it worked then, and it works now, so yeah cool. But if I were to mess with altering or extending that today, I would expect to break it in ways I wouldn't understand, because its really very bad. If you've got what you are doing half working then that's cool. I would still say start again not with v5

Here's where I think the solution is : when I did reordering for the theme assembler I experimented with doing "make n placeholder objects, flow and resize them, then assign elements their coordinates by script param". I completely can't remember why it didn't work, and that's essentially how I'm doing the extmixer sections in the (thing we're not talking about here) so it should work. Did I stop because it got messy, or because I uncovered some hidden fundamental flaw in the method? I wish I could remember, sorry. As I think it through now, it should work...
__________________
The House of White Tie
White Tie is offline   Reply With Quote
Old 08-17-2023, 04:06 AM   #10
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,593
Default

Ok thanks for explanation. I just used V5 theme as prototype since it has "things in place" to start working. But I wanted to see could elements be reordered via parameter rather than my original hack to modify and write to rtconfig itself.

It can be done since I had success, just sizes were broken because of variance macro broke so another approach is needed
Sexan is online now   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 08:33 AM.


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