Millis() zu langsam

Hallo leute.
Ich habe zwei Nanos, die über 3Min halbwegs synchron laufen sollen.
Sollte normal nicht das Thema sein.
Jetzt ist einer der Nanos aber massiv langsamer, das mir am Eine gut 20sek fehlen.
Am Nano liegt es nicht. Wenn ich die 2 vertausche wandert der Fehler auf dem Anderen Nano.
Was bringt in dem Sketch millis dazu langsamer zu laufen?
Dachte immer darauf hat man keinen Einfluß.


#include <Adafruit_NeoPixel.h>
#include "Arduino.h"

const byte stripes = 7;
const byte pins = 7, pin_wings1 = 13, pin_wings2 = 12, henryPin = 3, kleidPin = 5, kleidmotorBPin = 11 , kleidmotorAPin = 10, philPin = 6, aerialingePin = 9, nano1Pin = 2, nano3Pin = A3,
           CW = 1, CCW = 2, protectors = 1, gelb_rot = 1, blau_gelb = 2, blau_rot = 3, gelb_weiss = 4, rot_blau = 5, rot_gelb = 6, Colors = 6;
const byte ledPin[pins] = {3, 5, 6, 7, 9, 10, 11};
bool done [160], play = false;
const int shift = 300;
unsigned long lz_count = 0, bl_count = 0, sharp_count = 0;
enum effekts {fl_blink, fm_fl, fm_fr, fm_stp, fm_1, fm_2, fm_3, fm_4, fm_5, fm_1_5,
              fm_2_4, fm_all, c_fl, c_fr, c_stp, c_1, c_2, c_3, c_4, c_1_4,
              c_2_3, c_all, gf_stp, gf_1, gf_2, gf_all, spk_stp, start, stopp
             };
const byte brightness_wings = 40;
uint32_t colors;
const byte NUM_LEDS = 72;
int16_t blink_fc, blink_speed, blink_val, sharp_val, meteor_val, spk_val, rainbow_val, wing_color;
byte sparkles_value[NUM_LEDS];
bool sparkles_fade[NUM_LEDS];
bool sparkles_on;
bool sharp_on;
byte meteor_value[NUM_LEDS];
byte meteor_fo[NUM_LEDS];
byte meteor_on;
bool meteor_on_strip[stripes] = {0, 0, 0, 0, 0, 0, 0};
bool meteor_safe;
bool meteor_fade[NUM_LEDS];
unsigned long meteor_time[stripes] = {0, 0, 0, 0, 0, 0, 0};
unsigned long meteor_safe_time[stripes] = {0, 0, 0, 0, 0, 0, 0};
bool pixel[NUM_LEDS];
bool pixel2[NUM_LEDS];
const byte NUM_LEDs[] = {17, 10, 10, 10, 9, 8, 8};
const byte stripe[stripes][17] = {{0, 1, 2, 3, 4, 5, 6, 7, 16, 25, 26, 36, 37, 38, 49, 60, 61},
  {62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 0, 0, 0, 0, 0, 0},
  {50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 0, 0, 0, 0, 0, 0, 0},
  {39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, 0, 0, 0},
  {27, 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 0, 0, 0, 0},
  {17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, 0},
  {8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0}
};
const byte stripe_2[stripes][17] = {{0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 26, 27, 37, 38, 49, 50, 61},
  {62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 0, 0, 0, 0, 0, 0},
  {51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, 0, 0, 0, 0, 0, 0},
  {39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, 0, 0, 0},
  {28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0},
  {18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0},
  {8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0}
};
const byte gamma_steps = 3;
const float gamma_blink [] {0, 255, 0, 0};

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, pin_wings1, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip_2 = Adafruit_NeoPixel(NUM_LEDS, pin_wings2, NEO_GRB + NEO_KHZ800);

void setup() {

  for (int i = 0; i < pins; i++) {
    pinMode(ledPin[i], OUTPUT);
  }
  pinMode(nano1Pin, INPUT);
  Serial.begin(9600);
  track_reset(0);
  wing_color = random(1, Colors);
  randomSeed(analogRead(6));
  strip.begin();
  strip.setBrightness(brightness_wings);
  strip.show();
  strip_2.begin();
  strip_2.setBrightness(brightness_wings);
  strip_2.show();
}

void loop() {

  play = digitalRead(nano1Pin);
  strip.show();
  strip_2.show();
  strip.clear();
  strip_2.clear();
  Serial.print(millis());
  Serial.print(" ");
  Serial.println(millis() - lz_count);
  if (play) {
    digitalWrite(nano3Pin, HIGH);
    protect();
  } else {
    no_track();
    digitalWrite(nano3Pin, LOW);
    if (blink_val == 0 && sharp_val == 0) wing_color = random(1, Colors);
    lz_count = millis();
  }
  if (sharp_val > 0)sharpen(sharp_val, wing_color);
  for (byte i = 0; i < stripes; i++) {
    if (meteor_on_strip[i] || meteor_val > 0) {
      if (!meteor_safe) {
        meteor_safe = !meteor_safe;
        for (byte i = 0; i < stripes; i++) {
          meteor_time[i] = millis() - meteor_safe_time[i];
        }
      }
      meteor(meteor_val, 7);
    }
  }
  if (meteor_on == 0 && meteor_safe && meteor_val <= 0) {
    meteor_safe = !meteor_safe;
    for (byte i = 0; i < stripes; i++) {
      meteor_safe_time[i] = millis() - meteor_time[i];
    }
  }
  if (spk_val > 0)sparkles(spk_val);
  if (blink_val > 0) blink(blink_val, wing_color, 200);
  for (byte i = 0; i < NUM_LEDS; i++) {
    pixel[i] = false;
  }
}

void protect() {

  if ((millis() - lz_count > 0 && millis() - lz_count < 91309)
      || (millis() - lz_count > 116070 && millis() - lz_count < 162234)) {
    fade(blink_val, 0, 20);
  } else {
    fade(blink_val, 0, 10);
  }
  fade(blink_fc, 0, 0);
  if (millis() - lz_count > 12170 && millis() - lz_count < 161996) {
    fade(sharp_val, 0, 5);
  } else {
    fade(sharp_val, 0, 5);
  }
  if (millis() - lz_count > 2000 && millis() - lz_count < 10000) {
    fade(spk_val, 0, 0);
  } else {
    fade(spk_val, 0, 0);
  }
  if (millis() - lz_count > 91309 && millis() - lz_count < 116070) {
    fade(meteor_val, 180, 0);
  } else {
    fade(meteor_val, 0, 0);
  }
  henry(0);
  phil(0);
  aerial_inge(0);
  kleid(0);
  motor(0);
}

void no_track() {

  fade(blink_fc, 140, 5);
  fade(blink_val, 0, 5);
  fade(sharp_val, 0, 2);
  fade(rainbow_val, 0, 5);
  fade(spk_val, 5, 0);
  fade(meteor_val, 0, 2);
  henry(1);
  phil(1);
  aerial_inge(1);
  kleid(1);
  motor(0);
}

void fade(int &var, byte wert, byte var_speed) {
  if (var_speed > 0) {
    if (var < wert && millis() > bl_count ) {
      var++;
      bl_count = millis() + var_speed;
    }
    if (var > wert && millis() > bl_count) {
      var--;
      bl_count = millis() + var_speed;
    }
  } else {
    var = wert;
  }
}

