Method: Scruby::Audio::Server#boot
- Defined in:
- lib/scruby/audio/server.rb
#boot ⇒ Object
Boots the local binary of the scsynth forking a process, it will rise a SCError if the scsynth binary is not found in /Applications/SuperCollider/scsynt (default Mac OS path) or given path. The default path can be overriden using Server.scsynt_path=(‘path’)
41 42 43 44 45 46 47 48 |
# File 'lib/scruby/audio/server.rb', line 41 def boot raise SCError.new('Scsynth not found in the given path') unless File.exists?( @@sc_path ) Thread.new do path = @@sc_path.scan(/[^\/]+/) @server_pipe = IO.popen( "cd /#{ path[0..-2].join('/') }; ./#{ path.last } -u #{ @port }" ) loop { p Special.new(@server_pipe.gets.chomp) } end unless @server_pipe end |