I don't know why I get this errors.

I don't know why??????

So, in what scope are noteOn and noteOff defined? None is the wrong answer.

You can't call a function you haven't written (or have no intention of writing).