Nutcracker: Need help in understanding Vixen xml files

smeighan

Dedicated elf
Joined
Jan 19, 2012
Messages
1,109
Location
4217 Greenfinch Dr CO 80126
Hi all;
i have started the xml output module for vixen.






My color coding for the below is as follows:
GREEN= just output this exactly as shown
ORANGE= i can get rid of these, unneeded for a nutcracker vix file
BLUE= places whjere i need to supply the data.


I found this thread on vixen file format
http://doityourselfchristmas.com/forums/archive/index.php/t-2539.html






This is a cut and paste from a musicbox.vix file.





1..<?xml version="1.0" encoding="utf-8"?>
2..<Program>
3.. <Time>
117760</Time>
4.. <EventPeriodInMilliseconds>
50
5.. </EventPeriodInMilliseconds>



I assume <Time> is in millis seconds.
Since i have frames in Nutcracker, I will set time and EventPeriodMilliseconds



Lets use an example. 16 strings, 50 pixels each. I need one channel for r,g,b for each pixel
16x50=3 = 2400 channels. If i have a 5 second sequence with a 50ms frame time, then i have 100 frames.


$frames=100;
$frametime=50;


time = $frames * $frameTime;
EventPeriodInMilliseconds=$frameTime;


or
time=5000
EventPeriodInMilliseconds=50







6.. <MinimumLevel>0</MinimumLevel> I assume MinimumLevel,MaximumLevel is the range of each rgb value?
7.. <MaximumLevel>255</MaximumLevel>
8.. <AudioDevice>-1</AudioDevice>
9.. <AudioVolume>0</AudioVolume>
10. <Channels />
11. <PlugInData>
12. <PlugIn name="Adjustable preview" key=
"-1193625963" id="0" enabled="True" type="Output" from="1"
13. to=
"698">Is 698 the number of frames that are in sequence?
14. <BackgroundImage>
15. ... lots of stuff here, assume it is also base64 representing the image ....
16.</BackgroundImage>

17. <RedirectOutputs>False</RedirectOutputs>
18. <Display>
19. <Height>211</Height>
20. <Width>459</Width>
21. <PixelSize>3</PixelSize>
22. <Brightness>5</Brightness>
23. </Display>
24. <Channels>
25. <Channel Number=
"6">WQAMAFkACwBZAAoAWQAJAFoACQBaAAoAWgALAFoADABbAAwAXA
MAFwADQBdAAwAXQALAF0ACgBeAAoAXwAKAF8ACwBfAAwAXwANAF4ADQBdAA0AXAALAFwA
gBeAAkAXQAJAFwACQBbAAkAXAAOAF0ADgBbAA0AWgANAFkADQBeAA4AWwALAF8ADgBeAAw
AXgALAFoACABZAAgAWAAIAFcACQBWAAkAVQAJAE0AEABMABAAVAAOAFQADQBUAAwAVQAM (i added word wraps here, just for clarity)
AFYACwBWAAoAVwAKAFgACgBYAAsAWAAMAFcADABWAAwAUwAMAFMADQBSAA0AVAALAFUAC
wBWAA0AVgAOAFUADgBTAA4AUgAOAFEADgBQAA4ATwAOAE4ADgBNAA4ATQAPAE4ADwBPAA8A
UAAPAEwADwBLAA8ASgAPAEoADgBLAA4ATAAOAE0ADQBOAA0ATgAMAE8ADABQAAwAUQAMAFIAD
ABSAAsAUwALAFQACgBUAAkAVQAKAFMACgBRAA0AS
gAQAEoAEQBKABIASwASAEsAEQBMABEATgAQAE8AEABRAA8AVQANAFcACwBYAA0AVwANAFIADwB
TAA8ASwAQAFoADwBZAA8AWAAPAFsADwBcAA8AXAAQAFsAEABaABAAWQAQAFgAEABXABAAVgAQ
AFUAEABVABEAVwAPAFYAEQBUABEAUwARAFIAEQBRABEAUgAQAFMAEABUABAAVQAPAFAAEQBPABE
ATgARAE4AEgBNABIATQATAE4AEwBPABMAUAATAFEAEwBSABMAUwATAFMAEgBPABIAUAASAFEAEABSABIAUQASAFQAEgBVABIAVwARAA==</Channel>


