Need some advice #26
Replies: 2 comments
-
Hey there! I'm glad you found this tool useful. Just to clarify, for programmatic access to PyMusicLooper's features, the only thing you'll need would be the from pymusiclooper.core import MusicLooper
# String is prefixed with r to make it a raw string,
# so backslashes in the windows directory are not interpreted as an escape sequence
audio_file_path = r"F:\Musik zum Mixen\Test.wav"
try:
# MusicLooper loads the audio first from the given path
music_looper = MusicLooper(audio_file_path)
# Find loop pairs with the defaults
loop_pairs = music_looper.find_loop_pairs()
# Take the first / best ranked loop pair (interactive selection using a preview is encouraged though)
best_pair = loop_pairs[0]
loop_start = best_pair.loop_start
loop_end = best_pair.loop_end
# Play looping with the chosen loop start and end
music_looper.play_looping(loop_start=loop_start, loop_end=loop_end)
except Exception as e:
# An exception is raised if the audio fails to be loaded/analyzed, or if no loops were found
print(e) And that's it. If you don't want it to play from the beginning and start somewhere else, you can specify a # Play looping with the chosen loop start and end, starting from the loop directly
music_looper.play_looping(loop_start=loop_start, loop_end=loop_end, start_from=loop_start) Using other features instead of play_looping should be straightforward, but if there are any issues feel free to ask. I'll be adding better documentation for programmatic access to PyMusicLooper in the future, but in any case, hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Thanks a miilion for your kind and very helpful response Nabil. If you offer to ask some questions, I'll take advantage of that. Is it possible to filter for the Score and is it possible to define the amount of samples (or seconds) between the search for loops? I'm asking because it detects a lot of matches from 0 to1 from 1 to 2 and so on, I'm searching a way to configure it that way, that it starts looking from min1 to min2 , min3 to min4 - something like that. I like to get a better varation of loops from a track. I hope, I was able to explain it correct. Regards, |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm a beginner. Thank you for this wonderful tool! I need some advice.
What di I need to to in order for the most basics? Reading a track, analyze, and play the loop from given points using in my own Python script?
This is what I have: But it always plays the Track from beginning and not from
(loop_start=4084130, loop_end=4577835)
Regards,
Alfredo
Beta Was this translation helpful? Give feedback.
All reactions