Markov Melody Generator
First- and second-order chains, exported as MusicXML
Pitch weights — interval profile
Weight each interval by how often you want it to follow the current note. Weights are
whole numbers of any size; each one is converted to a percentage of the row total.
With nearest-neighbor octave placement, large intervals usually sound as their
inversions — 11 reads as a descending semitone.
The interval profile applies to all twelve rows. Override a single row to set exact
destination weights for one starting pitch class.
Destination pitch class
Chain order
← Reverse (gap-fill)
First order only
Continue →
Momentum reweights the first-order row by what just happened. Positive values favor
continuing in the same direction, and favor them more when the interval size also
repeats. Negative values favor turning around after a leap. At 0 the second-order
term vanishes and the chain is purely first-order.
Register & collection
Each new pitch class is placed at whichever octave sits closest to the previous note,
inside this range.
Pitch-class collection (optional)
Accepts 0,2,4,5,7,9,B, 0 2 4 5 7 9 B,
or unseparated 02457 9B. Hex throughout: A = 10, B = 11.
Pitch classes outside the collection get weight zero.
Rhythm weights
Each event draws a duration from these six weights. Durations that would cross a barline
are split and tied automatically.
Length
No key signature; accidentals are spelled with sharps. Reuse a seed to reproduce a
melody exactly.
Result
Notes
--
Rests
--
Measures
--
Range
--
Order
--
Seed
--
Pitches follow the Markov chain; durations are drawn independently from the rhythm weights.
Output is MusicXML 4.0, readable by MuseScore, Finale, Sibelius, and Dorico.