audio_stream 3.3.2 → 3.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/audio_stream/fx/schroeder_reverb.rb +13 -13
- data/lib/audio_stream/rate.rb +20 -0
- data/lib/audio_stream/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 323737f59491d3d370ca863c47eb54a2bce18dad3e1bf97d29674725e9e4213d
|
4
|
+
data.tar.gz: 4b1c734a8249a74f49a4a971535c4a2ed8c305de2e671ef4038a3766c17ab733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0b928495b8a46798be15e08254216fc9abea9b88d361abd96a9de0ea5d9449328a64509932d592a3307906be3a643344b6a46a1671e6f499fcf7c2d987675f5
|
7
|
+
data.tar.gz: bcc7884d895e368710535f8f265fdb1d4ba6080d14fcbd50195f3734a43a88518377a75111d6b00c51a6bb05bcba43997bd374537ce05d03998da8618c57f3d6
|
@@ -2,21 +2,25 @@ module AudioStream
|
|
2
2
|
module Fx
|
3
3
|
class SchroederReverb
|
4
4
|
|
5
|
-
|
5
|
+
# @param soundinfo [AudioStream::SoundInfo]
|
6
|
+
# @param time [AudioStream::Rate] reverb time
|
7
|
+
# @param dry [AudioStream::Decibel] dry gain
|
8
|
+
# @param wet [AudioStream::Decibel] wet gain
|
9
|
+
def initialize(soundinfo, time:, dry: -1.0, wet: -20.0)
|
6
10
|
@window_size = soundinfo.window_size
|
7
11
|
@combs = [
|
8
|
-
CombFilter.new(soundinfo, freq:
|
9
|
-
CombFilter.new(soundinfo, freq:
|
10
|
-
CombFilter.new(soundinfo, freq:
|
11
|
-
CombFilter.new(soundinfo, freq:
|
12
|
+
CombFilter.new(soundinfo, freq: time * (39.85 * 0.002), q: 0.871402),
|
13
|
+
CombFilter.new(soundinfo, freq: time * (36.10 * 0.002), q: 0.882762),
|
14
|
+
CombFilter.new(soundinfo, freq: time * (33.27 * 0.002), q: 0.891443),
|
15
|
+
CombFilter.new(soundinfo, freq: time * (30.15 * 0.002), q: 0.901117),
|
12
16
|
]
|
13
17
|
@allpasss = [
|
14
|
-
AllPassFilter.create(soundinfo, freq:
|
15
|
-
AllPassFilter.create(soundinfo, freq:
|
18
|
+
AllPassFilter.create(soundinfo, freq: Rate.msec(5.0).freq(soundinfo), q: BiquadFilter::DEFAULT_Q),
|
19
|
+
AllPassFilter.create(soundinfo, freq: Rate.msec(1.7).freq(soundinfo), q: BiquadFilter::DEFAULT_Q),
|
16
20
|
]
|
17
21
|
|
18
|
-
@dry = dry.
|
19
|
-
@wet = wet.
|
22
|
+
@dry = Decibel.create(dry).mag
|
23
|
+
@wet = Decibel.create(wet).mag
|
20
24
|
end
|
21
25
|
|
22
26
|
def process(input)
|
@@ -43,10 +47,6 @@ module AudioStream
|
|
43
47
|
|
44
48
|
Buffer.new(*streams)
|
45
49
|
end
|
46
|
-
|
47
|
-
def ms2freq(ms)
|
48
|
-
1.0 / (ms / 1000.0)
|
49
|
-
end
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
data/lib/audio_stream/rate.rb
CHANGED
@@ -47,6 +47,26 @@ module AudioStream
|
|
47
47
|
2.0 * Math::PI / sample(soundinfo)
|
48
48
|
end
|
49
49
|
|
50
|
+
def *(other)
|
51
|
+
other = other.to_f
|
52
|
+
|
53
|
+
if @sample
|
54
|
+
return self.class.new(sample: @sample * other)
|
55
|
+
end
|
56
|
+
|
57
|
+
if @sec
|
58
|
+
return self.class.new(sec: @sec * other)
|
59
|
+
end
|
60
|
+
|
61
|
+
if @freq
|
62
|
+
return self.class.new(freq: @freq / other)
|
63
|
+
end
|
64
|
+
|
65
|
+
if @sync
|
66
|
+
return self.class.new(sync: @sync * other)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
50
70
|
def self.sec(v)
|
51
71
|
new(sec: v)
|
52
72
|
end
|
data/lib/audio_stream/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: audio_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshida Tetsuya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|