Skip to main content

CAMAT

PyPI Python versions Documentation License

CAMAT (Computer-Assisted Music Analysis Toolbox) is an MEI-centred Python toolbox for editorial and analytical work with symbolic music. MEI is the durable score document; conversion, note tables, statistical analysis, pattern search, and rendering all connect back to that file.

The three workflows can be used independently. An existing MEI edition can go straight to parsing, while a MusicXML or Humdrum source first passes through conversion as part of editing and preparing music with MEI.

Workflow Starts with Produces
1. Editing music with the MEI data format existing or draft MEI, MusicXML, Humdrum, MuseScore, MIDI, and other symbolic formats imported MEI, rendered scores, facsimile links, combined pages, editorial checks
2. Parse music into CAMAT representations common-notation MEI note tables (df_pitch), event tables (df_events), piano-roll views
3. Analyse music: statistics and pattern search those tables or derived matrices distributions, binary matrices, pattern matches, and score overlays

Tables and matrices are working representations. They do not replace the edition; xml:id values are the bridge back to the score. Common-notation MEI is the supported path; mensural and timeline backends are experimental.

Guides, notebooks, and the API live in the documentation.

Install

Requires Python 3.11 or later.

python -m pip install camat

To run the showcase notebooks without cloning the whole repository:

camat-fetch-tutorials

That command copies notebooks/ and test_corpus/ into camat_tutorials/. See Cloud notebooks for Jupyter4NFDI and Google Colab.

To work on CAMAT itself:

git clone https://github.com/egorpol/camat_v2.git
cd camat_v2
python -m pip install -e ".[notebooks]"

Quick start

This example uses a tiny score shipped with CAMAT. After installation it runs offline, without a corpus download or Jupyter.

from importlib.resources import as_file, files
from camat import parse_files_quiet

example = files("camat").joinpath("examples", "facsimile_viewer_demo.mei")
with as_file(example) as score:
    results, _, _ = parse_files_quiet(
        [str(score)],
        backend="none",
        display_preview_df_pitch=False,
        display_preview_df_events=False,
        show_progress=False,
    )

notes = results[0]["df_pitch"]
print(f"Parsed {len(notes)} notes")

Expected output:

Parsed 8 notes

df_pitch holds note rows; df_events holds non-note events. Verovio is the default parser for common-notation MEI. Convert other formats first, then parse the resulting MEI.

Command-line tools such as camat-convert, camat-check-mei, and camat-fetch-tutorials are installed with the package.

What's in this repository

The PyPI wheel is the camat package: library code, a few packaged example scores, and the MEI 5.1 Common Music Notation schema. This git checkout also holds tutorials, documentation sources, tests, working corpora, and conference materials that are not shipped on PyPI.

camat_v2/
├── camat/            Installable package (conversion, parsers, analysis, rendering)
│   ├── examples/     Tiny MEI/SVG scores for offline demos
│   └── schemas/      MEI 5.1 CMN RELAX NG schema
├── notebooks/        Showcase tutorials, grouped into independent learning tracks
├── docs/             MkDocs sources published on Read the Docs
├── presentations/    Conference posters and talks (outside the installable package)
├── tests/            Pytest suite and synthetic fixtures
├── scripts/          Release checks, docs hooks, and maintainer probes
├── test_corpus/      Local MEI fixtures and corpus URL manifests
├── CAMAT_old/        Development archive (not a supported API)
└── exports/          Retained generated artifacts

Documentation

Page What it covers
Documentation home What CAMAT is and how musical documents connect to analysis
Getting started Three workflows, installation, offline example, and Jupyter setup
Cloud notebooks Jupyter4NFDI and Colab: copy tutorials without a full clone
Notebook roadmap Independent learning tracks for editing, parsing, and analysis
API reference Python modules and entry points
Known limitations Supported notation and experimental features

For bugs and suggestions, use GitHub Issues. See Contributing to work on the project.

The current checkout's general MEI validation guide documents camat-validate-mei, RELAX NG/Schematron, dependencies and execution records. These development changes are not yet part of a published release; install this checkout with python -m pip install -e '.[validation]' and provide xmllint separately. DdT publication policy is maintained in the corpus.

Authors and origins

Egor Polyakov — research and development; Martin Pfleiderer — principal investigator. Pia Steuck — research assistant.

The student assistants contributing to CAMAT's edition corpora are credited under About CAMAT.

The acronym was chosen in 2021–2022 for a basic MusicXML parsing tool; see the earlier project and tutorials. The current MEI-centred toolbox is a new implementation with a broader scope.

Funding, citation, and license

Funded by the German Research Foundation (DFG), programme Library and Information Services — E-Research Technologies (LIS), grant PF 669/18-1.

If you use CAMAT in research, cite the software and state the version. CITATION.cff supplies the metadata; GitHub exposes it through Cite this repository.

CAMAT's code is MIT licensed. Bundled material has separate notices.

Metadata

Release files for camat 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for camat 0.2.6
File Size Uploaded
camat-0.2.6.tar.gz 582.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for camat 0.2.6
File Interpreter ABI Platform
camat-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / camat-0.2.6.tar.gz

Download URL camat-0.2.6.tar.gz
Size 582.1 kB
Tags Source
SHA-256 checksum
How to use checksums
48a7f4bea432febec0a627723f4c37b93408068cd20b3100ac2eafd5c82c2878
BLAKE2b-256 checksum
How to use checksums
742808d9c6aa233d0d9b5d7a814b7cb0941c482f00e528024fa37a1afc744d52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / camat-0.2.6-py3-none-any.whl

Download URL camat-0.2.6-py3-none-any.whl
Size 588.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72f8697611b14b0b2ecce4c6f7af522cf5c15fc00c0b25cc2037f92c51b87ec4
BLAKE2b-256 checksum
How to use checksums
440ce76e0ba468cda6a52dd5e9a9213b34cf1e6b4879e0829e264b5615ba767b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.13

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page