File tree 2 files changed +24
-4
lines changed
2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ def oscillator
24
24
Node ::Oscillator . new ( self )
25
25
end
26
26
27
- def delay
28
- Node ::Delay . new ( self )
27
+ def delay ( max_time )
28
+ Node ::Delay . new ( self , max_time )
29
29
end
30
30
31
31
def dynamics_compressor
Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ class Delay
77
77
include Native
78
78
include Pluggable
79
79
80
- def initialize ( audio_context , max_time )
81
- super `#{ audio_context . to_n } .createDelay(max_time || 1 )`
80
+ def initialize ( audio_context , max_time = 1 )
81
+ super `#{ audio_context . to_n } .createDelay(max_time)`
82
82
end
83
83
84
84
def time = ( time )
@@ -96,6 +96,10 @@ class DynamicsCompressor
96
96
97
97
alias_native :reduction
98
98
99
+ def initialize ( audio_context )
100
+ super `#{ audio_context . to_n } .createDynamicsCompressor()`
101
+ end
102
+
99
103
def treshold = ( treshold )
100
104
`#@native .treshold.value = treshold`
101
105
end
@@ -138,13 +142,27 @@ def release
138
142
end
139
143
140
144
class BiquadFilter
145
+ TYPES = %i( lowpass highpass bandpass lowshelf highshelf peaking notch allpass )
146
+
141
147
include Native
142
148
include Pluggable
143
149
144
150
def initialize ( audio_context )
145
151
super `#{ audio_context . to_n } .createBiquadFilter()`
146
152
end
147
153
154
+ def type = ( type )
155
+ unless TYPES . include? ( type )
156
+ raise ArgumentError , "type #{ type } doesn't exists"
157
+ end
158
+
159
+ `#@native .type = type`
160
+ end
161
+
162
+ def type
163
+ `#@native .type`
164
+ end
165
+
148
166
def detune = ( detune )
149
167
`#@native .detune.value = #{ @detune = detune } `
150
168
end
@@ -170,6 +188,8 @@ class StereoPanner
170
188
include Native
171
189
include Pluggable
172
190
191
+ alias_native :normalize
192
+
173
193
def initialize ( audio_context )
174
194
super `#{ audio_context . to_n } .createStereoPanner()`
175
195
end
You can’t perform that action at this time.
0 commit comments