void henry(bool an) {

  if (an) analogWrite(henryPin, random(127, 255));
  if (!an)digitalWrite(henryPin, LOW);
}

void kleid(bool an) {

  if (an) analogWrite(kleidPin, random(127, 230));
  if (!an)digitalWrite(kleidPin, LOW);
}

void phil(bool an) {

  if (an) analogWrite(philPin, random(127, 230));
  if (!an)digitalWrite(philPin, LOW);
}

void aerial_inge(bool an) {

  if (an) analogWrite(aerialingePin, random(127, 255));
  if (!an)digitalWrite(aerialingePin, LOW);
}

void motor(bool an) {

  static bool dir = true;
  static bool direct_change = true;
  static unsigned long motor_time;
  static int motor_runtime = 15000;
  if (an) {
    if (millis() < motor_time + motor_runtime) {
      digitalWrite(kleidmotorAPin, dir);
      digitalWrite(kleidmotorBPin, !dir);
      direct_change = true;
    } else {
      if (direct_change) {
        dir = !dir;
        direct_change = false;
        motor_runtime = random(12000, 24000);
        motor_time = millis() - 1000;
      }
      digitalWrite(kleidmotorAPin, LOW);
      digitalWrite(kleidmotorBPin, LOW);
    }
  }
  if (!an) {
    digitalWrite(kleidmotorAPin, LOW);
    digitalWrite(kleidmotorBPin, LOW);
  }
}

void track_reset(unsigned long p_reset) {

  if (millis() - lz_count > p_reset) {
    play = false;
    Serial.println("Player reset");
    for (unsigned int i = 0; i < sizeof(done); i++) {
      done[i] = false;
    }
  }
}

//----------blink--------------------------
void blink(byte blink_intens, byte blink_color, byte speed_blink) {

  static unsigned long blink_time;
  static byte Pixel;
  static byte blink_run;
  static float blinkred;
  static float blinkgreen;
  static float blinkblue;
  int bl_speed;
  float value = blink_intens;
  static byte blink_red, blink_green, blink_blue;
  blink_speed = speed_blink;
  if (blink_speed > 127) bl_speed = map(blink_speed, 128, 255, 150, 30);
  if (blink_speed <= 127) bl_speed = map(blink_speed, 0, 127, 30, 150);
  if (blink_color == 1 || blink_color == 4) {
    blink_red = 170;
    blink_green = 128;
    blink_blue = 0;
  }
  if (blink_color == 2 || blink_color == 3) {
    blink_red = 0;
    blink_green = 0;
    blink_blue = 170;
  }
  if (blink_color == 5 || blink_color == 6) {
    blink_red = 170;
    blink_green = 0;
    blink_blue = 0;
  }
  for (byte j = 0; j < stripes; j++) {
    byte fade = NUM_LEDs[j];
    //  if (fire_end > 0) fade = NUM_LEDs[j] - fire_end;
    for (byte i = 0; i <= fade; i++) {
      if (!pixel[stripe[j][NUM_LEDs[j] - i]]) {
        blinkred = blink_red * (intensity(Pixel) / 255) * (value / 255);
        blinkgreen = blink_green * (intensity(Pixel) / 255) * (value / 255);
        blinkblue = blink_blue * (intensity(Pixel) / 255) * (value / 255);
        strip.setPixelColor(stripe[j][NUM_LEDs[j] - i], strip.Color(blinkred, blinkgreen, blinkblue));
        strip_2.setPixelColor(stripe_2[j][NUM_LEDs[j] - i], strip_2.Color(blinkred, blinkgreen, blinkblue));
      }
      Pixel == gamma_steps ? Pixel = 0 : Pixel++;
      pixel[stripe[j][NUM_LEDs[j] - i]] = true;
    }
  }
  if (blink_speed > 127) {
    if (blink_run <= gamma_steps) {
      if (millis() - bl_speed > blink_time) {
        blink_run ++;
        blink_time = millis();
      }
      Pixel = gamma_steps - blink_run;
    } else {
      blink_run = 0;
      Pixel = gamma_steps - blink_run;
    }
  }
  if (blink_speed <= 127) {
    if (blink_run > 0) {
      if (millis() - bl_speed > blink_time) {
        blink_run --;
        blink_time = millis();
      }
      Pixel = gamma_steps - blink_run;
    } else {
      blink_run = gamma_steps;
      Pixel = gamma_steps - blink_run;
    }
  }
}
float intensity(byte Pixel) {

  static float value;
  value = gamma_blink[Pixel] > blink_fc ? gamma_blink[Pixel] : blink_fc;
  return value;
}

//----------rainbow---------------------
void rainbow() {

  byte value = 200;
  int rgb_speed = -150;
  byte fade_in = NUM_LEDS;
  byte fade_out = 0;
  static uint32_t firstPixelHue = 0;
  static byte NUMLEDS;
  NUMLEDS = NUM_LEDS;
  for (unsigned int Pixel = fade_out; Pixel < fade_in; Pixel++) {
    int pixelHue = firstPixelHue + (Pixel * 65536L / NUMLEDS);
    strip.setPixelColor(Pixel, strip.gamma32(strip.ColorHSV(pixelHue, 255, value)));
    strip_2.setPixelColor(Pixel, strip_2.gamma32(strip_2.ColorHSV(pixelHue, 255, value)));
  }
  firstPixelHue += rgb_speed;
}

//----------sharpen--------------------------
void sharpen (byte sharp_intens, byte sharp_color) {

  static byte sharp_red, sharp_green, sharp_blue;
  if (sharp_color == 1 || sharp_color == 3) {
    sharp_red = sharp_intens;
    sharp_green = 0;
    sharp_blue = 0;
  }
  if (sharp_color == 2 || sharp_color == 6) {
    sharp_red = sharp_intens;
    sharp_green = sharp_intens;
    sharp_blue = 0;
  }
  if (sharp_color == 5) {
    sharp_red = 0;
    sharp_green = 0;
    sharp_blue = sharp_intens;
  }
  if (sharp_color == 4) {
    sharp_red = sharp_intens;
    sharp_green = sharp_intens;
    sharp_blue = sharp_intens;
  }
  for (byte i = 1; i < stripes; i++) {
    if (!pixel[stripe[i][NUM_LEDs[i] - 1]]) strip.setPixelColor(stripe[i][NUM_LEDs[i] - 1], sharp_red, sharp_green, sharp_blue);
    if (!pixel[stripe[i][NUM_LEDs[i] - 1]]) strip_2.setPixelColor(stripe_2[i][NUM_LEDs[i] - 1], sharp_red, sharp_green, sharp_blue);
    pixel[stripe[i][NUM_LEDs[i] - 1]] = true;
  }
}

