code: public void setAccidental(byte noteHeigth, Accidental accidental) throws IllegalArgumentException
      {
        int index = 0;
        noteHeigth = (byte)(noteHeigth%12);
        if (noteHeigth==Note.C) index=0;
        else if (noteHeigth==Note.D) index=1;
        else if (noteHeigth==Note.E) index=2;
        else if (noteHeigth==Note.F) index=3;
        else if (noteHeigth==Note.G) index=4;
        else if (noteHeigth==Note.A) index=5;
        else if (noteHeigth==Note.B) index=6;
        else
          throw new IllegalArgumentException("Invalid note heigth : " + noteHeigth);
  
        if (accidental.isNotDefined())
      	  accidentals[index] = Accidental.NATURAL;
        //accept it, because in midi, the key is changed when there
        //is an accidental in a bar, using this method
        //else if (accidental.isDoubleFlat() || accidental.isDoubleSharp())
        //    throw new IllegalArgumentException("Accidental can't be DOUBLE_SHARP or DOUBLE_FLAT");
        else
      	  accidentals[index] = accidental;
      }
docs: Sets the accidental for the specified note.
  @param noteHeigth The note heigth. Possible values are,
  <TT>Note.A</TT>, <TT>Note.B</TT>, <TT>Note.C</TT>, <TT>Note.D</TT>,
  <TT>Note.E</TT>, <TT>Note.F</TT> or <TT>Note.G</TT>.
  @param accidental The accidental to be set to the note. Possible values are :
  <TT>Accidental.SHARP</TT>, <TT>Accidental.NATURAL</TT>
  or <TT>Accidental.FLAT</TT>.
  @exception IllegalArgumentException Thrown if an invalid note heigth or
  accidental has been given.