okay, so 9 hours ago i posted in a comment links to other questions/answers regarding this topic for you to maybe pre-digest.
this is the issue of audio-to-MIDI conversion, which has been discussed, particularly among the Music Information Retrieval(MIR) people. it's not a perfectly solved problem, especially for anything polyphonic. even picking apart a duet is hard.
for monophonic, it's not so hard to get a decent pitch contour plot (that is the detected pitch vs. time) along with a plot for amplitude vs. time and a plot for pitch confidence or tone harmonicity (or the degree of periodicity of the note waveform) vs. time. there are other measures that one can do, such as a few different timbre parameters (like brightness, even/odd harmonic energy ratio).
what would be interesting maybe for you to do is, with your favorite monophonic test file (people often use Tom's Diner from Suzanne Vega) and see what pitch contour you get from YIN. and compare that to the pitch contour you get from using the ASDF (turned into autocorrelation) and peak picking from my other answers:
Fast pitch recognition
How to deal with low fundamental when using AMDF for pitch extraction?
What is an AMDF?
What is the difference between pitch detection and Onset detection?
so first make sure you get a decent pitch contour for your monophonic voice and see if the "octave errors" get patched up before looking for note onsets.
for many notes, the onset is clear by looking at sharp transitions in the amplitude contour curve and in the "harmonicity" curve. but if you're humming and not having any impulsive or sharp beginnings to notes, these curves make it hard to detect note onsets. sometimes then you need to look at somewhat sharper pitch transitions and also when the pitch crosses semi-tone boundaries. but somehow you don't want vibrato to trigger new notes if the vibrato happens to bring your note a little closer to another pitch in the 12 notes per octave scale.
finally, once you do effectively segment your notes, then you need to look at the pitch contour and decide, closer to the note onset, which of the equally-tempered, $\frac1{12}$ octave pitches you are closest to. but that can have a pitch offset if the whole song is a little sharp or a little flat (but the notes are well tuned to each other).