Matrix: row = note just played, column = note that comes next; brightness = probability, digits = your weights (0-9). Click a cell to raise its weight (Shift+click lowers), or focus the matrix and use arrows and +/-. measured note share long-run (stationary) share.
Markov chain melody. The next note depends only on the current one: P(Xn+1=j | Xn=i) = Pij = Wij / Σk Wik, where W are the weights you set (a row of zeros is treated as uniform). Real tunes have longer memory; a first-order chain is a deliberately simple model of style.
Stationary distribution. The long-run share of each note is the vector π with πP = π, Σπi = 1. We compute it two independent ways: power iteration on the lazy chain (P+I)/2 and direct Gaussian elimination of the linear system. If the chain has several closed classes, π is not unique and the check says so.
Entropy rate. Surprise per note: h = −Σi πi Σj Pij log2 Pij bits (maximum log2 8 = 3). The live estimate counts the transitions actually played, −Σ (Nij/N) log2(Nij/Ni); it converges to h as the melody gets long, with a small downward bias for short ones.
Euclidean rhythm. Spreading k pulses as evenly as possible over n steps (Bjorklund's algorithm, from neutron-pulse timing) reproduces many world rhythms: E(3,8) is the tresillo, E(5,8) the cinquillo. Only pulse steps emit a note; other steps rest.
Simplifications. Notes are from a chosen scale with equal-tempered tuning, a fixed envelope and one voice; there is no harmony, phrase structure or dynamics, so the result is a statistical sketch of a style, not music with intent.