Lua ??? - Record, fade selection

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
User avatar
TaineGilliam
Posts: 1183
Joined: Tue Oct 23, 2007 5:15 pm
Location: Cleveland, OH
Contact:

Re: Lua ??? - Record, fade selection

Post by TaineGilliam » Thu Jun 11, 2009 6:12 pm

I had a chance to look at your code - I'm learning a bit about List. I was unaware of the # operator for a list. Your parsing of the fixtures into the List is much cleaner than the code I stole from Brian's code for the ColorRange macro. I'm not sure about the added complexity to be sure each cue actually has NumCells channels - if math.random() return the same value a couple of time it may not matter. Otherwise we can do the list item delete on the master copy and move on.

As for performance, is the built in "table.remove(list, item_index)" better than "List.[item_index] = List.[NumFixtures]; Numfixtures=NumFixtures-1". Given that we don't need the list to survive and don't care about the order of items in the list. Or is my interpretation of List as an Array as a opposed to a List clouding my judgment. I really must read up on table.xxxx.

I think my pre-object oriented programming days(original Turbo Pascal) are starting to show.

Taine

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: Lua ??? - Record, fade selection

Post by RobertBell » Thu Jun 11, 2009 8:13 pm

TaineGilliam wrote:As for performance, is the built in "table.remove(list, item_index)" better than "List.[item_index] = List.[NumFixtures]; Numfixtures=NumFixtures-1".
Yes - it would be for sure.
And you're right - we don't need to keep the original list - EXCEPT if the selection set is (say) 10, NumCells is 4 and NumCues is 100. Then we may want to keep it around.
Robert Bell - Product Manager - Horizon Control Inc.

Post Reply