//----------sparkles--------------------------
void sparkles(byte sparkles_intens) {

  static unsigned long sparkles_zeit;
  static unsigned long sparkles_fadetime;
  static unsigned long sparkles_start;
  byte fade_count = 0;
  byte Pixel = random(NUM_LEDS);
  int value = map(sparkles_intens, 1, 255, 500, 0);;
  byte value_fo = map(sparkles_intens, 1, 255, 6, 200);;

  if (millis() - value_fo > sparkles_fadetime) {
    for (byte Pixel_fade = 0; Pixel_fade < NUM_LEDS; Pixel_fade++) {
      byte pixelfade;
      pixelfade = sparkles_fadeout(Pixel_fade);
      if (sparkles_fade[Pixel_fade]) {
        strip.setPixelColor(Pixel_fade, pixelfade, pixelfade, pixelfade);
        strip_2.setPixelColor(Pixel_fade, pixelfade, pixelfade, pixelfade);
      }
      fade_count += sparkles_fade[Pixel_fade];
    }
    if ((!pixel[Pixel]) && millis() - sparkles_zeit > sparkles_start) {
      strip.setPixelColor(Pixel, 0xffffff);
      sparkles_value[Pixel] = 255;
      pixel[Pixel] = true;
      sparkles_fade[Pixel] = true;
      sparkles_zeit = millis();
      sparkles_start = random(0, value);
    }
    sparkles_on = fade_count > 0 ? true : false;
    sparkles_fadetime = millis();
  } else {
    for (byte Pixel_fade = 0; Pixel_fade < NUM_LEDS; Pixel_fade++) {
      if (sparkles_fade[Pixel_fade]) {
        strip.setPixelColor(Pixel_fade, sparkles_value[Pixel_fade], sparkles_value[Pixel_fade], sparkles_value[Pixel_fade]);
        strip_2.setPixelColor(Pixel_fade, sparkles_value[Pixel_fade], sparkles_value[Pixel_fade], sparkles_value[Pixel_fade]);
        pixel[Pixel_fade] = true;
      }
    }

  }
}
byte sparkles_fadeout(byte Pixel) {
  if (sparkles_value[Pixel] > 12) {
    pixel[Pixel] = true;
    sparkles_value[Pixel] -= 12;
  } else {
    sparkles_value[Pixel] = 0;
    sparkles_fade[Pixel] = false;
  }
  return sparkles_value[Pixel];
}

//----------meteor---------------------
void meteor(byte speed_meteor, byte meteor_interval) {

  static unsigned long meteor_time_on[] = {0, 500, 1200, 1600, 200, 2000, 800};
  static unsigned long meteor_fadetime;
  static byte meteor_incr[] = {0, 0, 0, 0, 0, 0, 0};
  static byte meteor_interval_safe;
  int fade_count[] = {0, 0, 0, 0, 0, 0, 0};
  static bool meteor_done[] = {0, 0, 0, 0, 0, 0, 0};
  byte meteor_speed = map(speed_meteor, 1, 255, 150, 5);
  //byte meteor_interval = map(dmx_value[17], 0, 255, 1, 10);
  if (millis() - (meteor_speed) > meteor_fadetime) {
    for ( byte i = 0; i < stripes; i++) {
      if (meteor_on_strip[i]) {
        for (byte Pixel = 0; Pixel < NUM_LEDs[i]; Pixel++) {
          if (meteor_fade[stripe[i][Pixel]]) {
            meteor_value[stripe[i][Pixel]] = meteor_fadeout(stripe[i][Pixel]);
            strip.setPixelColor(stripe[i][Pixel] , meteor_value[stripe[i][Pixel]], meteor_value[stripe[i][Pixel]], meteor_value[stripe[i][Pixel]]);
            strip_2.setPixelColor(stripe[i][Pixel] , meteor_value[stripe[i][Pixel]], meteor_value[stripe[i][Pixel]], meteor_value[stripe[i][Pixel]]);
          }
          fade_count[i] += meteor_fade[stripe[i][Pixel]];
        }
        if (!meteor_done[i]) {
          strip.setPixelColor( stripe[i][meteor_incr[i]] , 0xfffff);
          strip_2.setPixelColor( stripe[i][meteor_incr[i]] , 0xfffff);
          if (meteor_incr[i] < NUM_LEDs[i]) {
            pixel[stripe[i][meteor_incr[i]]] = true;
            meteor_fade[stripe[i][meteor_incr[i]]] = true;
            meteor_value[stripe[i][meteor_incr[i]]] = 255;
            meteor_fo[stripe[i][meteor_incr[i]]] = random(10, 150);
          }
        }
        if (meteor_incr[i] < NUM_LEDs[i] - 1) {
          meteor_incr[i] ++;
        } else {
          meteor_incr[i] = 0;
          meteor_done[i] = true;
          if (!fade_count[i]) {
            meteor_time[i] = millis();
            meteor_time_on[i] = random(4000 / meteor_interval, 17000 / meteor_interval);
            meteor_done[i] = false;
            meteor_on_strip[i] = false;
            meteor_interval_safe = meteor_interval;
          }
        }
      } else {
        if (meteor_interval_safe != meteor_interval) {
          meteor_time[i] = millis();
          meteor_time_on[i] = random(4000 / meteor_interval, 17000 / meteor_interval);
          meteor_interval_safe = meteor_interval;
        }
      }
      if (millis() - meteor_time[i] > meteor_time_on[i]) {
        meteor_on_strip[i] = true;
      }

      meteor_fadetime = millis();
    }
  } else {
    for (byte Pixel = 0; Pixel < NUM_LEDS; Pixel++) {
      if (meteor_fade[Pixel]) {
        strip.setPixelColor(Pixel , meteor_value[Pixel], meteor_value[Pixel], meteor_value[Pixel]);
        strip_2.setPixelColor(Pixel , meteor_value[Pixel], meteor_value[Pixel], meteor_value[Pixel]);
        pixel[Pixel] = true;
      }
    }
  }
}
byte meteor_fadeout(byte Pixel) {
  if (meteor_value[Pixel] > meteor_fo[Pixel]) {
    pixel[Pixel] = true;
    meteor_value[Pixel] -= meteor_fo[Pixel];
  } else {
    meteor_value[Pixel] = 0;
    meteor_fade[Pixel] = false;
  }
  return meteor_value[Pixel];
}

wie sieht der zweite Sketch aus.

Der andere läuft richtig.
Die spielen nen Timecode zu nem Lied ab.
Beim ersten kann ich die Zeiten die ich brauche eintragen und alles passt.
Beim zweiten gurk ich massiv hinterher.

#include "Arduino.h"
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
#include <SoftPWM.h>

SoftwareSerial mySoftwareSerial(10, 11);
DFRobotDFPlayerMini myDFPlayer;


const byte pins = 14, buttonPin = A2, led_buttonPin = 9, nano2Pin = 13, pin_fm1 = 12, pin_fm2 = 8,
           pin_fm3 = 2, pin_fm4 = 6, pin_fm5 = 5, pin_c1 = A1, pin_c2 =  A0, pin_c3 = A4, pin_c4 = A5,
           pin_gf1 = 4, pin_gf2 = A3, pin_spk1 = 7  , pin_spk2 = 3, protectors = 1;
const byte ledPin[pins] = {A0, A1, A3, A4, A5, 2, 4, 5, 6, 7, 8, 9, 12, 13};
const bool player = true;
bool done [159], play = false;
const int shift = 300;
byte brightness_button = 255;
unsigned long lz_count = 0;
enum effekts {fm_fl, fm_fr, fm_stp, fm_1, fm_2, fm_3, fm_4, fm_5, fm_1_5,
              fm_2_4, fm_all, c_fl, c_fr, c_stp, c_1, c_2, c_3, c_4, c_1_4,
              c_2_3, c_all, gf_stp, gf_1, gf_2, gf_all, spk_stp, start, stopp
             };

