Gentone
Command-line program to generate Waveform Audio Format (wav) files of pure tones and synth waveforms.
Install / Use
/learn @fergarciadlc/GentoneREADME
gentone
Command-line program for writing audio wav files of pure tones and synth waveforms.
Installation
Use gcc to compile.
For UNIX systems type:
git clone https://github.com/fergarciadlc/gentone.git
cd gentone/
sudo gcc gentone.c waveform.c savewav.c -lm -w -o /usr/local/bin/gentone
For Windows: clone or download this repository, open a terminal in the directory and type:
gcc gentone.c waveform.c savewav.c -o gentone
Then, place the gentone.exe file in any location on your PATH (except for C:\Windows\System32).
Usage
Generate a wav file of a pure tone by typing:
gentone -f <(Hz)> [OPTIONS]
where:
-f Frequency of the signal in Hertz (Mandatory argument)
Options:
-t Time of the signal in seconds (default: 1 s)
-a Amplitude of the signal (0-1) (default: 1)
-s Sampling frequency in Hertz (default: 44100 Hz)
-b Bit depth, only 16 or 8 (default: 16 bits)
-w Waveform: <sine> (default)
<square>
<triangle>
<sawtooth>
-d Phase Shift in degrees (default: 0)
-r Phase Shift in radians (default: 0)
-N filename (default: "[freq]Hz--waveform--date--time.wav")
Type gentone -h to see the usage and help.
Example
Type:
gentone -f 220 -t 5
Output:
File: '220.00Hz--sine--19-Jun-2020--23-37-36.wav' generated.
Values:
Frequency = 220.00 Hz
Duration = 5.00 s
Amplitude = 1.00
Waveform = 'sine'
Phase Shift = 0.0000 rad
Fs = 44100.00 Hz
Bit depth = 16 bits
And it will generate a 5 seconds wav file of a 220 Hz pure tone (sine function) with the rest of the default values.
Supported waveforms
Espacial case: Aliasing
The program is aware of the Nyquist-Shannon sampling theorem and whenever the signal's frequency is greater than the double of the sampling frequency (for instance: gentone -f90 -s100) it will show the following warning:
WARNING: Nyquist-Shannon sampling theorem:
100.00 Hz sampling frequency is less than 2x(90.00 Hz)
And then will generate the file that could be useful to show/explain the Aliasing effect.
License:
Copyright (c) 2020 Fernando García de la Cruz
Licensed under the MIT License.
Related Skills
qqbot-channel
347.9kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.2k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
347.9kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
arscontexta
2.9kClaude Code plugin that generates individualized knowledge systems from conversation. You describe how you think and work, have a conversation and get a complete second brain as markdown files you own.
