com.softsynth.jmsl.score.transforms
Class AccidentalPreferenceTransform

java.lang.Object
  extended by com.softsynth.jmsl.score.NotePropertiesTransform
      extended by com.softsynth.jmsl.score.transforms.AccidentalPreferenceTransform

public class AccidentalPreferenceTransform
extends NotePropertiesTransform

Set preferred accidental for selected Notes. Then respell them. Some will change some won't, depending on whether or not their pitch requires an accidental. Important: this is NOT the same as transpose up or down by a half step. This is a way to tell the Note how you would like it to be spelled if it requires an accidental.

Author:
Nick Didkovsky, copyright 2000 Nick Didkovsky, all rights reserved

Field Summary
static java.lang.String copyright
           
 
Constructor Summary
AccidentalPreferenceTransform(int accPref)
          Constructor gives unique name, this.name = "Transpose: " + interval;
 
Method Summary
 void operate(Score score, SelectionBuffer selectionBuffer)
          Set the accidental preferences of all selected Notes
Source:
 
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 Detail

copyright

public static final java.lang.String copyright
See Also:
Constant Field Values
Constructor Detail

AccidentalPreferenceTransform

public AccidentalPreferenceTransform(int accPref)
Constructor gives unique name, this.name = "Transpose: " + interval;

Method Detail

operate

public void operate(Score score,
                    SelectionBuffer selectionBuffer)
Set the accidental preferences of all selected Notes
Source:
 public void operate(SelectionBuffer selectionBuffer) {
     for (Enumeration e = selectionBuffer.elements(); e.hasMoreElements();) {
         Note note = (Note) e.nextElement();
         if (!note.isRest()) {
             // get pitch data, transpose it, and set it again
             note.setAccPref(accPref);
             // Use NoteFactory to recalculate staff level, accidental, and stem direction
             NoteFactory.setLevelPitch(note, note.getPitchData());
         }
     }
 }
 

Specified by:
operate in class NotePropertiesTransform