fixed 0 notes played bug - initialize all the variables!
added NOTE_OFF test case; fixed some pointer issues; new function for
putting into midi buffer
more proper handling of empty stacks