PortAudio 2.0
patest_maxsines.c File Reference

How many sine waves can we calculate and play in less than 80% CPU Load. More...

#include <stdio.h>
#include <math.h>
#include "portaudio.h"

Data Structures

struct  paTestData
 

Macros

#define MAX_SINES   (2000)
 
#define MAX_USAGE   (0.5)
 
#define SAMPLE_RATE   (44100)
 
#define FREQ_TO_PHASE_INC(freq)
 
#define MIN_PHASE_INC   FREQ_TO_PHASE_INC(200.0f)
 
#define MAX_PHASE_INC   (MIN_PHASE_INC * (1 << 5))
 
#define FRAMES_PER_BUFFER   (512)
 
#define M_PI   (3.14159265)
 
#define TWOPI   (M_PI * 2.0)
 
#define TABLE_SIZE   (1024)
 

Typedefs

typedef struct paTestData paTestData
 

Functions

float LookupSine (paTestData *data, float phase)
 
int main (void)
 

Detailed Description

How many sine waves can we calculate and play in less than 80% CPU Load.

Author
Ross Bencina rossb.nosp@m.@aud.nosp@m.iomul.nosp@m.ch.c.nosp@m.om
Phil Burk philb.nosp@m.urk@.nosp@m.softs.nosp@m.ynth.nosp@m..com

Macro Definition Documentation

◆ FRAMES_PER_BUFFER

#define FRAMES_PER_BUFFER   (512)

Referenced by main().

◆ FREQ_TO_PHASE_INC

#define FREQ_TO_PHASE_INC ( freq)
Value:
(freq/(float)SAMPLE_RATE)
#define SAMPLE_RATE
Definition patest_maxsines.c:51

◆ M_PI

#define M_PI   (3.14159265)

Referenced by main().

◆ MAX_PHASE_INC

#define MAX_PHASE_INC   (MIN_PHASE_INC * (1 << 5))

◆ MAX_SINES

#define MAX_SINES   (2000)

Referenced by main().

◆ MAX_USAGE

#define MAX_USAGE   (0.5)

Referenced by main().

◆ MIN_PHASE_INC

#define MIN_PHASE_INC   FREQ_TO_PHASE_INC(200.0f)

◆ SAMPLE_RATE

#define SAMPLE_RATE   (44100)

Referenced by main().

◆ TABLE_SIZE

#define TABLE_SIZE   (1024)

Referenced by LookupSine(), and main().

◆ TWOPI

#define TWOPI   (M_PI * 2.0)

Typedef Documentation

◆ paTestData

typedef struct paTestData paTestData

Function Documentation

◆ LookupSine()

float LookupSine ( paTestData * data,
float phase )

References paTestData::sine, and TABLE_SIZE.

◆ main()