Class FrequencyToPitchTranslator

java.lang.Object
com.softsynth.jmsl.util.FrequencyToPitchTranslator
All Implemented Interfaces:
DataTranslator

public class FrequencyToPitchTranslator
extends java.lang.Object
implements DataTranslator
Use this to translate a double[] where frequency is in data[1] and Instrument expects pitch Uses TuningET.getPitch() for default 12tet tuning
Author:
Nick Didkovsky, email: nick@didkovsky.com, (c) 2004 Nick Didkovsky, all rights reserved.
  • Constructor Summary

    Constructors
    Constructor Description
    FrequencyToPitchTranslator()  
  • Method Summary

    Modifier and Type Method Description
    void setTuning​(TuningET tuningET)
    Set the equal temperament tuning into which frequency should be converted.
    double[] translate​(MusicJob job, double[] data)  

    Methods inherited from class java.lang.Object

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

    • FrequencyToPitchTranslator

      public FrequencyToPitchTranslator()
  • Method Details

    • translate

      public double[] translate​(MusicJob job, double[] data)
      Specified by:
      translate in interface DataTranslator
      Returns:
      copy of input array, where arr[1] now contains a pitch instead of a frequency
    • setTuning

      public void setTuning​(TuningET tuningET)
      Set the equal temperament tuning into which frequency should be converted. 12tet by default
      Parameters:
      tuningET -