HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
Oscillator.h
Go to the documentation of this file.
1#pragma once
2#include "HephAudioShared.h"
4#include <cmath>
5#include <cinttypes>
6
9namespace HephAudio
10{
16 {
17 public:
23
28 double frequency;
29
34 double phase_rad;
35
40 uint32_t sampleRate;
41
42 protected:
45
54 Oscillator(double peakAmplitude, double frequency, uint32_t sampleRate, double phase_rad);
55
56 public:
58 virtual ~Oscillator() = default;
59
64 virtual double operator[](size_t n) const = 0;
65
71
78
85 Heph::DoubleBuffer GenerateBuffer(size_t index, size_t size) const;
86 };
87}
#define HEPH_API
Definition HephShared.h:132
base class for oscillators.
Definition Oscillator.h:16
double phase_rad
Definition Oscillator.h:34
virtual ~Oscillator()=default
double frequency
Definition Oscillator.h:28
Oscillator(double peakAmplitude, double frequency, uint32_t sampleRate, double phase_rad)
Heph::DoubleBuffer GenerateBuffer(size_t size) const
Heph::DoubleBuffer GenerateBuffer(size_t index, size_t size) const
virtual double operator[](size_t n) const =0
double peakAmplitude
Definition Oscillator.h:22
uint32_t sampleRate
Definition Oscillator.h:40
Heph::DoubleBuffer GenerateBuffer() const
buffer for storing doubles.
Definition DoubleBuffer.h:14