It wasn't working for me.

Changes:
changed setSom to function
removed unnecessary oscilator redefinition
removed gain (values >= 1 do nothing)
removed stopSom in favor of oscilator.stop