If you allowed only one octave of notes (ie C to C) plus a rest,
and limited the timing to 16th notes, then for just one measure,
there are 2,177,953,337,809,371,136 combinations.
Allow two octaves, and the number rises to 43,608,742,899,428,874,059,776
And that's just one measure of a one part melody.