Main > Software Forum
LED Animation Editor - question for all the LED-Wiz Devs...
<< < (6/15) > >>
headkaze:
You didn't put anyone off, no worries mate. If you call an XML file random access, then you could call an ini file random access too. On the low level the file is still read byte by byte, it just depends on the xml library you use. It might look like it's random access, but it's not.

Anyway back on topic. If were going with xml, I'll cover the repeating frames concept in xml. This is where frame numbers probably make sense now.


--- Code: ---<?xml version="1.0"?>
<LEDWizAnimation>
<Frame Number="1" Duration="10">
<PBA LEDWizID="1" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0" />
<SBA LEDWizID="1" Value="34,0,68,0,2" />
<PBA LEDWizID="2" Value="0,0,0,0,0,0,0,48,0,0,48,48,0,0,0,0" />
<SBA LEDWizID="2" Value="128,12,0,50,2" />
</Frame>
<Frame Number="2" Duration="10">
<PBA LEDWizID="1,2" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0" />
<SBA LEDWizID="1,2" Value="34,0,68,0,2" />
</Frame>
<Loop Frame="2" Times="5" />
<Goto Frame="1" Times="2" />
</LEDWizAnimation>

--- End code ---

Note the addition of a new command called "Loop" that can loop a frame a number of times. I also show Goto frame for jumping the play position to any frame. These are just examples of way to do something like that, but of course it could be done in a number of ways.

I think a good way to conceptualise an animation editor/player for LED's would be to look at Flash and how it's editor works and have a basic version of that.
arzoo:

--- Quote from: headkaze on July 22, 2007, 09:24:46 am ---You didn't put anyone off, no worries mate. If you call an XML file random access, then you could call an ini file random access too.

--- End quote ---
Yes, I would consider an ini file random access. That's because the libraries that provide xml or ini parsing all provide random access functions.

--- Quote from: headkaze on July 22, 2007, 09:24:46 am ---On the low level the file is still read byte by byte, it just depends on the xml library you use. It might look like it's random access, but it's not.

--- End quote ---
And you are totally correct here. But this could be said for any data access. DBs use index files and optimized search algorithms, but often it still comes down to a byte by byte search. Anyway, this is off topic and I believe we both understand the concepts.  :)

--- Quote from: headkaze on July 22, 2007, 09:24:46 am ---Anyway back on topic. If were going with xml, I'll cover the repeating frames concept in xml. This is where frame numbers probably make sense now.


--- Code: ---<?xml version="1.0"?>
<LEDWizAnimation>
<Frame Number="1" Duration="10">
<PBA LEDWizID="1" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0" />
<SBA LEDWizID="1" Value="34,0,68,0,2" />
<PBA LEDWizID="2" Value="0,0,0,0,0,0,0,48,0,0,48,48,0,0,0,0" />
<SBA LEDWizID="2" Value="128,12,0,50,2" />
</Frame>
<Frame Number="2" Duration="10">
<PBA LEDWizID="1,2" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0" />
<SBA LEDWizID="1,2" Value="34,0,68,0,2" />
</Frame>
<Loop Frame="2" Times="5" />
<Goto Frame="1" Times="2" />
</LEDWizAnimation>

--- End code ---

Note the addition of a new command called "Loop" that can loop a frame a number of times. I also show Goto frame for jumping the play position to any frame. These are just examples of way to do something like that, but of course it could be done in a number of ways.

I think a good way to conceptualise an animation editor/player for LED's would be to look at Flash and how it's editor works and have a basic version of that.

--- End quote ---

So back on topic. I don't see the need for the Loop command since a single frame represents a single set of LED states - looping would do nothing (unless I misunderstand your intent).

The GoTo command works well.

Do we need to allow for LEDWizID attribute with multiple values (ie 1,2,4)? How about just use LEDWizID=0 for ALL devices.

I'd also like to do away with Randy's 4 bank SBA format. We can use the same format as the PBA command (32 ports plus one for the global pulse). I think this will also help with the file readability. Of course the code will need to convert back to 4 banks when sending the actual commands - but that's easy.


--- Code: ---<?xml version="1.0"?>
<LEDWizAnimation>
<Frame Number="1" Duration="10">
<PBA LEDWizID="1" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0" />
<SBA LEDWizID="1" Value="0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,..." />
<PBA LEDWizID="2" Value="0,0,0,0,0,0,0,48,0,0,48,48,0,0,0,0" />
<SBA LEDWizID="2" Value="0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,..." />
</Frame>
<Frame Number="2" Duration="10">
<PBA LEDWizID="0" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0,..." />
<SBA LEDWizID="0" Value="0,1,0,1,0,0,1,1,0,0,0,0,0,0,0,..." />
</Frame>
<Goto Frame="1" Times="2" />
</LEDWizAnimation>

