I assume that you are trying to take a MIDI and transcribe it to MML when you say "Constantly changing lengths of notes".
Here's the way I think of note lengths for standard rhythms and swing-based rhythms:
A standard rhythm takes notes shorter than a quarter note, and cuts them in half.
► So, c4 split into two notes would be c8c8.
For swing-based rhythms, the line is cut two-thirds through the note.
► So, c4 split into two notes would be c6c12. (a triplet of sorts)