/
in_out.rb
46 lines (40 loc) · 1.36 KB
/
in_out.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module Scruby
module Ugens
class In < Ugen
include MultiOut
class << self
# New In with :audio rate, inputs should be valid Ugen inputs or Ugens, arguments can be passed as an options hash or in the given order
def ar bus, channels = 1
new :audio, channels, bus
end
# New In with :control rate, inputs should be valid Ugen inputs or Ugens, arguments can be passed as an options hash or in the given order
def kr bus, channels = 1
new :control, channels, bus
end
end
end
class Out < Ugen
# ar and kr should be use for instantiation
def initialize *args
super
@channels = []
end
#:nodoc:
def output_specs; []; end
class << self
# New Out with :audio rate, inputs should be valid Ugen inputs or Ugens, arguments can be passed as an options hash or in the given order
def ar bus, *inputs
inputs.peel!
new :audio, bus, *inputs; 0.0 #Out has no output
end
# New Out with :control rate, inputs should be valid Ugen inputs or Ugens, arguments can be passed as an options hash or in the given order
def kr bus, *inputs
inputs.peel!
new :control, bus, *inputs; 0.0 #Out has no output
end
end
end
class ReplaceOut < Out
end
end
end