Upgrade code for use with Sonic-Pi Version 2

Altered the syntax of in_thread for compliance with Sonic-Pi v2