void setup() {

  mySoftwareSerial.begin(9600);
  Serial.begin(9600);
  Serial.println(F("Initializing Player ... (May take 3~5 seconds)"));
  if (!myDFPlayer.begin(mySoftwareSerial) && player) {  //Use softwareSerial to communicate with mp3.
    Serial.println(F("Unable to begin:"));
    Serial.println(F("1.Please recheck the connection!"));
    Serial.println(F("2.Please insert the SD card!"));
    while (true);
  }
  Serial.println(F("Player Mini online."));
  myDFPlayer.setTimeOut(500);
  myDFPlayer.volume(25);  //Set volume value. From 0 to 30
  myDFPlayer.EQ(DFPLAYER_EQ_NORMAL);
  myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD);
  player_reset(0);
  SoftPWMBegin();
  for (int i = 0; i < pins; i++) {
    pinMode(ledPin[i], OUTPUT);
    if (i < 13)SoftPWMSet(ledPin[i], 0);
  }
  SoftPWMSetFadeTime(ALL, 50, 100);
  SoftPWMSetFadeTime(led_buttonPin, 1000, 1500);
  pinMode(buttonPin, INPUT_PULLUP);
  digitalWrite(nano2Pin, LOW);

}

void loop() {

  if (play) {
    protect();
  } else {
    button_blink(2500);
    if (digitalRead(buttonPin) == LOW) {
      play = true;
      digitalWrite(nano2Pin, HIGH);
      player_start(protectors);
      delay(shift);
      lz_count = millis();
      SoftPWMSet(led_buttonPin, 255);
    }
  }
}

void player_start(byte track) {

  if (player) myDFPlayer.play(track);
  Serial.print("Play Track: ");
  if (track = protectors); Serial.println("Protectors Of The Earth");
}

void player_reset(unsigned long p_reset) {

  if (millis() - lz_count > p_reset) {
    play = false;
      digitalWrite(nano2Pin, LOW);
    Serial.println("Player reset");
    for (unsigned int i = 0; i < sizeof(done); i++) {
      done[i] = false;
    }
  }
}

void button_blink(int blink_speed) {

  static unsigned long startZeit;
  static bool turn = false;
  if (millis() > startZeit + blink_speed) {
    if (!turn) SoftPWMSet(led_buttonPin, 255);
    if (turn) SoftPWMSet(led_buttonPin, 0);
    turn = !turn;
    startZeit = millis();
  }
}

void protect() {

  fx(gf_all , 1, 0,  13110, 1);
  fx(c_1_4  , 1, 0,  16380, 2);
  fx(c_2_3  , 1, 0,  19550, 3);
  fx(gf_all , 1, 0,  22880, 4);
  fx(fm_3   , 1, 0,  26200, 5);
  fx(fm_2_4 , 1, 0,  25930, 6);
  fx(c_1_4  , 1, 0,  26200, 7);
  fx(fm_1_5 , 1, 0,  26200, 8);
  fx(c_2_3  , 1, 0,  29470, 9);
  fx(c_all  , 1, 0,  32740, 10);
  fx(gf_all , 1, 0,  36060, 11);
  fx(c_1    , 6, 0,  39280, 12);
  fx(c_2    , 6, 0,  40920, 13);
  fx(c_3    , 6, 0,  42550, 14);
  fx(c_4    , 6, 0,  44190, 15);
  fx(c_all  , 1, 0,  45830, 16);
  fx(c_1    , 2, 0,  46640, 17);
  fx(c_2    , 2, 0,  47460, 18);
  fx(c_3    , 2, 0,  48280, 19);
  fx(c_4    , 2, 0,  49100, 20);
  fx(c_3    , 2, 0,  49920, 21);
  fx(c_2    , 2, 0,  50730, 22);
  fx(c_1    , 2, 0,  51550, 23);
  fx(c_all  , 1, 0,  52370, 24);
  fx(fm_all , 1, 0,  52370, 25);
  fx(gf_1   , 2, 0,  54000, 26);
  fx(gf_2   , 2, 0,  55640, 27);
  fx(c_1    , 3, 0,  57280, 28);
  fx(c_4    , 3, 0,  58090, 29);
  fx(c_all  , 1, 0,  58910, 30);
  fx(fm_all , 1, 0,  58910, 31);
  fx(c_1    , 2, 0,  59730, 32);
  fx(c_2    , 2, 1,  550, 33);
  fx(c_3    , 2, 1,  1370, 34);
  fx(c_4    , 2, 1,  2180, 35);
  fx(c_3    , 2, 1,  3000, 36);
  fx(c_2    , 2, 1,  3820, 37);
  fx(c_1    , 2, 1,  4640, 38);
  fx(fm_all , 1, 1,  5460, 39);
  fx(fm_all , 1, 1,  5460, 40);
  fx(c_all  , 1, 1,  5460, 41);
  fx(c_1    , 1, 1,  6270, 42);
  fx(c_all  , 1, 1,  7090, 43);
  fx(c_2    , 1, 1,  7910, 44);
  fx(c_all  , 1, 1,  8930, 45);
  fx(gf_all , 1, 1,  8930, 46);
  fx(c_3    , 1, 1,  9540, 47);
  fx(c_all  , 1, 1,  10360, 48);
  fx(c_4    , 1, 1,  11180, 49);
  fx(c_all  , 1, 1,  12000, 50);
  fx(fm_1_5 , 1, 1,  12000, 51);
  fx(c_3    , 1, 1,  12820, 52);
  fx(c_all  , 1, 1,  13630, 53);
  fx(c_2    , 1, 1,  14450, 54);
  fx(c_all  , 1, 1,  15270, 55);
  fx(fm_2_4 , 1, 1,  15270, 56);
  fx(c_1    , 1, 1,  16090, 57);
  fx(c_all  , 1, 1,  16910, 58);
  fx(c_2    , 1, 1,  17920, 59);
  fx(c_all  , 1, 1,  18540, 60);
  fx(fm_3   , 1, 1,  18540, 61);
  fx(c_3    , 1, 1,  19360, 62);
  fx(c_all  , 1, 1,  20180, 63);
  fx(c_4    , 1, 1,  21000, 64);
  fx(c_all  , 1, 1,  21820, 65);
  fx(fm_2_4 , 1, 1,  21820, 66);
  fx(c_3    , 1, 1,  22630, 67);
  fx(c_all  , 1, 1,  23450, 68);
  fx(c_2    , 1, 1,  24270, 69);
  fx(c_all  , 1, 1,  25080, 70);
  fx(fm_1_5 , 1, 1,  25080, 71);
  fx(c_1    , 1, 1,  25900, 72);
  fx(c_all  , 1, 1,  26720, 73);
  fx(c_2    , 1, 1,  27540, 74);
  fx(c_all  , 1, 1,  28360, 75);
  fx(fm_3   , 1, 1,  28360, 76);
  fx(c_3    , 1, 1,  29170, 77);
  fx(c_all  , 3, 1,  29990, 78);
  fx(c_all  , 5, 1,  31220, 79);
  fx(fm_all , 5, 1,  31220, 80);
  fx(gf_all , 5, 1,  31220, 81);
  //fx(spk_stp, 2, 1,  31220, 82, start);
  //fx(spk_stp, 2, 1,  36700, 82, stopp);
  fx(c_1    , 1, 1, 44710, 83);
  fx(c_2    , 1, 1, 48090, 84);
  fx(c_3    , 1, 1, 51260, 85);
  fx(c_4    , 1, 1, 54530, 86);
  fx(c_stp  , 1, 1, 56160, 87, start);
  fx(gf_stp , 1, 1, 59440, 88, start);
  fx(fm_stp , 1, 1, 59440, 89, start);
  fx(c_stp  , 1, 2, 2310, 87, stopp);
  fx(gf_stp , 1, 2, 2310, 88, stopp);
  fx(fm_stp , 1, 2, 2310, 89, stopp);
  fx(c_1    , 5, 2, 2710, 90);
  fx(c_2    , 5, 2, 2710, 91);
  fx(fm_5   , 5, 2, 2710, 92);
  fx(c_3    , 5, 2, 3530, 93);
  fx(c_4    , 5, 2, 3530, 94);
  fx(fm_1   , 5, 2, 3530, 95);
  fx(c_fl   , 1, 2, 4340, 96);
  fx(fm_1_5 , 5, 2, 4340, 97);
  fx(c_fr   , 1, 2, 5160, 98);
  fx(fm_2_4 , 5, 2, 5160, 99);
  fx(c_1_4  , 5, 2, 5980, 100);
  fx(fm_fl  , 1, 2, 5980, 101);
  fx(c_2_3  , 5, 2, 6800, 102);
  fx(fm_fr  , 1, 2, 6800, 103);
  fx(fm_1   , 3, 2, 7620, 104);
  fx(gf_2   , 1, 2, 7620, 105);
  fx(c_1_4  , 3, 2, 8430, 106);
  fx(fm_5   , 3, 2, 9250, 107);
  fx(gf_1   , 1, 2, 9250, 108);
  fx(c_stp  , 1, 2, 12520, 109, start);
  fx(gf_stp , 1, 2, 14160, 110, start);
  fx(fm_stp , 1, 2, 14160, 111, start);
  fx(c_stp  , 1, 2, 15600, 109, stopp);
  fx(gf_stp , 1, 2, 15600, 110, stopp);
  fx(fm_stp , 1, 2, 15600, 111, stopp);
  fx(c_1    , 5, 2, 15790, 112);
  fx(c_2    , 5, 2, 15790, 113);
  fx(fm_5   , 3, 2, 15790, 114);
  fx(fm_all , 1, 2, 16610, 115);
  fx(c_all  , 1, 2, 16610, 116);
  fx(c_3    , 5, 2, 17430, 117);
  fx(c_4    , 5, 2, 17430, 118);
  fx(fm_1   , 3, 2, 17430, 119);
  fx(c_all  , 1, 2, 18250, 120);
  fx(fm_fl  , 1, 2, 19070, 121);
  fx(gf_2   , 2, 2, 19070, 122);
  fx(fm_fr  , 1, 2, 20660, 123);
  fx(gf_1   , 2, 2, 20660, 124);
  fx(c_1_4  , 3, 2, 22340, 125);
  fx(gf_2   , 2, 2, 22340, 126);
  fx(c_all  , 1, 2, 23150, 127);
  fx(c_2_3  , 3, 2, 23970, 128);
  fx(gf_1   , 2, 2, 23970, 129);
  fx(c_all  , 1, 2, 24800, 130);
  fx(fm_fl  , 1, 2, 25610, 131);
  fx(gf_2   , 2, 2, 25610, 132);
  fx(fm_fr  , 1, 2, 27250, 133);
  fx(gf_1   , 2, 2, 27250, 134);
  fx(gf_2   , 2, 2, 27870, 135);
  fx(c_1_4  , 3, 2, 27870, 136);
  fx(c_all  , 1, 2, 29700, 137);
  fx(c_2_3  , 1, 2, 30520, 138);
  fx(gf_2   , 2, 2, 30520, 139);
  fx(c_all  , 1, 2, 31340, 140);
  fx(c_fl   , 2, 2, 32150, 141);
  fx(gf_2   , 2, 2, 32150, 142);
  fx(c_fr   , 2, 2, 33780, 143);
  fx(gf_1   , 2, 2, 33780, 144);
  fx(c_1    , 3, 2, 35420, 145);
  fx(c_2    , 3, 2, 35420, 146);
  fx(gf_2   , 2, 2, 35420, 147);
  fx(c_3    , 3, 2, 36250, 148);
  fx(c_4    , 3, 2, 36250, 149);
  fx(gf_1   , 2, 2, 36250, 150);
  fx(c_all  , 1, 2, 37880, 151);
  fx(c_fl   , 2, 2, 38690, 152);
  fx(gf_2   , 2, 2, 38690, 153);
  fx(c_all  , 1, 2, 40330, 154);
  fx(c_all  , 5, 2, 41140, 155);
  fx(c_all  , 7, 2, 41960, 156);
  fx(fm_all , 7, 2, 41960, 157);
  fx(gf_all , 10, 2, 41960, 158);
  //fx(spk_stp, 2, 2, 41960, 159, start);
  //fx(spk_stp, 1, 2, 48960, 159, stopp);
  player_reset(167000);
}

void fx(effekts effekt, byte dauer, byte Min, unsigned long Sec, int number) {

  static unsigned long timer = 0;
  timer = (Min * 60000) + (Sec);
  if (millis() - lz_count > timer) {
    if (!done [number]) {
      Serial.print(timer);
      Serial.print("\t");
      Serial.println(effekt);
      if (effekt == fm_fl)   done[number] = fmfl  (dauer);
      if (effekt == fm_fr)   done[number] = fmfr  (dauer);
      if (effekt == fm_1)    done[number] = fm1   (dauer);
      if (effekt == fm_2)    done[number] = fm2   (dauer);
      if (effekt == fm_3)    done[number] = fm3   (dauer);
      if (effekt == fm_4)    done[number] = fm4   (dauer);
      if (effekt == fm_5)    done[number] = fm5   (dauer);
      if (effekt == fm_1_5)  done[number] = fm1_5 (dauer);
      if (effekt == fm_2_4)  done[number] = fm2_4 (dauer);
      if (effekt == fm_all)  done[number] = fmall (dauer);
      if (effekt == c_fl)    done[number] = cfl   (dauer);
      if (effekt == c_fr)    done[number] = cfr   (dauer);
      if (effekt == c_1)     done[number] = c1    (dauer);
      if (effekt == c_2)     done[number] = c2    (dauer);
      if (effekt == c_3)     done[number] = c3    (dauer);
      if (effekt == c_4)     done[number] = c4    (dauer);
      if (effekt == c_1_4)   done[number] = c1_4  (dauer);
      if (effekt == c_2_3)   done[number] = c2_3  (dauer);
      if (effekt == c_all)   done[number] = call  (dauer);
      if (effekt == gf_1)    done[number] = gf1   (dauer);
      if (effekt == gf_2)    done[number] = gf2   (dauer);
      if (effekt == gf_all)  done[number] = gfall (dauer);
    }
  }
}

void fx(effekts effekt, byte dauer, byte Min, unsigned long Sec, int number, effekts State) {

  bool fx_done;
  static unsigned long timer = 0;
  timer = (Min * 60000) + (Sec);
  if (millis() - lz_count > timer) {
    fx_done = State == start ? false : true;
    if (!done [number]) {
      Serial.print(timer);
      Serial.print("\t");
      Serial.println(effekt);
      if (effekt == fm_stp)  done[number] = fmstp (dauer, fx_done);
      if (effekt == c_stp)   done[number] = cstp  (dauer, fx_done);
      if (effekt == gf_stp)  done[number] = gfstp (dauer, fx_done);
      if (effekt == spk_stp) done[number] = spkstp(dauer, fx_done);
    }
  }
}

