Help for "standby" fadings till serial / MIDI Data is available

Thank you ,

the millis() is a good idea , i`ll give it a try :slight_smile:

but i dont know how to get the "serial" data check to work.

i tried "if serial read" , but this wont work.

possibly i should check IF THERE´s a MIDI byte available rather then if there`s pure serial data.

but how ? :o
here is my code in the void loop...

  Serial.begin(9600); //XBEE

    if (Serial.read == 0){ 
 rainbowCycle(20);            /NEOPIXEL
}

if(Serial.read > 0 ){
   MIDI.setHandleControlChange(HandleControlChange);
    MIDI.setHandleNoteOn(HandleNoteOn);
    MIDI.setHandleNoteOff(HandleNoteOff);
    MIDI.setHandleProgramChange(handleProgramChange);
    PIXSTRIP.show();
      RING.show();
}
}