Skip to main content

A package for real-time music alignment

Project description

Matchmaker

Matchmaker is a Python library for real-time music alignment.

Music alignment is a fundamental MIR task, and real-time music alignment is a necessary component of many interactive applications (e.g., automatic accompaniment systems, automatic page turning).

Unlike offline alignment methods, for which state-of-the-art implementations are publicly available, real-time (online) methods have no standard implementation, forcing researchers and developers to build them from scratch for their projects.

We aim to provide efficient reference implementations of score followers for use in real-time applications which can be easily integrated into existing projects.

The full documentation for matchmaker is available online at readthedocs.org.

Setup

Prerequisites

First, install Fluidsynth, and then install the pyfluidsynth Python library. We recommend to install Fluidsynth using conda as well (see instructions below).

Note that pyfluidsynth only provides Python bindings for Fluidsynth; it does not install Fluidsynth itself. Be aware that there is also a fluidsynth Python library (without the py- prefix), but it is not compatible with matchmaker. We recommend installing Fluidsynth using conda

Install from source using conda

Setting up the code as described here requires conda. Follow the instructions for your OS.

To setup the experiments, use the following script.

# Clone matchmaker
git clone https://github.com/pymatchmaker/matchmaker.git

# Create the conda environment
conda create -n matchmaker python=3.12

conda activate matchmaker

# Go to matchmaker directory
cd ../matchmaker

# Install matchmaker in editable mode
pip install -e ."[dev]"

# Install GCC
conda install -c conda-forge gcc=12.1.0

# Install glib and fluidsynth
conda install -c conda-forge glib fluidsynth

Because of the dependency of partitura, which uses MuseScore_General.sf3 (free soundfont provided by MuseScore) as the default soundfont, the soundfont will be installed automatically inside the partitura package. This might take a while for the first time.

Known Setup Issues

Missing Visual C++ build tools (on Windows)

The solution seems to be to download vs_BuildTools.exe from https://visualstudio.microsoft.com/visual-cpp-build-tools/ and then execute

vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools

Issues with Fluidsynth and pyfluidsynth on Windows

On Windows, pyfluidsynth expects fluidsynth.exe to be located in C:\tools\bin (other users have reported that it is expected in C:\tools\fluidsynth\bin). You can fix the issue by

  1. Get the ZIP file for your Windows version from https://github.com/FluidSynth/fluidsynth/releases/latest
  2. Extract the contents to C:\tools (or wherever pyfluidsynth expects the executable to be).

Using Fluidsynth installed from Homebrew on MacOS

We recommend to install Fluidsynth from conda in a dedicated environemnt. If however, you want to use the system-wide Fluidsynth installed with homebrew, you might run into an ImportError("Couldn't find the FluidSynth library.") with pyfluidsynth. Please refer to the following link.

Usage Examples

Quickstart for live streaming

To get started quickly, you can use the Matchmaker class, which provides a simple interface for running the alignment process. You can use a musicxml or midi file as the score file. Specify "audio" or "midi" as the input_type argument, and the default device for that input type will be automatically set up.

from matchmaker import Matchmaker

mm = Matchmaker(
    score_file="path/to/score",
    input_type="audio",
)
for current_position in mm.run():
    print(current_position)  # beat position in the score

The returned value is the current position in the score, represented in beats defined by partitura library's note array system. Specifically, each position is calculated for every frame input and interpolated within the score's onset_beat array. Please refer to here for more information about the onset_beat concept.

Testing with the performance file

You can simulate the real-time alignment by putting a specific performance file as input, rather than running it as a live stream. The type of performance file can be either audio file or midi file, depending on the input_type.

from matchmaker import Matchmaker

mm = Matchmaker(
    score_file="path/to/score",
    performance_file="path/to/performance.mid",
    input_type="midi",
)
for current_position in mm.run():
    print(current_position)

Testing with Specific Input Device

To use a specific audio or MIDI device that is not the default device, you can pass the device name or index. By default, input_type is set to “audio”. If you are using a MIDI device, you can change the input type to “midi”.

from matchmaker import Matchmaker

mm = Matchmaker(
    score_file="path/to/score",
    device_name_or_index="MacBookPro Microphone",
)
for current_position in mm.run():
    print(current_position)

Running Examples

The repository includes a ready-to-use example script that demonstrates the complete workflow:

# Run with audio input (default)
python run_examples.py

# Run with MIDI input
python run_examples.py --midi

This script runs a complete example with score following and evaluation, saving results to the results/ directory.

Testing with Different Methods or Features

For testing with Audio input, you can specify the alignment method as follows:

from matchmaker import Matchmaker

mm = Matchmaker(
    score_file="path/to/score",
    input_type="audio",
    method="dixon",  # or "arzt" (default)
)
for current_position in mm.run():
    print(current_position)

For options regarding the method, please refer to the Alignment Methods section. For options regarding the feature_type, please refer to the Features section.

Alignment Methods

Matchmaker currently supports the following alignment methods:

  • "dixon": On-line time warping algorithm by S. Dixon (2005). Currently supports audio input; MIDI support coming soon.
  • "arzt": On-line time warping algorithm adapted from Brazier and Widmer (2020) (based on the work by Arzt et al. (2010)). Currently supports audio input; MIDI support coming soon.
  • "hmm": Hidden Markov Model-based score follower by Cancino-Chacón et al. (2023), based on the state-space score followers by Duan et al. (2011) and Jiang and Raphael (2020). Currently supports MIDI input; Audio support coming soon.

Features

Matchmaker currently supports the following feature types:

  • For audio:
    • "chroma": Chroma features. Default feature type for audio input.
    • "mfcc": Mel-frequency cepstral coefficients.
    • "mel": Mel-Spectrogram.
    • "logspectral": Log-spectral features used in Dixon (2005).
  • For MIDI:
    • pianoroll: Piano-roll features. Default feature type for MIDI input.
    • "pitch": Pitch features for MIDI input.
    • "pitchclass": Pitch class features for MIDI input.

Configurations

Initialization parameters for the Matchmaker class:

  • score_file (str): Path to the score file.
  • input_type (str): Type of input data. Options: "audio", "midi".
  • feature_type (str): Type of feature to use. Options: "chroma", "mfcc", "cqt", "spectrogram", "onset".
  • method (str): Alignment method to use. Options: "dixon", "arzt", "hmm".
  • sample_rate (int): Sample rate of the input audio data.
  • frame_rate (int): Frame rate of the input audio/MIDI data.
  • device_name_or_index (str or int): The audio/MIDI device name or index you want to use. If None, the default device will be used.

Citing Matchmaker

If you find Matchmaker useful, we would appreciate if you could cite us!

