Note off to Max from external instrument
Hello, pretty sure it´s easy but I can´t do it:
I´m sending MIDI notes [notein] with a pad to max/MSP. So I send [45 127], [34 127], etc., for example, and then these notes are on. This is ok, but I want that, when I press again "45" (or "34"), now it sends note off to max/msp. I mean: one time for note on; second time for note off, and of course, playing in the meantime a lot of notes.
How can I make this?
Thank you very much and best regards.
there’s a Max object for that!
The [toggle] object functions as a latching switch:
----------begin_max5_patcher---------- 676.3oc2W1rbaBCDG+ryL4cPiNSyfDeXbeP5kNYxHf0DkwH4QHRral9tWgDD am3DCs.MsGrjY0hz+8GhUKOe8UKvoxcPEF8Uz2QKV7rwxBqsFKK5Lr.Wx1ks gUYcDmIKKAgF60NnF1osCHEa1iD.jC4H9ZzdYM5IlPizRTErkoXZ.Iq0nRnp hUXV1tYXCW.YxZgcZB5rJpKMduAz1k0uyLO2sXoO7EZ3KSwZUQp0sadww0Rg th+CnwLgdpcAqzZG+MPkyDL7QKJWzsljNqaY5r64hh6TPl1QqPZyRgHqhrcQ 1qZZQ2Zuoed8UM8lNudS1ZCWqwmO9CNW7SwGTnxDRZPcGHXoafSQlFJaeHik qWi8PXulFo.itsyI2Zo2uEZ8j27LFgs+N31zR0fXRCGChcv021QIyKUI+uQU ZTznSUsrnv.jyiUxYvJIoeX8rD6.oRKxjajJ2X92PhCW5G6Y92xn3j3.uirY CvguELvhm.GkBB6ZmUVE+OBqZeccDYUZsVadCZ.r5vg.uAGoLQA92OtZeuwk om5OywEcBhK2d6wLtDvSF091hATFQClMCnvjAj6M48i4IIqYPOfEw1kPFgjl sU97VZY3Dgtb.6NV9AfZLAD8x.h31GEE3pGZZ.TXx.ATzmA.sZzAzfSiDLYY QbUSDF00NmQ0TjabU+hJ2Ta+lkW+gS1YsYfWEqUxZUVm95NyBczAt4PklKXZ dSsiG7J9TutmmmChSJ.HmW0TTfEL9uO96uvn8RXIyuvh6ivnz4WXI8RXjYWX M5hbwmjg+Uz0k2gM+OHi5itl+M9K+bJqf9Hqkytr5U5qn+HY0l+msc6ifppc lcJxbn1CtO2J1ycMW3t1cvCVAOx6tEWgCXlxbPj1bJTsxUswt3PrYD6BZZ9E o86SqC -----------end_max5_patcher-----------
Hello, thank you very much for your help, but I have 88 pads and I can route 88 messages, but it´s not very "clean".
Thank you very much again.
There are several ways to do this, and numerous examples in the tutorials. There is no one "right" way to do this, but there is one that will be "right for you."
You may want to look at [poly] and [poly~], as well as the MSP Tutorials on integrating with MIDI (18-21). You may also want to look at [stripnote] and [flush] and work through Max MIDI Tutorial 2.
Unless you can be super-specific with what you’re exactly trying to do, a general question has a high chance of garnering responses in the close-but-no-cigar category. For instance, I’m not sure how anyone could guess that you had 88 inputs from the original post.
Here’s one way – using a coll to keep a register of played notes slightly adapted from something I had lying around. I would also second what Peter said re: lack of specificity, as there are a some assumptions in my solution…
----------begin_max5_patcher---------- 1239.3oc2Z1sbapCDG+Z6mBFt5blI0Cq9fO5c84nyYxfsURUKF7.x4jS6z28 CZEDiSLfbBVjlKhYjLf28m9qcWIkesbg+5hGEU9de16qdKV7qkKVfco6XQS6 E96RebSVZEda96DUUo2K7uw7cJwiJr+MYhzx1dyOrq3fJSnvmAZ58thbUk7m BrufUAMcatS0+sWXrCeeu+o4q1WJpD4pTkrH+1RwFk4N3g5m1Khp+Ln4iiOT pZy2j4228AhwaEfX8EJYEutQXmmQtEchh0e+SbpeG6MOcGZV9eoTll0w+j4s tGQ22uWtT+wMVRwME61U6Xufh096gLk2ekWnD238fH6uOORaY2ck2uFa+DM6 AxmAJTHRSCdPHxFNBRMgNKUHWHUfWAUpeAqE8HhHWnHRpoqm+5z76GUOQ3FR .A1JnHgvpH9SvilLH6fwY29zx59UhxaE4oqyDcGj+ykq.0nvRrlq.oilbDrF L2XU7u01wKlCeHee5le3AdASJw0Wr.crPt9RXLpO6icrDWLc977Q4s1a8zfF TEZqZjFi.hxhrUMRMADnrXinbH0HK7iLQ6Ut0vl5vgCwlf4iMk0tnXplJpIi UTwbALYX6CKzHGToQOXQdr3i2VwZmFV57y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responses. Maybe it´s my english, but I don´t know how to be more specific with my question (I had forgotten the 88 pads, but the rest is exactly how noob-meister had understood). I´ll try again: I have a pad with 88 pads. If I press one pad it sends one MIDI note number, and "1" while I sustain and "0" when I release the pad, but I can isolate this and use only the MIDI note number for my purpose. What I need is that when I press the pad number 54, for example, Max understand it like "1", and if I press it again, then it be "0". But I can press 34, then 23, then 12… and all of them be 1, and if I press after that, "34" again, then it be "0". So, it cans work as a sampler, for example, but in a way that I don´t need maintain my finger to maintain the sound: it maintains the sound still I press the same pad again.
I hope now it don´t be worst ;-)
Thank you very much and best regards.
Spectro, thank you very much for your help, I´ll take a look when I arrive at home.
Thank you very much, Spectro, with your patch I can see when I´m pressing the pad, but that´s not what I need. I was reading what I wrote this afternoon, and I must apologize very much for my english. I´ll try again:
- For my purpose, we can imagine it is for a sampler: if I press a pad, then it receives the MIDI number note and it´s note on.
- If I press again, it receives the MIDI number note and that now it´s note off, because before it was note on.
Thank you very much and best regards.
The patch I posted will do what you require – Its just not connected to midi ports/devices to illustrate its function. Its up to you to modify the patch to connect it to your MIDI devices. Hint:replace the kslider up top with note in (note number and velocity), and if you are sending the notes back out via MIDI, a noteout replaces number boxes at the bottom of the patch)
Hello, I did it, but with the kslider it works because kslider "doesn´t know" when I release the key. But with a MIDI device it works in other way: when I release the key it sends "note off" (velocity=0), so the result at the bottom is 0. I need that when I press the key the velocity maintain that value still I press the key again. The problems are two with MIDI devices, for what I need: it has to avoid the release message, and it has to remember that it has been touched still I touch it again.
----------begin_max5_patcher---------- 1187.3oc4Z1sbiZCEG+Z6mBFtpcFudz2.8t9bzoSFrQIq1hEd.4ro6N66dQR PhsWiPNEDa6dQLivxni9oy4+QGQ955Uw6pdg2DG8aQ+QzpUec8pUlaouwpt1 qhOj+x9x7FS2hk7OWs6Swarekh+hxb6lOmer+lUmTkbk5uOxsO3XgTEuwdI5 O65zwZdCWpxUhJ4C078JaewTzV5lHDBtErIBz8wq+pGqjJY9AyCN92qE4k8C p7zAgrcXMV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XNIgCOI9nrFtzx De7lQATpOyW2YX3VuFMub3B2ILe11RVX8ef9DteO4BSRzY35JigAHaSS5aOC Y7HroHF3p4.EiMyA744rMslgY.lMEQMWMCdi61+yEoLx19VyvbPenfS8lpR. .6VkXWrwo4wMB50h.8GqcoRBnTgOR6TPXsmwjtngamSHeB.fjvZOitw6vc.K Pe1YIhFV9fFy+IbmnAEO8Bno.16U.0d9d4GO9LutoyHL1d7g7OUUqax1XZJj 1lFaHtl+rnu+oq0Osus9e.PicxmO -----------end_max5_patcher-----------
Great! That´s exactly what I needed! I think I love you ;-) Now I have to study your patch to understand it. Thank you, thank you very much :-)
Forums > MaxMSP