It depends on [seq] from cyclone, and the [mscale] and [markov] abstraction. And OF, ofxPd, webMidi and Emscripten.
https://forum.pdpatchrepo.info/topic/11722/mscale-transpose-notes-according-to-given-scale-and-root
https://forum.pdpatchrepo.info/topic/12147/midi-into-seq-and-markov-chains
Here is the patch: https://webmidimarkov.handmadeproductions.de/
And here is also a PD only version: https://github.com/Jonathhhan/ofEmscriptenExamples/tree/main/midiFileMarkovPDversion