Bit by Bit… Gaining More Global Space With Push and MT

0
0

In the deep, dark world of Bome’s MT there is still yet more I have to learn to exploit. Over years of building, designing, debugging & starting again with my APC40 I thought I knew how much I could do and the limits were vastly greater than my ability to fill them, until now: Along came an Ableton Push into my possession, a long awaited prize, with many new features I just didn’t have with the APC.

Screen for starters… “Can I write to that?”, “Oh yes of course you can” went my little brain! Velocity sensitive buttons with polyphonic repeat and knobs that glide and send on/off codes when you touch them… ooooooh.

So what’s this post all about? Well we’re all about to find out when Steve gets onboard and starts melting and bending our minds, but first we have more scene to set.

 

The Push then:

  • 8×8 grid of velocity sensitive and polyphonic buttons (64 total) + another column labelled with quantise values not polyphonic or velocity sensitive (8 total)
  • 16 buttons along top, below screen, not velocity sensitive +2 at the right end called Master and Solo
  • 12 buttons on the left
  • 22 buttons on the right
  • 4 arrow style buttons bottom right
  • 9 knobs along top and 2 on the left
  • 1 Touch Strip

There are 360 globals available in MT (ga through n9 and ya through z9) to record values for later recall and use cross translator and cross preset.

I have managed to run out!

Here’s why:

Attached is a spreadsheet that I clear out for new projects in which I record my globals. This is butchered from my 1st Traktor mapping that I did with Push and has been transferred to RekordboxDJ by Pioneer. I like to keep my options open and I have owned Pioneer Mixers and CDJ’s for years so it makes sense to keep up to date with them too.

Looking at this Spreadsheet you will immediatly notice large areas of colour totalling 68 globals per block. ga-nt are used solely for writting to the screen. There are 68 cells per row and 4 rows to write. you must write the entire row in sysex even for a single cell change so you must remember all these values. That only leaves me from nu-n9 + ya-z9.

With Traktor this matters less as you have full control of the MIDI IN and OUT of it and so you can happily let Traktor deal with LED states etc and isolate incoming values in MT then SEND MONITOR STATE and the lights update, but Rekordbox is different; for the worse.

In RBDJ there is no control over the output of the control, it returns what it receives. What’s worse is it does not understand values below 63 as on and so if I wish my light to switch from value 3 when off to 4 when on it won’t trigger the control in program. This means long translation to send only 127 and 0 into RB and convert those to 3 and 4 on the way back, but what about when I change page to a different set of controls? RBDJ has no feature for this… no Send Monitor State. So now I need to remember the value of each of these buttons and across multiple pages… Omg I have no globals left and I’ve only done 1 quadrant 7 times…

I’m exagerating slightly of course, if you look at the spreadsheet you willl see then that the next blocks are in 16’s, 4 of them, for each quadrant. You will hopefully notice I can’t record the state of each page here, only the state for each page. Meaning On/Off the button is this colour. But at least I have 8 pages for 4 quadrants and 1 state to differentiate these buttons, right?

Wrong. Apparently there’s more information  available in these globals than we are used to using and this is where Steve will chime in below to show us how we can control 10 lights he reckons with 1 global with 2 spare bits. Something to do with 32bits and 3*10 RGB values, but lets try to do this practically and applicably.

Also attached then is a new bmtp with the basic button layout of the Push inside. 1 button 1 translator for the On state of each button. The top left grid of 16 pads triggering their lights on when you push them and off when u release, velocity denotes colour and 3 Presets for the screen rows.

Firstly condensing this ASCII into less than 68 globals per row would be great. then controlling the on/off state of 16 pads by as few globals as possible; being able to remember the state of each individually and return a state change if pushed.

This is Row 1 Sysex currently:

F0 47 7F 15 18 00 45 00 ga gb gc gd ge gf gg gh gi gj gk gl gm gn go gp gq gr gs gt gu gv gw gx gy gz g0 g1 g2 g3 g4 g5 g6 g7 g8 g9 ha hb hc hd he hf hg hh hi hj hk hl hm hn ho hp hq hr hs ht hu hv hw hx hy hz h0 h1 h2 h3 h4 h5 F7

Which is this in reality:

