Most MIDI generators fail in the same way: they produce output that is technically varied but musically incoherent. Notes appear in unexpected ranges, rhythms drift outside the groove, phrases lose the character of the original idea. The tool feels powerful in demo mode and useless in a real session.
The core problem
Randomness and variation are not the same thing. Randomness distributes values without regard for context. Variation means changing something in a way that still feels like it belongs to the same musical statement. A melody can vary across four bars and still feel like one phrase. A MIDI generator that does not understand this will produce fragments, not music.
Probability with memory
The approach I use in NoteWeave is to give the generator memory of what it has recently played, and use that memory to bias probability. If a certain pitch class was emphasized in the last two bars, its probability increases slightly for the next phrase. If a rhythmic density was low, the system resists jumping to a busy pattern without a transition step. This creates a sense of organic continuity rather than random selection.
Rule sets over raw probability
Pure probability is hard to control. What works better is defining interval rules — which steps from the current pitch are allowed, preferred, or avoided — and using probability only to choose among the permitted options. The result is variation that stays inside a musical behavior: the same scale, the same emotional register, the same rhythmic feel, but never exactly the same notes.
This is a small shift in architecture but it changes the character of everything the generator produces. Instead of random notes filtered after the fact, you get intentional motion constrained by musical logic. The producer's job becomes shaping the rules, not correcting the output.