Class: FMOD::Core::Reverb

Inherits:
Structure
  • Object
show all
Defined in:
lib/fmod/core/reverb.rb

Overview

Structure defining a reverb environment.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Structure

#inspect, #names, #values

Constructor Details

#initialize(address = nil) ⇒ Reverb

Returns a new instance of Reverb.

Parameters:

  • address (Pointer, Integer, String, nil) (defaults to: nil)

    The address in memory where the structure will be created from. If no address is given, new memory will be allocated.



15
16
17
18
19
20
21
# File 'lib/fmod/core/reverb.rb', line 15

def initialize(address = nil)
  types = Array.new(12, TYPE_FLOAT)
  members = [:decay_time, :early_delay, :late_delay, :hf_reference,
             :hf_decay_ratio, :diffusion, :density, :low_shelf_freq,
             :low_shelf_gain, :high_cut, :early_late_mix, :wet_level]
  super(address, types, members)
end

Instance Attribute Details

#decay_timeObject

Reverberation decay time (ms).

  • Minimum: 0.0

  • Maximum: 20000.0

  • Default: 1500.0



34
35
36
# File 'lib/fmod/core/reverb.rb', line 34

def decay_time=(value)
  self[:decay_time] = value.clamp(0.0, 20000.0)
end

#densityFloat

The modal density in the late reverberation decay (%).

  • Minimum: 0.0

  • Maximum: 100.0

  • Default: 100.0

Returns:

  • (Float)


94
95
96
# File 'lib/fmod/core/reverb.rb', line 94

def density=(value)
  self[:density] = value.clamp(0.0, 100.0)
end

#diffusionFloat

The echo density in the late reverberation decay (%).

  • Minimum: 0.0

  • Maximum: 100.0

  • Default: 100.0

Returns:

  • (Float)


84
85
86
# File 'lib/fmod/core/reverb.rb', line 84

def diffusion=(value)
  self[:diffusion] = value.clamp(0.0, 100.0)
end

#early_delayFloat

Initial reflection delay time (ms).

  • Minimum: 0.0

  • Maximum: 300.0

  • Default: 7.0

Returns:

  • (Float)


44
45
46
# File 'lib/fmod/core/reverb.rb', line 44

def early_delay=(value)
  self[:early_delay] = value.clamp(0.0, 300.0)
end

#early_late_mixFloat

Early reflections level relative to room effect (%).

  • Minimum: 0.0

  • Maximum: 100.0

  • Default: 50.0

Returns:

  • (Float)


134
135
136
# File 'lib/fmod/core/reverb.rb', line 134

def early_late_mix=(value)
  self[:early_late_mix] = value.clamp(0.0, 100.0)
end

#hf_decay_ratioFloat

High-frequency to mid-frequency decay time ratio (%).

  • Minimum: 10.0

  • Maximum: 100.0

  • Default: 50.0

Returns:

  • (Float)


74
75
76
# File 'lib/fmod/core/reverb.rb', line 74

def hf_decay_ratio=(value)
  self[:hf_decay_ratio] = value.clamp(10.0, 100.0)
end

#hf_referenceFloat

Reference high frequency (Hz).

  • Minimum: 20.0

  • Maximum: 20000.0

  • Default: 5000.0

Returns:

  • (Float)


64
65
66
# File 'lib/fmod/core/reverb.rb', line 64

def hf_reference=(value)
  self[:hf_reference] = value.clamp(20.0, 20000.0)
end

#high_cutFloat

Relative room effect level at high frequencies (Hz).

  • Minimum: 20.0

  • Maximum: 20000.0

  • Default: 20000.0

Returns:

  • (Float)


124
125
126
# File 'lib/fmod/core/reverb.rb', line 124

def high_cut=(value)
  self[:high_cut] = value.clamp(20.0, 20000.0)
end

#late_delayFloat

Late reverberation delay time relative to initial reflection (ms).

  • Minimum: 0.0

  • Maximum: 100.0

  • Default: 11.0

Returns:

  • (Float)


54
55
56
# File 'lib/fmod/core/reverb.rb', line 54

def late_delay=(value)
  self[:late_delay] = value.clamp(0.0, 100.0)
end

#low_shelf_freqFloat

Reference low frequency (Hz).

  • Minimum: 20.0

  • Maximum: 1000.0

  • Default: 250.0

