int key_forward()
{
  if (key_shifts & KB_CTRL_FLAG || index_false_control==1)
           {
           if(index_go==0 && index_go_back==0 && index_pause==0)
           {
           position_onstage=position_preset;
           }
            else {index_go=0;index_pause=0; index_go_back=0;}
           refresh_mem_onstage(position_onstage);
           detect_mem_before_one();
           detect_mem_preset();
           refresh_mem_onpreset(position_preset);
           niveauX1=255; niveauX2=0;
           refresh_banger_wx();
           refresh_integrated_gridplayer1();
           reset_modified_levels_in_crossfade();
           }
           else if (key_shifts & KB_SHIFT_FLAG || index_false_shift==1)
           {
           index_go=0;index_pause=0; index_go_back=0;
           detect_next_preset();
           refresh_mem_onpreset(position_preset);
           niveauX2=0;
           }
           strcpy(string_time_left_is,"");
           someone_changed_in_sequences=1;//icat
 return(0);
}
int call_mem_onpreset()
{

int mem_to_call=(int)(atof(numeric)*10.0001);
if ( mem_to_call>10000)
{sprintf(string_Last_Order,"a Mem can't be > to 1000");}
else
{
if(MemoiresExistantes[mem_to_call]==0)
{
sprintf(string_Last_Order,"Mem %d.%d doesn't exist", mem_to_call/10,mem_to_call%10);
}
else if (MemoiresExistantes[mem_to_call]==1)
{
sprintf(string_Last_Order,"Loaded %d.%d on preset", mem_to_call/10,mem_to_call%10);
position_preset=mem_to_call;
refresh_mem_onpreset(position_preset);
ratio_X1X2_together=ratio_cross_manuel[mem_to_call];
}
}
reset_numeric_entry();
someone_changed_in_sequences=1;//icat

return(0);
}
int call_mem_onstage()
{
int mem_to_call=(int)(atof(numeric)*10.0001);
if (mem_to_call>10000)
{sprintf(string_Last_Order,"a Mem can't be > to 1000");}
else
{
if(MemoiresExistantes[mem_to_call]==0)
{
sprintf(string_Last_Order,"Mem %d.%d doesn't exist", mem_to_call/10,mem_to_call%10);
}
if (MemoiresExistantes[mem_to_call]==1 && mem_to_call!=0)//eviter cherger mem 0 en clickant vide
{
sprintf(string_Last_Order,"Loaded %d.%d on Stage", mem_to_call/10,mem_to_call%10);
position_onstage=mem_to_call;
refresh_mem_onstage(position_onstage);
detect_mem_before_one();
detect_mem_preset();
refresh_mem_onpreset(position_preset);
}
if (MemoiresExistantes[mem_to_call]==1 && mem_to_call==0)//eviter cherger mem 0 en clickant vide
{
sprintf(string_Last_Order,"Mem 0.0 can't be loaded on Stage");
}
}
reset_numeric_entry();
someone_changed_in_sequences=1;//icat
return(0);
}
int next_mem_crossfade_finished(int mem_is_now_onstage)
{
position_onstage=mem_is_now_onstage;
for (int a=0;a<514;a++)
{
bufferSaisie[a]=bufferBlind[a];
}
detect_mem_preset();
refresh_mem_onpreset(position_preset);
detect_mem_before_one();
niveauX1=255; niveauX2=0;
if(midi_send_out[493]==1){index_send_midi_out[493]=1;}
someone_changed_in_sequences=1;//icat
return(0);
}
int arduino_do_digital_in_whitecat()
{
int vfader=0;

for(int p=0;p<=arduino_max_digital;p++)
{
        
if(arduino_digital_type[p]==1  && digital_data_from_arduino[p]!= previous_digital_data_from_arduino[p] )//si l'affectation est type INPUT
//et qu il y a une différence d'état      
{
switch(arduino_digital_function_input[p][0]) 
{
case 0://desafected
break;
case 1: //fader up  
if(digital_data_from_arduino[p]==1) {
vfader=(arduino_digital_function_input[p][1]-1);  
start_time_for_delays[vfader]=actual_time;
if(lfo_mode_is[vfader]!=1)//up
{
lfo_mode_is[vfader]=1;
faders_in_float[vfader]=Fader[vfader];
if(index_midi_mute_on_lfo==1){is_raccrochage_midi_remote[vfader]=1;}
}
else {lfo_mode_is[vfader]=0;}  
lfo_cycle_is_on[vfader]=0;    
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go  
}     

break;
case 2://fader down 
if(digital_data_from_arduino[p]==1) 
{
vfader=(arduino_digital_function_input[p][1]-1); 
start_time_for_delays[vfader]=actual_time;
if(lfo_mode_is[vfader]!=2)//down
{
lfo_mode_is[vfader]=2;
faders_in_float[vfader]=Fader[vfader];
if(index_midi_mute_on_lfo==1){is_raccrochage_midi_remote[vfader]=1;}
}
else {lfo_mode_is[vfader]=0;}
lfo_cycle_is_on[vfader]=0;
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go
}

break;
case 3://Fader saw
if(digital_data_from_arduino[p]==1) 
{
vfader=(arduino_digital_function_input[p][1]-1);  
start_time_for_delays[vfader]=actual_time;
faders_in_float[vfader]=Fader[vfader];
if(lfo_cycle_is_on[vfader]==0)//
{
lfo_cycle_is_on[vfader]=1;
lfo_mode_is[vfader]=0;
lfo_running_is_upward[vfader]=1;
if(index_midi_mute_on_lfo==1){is_raccrochage_midi_remote[vfader]=1;}
}
else if(lfo_cycle_is_on[vfader]==1)
{
lfo_cycle_is_on[vfader]=0;
}
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go  
}
break;      
case 4://Fader: ToPREVDock  
if(digital_data_from_arduino[p]==1) 
{   
vfader=(arduino_digital_function_input[p][1]-1);  
if (lfo_do_next_step[vfader][0]==0) {lfo_do_next_step[vfader][0]=1;lfo_do_next_step[vfader][1]=0;}   
else if (lfo_do_next_step[vfader][0]==1) {lfo_do_next_step[vfader][0]=0; }    
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go  
}
break;
case 5://Fader: ToNEXTDock  
if(digital_data_from_arduino[p]==1) 
{
vfader=(arduino_digital_function_input[p][1]-1);  
if (lfo_do_next_step[vfader][1]==0) {lfo_do_next_step[vfader][1]=1;lfo_do_next_step[vfader][0]=0; ;}   
else if (lfo_do_next_step[vfader][1]==1) {lfo_do_next_step[vfader][1]=0; }        
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go  
} 
break;
case 6://Fader: Up/Down
if(digital_data_from_arduino[p]==1) 
{
vfader=(arduino_digital_function_input[p][1]-1);  
lfo_cycle_steps[vfader]= toggle(lfo_cycle_steps[vfader]);
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go  
}
break;
case 7://Fader: LOCK
if(digital_data_from_arduino[p]==1) //si appuyé
{
vfader=(arduino_digital_function_input[p][1]-1);  
 switch(FaderLocked[vfader])
  {
   case 0:
   FaderLocked[vfader]=1;
   StateOfFaderBeforeLock[vfader]=Fader[vfader];
   if(StateOfFaderBeforeLock[vfader]==255){LockFader_is_FullLevel[vfader]=1;}
   else if(StateOfFaderBeforeLock[vfader]<255){LockFader_is_FullLevel[vfader]=0;}
   sprintf(string_Last_Order,">> LOCKED Fader %d",vfader+1);
   if(LockFader_is_FullLevel[vfader]==0)//quand mis en lock et pas full level rajout 0.7.6
   {
   lfo_mode_is[vfader]=0;
   lfo_cycle_is_on[vfader]=0;
   }
   break; 
   case 1:
   FaderLocked[vfader]=0;
   //remise à plat du niveau
   Fader[vfader]=(unsigned char)((((float)(StateOfFaderBeforeLock[vfader]))/255)*locklevel);
   midi_levels[vfader]=(int)(((float)Fader[vfader])/2);
   sprintf(string_Last_Order,">> UNLOCKED Fader %d",vfader+1);
   break;     
   }
   previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go  
}
break;
case 8://FLASH
vfader=(arduino_digital_function_input[p][1]-1);  
FaderIsFlash[vfader]=digital_data_from_arduino[p];
break;
case 9://Fader: All at 0
if(digital_data_from_arduino[p]==1) //si appuyé
{
vfader=(arduino_digital_function_input[p][1]-1);  
           Fader[vfader]=0;
           midi_levels[vfader]=0;
           index_send_midi_out[vfader]=1;
           lfo_speed[vfader]=64;
           midi_levels[196+p]=64;
           index_send_midi_out[196+p]=1;
           FaderLocked[vfader]=0;
           lfo_mode_is[vfader]=0;//no lfo
           lfo_cycle_is_on[vfader]=0;//saw
           lfo_cycle_steps[vfader]=0;
           lfo_do_next_step[vfader][0]=0;
           lfo_do_next_step[vfader][1]=0; 
           for(int d=0;d<6;d++)
           {
           is_dock_for_lfo_selected[vfader][d]=0;        
           }   
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go  
}
break;
case 10://Fader: L/Unloop dock
if(digital_data_from_arduino[p]==1) //si appuyé
{
vfader=(arduino_digital_function_input[p][1]-1);
is_dock_for_lfo_selected[vfader][(dock_used_by_fader_is[vfader])]=toggle(is_dock_for_lfo_selected[vfader][(dock_used_by_fader_is[vfader])]);
}  
digital_data_from_arduino[p]=toggle(digital_data_from_arduino[p]);
break;
case 11://Fader: L/Unloop all
if(digital_data_from_arduino[p]==1) //si appuyé
{
vfader=(arduino_digital_function_input[p][1]-1); 
for(int d=0;d<6;d++)
           {
           is_dock_for_lfo_selected[vfader][d]=toggle(is_dock_for_lfo_selected[vfader][d]);        
           }  
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go  
}
break;
case 12://Seq: GO
if(digital_data_from_arduino[p]==1) //si appuyé
{
do_go_function();
do_send_bang();
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);//pour ne pas faire un flicker sur le  go/pause/go
}
break;
case 13://Seq: GO BACK
if(digital_data_from_arduino[p]==1) //si appuyé
{
do_go_back_function();
int banger_back_is=Banger_Memoire[position_preset]-1;
do_go_back_bang(banger_back_is);
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);
}
break;
case 14://Seq: JUMP
if(digital_data_from_arduino[p]==1) //si appuyé
{
do_double_go_function();
do_send_bang();  
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);
}
break;
case 15://Seq: SHIFT-W
if(digital_data_from_arduino[p]==1) //si appuyé
{
index_go=0;index_pause=0; index_go_back=0; 
detect_mem_preset_previous();
refresh_mem_onpreset(position_preset);      
niveauX2=0; 
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);
someone_changed_in_sequences=1;//icat
}
break;
case 16://Seq: SHIFT-X
if(digital_data_from_arduino[p]==1) //si appuyé
{
index_go=0;index_pause=0; index_go_back=0;  
detect_next_preset();
refresh_mem_onpreset(position_preset);  
niveauX2=0; 
previous_digital_data_from_arduino[p]=toggle(previous_digital_data_from_arduino[p]);
someone_changed_in_sequences=1;//icat
}
break;
case 17:////As Key-On CH0 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,0,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,0,arduino_digital_function_input[p][1],0);
}
break;
case 18:////As Key-On CH1 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,1,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,1,arduino_digital_function_input[p][1],0);
}
break;
case 19:////As Key-On CH2 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,2,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");  
simulate_midi(2,3,arduino_digital_function_input[p][1],0);
}
break;
case 20:////As Key-On CH3 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,3,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On"); 
simulate_midi(2,4,arduino_digital_function_input[p][1],0);
}
break;
case 21:////As Key-On CH4 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,4,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On"); 
simulate_midi(2,4,arduino_digital_function_input[p][1],0);
}
break;
case 22:////As Key-On CH5 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,5,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On"); 
simulate_midi(2,5,arduino_digital_function_input[p][1],0);
}
break;
case 23:////As Key-On CH6 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,6,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,6,arduino_digital_function_input[p][1],0);
}
break;
case 24:////As Key-On CH7 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,7,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,7,arduino_digital_function_input[p][1],0);
}
break;
case 25:////As Key-On CH8 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,8,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On"); 
simulate_midi(2,8,arduino_digital_function_input[p][1],0);
}
break;
case 26:////As Key-On CH9 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,9,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,9,arduino_digital_function_input[p][1],0);
}
break;
case 27:////As Key-On CH10 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,10,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");  
simulate_midi(2,10,arduino_digital_function_input[p][1],0);
}
break;
case 28:////As Key-On CH11 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,11,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,11,arduino_digital_function_input[p][1],0);
}
break;
case 29:////As Key-On CH12 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,12,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,12,arduino_digital_function_input[p][1],0);
}
break;
case 30:////As Key-On CH13 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,13,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On"); 
simulate_midi(2,13,arduino_digital_function_input[p][1],0);
}
break;
case 31:////As Key-On CH14 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,14,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,14,arduino_digital_function_input[p][1],0);
}
break;
case 32:////As Key-On CH15 P:
if(digital_data_from_arduino[p]==1) //si appuyé
{
simulate_midi(1,15,arduino_digital_function_input[p][1],127);
sprintf (my_midi_string, "Arduino Chan:%-2d Pitch:%-2d Vel:%-2d Typ: %s",	ischan,ispitch,isvel, "Key-On");
simulate_midi(2,15,arduino_digital_function_input[p][1],0);
}
break;
default:
break;                                        
}                                               



}                                  
}

 return(0);   
}
int do_logical_Sequenciel_Window(int xseq, int yseq,int largeur_seq,int hauteur_seq)
{

do_logical_refresh_vision_memories(xseq,yseq);
do_logical_x1_x2(xseq,yseq-25);

////////////////////MENUS///////////////////////////////////////////////////////
//options hautes

///alink
if(mouse_x>xseq+180 && mouse_x<xseq+180+35 && mouse_y>yseq+50 && mouse_y<yseq+50+15)
{
if(index_link_is_on==0){index_link_is_on=1;}
else if(index_link_is_on==1){index_link_is_on=0;}
mouse_released=1;
}

///banger
if(mouse_x>xseq+223 && mouse_x<xseq+263 && mouse_y>yseq+50 && mouse_y<yseq+50+15)
{
index_banger_is_on=toggle(index_banger_is_on);
mouse_released=1;
}

//grid player 1 embeded
if(mouse_x>xseq+275 && mouse_x<xseq+275+30 && mouse_y>yseq+50 && mouse_y<yseq+50+15 )
{
show_gridplayer_in_seq=toggle(show_gridplayer_in_seq);
mouse_released=1;
}



/////menus bas
int rangee_y= yseq+180+(35*(nbre_memoires_visualisables_en_preset+1));
int index_atoi=0;
for (int op=0;op<7;op++)
{
///actions mouse
if(mouse_x>xseq+20+(op*60) && mouse_x<xseq+20+(op*60)+50 && mouse_y>rangee_y && mouse_y<rangee_y+20)
{
switch(op)
{
case 0:         //create
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(768,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
reset_indexs_confirmation();
index_do_create_mem=1;
index_ask_confirm=1;
}
break;
case 1://delete mem
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(769,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
reset_indexs_confirmation();
index_do_delete_mem=1;
index_ask_confirm=1;
}
break;
case 2://stage minus
if(  Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(770,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
    if(index_go==0 && index_go_back==0 && index_pause==0)
           {
           position_onstage=mem_before_one;
           }
           else {index_go=0;index_pause=0; index_go_back=0;}

refresh_mem_onstage(position_onstage);
detect_mem_before_one();
detect_mem_preset();
refresh_mem_onpreset(position_preset);
niveauX1=255; niveauX2=0;
refresh_banger_wx();
refresh_integrated_gridplayer1();
}
break;
case 3://stage +
if(  Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(771,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{

 if(index_go==0 && index_go_back==0 && index_pause==0)
           {
           position_onstage=position_preset;
           }
            else {index_go=0;index_pause=0; index_go_back=0;}

refresh_mem_onstage(position_onstage);
detect_mem_before_one();
detect_mem_preset();
refresh_mem_onpreset(position_preset);
niveauX1=255; niveauX2=0;
refresh_banger_wx();
refresh_integrated_gridplayer1();
}
break;
case 4://preset -
if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(772,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
index_go=0;index_pause=0; index_go_back=0;
detect_mem_preset_previous();
refresh_mem_onpreset(position_preset);
niveauX2=0;
}
break;
case 5://preset +
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(773,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
index_go=0;index_pause=0; index_go_back=0;
detect_next_preset();
refresh_mem_onpreset(position_preset);
niveauX2=0;
}
break;
case 6://goto
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1645,Midi_Faders_Affectation_Mode);
mouse_released=1;
}
else
{
if(numeric_postext>0)
{
index_atoi=(int)(atof(numeric)*10);
if(MemoiresExistantes[index_atoi]==1)
{
position_preset=index_atoi;
refresh_mem_onpreset(position_preset);
reset_numeric_entry();
numeric_postext=0;
}
}
}
break;

default:
break;
}//fin des switch
mouse_released=1;
}
}

//grid player 1 embarqué
if(show_gridplayer_in_seq==1)
{

//UP DOWN griders number selected

if(mouse_x>xseq+880-12 && mouse_x<xseq+880+12 && mouse_y>yseq+40-12 && mouse_y<yseq+40+12)
{

if(mouse_released==0)
{
if(Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1476,Midi_Faders_Affectation_Mode);
}
else
{
if(index_grider_selected[0]>0)
{index_grider_selected[0]--;}
}
 mouse_released=1;
}
}


if( mouse_x>xseq+910-12 && mouse_x<xseq+910+12 && mouse_y>yseq+40-12 && mouse_y<yseq+40+12)
{

if( mouse_released==0)
{
if( Midi_Faders_Affectation_Type!=0)//config midi
{
attribute_midi_solo_affectation(1480,Midi_Faders_Affectation_Mode);
}
else
{
if(index_grider_selected[0]<127){index_grider_selected[0]++;}
}
mouse_released=1;
}
}

do_logical_TheStepBox(xseq+660,yseq+90,0);
do_logical_ThePlayCommands(xseq+760,yseq+90,0);
do_logical_TheGrid_commands(xseq+660,yseq+130,0);//pos x, posy y, num player

if(mouse_x>xseq+690 && mouse_x<xseq+690+105 && mouse_y>yseq+295 && mouse_y<yseq+295+15 && mouse_released==0)
{
if( Midi_Faders_Affectation_Type!=0)
{
 attribute_midi_solo_affectation(1540,Midi_Faders_Affectation_Mode);
}

else
{
index_link_speed_crossfade_to_gpl1=toggle(index_link_speed_crossfade_to_gpl1);
if(index_link_speed_crossfade_to_gpl1==1)
{  grid_crossfade_speed[0]=crossfade_speed;
   midi_levels[1508]=crossfade_speed;
}
}
mouse_released=1;
}
}


return(0);
}