Wave file generator
Project description
Introduction
wav file generator.
- it can have different amplitude, frequency in multichannel wav file
- it uses different plug-in to produce different wave form.
Wave file command
python3 SampleTone.py # basic waveform from InToneFunc.py plu-in
python3 SampleSquareFourier.py # squarewave by fourier series from plu-in InSquareFourier.py
Help
python3 SampleTone.py -h
usage: SampleTone.py [-h] [-t DURATION] [-r {8,16,24,32}] [-s SAMPLERATE]
[-o OUTPUT] [-c CHANNELS]
[-w {square,sine,triangle,sawtooth,dc}]
[-W {square,sine,triangle,sawtooth,dc} [{square,sine,triangle,sawtooth,dc} ...]]
[-f FREQUENCY] [-F FREQUENCYS [FREQUENCYS ...]]
[-v VOLUME] [-V VOLUMES [VOLUMES ...]] [-p PHASE]
[-P PHASES [PHASES ...]]
Generate wave file.
optional arguments:
-h, --help show this help message and exit
-t DURATION set wav's duration in seconds (3.0)
-r {8,16,24,32} set wav's resolution
-s SAMPLERATE set wav's sampling rate [8000Hz:1000000000Hz]
-o OUTPUT set name of wav file
-c CHANNELS set wav's channels [1:16]
-w {square,sine,triangle,sawtooth,dc}
set wav's default wave form
-W {square,sine,triangle,sawtooth,dc} [{square,sine,triangle,sawtooth,dc} ...]
set wav's wave forms for multichannel
-f FREQUENCY set wav's default frequency [0:20000]
-F FREQUENCYS [FREQUENCYS ...]
set wav's each frequency for each channel [0:20000]
-v VOLUME set wav's default amplitude [0:100]
-V VOLUMES [VOLUMES ...]
set wav's each amplitude for each channel [0:100]
-p PHASE set wav's default phase [-360:360]
-P PHASES [PHASES ...]
set wav's each phase for each channel [-360:360]
Wav file spec
WaveFile Gem
Audio File Format Specifications
Samples
SampleTone.py uses InToneFunc.py plu-in.
Generate 4 channels wav file
python3 SampleTone.py -c 4 -w sine
Generate wav file, each channel has different wave form
python3 SampleTone.py -W sine square triangle sawtooth dc -f 30 -t 0.3 -v 70
Produce 5 channels wave file which includes these wave form... sine wave, square wave, triangle wave, sawtooth wave and dc.
Sample rate: default (48kHz).
Resilution: 16 bits
Length: 0.3 second.
Amplitude: 70 of 100
Wave frequency: 30Hz
Generate wav file, each channel has different phase
python3 SampleTone.py -w sine -P -270 -180 -90 0 90 180 270 -f 30 -t 0.3 -v 70
Phase: -270, -180, -90, 0, 90, 180, 270
SampleSquareFourier.py uses InSquareFourier.py plu-in.
Produce squrewave from fourier series
python3 SampleSquareFourier.py -f 30 -t 0.3 -v 70 -W SF1 SF2 SF3 SF4 SF5 SF30
squrewave by fourier series with N = 1, 2, 3, 30
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
WaveGenPy-0.1.0.tar.gz
(8.6 kB
view details)
File details
Details for the file WaveGenPy-0.1.0.tar.gz
.
File metadata
- Download URL: WaveGenPy-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74be9ebf68dbd75248b9ee980bd4dd01a6c314201c549d5d47ea91214dc70296 |
|
MD5 | b0ea1dfadbb295917816ed027b89f5db |
|
BLAKE2b-256 | b6eca89bd175425d98eb6bcb690f9e4952404e05ebb58530699d8d217b00c313 |