Skip to main content

CAMAT: tools for symbolic music parsing, analysis, and rendering.

Project description

CAMAT

CAMAT is a Python toolkit for symbolic music parsing, analysis, pattern search, and score rendering.

Optimized for Python => 3.11

Installation

pip install camat

What Is Included

  • Parsing helpers for music21 and partitura backends.
  • Pattern search and similarity utilities.
  • Piano-roll and overlay visualization helpers.
  • Verovio-based rendering utilities.

Quick Start

from camat import get_parse_files, run_pattern_search

parse_files = get_parse_files("music21")  # or "partitura"
results, dfs_by_name, last_df = parse_files(["path/to/score.mxl"])

# Example: run pattern search on a matrix and kernel
# out = run_pattern_search(matrix_source, kernel_source)

Documentation

This repo includes a Read the Docs-ready Sphinx project in docs/ and config in .readthedocs.yaml.

Local build:

pip install -r docs/requirements.txt
sphinx-build -b html docs docs/_build/html

Releasing

Releases are tag-driven.

  1. Update pyproject.toml, camat/__init__.py, and CHANGELOG.md.
  2. Create and push a version tag in the form vX.Y.Z.
  3. GitHub Actions will verify that the tag matches the package version, publish the built distributions to PyPI, and create the corresponding GitHub Release with the generated artifacts.

Manual twine upload is no longer part of the release flow.

Mensural MEI Helper

If your MEI files use mensural duration labels (for example semibrevis), you can normalize them for partitura compatibility:

python scripts/normalize_mensural_mei.py path/to/input.mei -o path/to/output.mei

You can override injected default meter if needed:

python scripts/normalize_mensural_mei.py path/to/input.mei -o path/to/output.mei --meter-count 2 --meter-unit 2

parse_files_partitura applies this preprocessing automatically by default:

  • normalize_mensural_durations=True
  • inject_missing_meter_signature=True (defaults to 4/4, configurable)
  • prefer_verovio_for_mensural=True (detects mensural MEI markers and runs Verovio first)
  • try_verovio_mei_conversion=True (retries unsupported MEI structures through Verovio, still using partitura)
  • verovio_mensural_to_cmn=True
  • verovio_duration_equivalence=None (set if you want explicit mensural-to-CMN scaling)
  • verovio_mensural_score_up=False

If you want a strict partitura-only workflow (no music21 fallback), set:

  • allow_music21_fallback=False

Repository Layout

  • camat/: package source used for PyPI distribution.
  • CAMAT_revamped/: legacy development notebooks and experiments.
  • CHANGELOG.md: release notes.
  • test_corpus - various test data

License

MIT (see LICENSE).

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

camat-0.1.3.tar.gz (100.2 kB view details)

Uploaded Source

Built Distribution

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

camat-0.1.3-py3-none-any.whl (102.0 kB view details)

Uploaded Python 3

File details

Details for the file camat-0.1.3.tar.gz.

File metadata

  • Download URL: camat-0.1.3.tar.gz
  • Upload date:
  • Size: 100.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for camat-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9020dd52a19e40ec5d0f5a94e71a09dd277bb1ce99a863dab9d1993e4503f3d0
MD5 116d214effdb26cdc3abb1d8dc90943c
BLAKE2b-256 f28a4621280ab4546f66b9e416c64594c24644fa2a15990f33105d2400270157

See more details on using hashes here.

Provenance

The following attestation bundles were made for camat-0.1.3.tar.gz:

Publisher: release.yml on egorpol/camat_v2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file camat-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: camat-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 102.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for camat-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 269302ddee1467771fd46e537ed2f0a14a12d6f66729832af02274ce8f16120a
MD5 c66f62b377dfad5a0b5e14d5731e9e5f
BLAKE2b-256 2158caa761eec6a119f03a051356a9b0adf8b660fec0dda0c19407fd1c55620c

See more details on using hashes here.

Provenance

The following attestation bundles were made for camat-0.1.3-py3-none-any.whl:

Publisher: release.yml on egorpol/camat_v2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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