I want to write a class that has a function which uses in_thread, like so:
class MyClass def myFn in_thread do puts "test" play 60 end end end x = MyClass.new x.myFn
but it gives me this error:
Runtime Error: [buffer 6, line 11] - NoMethodError
undefined method `in_thread’ for #<SonicPi::RuntimeMethods::MyClass:0x26cdf60>
I know that in_thread and other functions like play are defined in lang/core.rb.
How can I access these functions from within a class?
Thanks in advance,
I’m a C# programer, but I’m completly new to ruby and sonic pi.
Today I learned what a &block parameter is