de.sciss.synth.ugen

Pitch

final case class Pitch(rate: Rate, in: GE, initFreq: GE = synth.this.GE.const(440.0), minFreq: GE = synth.this.GE.const(60.0), maxFreq: GE = synth.this.GE.const(4000.0), execFreq: GE = synth.this.GE.const(100.0), binsPerOct: GE = synth.this.GE.const(16), median: GE = synth.this.GE.const(1), ampThresh: GE = synth.this.GE.const(0.01), peakThresh: GE = synth.this.GE.const(0.5), downSample: GE = synth.this.GE.const(1), clarity: GE = synth.this.GE.const(1)) 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.

minFreq

The minimum frequency in Hertz to be considered for reporting.

maxFreq

The maximum frequency in Hertz to be considered for reporting.

execFreq

The frequency at which the pitch is estimated. This will be automatically clipped to be between minFreq and maxFreq.

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.

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.

ampThresh

The minimum amplitude threshold above which the pitch follower operates. An input signal below this threshold is not analyzed.

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.

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.

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.

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

Instance Constructors

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

    in

    The signal to be analyzed.

    initFreq

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

    minFreq

    The minimum frequency in Hertz to be considered for reporting.

    maxFreq

    The maximum frequency in Hertz to be considered for reporting.

    execFreq

    The frequency at which the pitch is estimated. This will be automatically clipped to be between minFreq and maxFreq.

    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.

    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.

    ampThresh

    The minimum amplitude threshold above which the pitch follower operates. An input signal below this threshold is not analyzed.

    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.

    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.

    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.

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val ampThresh: GE

    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.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. val binsPerOct: GE

    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.

  9. val clarity: GE

    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.

  10. def clone(): AnyRef

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

    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.

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

    Definition Classes
    AnyRef
  13. val execFreq: GE

    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.

  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. val in: GE

    The signal to be analyzed.

  17. val initFreq: GE

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

  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. def makeUGen(_args: IndexedSeq[UGenIn]): UGenInLike

    Attributes
    protected
    Definition Classes
    Pitch → UGenSource
  20. def makeUGens: UGenInLike

    Attributes
    protected
    Definition Classes
    Pitch → Expander
  21. val maxFreq: GE

    The maximum frequency in Hertz to be considered for reporting.

  22. val median: GE

    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.

  23. val minFreq: GE

    The minimum frequency in Hertz to be considered for reporting.

  24. final def name: String

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

    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. val peakThresh: GE

    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.

  29. val rate: Rate

    Definition Classes
    Pitch → GE
  30. final def rewrap(args: IndexedSeq[UGenInLike], exp: Int): UGenInLike

    Attributes
    protected
    Definition Classes
    SomeOut → UGenSource
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  32. final def unwrap(args: IndexedSeq[UGenInLike]): UGenInLike

    Attributes
    protected
    Definition Classes
    UGenSource
  33. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from MultiOut

Inherited from SomeOut

Inherited from GE.Lazy

Inherited from GE

Inherited from UGenSource[UGenInLike]

Inherited from Product

Inherited from Equals

Inherited from Expander[UGenInLike]

Inherited from Lazy

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped