Class PitchSpellerLineOfFifths

java.lang.Object
com.softsynth.jmsl.score.util.PitchSpellerLineOfFifths

public class PitchSpellerLineOfFifths
extends java.lang.Object
Respell a Note depending on the spelling of the previous note. Decide by taking min distance between two notes along line of fifths. From an article by David Meredith, "Optimizing Chew and Chen's Pitch Spelling Algorithm", Computer Music Journal, Summer 2007, where he sites this rule originally in Temperley, D. The Cognition of Basic Musical Structures, p125
Author:
Nick Didkovsky, nick@didkovsky.com
  • Field Summary

    Fields
    Modifier and Type Field Description
    static boolean USE_QUARTER_TONES  
  • Constructor Summary

    Constructors
    Constructor Description
    PitchSpellerLineOfFifths()  
    PitchSpellerLineOfFifths​(boolean useEnharmonicSpellings)  
  • Method Summary

    Modifier and Type Method Description
    static void main​(java.lang.String[] args)  
    void spell​(Note previousNote, Note note)  
    com.softsynth.jmsl.score.util.Spelling spell​(com.softsynth.jmsl.score.util.Spelling spelling, double pitchClass)
    Given the spelling of a note, calculate the best spelling of the next note given only its pitch class.
    java.lang.String spellingsToString()  

    Methods inherited from class java.lang.Object

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

    • USE_QUARTER_TONES

      public static boolean USE_QUARTER_TONES
  • Constructor Details

    • PitchSpellerLineOfFifths

      public PitchSpellerLineOfFifths()
    • PitchSpellerLineOfFifths

      public PitchSpellerLineOfFifths​(boolean useEnharmonicSpellings)
  • Method Details

    • spellingsToString

      public java.lang.String spellingsToString()
    • spell

      public com.softsynth.jmsl.score.util.Spelling spell​(com.softsynth.jmsl.score.util.Spelling spelling, double pitchClass)
      Given the spelling of a note, calculate the best spelling of the next note given only its pitch class. Return the Spelling that gives the min distance along the line if fifths between the given note and the new note
    • spell

      public void spell​(Note previousNote, Note note)
    • main

      public static void main​(java.lang.String[] args)