....
26. channels are listed here
....


27. <Channel number="478">EAAMABAADQAQAA4AEAAPABAAEAAQABEAEAASABAAEwAQABQAEAAVABAAFgAQABcAEAAYAA==</Channel>






What are these numbers in the channel section? Is this where we specify what device is connected to the channel?


Lets use an example. 16 strings, 50 pixels each. I need one channel for r,g,b for each pixel
16x50=3 = 2400 channels. If i have a 5 second sequence with a 50ms frame time, then i have 100 frames.


So for string 1, Pixel #1 i have channels 1,2,3
So for string 1, Pixel #2 i have channels 4,5,6
So for string 1, Pixel #3 i have channels 7,8,9
..
So for string 16, Pixel #50 i have channels 2398,2399,2400




or is there a different format when outputting to rgb devices?




28. <Channel number="479">DAAWAA4AFAAPABMAEAASABEAEQASABAAEwAPAA0AFQAUAA4A</Channel>
29. <Channel number="477">EAASABEAEwASABQAEwAVABQAFgAPABEADgAQAA0ADwAMAA4A</Channel>
30. </Channels>

31. <DialogPositions>
32. <PreviewDialog x="237" y="186" />
33. </DialogPositions>
34. </PlugIn>
35. <PlugIn name="Renard Dimmer (modified)" key="935429715" id="1" enabled="True" type="Output" from="97" to="124">
36. <name>COM1</name>
37. <baud>57600</baud>
38. <parity>None</parity>
39. <data>8</data>
40. <stop>One</stop>
41. <ProtocolVersion>1</ProtocolVersion>
42. <HoldPort>True</HoldPort>
43. </PlugIn>

44. </PlugInData>
45. <SortOrders lastSort="-1" />
46. <Profile
2009 Sequences</Profile>I think i may want to make a profile, *.pro file. If i do , it oges here?
47. <Audio filename="DJ Schwede - Music Box Dancer.mp3" duration="117760">
48. </Audio>

49. <EventValues>
50. .... lots of base64 stuff goes here ....

So I assume all channels are concatenated into one huge string of base64 data?


I will be using php's base64_encode ( string $data ) to encode the data.
I assume this data is the r/g/b value for the frame i am at?


so.


So for channel#1 ( string 1, Pixel #1 ,R) i will encode the 100 bytes that correspond to the 100 frames of RED
So for channel#2 ( string 1, Pixel #1 ,G) i will encode the 100 bytes that correspond to the 100 frames of BLUE
So for channel#3 ( string 1, Pixel #1 ,B) i will encode the 100 bytes that correspond to the 100 frames of GREEN
So for channel#4 ( string 1, Pixel #2 ,R) i will encode the 100 bytes that correspond to the 100 frames of RED
So for channel#5 ( string 1, Pixel #2 ,G) i will encode the 100 bytes that correspond to the 100 frames of BLUE
So for channel#6 ( string 1, Pixel #2 ,B) i will encode the 100 bytes that correspond to the 100 frames of GREEN



51. </EventValues>
52. <LoadableData />
53. <EngineType>Standard</EngineType>
54. <Extensions>
55. <Extension type=".vix" />
56. </Extensions>
57. <WindowSize>160,27</WindowSize>
58. <ChannelWidth>214</ChannelWidth>
59. </Program>





When replying , you can use the line numbers i gave to point me to what section you are talking about.


As soon as i get this, we are probably going to see vixen files by this weekend. (fingers crossed).




Thanks
 

AussiePhil

Dedicated elf
Administrator
Joined
Jun 20, 2009
Messages
1,386
Location
Canberra, ACT, Australia
Sean

