Announcement

Collapse
No announcement yet.

Python script converting an Ableton Live project to Blackbox XML

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Python script converting an Ableton Live project to Blackbox XML

    Hi,

    I’ve had the Blackbox for a while and really like it, however, from time to time it’s easier to make things in Ableton Live and more than once I’ve wanted to have an easy way to transfer a Live project to the Blackbox. With this in mind I started thinking if it would be possible to write a scrip to convert an .als file to a Blackbox XML file. Turns out this was possible!

    What my script does, at the moment, is it will read the tracks of an .als file and extract the following:
    • Extract Simpler settings
    • Extract Sampler settings
    • Extract clip sequences from Simpler and Sampler tracks, along with clip sequences from Ableton Analog tracks and assign these as MIDI sequences on the Blackbox
    • Extract audio clips as loop pads as loop pads on the Blackbox
    For Simpler and Sampler the following settings are extracted and converted:
    • Play start and end (loop is ignored)
    • ADSR settings (the coefficients used here could use some tweaking)
    • Multisample mappings
    As a note it won’t handle grouped Simplers/Samplers but expect it to be a standalone instrument.
    For sequences the following things are extracted and converted:
    • Each step
    • Division is assumed to be 1/16, however if 1/32 or 1/64 note lengths are identified this will be used
    • Sequence length
    • Assigned to its corresponding Simpler/Sampler/MIDI track
    For Audio clip tracks the following things are extracted:
    • Number of beats

    For Simpler/Sampler/Audio tracks all necessary samples are copied to a specified project folder where the preset file is also saved. All sample references in the preset files are referring here, so by copying the whole folder to the Blackbox preset folder all samples will tag along. Samples need to be in .wav format though.

    A significant limitation at the moment is that I’m working in Live 10 and I’m on Blackbox 2.1.5 so all of this was written based on this and function is not guaranteed for other versions. I’ve also only tested this on Mac (albeit two different ones). All code is written in Python and I’ve only used standard packages.

    I don’t really have any intention to do anything more fancy than this, so it will remain a simple command line script. There is some tidying up to do though that I'll have look at when I have the time, along with some slight changes I wanna do. I can try to provide limited support but I don’t have time to do any intricate things on this end (such as support for other versions of Live/Blackbox/OS). I’m willing, however, to take feature requests and of course the code is freely available on my github for anyone to modify in any way seen fit. I’m not a programmer by training and this is not my typical programming project so my code is probably not very efficient and tidy but I will to streamline it a bit along with more rigid commenting.

    For more information and instructions check my github:


    Best regards
    Max

    #2
    This is really really really cool! I was going to post that it would be really nice if 1010music documented their XML formats so I could use the Blackbox algorithmically, but this might be enough to get me going. I don't have Ableton but I do have plenty of ways to write XML algorithmically. It would be cool on the Nanoboxes too; sequence entry is a bit cumbersome on them.

    Comment


      #3
      Thanks!

      And do it! The Blackbox XML format really isn’t complicated. A project consists of a few hundred lines and is neatly organized. I could have a go at documenting it in near future and put up in the same project since I’ve figured out most of it already.
      The Ableton projects (.als) are a completely different story and while I can provide some knowledge on that I won’t even begin to document the whole thing. The .als files are basically gzipped XML files but each project consists of a few hundred thousand lines. Neatly structured but veeery long.

      Comment


        #4
        Originally posted by pro424 View Post
        Thanks!

        And do it! The Blackbox XML format really isn’t complicated. A project consists of a few hundred lines and is neatly organized. I could have a go at documenting it in near future and put up in the same project since I’ve figured out most of it already.
        The Ableton projects (.als) are a completely different story and while I can provide some knowledge on that I won’t even begin to document the whole thing. The .als files are basically gzipped XML files but each project consists of a few hundred thousand lines. Neatly structured but veeery long.
        Sounds cool. I have a project already that writes MIDI files but there's something in them that the Blackbox doesn't like. There are a couple of other tools that won't read these files so I know it's not a Blackbox issue.

        Comment


          #5
          I'm still over here trying to figure out what exact hex characters I need to write within the 'inst' section of a WAV file so that VST multi-samples created in MPC Beats can have velocity recognized by the BlackBox. For some reason, I've only seen a few cryptic posts about it, so have been trying to reverse engineer it from WAV files created by the BB multi-sampling. Once I decode the exact values, I'd like to write a Python script to do it in bulk to folders of samples.

          Comment


          • pro424
            pro424 commented
            Editing a comment
            Actually, this script does not write anything to the wav files. In the Blackbox XML there’s an asset element for each sample part of a multisample instrument which specifice how it should behave. This script weite one asset for each sample part. The pro of this is I don’t have to alter the wav files in any way. The major drawback is that the multisample instrument only works properly in the preset generated by the script.

          • byrdinbbylon
            byrdinbbylon commented
            Editing a comment
            Yeah, that is a drawback indeed. Someone did post a better site for describing the inst seqment of the WAV, so I'll keep after my efforts.

          • byrdinbbylon
            byrdinbbylon commented
            Editing a comment
            update. I was able to figure out what hex characters are needed and am about to start coding a script to add them. Once done, I'll test it out to be sure the layers are actually recognized by the Blackbox.

          #6
          Wow ! did it work fro everyone ? amazing

          Comment


          • pro424
            pro424 commented
            Editing a comment
            Haven’t heard from anyone who tried it. Works for me which is why I made it updated my Blackbox to 3.0.9 last week so now I’m slowly started to update the script to handle that. Might attempt something with scenes being converted to song sections and utilization of the four patterns per sequence. Will take a while though.

          #7
          Oh that looks fantastic. I got into the habbit of making a prep session in ableton anyway before I export samples and midi files. This would drastically speed up my workflow!

          You have any data if this works with live 11? I guess I could also just download the version you have for prepping...

          Comment


          • pro424
            pro424 commented
            Editing a comment
            Since I don't own Ableton Live 11 I haven't had any projects made there to test it with. If you send me a .als file I could have a look how similar it is.
            As I wrote above I will try to update it for Blackbox 3.0.9 to make the most use out of it. While it works as is now for most part I've noticed some problems when opening projects made in 2.1.5 on 3.0.9. Since you already have a workflow for making a template in Live I'd love to hear more about it to make some kind of standardization on conversion.
        Working...
        X