APC40 LSX BPM Controller - V2
Version 2 of this little doohickie is here...
One of the things that I really wanted to accomplish with using the APC40 with LSX is to get things to work as closely as possible with the way things work, say when a musician is using the APC40 to control Abelton Live. They tap a tempo, select the quantization value, and select clip-launch buttons, and the clips play in tempo.
Well, LSX doesn't have a way to sync its playback to BPM. This update of the APC40 LSX Controller is an attempt to get LSX to understand BPM.
Note: This was not 100% successful - please read below for the full details
Here is a screenshot of the new app in action:
And a photo of the APC40 running LSX:
The UI has been polished a bit - and there is now a Tempo section. Things you can do with the tempo section include:
* Tap tempo to establish a tempo - you can tap tempo using your mouse and clicking on the TAP butotn, or use the Tap Tempo button on the APC40.
* Use your mouse to adjust the tempo - which decimal place you click on determines the scale of adjustments.
* Use the APC40 tempo knob to adjust the tempo. Rotating the knob by itself inc/decs the tempo by 1bpm. Holding the shift key down inc/decs the tempo by 1/10th bpm
There is also now simple transport control for LSX. Click the Play button on the App or on the APC40 and your show starts playing. Click play again and it stops. Its a toggle, and the LED on the APC 40 indicates whether the show is playing or not. Note though, that if you stop playback using LSX - it does not update the state of the APC40 (yet).
Also, there are now more colors defined for the clip-launch buttons. The APC40mk2 supports a theoretical RGB color range for the LEDs of the clip-launch buttons. In reality, the colors are quite limited. You can now choose from a larger palette of colors.
How to get things up an running in LSX
* Download the APC40 LSX-BPM Controller app
APC40 LSX BPM Controller
* If you don't already have a Windows app for creating virtual MIDI channels (shame on Microsoft for not making this part of the OS), then download one of the following programs - this create virtual MIDI ports that we will use to pass MIDI data from the APC App to the Laser Show software.
LoopMIDI
LoopBe
All we need from one of the apps is to create a virtual MIDI port - with loopMIDI it's as simple as launching the app and hitting the + button to add a virtual MIDI port.
Next, we need to setup the APC40 Max app
* Launch the APC40-LSX app
* Doubleclick on the midiout button labeled FROM APC and select your APC40
* Doubleclick on the midiin button labeled TO APC and select your APC40
* Doubleclick on the midiout button labeled MIDI Through - and select the virtual MIDI channel created above. This is how the app communicates with LSX.
* Under the "Select APC Model" step, choose the make of your APC40 - I haven't tested with an APC40mk1, but it should work. This will put the APC40 in "Live" mode and allow us to control the colors and behavior of the clip launch buttons.
You should now be able to select any of the dropdowns to change the color of any of the clip-launch buttons.
Setting up LSX
I have now included template files for getting things running in LSX.
Template Files
* apc40-bpm-template.rtd
This is a template show that should just automatically set everything up (though maybe not the midimap file) - it has a number display which shows the current BPM value received from the APC40 app (rounded for display only - internally its a fp number). It also has a flashing green circle which should flash on at every beeat.
* apc40-bpm-midimap.MRM
This is the file that defines the MIDI mapping from the APC 40.
* APC40-bpm-simplified.SFX
This is a loop event that handles all of the math of converting MIDI events from the APC40 app to LSX timeline events. This should automatically be included if you load the apc40-bpm-tempalte show.
Caveats about getting BPM Tempo to work with LSX
When using the Live Show mode in LSX, you set the clock to Live Mode - which allows you to use an expression to control the playback speed - called Timeline Speed. My thought was that if I just figure out the scaler factor to go from BPM to this timeline speed, we can have BPM support in LSX.
After lots of trial and error, it seemed pretty simple. Here is the equation:
ts = BPM/(124.5*quantValue)
ts is a timeline speed value with the limits set 0 - 50.
where BPM is the standard beats per minute unit, and quantValue is a number that determines how many beats we want per cycle (loop). quantValue is actually scaled so that a value of 1 means that the loop repeats at 16th note intervals - with a value of 4 it repeats at quarter note intervals, a value of 16 it repeate at 4 beats (or 1 measure in 4/4 timing), etc...
This was all well and good in theory. However, what I have discovered is that there is some non-linearity to this equation.
This non-linearity can best be seen by a graph of the ts values at various BPM values:
In calculating these values - I kept the quantValue static and simply adjusted the BPM and then played around with the ts value until it synced up perfectly for at least 10 measures.
Once I found a ts value that synced up, it stayed in perfect sync for a long time. The problem is that these ts values don't seem to follow any linear relation to the BPM chosen.
So, yeah, I don't understand why this is.
It is still usable - just not over a wide range of BPM values. Hopefully at some point in the future I will gain some insight into how the timeline speed effect actually effects playback speed and how it relates to BPM (or any frequency unit).
Let me know if you wanna use this and need help setting it up. Also let me know if you have any insight into how to better map BPM to Timeline Speed. I would love to get that 100% perfect.