As you might know Audacity has the ability to do some very nice audio analyzing like beat finding etcetera and displays this data as Labels. These Labels can be exported to a simple .txt file. To make use of this within Blender I wrote a little Add-on which converts these Labels into Timeline Markers (not the actual Label names but just the start times for each Label).
[EDIT] Iāve also included an Add-on which does the reverse and saves Blenderās Timeline Markers to an Audacity Labels (.txt) file.
Iām not a programmer so forgive me if my code is being very sloppy, but it seems to work fine for me so I just wanted to share it, maybe itās useful for someone out there as wellā¦
(btw. I forgot if Audacity comes standard packed with those awesome analyzing tools, if not I think to remember I got those extra plugins with Sonicvisualiser, either way the Label system is a standard feature of Audacity)
The Add-ons are in the AudacityLabelsAddons.zip attachment. An example labels.txt file generated by Audacity is also available in the attachments. Current version:0.3
I was wondering if there is a way to reverse the process and send markers to Audacity? For example I might like to indicate where edits or animation beats occur in Blender and use them as ques in Audacity.
A little update to V 0.2 alpha(you can get it from the attachment in the first post).
Some analyzing plugins apparently write commas instead of points in the labels.txt files which caused the script to fail, that should be fixed now. Also the the scene doesnāt have to be called āSceneā anymore.
@3pointEdit
Yes, that should be possible. Iāll have a look into that as well, but no promises since Iām just learning bits of python on the go. :rolleyes:
@zeffii
hEyA, thanks mate! I had been working on my own version, before I had a look at your post, and almost got it working, but your code is much cleaner anyway and it actually works!
Iāve made minor adjustments to your code so itāll save the output in a manner Audacity understands. Since I wanted to just focus on Markers and Labels I also took out the Keyframing part, hope you wonāt mind.
Iāve added the Markers2Labels.py to the attachment in the first post.
Thanks again, great job!
Do either of you think itās possible to send cut media from vse to audacity. That is trimmed tops and tails then placed at the correct time? Not sure of audacity does some sort of omfi import.
@zeffii
Although coding doesnāt come naturally to me (something which takes me hours to do, you probably write in minutes), I did have learnt something about it! :yes:
When I have the time and am able to wrap my head around it, Iāll try to make these scripts as an import/export add-on with proper file selections, and also include the more pythonic manner as you as used above.
For now Iām just glad itās actually usable.
@3pointEdit
Think that should be possible as well, but Iām afraid Iāll be well over my head trying to make something like that. :spin:
Iāve made both import and export scripts available as addons! For ease of use Iāve also implemented proper file selections. When activated theyāll be accessible from the Info, File, Import/Export menu.
You can download the addons at the first post. If you donāt know how to install addons the .zip file also contains a README.txt which should explain all of that.
@zeffii
Ah pretty useful indeed, although I only used it with the import part since I couldnāt quite figure out how to use it for the export part.
That is really cool for sending my mixdown to Audacity for sound post. I wonder if I can automate Blender to place markers at VSE strip start and end frames? They would become cutpoints (unless a sounmd overlaps of course)
@3pointEdit
Yes, thatās possible. I gave it a little go and came up with this:
## This should place Timeline Markers at the start & end of each
## selected strip in the Video Sequence Editor. gREEtZ, tumtidum.
import bpy
scene = bpy.context.scene
default_frame = scene.frame_current
default_area = bpy.context.area.type
bpy.context.area.type = ('TIMELINE')
seq = bpy.context.selected_sequences
a = (len(seq))
b = 0
if a > 0:
print('---')
while b < a:
scene.frame_current = (seq[b].frame_final_start)
bpy.ops.marker.add()
scene.frame_current = (seq[b].frame_final_end)
bpy.ops.marker.add()
b=b+1
bpy.ops.marker.select_all(action='TOGGLE')
else:
print('No strips selected...')
scene.frame_current = default_frame
bpy.context.area.type = default_area
Not sure how buggy it is, but again also this seems to work quite fine⦠itās almost like Iām actually starting to understand a thing or two about python⦠:eek:
Omg. Youāre smarter than me! Thanks. Would you mind commenting the lines of the script so I could understand the process better. Especially the definitions at the start?
## This should place Timeline Markers at the start & end of each
## selected strip in the Video Sequence Editor. gREEtZ, tumtidum.
import bpy
scene = bpy.context.scene
## Getting the current frame and assign it to "default_frame" so it can be set
## back at the end of the script. Not really needed, but just neat.
default_frame = scene.frame_current
## Getting the current area type (which in this case is Text Editor) and assign
## it to "default_area" so it can be set back at the end of the script.
default_area = bpy.context.area.type
## Set area type to Timeline which seems to be required in order to be able to place Markers.
bpy.context.area.type = ('TIMELINE')
## Assigning "seq" to the list of selected strips.
seq = bpy.context.selected_sequences
## Getting the length of "seq", thus amount of selected strips.
a = (len(seq))
## Will be used to iterate through selected strips, starting at the first strip.
b = 0
## Check if any strips are selected.
if a > 0:
## If so..
print('---')
## Keep repeating the following code untill amount of selected strips is met.
while b < a:
## Set current frame to start of strip b
scene.frame_current = (seq[b].frame_final_start)
## Place marker
bpy.ops.marker.add()
## Set current frame to end of strip b
scene.frame_current = (seq[b].frame_final_end)
## Place marker
bpy.ops.marker.add()
## Current strip will become next strip (unless it's already the last one)
b=b+1
## For deselecting last (all) Marker, not really needed but just neat.
bpy.ops.marker.select_all(action='TOGGLE')
## If no strips where selected in the first place...
else:
print('No strips selected...')
## Setting back the frame to where it was before the script was executed.
scene.frame_current = default_frame
## Setting back the area type to where it was before the script was executed.
bpy.context.area.type = default_area
Ah, man this is great! I was just looking for a way to extract BWF markers embedded in WAV files. My Tascam DR40 can embed those(and I believe most of the Zoom recorders can do this too), but I havenāt found any software which actually can extract those. But a coder has actually coded the function to do it in python for Audacity, but they havenāt added it yet to the releases(if they ever will). Would it be possible to add it to Blender?