Spontaneous composition

Spontaneous composition is music performed, occurring, or resulting from a sudden natural impulse, tendency, or inclination; without effort or premeditation; natural and unconstrained; unplanned.

Improvisation is one possible compositional tool used in creating a spontaneous composition.