Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nmrr/minigenerator
A signal generator (sinus, square, triangle, sawtooth) written in C++
https://github.com/nmrr/minigenerator
audio audio-processing generator signal-processing
Last synced: about 15 hours ago
JSON representation
A signal generator (sinus, square, triangle, sawtooth) written in C++
- Host: GitHub
- URL: https://github.com/nmrr/minigenerator
- Owner: nmrr
- License: mit
- Created: 2021-12-26T18:59:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-31T19:23:03.000Z (about 3 years ago)
- Last Synced: 2024-11-23T04:33:44.051Z (2 months ago)
- Topics: audio, audio-processing, generator, signal-processing
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minigenerator
A signal generator (sinus, square, triangle, sawtooth) written in C++Build the example :
```
g++ -Wall -pipe -Ofast main.cpp minigenerator.cpp -o minigenerator
```Run the example :
```
./minigenerator > out
```Use audacity (or other audio software) and import output data as **Raw Data** using the following parameters :
- Signed 16-bit PCM
- Little-endian
- 1 Channel (Mono)
- Sample rate : 44100Each signal function are used sequentially at the same frequency (440 Hz) but at different volume level.
# How to use this class ?
Create an object and define sample rate :
```
minigenerator generator = minigenerator(SAMPLE_RATE);
```Call a function (sinus, square, triangle, sawtooth) and indicate the **frequency** (double), the **volume** (double, between 0 & 1) and **duration** (integer, number of samples)
```
generator.sinus(FREQUENCY, VOLUME, DURATION);
```