src/Bri_Sat_Settings.h
void handleBrightnessSettings(){ // HANDLE BRIGHTNESS SETTINGS 
  
if (glowON == 0 || lastBRIGH != BRIGH){
  BRIGH=BRIGH;
  for (int i=0 ; i<numbrigh ; i++){brigh[i]=BRIGH;}
  lastBRIGH=BRIGH;
}
else if (glowON == 1){
  for (int i = 0; i < numbrigh; i++){
      int ii = i % 16;
      brigh[i] = beatsin8(brivalbpm[ii], qsub8(BRIGH,offBr),qadd8(BRIGH,offBr)); 
    // if (i < 16){
    // brigh[i] = beatsin8(brivalbpm[i], brivalmin[i], brivalmax[i]);
    // }
    // else{
    // brigh[i] = brigh[i-16];     
    // } 
  }
}
  
else if (glowON == 2){   

    for (int i = 0; i < numbrigh; i++){
      int ii = i % 16;
      brigh[i] = beatsin8(brivalbpm[ii], qsub8(BRIGH,offBr),qadd8(BRIGH,offBr)); 
    // if (i < 16){
    // brigh[i] = beatsin8(brivalbpm[i], qsub8(BRIGH,offBr),qadd8(BRIGH,offBr));
    // }
    // else{
    // brigh[i] = brigh[i-16];    
    // } 
  }
}

else if (glowON == 3){
 for (int i=0 ; i<numbrigh ; i++){
 if (millis() - previousMillisGlow3[i] >= rtGlow3[i]/2){ // BPS 2 is timer modifier
  if (numGlow3[i] == 0){
    timeFactorGlow3[i] = millis(); 
    numGlow3[i]=1;  
    cycleGlow3[i] = 0;
    }
  brigh[i] = map(sin16((millis()-timeFactorGlow3[i])*BPMB),0,32767,offBr,BRIGH); // glowfactor 16 is speed setting
  if (brigh[i] >= BRIGH-3){cycleGlow3[i] = 1;}
  if (brigh[i] <= offBr+3 && cycleGlow3[i] == 1){
    rtGlow3[i]=random(waveTimeBr);
    previousMillisGlow3[i] = millis();
    numGlow3[i]=0;
  }  
 }
 else{brigh[i] = offBr;}
 }
} 

else if (glowON == 4){
 for (int i=0 ; i<numbrigh ; i++){
 if (millis() - previousMillisGlow3[i] >= rtGlow3[i]/2){ // BPS 2 is timer modifier
  if (numGlow3[i] == 0){
    timeFactorGlow3[i] = millis(); 
    numGlow3[i]=1;  
    cycleGlow3[i] = 0;
    }
  brigh[i] = map(sin16((millis()-timeFactorGlow3[i])*BPMB),0,32767,BRIGH, offBr); // glowfactor 16 is speed setting
  if (brigh[i] <= offBr+3){cycleGlow3[i] = 1;} 
  if (brigh[i] >= BRIGH-3 && cycleGlow3[i] == 1){
    rtGlow3[i]=random(waveTimeBr);
    previousMillisGlow3[i] = millis();
    numGlow3[i]=0;
  }  
 }
 else{brigh[i] = BRIGH;} // making this offbr makes it sparkly
 }
}

else if (glowON == 5){
  for (int i = 0; i < numbrigh; i++){
    brigh[i]=beatsin8(BPMB, qsub8(BRIGH,offBr), qadd8(BRIGH,offBr), ((i+1)*convBrigh));
  }
}

else if (glowON == 6){
  for (int i = 0; i < numbrigh; i++){
    brigh[i]=beatsin8(BPMB, qsub8(BRIGH,offBr), qadd8(BRIGH,offBr),0, (100+(i*100)));
  }
}

else if (glowON == 7){
  for (int i = 0; i < numbrigh; i++){
    brigh[i]=beatsin8(BPMB, 0, qadd8(BRIGH,offBr), ((i+1)*(convBrigh/2)));
  }
}  

else if (glowON == 8){
  for (int i = 0; i < numbrigh; i++){
    brigh[i]=beatsin8(BPMB, 0, qadd8(BRIGH,offBr), ((i+1)*convBrigh));
  }
}
}
/*
 * handles all the glow modes. Some mode can likely be put in for loops, but that didn't work yet.
 */
