Class: FMOD::Dsp
Overview
Represents a digital signal processor. This allows for monitoring and applying effects to the sound in real-time.
Direct Known Subclasses
Effects::ChannelMix, Effects::Chorus, Effects::Compressor, Effects::ConvolutionReverb, Effects::Delay, Effects::Distortion, Effects::Echo, Effects::EnvelopeFollower, Effects::FFT, Effects::Fader, Effects::Flange, Effects::HighPass, Effects::HighPassSimple, Effects::ITEcho, Effects::ITLowPass, Effects::LadspaPlugin, Effects::Limiter, Effects::LoudnessMeter, Effects::LowPass, Effects::LowPassSimple, Effects::Mixer, Effects::MultibandEq, Effects::Normalize, Effects::ObjectPan, Effects::Oscillator, Effects::Pan, Effects::ParamEq, Effects::PitchShift, Effects::Return, Effects::Send, Effects::SfxReverb, Effects::ThreeEq, Effects::Transceiver, Effects::Tremolo, Effects::VstPlugin, Effects::WinampPlugin
Defined Under Namespace
Classes: ChannelFormat, DspInfo, WetDryMix
Instance Attribute Summary collapse
-
#active ⇒ Boolean
Gets or sets the enabled state of a unit for being processed.
-
#bypass ⇒ Boolean
Enables or disables the read callback of a DSP unit so that it does or doesn’t process the data coming into it.
-
#channel_format ⇒ ChannelFormat
The signal format of a DSP unit so that the signal is processed on the speakers specified.
-
#input_count ⇒ Integer
readonly
Retrieves the number of inputs connected to the DSP unit.
-
#output_count ⇒ Integer
readonly
Retrieves the number of outputs connected to the DSP unit.
-
#parameter_count ⇒ Integer
readonly
Retrieves the number of parameters a DSP unit has to control its behavior.
-
#parent ⇒ System
readonly
The parent System object that was used to create this object.
-
#type ⇒ Integer
readonly
Retrieves the pre-defined type of a FMOD registered DSP unit.
-
#wet_dry_mix ⇒ WetDryMix
Allows the user to scale the affect of a DSP effect, through control of the “wet” mix, which is the post-processed signal and the “dry” which is the pre-processed signal.
Attributes inherited from Handle
Class Method Summary collapse
-
.bool_param(index, name, **options) ⇒ void
private
Dynamically creates a method for getting and/or setting a named boolean parameter of a DSP unit.
-
.data_param(index, name, **options) ⇒ void
private
Dynamically creates a method for getting and/or setting a named data parameter of a DSP unit.
-
.float_param(index, name, **options) ⇒ void
private
Dynamically creates a method for getting and/or setting a named float parameter of a DSP unit.
-
.from_handle(address) ⇒ Dsp
Converts the specified memory address to a DSP of the appropriate sub-type instead of generic Dsp type.
-
.integer_param(index, name, **options) ⇒ void
private
Dynamically creates a method for getting and/or setting a named integer parameter of a DSP unit.
-
.type_map(type) ⇒ Hash{Integer=>Class}
Retrieves a hash mapping the class of each DSP to its corresponding integer type defined in Core::DspType.
Instance Method Summary collapse
-
#[](index) ⇒ Object
Get parameter by index.
-
#[]=(index, value) ⇒ Object
Sets parameter by index.
-
#add_input(dsp, type) ⇒ DspConnection
Adds the specified DSP unit as an input of the DSP object.
-
#disconnect(inputs, outputs) ⇒ void
Helper function to disconnect either all inputs or all outputs of a DSP unit.
-
#disconnect_from(dsp, connection = nil) ⇒ void
Disconnect the DSP unit from the specified input.
-
#enable_metering(input, output) ⇒ void
Enable metering for a DSP unit.
-
#get_bool(index) ⇒ Boolean?
Retrieves the unit’s boolean parameter by index.
-
#get_data(index) ⇒ Pointer?
Retrieves the unit’s data parameter by index.
-
#get_float(index) ⇒ Float?
Retrieves the unit’s float parameter by index.
-
#get_integer(index) ⇒ Integer?
Retrieves the unit’s integer parameter by index.
-
#idle? ⇒ Boolean
Retrieves the idle state of a DSP.
-
#info ⇒ DspInfo
name, version, default channels and width and height of configuration dialog box if it exists.
-
#input(index) ⇒ Dsp
Retrieves a DSP unit which is acting as an input to this unit.
-
#input_connection(index) ⇒ DspConnection
Retrieves the connection which to a DSP acting as an input to this unit.
-
#input_metering? ⇒ Boolean
A flag indicating if input metering for the DSP it is enabled or not.
-
#name ⇒ String
Retrieves the name of this DSP unit.
-
#output(index) ⇒ Dsp
Retrieves a DSP unit which is acting as an output to this unit.
-
#output_connection(index) ⇒ DspConnection
Retrieves the connection which to a DSP acting as an output to this unit.
-
#output_format(*args) ⇒ ChannelFormat
Call the DSP process function to retrieve the output signal format for a DSP based on input values.
-
#output_metering? ⇒ Boolean
A flag indicating if output metering for the DSP it is enabled or not.
-
#param_info(index) ⇒ ParameterInfo?
Retrieve information about a specified parameter within the DSP unit.
-
#play(group = nil) ⇒ Channel
Plays a sound object on a particular channel and ChannelGroup.
-
#reset ⇒ void
Calls the DSP unit’s reset function, which will clear internal buffers and reset the unit back to an initial state.
-
#set_bool(index, value) ⇒ self
Sets the unit’s boolean parameter by index.
-
#set_data(index, value) ⇒ self
Sets the unit’s data parameter by index.
-
#set_float(index, value) ⇒ self
Sets the unit’s float parameter by index.
-
#set_integer(index, value) ⇒ self
Sets the unit’s integer parameter by index.
-
#set_wet_dry_mix(pre_wet, post_wet, dry) ⇒ self
Allows the user to scale the affect of a DSP effect, through control of the “wet” mix, which is the post-processed signal and the “dry” which is the pre-processed signal.
-
#show_dialog(hwnd, show = true) ⇒ void
Display or hide a DSP unit configuration dialog box inside the target window.
-
#to_s ⇒ String
The string representation of the DSP unit.
-
#version ⇒ String
Retrieves the version of this DSP as string.
Methods inherited from Handle
#initialize, #int_ptr, #release
Constructor Details
This class inherits a constructor from FMOD::Handle
Instance Attribute Details
#active ⇒ Boolean
Gets or sets the enabled state of a unit for being processed.
This does not connect or disconnect a unit in any way, it just disables it so that it is not processed.
If a unit is disabled, and has inputs, they will also cease to be processed.
To disable a unit but allow the inputs of the unit to continue being processed, use #bypass instead.
235 |
# File 'lib/fmod/dsp.rb', line 235 bool_reader(:active, :DSP_GetActive) |
#bypass ⇒ Boolean
Enables or disables the read callback of a DSP unit so that it does or doesn’t process the data coming into it.
A DSP unit that is disabled still processes its inputs, it will just be “dry”.
If a unit is bypassed, it will still process its inputs.
To disable the unit and all of its inputs, use #active instead.
250 |
# File 'lib/fmod/dsp.rb', line 250 bool_reader(:bypass, :DSP_GetBypass) |
#channel_format ⇒ ChannelFormat
Returns The signal format of a DSP unit so that the signal is processed on the speakers specified.
328 329 330 331 332 333 |
# File 'lib/fmod/dsp.rb', line 328 def channel_format args = ["\0" * SIZEOF_INT, "\0" * SIZEOF_INT, "\0" * SIZEOF_INT] FMOD.invoke(:DSP_GetChannelFormat, self, *args) args.map! { |arg| arg.unpack1('L') } ChannelFormat.new(*args) end |
#input_count ⇒ Integer (readonly)
Because this function needs to flush the DSP queue before it can determine how many units are available, this function may block significantly while the background mixer thread operates.
Retrieves the number of inputs connected to the DSP unit.
Inputs are units that feed data to this unit. When there are multiple inputs, they are mixed together.
196 |
# File 'lib/fmod/dsp.rb', line 196 integer_reader(:input_count, :DSP_GetNumInputs) |
#output_count ⇒ Integer (readonly)
Because this function needs to flush the DSP queue before it can determine how many units are available, this function may block significantly while the background mixer thread operates.
Retrieves the number of outputs connected to the DSP unit.
Outputs are units that this unit feeds data to. When there are multiple outputs, the data is split and sent to each unit individually.
210 |
# File 'lib/fmod/dsp.rb', line 210 integer_reader(:output_count, :DSP_GetNumOutputs) |
#parameter_count ⇒ Integer (readonly)
Retrieves the number of parameters a DSP unit has to control its behavior.
183 |
# File 'lib/fmod/dsp.rb', line 183 integer_reader(:parameter_count, :DSP_GetNumParameters) |
#parent ⇒ System (readonly)
Returns the parent System object that was used to create this object.
376 377 378 379 |
# File 'lib/fmod/dsp.rb', line 376 def parent FMOD.invoke(:DSP_GetSystemObject, self, system = int_ptr) System.new(system) end |
#type ⇒ Integer (readonly)
Retrieves the pre-defined type of a FMOD registered DSP unit.
175 |
# File 'lib/fmod/dsp.rb', line 175 integer_reader(:type, :DSP_GetType) |
#wet_dry_mix ⇒ WetDryMix
Allows the user to scale the affect of a DSP effect, through control of the “wet” mix, which is the post-processed signal and the “dry” which is the pre-processed signal.
The dry signal path is silent by default, because DSP effects transform the input and pass the newly processed result to the output. It does not add to the input.
283 284 285 286 287 288 |
# File 'lib/fmod/dsp.rb', line 283 def wet_dry_mix args = ["\0" * SIZEOF_FLOAT, "\0" * SIZEOF_FLOAT, "\0" * SIZEOF_FLOAT] FMOD.invoke(:DSP_GetWetDryMix, self, *args) args.map! { |arg| arg.unpack1('f') } WetDryMix.new(*args) end |
Class Method Details
.bool_param(index, name, **options) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Dynamically creates a method for getting and/or setting a named boolean parameter of a DSP unit.
812 813 814 815 816 817 |
# File 'lib/fmod/dsp.rb', line 812 def bool_param(index, name, **) define_method(name) { get_bool(index) } unless [:write_only] unless [:readonly] define_method("#{name}=") { |value| set_bool(index, value) } end end |
.data_param(index, name, **options) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Dynamically creates a method for getting and/or setting a named data parameter of a DSP unit.
834 835 836 837 838 839 |
# File 'lib/fmod/dsp.rb', line 834 def data_param(index, name, **) define_method(name) { get_data(index) } unless [:write_only] unless [:readonly] define_method("#{name}=") { |value| set_data(index, value) } end end |
.float_param(index, name, **options) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Dynamically creates a method for getting and/or setting a named float parameter of a DSP unit.
756 757 758 759 760 761 762 763 764 765 |
# File 'lib/fmod/dsp.rb', line 756 def float_param(index, name, **) define_method(name) { get_float(index) } unless [:write_only] unless [:readonly] define_method("#{name}=") do |value| value = [:min] if [:min] && value < [:min] value = [:max] if [:max] && value > [:max] set_float(index, value) end end end |
.from_handle(address) ⇒ Dsp
Converts the specified memory address to a DSP of the appropriate sub-type instead of generic FMOD::Dsp type.
161 162 163 164 165 166 167 |
# File 'lib/fmod/dsp.rb', line 161 def self.from_handle(address) address = address.unpack1('J') if address.is_a?(String) type = "\0" * SIZEOF_INT FMOD.invoke(:DSP_GetType, address.to_i, type) klass = type_map(type.unpack1('l')) rescue Dsp klass.new(address) end |
.integer_param(index, name, **options) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Dynamically creates a method for getting and/or setting a named integer parameter of a DSP unit.
786 787 788 789 790 791 792 793 794 795 |
# File 'lib/fmod/dsp.rb', line 786 def integer_param(index, name, **) define_method(name) { get_integer(index) } unless [:write_only] unless [:readonly] define_method("#{name}=") do |value| value = [:min] if [:min] && value < [:min] value = [:max] if [:max] && value > [:max] set_float(index, value) end end end |
.type_map(type) ⇒ Hash{Integer=>Class}
Retrieves a hash mapping the class of each DSP to its corresponding integer type defined in Core::DspType.
Instance Method Details
#[](index) ⇒ Object
Get parameter by index.
695 696 697 698 699 700 701 702 703 704 |
# File 'lib/fmod/dsp.rb', line 695 def [](index) return nil unless FMOD.valid_range?(index, 0, parameter_count, false) case param_info(index).type when ParameterType::FLOAT then get_float(index) when ParameterType::INT then get_integer(index) when ParameterType::BOOL then get_integer(index) when ParameterType::DATA then get_data(index) else raise RangeError, 'Unknown data type.' end end |
#[]=(index, value) ⇒ Object
The value must be of the correct type for the specified parameter, no implicit conversions will be performed, i.e. passing an integer to a float parameter will fail, as it is not the correct type. It is up to the user to perform any conversions ahead before passing to this method.
Sets parameter by index.
718 719 720 721 722 723 724 725 726 727 |
# File 'lib/fmod/dsp.rb', line 718 def []=(index, value) return unless FMOD.valid_range?(index, 0, parameter_count, false) case value when Float then set_float(index, value) when Integer then set_integer(index, value) when TrueClass, FalseClass, NilClass then set_bool(index, value) when String, Pointer then set_data(index, value) else raise TypeError, "#{value} is not a valid DSP parameter type." end end |
#add_input(dsp, type) ⇒ DspConnection
Adds the specified DSP unit as an input of the DSP object.
501 502 503 504 505 506 |
# File 'lib/fmod/dsp.rb', line 501 def add_input(dsp, type) FMOD.type?(dsp, Dsp) connection = int_ptr FMOD.invoke(:DSP_AddInput, self, dsp, connection, type) DspConnection.new(connection) end |
#disconnect(inputs, outputs) ⇒ void
This method returns an undefined value.
Helper function to disconnect either all inputs or all outputs of a DSP unit.
418 419 420 |
# File 'lib/fmod/dsp.rb', line 418 def disconnect(inputs, outputs) FMOD.invoke(:DSP_DisconnectAll, self, inputs.to_i, outputs.to_i) end |
#disconnect_from(dsp, connection = nil) ⇒ void
If you have a handle to the connection pointer that binds these 2 DSP units, then it will become invalid. The connection is then sent back to a freelist to be re-used again by a later addInput command.
This method returns an undefined value.
Disconnect the DSP unit from the specified input.
435 436 437 438 439 |
# File 'lib/fmod/dsp.rb', line 435 def disconnect_from(dsp, connection = nil) FMOD.type?(dsp, Dsp) unless dsp.nil? FMOD.type?(connection, DspConnection) unless connection.nil? FMOD.invoke(:DSP_DisconnectFrom, self, dsp, connection) end |
#enable_metering(input, output) ⇒ void
This method returns an undefined value.
Enable metering for a DSP unit.
572 573 574 |
# File 'lib/fmod/dsp.rb', line 572 def enable_metering(input, output) FMOD.invoke(:DSP_SetMeteringEnabled, self, input ? 1 :0, output.to_i) end |
#get_bool(index) ⇒ Boolean?
Retrieves the unit’s boolean parameter by index.
611 612 613 614 615 616 |
# File 'lib/fmod/dsp.rb', line 611 def get_bool(index) return nil unless FMOD.valid_range?(index, 0, parameter_count, false) buffer = "\0" * SIZEOF_INT FMOD.invoke(:DSP_GetParameterBool, self, index, buffer, nil, 0) buffer.unpack1('l') != 0 end |
#get_data(index) ⇒ Pointer?
Retrieves the unit’s data parameter by index.
625 626 627 628 629 630 631 |
# File 'lib/fmod/dsp.rb', line 625 def get_data(index) return nil unless FMOD.valid_range?(index, 0, parameter_count, false) pointer = int_ptr size = "\0" * SIZEOF_INT FMOD.invoke(:DSP_GetParameterData, self, index, pointer, size, nil, 0) Pointer.new(pointer.unpack('J'), size.unpack1('l')) end |
#get_float(index) ⇒ Float?
Retrieves the unit’s float parameter by index.
583 584 585 586 587 588 |
# File 'lib/fmod/dsp.rb', line 583 def get_float(index) return nil unless FMOD.valid_range?(index, 0, parameter_count, false) buffer = "\0" * SIZEOF_FLOAT FMOD.invoke(:DSP_GetParameterFloat, self, index, buffer, nil, 0) buffer.unpack1('f') end |
#get_integer(index) ⇒ Integer?
Retrieves the unit’s integer parameter by index.
597 598 599 600 601 602 |
# File 'lib/fmod/dsp.rb', line 597 def get_integer(index) return nil unless FMOD.valid_range?(index, 0, parameter_count, false) buffer = "\0" * SIZEOF_INT FMOD.invoke(:DSP_GetParameterInt, self, index, buffer, nil, 0) buffer.unpack1('l') end |
#idle? ⇒ Boolean
Retrieves the idle state of a DSP. A DSP is idle when no signal is coming into it. This can be a useful method of determining if a DSP sub branch is finished processing, so it can be disconnected for example.
219 |
# File 'lib/fmod/dsp.rb', line 219 bool_reader(:idle?, :DSP_GetIdle) |
#info ⇒ DspInfo
name, version, default channels and width and height of configuration dialog box if it exists.
345 346 347 348 349 350 351 352 353 |
# File 'lib/fmod/dsp.rb', line 345 def info name, vs = "\0" * 32, "\0" * SIZEOF_INT args = ["\0" * SIZEOF_INT, "\0" * SIZEOF_INT, "\0" * SIZEOF_INT] FMOD.invoke(:DSP_GetInfo, self, name, vs, *args) args = args.map { |arg| arg.unpack1('l') } vs = vs.unpack1('L').to_s(16).rjust(8, '0') version = "#{vs[0, 4].to_i}.#{vs[4, 4].to_i}" DspInfo.new(name.delete("\0"), version, *args) end |
#input(index) ⇒ Dsp
Retrieves a DSP unit which is acting as an input to this unit.
447 448 449 450 451 |
# File 'lib/fmod/dsp.rb', line 447 def input(index) input = int_ptr FMOD.invoke(:DSP_GetInput, self, index, input, nil) Dsp.from_handle(input) end |
#input_connection(index) ⇒ DspConnection
Retrieves the connection which to a DSP acting as an input to this unit.
471 472 473 474 475 |
# File 'lib/fmod/dsp.rb', line 471 def input_connection(index) connection = int_ptr FMOD.invoke(:DSP_GetInput, self, index, nil, connection) DspConnection.new(connection) end |
#input_metering? ⇒ Boolean
Returns a flag indicating if input metering for the DSP it is enabled or not.
546 547 548 549 550 |
# File 'lib/fmod/dsp.rb', line 546 def input_metering? enabled = "\0" * SIZEOF_INT FMOD.invoke(:DSP_GetMeteringEnabled, self, enabled, nil) enabled.unpack1('l') != 0 end |
#name ⇒ String
Retrieves the name of this DSP unit.
256 257 258 259 260 |
# File 'lib/fmod/dsp.rb', line 256 def name name = "\0" * 32 FMOD.invoke(:DSP_GetInfo, self, name, nil, nil, nil, nil) name.delete("\0") end |
#output(index) ⇒ Dsp
Retrieves a DSP unit which is acting as an output to this unit.
459 460 461 462 463 |
# File 'lib/fmod/dsp.rb', line 459 def output(index) output = int_ptr FMOD.invoke(:DSP_GetOutput, self, index, output, nil) Dsp.from_handle(output) end |
#output_connection(index) ⇒ DspConnection
Retrieves the connection which to a DSP acting as an output to this unit.
483 484 485 486 487 |
# File 'lib/fmod/dsp.rb', line 483 def output_connection(index) connection = int_ptr FMOD.invoke(:DSP_GetOutput, self, index, nil, connection) DspConnection.new(connection) end |
#output_format(format) ⇒ ChannelFormat #output_format(mask, count, speaker_mode) ⇒ ChannelFormat
Call the DSP process function to retrieve the output signal format for a DSP based on input values.
A DSP unit may be an up mixer or down mixer for example. In this case if you specified 6 in for a down-mixer, it may provide you with 2 out for example.
Generally the input values will be reproduced for the output values, but some DSP units will want to alter the output format.
529 530 531 532 533 534 535 536 537 538 539 540 541 |
# File 'lib/fmod/dsp.rb', line 529 def output_format(*args) if args.size == 3 && args.all? { |arg| arg.is_a?(Integer) } mask, count, mode = args elsif args.size == 1 && FMOD.type?(args[0], ChannelFormat) mask, count, mode = args[0].values else mask, count, mode = channel_format.values end args = ["\0" * SIZEOF_INT, "\0" * SIZEOF_INT, "\0" * SIZEOF_INT] FMOD.invoke(:DSP_GetOutputChannelFormat, mask, count, mode, *args) args.map! { |arg| arg.unpack1('L') } ChannelFormat.new(*args) end |
#output_metering? ⇒ Boolean
Returns a flag indicating if output metering for the DSP it is enabled or not.
555 556 557 558 559 |
# File 'lib/fmod/dsp.rb', line 555 def output_metering? enabled = "\0" * SIZEOF_INT FMOD.invoke(:DSP_GetMeteringEnabled, self, nil, enabled) enabled.unpack1('l') != 0 end |
#param_info(index) ⇒ ParameterInfo?
Retrieve information about a specified parameter within the DSP unit.
402 403 404 405 406 |
# File 'lib/fmod/dsp.rb', line 402 def param_info(index) return nil unless FMOD.valid_range?(index, 0, parameter_count, false) FMOD.invoke(:DSP_GetParameterInfo, self, index, info = int_ptr) ParameterInfo.new(info.unpack1('J')) end |
#play(group = nil) ⇒ Channel
Plays a sound object on a particular channel and ChannelGroup.
When a sound is played, it will use the sound’s default frequency and priority.
152 153 154 |
# File 'lib/fmod/dsp.rb', line 152 def play(group = nil) parent.play_dsp(self, group, false) end |
#reset ⇒ void
This method returns an undefined value.
Calls the DSP unit’s reset function, which will clear internal buffers and reset the unit back to an initial state.
Calling this function is useful if the DSP unit relies on a history to process itself (ie an echo filter).
If you disconnected the unit and reconnected it to a different part of the network with a different sound, you would want to call this to reset the units state (ie clear and reset the echo filter) so that you dont get left over artifacts from the place it used to be connected.
368 369 370 |
# File 'lib/fmod/dsp.rb', line 368 def reset FMOD.invoke(:DSP_Reset, self) end |
#set_bool(index, value) ⇒ self
Sets the unit’s boolean parameter by index.
666 667 668 669 670 |
# File 'lib/fmod/dsp.rb', line 666 def set_bool(index, value) return unless FMOD.valid_range?(index, 0, parameter_count, false) FMOD.invoke(:DSP_SetParameterBool, self, index, value.to_i) self end |
#set_data(index, value) ⇒ self
Sets the unit’s data parameter by index.
679 680 681 682 683 684 685 686 687 |
# File 'lib/fmod/dsp.rb', line 679 def set_data(index, value) return unless FMOD.valid_range?(index, 0, parameter_count, false) unless FMOD.type?(value, String, false) FMOD.type?(value, Pointer) end size = value.is_a?(String) ? value.bytesize : value.size FMOD.invoke(:DSP_SetParameterData, self, index, value, size) self end |
#set_float(index, value) ⇒ self
Sets the unit’s float parameter by index.
640 641 642 643 644 |
# File 'lib/fmod/dsp.rb', line 640 def set_float(index, value) return unless FMOD.valid_range?(index, 0, parameter_count, false) FMOD.invoke(:DSP_SetParameterFloat, self, index, value) self end |
#set_integer(index, value) ⇒ self
Sets the unit’s integer parameter by index.
653 654 655 656 657 |
# File 'lib/fmod/dsp.rb', line 653 def set_integer(index, value) return unless FMOD.valid_range?(index, 0, parameter_count, false) FMOD.invoke(:DSP_SetParameterInt, self, index, value) self end |
#set_wet_dry_mix(pre_wet, post_wet, dry) ⇒ self
Allows the user to scale the affect of a DSP effect, through control of the “wet” mix, which is the post-processed signal and the “dry” which is the pre-processed signal.
The dry signal path is silent by default, because dsp effects transform the input and pass the newly processed result to the output. It does not add to the input.
319 320 321 322 |
# File 'lib/fmod/dsp.rb', line 319 def set_wet_dry_mix(pre_wet, post_wet, dry) FMOD.invoke(:DSP_SetWetDryMix, self, pre_wet, post_wet, dry) self end |
#show_dialog(hwnd, show = true) ⇒ void
This method returns an undefined value.
Display or hide a DSP unit configuration dialog box inside the target window.
391 392 393 |
# File 'lib/fmod/dsp.rb', line 391 def show_dialog(hwnd, show = true) FMOD.invoke(:DSP_ShowConfigDialog, self, hwnd, show.to_i) end |
#to_s ⇒ String
Returns the string representation of the DSP unit.
731 732 733 |
# File 'lib/fmod/dsp.rb', line 731 def to_s "#{name} v.#{version}" end |
#version ⇒ String
Retrieves the version of this DSP as string.
265 266 267 268 269 270 |
# File 'lib/fmod/dsp.rb', line 265 def version vs = "\0" * SIZEOF_INT FMOD.invoke(:DSP_GetInfo, self, nil, vs, nil, nil, nil) version = vs.unpack1('L').to_s(16).rjust(8, '0') "#{version[0, 4].to_i}.#{version[4, 4].to_i}" end |