so a single cpp file can only have one class in it? all functions are considered part of the class?
No and no. If the function is declared inside a class, it must be implemented as a class method, using the
ReturnType ClassName::MethodName(ArgType arg)
format.
If the function is declared outside the class, it is a global method, but it does not have access to variables defined in other files, unless the extern keyword is used to import the variable into the file scope.
Perhaps I am misunderstanding... I want to split my midi related stuff out of my main sketch into a midi.cpp file... part of this midi related stuff is the class, but not all of it. Am I to understand that I cannot have a global function and a class in a single cpp file?
You can have non-class members in the file. But, those non-class members can not call methods in a class without an instance of that class. If the instance is declared in another file, that instance must be imported using the extern keyword.