LMMS
Loading...
Searching...
No Matches
adlibemu.c File Reference
#include <math.h>
#include <string.h>

Classes

struct  celltype

Macros

#define max(a, b)
#define min(a, b)
#define PI   3.141592653589793
#define MAXCELLS   18
#define WAVPREC   2048
#define FRQSCALE   (49716/512.0)
#define MODFACTOR   4.0
#define MFBFACTOR   1.0
#define ADJUSTSPEED   0.75
#define FIFOSIZ   256
#define _inline
#define ctc   ((celltype *)c)

Functions

static void ftol (float f, long *a)
void docell4 (void *c, float modulator)
void docell3 (void *c, float modulator)
void docell2 (void *c, float modulator)
void docell1 (void *c, float modulator)
void docell0 (void *c, float modulator)
void cellon (long i, long j, celltype *c, unsigned char iscarrier)
void cellfreq (signed long i, signed long j, celltype *c)
void adlibinit (long dasamplerate, long danumspeakers, long dabytespersample)
void adlib0 (long i, long v)
static void clipit8 (float f, unsigned char *a)
static void clipit16 (float f, short *a)
void adlibsetvolume (int i)
void adlibgetsample (unsigned char *sndptr, long numbytes)

Variables

static float AMPSCALE =(8192.0)
static long numspeakers
static long bytespersample
static float recipsamp
static celltype cell [MAXCELLS]
static signed short wavtable [WAVPREC *3]
static float kslmul [4] = {0.0,0.5,0.25,1.0}
static float frqmul [16] = {.5,1,2,3,4,5,6,7,8,9,10,10,12,12,15,15}
static float nfrqmul [16]
static unsigned char adlibreg [256]
static unsigned char ksl [8][16]
static unsigned char modulatorbase [9] = {0,1,2,8,9,10,16,17,18}
static unsigned char odrumstat = 0
static unsigned char base2cell [22] = {0,1,2,0,1,2,0,0,3,4,5,3,4,5,0,0,6,7,8,6,7,8}
float lvol [9] = {1,1,1,1,1,1,1,1,1}
float rvol [9] = {1,1,1,1,1,1,1,1,1}
long lplc [9] = {0,0,0,0,0,0,0,0,0}
long rplc [9] = {0,0,0,0,0,0,0,0,0}
long nlvol [9]
long nrvol [9]
long nlplc [9]
long nrplc [9]
long rend = 0
static float * rptr [9]
static float * nrptr [9]
static float rbuf [9][FIFOSIZ *2]
static float snd [FIFOSIZ *2]
static long waveform [8] = {WAVPREC,WAVPREC>>1,WAVPREC,(WAVPREC*3)>>2,0,0,(WAVPREC*5)>>2,WAVPREC<<1}
static long wavemask [8] = {WAVPREC-1,WAVPREC-1,(WAVPREC>>1)-1,(WAVPREC>>1)-1,WAVPREC-1,((WAVPREC*3)>>2)-1,WAVPREC>>1,WAVPREC-1}
static long wavestart [8] = {0,WAVPREC>>1,0,WAVPREC>>2,0,0,0,WAVPREC>>3}
static float attackconst [4] = {1/2.82624,1/2.25280,1/1.88416,1/1.59744}
static float decrelconst [4] = {1/39.28064,1/31.41608,1/26.17344,1/22.44608}
static long initfirstime = 0

Macro Definition Documentation

◆ _inline

#define _inline

◆ ADJUSTSPEED

#define ADJUSTSPEED   0.75

◆ ctc

#define ctc   ((celltype *)c)

◆ FIFOSIZ

#define FIFOSIZ   256

◆ FRQSCALE

#define FRQSCALE   (49716/512.0)

◆ max

#define max ( a,
b )
Value:
(((a) > (b)) ? (a) : (b))
uint8_t a
Definition Spc_Cpu.h:141
b
Definition crypt.c:628

◆ MAXCELLS

#define MAXCELLS   18

◆ MFBFACTOR

#define MFBFACTOR   1.0

◆ min

#define min ( a,
b )
Value:
(((a) < (b)) ? (a) : (b))

