RGBW data for LEDs

Andrew Goddard's icon

Hi there,

Just wondering what might be the best way to create a white channel of output data from a matrix, in addition to RGB, so that I can feed RGBW LEDs? Would I need to create some kind of sum value of the RGB channels?

Cheers,
Andrew

Andrew Goddard's icon

Hi just bumping this as it's a little above my knowledge and I'm having trouble finding any information specific to Max/MSP.

I have found this formula below which seems promising, however I am not sure exactly how to put this into a js object to perform the operation on every pixel of a matrix per frame, or if there might be an easier way to perform this function?

Any suggestions or related tutorials for how to approach this would be greatly appreciated!

Roman Thilenius's icon

many jitter objects support an arbitrary number of dimensions and channels.

with those who dont, you could abuse the alpha channel as "w".

but i wouldnt use jitter objects for single color values.

M = [expr max(max($f1,\$f2),\$f3)] or [pak 0. 0. 0.] -> [maximum]

m = [expr min(min($f1,\$f2),\$f3)] or [pak 0. 0. 0.] -> [minimum]

Wo = [expr (($f2/$f1)<0.5)*(($f2*$f1)/($f1-$f2)) + (($f2/$f1)>=0.5)*($f1)



Rob Ramirez's icon

this is a perfect use case for Gen in jitter (for 4 plane ARGB matrix data we can use jit.pix). the code from the article can be entered with only slight modifications to syntax directly into a gen code box.

i threw this together to demonstrate, but I have no idea if the output is correct so you may have to tweak further:

Max Patch
Copy patch and select New From Clipboard in Max.

Andrew Goddard's icon

Thank you for your responses Roman and Rob!

Before seeing your responses I had actually managed to make a js object run a different code from another article with pretty good results, so I will also try these suggestions and compare. The colour that comes out of the LEDs is always a bit different to what it looks like on the screen, so having a couple of options is a useful comparison :)

Floating Point's icon

this is a patch I did years ago to convert RGB to RGBW for an installation (to illuminate large outdoor structures at night). I think it uses the same or similar conversion algorithm you outlined. I think I got it from a Philips patent document. All done in standard max-jitter objects (no gen or js). May be of some use...

Max Patch
Copy patch and select New From Clipboard in Max.

Dominik Dudek's icon

K parameter doesnt make sense since m can be 0.