Web hosting

Thursday, July 9, 2015

Ableton and Ableton Push Hacking

For those who have been tracking this blog, it's been obvious that I've recently been spending more and more time with the Ableton Push.

If you don't know what this is please see the following...
Easy to miss Push features
Helpful Push information.

Jeremy Ellis meets Ableton Push
Mad Zach Push Performance Walkthrough
Decap Push Performance

It's basically an advanced, modern musical instrument/MIDI controller.

There have been others who have attempted to de-compile and extend/modify the behaviour of the device but while information and the extensions that have been provided have been interesting and useful they have been somewhat limited.
ableton: just release the py midi remote scripts
Live 9 MIDI Remote Scripts revealed...

I'm beginning to understand why. The following link provides an update to automatically generated documentation (via epydoc) of decompiled Ableton Remote Script code (my scripts for decompilation and automated documentation have been included in the package).


If you want to make any additional modifications of behaviour you'll need to be aware of the following:
- you'll need to catch up on your Python coding
- you'll need knowledge of how the device works, music and mathematical theory, Ableton, and core computing knowledge. It is not sufficient to know how they work seperately. You need to know how everything fits together.
- sounds obvious but start small and move up. This is critical particularly with reference to the awkward style of programming that they can sometimes resort to. More on this to below
- the code can vary in quality and style quite significantly at times. At times it seems incredibly clean, elegant, and well documented. At other times, it there is no documentation at all and doesn't seem to be well designed or engineered or have keep maintenance in mind. For instance, a commonly used design pattern is MVC. This doesn't seem to follow that. They use a heap of sentinels throughout there code. Moreover, the characters that are used can be a bit confusing. They don't use preprocesser directives/constants where they may be better suited. If you break certain aspects of the code you can end up breaking a whole lot of other parts. This may be deliberate (to reduce the chances of third party modification which is likely particularly as there seems to be some authentication/handshake mechasnisms in the code to stop it from working with 'uncertified devices') or not (they lack resources or just have difficult timelines to deal with)
- be prepared to read through a lot of code just to understand/make a change to something very small. As stated previously strictly speaking at times they don't adhere to good practice. That said, other aspects can be changed extremely easily without breaking other components
- due to the previous two poits it should seem obvious that it can be very difficult to debug things sometimes. Here's the other thing you should note,
- the reason why Ableton suffers from strange crashes and hangs from time to time becomes much more obvious when you look at the way they code. In the past, I've built programs (ones which rely on automated code generation in particular) that relied on a lot of consecutive steps that required proper completion/sequencing for things to work properly. When things work well, things are great. When things break, you feel and look incredibly silly
- you may need to figure out a structure for ensuring and maintaining a clean coding environment. I try to have two screens with one for clean code and another for modified code. Be prepared to restart from scratch by reverting to a clean pyc code and only one or a small number of modified py files.
- caching occurs in situations where you may not entirely expect. If you can not explain what is happening and suspect caching just restart the system. Better yet, maintain your development environment in a virtual machine to reduce hardware stress caused by continual restarts.
- you will need patience. As stated previously, due to the way code has been structured (sometimes) you'll need to understand it properly to allow you to make changes without breaking other parts. Be prepared to modify, delete, or add code just to help you understand it
- if you've ever dealt with firmware or embedded devices on a regular basis you would be entirely familiar with some of what I'm talking about. Like a lot of embedded devices you'll have limited feedback if something goes wrong and you'll be scratching your head with regards to how to work the problem
You may require a lot of Linux/UNIX based tools and other debugging utilities such as IDA Pro, Process Explorer and Process Monitor from the Sysinternals Suite. Once you examine Ableton using such utilities, it becomes much clearer how the program has been structured, engineered, and designed. One thing that can cause mayhem in particular is the Ableton Indexer which when it kicks in at the wrong time can make it feel as though the entire system has frozen.
Ablton indexing Crashes
(42474187) Disable "Ableton Index" possible?
The actual index file/s are located at
C:\Users\[username]\AppData\Roaming\Ableton\Live 9.1.7\Database
- the most relevant log file is located at,
C:\Users\[username]\AppData\Roaming\Ableton\Live 9.1.7\Preferences\Log.txt
The timestamps works on the basis on amount of time since program startup. Time of startup is clearly outlined.
Ableton takes 130 - 2 mins to start up ?
Delete it if you need to if you get confused about how it works.
- be aware that there are some things that you can't do anything about. The original Novation Launchpad was considered somewhat sluggish in terms of refresh rate and latency. The electronics were subsequently updated in the Novation Launchpad S to deal with it. You may encounter similar circumstances here.
Push browser - slow, freezing, sluggish :(
- they have a strong utility/systems engineering mentality. A lot of files are archives which include relatively unobfuscated content. For instance, look in a
C:\Users\[username]\AppData\Roaming\Ableton\Live 9.1.7\Live Reports
and you'll find a lot of 'alp' files. These are 'Crash Reports' which are sent to Ableton to help debug problems. Rename them to a gz file extension and run it through hexedit. Same with 'adg' audio device group files. Rename to gz and gunzip to see a flat XML file containing some encoded information but mostly free/human readable content. It will be interesting to see how much of this can be manually altered achieving flexibility in programming without having to understand the underlying file format.
- each version of Ableton seems to have a small version of Python included. To make certain, advanced extensions others have suggested installing a libraries seperately or a different version of Python...
- be prepared to learn multiple protocols and languages in order to make the changes that you want
How to control the Push LCD text with sysex messages

For a lot of people, the device seems incredibly expensive for what amounts to a MIDI controller. It was much the same with me. The difference is that it's becoming increasingly clear how flexible the device can be with adequate knowledge of the platform.
Push feature requests
The Ableton Push is a good platform but it will never realise it's full potential if the software isn't upgraded.

If you are interested in signing up to test the latest Beta version of Ableton please see the following...

Bible Codes, Random Stuff, and More

On Bible Codes: Obviously, I am somewhat curious about the origin of religion... Recently, I came across a book called 'Bible Code...