synthberry
Software MIDI synthesizer for the Raspberry Pi.
 All Classes Functions
basicwave.cpp
1 #include "basicwave.h"
2 
10 template <class SampleType> BasicWave<SampleType>::BasicWave(uint16_t bitrate) :
11  Wave<SampleType>(bitrate),
12  position(0)
13 {
14 }
15 
16 template <class SampleType> BasicWave<SampleType>::~BasicWave()
17 {
18 }
19 
29 template <class SampleType> SampleType BasicWave<SampleType>::getNextSample()
30 {
31  if(position == this->bufferSize)
32  position = 0;
33 
34  return this->buffer[position++];
35 }