AudioEffectDistortion

package
v0.0.0-...-aa4eb42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape.

By distorting the waveform the frequency content changes, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsAudioEffectDistortion() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsAudioEffect

func (self *Extension[T]) AsAudioEffect() AudioEffect.Instance

func (*Extension[T]) AsAudioEffectDistortion

func (self *Extension[T]) AsAudioEffectDistortion() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.AudioEffectDistortion

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsAudioEffect

func (self Instance) AsAudioEffect() AudioEffect.Instance

func (Instance) AsAudioEffectDistortion

func (self Instance) AsAudioEffectDistortion() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) Drive

func (self Instance) Drive() Float.X

Distortion power. Value can range from 0 to 1.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) KeepHfHz

func (self Instance) KeepHfHz() Float.X

High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000.

func (Instance) Mode

func (self Instance) Mode() Mode

Distortion type.

func (Instance) PostGain

func (self Instance) PostGain() Float.X

Increases or decreases the volume after the effect, in decibels. Value can range from -80 to 24.

func (Instance) PreGain

func (self Instance) PreGain() Float.X

Increases or decreases the volume before the effect, in decibels. Value can range from -60 to 60.

func (Instance) SetDrive

func (self Instance) SetDrive(value Float.X)

SetDrive sets the property returned by [GetDrive].

func (Instance) SetKeepHfHz

func (self Instance) SetKeepHfHz(value Float.X)

SetKeepHfHz sets the property returned by [GetKeepHfHz].

func (Instance) SetMode

func (self Instance) SetMode(value Mode)

SetMode sets the property returned by [GetMode].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPostGain

func (self Instance) SetPostGain(value Float.X)

SetPostGain sets the property returned by [GetPostGain].

func (Instance) SetPreGain

func (self Instance) SetPreGain(value Float.X)

SetPreGain sets the property returned by [GetPreGain].

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Mode

type Mode int //gd:AudioEffectDistortion.Mode
const (
	// Digital distortion effect which cuts off peaks at the top and bottom of the waveform.
	ModeClip Mode = 0
	ModeAtan Mode = 1
	// Low-resolution digital distortion effect (bit depth reduction). You can use it to emulate the sound of early digital audio devices.
	ModeLofi Mode = 2
	// Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers. The [Drive] property has no effect in this mode.
	//
	// [Drive]: https://pkg.go.dev/graphics.gd/classdb/#Instance.Drive
	ModeOverdrive Mode = 3
	// Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound.
	ModeWaveshape Mode = 4
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL