Augmenting the Lauchpad with Python remote scripting

Discuss music production with Ableton Live.
Post Reply
RegD
Posts: 46
Joined: Sat Nov 30, 2013 4:54 pm

Augmenting the Lauchpad with Python remote scripting

Post by RegD » Wed Jul 02, 2014 2:25 pm

Hey guys,

I am currently trying to alter the USER1 MODE and USER2 MODE of the Novation Launchpad and I could use some help.

Basically instead of having 2 4x8 columns of notes in the USER1 MODE I want just one 8x8 column. And I want the notes to be translated to a major scale. I have managed this by using the _Framework.ControlSurface's _translate_message(MIDI_NOTE_TYPE, original_note, 0, new_note, new_channel) on the launchpad.py file.

From there, I would like to build many things but the first one that I can't seem to be able to is getting the LED feedback when a button is pressed. I haven't been able to locate the code where I can implement this function. Does any one know? Weirdly, in Live, if I set a track receiving MIDI in from channel 5, I can see the notes like I programmed them but if I set the track to send midi out to the launchpad on channel 5 no light is getting turned on in the USER1 MODE...

Thanks for any help!
R

RegD
Posts: 46
Joined: Sat Nov 30, 2013 4:54 pm

Re: Augmenting the Lauchpad with Python remote scripting

Post by RegD » Thu Jul 03, 2014 12:21 pm

Hi again,

Still having some trouble getting the LED feedback in User modes.

I found out that Launchpad receives midi data from Live on Channel 1, even in User1 mode. But the way the notes are mapped is according to the drum rack (two 4x8 columns from bottom to top) and I am struggling changing this paradigm (from Live to the Launchpad - I managed the other way around).

For instance on my custom-mapped User1 page, if I hit the note C1 (which is now in the middle of the grid) then the bottom left pad will light up coz it corresponds to C1 in the original drum rack mapping.
Additionnally I only manage this using a MIDI track listening to the Launchpad on channel 5 and sending out midi to the lauchpad on channel 1. So this is not great at all.

I tried to temper the method _send_midi(self,midi_bytes) within the file Launchpad.py but it seems this is just for initiallization then hitting a pad doesn't call this method...

Can anybody point me what method I should alter?
Thanks!
R

RegD
Posts: 46
Joined: Sat Nov 30, 2013 4:54 pm

Re: Augmenting the Lauchpad with Python remote scripting

Post by RegD » Mon Jul 07, 2014 1:36 pm

I've pinpointed the issue to come from button.set_enabled((not release_matrix)) in MainSelectorComponent. This is forwarded to ConfigurableButtonElement and used in the install_connections method (which is forwarded to InputControlElement). So if release_matrix is True then we get the button connected normally with a listener, callback and so forth. And if release_matrix is False then the button is more or less ignored by the script ans Live interprets it as a potentially usable midi signal (little square light flishing at the very top right of the Live screen). But in the latter case I am not managing to do anything with the Midi signals in the python scripts as the listener is bypassed so it means I can't even light up the LED of that button, which is lame.

I have struggled, strived and even toiled trying to combine those two states together (midi signals passing over to Live so they can trigger intrument notes and at the same time having some LED feedback when buttons are held down) but they seem imcopatible! I can't believe it, there must be a way, right?

Help, please... anybody?

RegD
Posts: 46
Joined: Sat Nov 30, 2013 4:54 pm

Re: Augmenting the Lauchpad with Python remote scripting

Post by RegD » Wed Jul 23, 2014 9:48 am

Well I have managed to achieve more or less what I had in mind but had to resort to tricks - third part MIDI routing soft (such as Bome's MT or MIDI OX) and Live MIDI tracks sending back MIDI to the Python script. That's a bit disapointing but I think there are some limitations in using only Python due to the fact that Live asks the Python script how to interpret and what to do with the MIDI signal but the script itself cannot do everything for instance clone a MIDI signal (as far as I understand it)
@TomViolenz
you're probably gonna say I told you so ;)

TomViolenz
Posts: 6854
Joined: Mon Dec 13, 2010 6:19 pm

Re: Augmenting the Lauchpad with Python remote scripting

Post by TomViolenz » Wed Jul 23, 2014 10:57 am

Skyter wrote:Well I have managed to achieve more or less what I had in mind but had to resort to tricks - third part MIDI routing soft (such as Bome's MT or MIDI OX) and Live MIDI tracks sending back MIDI to the Python script. That's a bit disapointing but I think there are some limitations in using only Python due to the fact that Live asks the Python script how to interpret and what to do with the MIDI signal but the script itself cannot do everything for instance clone a MIDI signal (as far as I understand it)
@TomViolenz
you're probably gonna say I told you so ;)
:mrgreen:
Once you started using Bomes you will see how much more you can do. To an outside observer it will look like magic.

But one problem I stumbled upon, and maybe you already found out about it, is how to get values of parameters in Live, that you didn't set using Bomes into Bomes?!
Let's say my SendA value on track 1 is at the midway point, set that way using something not routed through Bomes, like with my Push for instance, now I would like Bomes to know that this Parameter is already at mid point and not 0, so that I can store that in a global variable and have a translator return to that value later. Do you have an idea how that could be achieved?

RegD
Posts: 46
Joined: Sat Nov 30, 2013 4:54 pm

Re: Augmenting the Lauchpad with Python remote scripting

Post by RegD » Fri Aug 01, 2014 3:55 pm

Hey TomViolenz,
Well you might get disappointed but I am using Midi OX not Bomes, I just needed to create some channel clones and filter out some MIDI data (the main processing still happens within the Python script :) so MIDI OX was enough for me.
So sorry can't really help you out here. I am pretty sure what you want would be feasible to do in Python but then I am not sure how it communicates with Bomes... you might have more luck with M4L..? good luck

Post Reply