private void insertClusterSequence ( ClusterSequence cs, float offSet) {

    //
    int scoreIndex=0;
    float clusterTime;
    for ( int i=0; i < cs.getClusterNumber() ; i++ ) {
      clusterTime=cs.getTimeAtStep(i)+offSet;
      System.out.println(clusterTime+"eccolo");
      for (int j=scoreIndex; j <  score.getClusterNumber() ; j++ ) {
        // ERRORE CONTROLLARE
        if ( clusterTime ==  score.getTimeAtStep(j) ) {
          // add notes to existing cluster
          //aggiunger elemnti al cluster esistente, per ora forza bruta
          // score.
          
          score.addToCluster(cs.getCluster(i),j);
          scoreIndex=j;
          break;

        } 
        else if ( j==score.getClusterNumber()-1 )  {
          
          // it creates a new cluster in the internal sequence
          score.insertCluster(cs.getCluster(i),j+1,clusterTime);
          scoreIndex=j;
          break;

        } 
        else if (( j==0 )&&(clusterTime<score.getTimeAtStep(0)))  {
        
          // it creates a new cluster in the internal sequence
          score.insertCluster(cs.getCluster(i),0,clusterTime);
          scoreIndex=j;
          break;

        } 
        else if (( clusterTime >  score.getTimeAtStep(j) )&&( clusterTime <  score.getTimeAtStep(j+1) )) {
          
          // it creates a new cluster in the internal sequence
          score.insertCluster(cs.getCluster(i),j+1,clusterTime);
          scoreIndex=j;
          break;

        } 

      }
    }        



  }