F0 47 7F 15 18 00 45 00 4C 65 76 65 6C 20 31 20 05 20 50 61 72 61 6D 20 31 50 61 72 61 6D 20 32 20 05 20 52 65 6C 2E 53 65 6C 4C 65 76 65 6C 20 32 20 05 20 50 61 72 61 6D 20 31 50 61 72 61 6D 20 32 20 05 20 52 65 6C 2E 53 65 6C F7

These 4 are separators and stay the same whatever:

gi=5
gz=5
hg=5
hx=5

the others are blocks of 8 for words or symbols and will likely change together.

You must send the entire 68 to change 1 cell.

Hopefully this won’t be so difficult and it will massively streamline the project and all future projects.

 

Before I go and await the pending destruction of my mind, I have a couple of questions I would like addressed within the reply/solution:

 

To my basic understanding of what you seem to be saying with the colours in RGB: If we take it that a single bit can have a value of 0 or 1 and we give 3 for R G and B then we can only mix very basic full brightness colours with this. Red 100, Green 010, Blue 001, etc. Please elaborate on what we are storing and how we are translating that back to a meaningful spectrum of colours. Also Push has defined MIDI values for colours and can’t/don’t we just use them?

Second question: If I have say 16 buttons and I combine them to have On/Off states for 1 bit each how can I know that it is button 14 which is on and not button 1 when the value of the whole number is still 1. To me it seems that any given value can only produce 1 effect but maybe there are 8 active and 8 not active? Then which 8 are or are not? etc.

I’m sure this is the point and you are going to show me some weird magic that I’m gonna twist and turn over for sometime, I thank you in advance.

 

Robbie

Marked as spam
Posted by (Q&A Forum: 2, Answers: 22)
October 29, 2017 8:45 pm
99 views

For ascii compression of 68 characters you can use 1 global for 4 charachters (28 bits of the 32 bits) so 68/4 will give you 17 variables

To you can pack them in what ever order you want but be consistant.

so for example ga you could use bits 0-6 for first character, bits 7-13 for second character, bits 14-20 for 3rd character and 21-27 for 4th character.

Using the above methodology, you extract first character as follows
pp=ga&0x7F
For second character
pp=ga>>7
pp=gg&0x7f
For third
pp=ga.>14
pp=pp&0x7f
Forth
pp=pp>>21
pp=gg^ga

Make sense?

( at October 30, 2017 6:38 pm)

Yes and No… where is gg plucked from? it seems to have been inserted with no reference and then used to XOR ga?

the rest of it i’m good… using 127 I get 6 bits and thus a HEX code for my ASCII letter and that groups those bits after shifting to the start bit. 🙂

( at October 30, 2017 7:33 pm)

Also of note, I only need 64 letters to be saved as there are 4 dividers that are the same permanently and may aswell just get a hard code ascii. so 64/4= 16 so I save a global and make my numbers even again and divisible by 8 yay!

( at October 30, 2017 7:35 pm)

pp=gg^ga us typo sorry should be pp=pp&0x7f

For stuffing values back in it will require a bit more work. Basically we have to ensure we only touch the bits we want to stuff.

( at October 30, 2017 8:16 pm)

Yeah cool if they’re all the same then you have +7 on each no problem, gives 8 bits not 6 sorry and then there is 4 spare.

This is all starting to come together in my brain, still a few holes, but I’m geting there.

( at October 30, 2017 8:23 pm)
Hi Steve, I’ve been mulling this over in my brain whilst working on the buttons, which are now fully coded and working with many less globals thanks to your good self. I don’t actuially think it is possible to control the screen with less globals though, here’s why: As I point out in the original post, you must update the entire row even for a single cell change. the Sysex looks like this: F0 47 7F 15 1A 00 45 00 j2 j3 j4 j5 j6 j7 j8 j9 ka kb kc kd ke kf kg kh ki kj kk kl km kn ko kp kq kr ks kt ku kv kw kx ky kz k0 k1 k2 k3 k4 k5 k6 k7 k8 k9 la lb lc ld le lf lg lh li lj lk ll lm ln lo lp lq lr ls lt lu lv lw lx F7 there are not enough locals to replace the 68 globals here for output to the Push, no matter how lovely 17 Globals for the storage of the current Letter may be you still nedd to somehow get 68 values on the output and thus it makes it impossible I think to do this without a discrete global for each… If you have any thoughts on this please feel free but for now I’m gonna stick to light state reduction! Peace dude
( at November 1, 2017 5:27 pm)

You may be able to use a timer as a loop and output the same local variable each iteration of the loop.
The logic would to
1) Put out the Syexe header
2) Set up a repeating timer to go through 68 iterations
3) Run through the loop extracting one value at a time from the 17 globals and putting them in pp outputting just
one byte at a time raw midi for each iteration. The extraction logic would all happen here.
4) Follow it up with the trailing F7 when complete. You can have the last iteration set off a one shot timer to do that.

What do you think?

( at November 1, 2017 9:36 pm)

hang on… have I missed a trick here?

you can send SysEx over multiple translators by leaving it open and closing in the last omne, so long as you don’t put any other translator inbetween, e.g.

Translator 1 Out: F0 00 00 00 00 00…
Translator 2 Out: 00 00 00 00 00…
Translator 3 Out: 00 F7

That’s sick as !”£$.

( at November 1, 2017 9:40 pm)

Well I think you can if you are sending to external MIDI device. Not sure if the Windows or MAC midi drivers would like it though. I would suggest testing my theory before going through too much work.

Steve

( at November 1, 2017 9:42 pm)

Ofc. but it makes sense, and I can’t believe I missed it as an option. in this manner you can either have 70 translators to deal with each letter individually or you can condense it to 8 sending 1 byte per time, definitely an interesting possibility man.

I’ll let you know when I’ve tested it. Won’t be for a week probably, t’is the Missus b’day weekend and we got a rave to go to in Saturday, I won’t be capable until mid next week I don’t feel.

Peace dude

( at November 1, 2017 9:46 pm)
You can test it on your APC mini if it still has the 3 modes? My APC40 had 3 1 for switching it on, 1 when ablechum connected and 1 when ablechum disconnected and i used to control this with a SysEx string where the defining byte was either 40, 41 or 42 for each mode. You probably know this already but it’s worth pointiing out if you wann give it a test yourself. laters
( at November 1, 2017 9:49 pm)
Also to check, if I have a Timer that repeats multiple times and I set it to 68; 0 init delay; 1ms repeat delay, how do I know what iteration it is on in another translator and isolate/change the position of the byte to suit? I don’t see anything in the Timer that does this.
( at November 1, 2017 9:56 pm)

Alas you would need a global variable for the timer to track it’s iterations.

( at November 1, 2017 10:40 pm)

Re APC Mini. Yeah I have one. Pretty much only use it to test out MT Pro projects for helping users here. Take care of your Missus.!

( at November 1, 2017 11:05 pm)

Ok so alas I don’t think we can do it…
as soon as F0 is sent it reports port closed and all subsequent message are not part of the SysEx, bugger.

125: IN 40.2 On timer “Sysex Itera”
126: RULE 40.2:9 condition satisfied: if gr>=77 then gr=0
127: RULE 40.2:9 assignment: (if gr>=77 then gr=0) = 0
128: RULE 40.2:10 expression: (gr=gr+1) = 1
129: RULE 40.2:12 condition satisfied: if gr==1 then pp=240
130: RULE 40.2:12 assignment: (if gr==1 then pp=240) = 240
131: MIDI OUT [Ableton Push 2]: F0
132: OUT 40.2 MIDI F0 [port closed]

( at November 3, 2017 12:45 am)

Yes, I think this might be a driver issue. My guess is if you were to send it directly to an external MIDI device it would work because it really doesn’t evaluate the bits. In Windows driver if it recognizes as a partial Sysex and it doesn’t complete, it closes it off.
I tried a test sending through LoopMIDI to Bome SendSX. It took the header, ignored the data bytes and took the final F7.

I tried to send this F0 7D 42 4F 4D 45 7F 05 05 F7
but got this on the receiving end.

F0 7D 42 4F 4D 45 7F F7

No errors where reported however :

Here is what MT Pro output reported
122: MIDI OUT [loopMIDI Port 1]: F0 7D 42 4F 4D 45 7F
123: MIDI OUT [loopMIDI Port 1]: 05
124: MIDI OUT [loopMIDI Port 1]: 05
125: MIDI OUT [loopMIDI Port 1]: F7

( at November 3, 2017 1:03 am)

So that’s odd…. each byte was a seperate iteration right?

i haven’t gone to LoopMIDI yet cos I didin’t see the need but perhaps i’ll try this:

Push -> LoopMIDI -> BMT
BMT -> LoopMIDI -> Push and see

( at November 3, 2017 1:09 am)

I used to use Jack for audio routing and it had MIDI transfer in it too, but it’s a dick to install.

( at November 3, 2017 1:10 am)

Ah I just realised what I said and how wrong I was, LoopMIDI works between software not hardware, damn.

( at November 3, 2017 1:15 am)

Have you tried sending Sysex directly to your Pioneer display?

( at November 3, 2017 1:20 am)

Ok so I got it to send and close properly but nothing has happened pon the push, might be too many characters or something but the solution is to iterate only what you need to change and leave the original lead in identifiers with the F0 like this for me:

Translator 1 Out on release of button:
F0 47 7F 15 18 00 45 00

Translator 2 Timer start on Release of button
20ms init delay
repeat 69 times
2ms dealy between

3rd translator outputs pp as normal 69 times

Port opens and closes with F7

( at November 3, 2017 1:30 am)

Here with 1ms init delay and 0ms repeat it still doesn’t do the push but closes properly:

IN 40.1 Note Off on ch. 1 with note:41 (0x29) and velocity:0 (0x00)
4: IN 40.2 Note Off on ch. 1 with note:41 (0x29) and velocity:0 (0x00)
5: MIDI OUT [Ableton Push 2]: F0 47 7F 15 18 00 45 00
6: OUT 40.1 Timer 69 times “Sysex Itera”: 0 ms (initial delay: 1 ms)
7: OUT 40.2 MIDI 8 bytes F0 47 7F 15 18 00 45 00
8: IN 40.3 On timer “Sysex Itera”
9: RULE 40.3:10 condition satisfied: if gr>=69 then gr=0
10: RULE 40.3:10 assignment: (if gr>=69 then gr=0) = 0
11: RULE 40.3:11 expression: (gr=gr+1) = 1
12: RULE 40.3:14 condition satisfied: if gr==1 then pp=97
13: RULE 40.3:14 assignment: (if gr==1 then pp=97) = 97
14: MIDI OUT [Ableton Push 2]: 61
15: OUT 40.3 MIDI 61
16: IN 40.3 On timer “Sysex Itera”
17: RULE 40.3:11 expression: (gr=gr+1) = 2
18: RULE 40.3:15 condition satisfied: if gr==2 then pp=97
19: RULE 40.3:15 assignment: (if gr==2 then pp=97) = 97
20: MIDI OUT [Ableton Push 2]: 61…

…412: IN 40.3 On timer “Sysex Itera”
413: RULE 40.3:11 expression: (gr=gr+1) = 68
414: RULE 40.3:93 condition satisfied: if gr==68 then pp=97
415: RULE 40.3:93 assignment: (if gr==68 then pp=97) = 97
416: MIDI OUT [Ableton Push 2]: 61
417: OUT 40.3 MIDI 61
418: IN 40.3 On timer “Sysex Itera”
419: RULE 40.3:11 expression: (gr=gr+1) = 69
420: RULE 40.3:94 condition satisfied: if gr==69 then pp=247
421: RULE 40.3:94 assignment: (if gr==69 then pp=247) = 247
422: MIDI OUT [Ableton Push 2]: F7
423: OUT 40.3 MIDI F7 [port closed]

( at November 3, 2017 1:35 am)

I’m not gonna try to mess with the pioneer connection btw, the screen in question is on my Push and i’ve already got 4 lines of text on the display, but this sysex iterationhas no effect.

( at November 3, 2017 5:04 pm)
0
Private answer

If you want, you can try my project file.

Marked as spam
Posted by (Q&A Forum: 22, Answers: 1005)
November 3, 2017 1:10 am
0
Private answer

Here’s how I switch the variables for different pages: 10 in total only 1 example here and it only covers top left quadrant as the pages are organised this way, pretty straight forward to do it 3 more times for the other 3 though.

//compensate for Push Start Value to 0
pp=pp-36
//Isolate Quadrant
if pp<32 then exit rules, skip Outgoing Action
if pp<36 then Goto \"Onwards\"
if pp<40 then exit rules, skip Outgoing Action
if pp<44 then Goto \"Onwards\"
if pp<48 then exit rules, skip Outgoing Action
if pp<52 then Goto \"Onwards\"
if pp<56 then exit rules, skip Outgoing Action
if pp<60 then Goto \"Onwards\"
if pp<64 then exit rules, skip Outgoing Action

Label \"Onwards\"

// Only up to 64
if pp>64 then exit rules, skip Outgoing Action
// Determine variable to use
// Default to ga
if z0==0 then xx=nu
if z0==1 then xx=nv
if z0==2 then xx=nw
if z0==3 then xx=nx
if z0==4 then xx=ny
if z0==5 then xx=nz
if z0==6 then xx=n0
if z0==7 then xx=n1
if z0==8 then xx=n2
if z0==9 then xx=n3

//if pp>31 then xx=gb
// Lets extract the bit
// First we need to determine how much to shift it
// the shift amount is the note value
qq=pp
// Shift it
rr=xx>>qq
// It should now be into position. Ignore all other bits
rr=rr&1
// Now toggle it
rr=rr^1

// Put the toggled value back
// set tt to shifted value - Will be used if value is 1
tt=rr<<qq
// Otherwise, we need to mask with uu to turn the bit off
uu=1<<qq

// If it is a 1, we OR the bit
if rr==1 then xx=tt|xx
//Otherwize we Exclusive or it with with a 1 to turn it off
if rr!=1 then xx=uu^xx

if z0==0 then Goto \"Page1\"
if z0==1 then Goto \"Page2\"
if z0==2 then Goto \"Page3\"
if z0==3 then Goto \"Page4\"
if z0==4 then Goto \"Page5\"
if z0==5 then Goto \"Page6\"
if z0==6 then Goto \"Page7\"
if z0==7 then Goto \"Page8\"
if z0==8 then Goto \"Page9\"
if z0==9 then Goto \"Page10\"

//if pp<=31 then nu=xx
// Now we can send it out

Label \"Page1\"
nu=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=126
// 0 if off
if rr==0 then vv=127
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page2\"
nv=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=126
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page3\"
nw=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=125
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page4\"
nx=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=124
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page5\"
ny=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=123
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page6\"
nz=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=122
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page7\"
n0=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=121
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page8\"
n1=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=120
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page9\"
n2=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=119
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

Label \"Page10\"
n3=xx
// Note on or note off for lights of my APC Midi
// 127 is Orange
if rr==1 then vv=118
// 0 if off
if rr==0 then vv=0
pp=pp+36
exit rules, execute Outgoing Action

 

 

Marked as spam
Posted by (Q&A Forum: 2, Answers: 22)
October 30, 2017 8:03 pm
0
Private answer

Here is working code for the lower 8 buttons on the top left grid of the push, It recalls the state and sets the button to the correct colour Orange for Off and Yellow for On. On an APC mini it may just stay green, my APC 40 only had 0-6 as colours every other value 7-127 displayed green.

 

if z0!=0 then exit rules, skip Outgoing Action
//Grab the Global.
oo=nu

//Start shifting and assiging 8 bits.
//Should equal the value of each bit.
//pp is the bottom left corner of the 2×4 grid we are working with.

pp=oo>>0
qq=pp>>1
rr=qq>>1
ss=rr>>1
tt=ss>>5
uu=tt>>1
vv=uu>>1
ww=vv>>1

//Ignore other bits (should equal 0 if off or 1 if on now).

pp=pp&1
qq=qq&1
rr=rr&1
ss=ss&1
tt=tt&1
uu=uu&1
vv=vv&1
ww=ww&1

//Assign Colours to Variables Instead.
//127=Orange 126=Yellow

