Sha256: a275dd89ac084e35a38efed55e72a39625595fccac8b4529675f4ca659eb1607

Contents?: true

Size: 870 Bytes

Versions: 2

Compression:

Stored size: 870 Bytes

Contents

#!/usr/bin/env ruby
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require "ruck"

# stuff accessible in a shred
module ShredLocal

  def blackhole
    BLACKHOLE
  end
  
  def now
    SHREDULER.now
  end

  def spork(name = "unnamed", &shred)
    SHREDULER.spork(name, &shred)
  end

  def play(samples)
    SHREDULER.current_shred.yield(samples)
  end

  def finish
    shred = SHREDULER.current_shred
    SHREDULER.remove_shred shred
    shred.finish
  end

end


SAMPLE_RATE = 22050
SHREDULER = Ruck::UGenShreduler.new
BLACKHOLE = Ruck::InChannel.new

filenames = ARGV
filenames.each do |filename|
  unless File.readable?(filename)
    LOG.fatal "Cannot read file #{filename}"
    exit
  end
end

filenames.each do |filename|
  SHREDULER.spork(filename) do
    include ShredLocal
    include Ruck::Generators
    require filename
  end
end
SHREDULER.run

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruck-0.1.2 bin/ruck_ugen
ruck-0.1.0 bin/ruck_ugen