pitch_garden.algorithms#
The algorithms are chosen by their names, e.g., pg.Tracker("rapt"), and
their parameters are given as the fields of their configurations, e.g.,
pg.Tracker("rapt", fmin=60.0).
- class pitch_garden.algorithms.base.AlgorithmConfig(fmin: float | None = None, fmax: float | None = None, device: str = 'cpu')[source]#
The base configuration shared by all algorithms.
Each algorithm defines its own configuration by inheriting this class and adding algorithm-specific fields.
crepe#
- class pitch_garden.algorithms.crepe.CrepeAlgorithm(config: AlgorithmConfig)[source]#
CREPE: a convolutional representation for pitch estimation (Kim et al., 2018).
The model and the weights are those of torchcrepe. Unlike torchcrepe, no dither is added to the pitch, so the results are reproducible, and the audio is resampled by soxr instead of resampy.
- class pitch_garden.algorithms.crepe.CrepeConfig(fmin: float | None = None, fmax: float | None = None, device: str = 'auto', model: Literal['full', 'tiny'] = 'full', decoder: Literal['viterbi', 'weighted_argmax'] = 'viterbi', voicing_threshold: float = 0.21, filter_length: float = 15.0, silence_threshold: float | None = None, batch_size: int = 512, num_threads: int | None = None, weights_path: str | None = None)[source]#
Configuration of CREPE.
dio#
- class pitch_garden.algorithms.sptk.DioAlgorithm(config: AlgorithmConfig)[source]#
DIO: a fast F0 estimator of WORLD (Morise et al., 2009).
- class pitch_garden.algorithms.sptk.DioConfig(fmin: float | None = 40.0, fmax: float | None = 800.0, device: str = 'cpu', voicing_threshold: float = 0.1)[source]#
Configuration of DIO, where a higher threshold gives more voiced frames.
The recommended range of the threshold is [0.02, 0.2] as in SPTK, but values outside are also accepted.
fcn-f0#
- class pitch_garden.algorithms.fcn_f0.FcnF0Algorithm(config: AlgorithmConfig)[source]#
FCN-f0: a fully-convolutional network for pitch estimation of speech signals.
This is proposed by Ardaillon and Roebel (2019). The frames are normalized and analyzed one by one as FULLCONV=False of FCN-f0, unlike the default of FCN-f0 analyzing the whole audio at once with the normalization by sliding windows, so that any frame period is available.
- class pitch_garden.algorithms.fcn_f0.FcnF0Config(fmin: float | None = None, fmax: float | None = None, device: str = 'auto', model: Literal['929', '993', '1953'] = '993', voicing_threshold: float = 0.4, batch_size: int = 512, num_threads: int | None = None, weights_path: str | None = None)[source]#
Configuration of FCN-f0.
fcpe#
- class pitch_garden.algorithms.fcpe.FcpeAlgorithm(config: AlgorithmConfig)[source]#
FCPE: fast context-based pitch estimation (Luo et al., 2025).
The model and the weights are those bundled in torchfcpe. The frames are analyzed every 10 milliseconds for any frame period. The outputs are at the hops as trained in FCPE, although the windows are centered 80 samples after the hops. The whole audio is analyzed at once because the group normalization of the model uses the statistics over all the frames.
harmof0#
- class pitch_garden.algorithms.harmof0.HarmoF0Algorithm(config: AlgorithmConfig)[source]#
HarmoF0: logarithmic scale dilated convolution (Wei et al., 2022).
The models and the weights are those of HarmoF0. The frames are analyzed every 46 samples, i.e., about 2.9 milliseconds, for any frame period, because the convolution over the frames is trained on such dense frames, e.g., a hop of 10 milliseconds degrades the accuracy considerably. Unlike HarmoF0, the frames are centered at multiples of the hop, the dynamic range of the log spectrogram is limited relative to the maximum of the whole audio instead of every 1000 frames, and the batches of frames overlap so that the results are independent of the batch size.
- class pitch_garden.algorithms.harmof0.HarmoF0Config(fmin: float | None = None, fmax: float | None = None, device: str = 'auto', model: Literal['mdb-stem-synth', 'mir-1k'] = 'mdb-stem-synth', voicing_threshold: float = 0.8, batch_size: int = 1000, num_threads: int | None = None, weights_path: str | None = None)[source]#
Configuration of HarmoF0.
harvest#
- class pitch_garden.algorithms.sptk.HarvestAlgorithm(config: AlgorithmConfig)[source]#
Harvest: a high-performance F0 estimator of WORLD (Morise, 2017).
- class pitch_garden.algorithms.sptk.HarvestConfig(fmin: float | None = 40.0, fmax: float | None = 800.0, device: str = 'cpu', voicing_threshold: float = 0.01)[source]#
Configuration of Harvest, where a higher threshold gives more voiced frames.
The recommended range of the threshold is [0.0, 0.2] as in SPTK, but values outside are also accepted.
pesto#
- class pitch_garden.algorithms.pesto.PestoAlgorithm(config: AlgorithmConfig)[source]#
PESTO: a self-supervised pitch estimator (Riou et al., 2023).
PESTO stands for pitch estimation with self-supervised transposition-equivariant objective. See SonyCSLParis/pesto for details.
pienet#
- class pitch_garden.algorithms.pienet.PiENetAlgorithm(config: AlgorithmConfig)[source]#
PiENet: the pitch estimation network (Airaksinen et al., 2019).
The model and the weights are those of GTE-AUG in PiENet, which is trained with noise augmentation for robustness. The frames are analyzed every 10 milliseconds, with which the convolution over the frames is trained, for any frame period, and the batches of frames overlap so that the results are independent of the batch size.
pyin#
- class pitch_garden.algorithms.pyin.PyinAlgorithm(config: AlgorithmConfig)[source]#
pYIN: probabilistic YIN (Mauch and Dixon, 2014).
rapt#
- class pitch_garden.algorithms.sptk.RaptAlgorithm(config: AlgorithmConfig)[source]#
RAPT: a robust algorithm for pitch tracking (Talkin, 1995).
- class pitch_garden.algorithms.sptk.RaptConfig(fmin: float | None = 40.0, fmax: float | None = 800.0, device: str = 'cpu', voicing_threshold: float = 0.0)[source]#
Configuration of RAPT, where a higher threshold gives more voiced frames.
The recommended range of the threshold is [-0.6, 0.7] as in SPTK, but values outside are also accepted.
reaper#
- class pitch_garden.algorithms.sptk.ReaperAlgorithm(config: AlgorithmConfig)[source]#
REAPER: robust epoch and pitch estimator (Talkin, 2015).
- class pitch_garden.algorithms.sptk.ReaperConfig(fmin: float | None = 40.0, fmax: float | None = 800.0, device: str = 'cpu', voicing_threshold: float = 0.9)[source]#
Configuration of REAPER, where a higher threshold gives more voiced frames.
The recommended range of the threshold is [-0.5, 1.6] as in SPTK, but values outside are also accepted.
rmvpe#
- class pitch_garden.algorithms.rmvpe.RmvpeAlgorithm(config: AlgorithmConfig)[source]#
RMVPE: a robust model for vocal pitch estimation (Wei et al., 2023).
The model and the weights are those of RVC. The frame period of the model is fixed to 10 ms.
straight#
- class pitch_garden.algorithms.straight.StraightAlgorithm(config: AlgorithmConfig)[source]#
STRAIGHT: the F0 extraction based on multiple cues (Kawahara et al., 2005).
This uses pylstraight, a Python port of Legacy STRAIGHT. See takenori-y/pylstraight for details. The voicing decision is made inside the algorithm, and thus the voicing score is not provided. Note that the voicing decision relies on the contrast with silent segments.
swift-f0#
- class pitch_garden.algorithms.swift_f0.SwiftF0Algorithm(config: AlgorithmConfig)[source]#
SwiftF0: a fast and accurate monophonic pitch detector.
See lars76/swift-f0 for details.
swipe#
- class pitch_garden.algorithms.sptk.SwipeAlgorithm(config: AlgorithmConfig)[source]#
SWIPE’: a sawtooth waveform inspired pitch estimator (Camacho, 2007).
- class pitch_garden.algorithms.sptk.SwipeConfig(fmin: float | None = 40.0, fmax: float | None = 800.0, device: str = 'cpu', voicing_threshold: float = 0.3)[source]#
Configuration of SWIPE’, where a lower threshold gives more voiced frames.
The recommended range of the threshold is [0.2, 0.5] as in SPTK, but values outside are also accepted.
yaapt#
- class pitch_garden.algorithms.yaapt.YaaptAlgorithm(config: AlgorithmConfig)[source]#
YAAPT: yet another algorithm for pitch tracking (Zahorian and Hu, 2008).
This uses AMFM_decompy, a Python port of YAAPT. See bjbschmitt/AMFM_decompy for details. The voicing decision is made inside the algorithm by dynamic programming, and thus the voicing score is not provided. The warnings and the messages of AMFM_decompy are suppressed.
yin#
- class pitch_garden.algorithms.yin.YinAlgorithm(config: AlgorithmConfig)[source]#
YIN: a fundamental frequency estimator (de Cheveigné and Kawahara, 2002).