Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add feature for parsing ableton ASD file #26

Closed
wants to merge 1 commit into from

Conversation

DBraun
Copy link

@DBraun DBraun commented May 18, 2021

Reference Issue

N/A

What does this implement/fix? Explain your changes.

This adds a function ableton_asd_to_time_map for parsing Ableton .asd warp files into a time_map list to be used with pyrb.timemap_stretch.

Any other comments?

Example usage:

import pyrb
import librosa

sr = 44100
bpm = 120.

y = librosa.load('song.wav', sr=sr)[0]
time_map = pyrb.ableton_asd_to_time_map('song.wav.asd', y, sr, bpm)
new_song = pyrb.timemap_stretch(y, sr, time_map)

from scipy import io
import scipy.io.wavfile
io.wavfile.write('new_song.wav', sr, new_song )

I wrote the code after reading https://github.com/jtxx000/extract-warp-markers. That project showed how to extract the BPM. I did some extra probing to find out how to get other fields such as loop_start, loop_end, start_marker, end_marker, loop_on. I think having that information could be really useful for other developers. Perhaps pyrubberband could handle looping one day.

It's possible that this function could break if Ableton changes their ASD format... But I still think it's worth sharing. I'm using Ableton 10.1.30.

@bmcfee
Copy link
Owner

bmcfee commented May 19, 2021

Thanks for this -- it's certainly an interesting feature!

That said, I think it might be better handled as a stand-alone tool or package that produces time-maps we can feed into pyrb.time_stretch (or use outside of pyrb entirely). This will make it easier in the future to decouple updates in case the ASD format does change.

I also don't have ableton, or a machine capable of running it, so it's impossible for me to test this.

If you want feedback on the code in the PR, I'm happy to provide it, but I don't think we'll merge this.

@DBraun
Copy link
Author

DBraun commented May 19, 2021

That's a good call. Thanks for your feedback. I'll try to put it in a separate repo soon.

@DBraun DBraun closed this May 19, 2021
@DBraun
Copy link
Author

DBraun commented May 19, 2021

https://github.com/DBraun/AbletonParsing Here it is. It's been a long time since I tried to package up a real python module for distribution/peer review, so all feedback is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants