Class HoldTransform

java.lang.Object
com.softsynth.jmsl.score.NotePropertiesTransform
com.softsynth.jmsl.score.transforms.HoldTransform

public class HoldTransform
extends NotePropertiesTransform
Change hold (sustain time) of selected notes based on a ratio to its duration. Brings up dialog for user input.
Author:
Nick Didkovsky, copyright 2000 Nick Didkovsky, all rights reserved
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String copyright  
  • Constructor Summary

    Constructors
    Constructor Description
    HoldTransform()
    Constructor gives unique name, this.name = "Transpose: " + interval;
    HoldTransform​(java.awt.Frame f)  
  • Method Summary

    Modifier and Type Method Description
    void operate​(Score score, SelectionBuffer selectionBuffer)
    public void operate(Score score, SelectionBuffer selectionBuffer) { HoldDialog vd = new HoldDialog(this, parent, ratio); (new HoldDialog(this, parent, ratio)).setVisible(true); if (!proceed) { // System.out.println("Bailing"); } else { for (Enumeration e = selectionBuffer.elements(); e.hasMoreElements();) { Note note = (Note) e.nextElement(); if (!note.isRest()) { double duration = note.getDurationData(); double hold = ratio * duration; note.setHoldData(hold); } } } score.setDirty(true); }

    Methods inherited from class com.softsynth.jmsl.score.NotePropertiesTransform

    getName, setName

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • HoldTransform

      public HoldTransform()
      Constructor gives unique name, this.name = "Transpose: " + interval;
    • HoldTransform

      public HoldTransform​(java.awt.Frame f)
  • Method Details

    • operate

      public void operate​(Score score, SelectionBuffer selectionBuffer)
       
       public void operate(Score score, SelectionBuffer selectionBuffer) {
           HoldDialog vd = new HoldDialog(this, parent, ratio);
           (new HoldDialog(this, parent, ratio)).setVisible(true);
           if (!proceed) {
               // System.out.println("Bailing");
           } else {
               for (Enumeration e = selectionBuffer.elements(); e.hasMoreElements();) {
                   Note note = (Note) e.nextElement();
                   if (!note.isRest()) {
                       double duration = note.getDurationData();
                       double hold = ratio * duration;
                       note.setHoldData(hold);
                   }
               }
           }
           score.setDirty(true);
       }
       
       
       
      Specified by:
      operate in class NotePropertiesTransform