Returns:

  • (Float)


104
105
106
# File 'lib/fmod/core/reverb.rb', line 104

def low_shelf_freq=(value)
  self[:low_shelf_freq] = value.clamp(20.0, 1000.0)
end

#low_shelf_gainFloat

Relative room effect level at low frequencies (dB).

  • Minimum: -36.0

  • Maximum: 12.0

  • Default: 0.0

Returns:

  • (Float)


114
115
116
# File 'lib/fmod/core/reverb.rb', line 114

def low_shelf_gain=(value)
  self[:low_shelf_gain] = value.clamp(-36.0, 12.0)
end

#wet_levelFloat

Room effect level at mid frequencies (dB).

  • Minimum: -80.0

  • Maximum: 20.0

  • Default: -6.0

Returns:

  • (Float)


144
145
146
# File 'lib/fmod/core/reverb.rb', line 144

def wet_level=(value)
  self[:wet_level] = value.clamp(-80.0, 20.0)
end

Class Method Details

.alleyReverb

Returns an alley environment.

Returns:

  • (Reverb)

    an alley environment.



275
276
277
# File 'lib/fmod/core/reverb.rb', line 275

def self.alley
  new [1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8].pack('f*')
end

.arenaReverb

Returns an arena environment.

Returns:

  • (Reverb)

    an arena environment.



245
246
247
# File 'lib/fmod/core/reverb.rb', line 245

def self.arena
  new [7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6].pack('f*')
end

.auditoriumReverb

Returns an auditorium environment.

Returns:

  • (Reverb)

    an auditorium environment.



227
228
229
# File 'lib/fmod/core/reverb.rb', line 227

def self.auditorium
  new [4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7].pack('f*')
end

.bathroomReverb

Returns a bathroom environment.

Returns:

  • (Reverb)

    a bathroom environment.



209
210
211
# File 'lib/fmod/core/reverb.rb', line 209

def self.bathroom
  new [1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5].pack('f*')
end

.carpeted_hallwayReverb

Returns a carpeted hallway environment.

Returns:

  • (Reverb)

    a carpeted hallway environment.



257
258
259
# File 'lib/fmod/core/reverb.rb', line 257

def self.carpeted_hallway
  new [300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0].pack('f*')
end

.caveReverb

Returns a cave environment.

Returns:

  • (Reverb)

    a cave environment.



239
240
241
# File 'lib/fmod/core/reverb.rb', line 239

def self.cave
  new [2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3].pack('f*')
end

.cityReverb

Returns a city environment.

Returns:

  • (Reverb)

    a city environment.



287
288
289
# File 'lib/fmod/core/reverb.rb', line 287

def self.city
  new [1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0].pack('f*')
end

.concert_hallReverb

Returns a concert hall environment.

Returns:

  • (Reverb)

    a concert hall environment.



233
234
235
# File 'lib/fmod/core/reverb.rb', line 233

def self.concert_hall
  new [3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8].pack('f*')
end

.forestReverb

Returns a forest environment.

Returns:

  • (Reverb)

    a forest environment.



281
282
283
# File 'lib/fmod/core/reverb.rb', line 281

def self.forest
  new [1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3].pack('f*')
end

.from_index(index) ⇒ Reverb

Returns a pre-mad Reverb preset from the specified FMOD::Core::ReverbIndex.

Parameters:

  • index (Integer)

    The index of the preset to retrieve.

Returns:

  • (Reverb)

    the reverb preset.



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/fmod/core/reverb.rb', line 154

def self.from_index(index)
  case index
  when ReverbIndex::GENERIC then generic
  when ReverbIndex::PADDED_CELL then padded_cell
  when ReverbIndex::ROOM then room
  when ReverbIndex::BATHROOM then bathroom
  when ReverbIndex::LIVING_ROOM then living_room
  when ReverbIndex::STONE_ROOM then stone_room
  when ReverbIndex::AUDITORIUM then auditorium
  when ReverbIndex::CONCERT_HALL then concert_hall
  when ReverbIndex::CAVE then cave
  when ReverbIndex::ARENA then arena
  when ReverbIndex::HANGAR then hangar
  when ReverbIndex::CARPETED_HALLWAY then carpeted_hallway
  when ReverbIndex::HALLWAY then hallway
  when ReverbIndex::STONE_CORRIDOR then stone_corridor
  when ReverbIndex::ALLEY then alley
  when ReverbIndex::FOREST then forest
  when ReverbIndex::CITY then city
  when ReverbIndex::MOUNTAINS then mountains
  when ReverbIndex::QUARRY then quarry
  when ReverbIndex::PLAIN then plain
  when ReverbIndex::PARKING_LOT then parking_lot
  when ReverbIndex::SEWER_PIPE then sewer_pipe
  when ReverbIndex::UNDERWATER then underwater
  else off
  end