if pp==0 then pp=127
if pp==1 then pp=126
if qq==0 then qq=127
if qq==1 then qq=126
if rr==0 then rr=127
if rr==1 then rr=126
if ss==0 then ss=127
if ss==1 then ss=126
if tt==0 then tt=127
if tt==1 then tt=126
if uu==0 then uu=127
if uu==1 then uu=126
if vv==0 then vv=127
if vv==1 then vv=126
if ww==0 then ww=127
if ww==1 then ww=126

 

MIDI OUT:

90 44 pp 90 45 qq 90 46 rr 90 47 ss 90 4C tt 90 4D uu 90 4E vv 90 4F ww

Marked as spam
Posted by (Q&A Forum: 2, Answers: 22)
October 30, 2017 7:39 pm

Excellent!

( at October 30, 2017 7:46 pm)
0
Private answer

Hi Robbie,

 

Not exactly following your latest posts, however you had asked how to do a virutal bank switch.

In the attached I use the following variables

g1 g2 (light 0-63 bank 1)

g3 – use this as a coundown timer for light refresh

g4-g5 (light 0-63 bank 2)

g6 bank selection variable 0=bank 1 and 1 is bank 2

So instead of output when you push a button, it just sets the variable and then triggers a “light refresh” timer

The light refresh timer just pulls out the bits one at a time and sends not message to the light (1ms intervals)

Light refresh is triggered by push button change and also

all lights on

all lights off

bank change

Bank change simply sets the value of g6 and then enables the current bank preset and disables the other bank preset.

Another trigger is that when the current bank preset is enabled, it triggers the timer to update the lights.

Again I did this on my APC Mini

Enjoy!

Marked as spam
Posted by (Q&A Forum: 22, Answers: 1005)
October 30, 2017 6:14 pm

I have to make a new answer for this but i have done as you say but without bit stuffing the switches yet. z0-z3 have values 0-9 and thus 10 pages per quadrant with scope for more if i want.

i’ll post the code in an answer below so you can see, but most of the credit goes to you in there lol.

( at October 30, 2017 8:01 pm)
0
Private answer

Good Morning Sir, I’m getting somewhere, definitely but I’m now wondering how you can recall all the bits and thus refresh all the lights at once… it must have something to do with the AND we were talking about, I’m guessing that if bit 31 has a value of 2,147,483,648, that it’s that?

rr=rr&2147483648

and that will return the value of all the 1’s in the set which will allow for definition of those to lights On/Off.
but this would still mean to get 16 outputs at once (I’ve clamped to a quadrant for pages) you need to account for every possible value of rr between 1 and 32 bits… that’s loads of rules and jumps… it must be doable from a variable iterative perspective?

I’m attaching my modification to your translator so you can see how I’m working with it. There will be 4 of these 1 per quadrant and therfore the 2 globals can be used to access Page 1 on any quadrant and by changing the global I have 9 pages per quadrant with only 18 globals used. nu-n3 and n4-yc with these pages controlled by z0-z3 for the 4 quadrants.

Peace

 

Robbie

Marked as spam
Posted by (Q&A Forum: 2, Answers: 22)
October 30, 2017 2:43 pm
just a thought… rr=rr&214747483648 oo=rr<<1, ss=rr<<2, tt=rr<<3, each returning 0 or 1 for the 1st 4 lights.
( at October 30, 2017 3:00 pm)

nope

( at October 30, 2017 3:14 pm)
So this is where I’m at but the numbers don’t look right yet? if z0!=0 then exit rules, skip Outgoing Action //grab the Global oo=nu //start shifting and assiging 8 bits pp=oo>1 ss=rr>>1 tt=ss>>1 uu=tt>>1 vv=uu>>1 ww=vv>>1 Produces this in the log: 1523: IN 12.1 Control Change on ch. 1 with CC#:20 (0x14) and value:0 (0x00) 1524: RULE 12.1:3 assignment: (oo=nu) = 185536271 1525: RULE 12.1:7 expression: (pp=oo>1) = 126320640 1527: RULE 12.1:9 expression: (rr=qq>>1) = 63160320 1528: RULE 12.1:10 expression: (ss=rr>>1) = 31580160 1529: RULE 12.1:11 expression: (tt=ss>>1) = 15790080 1530: RULE 12.1:12 expression: (uu=tt>>1) = 7895040 1531: RULE 12.1:13 expression: (vv=uu>>1) = 3947520 1532: RULE 12.1:14 expression: (ww=vv>>1) = 1973760 This is going to be incorrect anyway as the push moves incrementally from bottom left to top right as MIDI notes, so the left quadrant will be bits 1-4, 9-12, 17-20 & 25-28 with the right quadrant being the inbetweens.
( at October 30, 2017 3:50 pm)