Seriously for Vixen2.x i wouldn't bother trying to write the VIX files directly, I respectfully suggest that 99.99% of people will want to incorporate these effects into larger over all sequences involving other elements and the provision of the raw data in a TEXT file based on channels v Time would allow people to paste effects into existing sequences.

If you want to integrate into the app closer then create Routine Files that can then be accessed inside the Vixen UI......

From memory a Routine file and a data text file have the same structure.
Comma seperated channel values, each row is a channel over time.
ie
255,0,255,0,255
255,0,255,0,255

Will flash three channels on-off-on-off-on and if pasted across three channels going to a RGB pixel the flashing would be white.

Phil
 

smeighan

Dedicated elf
Joined
Jan 19, 2012
Messages
1,109
Location
4217 Greenfinch Dr CO 80126
AussiePhil said:
Sean

Seriously for Vixen2.x i wouldn't bother trying to write the VIX files directly, I respectfully suggest that 99.99% of people will want to incorporate these effects into larger over all sequences involving other elements and the provision of the raw data in a TEXT file based on channels v Time would allow people to paste effects into existing sequences.

If you want to integrate into the app closer then create Routine Files that can then be accessed inside the Vixen UI......

From memory a Routine file and a data text file have the same structure.
Comma seperated channel values, each row is a channel over time.
ie
255,0,255,0,255
255,0,255,0,255

Will flash three channels on-off-on-off-on and if pasted across three channels going to a RGB pixel the flashing would be white.

Phil

Hi Phil;


So in my example


Lets use an example. 16 strings, 50 pixels each. I need one channel for r,g,b for each pixel[/size]16x50=3 = 2400 channels. If i have a 5 second sequence with a 50ms frame time, then i have 100 frames.


I am going to have 100 values ( because i have 100 frames) so


100,200,111,122 ... 122 "string 1, Pixel #1, R' , until i printed 100 values?
100,200,111,122 ... 122 "string 1, Pixel #1, G' , until i printed 100 values?
100,200,111,122 ... 122 "string 1, Pixel #1, B' , until i printed 100 values?
100,200,111,122 ... 122 "string 1, Pixel #2, R' , until i printed 100 values?
100,200,111,122 ... 122 "string 1, Pixel #2, G' , until i printed 100 values?




so there would be 2400 lines of ascii and each line would have 100 values, comma separated?


that certainly would be easier.



 

AussiePhil

Dedicated elf
Administrator
Joined
Jun 20, 2009
Messages
1,386
Location
Canberra, ACT, Australia
Sean

absolutely correct, may need to zip/rar it on the fly for download if it gets too big but yes that will work.

Now i'm keen to give it a try

Phil
 

smeighan

Dedicated elf
Joined
Jan 19, 2012
Messages
1,109
Location
4217 Greenfinch Dr CO 80126
AussiePhil said:
Sean

absolutely correct, may need to zip/rar it on the fly for download if it gets too big but yes that will work.

Now i'm keen to give it a try

Phil

I poste dthis on DLA earlier



Ok, here is first pass of a vixen vir file


http://meighan.net/nutcracker_sean/effects/workspaces/f/AA.vir


It was just brought to my attention that the file was csv when it needed to be spaces. I have fixed it. The above link should now have space delimited data



This file should make a picture that looks like this



This was the target
MODEL: AA.dat
target_name AA
total_strings 10
pixel_count 80

pixel_length 240.00
unit_of_measure in
topography UP_DOWN_NEXT <= so each strand has 40 pixels, 2 strands per pixel.




And here was effects settings
_POST
username f
user_target AA
effect_class spirals
effect_name VIXEN_VIR_TEST
handiness r
number_spirals 4
number_rotations 2
spiral_thickness 2
window_degrees 180
start_color #FF147A
end_color #FFF712
frame_delay 5
direction cw
sparkles
use_background y
background_color #80FF84
sequence_duratio 6.5
submit Submit Form to create your target model




