Revert to explicitly passing midi receiver rather than using dynamic vars. Dynamic vars were not working for functions that executed code on other threads.