Unit DTSweep

Classes

TForm1 -

Functions

Types

audio_sample
modes
out_freqs
out_levels
PBuffer
PMonoBuffer
PSineTable
ranges
speeds
TBuffer
TMonoBuffer
TSineTable

Constants

max_buffer_samples
pink_noise_filename
sample_rate
sine_table_samples

Variables

Form1


Functions


Types


audio_sample = -32767..32767

modes = (logarithmic, linear);
sweep ranges
out_freqs = array [0..0] of extended;
output modes
out_levels = (phase_normal, phase_reverse, independent);
sweep speeds
PBuffer = ^TBuffer
1-channel
PMonoBuffer = ^TMonoBuffer

PSineTable = ^TSineTable
for 16-bit audio
ranges = (lf, mf, hf, wide);
2-channels
speeds = (fast_stepped, fast_smooth, white, pink,
            slow, programmed, manual, no_sweep);
sweep modes
TBuffer = array [0..2*max_buffer_samples-1] of audio_sample;
output buffer type
TMonoBuffer = array [0..max_buffer_samples-1] of audio_sample;
pink noise buffer type
TSineTable = array [0..sine_table_samples-1] of audio_sample;
sine value store

Constants

max_buffer_samples = 57330

number of samples in sine table

pink_noise_filename = 'pink.wav'

size of output buffer for 1.3 seconds four times this in bytes

sample_rate = 44100

Renamed from MainForm.pas 6/20/1998 Paul Rice to avoid conflicts with others' work.} SweepGen - David's Audio Sweep Generator Revision History V0.0 1994 Oct 09 First version, combining SloSweep and Sinewave V0.0-01 1994 Oct 10 Use TDlgWindow as main window Move sweep_running to main data segment V0.0-02 1994 Oct 12 Get double-buffering working properly Put sweep_running back in object data! V1.0.0 1995 May 07 Version for Delphi 1.0 V1.1.0 1995 Oct 08 Better quality, 16-bit audio V2.0.0 1996 Jun 01 Version for 32-bit Delphi Add more output levels Allow for smooth or stepped fast sweep Improve generation to about 15-bit accuracy Release to public domain V2.0.2 1996 Dec 30 Add white noise option V2.0.4 1997 Jan 10 Add manual slow sweep controlled by PageUp & PageDown keys (Start button must have the focus) Add two more output levels Add octave markers V2.0.6 1997 Mar 09 Add TrackBar for manual frequency control Reversed interpretation of PageUp & PageDown keys V2.1.0 1997 May 03 Replace output level buttons by slider control Use 2-channel output buffer for all modes Allow independent Left and Right frequencies Allow in-phase, out-of-phase or independent channel levels Add running LED Add HTML documentation V2.2.0 1997 Jun 01 Version for Delphi 3.0 Make sine table generator use symmetry for faster startup Change max_buffer_samples to allow 1.3 seconds of audio - this allows exactly 50ms per fast sweep segment Correct two truncated buffer writes at end of slow sweep Use array of pre-computed frequencies for slow sweep Add ability to save sweeps as a file Add experimental programmed sweep mode V2.2.2 1997 Oct 06 Version for Delphi 3.01 Don't progress programmed mode Add Pink noise mode

sine_table_samples = 1 shl 15

i.e. best CD quality note: 10ms -> exactly 441 samples

Variables

Form1 : TForm1

Public declarations