Try reposting the code in </> code tags so it's not in italics.
How do you expect the analog inputs to work? If the analog level controls the velocity when do you decide to send a NoteOn with that velocity? Every time the input changes? By how much? Or what?
Steve