zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
alcModulator.c File Reference
#include "config.h"
#include <math.h>
#include <stdlib.h>
#include "alMain.h"
#include "alFilter.h"
#include "alAuxEffectSlot.h"
#include "alError.h"
#include "alu.h"

Go to the source code of this file.

Macros

#define DECL_TEMPLATE(func)
 
#define WAVEFORM_FRACBITS   16
 
#define WAVEFORM_FRACMASK   (WAVEFORM_FRACONE-1)
 
#define WAVEFORM_FRACONE   (1<<WAVEFORM_FRACBITS)
 

Typedefs

typedef struct ALmodulatorState ALmodulatorState
 

Functions

static __inline ALfloat hpFilter1P (FILTER *iir, ALuint offset, ALfloat input)
 
ALeffectStateModulatorCreate (void)
 
static ALvoid ModulatorDestroy (ALeffectState *effect)
 
static ALboolean ModulatorDeviceUpdate (ALeffectState *effect, ALCdevice *Device)
 
static ALvoid ModulatorProcess (ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat(*RESTRICT SamplesOut)[BUFFERSIZE])
 
static ALvoid ModulatorUpdate (ALeffectState *effect, ALCdevice *Device, const ALeffectslot *Slot)
 
static __inline ALfloat Saw (ALuint index)
 
static __inline ALfloat Sin (ALuint index)
 
static __inline ALfloat Square (ALuint index)
 

Macro Definition Documentation

#define DECL_TEMPLATE (   func)
Value:
static void Process##func(ALmodulatorState *state, ALuint SamplesToDo, \
const ALfloat *RESTRICT SamplesIn, \
ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) \
{ \
const ALuint step = state->step; \
ALuint index = state->index; \
ALfloat samp; \
for(i = 0;i < SamplesToDo;i++) \
{ \
samp = SamplesIn[i]; \
\
index += step; \
samp *= func(index); \
\
samp = hpFilter1P(&state->iirFilter, 0, samp); \
for(k = 0;k < MaxChannels;k++) \
SamplesOut[k][i] += state->Gain[k] * samp; \
} \
state->index = index; \
}
static __inline ALfloat hpFilter1P(FILTER *iir, ALuint offset, ALfloat input)
Definition: alcModulator.c:72
int32_t k
Definition: e_log.c:102
GLenum func
Definition: SDL_opengl.h:5654
float ALfloat
Definition: al.h:68
#define WAVEFORM_FRACMASK
Definition: alcModulator.c:54
for(;;)
GLuint index
Definition: glew.h:1800
unsigned int ALuint
Definition: al.h:59
#define const
Definition: zconf.h:91
struct ALmodulatorState ALmodulatorState
int i
Definition: pngrutil.c:1377
#define BUFFERSIZE
Definition: alMain.h:556

Definition at line 85 of file alcModulator.c.

#define WAVEFORM_FRACBITS   16

Definition at line 52 of file alcModulator.c.

Referenced by Square().

#define WAVEFORM_FRACMASK   (WAVEFORM_FRACONE-1)

Definition at line 54 of file alcModulator.c.

#define WAVEFORM_FRACONE   (1<<WAVEFORM_FRACBITS)

Definition at line 53 of file alcModulator.c.

Referenced by ModulatorUpdate(), Saw(), and Sin().

Typedef Documentation

typedef struct ALmodulatorState ALmodulatorState

OpenAL cross platform audio library Copyright (C) 2009 by Chris Robinson. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Or go to http://www.gnu.org/copyleft/lgpl.html

Function Documentation

static __inline ALfloat hpFilter1P ( FILTER iir,
ALuint  offset,
ALfloat  input 
)
static

Definition at line 72 of file alcModulator.c.

References FILTER::coeff, FILTER::history, and sort_controllers::output.

ALeffectState* ModulatorCreate ( void  )
static ALvoid ModulatorDestroy ( ALeffectState effect)
static

Definition at line 118 of file alcModulator.c.

References free.

Referenced by ModulatorCreate().

static ALboolean ModulatorDeviceUpdate ( ALeffectState effect,
ALCdevice Device 
)
static

Definition at line 124 of file alcModulator.c.

References AL_TRUE.

Referenced by ModulatorCreate().

static ALvoid ModulatorProcess ( ALeffectState effect,
ALuint  SamplesToDo,
const ALfloat *RESTRICT  SamplesIn,
ALfloat(*)  SamplesOut[BUFFERSIZE] 
)
static

Definition at line 164 of file alcModulator.c.

Referenced by ModulatorCreate().

static __inline ALfloat Saw ( ALuint  index)
static

Definition at line 61 of file alcModulator.c.

References WAVEFORM_FRACONE.

static __inline ALfloat Sin ( ALuint  index)
static

Definition at line 56 of file alcModulator.c.

References F_PI, and WAVEFORM_FRACONE.

static __inline ALfloat Square ( ALuint  index)
static

Definition at line 66 of file alcModulator.c.

References WAVEFORM_FRACBITS.