Package jmsltestsuite
Class PitchToTextTransform
java.lang.Object
com.softsynth.jmsl.score.NotePropertiesTransform
jmsltestsuite.PitchToTextTransform
public class PitchToTextTransform extends NotePropertiesTransform
Set the text of selected notes to their pitches Select notes and look for
"PitchToTextTransform" in the Note menu
-
Field Summary
Fields inherited from class com.softsynth.jmsl.score.NotePropertiesTransform
copyright
-
Constructor Summary
Constructors Constructor Description PitchToTextTransform()
-
Method Summary
Modifier and Type Method Description static void
main(java.lang.String[] args)
void
operate(Score score, SelectionBuffer selectionBuffer)
Implement this method to do something to the Notes in the SelectionBuffer.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
-
Constructor Details
-
PitchToTextTransform
public PitchToTextTransform()
-
-
Method Details
-
operate
Description copied from class:NotePropertiesTransform
Implement this method to do something to the Notes in the SelectionBuffer. Operations are upon the Notes themselves, not a clone of the Notes. Be careful!Example: // transpose pitch up an octave 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.setPitchData(note.getPitchData()+12); // Use NoteFactory to recalculate staff level, accidental, and stem direction NoteFactory.setLevelPitch(note, note.getPitchData()); } } }
- Specified by:
operate
in classNotePropertiesTransform
-
main
public static void main(java.lang.String[] args)
-