Skip to main content

Python module for parsing Ableton Live ASD clip files containing warp markers.

Project description

AbletonParsing

CI PyPI version

Parse an Ableton ASD clip file and its warp markers in Python. This module has been tested with .asd files saved with Ableton 9 and Ableton 10.

Note: Ableton Live 12 uses a different binary format that is not yet supported by this library.

Install

pip install abletonparsing

Development Dependencies

To run the tests, you'll need to install additional dependencies:

# On macOS
brew install rubberband

# On Ubuntu/Debian
sudo apt-get install -y rubberband-cli

# Install Python test dependencies
pip install abletonparsing[test]
# or
pip install -e ".[test]"  # for development

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

If loop_on is false, then loop_start will equal the start_marker, and loop_end will equal the end_marker.

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


Download files

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

Source Distribution

abletonparsing-0.1.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

abletonparsing-0.1.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file abletonparsing-0.1.3.tar.gz.

File metadata

  • Download URL: abletonparsing-0.1.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for abletonparsing-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bc32a2dc96ac1b78f6cd47e11fbaf74c777f6b67f130ee7b49b1cea8b9cd85ba
MD5 1e146eb3b98b9a6cef07bc3d40a2e5fe
BLAKE2b-256 2ef55386f74659926a8851577305f1083ceccfb62803e7e47aed29bd392de62c

See more details on using hashes here.

File details

Details for the file abletonparsing-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: abletonparsing-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for abletonparsing-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 444eac38daa6e160c7be5f8ceff2bff1d151e76d849ba265ce94b82c2b6dc289
MD5 b5f2db0414833d10f68d60cfa85cc4ca
BLAKE2b-256 cf5ef8e31535f6483801d8790c65871ea8416429234a578d46aee7e898b0166d

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