Skip to main content

A python package for birdsongs creation and data extraction.

Project description

WaveSongs logo

WaveSongs

A Python package for birdsong synthesis and bioacoustic analysis


🔎 Overview

WaveSongs implements the motor gestures model for birdsong developed by Gabo Mindlin to generate synthetic birdsongs through numerical optimization. By leveraging fundamental frequency (FF) and spectral content index (SCI) as key parameters, the package solves a minimization problem using SciPy and performs audio analysis with librosa.

Validated against field recordings of Zonotrichia Capensis, Ocellated Tapaculo, and Mimus Gilvus, the model achieves <5% relative error in FF reconstruction compared to empirical data.

⚒️ Installation

Prerequisites

Steps

  1. Clone the repository:

    git clone https://github.com/wavesongs/wavesongs
    cd wavesongs
    
  2. Set up a virtual environment (choose one method):

    Using venv

    python -m venv venv
    # Activate on Linux/macOS
    source venv/bin/activate
    # Activate on Windows
    .\venv\Scripts\activate
    

    Using Conda

    conda create -n wavesongs python=3.12
    conda activate wavesongs
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Install WaveSongs in editable mode:

    pip install -e .
    

🚀 Gettint Started

Explore the Tutorial Notebook to generate synthetic birdsongs and analyze acoustic features. Here is an example of simple code to import and display an audio.

# select matplotlib backend for notebook, enable interactive plots
%matplotlib ipympl

from wavesongs.utils.paths import ProjDirs       # project files manager
from wavesongs.objects.song import Song          # song objects
from wavesongs.objects.syllable import Syllable  # syllable objects
from wavesongs.utils import plots                # plotter

proj_dirs = ProjDirs(audios="./assets/audio", results="./assets/results")

# define the song and compute its acoustical features
copeton_song = Song(proj_dirs, file_id="574179401")
copeton_song.acoustical_features(umbral_FF=1.4, NN=256)

# display the song
plots.spectrogram_waveform(copeton_song, save=False)

Sample Output

For advanced usage (e.g., custom gestures, parameter tuning), refer to the Documentation.

🎶 Data Integration

Pre-processed field recordings from Xeno Canto and eBird are included in ./assets/audio. To use custom recordings place .wav or .mp3 files in ./assets/audio/ or define the audios path with the ProjDirs class.

📜 License

WaveSongs is licensed under the GNU General Public License v3.0.

📒 Citation

If this work contributes to your research, please cite:

@software{aguilera_wavesongs_2025,
    author = {Aguilera Novoa, Sebastián},
    title = {WaveSongs: Computational Birdsong Synthesis},
    year = {2025},
    publisher = {GitHub},
    journal = {GitHub Repository},
    url = {https://github.com/wavesongs/wavesongs}
}

🌱 Contribute

We welcome contributions! See our roadmap:

  • Integrate Xeno Canto API for direct dataset downloads
  • Add ROIs analysis using scikit-maad
  • Improve FF parametrization for non-linear gestures

To report issues or suggest features, open a GitHub Issue.

📚 References

Core Methodology

  1. Mindlin, G. B., & Laje, R. (2005). The Physics of Birdsong. Springer. DOI
  2. Amador, A., et al. (2013). Elemental gesture dynamics in song premotor neurons. Nature. DOI

Software

Data Sources

  • Xeno-Canto: Sharing wildlife sounds from around the world
  • eBird: Macaulay Library. The Cornell Lab of Ornithology (2005)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wavesongs-0.0.1b0.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wavesongs-0.0.1b0-py3-none-any.whl (44.7 kB view details)

Uploaded Python 3

File details

Details for the file wavesongs-0.0.1b0.tar.gz.

File metadata

  • Download URL: wavesongs-0.0.1b0.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-52-generic

File hashes

Hashes for wavesongs-0.0.1b0.tar.gz
Algorithm Hash digest
SHA256 6173cc2e7363dcd0f6a7f9cf5cd2214482fe3cc99a3881d78ca17b3ba4622f34
MD5 98975624d38822caabcd168adbcd5f64
BLAKE2b-256 22df708ab87fd18aef043971582f6fc3ee5ea7d9d0c2e3924de1cd1358932def

See more details on using hashes here.

File details

Details for the file wavesongs-0.0.1b0-py3-none-any.whl.

File metadata

  • Download URL: wavesongs-0.0.1b0-py3-none-any.whl
  • Upload date:
  • Size: 44.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Linux/6.8.0-52-generic

File hashes

Hashes for wavesongs-0.0.1b0-py3-none-any.whl
Algorithm Hash digest
SHA256 350fe6b95758055ec0eb1db0ee13a3534e9dd0835fc1462c0bb58af491a3ad28
MD5 1323d28e09883e413f1b79853b863ef0
BLAKE2b-256 9331faa90e65000f161f8d6891be7af727a001e0e89242742c2c7a5a5c56e232

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page