An unofficial ONNX conversion of maxrmorrison/fcnf0-plus-plus: FCNF0++, the pitch and periodicity estimator of PENN (Morrison, Hsieh, Pruyne, Pardo: Cross-domain Neural Pitch and Periodicity Estimation, 2023). It is not made or endorsed by its authors, to whom all credit for the model goes; see PENN for its training data, scores and limitations.
argmax decoder
with local_expected_value), and the entropy-based periodicity. PENN's default Viterbi decoder is not included.| File | |
|---|---|
onnx/pitch_model.onnx |
frames: float32 (count, 1024), windows of mono sound at 8000 Hz, one per value wanted -> pitch: (count) in Hz, periodicity: (count) 0..1 |
bachmcp.json |
the same facts, for programs |
import numpy as np, onnxruntime as ort
session = ort.InferenceSession("onnx/pitch_model.onnx")
x = np.zeros(8000 * 2, np.float32) # your sound: mono, 8000 Hz
x = np.pad(x, 512) # so that value i is at i * 10 ms
frames = np.stack([x[i:i + 1024] for i in range(0, len(x) - 1023, 80)])
pitch, periodicity = session.run(None, {"frames": frames}) # Hz, 0..1 (low: no pitch there)
The pitch is between 31 and 1984 Hz. Where the periodicity is low the pitch means nothing. Any hop works: the network hears each window on its own.
Converted with export_onnx.py for bach-mcp.
MIT, as PENN (the full text is in LICENSE). Please cite the original authors:
@misc{morrison2023crossdomain,
title={Cross-domain Neural Pitch and Periodicity Estimation},
author={Morrison, Max and Hsieh, Caedon and Pruyne, Nathan and Pardo, Bryan},
year={2023},
eprint={2301.12258},
archivePrefix={arXiv}
}
maxrmorrison/fcnf0-plus-plus