All-In-One Metrical and Functional Music Structure Analysis
Project description
All-In-One Music Structure Analysis Model
NOTE: This is a work in progress
Installation
1. Install PyTorch
Visit PyTorch and install the appropriate version for your system.
2. Install the package
pip install git+https://github.com/CPJKU/madmom # install the latest madmom directly from GitHub
pip install allin1
3. (Optional) Install FFmpeg for MP3 support
For ubuntu:
sudo apt install ffmpeg
For macOS:
brew install ffmpeg
Usage
CLI
allin1 your_audio_file1.wav your_audio_file2.wav
The result will be saved in `./structures:
./structures
└── your_audio_file1.json
└── your_audio_file2.json
And a JSON analysis result has:
{
"beats": [ 0.33, 0.75, 1.14, ... ],
"downbeats": [ 0.33, 1.94, 3.53, ... ],
"beat_positions": [ 1, 2, 3, 4, 1, 2, 3, 4, 1, ... ],
"segments": [
{
"start": 0.0,
"end": 0.33,
"label": "start"
},
{
"start": 0.33,
"end": 13.13,
"label": "intro"
},
{
"start": 13.13,
"end": 37.53,
"label": "chorus"
},
{
"start": 37.53,
"end": 51.53,
"label": "verse"
},
...
]
}
Python
import allinone
# You can analyze a single file:
result = allinone.analyze('your_audio_file.wav')
# Or multiple files:
results = allinone.analyze(['your_audio_file1.wav', 'your_audio_file2.wav'])
A result is a dataclass instance containing:
AnalysisResult(
beats=[0.33, 0.75, 1.14, ...],
beat_positions=[1, 2, 3, 4, 1, 2, 3, 4, 1, ...],
downbeats=[0.33, 1.94, 3.53, ...],
segments=[
Segment(start=0.0, end=0.33, label='start'),
Segment(start=0.33, end=13.13, label='intro'),
Segment(start=13.13, end=37.53, label='chorus'),
Segment(start=37.53, end=51.53, label='verse'),
Segment(start=51.53, end=64.34, label='verse'),
Segment(start=64.34, end=89.93, label='chorus'),
Segment(start=89.93, end=105.93, label='bridge'),
Segment(start=105.93, end=134.74, label='chorus'),
Segment(start=134.74, end=153.95, label='chorus'),
Segment(start=153.95, end=154.67, label='end'),
]),
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
allin1-0.0.3.tar.gz
(16.6 kB
view hashes)
Built Distribution
allin1-0.0.3-py2.py3-none-any.whl
(19.7 kB
view hashes)
Close
Hashes for allin1-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91f106b53112fb506ccef928eb5ec86749486e18fd1b8d6f3ecfd8612351f370 |
|
MD5 | 9af7f949d8396d52c623ff95b1836aed |
|
BLAKE2b-256 | 31be14dc8a20dd2eff19348aa8b8c93185e0fc39b62ba804ff75ac30417ab9d0 |