Melodic density, while not a "term of art", would be generally understood to mean as you intend.
In 1962, Milton Babbitt coined the term time-point interval, which can be used to describe the linear density of pitch onsets. A time point is the instantaneous moment at which a note begins (its onset). The time-point interval is the distance between onsets. It can be measured according to note-values rather than absolute time, and thus is tempo-independent.
For example, in 4/4 time, a quarter note followed by a quarter rest and then a half note would have a time-point interval (also called interonset interval) of a half note — the time from the initiation of the first quarter note to the initiation of the half note. An eighth note followed by a dotted quarter rest and then a half note would also have a time-point interval of a half note.
Thus, a measure with 40 linear (melodic) onsets would have a higher average interonset interval (call it interonset density) than a measure with 10 linear onsets.