Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MultiOut ugens can accept an array as input, little gem version bump

  • Loading branch information...
commit ec83dff8fe11786226d8735a59a85feac01275b6 1 parent e4a6c7f
@maca authored
Showing with 0 additions and 53 deletions.
  1. +0 −53 lib/scruby/ugens/multi_out_ugens.rb
View
53 lib/scruby/ugens/multi_out_ugens.rb
@@ -1,53 +0,0 @@
-module Scruby
- module Ugens
- module MultiOut #:nodoc:
- def self.included base
- base.extend ClassMethods
- end
-
- def initialize rate, channels, *inputs
- super rate, *inputs
- @channels = Array === channels ? channels : (0...channels).map{ |i| OutputProxy.new rate, self, i }
- @channels = @channels.to_da
- end
-
- def output_specs
- channels.output_specs
- end
-
- module ClassMethods
- private
- def new rate, channels, *inputs
- instantiated = super
- Array === instantiated ? instantiated : instantiated.channels
- end
- end
- end
-
- class OutputProxy < Ugen #:nodoc:
- attr_reader :source, :control_name, :output_index
- class << self; public :new; end
-
- def initialize rate, source, output_index, name = nil
- super rate
- @source, @control_name, @output_index = source, name, output_index
- end
-
- def index; @source.index; end
-
- def add_to_synthdef; end
- end
-
- class Control < Ugen #:nodoc:
- include MultiOut
-
- def initialize rate, *names
- super rate, names.collect_with_index{ |n, i| OutputProxy.new rate, self, i, n }
- end
-
- def self.and_proxies_from names
- new names.first.rate, *names
- end
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.