bool fmfl(byte dauer_fl) { //fivemaster fade links

  bool done_fl = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fl)  SoftPWMSet(pin_fm1, 255);
  if (millis() - count >= 120 * dauer_fl && millis() - count < 240 * dauer_fl)  {
    SoftPWMSet(pin_fm1, 0);
    SoftPWMSet(pin_fm2, 255);
  }
  if (millis() - count >= 240 * dauer_fl && millis() - count < 360 * dauer_fl)  {
    SoftPWMSet(pin_fm2, 0);
    SoftPWMSet(pin_fm3, 255);
  }
  if (millis() - count >= 360 * dauer_fl && millis() - count < 480 * dauer_fl)  {
    SoftPWMSet(pin_fm3, 0);
    SoftPWMSet(pin_fm4, 255);
  }
  if (millis() - count >= 480 * dauer_fl && millis() - count < 600 * dauer_fl)  {
    SoftPWMSet(pin_fm4, 0);
    SoftPWMSet(pin_fm5, 255);
  }
  if (millis() - count >= 600 * dauer_fl)  {
    SoftPWMSet(pin_fm5, 0);
    fx_run = false;
    done_fl = true;
  }
  return done_fl;
}

bool fmfr(byte dauer_fr) { //fivemaster fade rechts

  bool done_fr = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fr)  SoftPWMSet(pin_fm5, 255);
  if (millis() - count >= 120 * dauer_fr && millis() - count < 240 * dauer_fr)  {
    SoftPWMSet(pin_fm5, 0);
    SoftPWMSet(pin_fm4, 255);
  }
  if (millis() - count >= 240 * dauer_fr && millis() - count < 360 * dauer_fr)  {
    SoftPWMSet(pin_fm4, 0);
    SoftPWMSet(pin_fm3, 255);
  }
  if (millis() - count >= 360 * dauer_fr && millis() - count < 480 * dauer_fr)  {
    SoftPWMSet(pin_fm3, 0);
    SoftPWMSet(pin_fm2, 255);
  }
  if (millis() - count >= 480 * dauer_fr && millis() - count < 600 * dauer_fr)  {
    SoftPWMSet(pin_fm2, 0);
    SoftPWMSet(pin_fm1, 255);
  }
  if (millis() - count >= 600 * dauer_fr)  {
    SoftPWMSet(pin_fm1, 0);
    fx_run = false;
    done_fr = true;
  }
  return done_fr;
}

bool fmstp(byte dauer_stp , bool done_stp) { //fivemaster stepper

  static bool fx_run = false;
  static unsigned long count;
  if (!done_stp) {
    if (!fx_run) {
      count = millis();
      fx_run = true;
    }
    if (millis() - count < 120 * dauer_stp)  SoftPWMSet(pin_fm1, 255);
    if (millis() - count >= 120 * dauer_stp && millis() - count < 240 * dauer_stp)  {
      SoftPWMSet(pin_fm1, 0);
      SoftPWMSet(pin_fm4, 255);
    }
    if (millis() - count >= 240 * dauer_stp && millis() - count < 360 * dauer_stp)  {
      SoftPWMSet(pin_fm4, 0);
      SoftPWMSet(pin_fm2, 255);
    }
    if (millis() - count >= 360 * dauer_stp && millis() - count < 480 * dauer_stp)  {
      SoftPWMSet(pin_fm2, 0);
      SoftPWMSet(pin_fm5, 255);
    }
    if (millis() - count >= 480 * dauer_stp && millis() - count < 600 * dauer_stp)  {
      SoftPWMSet(pin_fm5, 0);
      SoftPWMSet(pin_fm3, 255);
    }
    if (millis() - count >= 600 * dauer_stp)  {
      SoftPWMSet(pin_fm3, 0);
      fx_run = false;
    }
  } else {
    SoftPWMSet(pin_fm1, 0);
    SoftPWMSet(pin_fm2, 0);
    SoftPWMSet(pin_fm3, 0);
    SoftPWMSet(pin_fm4, 0);
    SoftPWMSet(pin_fm5, 0);
  }
  return done_stp;
}

bool fm1(byte dauer_fm1) { //fivemaster flamme 1

  bool done_fm1 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fm1)  SoftPWMSet(pin_fm1, 255);
  if (millis() - count >= 240 * dauer_fm1)  {
    SoftPWMSet(pin_fm1, 0);
    fx_run = false;
    done_fm1 = true;
  }
  return done_fm1;
}

bool fm2(byte dauer_fm2) { //fivemaster flamme 2

  bool done_fm2 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fm2)  SoftPWMSet(pin_fm2, 255);
  if (millis() - count >= 240 * dauer_fm2)  {
    SoftPWMSet(pin_fm2, 0);
    fx_run = false;
    done_fm2 = true;
  }
  return done_fm2;
}

bool fm3(byte dauer_fm3) { //fivemaster flamme 3

  bool done_fm3 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fm3)  SoftPWMSet(pin_fm3, 255);
  if (millis() - count >= 240 * dauer_fm3)  {
    SoftPWMSet(pin_fm3, 0);
    fx_run = false;
    done_fm3 = true;
  }
  return done_fm3;
}

bool fm4(byte dauer_fm4) { //fivemaster flamme 4

  bool done_fm4 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fm4)  SoftPWMSet(pin_fm4, 255);
  if (millis() - count >= 240 * dauer_fm4)  {
    SoftPWMSet(pin_fm4, 0);
    fx_run = false;
    done_fm4 = true;
  }
  return done_fm4;
}

bool fm5(byte dauer_fm5) { //fivemaster flamme 5

  bool done_fm5 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fm5)  SoftPWMSet(pin_fm5, 255);
  if (millis() - count >= 240 * dauer_fm5)  {
    SoftPWMSet(pin_fm5, 0);
    fx_run = false;
    done_fm5 = true;
  }
  return done_fm5;
}

bool fm1_5(byte dauer_fm_1_5) { //fivemaster flamme 1 und 5

  bool done_fm_1_5 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fm_1_5)  {
    SoftPWMSet(pin_fm1, 255);
    SoftPWMSet(pin_fm5, 255);
  }
  if (millis() - count >= 240 * dauer_fm_1_5)  {
    SoftPWMSet(pin_fm1, 0);
    SoftPWMSet(pin_fm5, 0);
    fx_run = false;
    done_fm_1_5 = true;
  }
  return done_fm_1_5;
}

bool fm2_4(byte dauer_fm_2_4) { //fivemaster flamme 2 und 4

  bool done_fm_2_4 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fm_2_4)  {
    SoftPWMSet(pin_fm2, 255);
    SoftPWMSet(pin_fm4, 255);
  }
  if (millis() - count >= 240 * dauer_fm_2_4)  {
    SoftPWMSet(pin_fm2, 0);
    SoftPWMSet(pin_fm4, 0);
    fx_run = false;
    done_fm_2_4 = true;
  }
  return done_fm_2_4;
}

bool fmall(byte dauer_fm_all) { //fivemaster alle flammen

  bool done_fm_all = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_fm_all)  {
    SoftPWMSet(pin_fm1, 255);
    SoftPWMSet(pin_fm2, 255);
    SoftPWMSet(pin_fm3, 255);
    SoftPWMSet(pin_fm4, 255);
    SoftPWMSet(pin_fm5, 255);
  }
  if (millis() - count >= 240 * dauer_fm_all)  {
    SoftPWMSet(pin_fm1, 0);
    SoftPWMSet(pin_fm2, 0);
    SoftPWMSet(pin_fm3, 0);
    SoftPWMSet(pin_fm4, 0);
    SoftPWMSet(pin_fm5, 0);
    fx_run = false;
    done_fm_all = true;
  }
  return done_fm_all;
}

bool cfl(byte dauer_cfl) { //flamecubes fade links

  bool done_cfl = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_cfl)  SoftPWMSet(pin_c1, 255);
  if (millis() - count >= 120 * dauer_cfl && millis() - count < 240 * dauer_cfl)  {
    SoftPWMSet(pin_c1, 0);
    SoftPWMSet(pin_c2, 255);
  }
  if (millis() - count >= 240 * dauer_cfl && millis() - count < 360 * dauer_cfl)  {
    SoftPWMSet(pin_c2, 0);
    SoftPWMSet(pin_c3, 255);
  }
  if (millis() - count >= 360 * dauer_cfl && millis() - count < 480 * dauer_cfl)  {
    SoftPWMSet(pin_c3, 0);
    SoftPWMSet(pin_c4, 255);
  }
  if (millis() - count >= 480 * dauer_cfl)  {
    SoftPWMSet(pin_c4, 0);
    fx_run = false;
    done_cfl = true;
  }
  return done_cfl;
}

bool cfr(byte dauer_cfr) { //flamecubes fade rechts

  bool done_cfr = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_cfr)  SoftPWMSet(pin_c4, 255);
  if (millis() - count >= 120 * dauer_cfr && millis() - count < 240 * dauer_cfr)  {
    SoftPWMSet(pin_c4, 0);
    SoftPWMSet(pin_c3, 255);
  }
  if (millis() - count >= 240 * dauer_cfr && millis() - count < 360 * dauer_cfr)  {
    SoftPWMSet(pin_c3, 0);
    SoftPWMSet(pin_c2, 255);
  }
  if (millis() - count >= 360 * dauer_cfr && millis() - count < 480 * dauer_cfr)  {
    SoftPWMSet(pin_c2, 0);
    SoftPWMSet(pin_c1, 255);
  }
  if (millis() - count >= 480 * dauer_cfr)  {
    SoftPWMSet(pin_c1, 0);
    fx_run = false;
    done_cfr = true;
  }
  return done_cfr;
}

bool cstp(byte dauer_cstp , bool done_cstp) { //flamecubes stepper

  static bool fx_run = false;
  static unsigned long count;
  if (!done_cstp) {
    if (!fx_run) {
      count = millis();
      fx_run = true;
    }
    if (millis() - count < 120 * dauer_cstp)  {
      SoftPWMSet(pin_c1, 255);
      SoftPWMSet(pin_c3, 255);
      SoftPWMSet(pin_c2, 0);
      SoftPWMSet(pin_c4, 0);
    }
    if (millis() - count >= 120 * dauer_cstp && millis() - count < 240 * dauer_cstp)  {
      SoftPWMSet(pin_c2, 255);
      SoftPWMSet(pin_c4, 255);
      SoftPWMSet(pin_c1, 0);
      SoftPWMSet(pin_c3, 0);
    }
    if (millis() - count >= 240 * dauer_cstp)  {
      fx_run = false;
    }
  } else {
    SoftPWMSet(pin_c1, 0);
    SoftPWMSet(pin_c2, 0);
    SoftPWMSet(pin_c3, 0);
    SoftPWMSet(pin_c4, 0);
  }
  return done_cstp;
}

bool c1(byte dauer_c1) { //flamecube 1

  bool done_c1 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_c1)  SoftPWMSet(pin_c1, 255);
  if (millis() - count >= 240 * dauer_c1)  {
    SoftPWMSet(pin_c1, 0);
    fx_run = false;
    done_c1 = true;
  }
  return done_c1;
}

bool c2(byte dauer_c2) { //flamecube 2

  bool done_c2 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_c2)  SoftPWMSet(pin_c2, 255);
  if (millis() - count >= 240 * dauer_c2)  {
    SoftPWMSet(pin_c2, 0);
    fx_run = false;
    done_c2 = true;
  }
  return done_c2;
}

bool c3(byte dauer_c3) { //flamecube 3

  bool done_c3 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_c3)  SoftPWMSet(pin_c3, 255);
  if (millis() - count >= 240 * dauer_c3)  {
    SoftPWMSet(pin_c3, 0);
    fx_run = false;
    done_c3 = true;
  }
  return done_c3;
}

bool c4(byte dauer_c4) { //flamecube 4

  bool done_c4 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_c4)  SoftPWMSet(pin_c4, 255);
  if (millis() - count >= 240 * dauer_c4)  {
    SoftPWMSet(pin_c4, 0);
    fx_run = false;
    done_c4 = true;
  }
  return done_c4;
}

bool c1_4(byte dauer_c_1_4) { //flamecube 1 und 4

  bool done_c_1_4 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_c_1_4) {
    SoftPWMSet(pin_c1, 255);
    SoftPWMSet(pin_c4, 255);
  }
  if (millis() - count >= 240 * dauer_c_1_4)  {
    SoftPWMSet(pin_c1, 0);
    SoftPWMSet(pin_c4, 0);
    fx_run = false;
    done_c_1_4 = true;
  }
  return done_c_1_4;
}

bool c2_3(byte dauer_c_2_3) { //flamecube 2 und 3

  bool done_c_2_3 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_c_2_3)  {
    SoftPWMSet(pin_c2, 255);
    SoftPWMSet(pin_c3, 255);
  }
  if (millis() - count >= 240 * dauer_c_2_3)  {
    SoftPWMSet(pin_c2, 0);
    SoftPWMSet(pin_c3, 0);
    fx_run = false;
    done_c_2_3 = true;
  }
  return done_c_2_3;
}

bool call(byte dauer_cubes_all) { //flamecubes alle

  bool done_cubes_all = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_cubes_all)  {
    SoftPWMSet(pin_c1, 255);
    SoftPWMSet(pin_c2, 255);
    SoftPWMSet(pin_c3, 255);
    SoftPWMSet(pin_c4, 255);
  }
  if (millis() - count >= 240 * dauer_cubes_all)  {
    SoftPWMSet(pin_c1, 0);
    SoftPWMSet(pin_c2, 0);
    SoftPWMSet(pin_c3, 0);
    SoftPWMSet(pin_c4, 0);
    fx_run = false;
    done_cubes_all = true;
  }
  return done_cubes_all;
}

bool gfstp(byte dauer_gfstp , bool done_gfstp) { //g-flames stepper

  static bool fx_run = false;
  static unsigned long count;
  if (!done_gfstp) {
    if (!fx_run) {
      count = millis();
      fx_run = true;
    }
    if (millis() - count < 120 * dauer_gfstp)  {
      SoftPWMSet(pin_gf1, 255);
      SoftPWMSet(pin_gf2, 0);
    }
    if (millis() - count >= 120 * dauer_gfstp && millis() - count < 240 * dauer_gfstp)  {
      SoftPWMSet(pin_gf2, 255);
      SoftPWMSet(pin_gf1, 0);
    }
    if (millis() - count >= 240 * dauer_gfstp)  {
      fx_run = false;
    }
  } else {
    SoftPWMSet(pin_gf1, 0);
    SoftPWMSet(pin_gf2, 0);
  }
  return done_gfstp;
}

