}
int rowWithoutEmpty=row-offset;
//log.debug("effective Row: "+rowWithoutEmpty);
int nameIdx=rowWithoutEmpty/notesPerScaleTotal;
Scale s=scaleBuffer.get(nameIdx);
if (s==null) {
//log.debug("nameIdx......: "+nameIdx);
if (scaleName.isMajor()) {
NoteName nn=Scale.MAJOR_SCALES_CLASSIC[nameIdx];
s=new Scale(nn, scaleName);
} else {
NoteName nn=Scale.MINOR_SCALES_CLASSIC[nameIdx];
s=new Scale(nn, scaleName);
}
scaleBuffer.put(nameIdx, s);
}
int noteIdx=rowWithoutEmpty%notesPerScaleTotal;
//log.debug("note index: "+noteIdx);
if (col==0) {
return s.getNote(noteIdx);
}
Map<Integer, Chord> cMap=chordBuffer.get(rowWithoutEmpty);
if (cMap==null) {
cMap=new HashMap<Integer, Chord>();
chordBuffer.put(rowWithoutEmpty, cMap);
}
Chord c=cMap.get(col-1);
if (c==null) {
c=Chord.create(s.getNote(noteIdx), columnNames.get(col-1));
if (s.contains(c, true)) {
cMap.put(col-1, c);
} else {
cMap.put(col-1, FAIL_CHORD);
c=null;
}