Skip to main content

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

Project description

AbletonParsing

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.

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

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.2.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

abletonparsing-0.1.2-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: abletonparsing-0.1.2.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

Hashes for abletonparsing-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b106fc26df22ce9549c682e043981e2b3a71cbc9c7de71d96b2f1b24daadd44b
MD5 e5af626a7a08ac4aa2700462c2558097
BLAKE2b-256 94e69ed628a7b59df17707d66ee3fd52424ad2cc1a23bb9b23c14c8d68d7beb3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: abletonparsing-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.8 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

Hashes for abletonparsing-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c80aebfad5a600f1568e25718c82717c6695ced12fc69de115adc4ae9495a2f
MD5 d3c12d135cef7aac361c291f5d6f7f2f
BLAKE2b-256 3fa1149785ef482517adfc0e2b6c5748aaa2a28faac7a7bf035e4d6ae5b9cd2f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page