Skip to main content

MUSION, a toolbox for music information retrieval and music signal processing.

Project description

MUSION, a toolbox for music information retrieval and music signal processing.

A collection of MIR open-source tools, dedicated to efficient inference tasks.

Advantages

Minimal Package Dependencies

Designed to be lightweight with minimal package dependencies, ensuring easy installation and compatibility with various environments. This reduces the complexity of managing dependencies and helps avoid potential conflicts with other packages.

Accelerated Multi-file Parallel Processing

Significantly accelerating the analysis and processing of large datasets. By leveraging multi-threading and multi-processing techniques, and using ONNX TRT/CUDA for multi-GPU acceleration, MUSION can efficiently handle multiple files simultaneously, reducing the overall processing time.

Unified and Concise UI

Making it easy to use across different tools and applications. Whether you prefer using the Python interface, command-line interface (CLI), MUSION provides a consistent and intuitive experience for all users.

Available tools

beat beat tracking
Detect beat and downbeat in music

separate music source separation
Separate songs into "drums", "bass", "other", "vocals"

struct music structure analysis / music segmentation
Detect chorus part for pop songs

transcribe automatic music transcription
Transcribe piano, drums or vocal audio to BEAT-ALIGNED MIDI file.

Installation

  1. Using PyPI
python -m pip install musion
  1. Download ONNX model files from https://zenodo.org/records/13906170, and put them in the corresponding folders.

Example Usage

All the tools use the same procedure and method, only different at tool name.
Here is a example for the struct tool.

from musion.struct import Struct

struct = Struct()

# Select one of the two ways for input
## 1. Process a single file, given its file path
struct_res = struct(audio_path='dir/audio.wav')
## audio_path could also be a directory that contains audio files, or a list of audio paths.
struct_res = struct(audio_path='dir/')
struct_res = struct(audio_path=['audio1.wav', 'audio2.wav'])

## 2. Process a single audio data, given its pcm
from musion import MusionPCM
pcm = MusionPCM(samples, sample_rate)
struct_res = struct(pcm=pcm)

""" Optional Parameters """
# Save the result to a file
from musion import SaveConfig
save_cfg = SaveConfig(dir_path='dir/to/save/in', keys=['struct'])
# Where the keys can be obtained by
struct.result_keys
# Save the result by passing save_cfg, to the file: dir/to/save/in/audio.strcut
struct(audio_path='dir/audio.wav', save_cfg=save_cfg)

# Enable parallel processing when input contains multiple files, just set a proper number for num_workers
struct(audio_path='dir/', num_workers=5)
# Overwrite the existing result
struct(audio_path='dir/', overwrite=True)

Command-Line Interface

Almost the same parameters as above. Type '$ musion -h' for more details. Here's a comprehensive example.

$ musion separate test_wavs/ --save_dir results_dir/ --save_keys vocals.wav bass.wav --num_workers 5

Contributing

If you would like to participate in the development of Musion you are more than welcome to do so. Don't hesitate to throw us a pull request and we'll do our best to examine it quickly.

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

musion-0.4.0.tar.gz (32.8 kB view details)

Uploaded Source

Built Distribution

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

musion-0.4.0-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

File details

Details for the file musion-0.4.0.tar.gz.

File metadata

  • Download URL: musion-0.4.0.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for musion-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5e73e8a35529c9797fc320db8515c2770696cb7de1d3853b9c658d1c731bc8ff
MD5 669bf076f488a4763316aa4662b2c719
BLAKE2b-256 22d5b2e21f6f63baded497865638f7bcc0c3cb71dd4910dee49e64b8940e9d90

See more details on using hashes here.

File details

Details for the file musion-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: musion-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 36.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for musion-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc08311c115422f7c9979cb40c96f259e8469387db8724dba8fff8960c19cb80
MD5 6ac9bd088c3bfca764ca2192da14ab24
BLAKE2b-256 45a708c75aada95a8e42a4e89fafcad56b1c7d39b29c090b4e2d67cc5a3575dd

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