◆ MODFACTOR

#define MODFACTOR   4.0

◆ PI

#define PI   3.141592653589793

◆ WAVPREC

#define WAVPREC   2048

Function Documentation

◆ adlib0()

void adlib0 ( long i,
long v )

◆ adlibgetsample()

void adlibgetsample ( unsigned char * sndptr,
long numbytes )

◆ adlibinit()

void adlibinit ( long dasamplerate,
long danumspeakers,
long dabytespersample )

◆ adlibsetvolume()

void adlibsetvolume ( int i)

◆ cellfreq()

void cellfreq ( signed long i,
signed long j,
celltype * c )

◆ cellon()

void cellon ( long i,
long j,
celltype * c,
unsigned char iscarrier )

◆ clipit16()

void clipit16 ( float f,
short * a )
static

◆ clipit8()

void clipit8 ( float f,
unsigned char * a )
static

◆ docell0()

void docell0 ( void * c,
float modulator )

◆ docell1()

void docell1 ( void * c,
float modulator )

◆ docell2()

void docell2 ( void * c,
float modulator )

◆ docell3()

void docell3 ( void * c,
float modulator )

◆ docell4()

void docell4 ( void * c,
float modulator )

◆ ftol()

void ftol ( float f,
long * a )
static

Variable Documentation

◆ adlibreg

unsigned char adlibreg[256]
static

◆ AMPSCALE

float AMPSCALE =(8192.0)
static

◆ attackconst

float attackconst[4] = {1/2.82624,1/2.25280,1/1.88416,1/1.59744}
static

◆ base2cell

unsigned char base2cell[22] = {0,1,2,0,1,2,0,0,3,4,5,3,4,5,0,0,6,7,8,6,7,8}
static

◆ bytespersample

long bytespersample
static

◆ cell

celltype cell[MAXCELLS]
static

◆ decrelconst

float decrelconst[4] = {1/39.28064,1/31.41608,1/26.17344,1/22.44608}
static

◆ frqmul

float frqmul[16] = {.5,1,2,3,4,5,6,7,8,9,10,10,12,12,15,15}
static

◆ initfirstime

long initfirstime = 0
static

◆ ksl

unsigned char ksl[8][16]
static

◆ kslmul

float kslmul[4] = {0.0,0.5,0.25,1.0}
static

◆ lplc

long lplc[9] = {0,0,0,0,0,0,0,0,0}

◆ lvol

float lvol[9] = {1,1,1,1,1,1,1,1,1}

◆ modulatorbase

unsigned char modulatorbase[9] = {0,1,2,8,9,10,16,17,18}
static

◆ nfrqmul

float nfrqmul[16]
static

◆ nlplc

long nlplc[9]

◆ nlvol

long nlvol[9]

◆ nrplc

long nrplc[9]

◆ nrptr

float * nrptr[9]
static

◆ nrvol

long nrvol[9]

◆ numspeakers

long numspeakers
static

◆ odrumstat

unsigned char odrumstat = 0
static

◆ rbuf

float rbuf[9][FIFOSIZ *2]
static

◆ recipsamp

float recipsamp
static

◆ rend

long rend = 0

◆ rplc

long rplc[9] = {0,0,0,0,0,0,0,0,0}

◆ rptr

float* rptr[9]
static

◆ rvol

float rvol[9] = {1,1,1,1,1,1,1,1,1}

◆ snd

float snd[FIFOSIZ *2]
static

◆ waveform

long waveform[8] = {WAVPREC,WAVPREC>>1,WAVPREC,(WAVPREC*3)>>2,0,0,(WAVPREC*5)>>2,WAVPREC<<1}
static

◆ wavemask

long wavemask[8] = {WAVPREC-1,WAVPREC-1,(WAVPREC>>1)-1,(WAVPREC>>1)-1,WAVPREC-1,((WAVPREC*3)>>2)-1,WAVPREC>>1,WAVPREC-1}
static

◆ wavestart

long wavestart[8] = {0,WAVPREC>>1,0,WAVPREC>>2,0,0,0,WAVPREC>>3}
static

◆ wavtable

signed short wavtable[WAVPREC *3]
static