Package org.staccato

Class MicrotonePreprocessor

java.lang.Object
org.staccato.MicrotonePreprocessor
All Implemented Interfaces:
Preprocessor

public class MicrotonePreprocessor extends Object implements Preprocessor
The MicrotonePreprocess lets a user express a microtone using 'm' followed by the frequency - e.g., m440. The MicrotonePreprocessor takes this String, parses the frequency value, figures out what Pitch Wheel and Note events need to be called to generate this frequency in MIDI, and returns the full set of Staccato Pitch Wheel and Note events.
  • Constructor Details

    • MicrotonePreprocessor

      public MicrotonePreprocessor()
  • Method Details

    • getInstance

      public static MicrotonePreprocessor getInstance()
    • preprocess

      public String preprocess(String s, StaccatoParserContext context)
      Specified by:
      preprocess in interface Preprocessor
    • convertFrequencyToStaccato

      public static String convertFrequencyToStaccato(double frequency, String qualifier)
      Converts the given frequency to a music string that involves the Pitch Wheel and notes to create the frequency
      Parameters:
      freq - the frequency
      Returns:
      a MusicString that represents the frequency