APC 40 drawbar problem
I am trying to make a patch where pressing one of the buttons on the 5×8 matrix of the APC40 gives a visual feedback, like horizontal drawbars of an organ. the pressed button should be red, the ones to the left green, the ones on the right off.
My patch is a bit brute force (read: spiderweb…), I suspect I could simplify a few things, but also I think I really need to give it a huge overhaul, because my message order seems to be corrupt so that I get wrong lines lighting up, along with the right one.
I’d appreciate any help, the most valuable would be pointers instead of answers (even though answers would be tempting since they save so much time…, as I really really need to learn more and more…
any help is greatly appreciated!
You could patch together something using [uzi] to send out the numbers between 1 and 8 and then test to see if this number is below, equal to or above the channel number (using [if] or [< ][==][>] or [split] etc) and output your APC colour code: 1, 3 or 0; depending on the result. Shouldn’t take more than 15 max objects. If you’re still stuck let me know and I’ll add some comments to my patch and let you have a look.
thanks a lot, I will try that and post the result.
I gave it a go and got much further this time, much fewer objects and I feel I have a better understanding of what we (the patch and I) are doing. Everything is much more reliable and predictable.
but there are two more problems that I have a hard time tracking down:
when I press a button (of the top three lines, I only use those), channel 8 is output twice (the "print pack" shows that) why is that? I was thinking it’s the original message but that’s not it, since it’s always on channel 8.
the second thing is that the button I press turns red while I press it, but then goes off again, instead of staying red. Again, I fail to see why this happens.
again thanks a lot for any help and pointers!
It looks like the first 8 is sent at the beginning of the message because its the last number stored from the previous message. Your message ordering needs to make the 1-8 count start before outputting the old 8 which is the last number previously stored.
as for your buttons not staying lit, that is the way the APC works. Without hacking into the "handshake" sysex messages to change the way it performs and responds, you are always going to get a note off message when you release the button, and thus the light will turn off. What you need to do is build a quick fix to automatically turn the button back on when it receives a note off message. Shouldnt be too hard to figure out, I got it going in a couple minutes. Sounds like you want to design the fixes yourself so im not gonna post my fixed version of your patch.
let me know if you get stuck or dont understand what im saying. hope this helps.
thank you very much, this really helped me. I feel like I hacked it a bit by selecting the Velocity 0 of the note off and sending another note after it.
I also switched one number box to a message box and now the double 8 issue is resolved.
Thanks to your and lh’s help, the patch works nicely now, if you have any suggestions still, I’d be very happy to hear them.
Wonderful help in this forum!
glad you got it figured out. I used int’s to store the button message and sel 0 to trigger them when a note off is received.
I liked your idea with the horizontal drawbars, might have to implement it at some point. Im nearly finished with a huge 2 month project using the APC and Max to control instruments in Ableton Live, and will most likely make a short video showcasing it. I will be sure to let you know when that is done.
Here’s the method I came up with, the [jstrigger] is basically replicating your [split] method of triggering the right lighting command. The one thing it doesn’t do is resend the last note after the key-release so you might have to add that in.
----------begin_max5_patcher---------- 708.3ocyX10aZCCEF95vuBqbU6FC4OSblVmDZ+A18TTU.xntEbhRLZrV0+6K wNgOpnfCwJaBoDcNDbd8iO90175.O+YoaSJ7AeELA3485.OOcppDd0wd9qi2 NeUbg9w7kI+Nc1S9CMekJYqRmNKWHUMYyhUyeTHW9PdxbkowQHzH3P.lRptQ n5.3HHXZ8u4WoRkLdcht0FmKhW0zZxMqExUIJ86GsOY5FUSV3AMRg3Ecifvi ZRKVna0Rc+EDD5Wk7sACptLra8ZEP.DMYM5Q8mrDSW1WSDysccySglPMMPzH MZ3iXtDMXqQSD2ojY1YHyrX4RqPiopAA02XQ+yPSnCQy4KXrAGTd2vA9j3.Y ONBbHN17h.vAnKVqz1ZFr1ogFbsNMmFRD6gDygPRlpRJUA3d+wOGK.i+4Onv 68OmeKM7.+VDN7Zw.oiFtbpCwPV77mAP.8CKVNekQjwnMz3l33JC6m9vc4zm mJT4hkKSxA2bS7D3zuGOAM81OA+rN5alHjI5t6Lgja6F.izEUXNysqh2BBxc eQU4mqjJ0asAockCBb6LsV3JibHTJxVIT.FAvB679aL7gosfBXtEOsXMbrKw S4jtrJSYGAmvn8WcmkTKfCwwKVIjevZUmCT1yKhtLBQhbqCTKVc+nk0zuc+U B46OKktGTk+XJVjtIedC.pMzFB12IVjTnDxXkHUdvCUNAurOu6gdTrXQh7vU iWKVjkVRvZQfgD8NDQFXQMG5pJBL8ji1Vq1.KT665RWTscTSkCHVPPb+qIzk zDocipcUSXa3Doe4DwFME1uZJzlwtf9crKzFNw5WNwrQSA8+7N7k7m54wNlE ZJpkdlUmxiUYsab34jcQcUsbKp9487np0qQhaAAqYl4LgnfvcQcUsA1p1djf HKzT0+P5+chhSa4Dix8DVs0GJTOrVdV+lniTaYvaC96zw7C9 -----------end_max5_patcher-----------
the jstrigger of course is a good way to make the patch very clean, I must explore that one.
thanks again for your great help to figure things out!