Best/easiest way to shape MIDI notes dynamically? (BBC SO Discover strings)

I have a MIDI file with long notes. Rather than have each note play at a single dynamic level, I would like to "shape" the notes dynamically so that each note builds quickly at the start and then tapers off, but without stopping short. So instead of a bunch of boxes dynamically, I'd have a bunch of whales swimming to the left. (See sketch below.) I'm looking for the best/easiest way to do this with all the notes in a MIDI file in one go, as a starting point, as opposed to doing it note by note. My DAW is REAPER, if that helps. Thanks! (edit: I realize the picture below is an exaggeration, because the live playing already has some shape -- not just box-like. But I would like to be able to shape the notes further.)