# Guia de Efectos de Audio (v0.3.0)

## Resumen

basskit ofrece 25 efectos de audio divididos en dos familias:
- **Efectos DX8** (10): Integrados en bass.dll, basados en DirectX 8
- **Efectos BASS_FX** (15): Proporcionados por bass_fx.dll, mas avanzados

## API de Alto Nivel: CadenaEfectos

```python
from basskit.alto_nivel.efectos import CadenaEfectos

cadena = CadenaEfectos(stream)

# Agregar efecto con valores por defecto
cadena.agregar("reverb")

# Agregar con parametros personalizados
cadena.agregar("echo", fFeedback=60, fLeftDelay=400)

# Bypass sin quitar
cadena.bypass("reverb", True)

# Actualizar parametros
cadena.actualizar("echo", fFeedback=30)

# Quitar efecto
cadena.quitar("echo")

# Ver activos
print(cadena.activos)

# Limpiar todo
cadena.limpiar()
```

## Efectos DX8 Disponibles

| Nombre | Descripcion | Parametros principales |
|--------|-------------|----------------------|
| `chorus` | Efecto coral | fWetDryMix, fDepth, fFeedback, fFrequency |
| `compressor_dx8` | Compresor dinamico | fGain, fAttack, fRelease, fThreshold, fRatio |
| `distortion_dx8` | Distorsion | fGain, fEdge, fPostEQCenterFrequency |
| `echo` | Eco | fWetDryMix, fFeedback, fLeftDelay, fRightDelay |
| `flanger_dx8` | Flanger | fWetDryMix, fDepth, fFeedback, fFrequency |
| `gargle` | Modulacion de amplitud | dwRateHz, dwWaveShape |
| `i3dl2reverb` | Reverb I3DL2 (salas) | lRoom, flDecayTime, flDiffusion, flDensity |
| `parameq` | Ecualizador parametrico | fCenter, fBandwidth, fGain |
| `reverb` | Reverb simple | fInGain, fReverbMix, fReverbTime |
| `volume_dsp` | Control de volumen DSP | fTarget, fTime, lCurve |

## Efectos BASS_FX Disponibles

| Nombre | Descripcion | Parametros principales |
|--------|-------------|----------------------|
| `bfx_echo` | Eco simple | fLevel, lDelay |
| `bfx_flanger` | Flanger | fWetDry, fSpeed |
| `bfx_reverb` | Reverberacion | fLevel, lDelay |
| `bfx_lpf` | Filtro paso bajo | fResonance, fCutOffFreq |
| `bfx_damp` | Amplificacion dinamica | fTarget, fQuiet, fRate, fGain |
| `bfx_autowah` | Auto-wah | fDryMix, fWetMix, fFeedback, fRate |
| `bfx_echo2` | Eco avanzado | fDryMix, fWetMix, fFeedback, fDelay |
| `bfx_phaser` | Phaser | fDryMix, fWetMix, fFeedback, fRate |
| `bfx_echo3` | Eco stereo | fDryMix, fWetMix, fDelay |
| `bfx_chorus` | Chorus | fDryMix, fWetMix, fMinSweep, fMaxSweep |
| `bfx_apf` | Filtro pasa-todo | fGain, fDelay |
| `bfx_compressor` | Compresor simple | fThreshold, fAttacktime, fReleasetime |
| `bfx_distortion` | Distorsion | fDrive, fDryMix, fWetMix, fVolume |
| `bfx_compressor2` | Compresor avanzado | fGain, fThreshold, fRatio, fAttack, fRelease |
| `bfx_bqf` | Filtro BiQuad | lFilter, fCenter, fGain, fBandwidth |

## Filtros BiQuad (bfx_bqf)

El parametro `lFilter` acepta estos valores:

| Valor | Constante | Tipo de filtro |
|-------|-----------|----------------|
| 0 | BASS_BFX_BQF_LOWPASS | Paso bajo |
| 1 | BASS_BFX_BQF_HIGHPASS | Paso alto |
| 2 | BASS_BFX_BQF_BANDPASS | Paso banda |
| 3 | BASS_BFX_BQF_BANDPASS_Q | Paso banda (Q) |
| 4 | BASS_BFX_BQF_NOTCH | Notch (elimina frecuencia) |
| 5 | BASS_BFX_BQF_ALLPASS | Pasa todo |
| 6 | BASS_BFX_BQF_PEAKINGEQ | EQ de pico |
| 7 | BASS_BFX_BQF_LOWSHELF | Estanteria baja |
| 8 | BASS_BFX_BQF_HIGHSHELF | Estanteria alta |

```python
cadena.agregar("bfx_bqf", lFilter=0, fCenter=2000, fBandwidth=2.5)
```

## Bajo Nivel

```python
import ctypes
from basskit.dlls.bass import bass
from basskit.constantes.bass import BASS_FX_DX8_REVERB
from basskit.estructuras.bass import BASS_DX8_REVERB

fx = bass.BASS_ChannelSetFX(stream, BASS_FX_DX8_REVERB, 0)
params = BASS_DX8_REVERB()
params.fReverbMix = -5.0
params.fReverbTime = 2000.0
bass.BASS_FXSetParameters(fx, ctypes.byref(params))

# Bypass
bass.BASS_FXSetBypass(fx, 1)  # 1=bypass, 0=activo

# Reset estado interno
bass.BASS_FXReset(fx)

# Quitar
bass.BASS_ChannelRemoveFX(stream, fx)
```