handles all the glow modes. Some mode can likely be put in for loops, but that didn't work yet.
handles all the glow modes . Some mode can likely be put in for loops but that didn ' t work yet .
void handleBrightnessSettings(){ 
if (glowON == 0 || lastBRIGH != BRIGH){
  BRIGH=BRIGH;
  for (int i=0 ; i<numbrigh ; i++){brigh[i]=BRIGH;}
  lastBRIGH=BRIGH;
}
else if (glowON == 1){
  for (int i = 0; i < numbrigh; i++){
      int ii = i % 16;
      brigh[i] = beatsin8(brivalbpm[ii], qsub8(BRIGH,offBr),qadd8(BRIGH,offBr)); 
  }
}
else if (glowON == 2){   
    for (int i = 0; i < numbrigh; i++){
      int ii = i % 16;
      brigh[i] = beatsin8(brivalbpm[ii], qsub8(BRIGH,offBr),qadd8(BRIGH,offBr)); 
  }
}
else if (glowON == 3){
 for (int i=0 ; i<numbrigh ; i++){
 if (millis() - previousMillisGlow3[i] >= rtGlow3[i]/2){ 
  if (numGlow3[i] == 0){
    timeFactorGlow3[i] = millis(); 
    numGlow3[i]=1;  
    cycleGlow3[i] = 0;
    }
  brigh[i] = map(sin16((millis()-timeFactorGlow3[i])*BPMB),0,32767,offBr,BRIGH); 
  if (brigh[i] >= BRIGH-3){cycleGlow3[i] = 1;}
  if (brigh[i] <= offBr+3 && cycleGlow3[i] == 1){
    rtGlow3[i]=random(waveTimeBr);
    previousMillisGlow3[i] = millis();
    numGlow3[i]=0;
  }  
 }
 else{brigh[i] = offBr;}
 }
} 
else if (glowON == 4){
 for (int i=0 ; i<numbrigh ; i++){
 if (millis() - previousMillisGlow3[i] >= rtGlow3[i]/2){ 
  if (numGlow3[i] == 0){
    timeFactorGlow3[i] = millis(); 
    numGlow3[i]=1;  
    cycleGlow3[i] = 0;
    }
  brigh[i] = map(sin16((millis()-timeFactorGlow3[i])*BPMB),0,32767,BRIGH, offBr); 
  if (brigh[i] <= offBr+3){cycleGlow3[i] = 1;} 
  if (brigh[i] >= BRIGH-3 && cycleGlow3[i] == 1){
    rtGlow3[i]=random(waveTimeBr);
    previousMillisGlow3[i] = millis();
    numGlow3[i]=0;
  }  
 }
 else{brigh[i] = BRIGH;} 
 }
}
else if (glowON == 5){
  for (int i = 0; i < numbrigh; i++){
    brigh[i]=beatsin8(BPMB, qsub8(BRIGH,offBr), qadd8(BRIGH,offBr), ((i+1)*convBrigh));
  }
}
else if (glowON == 6){
  for (int i = 0; i < numbrigh; i++){
    brigh[i]=beatsin8(BPMB, qsub8(BRIGH,offBr), qadd8(BRIGH,offBr),0, (100+(i*100)));
  }
}
else if (glowON == 7){
  for (int i = 0; i < numbrigh; i++){
    brigh[i]=beatsin8(BPMB, 0, qadd8(BRIGH,offBr), ((i+1)*(convBrigh/2)));
  }
}  
else if (glowON == 8){
  for (int i = 0; i < numbrigh; i++){
    brigh[i]=beatsin8(BPMB, 0, qadd8(BRIGH,offBr), ((i+1)*convBrigh));
  }
}
}
void handleBrightnessSettings ( ) { if ( glowON == 0 || lastBRIGH != BRIGH ) { BRIGH = BRIGH ; for ( int i = 0 ; i < numbrigh ; i ++ ) { brigh [ i ] = BRIGH ; } lastBRIGH = BRIGH ; } else if ( glowON == 1 ) { for ( int i = 0 ; i < numbrigh ; i ++ ) { int ii = i % 16 ; brigh [ i ] = beatsin8 ( brivalbpm [ ii ] , qsub8 ( BRIGH , offBr ) , qadd8 ( BRIGH , offBr ) ) ; } } else if ( glowON == 2 ) { for ( int i = 0 ; i < numbrigh ; i ++ ) { int ii = i % 16 ; brigh [ i ] = beatsin8 ( brivalbpm [ ii ] , qsub8 ( BRIGH , offBr ) , qadd8 ( BRIGH , offBr ) ) ; } } else if ( glowON == 3 ) { for ( int i = 0 ; i < numbrigh ; i ++ ) { if ( millis ( ) - previousMillisGlow3 [ i ] >= rtGlow3 [ i ] / 2 ) { if ( numGlow3 [ i ] == 0 ) { timeFactorGlow3 [ i ] = millis ( ) ; numGlow3 [ i ] = 1 ; cycleGlow3 [ i ] = 0 ; } brigh [ i ] = map ( sin16 ( ( millis ( ) - timeFactorGlow3 [ i ] ) * BPMB ) , 0 , 32767 , offBr , BRIGH ) ; if ( brigh [ i ] >= BRIGH - 3 ) { cycleGlow3 [ i ] = 1 ; } if ( brigh [ i ] <= offBr + 3 && cycleGlow3 [ i ] == 1 ) { rtGlow3 [ i ] = random ( waveTimeBr ) ; previousMillisGlow3 [ i ] = millis ( ) ; numGlow3 [ i ] = 0 ; } } else { brigh [ i ] = offBr ; } } } else if ( glowON == 4 ) { for ( int i = 0 ; i < numbrigh ; i ++ ) { if ( millis ( ) - previousMillisGlow3 [ i ] >= rtGlow3 [ i ] / 2 ) { if ( numGlow3 [ i ] == 0 ) { timeFactorGlow3 [ i ] = millis ( ) ; numGlow3 [ i ] = 1 ; cycleGlow3 [ i ] = 0 ; } brigh [ i ] = map ( sin16 ( ( millis ( ) - timeFactorGlow3 [ i ] ) * BPMB ) , 0 , 32767 , BRIGH , offBr ) ; if ( brigh [ i ] <= offBr + 3 ) { cycleGlow3 [ i ] = 1 ; } if ( brigh [ i ] >= BRIGH - 3 && cycleGlow3 [ i ] == 1 ) { rtGlow3 [ i ] = random ( waveTimeBr ) ; previousMillisGlow3 [ i ] = millis ( ) ; numGlow3 [ i ] = 0 ; } } else { brigh [ i ] = BRIGH ; } } } else if ( glowON == 5 ) { for ( int i = 0 ; i < numbrigh ; i ++ ) { brigh [ i ] = beatsin8 ( BPMB , qsub8 ( BRIGH , offBr ) , qadd8 ( BRIGH , offBr ) , ( ( i + 1 ) * convBrigh ) ) ; } } else if ( glowON == 6 ) { for ( int i = 0 ; i < numbrigh ; i ++ ) { brigh [ i ] = beatsin8 ( BPMB , qsub8 ( BRIGH , offBr ) , qadd8 ( BRIGH , offBr ) , 0 , ( 100 + ( i * 100 ) ) ) ; } } else if ( glowON == 7 ) { for ( int i = 0 ; i < numbrigh ; i ++ ) { brigh [ i ] = beatsin8 ( BPMB , 0 , qadd8 ( BRIGH , offBr ) , ( ( i + 1 ) * ( convBrigh / 2 ) ) ) ; } } else if ( glowON == 8 ) { for ( int i = 0 ; i < numbrigh ; i ++ ) { brigh [ i ] = beatsin8 ( BPMB , 0 , qadd8 ( BRIGH , offBr ) , ( ( i + 1 ) * convBrigh ) ) ; } } }
handles all the glow modes.
handles all the glow modes .
// HANDLE BRIGHTNESS SETTINGS  // if (i < 16){ // brigh[i] = beatsin8(brivalbpm[i], brivalmin[i], brivalmax[i]); // } // else{ // brigh[i] = brigh[i-16];      // }  // if (i < 16){ // brigh[i] = beatsin8(brivalbpm[i], qsub8(BRIGH,offBr),qadd8(BRIGH,offBr)); // } // else{ // brigh[i] = brigh[i-16];     // }  // BPS 2 is timer modifier // glowfactor 16 is speed setting // BPS 2 is timer modifier // glowfactor 16 is speed setting // making this offbr makes it sparkly