making a momentary MIDI switch into a latching Max switch 4.6
I bought a launchpad and am trying to get back some Max skills but this one has me stumped. I’d like to make a momentary MIDI switch into a latching Max switch using matrixctrl.
The User 2 bank of the Launchpad sends out a noteon when you press a pad, and a noteoff as soon as you release the pad. So it’s just like a keyboard in that respect. But I want to use it as a matrix controller, turning processes on (MIDI processes in Max) and then turning them off later. In other words, I want Max to interpret a first noteon as an on command to turn on a process, and the very next time it sees the same noteon, I want it to turn the process off. And because I want to keep track of which processes are on and which are off, I am using the matrixctrl object. But I can’t figure out a way to do this! As a starting point I’ll use stripnote to remove noteoffs in the following example of how I want to use it.
Example of latching switch mode using pitch and velocity
55 127 – process x on
66 127 – process y on
77 127 – process z on
55 127 – process x off
44 127 – process a on
66 127 – process y off
For those who are familiar with Launchpad and Ableton LIVE, this is essentially an imitation of the functionality of the session and mixer modes where you have visual feedback on what’s on and off in LIVE.
I have attached my patch for the momentary patch.
Thanks for any help.
You might want to try a [stripnote] between the notein and the rest of your patch.
I already tried that. All it does is give me the notes without noteoffs. I said:
"As a starting point I’ll use stripnote to remove noteoffs in the following example of how I want to use it."
That means I already understand that the noteoffs are not needed. What I need is some sort of storage object that, when it see a repetition of a list – even after intervening list items – I reverses its state. That is what I tried to describe in the example I gave above: 55 127 repeats after two intervening list items, and at that point I want a zero to be sent.
So, to restate, perhaps clearer:
Is there an object that will reverse its state (1 to 0 or 0 to 1) when it sees a repetition of a list?
I have tried with 4 objects, but none seems to do exactly what I want:
coll, funbuff, table, offer
Thanks for any help! Going mad with this one.
here is a little patch i wrote for my launchpad some while ago. Shouldn’t be using double buffering. Seems to be what you want and really isn’t too complicated.
The only thing is, i have chosen the Abbreviation "i" for my launchpad, you will need to correct the port at two midi objects in that patch or choose the same abbreviation to make it work. It is thought to display the routing in the matrix object even if the matrixctrl has changed (py pattrstorage eg.) and only if the patch is "on", wich is the toggle on the upper left. so if you don’t want that, you can maybe delete some objects in there.
----------begin_max5_patcher---------- 1412.3oc2aszjiZCD9rmeEZopbIw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2O7IiKOvWoj0KeC9XmLNKd2t8lAV48.c2st6kyT8lJHarO.ruY 32aY3oeIkXbOc2r1+p4TMv7iBjG57oZLSrwa9oAuGdNlJPfGfdWc8EyDgTzf ZXz0JYXfJAm4wZbcXbdGO.Y9Xmu.USqaUu7R.7vFM3ppOuXDvKG.rbvpqTpX 1NMT.Xkfa34r6kFPSw3etVkFeJYc0dUo+F4U7rwjlEFAWAci4TD3rwjdJbyF STSU+P3liw460kXf79KRwsERE4BtKlJNLXavj1Eb+vd8TtuJMIf0safEuCWW dsTOA6Yj1U.qucfsjLETLYedN+Jo9hVcKPaw4XYCZk4MtkiOMyE6wkWKMIFB 5tXH3g2XRIzAodBVttsfkMYt8m4jbELYGjJ8cD3Ykx7o0R8k.aqW+Dxez15t vrw4VC1b9PlYkhUK0WzJGAz5RA7oweqTknEj561carM4V5bK8QtUhWdtupVp un0qsn0FKAdSzpvhZGDz94tIWAsdSaIHshAo1gIFF+t79a3RcsTeQqpMEw4M oQiXx1hoIbWsMVZLtk6p9PvFIGuHNNjwFjFBzdOFbhIv1j16LqwwFSswS8Li wwFRhVVHiEHh64CktT96FEij.RCPgL2ykPLor2Y8ebkcTKaRopsD7n57YzZo 9xez1DSwRzxc4XAL3IGI0eojPwZpIpAnS11v6bK6jsDet3QgUVwCHMDUMvum gqkUjoTXMNTE9SqfVK02HBspeK5zFkR2BKWokwoTZ7+VAz5rrdbuox5j0MiS zwpoTOAaqvJqG614Be5g+E7Fq5sE -----------end_max5_patcher-----------
Unless I’m completely misunderstanding your problem, stripnote works fine for this:
----------begin_max5_patcher---------- 813.3ocyX1saaBCFF93jqBKNNKx+gMd2FSZmLUMQBNozBlHvQqcU8deXCjQW Shc5Rb4D9w.1uuO9ye1lWlOKZU0SxlHvWA+.La1KymMyVjofY82OKpL8o0Eo M1WKZcUYoToiVz8Ls7Iss7ukWtuHUKy.OJetY3wapT5l7eKMuBBuD1W7tT85 6yUa+Ysbstq0QPV6iATt4HBRLmvnkPvc8eSdlscpV8vWn7g5WsuLWUH0VsgF 0npzRaiF8cYcVpJczGTsWO7EPSguNet4vBOAfR9qVM7N+Wl9nTUok.FDfigC OuqwzOuS1YynMEUosza3hC16RHExxHJ1dBwOKpPGEUjKFU3O.pzUa2VHGpuc 0xl1HmTcdkZjcHwhkPJGhSV.HclA1e3fgdGEyUiP2QXz3JEyDVBAGNdLNQhO aH0aYA5lwBRxMfEipT+XAaRvBi+u5rXTk5GK3SAVfErqOKFWo9whjIAK3w2. VLpR8iEhaLKdroHOSV6.FvC1WXm9Ll3hBKbCCDDuDwfXAcAnkKDFKVfMyzXm vgcJhPNLm2lMMRacwFlFqNUssapMxwvF9FMkykGGDSs859DBfgAc3vk6EBwa ufDSbuzE64mWRl1dAIP96E9D2Kbn+dgMw8BU3uWlFKWraK.XJ85LKHBm3OAn 2XBbh8Y0HKLawhg.LLfQ.LJfECXL.iCXI.l.vg.NBvwmLPXU6jQl4Au0m+Xa tqa6b84tE3yt4tqz1fQzOgQa8F0qEa8IEpoqy2Y1SezkrfpKtuFIrCeYzy0U e7swiCx132kpjEQm1Gc5uKITeJD6oiFxd9X1UaWWUTU2ymtDZbV6ByYlqvHA ClXthJfsWenAN8e0w9JQE4p+8ubY8go72Z7lp80qG5d6GiA3GZnLYiNWYyCO 5cLqDD7W6dedVlz97gN+x7rcUsQI8Z.b2Q6EtDIwbHIyB5BrjhcIojfKIpKI wCtjHtjDK3RB6RRwAWRHWRhFbIAcHIRPUDxCEEdFk3hQgOqjvkjBeVIjyPov mVB4ZDGI74kPtRLQBbhIjOYldy6DDIA8PRgiRl+CnSJQCKlHDeRW9+vo1adc 9ef2xJ69 -----------end_max5_patcher-----------
it seems not only i didn’t see that you’re running max 4.6, sorry for the real helpful patch i guess.
I don’t know if this was in 4.6 already the case but what you seem to need is the "inc" "dec" command (for increase/decrease of course)to the matrixctrl object.
so sending for example "0 0 inc" to matrixctrl would alternate the state of the cell with the coordinates 0 0 everytime you send the message. So you can store the state of a pad or cell in matrixctrl. of course you need to remove the note-offs either with stripnote or a simple gate which is opened by "!= 0" for example.
the rest is converting the "pitches" of the launchpad to matrixctlr coordinates. Find that an interesting process, say so if you need help on this.
I’m doing something similar and this has helped a great deal! I’m using NI Maschine for a similar task. However, instead of muting/unmuting instruments/melodies I am using it to select patterns.
So I have a patch similar to the example above, so that when a note is hit the select object picks up the note and latches the toggle box.
However, in my case, this can lead to more than one toggle lit at once where as I should only ever have one as I want to select one pattern or another.
So basically I want to send an off message to all the other toggles when one is selected. Is there a way to do this with select or an alternate object? I could use if/else and != calculations but this seems like overkill.