Is there any midi overwrite/overdub option?

I would like to record midi in a loop and overwriting the notes. Is there a overwrite/overdub option I forgot? The overwriting doesn’t work so well, if you ask me…

I believe someone wrote a tool for that but currently no title keywords are hitting me at the moment that allows me to find the topic…

Maybe the auto clone pattern tool?