Skip to content

Commit f123b8c

Browse files
committed
v0.7.1, 1D effects x to y-axis conversion
Back end ======== - blur1d: add optional column - MoonLight effects: RingEffect, Audiorings effect - WLED effects: Bouncing balls, tetrix: swap x,y - WLED effects: Rain: y-axis + random over x-axis (still a bug ...) - WLED effects: Drip swap xy and inverse y - WLED effects: DJLightEffect swap xy - Modifier: circle, Pinwheel1D, RippleYZModifier takes y-axis!
1 parent 0c3733e commit f123b8c

File tree

5 files changed

+174
-157
lines changed

5 files changed

+174
-157
lines changed

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ build_flags =
5555
${features.build_flags}
5656
-D BUILD_TARGET=\"$PIOENV\"
5757
-D APP_NAME=\"MoonLight\" ; 🌙 Must only contain characters from [a-zA-Z0-9-_] as this is converted into a filename
58-
-D APP_VERSION=\"0.7.0\" ; semver compatible version string
59-
-D APP_DATE=\"20251222\" ; 🌙
58+
-D APP_VERSION=\"0.7.1\" ; semver compatible version string
59+
-D APP_DATE=\"20251223\" ; 🌙
6060

6161
-D PLATFORM_VERSION=\"pioarduino-55.03.35\" ; 🌙 make sure it matches with above plaftform
6262

src/MoonLight/Layers/VirtualLayer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,19 +211,19 @@ class VirtualLayer {
211211
// checks if a virtual light is mapped to a physical light (use with XY() or XYZ() to get the indexV)
212212
bool isMapped(int indexV) const { return indexV < mappingTableSize && (mappingTable[indexV].mapType == m_oneLight || mappingTable[indexV].mapType == m_moreLights); }
213213

214-
void blur1d(fract8 blur_amount) {
214+
void blur1d(fract8 blur_amount, uint16_t x = 0) {
215215
// todo: check updated in wled-MM
216216
const uint8_t keep = 255 - blur_amount;
217217
const uint8_t seep = blur_amount >> 1;
218218
CRGB carryover = CRGB::Black;
219-
for (uint16_t i = 0; i < size.x; ++i) {
220-
CRGB cur = getRGB(i);
219+
for (uint16_t i = 0; i < size.y; ++i) {
220+
CRGB cur = getRGB(Coord3D(x, i));
221221
CRGB part = cur;
222222
part.nscale8(seep);
223223
cur.nscale8(keep);
224224
cur += carryover;
225-
if (i) addRGB(i - 1, part);
226-
setRGB(i, cur);
225+
if (i) addRGB(Coord3D(x, i - 1), part);
226+
setRGB(Coord3D(x, i), cur);
227227
carryover = part;
228228
}
229229
}

src/MoonLight/Nodes/Effects/E_MoonLight.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,8 +1558,8 @@ class MarioTestEffect : public Node {
15581558

15591559
class RingEffect : public Node {
15601560
protected:
1561-
void setRing(int ring, CRGB colour) { // so britisch ;-)
1562-
layer->setRGB(ring, colour);
1561+
void setRing(int ring, CRGB colour) { // so britisch ;-)
1562+
layer->setRGB(Coord3D(0, ring), colour); // 1D effect on y-axis (default)
15631563
}
15641564
};
15651565

@@ -1577,7 +1577,7 @@ class RingRandomFlowEffect : public RingEffect {
15771577

15781578
void onSizeChanged(const Coord3D& prevSize) override {
15791579
freeMB(hue);
1580-
hue = allocMB<uint8_t>(layer->size.x);
1580+
hue = allocMB<uint8_t>(layer->size.y);
15811581
if (!hue) {
15821582
EXT_LOGE(ML_TAG, "allocate hue failed");
15831583
}
@@ -1586,10 +1586,10 @@ class RingRandomFlowEffect : public RingEffect {
15861586
void loop() override {
15871587
if (hue) {
15881588
hue[0] = random(0, 255);
1589-
for (int r = 0; r < layer->size.x; r++) {
1589+
for (int r = 0; r < layer->size.y; r++) {
15901590
setRing(r, CHSV(hue[r], 255, 255));
15911591
}
1592-
for (int r = (layer->size.x - 1); r >= 1; r--) {
1592+
for (int r = (layer->size.y - 1); r >= 1; r--) {
15931593
hue[r] = hue[(r - 1)]; // set this ruing based on the inner
15941594
}
15951595
// FastLED.delay(SPEED);
@@ -1605,14 +1605,14 @@ class AudioRingsEffect : public RingEffect {
16051605
static const char* tags() { return "♫💫"; }
16061606

16071607
bool inWards = true;
1608-
uint8_t nrOfRings = 7;
16091608

16101609
void setup() override {
16111610
addControl(inWards, "inWards", "checkbox");
1612-
addControl(nrOfRings, "rings", "slider", 1, 50);
1611+
// addControl(nrOfRings, "rings", "slider", 1, 50);
16131612
}
16141613

16151614
void loop() override {
1615+
uint8_t nrOfRings = MAX(layer->size.y, 2); // height of the layer, minimal 2
16161616
for (int i = 0; i < nrOfRings; i++) {
16171617
uint8_t band = ::map(i, 0, nrOfRings - 1, 0, NUM_GEQ_CHANNELS - 1);
16181618

0 commit comments

Comments
 (0)