Python package for online and laboratory singing experiments
Project description
sing4me — Singing Experiments
Manuel Anglada-Tort, Peter Harrison, and Nori Jacoby
Computational Auditory Perception Group
Max Planck Institute for Empirical Aesthetics
sing4me is a Python package for singing extraction, optimized for laboratory and online singing experiments. It provides signal-processing code for sung-pitch extraction, plus a bundled Praat syllable_extract.praat script for syllable / rhythm extraction.
Quick Links
Citation
Please cite this package if you use it:
Anglada-Tort, M., Harrison, P. M., Lee, H., & Jacoby, N. (2023). Large-scale iterated singing experiments reveal oral transmission mechanisms underlying music evolution. https://doi.org/10.1016/j.cub.2023.02.070
Analysis code and datasets supporting the paper (2023): https://doi.org/10.17605/OSF.IO/UANGD
Installation
Prerequisites
- Python 3.9 or newer (tested with 3.9–3.13)
- macOS (primary testing platform)
Setting up a Virtual Environment
pip3 install virtualenv virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
mkdir -p $WORKON_HOME
export VIRTUALENVWRAPPER_PYTHON=$(which python3)
source $(which virtualenvwrapper.sh)
mkvirtualenv sing4me --python $(which python3)
The virtual environment is now active. To activate it later:
workon sing4me
Installing sing4me
To install the published package from PyPI:
pip install sing4me
To install from a source checkout in editable mode (this also installs the runtime dependencies declared in pyproject.toml):
git clone git@gitlab.com:computational-audition/sing4me.git
cd sing4me
pip install -e .
Optional extras:
dev— flake8, blacknotebook— jupyter, sounddevice, soundfile (needed for the demo notebooks)publish— build, twine (only needed if you intend to build and upload a release to PyPI)
Install an extra with, e.g.:
pip install -e ".[notebook]"
Verify installation
sing4me --version
Running Demos
The demo notebooks in demos/ rely on the local input/ directory of sample audio. Those audio assets are not shipped with the PyPI distribution — clone the repository if you want to run the demos:
git clone git@gitlab.com:computational-audition/sing4me.git
cd sing4me
pip install -e ".[notebook]"
jupyter notebook
Then open one of:
demos/singing_demo.ipynbdemos/debug_singing_extract.ipynb
Sample Audio
The directory sing4me/tests/ in the source checkout contains a large collection of sample .wav / .png / .txt files used for manual / pilot inspection. Those samples are kept in the repository for development but are not shipped with the PyPI distribution (they would exceed PyPI's per-file limits). To use them, work from a source checkout.
A simple helper called generate_pilot_analysis_suite will generate plots and analysis for a directory of recordings:
generate_pilot_analysis_suite(
audio_dir=os.path.dirname(here) + "/tests/good_2int/",
)
License
MIT License
Future Improvements
- Rename / clean up
sing4me/tests/test_sing4me.py— it is a misleadingly-named manual debug script, not a real pytest test - Update the LICENSE copyright line — it still reads
Copyright (c) 2018 Computational Auditory Perception Research Group. Decide between an institutional or named-individual form, confirm with the listed authors, and refresh the year (and optionally add an explicitMIT Licenseheader line) - Add a tag-triggered PyPI publish job to the GitLab CI pipeline (using PyPI Trusted Publishing) so releases don't need to be uploaded from a developer's local venv
- Automate creation of a GitLab Release (with changelog and built artifacts) on every tagged version
- Add type hints and a
py.typedmarker - Add code-formatting and linting configuration (black/ruff/flake8)
- Add
CONTRIBUTING.mdandCODE_OF_CONDUCT.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sing4me-2.0.0rc0.tar.gz.
File metadata
- Download URL: sing4me-2.0.0rc0.tar.gz
- Upload date:
- Size: 40.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b53b78fb5f261fab27e9168c4b8f1d581eec79dbdd97822cfe6a2d6d791d178
|
|
| MD5 |
7cc3da03e1f4e6348d2803b36d278785
|
|
| BLAKE2b-256 |
02c18b32e0c25acf3a9ded7e9169115f50a5f2ceea5f3f7085d8e45b7d689617
|
File details
Details for the file sing4me-2.0.0rc0-py3-none-any.whl.
File metadata
- Download URL: sing4me-2.0.0rc0-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88411f121c0f4a2aef35ac40e72e78b77d6a429cf2a1121addc549bd811c623f
|
|
| MD5 |
0bf80d239c0401ab1f91c805731e33a9
|
|
| BLAKE2b-256 |
72484f822d09f820462a5a4166c84d1ff338a99e77947ef6a87fe2980e4b4a86
|