CLI software synthesizer
Go to file
2023-06-25 20:17:23 -05:00
tests tests/: restore files 2020-01-20 19:14:43 -06:00
.gitattributes gitattributes: added 2020-01-21 06:37:01 -06:00
.gitignore gitignore 2023-06-25 20:17:23 -05:00
.travis.yml Makefile: explicit target .travis.yml: update 2020-01-20 10:52:53 -06:00
freqr.c lopass filter 2023-06-23 15:04:06 -05:00
Makefile Makefile: explicit target .travis.yml: update 2020-01-20 10:52:53 -06:00
raw2wav.sh Added test suite 2020-01-20 10:31:53 -06:00
README.md README.md: Travis CI badge 2020-01-20 10:55:23 -06:00

Build Status

freqr

CLI utility to generate 1-second square wave at specified frequency to file

Introduction

Try this:

pacman -S sox or apt install sox

make

./freqr -f 440 -o myaudio.dat

./raw2wav.sh myaudio.dat

play myaudio.dat.wav

Usage: ./freqr [-f] [-r] [-s] [-a] [-o] [-w {sn|sq|tr|sw|ns}]

-f FREQ		Frequency			frequency in audible range (e.g., 'freqr -f 440')

-r SAMPLERATE	Sample rate(e.g., -s 44100)	sample rate (defaults to 44100) in samples/second or Hz

-s NUM_SAMPLES	Number of samples		number of samples to generate (defaults to 44100, or 1 second of audio)

-a AMPLITUDE	Amplitude (16-bit int)		value of signed 16 bit integer to indicate maximum amplitude (notice negatives invert the waveform)

-w WAVEFORM	One of: sn,sq,tr,sw,ns		sine, square, triangle, saw, noise

-o OUTPUTFILE	Specify file to output to

Notes

Triangle and Saw waves are offset by 1/4 and 1/2 the period respectively, in order to 'normalize' the initial output of their functions to zero (this affects phase but is worth the quality improvement IMHO)

To do

Implement '-b <16/32...>' switch to change bit-depth (defaults to 16-bit)