Class/Object

de.sciss.synth.ugen

Pitch

Related Docs: object Pitch | package ugen

Permalink

final case class Pitch(rate: Rate, in: GE, initFreq: GE = 440.0f, minFreq: GE = 60.0f, maxFreq: GE = 4000.0f, execFreq: GE = 100.0f, binsPerOct: GE = 16, median: GE = 1, ampThresh: GE = 0.01f, peakThresh: GE = 0.5f, downSample: GE = 1, clarity: GE = 0) extends MultiOut with Product with Serializable

An autocorrelation based pitch following UGen. It is more accurate than ZeroCrossing , but more also more CPU costly. For most purposes the default settings can be used and only in needs to be supplied.

The UGen has two outputs: The first output is the frequency estimate in Hertz, the second output is a toggle hasFreq , which tells whether a pitch was found (1) or not (0). If the clarify argument is used, hasFreq has more fine grained information.

The pitch follower executes periodically at the rate specified by execFreq in cps. First it detects whether the input peak to peak amplitude is above the ampThresh . If it is not then no pitch estimation is performed, the hasFreq output is set to zero and the freq output is held at its previous value. Otherwise, the autocorrelation is calculated, and the first peak after the peak around the lag of zero that is above peakThresh times the amplitude of the peak at lag zero is reported.

in

The signal to be analyzed.

initFreq

The initial value of the freq output, until the first valid pitch is found. (init-time only)

minFreq

The minimum frequency in Hertz to be considered for reporting. (init-time only)

maxFreq

The maximum frequency in Hertz to be considered for reporting. (init-time only)

execFreq

The frequency at which the pitch is estimated. This will be automatically clipped to be between minFreq and maxFreq . (init-time only)

binsPerOct

A value which guides the search for the peak frequency in the first coarse step. Its setting does *not* affect the final pitch resolution; setting it larger will cause the coarse search to take longer, and setting it smaller will cause the fine search to take longer. (init-time only)

median

This specifies the length of a median filter applied to the frequency output estimation. With the default value of 1 the filter is defeated. Median filtering can help eliminating single spikes and jitter. This will however add latency to the output. (init-time only)

ampThresh

The minimum amplitude threshold above which the pitch follower operates. An input signal below this threshold is not analyzed. (init-time only)

peakThresh

This is a threshold used to find the first peak in the autocorrelation signal which gives the reported frequency. It is a factor of the energy of the signal (autocorrelation coefficient at zero). Set this value higher (e.g. to 1 ) to eliminate false frequencies corresponding to overtones. (init-time only)

downSample

An integer factor by which the input signal is down sampled to reduce CPU overhead. This will also reduce the pitch resolution. The default value of 1 means that the input signal is not down sampled. (init-time only)

clarity

