Structure with brackets and structure ( ) with quotation marks " "

akaioni's picture

Hello

I have a small problem that I cannot figure my way around, I am trying to send some numbers with Kineme's ArtDMX, it works well when the structure is supplied by one of Kineme's Structure Maker, but when I aim to get the structure from any of the Queue patches. The only difference between the two structures is that one has index number written in quotation marks and the others in brackets.

I am now wondering, is the root of the problem that ArtDMX does not want to digest the data because of brackets, how should I avoid it.

I'm posting the screen shots of the patch.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cybero's picture
Re: Structure with brackets and structure ( ) with ...

This is a none problem, all you really need to do is flag and then unflag [Boolean switch would do the job] on the Queue in Parallel's Reset and you should be good to go. Then the channel structure does receive that data, I only have the plugins installed and no DMX equipment to further test upon in regards of 'digestion'

The "" or () makes no difference at all. :-).

Hope that helps.

akaioni's picture
Re: Structure with brackets and structure ( ) with ...

ok, one thing got cleared, the structure I'm sending should be alright even with the (), but the light don't work. I tried to reset the queue tool manually, bu ticking on and off the box, didn't help. Should I make it count structure end reset every time all of queued elements batch passes? or is there some other trick to it? I do receive the structure in the artnet tool input, I can see it but the lights don't change.

cybero's picture
Re: Structure with brackets and structure ( ) with ...

@akoloni I think my advice is limited in applicability due to the fact that I am not sending via a valid subnet to any ArtDMX device. [doesn't help, I know]. If the "" & / or () is a real hang up then you could simply run your structure through this code [via a JS patch] and it will present your bracketed structure from Queues in ArtDMX acceptable or so it would only seem, quoted format.

var array = new Array();
function (__structure DMXStructure) main (__structure QueuedStructure) {
   var result = new Object();
 
   if (QueuedStructure != null) 
   {
      for (i=0; i<QueuedStructure.length; ++i) 
      {
         var value = QueuedStructure[i];
         var lastValue = array[i];
          {
            array[i] = value;
         }
      }
   }
 
   result.DMXStructure = array;
   return result;
}

I'd like to hear if that helps.

Back to marking assignments :-)

PreviewAttachmentSize
ReQuoter.qtz49.37 KB

cybero's picture
Re: Structure with brackets and structure ( ) with ...

Have you checked that you are running a valid for ArtDMX purposes 10. or 2. IP address & 255. subnet ?

gtoledo3's picture
Re: Structure with brackets and structure ( ) with ...

Ditto.

akaioni's picture
Re: Structure with brackets and structure ( ) with ...

worked like magic, thank you

akaioni's picture
Re: Structure with brackets and structure ( ) with ...

yes, yes, it would work with the structure in quotation marks everything works perfectly

akaioni's picture
ArtNet sender indexing problem

I got to the center of the ArtNet sender problem, it does no want to digest properly the number index under "0". I have reported it as a bug, but maybe there is a way in javascript to fix it for now and make the array start from index number "1", until the ArtNet sender can cope with "0" index

usefuldesign.au's picture
Re: Structure with brackets and structure ( ) with ...

what does this line do:

Quote:
var lastValue = array[i];

before the next line. Any reason the next line is in it's own braces?

Thanks

cwright's picture
Re: Structure with brackets and structure ( ) with ...

lastValue looks vestigial. So do the braces (though it's not unheard of to brace out chunks of code, to help block it into functional units without going so far as to create your own functions -- smokris got me hooked on that practice)

cybero's picture
Re: Structure with brackets and structure ( ) with ...

I'd quite forgotten about those unneeded braces.

You can get rid of

var lastValue = array[i];

entirely, & the code still works.

I guess what that means is that the JS does what it needs to and doesn't use what it doesn't :-)

The vestigial line is for when one's creating an array from a set of varying input numbers, which in this case doesn't have a corresponding input / output type set in the main function.

Ergo - not required - can be cut out entirely.

usefuldesign.au's picture
Re: ArtNet sender indexing problem

This is a simple way using the structure Range patch. You'll have to use a dummy value in item 0. If that presents a problem, you may have to go the JS route as I don't think there is a Structure 'merge' or 'push' (to use a JS method name) patch available.

Can anybody tell me why the mouse co-ords are mapping to the cursor when I draw with it? This must be a simple thing I'm missing. Should look at paint.qtz I guess.

PreviewAttachmentSize
Remove first item in structure.qtz5.54 KB

akaioni's picture
Re: ArtNet sender indexing problem

I see where your solution comes from, unfortunately I need to push the whole structure a place further to start from 1. Now the structure starts from 1 but it skips the first number, so not really working.

akaioni's picture
Re: ArtNet sender indexing problem

ok, the range does what it should now, when I added an extra object before array, it chops it nicely from index 1. The ArtNet is still indifferent and does whatever it likes, that is doesn't work. I really need help what is wrong with ArtNet

PreviewAttachmentSize
Screen shot 2010-06-01 at 13.14.43 (2).png
Screen shot 2010-06-01 at 13.14.43 (2).png261.08 KB

usefuldesign.au's picture
Re: ArtNet sender indexing problem

Like I said, you need to create a dummy instance at the start of your structure or use JS  new_array = my_array.concat(dummy_array_1_item_in_size)   method to add in an element at zero that can be wasted by ArtNet.

NB. If structures are in quotes eg. "1": 0.12343 then it is a keyed structure. If it is brackets eg. (1): 0.12344 then it is an indexed structure and applying the Range patch will probably reset it to starting with index as 0 once you chop of the first item. So either leave in in there or make sure you are using Keys not indexes.

Check out the 4 array methods in this comp. The fourth one is the concatenate method for combining two structures. The fifth one outputs the actual structure so you can examine the difference between Keys and Indexs.

PreviewAttachmentSize
Array methods demo patch.qtz31.45 KB

usefuldesign.au's picture
Re: ArtNet sender indexing problem

Mapping was 'fixed' with a quit and restart of QC ;)

usefuldesign.au's picture
Re: Structure with brackets and structure ( ) with ...

Word of the month; vestigial!

gtoledo3's picture
Re: ArtNet sender indexing problem

This is interesting... the patch totally will not restore on my 10.6.4 system.

PreviewAttachmentSize
exception.jpg
exception.jpg71.59 KB
screengrab.jpg
screengrab.jpg215.87 KB

akaioni's picture
Re: ArtNet sender indexing problem

same problems

usefuldesign.au's picture
Re: ArtNet sender indexing problem

Weird. Can you input a structure to a Iterator enable input to force evaluation in 10.6? That's all I was doing with the missing noodles. Maybe those noodles aren't required for the rest of the patch to work though (more vestigialness).

This patch actually loads and plays into Safari for me if I click the link.

Anyhow I don't know jack about ArtNet sorry if this was a bum steer. Was just trying to answer the question which may not be the right question as George says.

gtoledo3's picture
Re: ArtNet sender indexing problem

In my composition, there is nothing inside the iterators when it restores though, so I guess it's more than just the enable connection (?).

akaioni's picture
artnet and iterator

ok, we are probably at the end of our wits with this composition,

What we are aiming to do

Take a picture, crop it spaghetti it to the iterator where the picture is take apart by image pixel remakes it into array of colors and goes out of iterator, then we aim to put the shrunk pixelated image back together pixel by pixel to send into DMX lights as each separate color. All colors make are made into structure with Kineme named structure maker, we queue them parallel(the length of queue being the number of lights, the number of iterations also being the number of lights), push the whole queue by 1 so the actual color values start at indexed number 0 in javascript and it goes into ArtNet.

The Kineme structure maker manually spaghettied input by input works but the number of rows/columns may differ every time and there will be around 30+ lights with 5 inputs for each (5 inputs - R, G, B, Alpha, flashing light<- this one stays 0 so the light is constant), it will take alot of time to change. We need a self populating structure that outputs a full array of pictures. The structure now that comes out of the queue patch has all the same values even if it should take following numbers from iterator.

Do we and can we have artnet in iterator? Is there any idea how to solve this problems, I'm attaching the quartz file.

I am attaching

PreviewAttachmentSize
ArtNet fun.qtz40.34 KB

usefuldesign.au's picture
Re: ArtNet sender indexing problem

No it's just to force evaluation so user can hover the cursor over the outputs from the JS patch and Range patch to see how the Key stays at "1" even though the index falls back to zero.

I hope I'm right in saying all that stuff about quotes being Keys and brackets being Indexes?! the number before "n" just being a QC editor generated list number I guess. Can QC structures have non consecutive indexed structures as in:

<struct>
   <1>
      "Foo"
   </1>   
   <2>
      "Fie"
   </2>
   <4>
      "Fum"
   </4>
</struct>

ie: no <0> and no <3>??

usefuldesign.au's picture
Re: artnet and iterator

Congratulations on posting your comp, the first step in getting meaningful help! I cannot look at it this minute, try to get back to it.