Source: Originally shared by Jason Coon I added Stefan Petrick's "Noise Smearing" to


Originally shared by Jason Coon

I added Stefan Petrick’s “Noise Smearing” to Mark Kriegsman’s Fire, and I really like the combination.

Looking good!

Does anybody did this but with just regular led strips, not with the smart matrix?

It’s no difference - it all happens in a 24 bit color space. So the actual output device doesen’t matter.

@Stefan_Petrick stefan i understand that the output can be converted to leds(i) , so it should be some code to delete from the smart matrix, and some code to modify to remap to leds(i) on the 2812 matrix . otherwise it won’t work with the strips , am i wright , ?,

Long story short: I recommend to don’t touch the calculations of the leds array. See it as a “virtual matrix”: Just use a second CRGB array and define a mapping according to your hardware setup. Like custom(i)=leds(…). The only 2 things you need to comment out is LEDS.addLeds<SMART_MATRIX>(leds,NUM_LEDS); and the SM specific color correction (if I remember it right). Add your 2812 controller linked to the custom array instead. Which matrix size are you going to use, @Gustavo_K ?

@Stefan_Petrick stefan, when compiling oi receive no errors, but a warning : ^
noiseSmear.ino: In function ‘void MoveFractionalNoiseX(byte)’:
noiseSmear.ino:336:8: warning: unused variable ‘fractions’ [-Wunused-variable]
noiseSmear.ino: In function ‘void MoveFractionalNoiseY(byte)’:
noiseSmear.ino:398:8: warning: unused variable ‘fractions’ [-Wunused-variable]

and no single led on, they staty just in the previous state ( prior test)
any suggestions ?thanks

Please upload your complete code to Gist or somewhere. We also need detailed informations about your physical led setup + used micrcontroller. Without that informations it´s all just guessing…

@Stefan_Petrick thanks stefan , this is the code link : gnkarn / gist:df9e0a098fea228ff173
it si teensy 3.1, 2812 , serpentine layout in a 30x8 matrix .

@Gustavo_K found that have to set , #define MATRIX_HEIGHT 8 // redefined
#define MATRIX_WIDTH 30 // redefined , because they were defined inside smart matrix , but nothing changed .

@Gustavo_K could it be that im not properly setting the kmatrix coordinates and the physical matrix coordinates?

Please set kMatrixWidth and kMatrixHeight back to 32. The math depends on it.
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalSMD5050); by

FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds2, 30*8).setCorrection(TypicalSMD5050);

Before calling;
you need to copy the calculated data from the CRGB leds into leds2.

So write a copy function which takes the data from the (non serpentine) leds into your serpentine leds2. You will need a second XY function too to do so.

So basically something like (pseudocode)
for x = 0 to 29
for y = 0 to 7
leds2(YOURXY(x,y)) = leds (XY(x,y))

ANd CRGB leds2[kMatrixWidth * kMatrixHeight];
needs to become CRGB leds2[30*8];

@Stefan_Petrick thank you , so the leds array should work on the 32x32 space, and the leds2, on the leds physical space ,?

@Gustavo_K so if leds2 is now the led mapping matrix, it seams that many other functions needs to be changed, in order not to go beyond matrix limits, because the XY translation function is only one ( probably have to make another XY converter , one for leds, and other for leds2?

I understand that there is something still wrong, to make it work with a rectangular matrix …

“probably have to make another XY converter , one for leds, and other for leds2?”

Yes, you need another XY function (with a different name) for leds2.

That´s the trick: leave all the calculations of leds as they are. Just at the very end (before you need to copy SOME of the leds data into leds2. The rectangular leds2 is no problem, because it is smaller than leds. leds has 32*32=1024 entrys. But you copy just 30 columns and just 8 rows from that. So 240 out of 1024 entrys.

Later we can talk about a more sophisticated mapping which basically scales the 3232 into your 308. (It´s not trivial - when I did it the first time it took me 2 days…)

But for now I suggest to really just copy a part of leds into leds2.

I will be offline for (at least) 2 days - so good luck and cheers for now!

@Stefan_Petrick ok, just up`dating , a third leds matrix is needed, leds was the smart matrix physical, now is the output “simulated” matrix, leds2 is an intermediate matrix, and leds3 is the output physical matrix , is now working but i have to check if other mods are needed , as the effects are nowhere near , the originals … !!