synthberry
Software MIDI synthesizer for the Raspberry Pi.
Main Page
Classes
Files
File List
All
Classes
Functions
include
wave.h
1
#ifndef WAVE_H
2
#define WAVE_H
3
4
#include <functional>
5
#include <vector>
6
#include <cstdint>
7
8
25
template
<
class
SampleType>
class
Wave
26
{
27
// FormulaFunction(*buffer, bufferSize, bitrate)
28
using
FormulaFunction = std::function<void(SampleType*, std::size_t, uint16_t)>;
29
30
public
:
31
Wave
(uint16_t bitrate);
32
virtual
~
Wave
();
33
virtual
SampleType getNextSample() = 0;
34
void
setNewFormula
(FormulaFunction func);
35
void
addToFormula
(FormulaFunction func);
36
void
setLowestFrequency
(
float
freq);
37
float
getLowestFrequency
();
38
void
updateBuffer
();
39
40
protected
:
41
SampleType *buffer;
42
std::size_t bufferSize;
43
44
private
:
45
std::vector<FormulaFunction> formula;
46
uint16_t bitrate;
47
bool
changed;
48
float
lowestFreq;
49
};
50
51
#endif // WAVE_H
Generated on Fri Apr 4 2014 10:15:23 for synthberry by
1.8.1.2