Almost Got it!

865: IN 12.1 Control Change on ch. 1 with CC#:20 (0x14) and value:0 (0x00)
866: RULE 12.1:3 assignment: (oo=nu) = 3855
867: RULE 12.1:7 expression: (pp=oo>>1) = 1927
868: RULE 12.1:8 expression: (qq=pp>>1) = 963
869: RULE 12.1:9 expression: (rr=qq>>1) = 481
870: RULE 12.1:10 expression: (ss=rr>>1) = 240
871: RULE 12.1:11 expression: (tt=ss>>4) = 15
872: RULE 12.1:12 expression: (uu=tt>>1) = 7
873: RULE 12.1:13 expression: (vv=uu>>1) = 3
874: RULE 12.1:14 expression: (ww=vv>>1) = 1
875: RULE 12.1:18 expression: (pp=pp&1) = 1
876: RULE 12.1:19 expression: (qq=qq&1) = 1
877: RULE 12.1:20 expression: (rr=rr&1) = 1
878: RULE 12.1:21 expression: (ss=ss&1) = 0
879: RULE 12.1:22 expression: (tt=tt&1) = 1
880: RULE 12.1:23 expression: (uu=uu&1) = 1
881: RULE 12.1:24 expression: (vv=vv&1) = 1
882: RULE 12.1:25 expression: (ww=ww&1) = 1

but ss is not working properly all lights should be on and i only get 0 value for ss? bug shooting here we come!

( at October 30, 2017 5:00 pm)

And we’re in:
244: IN 12.1 Control Change on ch. 1 with CC#:20 (0x14) and value:0 (0x00)
245: RULE 12.1:3 assignment: (oo=nu) = 3855
246: RULE 12.1:8 expression: (pp=oo>>0) = 3855
247: RULE 12.1:9 expression: (qq=pp>>1) = 1927
248: RULE 12.1:10 expression: (rr=qq>>1) = 963
249: RULE 12.1:11 expression: (ss=rr>>1) = 481
250: RULE 12.1:12 expression: (tt=ss>>5) = 15
251: RULE 12.1:13 expression: (uu=tt>>1) = 7
252: RULE 12.1:14 expression: (vv=uu>>1) = 3
253: RULE 12.1:15 expression: (ww=vv>>1) = 1
254: RULE 12.1:19 expression: (pp=pp&1) = 1
255: RULE 12.1:20 expression: (qq=qq&1) = 1
256: RULE 12.1:21 expression: (rr=rr&1) = 1
257: RULE 12.1:22 expression: (ss=ss&1) = 1
258: RULE 12.1:23 expression: (tt=tt&1) = 1
259: RULE 12.1:24 expression: (uu=uu&1) = 1
260: RULE 12.1:25 expression: (vv=vv&1) = 1
261: RULE 12.1:26 expression: (ww=ww&1) = 1

( at October 30, 2017 5:08 pm)
0
Private answer

Yes a little lesson in logic

1 AND 1 = 1

1 AND 0 = 0

0 AND 0 = 0

—————–

1 OR 1 = 1

1 OR 0 = 1

0 OR 0 = 0

————

1 XOR 1 = 0

1 XOR 0 = 1

0 Xor 0 = 0

Marked as spam
Posted by (Q&A Forum: 22, Answers: 1005)
October 30, 2017 5:24 am
0
Private answer

Here is the first cut of adventures in bit mapping.  In it I can turn all my 64 lights (not the round buttons) of my APC Mini all with one translator and 2 variables.

Have fun.

For setting up pages, etc. Just a math exercise to work out page number etc. Maybe you could enable and disable different presets depending on the page you want to show.

 

Marked as spam
Posted by (Q&A Forum: 22, Answers: 1005)
October 30, 2017 1:07 am

Cool, well i’ve had to release the velocity so it triggers, and the push doesn’t start from 1 but i’ve made your map work, now I need to figure out how?