If the clarity argument is greater than zero (it is zero by default) then the hasFreq output is given additional detail. Rather than simply being 1 when a pitch is detected, it is a "clarity" measure in the range between zero and one. (Technically, it's the height of the autocorrelation peak normalised by the height of the zero-lag peak.) It therefore gives a kind of measure of "purity" of the pitched signal. (init-time only)

Linear Supertypes
Serializable, Serializable, MultiOut, SomeOut, GE.Lazy, GE, UGenSource[UGenInLike], Expander[UGenInLike], Lazy, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Pitch
  2. Serializable
  3. Serializable
  4. MultiOut
  5. SomeOut
  6. Lazy
  7. GE
  8. UGenSource
  9. Expander
  10. Lazy
  11. Product
  12. Equals
  13. AnyRef
  14. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Pitch(rate: Rate, in: GE, initFreq: GE = 440.0f, minFreq: GE = 60.0f, maxFreq: GE = 4000.0f, execFreq: GE = 100.0f, binsPerOct: GE = 16, median: GE = 1, ampThresh: GE = 0.01f, peakThresh: GE = 0.5f, downSample: GE = 1, clarity: GE = 0)

    Permalink

    in

    The signal to be analyzed.

    initFreq

    The initial value of the freq output, until the first valid pitch is found. (init-time only)

    minFreq

    The minimum frequency in Hertz to be considered for reporting. (init-time only)

    maxFreq

    The maximum frequency in Hertz to be considered for reporting. (init-time only)

    execFreq

    The frequency at which the pitch is estimated. This will be automatically clipped to be between minFreq and maxFreq . (init-time only)

    binsPerOct

    A value which guides the search for the peak frequency in the first coarse step. Its setting does *not* affect the final pitch resolution; setting it larger will cause the coarse search to take longer, and setting it smaller will cause the fine search to take longer. (init-time only)

    median

    This specifies the length of a median filter applied to the frequency output estimation. With the default value of 1 the filter is defeated. Median filtering can help eliminating single spikes and jitter. This will however add latency to the output. (init-time only)

    ampThresh

    The minimum amplitude threshold above which the pitch follower operates. An input signal below this threshold is not analyzed. (init-time only)

    peakThresh

    This is a threshold used to find the first peak in the autocorrelation signal which gives the reported frequency. It is a factor of the energy of the signal (autocorrelation coefficient at zero). Set this value higher (e.g. to 1 ) to eliminate false frequencies corresponding to overtones. (init-time only)

    downSample

    An integer factor by which the input signal is down sampled to reduce CPU overhead. This will also reduce the pitch resolution. The default value of 1 means that the input signal is not down sampled. (init-time only)

    clarity

    If the clarity argument is greater than zero (it is zero by default) then the hasFreq output is given additional detail. Rather than simply being 1 when a pitch is detected, it is a "clarity" measure in the range between zero and one. (Technically, it's the height of the autocorrelation peak normalised by the height of the zero-lag peak.) It therefore gives a kind of measure of "purity" of the pitched signal. (init-time only)

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val ampThresh: GE

    Permalink

    The minimum amplitude threshold above which the pitch follower operates.

    The minimum amplitude threshold above which the pitch follower operates. An input signal below this threshold is not analyzed. (init-time only)

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val binsPerOct: GE

    Permalink

    A value which guides the search for the peak frequency in the first coarse step.

    A value which guides the search for the peak frequency in the first coarse step. Its setting does *not* affect the final pitch resolution; setting it larger will cause the coarse search to take longer, and setting it smaller will cause the fine search to take longer. (init-time only)

  7. val clarity: GE

    Permalink

    If the clarity argument is greater than zero (it is zero by default) then the hasFreq output is given additional detail.

    If the clarity argument is greater than zero (it is zero by default) then the hasFreq output is given additional detail. Rather than simply being 1 when a pitch is detected, it is a "clarity" measure in the range between zero and one. (Technically, it's the height of the autocorrelation peak normalised by the height of the zero-lag peak.) It therefore gives a kind of measure of "purity" of the pitched signal. (init-time only)

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. val downSample: GE

    Permalink

    An integer factor by which the input signal is down sampled to reduce CPU overhead.

    An integer factor by which the input signal is down sampled to reduce CPU overhead. This will also reduce the pitch resolution. The default value of 1 means that the input signal is not down sampled. (init-time only)

  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. val execFreq: GE

    Permalink

    The frequency at which the pitch is estimated.

    The frequency at which the pitch is estimated. This will be automatically clipped to be between minFreq and maxFreq . (init-time only)

  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def freq: GE

    Permalink
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hasFreq: GE

    Permalink
  16. val in: GE

    Permalink

    The signal to be analyzed.

  17. val initFreq: GE

    Permalink

    The initial value of the freq output, until the first valid pitch is found.

    The initial value of the freq output, until the first valid pitch is found. (init-time only)

  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def makeUGens: UGenInLike

    Permalink

    Abstract method which must be implemented by creating the actual UGens during expansion.

    Abstract method which must be implemented by creating the actual UGens during expansion. This method is at most called once during graph expansion

    returns

    the expanded object (depending on the type parameter U)

    Attributes
    protected
    Definition Classes
    PitchExpander
  20. val maxFreq: GE

    Permalink

    The maximum frequency in Hertz to be considered for reporting.

    The maximum frequency in Hertz to be considered for reporting. (init-time only)

  21. val median: GE

    Permalink

    This specifies the length of a median filter applied to the frequency output estimation.

    This specifies the length of a median filter applied to the frequency output estimation. With the default value of 1 the filter is defeated. Median filtering can help eliminating single spikes and jitter. This will however add latency to the output. (init-time only)

  22. val minFreq: GE

    Permalink

    The minimum frequency in Hertz to be considered for reporting.

    The minimum frequency in Hertz to be considered for reporting. (init-time only)

  23. final def name: String

    Permalink
    Definition Classes
    UGenSource
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. val peakThresh: GE

    Permalink

    This is a threshold used to find the first peak in the autocorrelation signal which gives the reported frequency.

    This is a threshold used to find the first peak in the autocorrelation signal which gives the reported frequency. It is a factor of the energy of the signal (autocorrelation coefficient at zero). Set this value higher (e.g. to 1 ) to eliminate false frequencies corresponding to overtones. (init-time only)

  28. val rate: Rate

    Permalink
    Definition Classes
    PitchGE
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from MultiOut

Inherited from SomeOut

Inherited from GE.Lazy

Inherited from GE

Inherited from UGenSource[UGenInLike]

Inherited from Expander[UGenInLike]

Inherited from Lazy

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped