# How to manage 16 bit channel dmx

Hello,

I’m just wondering how to manage 16 bit channel :
A dmx channel is 8 bit ( 0->255).
For a better resolution you can pair 2 channels to get 65536 value.

How would you merge and process the data ?

Thanks.

Xavier

1 Like

I threw this patch together this morning. Unfortunately, I haven’t had time to try it yet. There are a couple ETC Source 4 Revolutions sitting in my living room at the moment, and I plan on verifying everything this evening.

For the LSB I made a Constant Chop 0.-1.>>Math Chop*65536>>Lag Chop (smooth things out)>>Chop to DAT>>Select DAT (select by index to parse out the data you want)>>Evaluate DAT with a wrap expression for 0,255>>DAT to Chop>>Math Chop (rounding integers)>>Select Chop (rename)

For the MSB I just took the 0.-1. from the constant and multiplied by 255

Pretty sure this should work. Like I said, I haven’t had time to test it yet.

Perhaps there is a more elegant way to achieve the same result. I’d love some input from other users. I’m still pretty sloppy with DATs and expressions so I would appreciate any critique.

Just checked this sort of works… I need to figure out a way to interpolate the numbers before the wrap expression so the fine channel doesn’t sit between the coarse channel… I think I am going about this the wrong way completely. I’m reading up on bitwise intersection, and trying to figure out how to do it in touch. A lot of the terminology is foreign to me so it’s going to take a little time, but I’m determined to figure this out. This is probably an elementary problem for those with a programming background…

This likely doesn’t matter to anyone else, but I had the coarse and fine (MSB, LSB, respectively) in the wrong order for the Revolution profile. I’ve updated the patch for consistency.

[FILE DELETED - REFER TO ITARU’S REPLY]

Ok… I’m stumped. I have a number from 0-65535 being converted to a 16bit binary string. I can’t for the life of me figure out how to do a bit shift operation (>> or <<). Is there a way to truncate a string of binary data from a DAT? I just want to intersect the bits between 1024 and 512.

I currently have pan tilt data coming out of that revolution patch via OSC into Max/MSP which allows me to easily bit shift with expressions, and it’s working perfectly. I have to believe there is a way to do this in Touch but I can’t find anything in the man pages.

I’ve included the patch with the conversion. The top function using the format() expression works. The bottom one should work but I think there is a bug with the padzero() expression when evaluating binary data.

[FILE DELETED - REFER TO ITARU’S REPLY]

16to8.3.toe (12.3 KB)

Thank you itaru!

You have exposed me to the power of modulo operations! Thank you, thank you, thank you.

This helps me beyond the aforementioned problem. Greatly appreciated.

Nice. So much simpler than my approach…knew there had to be a simpler way involving a little math

Thank you Itaru, this just saved me from getting completely crazy!

David.

Hi, I do a fair amount of work with DMX, and usually wind up building something for this from scratch on a case by case basis.

Today I was particularly lazy and decided that there must be a canon solution to this. I found this thread, looked at Itaru’s solution and decided to rebuild it without Expression CHOPs (I think they’re a bit more expensive than just math and limit CHOPs).

I also added support for multiple input channels. The component outputs the channels interleaved in a way that makes it suitable for sending data to the dmxout CHOP.

Enjoy

16to8.tox (686 Bytes)

2 Likes

This is a brilliantly simple solution! Love it!