help needed modifying push scripts

Discuss Push with other users.
Post Reply
neuromodulator
Posts: 85
Joined: Mon Dec 07, 2009 6:05 am

help needed modifying push scripts

Post by neuromodulator » Thu May 02, 2013 2:57 am

I want to modify the push script so that I can toggle a step sequencer on or off for a particular track, whether it's a drum rack or no. One way that occurred to me to do that would be to modify the script not so it queries the track about the existence of a drum rack, but only whether the selected device is a drum rack. Then by toggling the selected device, I could be toggling between the two modes. But I can't get the wording right; all my attempts to redefine the presence of a drum rack result in a non-working Push. A little help?

(An alternate method would be to be able to set the value via a max for live toggle, but I figure this is more complicated because Live wants to do other things (for instance, select a drum pad) based on the presence of a drum rack that the first method would comply with but this alternate method would not...)
def _select_note_mode(self):
"""
Selects which note mode to use depending on the kind of
current selected track and its device chain...
"""
track = self.song().view.selected_track
drum_device = find_if(lambda d: d.can_have_drum_pads, track.devices)
self._step_sequencer.set_drum_group_device(drum_device)
if track == None or track.is_foldable or track in self.song().return_tracks or track == self.song().master_track:
self._note_modes.selected_mode = 'disabled'
elif track and track.has_audio_input:
self._note_modes.selected_mode = 'looper'
elif drum_device:
self._note_modes.selected_mode = 'sequencer'
else:
self._note_modes.selected_mode = 'instrument'
I assume it's all in here, and I've tried redefining drum_device with stuff like "= self.song().view.selected_track.view.selected_device.can_have_drum_pads" but I've obviously got something wrong.

Cheers!

neuromodulator
Posts: 85
Joined: Mon Dec 07, 2009 6:05 am

Re: help needed modifying push scripts

Post by neuromodulator » Thu May 02, 2013 3:17 am

I guess the other issue is whether my proposed method would refresh the controller properly (i.e. with a selected device change only, without toggling the track or what have you). I have no idea how to read the script to determine if that's the case, so any advice on that front would be great as well.

neuromodulator
Posts: 85
Joined: Mon Dec 07, 2009 6:05 am

Re: help needed modifying push scripts

Post by neuromodulator » Thu May 02, 2013 7:47 am

Gah, it appears to be more complicated. It's not just that I haven't got the syntax right above, but also that I can't insert any modifications in the remote scripts successfully. Like, including just opening the push.py and inserting a single character in one of the comment lines. Any modification breaks it. Is there some kind of error correction going on? Are the existing scripts online out of date and incompatible with the current scripts?

irrelevance
Posts: 463
Joined: Tue May 20, 2008 7:31 pm

Re: help needed modifying push scripts

Post by irrelevance » Thu May 02, 2013 8:34 am


Because789
Posts: 440
Joined: Thu Apr 28, 2011 1:26 pm

Re: help needed modifying push scripts

Post by Because789 » Thu May 02, 2013 10:48 am

neuromodulator wrote:Are the existing scripts online out of date and incompatible with the current scripts?
They are definitly out of date and very probably incompatible. The Push scripts are under heavy development, with each update there is a chance that you have to start from scratch (if you only want to make minor changes to the default script).

No help on you other questions, since I didn't dig into the scripts yet (because of the above reason).
Live 9.5 (64bit), Max 7.0.6, Windows 10, Push 2, Korg electribe2, Bass Station II, Launch Control XL, Faderfox DJ3

M4L

djlimbs
Posts: 143
Joined: Wed Dec 12, 2007 12:07 am

Re: help needed modifying push scripts

Post by djlimbs » Thu May 02, 2013 2:10 pm

neuromodulator wrote:Gah, it appears to be more complicated. It's not just that I haven't got the syntax right above, but also that I can't insert any modifications in the remote scripts successfully. Like, including just opening the push.py and inserting a single character in one of the comment lines. Any modification breaks it. Is there some kind of error correction going on? Are the existing scripts online out of date and incompatible with the current scripts?
yea the scripts Julien decompiled are out of date (last time I checked). some files weren't changed in updates but others were. you might get more luck if you contact NativeKontrol, get the PXT-Live script and ask about source for the file you wanna mod. Or try decompiling yourself (which was a pain to do, but possible on a Mac).

lo.key
Posts: 360
Joined: Tue Dec 22, 2009 7:05 pm

Re: help needed modifying push scripts

Post by lo.key » Thu May 02, 2013 4:17 pm


neuromodulator
Posts: 85
Joined: Mon Dec 07, 2009 6:05 am

Re: help needed modifying push scripts

Post by neuromodulator » Thu May 02, 2013 5:09 pm

Yeah, I tried that like an hour ago. There were bits of the test file I tried that it couldn't do. It's probably a later version of Python.

lo.key
Posts: 360
Joined: Tue Dec 22, 2009 7:05 pm

Re: help needed modifying push scripts

Post by lo.key » Thu May 02, 2013 5:43 pm

hmm, this one supposedly takes up to python 2.7

https://github.com/wibiti/uncompyle2

neuromodulator
Posts: 85
Joined: Mon Dec 07, 2009 6:05 am

Re: help needed modifying push scripts

Post by neuromodulator » Thu May 02, 2013 8:13 pm

Yeah, we're on the same page, lo.key. Don't know how the hell to use it, though. :)

I know I'm trying to do things that are beyond my knowledge, but it's fun. I love poking about with this stuff.

irrelevance
Posts: 463
Joined: Tue May 20, 2008 7:31 pm

Re: help needed modifying push scripts

Post by irrelevance » Thu May 02, 2013 10:21 pm

djlimbs wrote:
neuromodulator wrote:Gah, it appears to be more complicated. It's not just that I haven't got the syntax right above, but also that I can't insert any modifications in the remote scripts successfully. Like, including just opening the push.py and inserting a single character in one of the comment lines. Any modification breaks it. Is there some kind of error correction going on? Are the existing scripts online out of date and incompatible with the current scripts?
yea the scripts Julien decompiled are out of date (last time I checked). some files weren't changed in updates but others were. you might get more luck if you contact NativeKontrol, get the PXT-Live script and ask about source for the file you wanna mod. Or try decompiling yourself (which was a pain to do, but possible on a Mac).
Says the last update/upload for push script was 20 days ago. There hasn't been any Live updates in this time has there?

Because789
Posts: 440
Joined: Thu Apr 28, 2011 1:26 pm

Re: help needed modifying push scripts

Post by Because789 » Fri May 03, 2013 9:52 am

irrelevance wrote: Says the last update/upload for push script was 20 days ago. There hasn't been any Live updates in this time has there?
Only a change to BrowserComponent.py was added the 12th of april, all other Push scripts were uploaded the 3th of march. They are outdated.

Btw: the Live 9 scripts use python 2.5
Live 9.5 (64bit), Max 7.0.6, Windows 10, Push 2, Korg electribe2, Bass Station II, Launch Control XL, Faderfox DJ3

M4L

Post Reply