I am not releasing the code yet , because any bigger trees uses up all the memory. I will need to put the effect models you create into a database also.


I dont know vixen well enough to see how to check the vir file.


So 10 strings, 80 pixels x 3 channels per pixel = 2400 lines in the vir file.
 

AussiePhil

Dedicated elf
Administrator
Joined
Jun 20, 2009
Messages
1,386
Location
Canberra, ACT, Australia

smeighan

Dedicated elf
Joined
Jan 19, 2012
Messages
1,109
Location
4217 Greenfinch Dr CO 80126
Hi Phil;


I will produce a vir file, a cvs file and a pro file.


I also pasted a vir file and see that I would like the channels to show up as r,g,b colored on each row.




Here is ny first pass at that. I still have something wrong in the profile file, but I am closehttp://meighan.net/nutcracker_sean/effects/workspaces/f/BB.vir
http://meighan.net/nutcracker_sean/effects/workspaces/f/BB.pro
Thanks








AussiePhil said:
Sean


A short reply with a little video for you to watch, it's about 10Mb so give it a chance to download.


Just noticed the name :) it's NOT a virus :) but VIR usage


http://www.incanberra.biz/xmaslights/images/vixenvirusage.mp4


Here's the equivalent data file used for pasting info, same data as your vir file


http://www.incanberra.biz/xmaslights/images/AA-paste.txt


Question asked in video about writing both file types at the same time.


Cheers
Phil
 

AussiePhil

Dedicated elf
Administrator
Joined
Jun 20, 2009
Messages
1,386
Location
Canberra, ACT, Australia
Sean


Vixen 2.1 and Vixen 2.5 profiles are different. I've attached various 2.5 profiles and a 2.1 profile for you to look at.


The ID's should be GUID's even though Vixen2.x doesn't seem to use them.


If your going to write profile info then a field to set start number for the particular model will be needed, I for one have 2 megatrees i would model into the one sequence.


Great Work :)


Cheers
Phil
 

Attachments

smeighan

Dedicated elf
Joined
Jan 19, 2012
Messages
1,109
Location
4217 Greenfinch Dr CO 80126
Nutcracker new release!


There are lots of internal changes. Some animation creations are now 10x faster, some about the same.


You MUST resave your target models!! I have extra columns that need to be added


Follow these steps (its fast, i assure you)


1) Login
2) Go to the target generator tab
3) For each target model you have already created, click the target name (It is under Object Name)
4) Now click on the submit button. "Submit Form to create your target model".
5) When this finishes go back to 2 and repeat for each of your target models. You only have to do this once
6) Now go to the Effects tab and create effects or use existing ones and create some output.
7) You will now see a link below the animated gif, "Click here to make Sequencer Files". If you are ready for a Vixen or HLS file, click away.


Some Caveats:
I will only leave the last files around. The very next time you go into the effects generator, it deletes all *.png, *.dat, *.vir, *.txt, *.hls files. It only leaves the gif files around. This is because you can easily be creating 50-100 mbytes of data and we now have almost 190 users of Nutcracker. Not a big deal. suppose you loaded an effect a week ago, loaded it into Vixen. today you decided to use different colors. Go to the effects screen, change what you want and produce the new vixen files. Now download them to your computer into the Vixen profiles directory and you are set.




Be aware that the thickness argument really slows down the generation of effects. This is because i generate a new png for every spiral that is active. 4 spirals on a 32 strand tree, i make 4 png's. 4 spirals on a 32 strand tree with a thickness setting of 3, i make 12 png files.


I still have a 30 second limit for everything, but i was able to do a 100 string x 100 pixel tree and it did finish. Not too many people have 10,000 pixels and 30,000 channels.




Here is one effect



and the vixen vir file for it
http://meighan.net/nutcracker_sean/effects/workspaces/2/AA+SEAN3.vir


the vixen csv file (this was requested besdes the above space delimited file)
http://meighan.net/nutcracker_sean/effects/workspaces/2/AA+SEAN3.txt




Enjoy
 
Top