--- End code ---

Lastly, Randy spoke about optimization. I think this is something that should be handled by the animation player code (not by the animation editor). It seems pretty simple - if the PBA values have not changed from the prior frame, don't resend them. With that logic, the animation files could contain the PBA and SBA for commands for every device in every frame. Again, this would make for better readability. But I'm not sure I've convinced myself with this concept.

Let me know what you all think!
headkaze:

--- Quote from: arzoo on July 22, 2007, 06:41:57 pm ---So back on topic. I don't see the need for the Loop command since a single frame represents a single set of LED states - looping would do nothing (unless I misunderstand your intent).
--- End quote ---

No your right there, the loop command is useless, I wasn't thinking straight ;)

--- Quote from: arzoo on July 22, 2007, 06:41:57 pm ---The GoTo command works well.
--- End quote ---

Yep that should cover it.


--- Quote from: arzoo on July 22, 2007, 06:41:57 pm ---Do we need to allow for LEDWizID attribute with multiple values (ie 1,2,4)? How about just use LEDWizID=0 for ALL devices.
--- End quote ---

I like that, 0 for all, works for me.


--- Quote from: arzoo on July 22, 2007, 06:41:57 pm ---I'd also like to do away with Randy's 4 bank SBA format. We can use the same format as the PBA command (32 ports plus one for the global pulse). I think this will also help with the file readability. Of course the code will need to convert back to 4 banks when sending the actual commands - but that's easy.


--- Code: ---<?xml version="1.0"?>
<LEDWizAnimation>
<Frame Number="1" Duration="10">
<PBA LEDWizID="1" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0" />
<SBA LEDWizID="1" Value="0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,..." />
<PBA LEDWizID="2" Value="0,0,0,0,0,0,0,48,0,0,48,48,0,0,0,0" />
<SBA LEDWizID="2" Value="0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,..." />
</Frame>
<Frame Number="2" Duration="10">
<PBA LEDWizID="0" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0,..." />
<SBA LEDWizID="0" Value="0,1,0,1,0,0,1,1,0,0,0,0,0,0,0,..." />
</Frame>
<Goto Frame="1" Times="2" />
</LEDWizAnimation>

--- End code ---

--- End quote ---

I agree with this point also. Unless your proficient in binary numbers and have a calculator handy it's pretty hard to write by hand. I like your idea there, we can always repack the data into 16 bit values when we send them to ledwiz.dll.


--- Quote from: arzoo on July 22, 2007, 06:41:57 pm ---Lastly, Randy spoke about optimization. I think this is something that should be handled by the animation player code (not by the animation editor). It seems pretty simple - if the PBA values have not changed from the prior frame, don't resend them. With that logic, the animation files could contain the PBA and SBA for commands for every device in every frame. Again, this would make for better readability. But I'm not sure I've convinced myself with this concept.
--- End quote ---

Yep this can be handled by the player I guess. Otherwise someone who painstakenly makes an animation file by hand, your editor will optimize it and turn it into unreadable mush. So yeah, the player should do the optimizing. It's not hard, just store current state and intensity values, and only send the command if they need changing. I don't think there is a huge need for optimization though. As long as you don't run the animation too fast there should be enough time for USB 2.0 to handle the data.

Although I don't think you should have PBA and SBA commands for every device in every frame though. Only add them for a device if they are changed in the editor. But don't bother with any optimizations. I'm not exactly sure how to implement this well in an animation player, but I guess the way to do it is when the user is editing the state or intensity of a particular LED, check the last frame and only save the data if it differs. This will be a sort of be like a realtime optimization but only checking the last frame.

So there will an option for each frame I guess called "Send to all LEDWiz devices", so when you edit an LED it will effect the same outputs on every other LEDWiz. If you turn off the option and change a value for state or intensity it will check the last frame and if it differs add a new SBA or PBA command for that LEDWiz device.

Overall though I think were on the right track.
arzoo:
Excellent  ;D
Unless anyone else (loadman, youki, RandyT) has any objections, I'm going to move ahead with the new LWA format. We can tweak it as we go if necessary.
headkaze:
Just one last thing I forgot to add, instead of having the GlobalPulse value inside the Value attribute, move it into it's own attribute for readability sake.

Eg.

--- Code: ---<?xml version="1.0"?>
<LEDWizAnimation>
<Frame Number="1" Duration="10">
<PBA LEDWizID="1" Value="0,48,0,0,0,48,0,0,0,0,0,0,0,0,0,0" GlobalPulse="2" />
</Frame>
</LEDWizAnimation>
--- End code ---
Navigation
Message Index
Next page
Previous page

Go to full version