What has the most impact on the size of a template?

Discuss Lemur and share techniques.
Post Reply
electrofux
Regular
Posts:297
Joined:24 Jan 2012 18:22
What has the most impact on the size of a template?

Post by electrofux » 26 Nov 2013 13:10

I am constantly fighting the size restriction of my template. So i am wondering where i can save the most.

Is the size simply depending on the size of the jzml file and thus from the number of lines/characters in it. Or do certain object use up alot more than others. If so what objects are heavy and which ones are lighter. I assume using a 1x16 switch uses less than 16 custom buttons.
How about containers, do they make thing alot bigger. Is a new interface lighter than a new container?

I have already saved some space through reusing objects through dynamic scripting so i think object use up more than even bigger scripts, right?

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: What has the most impact on the size of a template?

Post by Softcore » 27 Nov 2013 10:10

I have a lot and more complex questions about these things myself too as Im not a proffesional programmer and I really dont know but the absolute basics when it comes to code optimising.

For example, does it even make a difference if in a script I have "x = y/2" or "x=y*0.5"
Is it better to use a static predefined vector or a create one in a script dynamically?
Is it better to fill a vector with values statically or to use a function?

And aaaaaaaaaaaaallllll sorts of other questions....
Well actually my questions are related more to performance and not the template size, but still, when reaching the limits of size, optimised code can really make a difference too, I think.
I also think a well informed Lemur scripter should take the bite and post some general rules of practises for such things.

EDIT to add: as for multi-objects, I've read elsewhere and you are correct: its better to use a multi-object instead of single iterations of the same object when that is possible (pads, switches etc)

Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: What has the most impact on the size of a template?

Post by Macciza » 27 Nov 2013 22:00

Hi
Can't answer all of those questions right now off the top of my head but can offer a suggestion or two . .
Different objects take up more space then others - someone posted some general guides a while ago - scripts in general I believe take up less space, but then objects have 'hidden' scripts in them that do there stuff . .

Starting from a blank project chuck a 4*4 Pads on then hover over the Size indicator and it should show a numeric value for 'Bytes used' - this shows ~23k
Then delete it and add 1 single Pads object and check (~22k) then make it 16 individual Pads (~320k)
One could also look to see how scripts affect these figures ….

Will have to have a think on some of the others but I think that anything that can be defined as a constant is probably best done that way
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

midimockup
Newbie
Posts:41
Joined:08 Nov 2012 15:55

Re: What has the most impact on the size of a template?

Post by midimockup » 28 Nov 2013 16:07

2 things I've noticed:
1) lots of text objects
2) scripts involving bidirectional MIDI (i.e. MIDI_ARGS). Not sure if limiting the number of channels the script listens to has an effect.

Traxus
Regular
Posts:216
Joined:30 Nov 2012 06:19
Location:Detroit
Contact:

Re: What has the most impact on the size of a template?

Post by Traxus » 04 Dec 2013 18:48

Awhile ago, I wrote a php script that would minify and obfuscate one of my lemur templates. Basically, variable names, function names etc would get shortened so that 'longVariableName' would become var001, 'longFunctionName' would become func001 etc... It also removed unnecessary white space as a .jzml is just a fancy xml file. Surprisingly, the effect was minimal, file size dropped from 2,329 to 2,039 KiB... Hinting that the lemur editor probably does some compiling on its own?

In essence, I tend to agree that it is largely based on object count.

Post Reply