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"
Detailed Description
How many sine waves can we calculate and play in less than 80% CPU Load.
- Author:
- Ross Bencina <rossb@audiomulch.com>
-
Phil Burk <philburk@softsynth.com>
Define Documentation
#define FRAMES_PER_BUFFER (512) |
#define FREQ_TO_PHASE_INC |
( |
freq |
|
) |
(freq/(float)SAMPLE_RATE) |
#define MAX_PHASE_INC (MIN_PHASE_INC * (1 << 5)) |
#define MIN_PHASE_INC FREQ_TO_PHASE_INC(200.0f) |
#define SAMPLE_RATE (44100) |
#define TWOPI (M_PI * 2.0) |
Function Documentation
float LookupSine |
( |
paTestData * |
data, |
|
|
float |
phase | |
|
) |
| | |
References PaStreamParameters::channelCount, PaDeviceInfo::defaultHighOutputLatency, PaStreamParameters::device, FRAMES_PER_BUFFER, PaStreamParameters::hostApiSpecificStreamInfo, M_PI, MAX_SINES, MAX_USAGE, paTestData::numSines, Pa_CloseStream(), Pa_GetDefaultOutputDevice(), Pa_GetDeviceInfo(), Pa_GetErrorText(), Pa_GetStreamCpuLoad(), Pa_Initialize(), Pa_OpenStream(), Pa_Sleep(), Pa_StartStream(), Pa_StopStream(), Pa_Terminate(), paClipOff, paFloat32, paNoError, SAMPLE_RATE, PaStreamParameters::sampleFormat, paTestData::sine, PaStreamParameters::suggestedLatency, and TABLE_SIZE.