Python module for parsing Ableton Live ASD clip files containing warp markers.
Project description
AbletonParsing
Parse an Ableton ASD clip file in Python.
Install
pip install abletonparsing
API
Clip class:
- .loop_on - ( bool , READ/WRITE ) - Loop toggle is on
- .start_marker - ( float , READ/WRITE ) - Start marker in beats relative to 1.1.1
- .end_marker - ( float , READ/WRITE ) - End marker in beats relative to 1.1.1
- .loop_start - ( float , READ/WRITE ) - Loop start in beats relative to 1.1.1
- .loop_end - ( float , READ/WRITE ) - Loop end in beats relative to 1.1.1
- .hidden_loop_start - ( float , READ/WRITE ) - Hidden loop start in beats relative to 1.1.1
- .hidden_loop_end - ( float , READ/WRITE ) - Hidden loop end in beats relative to 1.1.1
- .warp_markers - ( list[WarpMarker] , READ/WRITE ) - List of warp markers
- .warp_on - ( bool , READ/WRITE ) - Warping is on
- .sr - ( float , READ/WRITE ) - Sample rate of audio data
WarpMarker class:
- .seconds - ( float , READ/WRITE ) - Position in seconds in the audio data.
- .beats - ( float , READ/WRITE ) - Position in "beats" (typically quarter note) relative to 1.1.1
Note that if loop_on is true, then hidden_loop_start will equal the loop_start, and the hidden_loop_end will equal the loop_end. If loop_on is false, then loop_start will equal the start_marker, and loop_end will equal the end_marker. In both cases, the value of loop_on does not affect the absolute value of hidden_loop_start or hidden_loop_end.
Example
import abletonparsing
import librosa
import soundfile as sf
import pyrubberband as pyrb
bpm = 130.
audio_path = 'drums.wav'
clip_path = audio_path + '.asd'
audio_data, sr = librosa.load(audio_path, sr=None, mono=False)
num_samples = audio_data.shape[1]
clip = abletonparsing.Clip(clip_path, sr, num_samples)
time_map = clip.get_time_map(bpm)
# Time-stretch the audio to the requested bpm.
output_audio = pyrb.timemap_stretch(audio_data.transpose(), sr, time_map)
with sf.SoundFile('output.wav', 'w', sr, 2, 'PCM_24') as f:
f.write(output_audio)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abletonparsing-0.1.1.tar.gz.
File metadata
- Download URL: abletonparsing-0.1.1.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9f21caaeb44a6eaadf659bc488f664e14a3203b4a665d3ece65053bda673659
|
|
| MD5 |
d56b5772523f60832644029de5525950
|
|
| BLAKE2b-256 |
afe0bc5e2eb063198c3056f321a9fde90fe1ff74cd5c86cadb1f9d5a3f3067a0
|
File details
Details for the file abletonparsing-0.1.1-py3-none-any.whl.
File metadata
- Download URL: abletonparsing-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ecfdb92ddef62c5bb1ddb48c0a82bfeac1859975fb3fa11bebf9522997f1c45
|
|
| MD5 |
197eb2cf0c7edf4dfcf0bb8cd83e1b67
|
|
| BLAKE2b-256 |
a7b9763d1cb509e45507b856fa04206457187bdf9fe3ed60028181d7cc2a3244
|