Class: FMOD::Effects::Delay

Inherits:
Dsp
  • Object
show all
Defined in:
lib/fmod/effects/delay.rb

Overview

Note:

Every time MaxDelay is changed, the plugin re-allocates the delay buffer. This means the delay will disappear at that time while it refills its new buffer.

A larger #max_delay results in larger amounts of memory allocated.

Channel delays above #max_delay will be clipped to MaxDelay and the delay buffer will not be re-sized.

This unit produces different delays on individual channels of the sound.

Instance Attribute Summary collapse

Attributes inherited from Dsp

#active, #bypass, #channel_format, #input_count, #output_count, #parameter_count, #parent, #type, #wet_dry_mix

Attributes inherited from Handle

#user_data

Instance Method Summary collapse

Methods inherited from Dsp

#add_input, bool_param, data_param, #disconnect, #disconnect_from, #enable_metering, float_param, from_handle, #get_bool, #get_data, #get_float, #get_integer, #idle?, #info, #input, #input_connection, #input_metering?, integer_param, #name, #output, #output_connection, #output_format, #output_metering?, #param_info, #play, #reset, #set_bool, #set_data, #set_float, #set_integer, #set_wet_dry_mix, #show_dialog, #to_s, type_map, #version

Methods inherited from Handle

#initialize, #int_ptr, #release, #to_s

Constructor Details

This class inherits a constructor from FMOD::Handle

Instance Attribute Details

#max_delayFloat

Maximum delay in ms.

  • Minimum: 0.0

  • Maximum: 10000.0

  • Default: 10.0

Returns:

  • (Float)

    the current value of max_delay



21
22
23
# File 'lib/fmod/effects/delay.rb', line 21

def max_delay
  @max_delay
end

Instance Method Details

#[](channel) ⇒ Float

Retrieves the delay, in ms, for the specified channel.

Parameters:

  • channel (Integer)

    The channel index to retrieve (0 to 15).

Returns:

  • (Float)


27
28
29
# File 'lib/fmod/effects/delay.rb', line 27

def [](channel)
  get_float(channel.clamp(0, 15))
end

#[]=(channel, delay) ⇒ Float

Sets the delay, in ms, for the specified channel.

Parameters:

  • channel (Integer)

    The channel index to set (0 to 15).

  • delay (Float)

    The delay value, clamped between 0.0 and 10000.0.

Returns:

  • (Float)

    The delay.



36
37
38
39
# File 'lib/fmod/effects/delay.rb', line 36

def []=(channel, delay)
  set_float(channel.clamp(0, 15), delay.clamp(0.0, 10000.0))
  delay
end