Understanding Push's button color codes

Learn about building and using Max for Live devices.
Post Reply
patrickstinson
Posts: 168
Joined: Thu Oct 13, 2011 5:01 am
Location: Anchorage, Alaska
Contact:

Understanding Push's button color codes

Post by patrickstinson » Mon Sep 15, 2014 8:08 am

I am trying to get a button to pulse smoothly from bright green to the darkest green, sort of like fading opacity. The problem is that there appears to be no rhyme or reason to the Push color codes, so I can't find a way to do this with math.

Does anyone understand how this works? I have tried reading the _Framework classes several times (and I am an experienced professional Python developer) but can't figure this part out.

Bottom line, what are the color codes to fade a color in and out?

Thanks!
Web | Mobile | Audio
http://vedanamedia.com/

TYLRbass
Posts: 277
Joined: Tue Aug 30, 2011 8:51 pm

Re: Understanding Push's button color codes

Post by TYLRbass » Mon Sep 15, 2014 3:59 pm

I may be completely off here since you are talking about scripting and not simple MIDI output to the unit but isn't it a matter of note velocity?
Image

patrickstinson
Posts: 168
Joined: Thu Oct 13, 2011 5:01 am
Location: Anchorage, Alaska
Contact:

Re: Understanding Push's button color codes

Post by patrickstinson » Mon Sep 15, 2014 5:43 pm

I did reference the scripting framework classes, but this topic is for sending color values using M4L via the control surface API (which yes, is defined by Ableton's scripts).

Setting a button's color is easy, you just call send_value <row> <col> <color> to the button. The problem is that there is no consistency in the ordering of the color code values themselves. For example there appears to be several shades of red but they are scattered all over the integer range of 0-127 with no coherent pattern. For example, if all the reds were defined by the values 0-5 in order of opacity, and the greens 6-10 in order of opacity, fading a color would be simple addition or subtraction. But this is not the case.

I hope that clarifies.
Web | Mobile | Audio
http://vedanamedia.com/

Mark Towers
Posts: 9
Joined: Thu Nov 22, 2012 3:45 pm

Re: Understanding Push's button color codes

Post by Mark Towers » Thu Sep 25, 2014 3:44 pm

Could you use 'dict' or something similar to create a library in the order you want? It would mean going through all the values for Push manually, but would only need doing once.

S4racen
Posts: 5830
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: Understanding Push's button color codes

Post by S4racen » Thu Sep 25, 2014 6:16 pm

I'd just use a jitter grid?

dict has remained beyond me to date, probably need a lesson ;-)

Cheers
D

S4racen
Posts: 5830
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: Understanding Push's button color codes

Post by S4racen » Thu Sep 25, 2014 7:10 pm

This is from Mark Egloffs patchers!

