We'll also demo Archaeopteryx playing drums, switching tempos, and, without any human intervention, creating a live drum and bass remix.
Technically I can get away with that boast just by demoing Arx improvising original drum patterns on top of an 80s song.
But I wanted to do something more interesting than that. One necessary milestone: activating and deactivating clips in Ableton Live while controlling the tempo by sending MIDI to Live's tap tempo control. This was pretty easy to do.
The branch on GitHub.
Tangent: I'm using branches for everything with Arx because the code's a mess and I want it to get even messier. You've got to do some nasty hacking before you make stuff pretty - most of the real ugliness in Archaeopteryx comes from attempts to design the solution before I had built any hacks.
Anyway - the way this code works is it creates a
Messageclass, similar to a MIDI
Note, and then sets up several
Clipobjects, representing Clips in Ableton Live. In practice these are just wrapper classes on
Messages. I also created a similar
TapTempoclass which is essentially a hard-coded MIDI message.
You have to manually set the correlation between MIDI messages and elements of the Live UI. That's a topic for a Live tutorial, but Archaeopteryx includes a script called
pulse.rbto handle that. I finally gave it command-line args as part of this branch.
The looping code in Archaeopteryx expects generators to exist, which it can call
playon. I expanded this for MIDI messages with
I already had a
Mixclass in Arx for situations where you want more than one generator, so I gave it a
sendmethod and then subclassed it as
ExclusiveMixfor situations where you have a collection of
Clips and you only want to play one at a time. (In Ableton, Clips in Tracks can only play one at a time.)
To use this stuff, I wrote a script called
fruit_machine.rb(named after "Fruit Machine" by the Ting Tings, which is one of the songs I'm mashing together here).
Here's how it works. First you create a new
Cliprepresenting the Clip (A) you want to control in Ableton Live. Next (B) create an
ExclusiveMixof all the
Clips which run in the same Track. (In fact,
ExclusiveMixshould be called
Track.) Then create a new loop (C), which I call an
Arkxfor very foolish legacy reasons, and last (D) create a
This API will probably change in future, since it sucks.