Examples of Motion


Examples of instantbach.data.Motion

        for (int i = 0; i < allChords.length; i++) {

            boolean returner = true;

            Motion bass = new Motion(chord.getVoice(VoiceType.BASS),
                                     allChords[i].getVoice(VoiceType.BASS));
            Motion tenor = new Motion(chord.getVoice(VoiceType.TENOR),
                                      allChords[i].getVoice(VoiceType.TENOR));
            Motion alto = new Motion(chord.getVoice(VoiceType.ALTO),
                                     allChords[i].getVoice(VoiceType.ALTO));
            Motion soprano = new Motion(chord.getVoice(VoiceType.SOPRANO),
                                     allChords[i].getVoice(VoiceType.SOPRANO));

            //check for invlalid parallel motion
            if (bass.compareTo(tenor)) {
                if (tenor.isValidInterval(bass) == false)
                    returner = false;
            }
            if (bass.compareTo(alto)) {
                if (alto.isValidInterval(bass) == false)
                    returner = false;
            }
            if (bass.compareTo(soprano)) {
                if (soprano.isValidInterval(bass) == false)
                    returner = false;
            }

            if (tenor.compareTo(alto)) {
                if (alto.isValidInterval(tenor) == false)
                    returner = false;
            }
            if (tenor.compareTo(soprano)) {
                if (soprano.isValidInterval(tenor) == false)
                    returner = false;
            }

            if (alto.compareTo(soprano)) {
                if (soprano.isValidInterval(alto) == false)
                    returner = false;
            }

            //check for cross voicing
            int allChordBassNote = allChords[i].getNoteNumeric(VoiceType.BASS);
            int allChordTenorNote = allChords[i].getNoteNumeric(VoiceType.TENOR);
            int allChordAltoNote = allChords[i].getNoteNumeric(VoiceType.ALTO);
            int allChordSopranoNote = allChords[i].getNoteNumeric(VoiceType.SOPRANO);

            int bassNote = chord.getNoteNumeric(VoiceType.BASS);
            int tenorNote = chord.getNoteNumeric(VoiceType.TENOR);
            int altoNote = chord.getNoteNumeric(VoiceType.ALTO);
            int sopranoNote = chord.getNoteNumeric(VoiceType.SOPRANO);

            if (allChordBassNote > allChordTenorNote)
                returner = false;
            if (allChordTenorNote > allChordAltoNote)
                returner = false;
            if (allChordAltoNote > allChordSopranoNote)
                returner = false;

            //check for cross voicing in between chords
            if (allChordBassNote > tenorNote)
                returner = false;
            if (allChordTenorNote < bassNote)
                returner = false;
            if (allChordTenorNote > altoNote)
                returner = false;
            if (allChordAltoNote < tenorNote)
                returner = false;
            if (allChordAltoNote > sopranoNote)
                returner = false;
            if (allChordSopranoNote < altoNote)
                returner = false;

            //check for invalid skips
            if (bass.getDistance() > 7)
                returner = false;
            if (tenor.getDistance() > 4)
                returner = false;
            if (alto.getDistance() > 4)
                returner = false;
            if (soprano.getDistance() > 5)
                returner = false;

            //iii
            if (allChords[i].getSymbol().equals("iii")) {
View Full Code Here

Examples of instantbach.data.Motion

        for (int i = 0; i < allChords.length; i++) {

            if (allChords[i].getBassNotePosition() == NotePosition.ROOT) {

                Motion tenor = new Motion(chord.getTenorVoice(), allChords[i].getTenorVoice());
                Motion alto = new Motion(chord.getAltoVoice(), allChords[i].getAltoVoice());
                Motion soprano = new Motion(chord.getSopranoVoice(), allChords[i].getSopranoVoice());

                int totalDistance = tenor.getDistance() + alto.getDistance() +
                                    soprano.getDistance();

                if (totalDistance < minDistance) {
                    chord = allChords[i];
                    minDistance = totalDistance;
                    chordFound = true;

                }
            }

        }

        if (!chordFound) {

            for (int i = 0; i < allChords.length; i++) {

                Motion tenor = new Motion(chord.getTenorVoice(), allChords[i].getTenorVoice());
                Motion alto = new Motion(chord.getAltoVoice(), allChords[i].getAltoVoice());
                Motion soprano = new Motion(chord.getSopranoVoice(), allChords[i].getSopranoVoice());

                int totalDistance = tenor.getDistance() + alto.getDistance() +
                                    soprano.getDistance();

                if (totalDistance < minDistance) {
                    chord = allChords[i];
                    minDistance = totalDistance;
View Full Code Here

Examples of net.br410bury.motion.Motion

    {
      elements = line.trim().split("\\s+");
     
      if(line.contains("Frames"))
      {
        motion = new Motion(Integer.valueOf(elements[1]), channels);
      }
      else if(line.contains("Frame Time"))
      {
        motion.setFrameLength(Double.valueOf(elements[2]));
      }
View Full Code Here

Examples of net.br410bury.motion.Motion

   *
   * @param mot The motion to use for this motion file.
   */
  public void setMotion(Motion motion)
  {
    this.motion = new Motion(motion.getData());
  }
View Full Code Here

Examples of org.jwildfire.create.tina.dance.motion.Motion

        return null;
      }

      @Override
      public Object getValueAt(int rowIndex, int columnIndex) {
        Motion motion = rowIndex < project.getMotions().size() ? project.getMotions().get(rowIndex) : null;
        if (motion != null) {
          switch (columnIndex) {
            case COL_MOTION:
              return motion.getDisplayLabel();
            case COL_START_FRAME:
              return (motion.getStartFrame() != null) ? String.valueOf(motion.getStartFrame()) : "";
            case COL_END_FRAME:
              return (motion.getEndFrame() != null) ? String.valueOf(motion.getEndFrame()) : "";
          }
        }
        return null;
      }
View Full Code Here

Examples of org.jwildfire.create.tina.dance.motion.Motion

  }

  private void refreshMotionLinksTable() {
    final int COL_FLAME = 0;
    final int COL_PROPERTY = 1;
    final Motion currMotion = getSelectedMotion();
    motionLinksTable.setModel(new DefaultTableModel() {
      private static final long serialVersionUID = 1L;

      @Override
      public int getRowCount() {
        return currMotion != null ? currMotion.getMotionLinks().size() : 0;
      }

      @Override
      public int getColumnCount() {
        return 2;
      }

      @Override
      public String getColumnName(int columnIndex) {
        switch (columnIndex) {
          case COL_FLAME:
            return "Flame";
          case COL_PROPERTY:
            return "Property";
        }
        return null;
      }

      @Override
      public Object getValueAt(int rowIndex, int columnIndex) {
        MotionLink motionLink = rowIndex < currMotion.getMotionLinks().size() ? currMotion.getMotionLinks().get(rowIndex) : null;
        if (motionLink != null) {
          switch (columnIndex) {
            case COL_FLAME:
              return flamePropertiesTreeService.getFlameCaption(motionLink.getProperyPath().getFlame());
            case COL_PROPERTY:
View Full Code Here

Examples of org.jwildfire.create.tina.dance.motion.Motion

    doRecordCBx.setEnabled(!running);

    motionTable.setEnabled(!running);
    addMotionCmb.setEnabled(!running);
    addMotionBtn.setEnabled(!running);
    Motion selMotion = getSelectedMotion();

    deleteMotionBtn.setEnabled(!running && selMotion != null);
    renameMotionBtn.setEnabled(deleteMotionBtn.isEnabled());
    boolean plainPropertySelected = flamePropertiesTreeService.isPlainPropertySelected(flamePropertiesTree);
    {
      boolean linkMotionEnabled = false;
      if (!running && selMotion != null && selMotion.getParent() == null) {
        if (plainPropertySelected) {
          FlamePropertyPath selPath = flamePropertiesTreeService.getSelectedPropertyPath(flamePropertiesTree);
          linkMotionEnabled = !selMotion.hasLink(selPath);
        }
      }
      linkMotionBtn.setEnabled(linkMotionEnabled);
      unlinkMotionBtn.setEnabled(selMotion != null && motionLinksTable.getSelectedRow() >= 0 && motionLinksTable.getSelectedRow() < selMotion.getMotionLinks().size());
    }

    createMotionsCmb.setEnabled(!running);
    clearMotionsBtn.setEnabled(!running && project.getMotions().size() > 0);
    loadProjectBtn.setEnabled(!running);
View Full Code Here

Examples of org.jwildfire.create.tina.dance.motion.Motion

  public void addMotionBtn_clicked() {
    try {
      MotionType motionType = (MotionType) addMotionCmb.getSelectedItem();
      if (motionType != null) {
        Motion newMotion = motionType.getMotionClass().newInstance();
        project.getMotions().add(newMotion);

        boolean oldRefreshing = refreshing;
        refreshing = true;
        try {
View Full Code Here

Examples of org.jwildfire.create.tina.dance.motion.Motion

      if (motionPropertyPnl != null) {
        motionPropertyRootPnl.remove(motionPropertyPnl);
        motionPropertyPnl = null;
      }
      if (project.getMotions().size() > 0 && motionTable.getSelectedRow() >= 0 && motionTable.getSelectedRow() < project.getMotions().size()) {
        Motion motion = project.getMotions().get(motionTable.getSelectedRow());

        @SuppressWarnings("rawtypes")
        Map<Class, PropertyEditor> editors = new HashMap<Class, PropertyEditor>();
        editors.put(Motion.class, new MotionTypeEditor(project.getMotions()));
View Full Code Here

Examples of org.jwildfire.create.tina.dance.motion.Motion

    motionPropertyRootPnl.invalidate();
    motionPropertyRootPnl.validate();
  }

  public void linkMotionBtn_clicked() {
    Motion currMotion = getSelectedMotion();
    if (currMotion != null && flamePropertiesTreeService.isPlainPropertySelected(flamePropertiesTree)) {
      FlamePropertyPath propertyPath = flamePropertiesTreeService.getSelectedPropertyPath(flamePropertiesTree);
      currMotion.getMotionLinks().add(new MotionLink(propertyPath));
      refreshMotionLinksTable();
      int selectRow = currMotion.getMotionLinks().size() - 1;
      motionLinksTable.getSelectionModel().setSelectionInterval(selectRow, selectRow);
      enableControls();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.