Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ build_flags =
${features.build_flags}
-D BUILD_TARGET=\"$PIOENV\"
-D APP_NAME=\"MoonLight\" ; 🌙 Must only contain characters from [a-zA-Z0-9-_] as this is converted into a filename
-D APP_VERSION=\"0.7.0\" ; semver compatible version string
-D APP_DATE=\"20251222\" ; 🌙
-D APP_VERSION=\"0.7.1\" ; semver compatible version string
-D APP_DATE=\"20251223\" ; 🌙

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

Expand Down
10 changes: 5 additions & 5 deletions src/MoonLight/Layers/VirtualLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,19 @@ class VirtualLayer {
// checks if a virtual light is mapped to a physical light (use with XY() or XYZ() to get the indexV)
bool isMapped(int indexV) const { return indexV < mappingTableSize && (mappingTable[indexV].mapType == m_oneLight || mappingTable[indexV].mapType == m_moreLights); }

void blur1d(fract8 blur_amount) {
void blur1d(fract8 blur_amount, uint16_t x = 0) {
// todo: check updated in wled-MM
const uint8_t keep = 255 - blur_amount;
const uint8_t seep = blur_amount >> 1;
CRGB carryover = CRGB::Black;
for (uint16_t i = 0; i < size.x; ++i) {
CRGB cur = getRGB(i);
for (uint16_t i = 0; i < size.y; ++i) {
CRGB cur = getRGB(Coord3D(x, i));
CRGB part = cur;
part.nscale8(seep);
cur.nscale8(keep);
cur += carryover;
if (i) addRGB(i - 1, part);
setRGB(i, cur);
if (i) addRGB(Coord3D(x, i - 1), part);
setRGB(Coord3D(x, i), cur);
carryover = part;
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/MoonLight/Nodes/Effects/E_MoonLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -1558,8 +1558,8 @@ class MarioTestEffect : public Node {

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

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

void onSizeChanged(const Coord3D& prevSize) override {
freeMB(hue);
hue = allocMB<uint8_t>(layer->size.x);
hue = allocMB<uint8_t>(layer->size.y);
if (!hue) {
EXT_LOGE(ML_TAG, "allocate hue failed");
}
Expand All @@ -1586,10 +1586,10 @@ class RingRandomFlowEffect : public RingEffect {
void loop() override {
if (hue) {
hue[0] = random(0, 255);
for (int r = 0; r < layer->size.x; r++) {
for (int r = 0; r < layer->size.y; r++) {
setRing(r, CHSV(hue[r], 255, 255));
}
for (int r = (layer->size.x - 1); r >= 1; r--) {
for (int r = (layer->size.y - 1); r >= 1; r--) {
hue[r] = hue[(r - 1)]; // set this ruing based on the inner
}
// FastLED.delay(SPEED);
Expand All @@ -1605,14 +1605,14 @@ class AudioRingsEffect : public RingEffect {
static const char* tags() { return "♫💫"; }

bool inWards = true;
uint8_t nrOfRings = 7;

void setup() override {
addControl(inWards, "inWards", "checkbox");
addControl(nrOfRings, "rings", "slider", 1, 50);
// addControl(nrOfRings, "rings", "slider", 1, 50);
}

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

Expand Down
Loading