MIDI Pressure Sensitive Pad

Hi there,
new to the forum here so hello to everybody and apologies in advance for any stupid/redundant questions...
I have tried my best scouring this site and the internet to find an answer to no avail,
so here is the question.
I have made a diy FSR with conductive foam, the objective is to create a Midi controller that will play notes at a certain velocity depending on the pressure applied, with the minimum latency possible, so I am trying to find a way to do it without delay.
I can get it to work okish, problem is as I press the pad I get a stream of values that convert to notes being played one after the other very rapidly.
what I would like to do is to get all the analog values from 0 to the max pressure applied, retrieve the maximum value and then send and hold the noteOn as the values stabilize at the peak of the curve. As the values start to go down when i release the pad, I would like to send a noteOff, and do that only once per cycle.
If I introduce debouncing I can only get it to work with massive latency, and still I get a few noteOn events per Cycle.
I am really new to coding and arduino, trying my best to figure it out. Maybe there is a way to collect the data from 0 to max to 0 again and than analyze and manipulate it to achieve what I desire that I just don't know of...
Any nudge in the right direction would be greatly appreciated.

p.s. I don't attach any code at the moment because it's a mess, and I fear it would make things even more complicated.

So you need to detect the peak value, which is the value read just before they start decreasing again, at which
point trigger the midi event. Below some threshold you’d trigger a midi noteOff if one was current active.

A simple state machine diagram can be drawn for this, learn how to use state machines and such problems become easier…