bool gf1(byte dauer_gf1) { //g-flame 1

  bool done_gf1 = false;
  static bool fx_run = false;
  static unsigned long count;
  static unsigned long count2;
  static byte brightness;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_gf1) {
    SoftPWMSet(pin_gf1, 255);
  }

  if (millis() - count >= 240 * dauer_gf1)  {
    SoftPWMSet(pin_gf1, 0);
    fx_run = false;
    done_gf1 = true;
  }
  return done_gf1;
}

bool gf2(byte dauer_gf2) { //g-flame 2

  bool done_gf2 = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_gf2) {
    SoftPWMSet(pin_gf2, 255);
  }
  if (millis() - count >= 240 * dauer_gf2) {
    SoftPWMSet(pin_gf2, 0);
    fx_run = false;
    done_gf2 = true;
  }
  return done_gf2;
}

bool gfall(byte dauer_gf_all) { //g-flames alle

  bool done_gf_all = false;
  static bool fx_run = false;
  static unsigned long count;
  if (!fx_run) {
    count = millis();
    fx_run = true;
  }
  if (millis() - count < 120 * dauer_gf_all)  {
    SoftPWMSet(pin_gf1, 255);
    SoftPWMSet(pin_gf2, 255);
  }
  if (millis() - count >= 240 * dauer_gf_all)  {
    SoftPWMSet(pin_gf1, 0);
    SoftPWMSet(pin_gf2, 0);
    fx_run = false;
    done_gf_all = true;
  }
  return done_gf_all;
}

bool spkstp(byte dauer_spk , bool done_spk) { //sparkler

  static bool fx_run = false;
  static unsigned long count;
  if (!done_spk) {
    if (!fx_run) {
      count = millis();
      fx_run = true;
    }
    if (millis() - count < 20 * dauer_spk)  {
      SoftPWMSet(pin_spk1, 255);
      SoftPWMSet(pin_spk2, 0);
    }
    if (millis() - count >= 20 * dauer_spk && millis() - count < 40 * dauer_spk)  {
      SoftPWMSet(pin_spk2, 255);
      SoftPWMSet(pin_spk1, 0);
    }
    if (millis() - count >= 40 * dauer_spk)  {
      fx_run = false;
    }
  } else {
    SoftPWMSet(pin_spk1, 0);
    SoftPWMSet(pin_spk2, 0);
  }
  return done_spk;
}

Hallo
Wofür ist delay(shift); ?
Damit legst du den Prozessor schlafen.

Annahme: die Interrupts in den Neopixel machen dir die millis() "kaputt". Ich glaube ohne einer Verbindung zwischen den beiden Nanos bekommst das nie syncron. Warum benötigst du zwei Nanos?

Um den Start des Timecodes auf lied Anfang zu setzen.
Lauf ich nur am anfang einmal rein und dann nimmer.
Der Sketch läuft aber auch wie er soll.

Kann das echt an den Neopixeln liegen?
20 Sekunden über ein Lied?
Das is echt häßlich.
Verbunden krieg ich die Nanos nicht.
Ich hab 3 im Projekt.
Der erste ist voll belegt und der zweite Nano mit den Pixeln eh recht ausgelastet.
Kommen auch noch paar Effekte dazu. Da wird der Nano eh schon knapp.

dann versteh ich nicht wie du das gemeinsam starten kannst. Wie beginnen die drei Sketche gleichzeitig?

Aber es läuft darauf hinaus: Zeige ALLES. Zeichne ein Skizze wie weit die Nanos voneiander entfernet sind, welche Module sie jeweils betreiben. Der Dritte Sketch wäre auch nicht schlecht.

Die sitzen auf ner Platine zusammen mit dem mp3 player.
Sind über einen Pin verbunden.
Und ne Freiluftverdrahtung, um den zweiten nano in den i2c bus zu kriegen, wollt ich vermeiden.

lass mich nicht raten, welcher Pin in welchem Sketch?

Entweder du bringst die 3 in Sync (I2C, Serial, Pin bitbang...) oder
du nimmst einen Mega. Das würde meines erachtens Komplexität rausnehmen und du hättest alles auf einem Controller. Schreib nicht dass dir der zu groß ist, es gibt diesen in Pro Varianten auch in kleiner Bauform, dann ist der gerade mal so groß wie ein Uno.

Wenn du dein ganzes Projekt vollständig beschreiben würdest, könnte man dir vermutlich noch besser helfen.

P.S.: Wegen Speicher, über 200 Byte SRAM ( 7 * 17 * 2) kannst sparen, wenn du die beiden großen Arrays in PROGMEM hältst.

Das wird versagen.
Spätestens kurz vor Ende der 49 Tage.

Dann hab ich trotzdem nur 16mhz. Selbst wenn ich alles unterkriege ist Zykluszeit bei den Pixeln eine Thema.
Und ich hab ja schon die Platinen da.
Ich kann auch mit i2c externdern arbeiten und einen leistungsfähigeren Controller nutzen.
Aber is alles in der "hätte, würde, wenn" Kiste.
Die Platinen werd ich auf jeden Fall nicht neu machen.
Dazu kommt, das dann wohl beide Controller das selbe Laufzeit Problem haben und nicht nur einer.

Dann läuft der der Zähler über.
Aber mehr als 6-7h wird das Projekt nicht laufen.

Warum machst du es nicht richtig.
Kostet dich doch nix.

Zudem kannst du genau an der Stelle (und an vergleichbaren) deine verlorenen Sekunden aufholen.
Das wäre mit der Reparatur zusammen ein Aufwasch.

Wie soll das was mit der Laufzeit zu tun haben?

Weil millis() offensichtlich schon vorgelaufen ist, wenn du die fehlerhafte Addition machst. In dem Vorlauf verlierst du deine Sekunden.

constexpr unsigned long interval {1000};
unsigned long zeitmerker;
 
void setup() 
{
  zeitmerker = millis();
}

void loop() 
{
  if(millis() - zeitmerker > interval)
  {
    zeitmerker += interval; // holt verlorene Millis wieder auf
    // hier tuwas
  }
}

So, und nicht anders.

Gut der constexpr is mir neu.
Brauchs den an der Stelle?
Die 1000 ändern sich ja nicht?
Ich gebe an der Stelle den Parameter eh mit dem Funktionsaufruf mit.
Hab die Funktion Fade mal angepasst.
Aber hat sich nix geändert.
Müsst jetzt mal durch den kompletten sketch gehen.
Bezweifle aber das der Rest was bringt, wenn bis jetzt nix zu erkennen ist.
Ich überspring ja das Allermeiste.

void fade(int &var, byte wert, byte var_speed) {
  if (var_speed > 0) {
    if (var < wert && millis() - fade_count > var_speed) {
      var++;
      fade_count += var_speed;
    }
    if (var > wert && millis() - fade_count > var_speed) {
      var--;
      fade_count += var_speed;
    }
  } else {
    var = wert;
  }
}

Spielt keine Rolex.

Richtig!
Wäre ja doof, de anderen Stellen kaputt zu lassen.

Alles klar.....

Kaputt ist was das nicht geht.
Das wird nie in den Zustand kommen, das es deswegen nicht geht. Von dem her Luxusproblem.
Und wenn das der Grund für Laufzeitprobleme wäre, hätte ich auf dem anderen Nano ja die selben.
Ich sollte auch nirgends mehr an so nen aufgebauten Timer stoßen aktuell.