@inproceedings{park_matchmaker_2025,
	title = {Matchmaker: {An} {Open}-{Source} {Library} for {Real}-{Time} {Piano} {Score} {Following} and {Systematic} {Evaluation}},
	booktitle = {Proceedings of the 26th {International} {Society} for {Music} {Information} {Retrieval} {Conference} ({ISMIR} 2025)},
	author = {Park, Jiyun and Cancino-Chacón, Carlos and Chiruthapudi, Suhit and Nam, Juhan},
    address = {Daejeon, South Korea}
	year = {2025}
}
@inproceedings{matchmaker_lbd,
  title={{Matchmaker: A Python library for Real-time Music Alignment}},
  author={Park, Jiyun and Cancino-Chac\'{o}n, Carlos and Kwon, Taegyun and Nam, Juhan},
  booktitle={{Proceedings of the Late Breaking/Demo Session at the 25th International Society for Music Information Retrieval Conference}},
  address={San Francisco, USA.},
  year={2024}
}

Acknowledgments

This work has been supported by the Austrian Science Fund (FWF), grant agreement PAT 8820923 ("Rach3: A Computational Approach to Study Piano Rehearsals"). Additionally, this work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. NRF-2023R1A2C3007605).

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pymatchmaker-0.2.1-cp312-cp312-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pymatchmaker-0.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pymatchmaker-0.2.1-cp312-cp312-macosx_11_0_arm64.whl (249.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pymatchmaker-0.2.1-cp312-cp312-macosx_10_13_x86_64.whl (254.3 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

pymatchmaker-0.2.1-cp311-cp311-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pymatchmaker-0.2.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pymatchmaker-0.2.1-cp311-cp311-macosx_11_0_arm64.whl (247.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pymatchmaker-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl (251.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pymatchmaker-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pymatchmaker-0.2.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pymatchmaker-0.2.1-cp310-cp310-macosx_11_0_arm64.whl (246.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pymatchmaker-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl (250.5 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pymatchmaker-0.2.1-cp39-cp39-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

pymatchmaker-0.2.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pymatchmaker-0.2.1-cp39-cp39-macosx_11_0_arm64.whl (248.2 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pymatchmaker-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl (251.7 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file pymatchmaker-0.2.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 10e2e90736fc90c2c97da18f2d2ede1ec2343c5fd5d35fe8b9866c5cb647f7e4
MD5 11766ccd7878527ddf30e956f164171b
BLAKE2b-256 1e90b1afb142935b3657c33fac770aa0ff97161f03b207a3adbc4632d16f61d2

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b18a67cb9b46360ce1b3e21826d66a2c3ab1592547f50d04a481da3dcd164cc2
MD5 4f08cdcafbc03baf1e049d22f4e6d2f0
BLAKE2b-256 3790894dbceea3e4ad7fc8c7597b79a15cff309c67d10cfa4893636a9350e954

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4a5c145f758cff5fe6dc517524754259be24bf8935afe05fbdb582b7a7bedea3
MD5 9cd07ddd377811657a1a3be1ad57dfce
BLAKE2b-256 b137499e6dac93411d91e88c30c381ac3b5c7f45111416e1e0e758935e9f2736

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 94b5c4fe5e3718ab8ae0365a0708acb61c761ebd0aa4a8108600e628433ea4ac
MD5 6a223273e8bc834d7f842689371a87f2
BLAKE2b-256 21c997214b88ed7b20d6c957b10387b9960e896831f658fdc8a838660ff4417c

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 040b73dc40b4fe26dbf826010267fb6261770112ec03b2a7788a6ead48f54660
MD5 07c4a779fc2950a64df4c30edf36e859
BLAKE2b-256 94363435e4a229650b9942e7d7b8d6798bad095293eec00c15d02ec4df16da3e

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cb0ebe46cb306a6cd296de7138734b2fc8aeb56a0999e1b9996e246cb3f24f50
MD5 f453a9c57863d4f638d0f083beac561d
BLAKE2b-256 d4b595e792c2ad2e9257c5541b7f369a092f39188d95f6ed1b6254f78956b9fa

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f12fe717b69f60edf369c10895ccb6bd87ffe1be014e9be9d2af330d3d8da792
MD5 565c48630f36bee9c447f48802a16313
BLAKE2b-256 ad2d5d21a317eeb9c98eaaa46790f0958bbf6c8e4f6b4588bd24d5bd64e469ce

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 99ba1d0e55548d201eb5a1b214950c1b8c6cf7463a0fa7a58b8029017a4418a4
MD5 5c52449603de0267e964dc285ffc4948
BLAKE2b-256 e66b6e72401f807d80678d3621e0cbfb3c604bdada2d3527f0c45f46d02df505

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ed58b18e040d69701458510ea804bc5f430bcca3e5c16dd1fe7cbcb0f0240947
MD5 7377b728adbb6d0dc064ad7ec14f5efb
BLAKE2b-256 2d5767c174bd3c75c9be1a446bd1b8e275fb65e386594fb8d8b5881d2029d41f

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 94222446c8d76869124d201399a176860ff8641f4c5b1c0a21aca2815b9644d9
MD5 77ea6e2588a3a655b9c4fd47c8286874
BLAKE2b-256 c7294805bb2c3d282b526fd6193d5df8a3c57d48e85ad9550c366e4608693b76

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 100acba33be417cce8f0704f6ead3e307698c0a7009ff06913fcbc5e99ff8124
MD5 99c9c3e7af02317ae775ffe010833257
BLAKE2b-256 dc754a415a28a51eb8a8ac47dbe05930dc42e2653e21e44e89b555049576fa1e

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a29dd90be2b0b000439b554ef4fa4ddc52b17f84556232a62fbcb7f225086148
MD5 db89fb6c9add766a6c42c5e4591aa844
BLAKE2b-256 5e5dbea537347be4e5791d4f1a801e9cdea5ce6a54db3db75785965ebecf97ae

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3cf2743f77476cc87d26dd03dfad0d4f1002146eb35bc436eacf483b12b50bd5
MD5 b4e8576535b42a7b3174fed2a0418768
BLAKE2b-256 5b8849ca37e20e7cdc64c34e565f0ae8f5e2e8023ad0402ecc388b8efcc036c7

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f00b0194573ffd9e85d2caedf76838aa20d8e2853554aedcde4a4b88dcea880a
MD5 d607cc1f3635b79e0a136fb0e007ea28
BLAKE2b-256 b4f5580d2a5fb2d601af00b961487aad728ccb924806e3f6f54abd34bce8c6a9

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58bbdaab12d6623bccd661c35964d23a2fdf6cbd3bc52abd099ddde94eb55c84
MD5 a13c6983299e9a2a82305b9a6cdd5f12
BLAKE2b-256 d6c9d9dea2501f2921b90abbdd869a227b4a4cc26fcc0f27b6d56ccb0f5df11c

See more details on using hashes here.

File details

Details for the file pymatchmaker-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pymatchmaker-0.2.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 575ed2d4629e8ed768c544c3ebf5efc0768e89b2f926859f187a8e70899a91de
MD5 794d7f05ba66c41d9fb5b4baa323c5b7
BLAKE2b-256 6e548645c39fa7ffd4a18fd7e004ef83b1e4c7184648062628c957a4aa67abee

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