Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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++

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 : 44100

Each 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);
```