end

.genericReverb

Returns a generic reverb environment.

Returns:

  • (Reverb)

    a generic reverb environment.



191
192
193
# File 'lib/fmod/core/reverb.rb', line 191

def self.generic
  new [1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0].pack('f*')
end

.hallwayReverb

Returns a hallway environment.

Returns:

  • (Reverb)

    a hallway environment.



263
264
265
# File 'lib/fmod/core/reverb.rb', line 263

def self.hallway
  new [1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5].pack('f*')
end

.hangarReverb

Returns a hangar environment.

Returns:

  • (Reverb)

    a hangar environment.



251
252
253
# File 'lib/fmod/core/reverb.rb', line 251

def self.hangar
  new [10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4].pack('f*')
end

.living_roomReverb

Returns a living room environment.

Returns:

  • (Reverb)

    a living room environment.



215
216
217
# File 'lib/fmod/core/reverb.rb', line 215

def self.living_room
  new [500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0].pack('f*')
end

.mountainsReverb

Returns a mountain environment.

Returns:

  • (Reverb)

    a mountain environment.



293
294
295
# File 'lib/fmod/core/reverb.rb', line 293

def self.mountains
  new [1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0].pack('f*')
end

.offReverb

Returns no reverberation.

Returns:

  • (Reverb)

    no reverberation.



185
186
187
# File 'lib/fmod/core/reverb.rb', line 185

def self.off
  new [1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0].pack('f*')
end

.padded_cellReverb

Returns a padded cell environment.

Returns:

  • (Reverb)

    a padded cell environment.



197
198
199
# File 'lib/fmod/core/reverb.rb', line 197

def self.padded_cell
  new [170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8].pack('f*')
end

.parking_lotReverb

Returns a parking lot environment.

Returns:

  • (Reverb)

    a parking lot environment.



311
312
313
# File 'lib/fmod/core/reverb.rb', line 311

def self.parking_lot
  new [1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5].pack('f*')
end

.plainReverb

Returns a plain environment.

Returns:

  • (Reverb)

    a plain environment.



305
306
307
# File 'lib/fmod/core/reverb.rb', line 305

def self.plain
  new [1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0].pack('f*')
end

.quarryReverb

Returns a quarry environment.

Returns:

  • (Reverb)

    a quarry environment.



299
300
301
# File 'lib/fmod/core/reverb.rb', line 299

def self.quarry
  new [1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0].pack('f*')
end

.roomReverb

Returns a room environment.

Returns:

  • (Reverb)

    a room environment.



203
204
205
# File 'lib/fmod/core/reverb.rb', line 203

def self.room
  new [400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4].pack('f*')
end

.sewer_pipeReverb

Returns a sewer-pipe environment.

Returns:

  • (Reverb)

    a sewer-pipe environment.



317
318
319
# File 'lib/fmod/core/reverb.rb', line 317

def self.sewer_pipe
  new [2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2].pack('f*')
end

.stone_corridorReverb

Returns a stone corridor environment.

Returns:

  • (Reverb)

    a stone corridor environment.



269
270
271
# File 'lib/fmod/core/reverb.rb', line 269

def self.stone_corridor
  new [270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0].pack('f*')
end

.stone_roomReverb

Returns a stone room environment.

Returns:

  • (Reverb)

    a stone room environment.



221
222
223
# File 'lib/fmod/core/reverb.rb', line 221

def self.stone_room
  new [2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5].pack('f*')
end

.underwaterReverb

Returns an underwater environment.

Returns:

  • (Reverb)

    an underwater environment.



323
324
325
# File 'lib/fmod/core/reverb.rb', line 323

def self.underwater
  new [1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0].pack('f*')
end