I think it is best here for me to put down any problems I’m struggling with.

I’m really confusing myself with the BIT WISE expressions and their definitions in the manual.

I cannot for the life of me see the maths that makes tt=0x98&15=8, so in decimal (which would be much easier you’d think) 152&15=8? WTF is & doing to 152 that makes 8?

The > seem fairly self explanitory.

But why do you invert the 0’s and 1’s then put them back again? That seems counter intuitive.

This is definitely some crazy shinanigins dude. tyvm

( at October 30, 2017 1:25 am)
0x98 or 152 in binary is 1011 1000 0xF or 8 in binary is 0000 1000 If you look at the columns and AND the bits where 1+1=1 and 1+0 =0 1101 1000 0000 1000 ————- 0000 1000 – Or 8 Whoops brain fart. 15 is 1111 so 1100 1000 0000 1111 ========= 0000 1000 or still 8 Only the columns with 1 on both number will come out to 1
( at October 30, 2017 1:54 am)

Dude YOU ARE A LEGEND!

Wow, how clean is that. I’m still getting to grips with the logic but omg. To make it work i simply put pp=pp-36 at the start and pp=pp+36 at the end so u know.

( at October 30, 2017 2:11 am)

i think i get you with the AND thing now… it asks for anything that has a 1 in any column up to the total you input and gives you the total so, 1011 would give 11 in this case and so you would know that 1011 was the pattern of on/off’s

( at October 30, 2017 2:14 am)

Thanks for the good words, I’ll be off to look at your issues with Pioneer and the video you posted tomorrow morning. Maybe we can figure something out.

( at October 30, 2017 5:18 am)
0
Private answer

“To my basic understanding of what you seem to be saying with the colours in RGB: If we take it that a single bit can have a value of 0 or 1 and we give 3 for R G and B then we can only mix very basic full brightness colours with this. Red 100, Green 010, Blue 001, etc. Please elaborate on what we are storing and how we are translating that back to a meaningful spectrum of colours. Also Push has defined MIDI values for colours and can’t/don’t we just use them?”

You are right. It matters how many colors you want to control. If you want 7 colors (plus off), you need 3 bits. If you need more you have to go 1 more bit per light which will give you 15 colors (plus off).

For your second question. Say you want only on and off states for lights. You set up a scheme how to calculate the bits and the use rule to extract and stuff the bits.

Say you have 64 lights you want to control. That will require two global variables.

You set up ga  (as an example) so that it produces the first 32 and gb for the next 32.

You assign the bits so that bit 0 of ga is light #1 bit 1 is light #2 and so on up to bit 31.

You assign bits of gb starting at light 33 where bit 0 is the first light, bit 1 etc up to bit 31

Now, I’m not going to design your project for you (but I can if you want to pay me to do so) but I will post the logic (hopefully later today) to show you how you can control the on/off state of those 64 lights.  Would this be enough to get you started on your massive endeavor  to master the art of bit mapping?

As I said, if you want to mange the colors or intensity of them, it consumes more bits, however the general logic is the same. The key difference will be writing rules to extract sections of the global variable and also insert them without interfering with the neighboring sections.  Stay tuned for bit mapping 101 course.

 

Marked as spam
Posted by (Q&A Forum: 22, Answers: 1005)
October 29, 2017 9:36 pm

Yeah I get you I think… really interested to know how you can seperate the bits… and I don’t want you to design my project, that would be pointless.

I’m sitting on the edge of my seat lol.

what about Pages too, so if i have 4 globals for 4 sets of 8 pages, then these 64 lights need to have referenced both the value of the page global and the value of the correct on/off of the correct control….

can’t wait to find out what you gotta say man

( at October 29, 2017 9:53 pm)

I’m of course reading around at the moment and you have been busy replying to people about this kind of thing.

What I think I’m lacking (apart from the jargon and programming text like &7 and XOR etc.) is the way in which you break up the Bits into Blocks?

I would like clarification on how you can pick the block sizes. is it simply *3 for 3 pieces, *8 for 8 in a block etc?

( at October 29, 2017 11:45 pm)
Votes
Answers
Topic
0
votes
8
answers
asked 3 weeks ago by
updated 2 weeks ago by