Midi key off problem and backwards kslider

Joe Donaghey's icon

Absolute beginner here. I have created a basic envelope connected to a saw~ controlled by my midi controller through a kslider and notein. How come when i press a key the note begins but when i take my finger off the key it restarts the note. Essentially sending a bang on key press and key off.

Second question is that somehow the pitches go high to low instead of low to high on a normal midi controller.

Max Patch
Copy patch and select New From Clipboard in Max.

Jean-Francois Charles's icon

Welcome Joe!
- why retrigger? your midi keyboard is sending a "note on" and "note off" message. You want to filter out the note off, or do something with the information. For instance, use [stripnote].
- why reversed low-high? I would answer with a question: why [ !/ 1000]?
- why did I add a [t b i] in your patch? Because it's a good thing to learn about the [t] object early, and to use and overuse it. Welcome to Max!
Try this:

Max Patch
Copy patch and select New From Clipboard in Max.

Roman Thilenius's icon

a note off event, which has a velocity of 0, does not automatically end up in ending a note in max.

depending on how you get midi in your patch and where you send it to, you must may control that yourself what velocity 0 should do.

because it is more difficult, i would recommend you to begin with the generic [midiin] object, and not with the specialized ones.

the midiin and midiparseobjects are always agreat start into control-rate data handling / "working with messages" with max.

and +1 for overusing [t] !

Joe Donaghey's icon

Thank you for the swift reply! Strip note is exactly what i was looking for apparently. I tried that and Flush at first but i guess i used stripnote wrong!

As for the [ !/ 1000] that was entirely due to watching a tutorial and seeing how it worked in someone else's patch

Again i used [t b i] earlier but must have used it wrong.

It's nice to know i was close at least!

Thank you for the help :)