<pre><code>
----------begin_max5_patcher----------
1341.3oc2Z00bZqCD8Y3WgG+3cRxXIaiM8MfPSYBIoWRxzgobGFC3l3FibFa
SZ5sS+uesjEeDBKr5ZienclTEKVc7QGoUq1M7q50zmD8peht1Gz9pVsZ+pds
Zht3cTS9bM84duNMzKQXl9zn4y8Yo5mj+Yo9ulJ5eP2yGwZcU6tCFwF1se+a
9xH1EC5185QrQr+5s+KyvYyzRdzalexGFwFS.sYRX.6o.1Cbq9lWRZVSRXzO
V91y9T+oQKXBJPLk8xVLOZQZnepfwFxd+VDKMI3e8ElZb1xtClInezjueJwV
eCaYdyE1p2JNvKTqcT3L80uf.1R7IxNe1Kc5iYTcbr+zzbEkZweOZDaJuwwc
0CZ+yxWT7CSDj7LCdG+tdc9+cBx0h49IIdO3+t0BCMCMg1OlHTskFjqJo+7Y
+b9oquhHuUyHn0rlvR1NUK5AUKSgX0zQHVM3ZUIqLTxQTOHjRTPLZJDApXii
sQgTDl+Ox326Djm8l9jFWULNlhBUQQw7v9TFVBeJh3A2xUTVvVIKIfxR.+Pv
UMPhjIdQxTQQ5vG7X233oQSiBC0N8zSaGzu64i6DEFECqUBEZ4O.JkEZkxsD
EplhSabk6obWqTxwvmlim4k5IUHoDw+.YXGp8IxtVZ1WEFtxzrO4I+eJ33Me
7iRFx68EuvERERtzTa4BytGdVL1wjcC.AO.aFAcKTnJfxFAV1BESrnr6gagl
DvSDazX.OMZfBCwUdfVUbTAh8LcbUBG3oTS73.rMyPAl.OeHDEfAd5PvseM+
5nfdNlJAx9lUVpgzdlX1JfD.DMTgL6YR4nBN6YJgaOr7Zq.XzTEL124bFJAD
7rhRvCD.BTEnxdlQlJ.ydlOatEV9qY3kGKLw6E+Yiyh.mE9brWZZbvjEo4YO
tYjQ+4S7EAqIxgWx2e+lNcasdKxw39pNk2c3sbWmSii0QKmFK5QTNrJO4f37
mQFMkXBM46P9CLelx6V54RTojMCT4qZ2uUmK0FwNu0fKGmcJ4PMQ4qFpk09k
O06ttYsYWWTi+r3ZIZqKyU+dW0USSVtqr1a+7fdWewH1c2O3uu+ld2xGamgs
tlaysWNTfg3Prr118uWL1aFz4S8NeD6pVWz856ZIr4y8t9Rd66pM1tJf1X5H
1NKKFsvkEypjKKlk0Y1aUULZCyRqpXGHg0AWztZSWkXTx5GwvXyjVM9ejzpU
C7IsJbMJRZqq7oJRpqviG2EnDNwGk7UsKZRUMK9k8wME3GTUna4uu6whaYL+
rQ.HvojqNVE.EbxI+.YfsC3DyrSxAFONsTDA.nBH3zRdrC..voj4Ac.f.mLJ
iWA3YfSI4w4..von0EqDJhCxZdbfpLXg1CEDhRHCZjYal6kBBRC07Sgvwz.s
mJHDVX8UAQvEu2JDFVTz9qfPzPAOVHPrMTwmEDEKzdsfP3h1ukV7JmRKTQFk
9szBUINgeKsDpZEsPk2Q52BAhih9s.3XRv62BAgMZ+VHDZpfeK.FVl38agfv
QE+V.PrIJ42BghMd+VHHZdbK+mHCEQ5oa8cNQjkCu+2lWWRzh3oKyJS90MPa
cdNYY+lFv7RChXaXC+Oj5FF8XvrY9rMS4cVPh2jvbRt6DLwRGWLzISq44nTA
zwACcpLwghfMVY1PpD1H1UPO.cbqLwYqMo6YqSExGBF9TQKWX18v+x1TU7w.
AepNOcBR1XTYrgffMjJiMGxQeqkS7zIOBl2yO+hebhDSASzm688nX9ihRqoO
Ofk+nnPd5w9uDrzdWQOdwSeLHMKV5h37BB9ZCK8572yuq+ePwkVkX
-----------end_max5_patcher-----------
</code></pre>

patrickstinson
Posts: 168
Joined: Thu Oct 13, 2011 5:01 am
Location: Anchorage, Alaska
Contact:

Re: Understanding Push's button color codes

Post by patrickstinson » Thu Sep 25, 2014 7:33 pm

S4racen wrote:This is from Mark Eg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k
O06ttYsYWWTi+r3ZIZqKyU+dW0USSVtqr1a+7fdWewH1c2O3uu+ld2xGamgs
tlaysWNTfg3Prr118uWL1aFz4S8NeD6pVWz856ZIr4y8t9Rd66pM1tJf1X5H
1NKKFsvkEypjKKlk0Y1aUULZCyRqpXGHg0AWztZSWkXTx5GwvXyjVM9ejzpU
C7IsJbMJRZqq7oJRpqviG2EnDNwGk7UsKZRUMK9k8wME3GTUna4uu6whaYL+
rQ.HvojqNVE.EbxI+.YfsC3DyrSxAFONsTDA.nBH3zRdrC..voj4Ac.f.mLJ
iWA3YfSI4w4..von0EqDJhCxZdbfpLXg1CEDhRHCZjYal6kBBRC07Sgvwz.s
mJHDVX8UAQvEu2JDFVTz9qfPzPAOVHPrMTwmEDEKzdsfP3h1ukV7JmRKTQFk
9szBUINgeKsDpZEsPk2Q52BAhih9s.3XRv62BAgMZ+VHDZpfeK.FVl38agfv
QE+V.PrIJ42BghMd+VHHZdbK+mHCEQ5oa8cNQjkCu+2lWWRzh3oKyJS90MPa
cdNYY+lFv7RChXaXC+Oj5FF8XvrY9rMS4cVPh2jvbRt6DLwRGWLzISq44nTA
zwACcpLwghfMVY1PpD1H1UPO.cbqLwYqMo6YqSExGBF9TQKWX18v+x1TU7w.
AepNOcBR1XTYrgffMjJiMGxQeqkS7zIOBl2yO+hebhDSASzm688nX9ihRqoO
Ofk+nnPd5w9uDrzdWQOdwSeLHMKV5h37BB9ZCK8572yuq+ePwkVkX
-----------end_max5_patcher-----------
</code></pre>
That's the closest thing I've found for this yet! Although I'm not sure what to do with these "fast" "slow" and "blink" values since just sending them to the grid as is will not produce animations. Where did you find this, and is there anything else that goes with it? I am having trouble finding contact info for Mark himself.
Web | Mobile | Audio
http://vedanamedia.com/

darth_fader
Posts: 36
Joined: Thu Jun 18, 2009 11:29 am
Location: Germany
Contact:

Re: Understanding Push's button color codes

Post by darth_fader » Fri Sep 26, 2014 7:41 am

patrickstinson wrote:I am trying to get a button to pulse smoothly from bright green to the darkest green, sort of like fading opacity.
For slow blinking (pulsating) you need to send the color(note) on midi channel 10.
For fast blinking you need to send the note on midi channel 14.
Before that you need to send the base color on midi channel 0.

Found that out by experimenting. You can also take a look at my Bitwig script: https://github.com/git-moss/Push4Bitwig/
See the files Grid.js and Colors.js

patrickstinson
Posts: 168
Joined: Thu Oct 13, 2011 5:01 am
Location: Anchorage, Alaska
Contact:

Re: Understanding Push's button color codes

Post by patrickstinson » Fri Sep 26, 2014 7:56 am

darth_fader wrote:
patrickstinson wrote:I am trying to get a button to pulse smoothly from bright green to the darkest green, sort of like fading opacity.
For slow blinking (pulsating) you need to send the color(note) on midi channel 10.
For fast blinking you need to send the note on midi channel 14.
Before that you need to send the base color on midi channel 0.

Found that out by experimenting. You can also take a look at my Bitwig script: https://github.com/git-moss/Push4Bitwig/
See the files Grid.js and Colors.js

Woah, cool. I'll check out your code. So sending a code over midi implies that the fading and blinking functionality is built into Push or it's python script? I assume these values don't apply when using the control_surfaces Button_Matrix interface when using M4L (which is what I'm using)?

Again, I am surprised and impressed to get such feedback, I've been messing with this for months!
Web | Mobile | Audio
http://vedanamedia.com/

S4racen
Posts: 5830
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: Understanding Push's button color codes

Post by S4racen » Fri Sep 26, 2014 8:13 am

The Mark Egloff pataches were from the Cycling 74 website from memory...

Cheers
D

darth_fader
Posts: 36
Joined: Thu Jun 18, 2009 11:29 am
Location: Germany
Contact:

Re: Understanding Push's button color codes

Post by darth_fader » Fri Sep 26, 2014 11:20 am

patrickstinson wrote: Woah, cool. I'll check out your code. So sending a code over midi implies that the fading and blinking functionality is built into Push or it's python script?
It is in the Hardware.
patrickstinson wrote: I assume these values don't apply when using the control_surfaces Button_Matrix interface when using M4L (which is what I'm using)?
Only had a quick look some time ago. I guess they do the same internally.

Post Reply