Package jpianotrain.staff

Examples of jpianotrain.staff.Scale


      lowerBoundTreble.setValue(64);
      upperBoundTreble.setValue(127);
    }
    numberSpinner.setValue(rtf.getNoteCount());

    Scale s=rtf.getScale();
    if (s==null) {
      majorCheck.setSelected(true);
      for (NoteName nn:Scale.MAJOR_SCALES_CLASSIC_EN) {
        scaleBox.addItem(nn);
      }
    } else {
      majorCheck.setSelected(s.isMajor());
      if (s.isMajor()) {
        for (NoteName nn:Scale.MAJOR_SCALES_CLASSIC_EN) {
          scaleBox.addItem(nn);
        }
      } else {
        for (NoteName nn:Scale.MINOR_SCALES_CLASSIC_EN) {
          scaleBox.addItem(nn);
        }
      }
      scaleBox.setSelectedItem(s.getRoot().getName());
    }
  }
View Full Code Here


    rtf.setUpperBoundBass((Integer)upperBoundBass.getValue());
    rtf.setLowerBoundTreble((Integer)lowerBoundTreble.getValue());
    rtf.setUpperBoundTreble((Integer)upperBoundTreble.getValue());
    rtf.setNoteCount((Integer)numberSpinner.getValue());

    Scale s=new Scale((NoteName)scaleBox.getSelectedItem());
    rtf.setScale(s);
    rtf.flushEvents();
  }
View Full Code Here

    }

    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;
      }
View Full Code Here

    return scaleName==null?0:scaleName.getMapping().length+1;
  }
 
  @Override
  public Object getValueAt(int row, int col) {
    Scale s=scaleBuffer.get(col);
    if (s==null) {
      s=new Scale(columnNames[col], scaleName);
      scaleBuffer.put(col, s);
    }
    return s.getNote(row);
  }
View Full Code Here

TOP

Related Classes of jpianotrain.staff.Scale

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.