synthberry
Software MIDI synthesizer for the Raspberry Pi.
 All Classes Functions
Public Member Functions | List of all members
BasicWave< SampleType > Class Template Reference

Representation of a basic wave. More...

#include <basicwave.h>

Inheritance diagram for BasicWave< SampleType >:
Inheritance graph
[legend]
Collaboration diagram for BasicWave< SampleType >:
Collaboration graph
[legend]

Public Member Functions

 BasicWave (uint16_t bitrate)
SampleType getNextSample ()
 Retrieve next sample to play.
- Public Member Functions inherited from Wave< SampleType >
 Wave (uint16_t bitrate)
void setNewFormula (FormulaFunction func)
 Set a new formula.
void addToFormula (FormulaFunction func)
 Add an extra formula.
void setLowestFrequency (float freq)
 Set a new lowest frequency.
float getLowestFrequency ()
 Retrieve the lowest frequency.
void updateBuffer ()
 Update the wave buffer.

Additional Inherited Members

- Protected Attributes inherited from Wave< SampleType >
SampleType * buffer
std::size_t bufferSize

Detailed Description

template<class SampleType>
class BasicWave< SampleType >

Representation of a basic wave.

BasicWave is the simplest implementation of the abstract Wave class. Oscillators create instances of BasicWave, which can later on be upgraded to EnvelopedWave objects should the need occur.

Definition at line 13 of file basicwave.h.

Constructor & Destructor Documentation

template<class SampleType >
BasicWave< SampleType >::BasicWave ( uint16_t  bitrate)

Construct a BasicWave

When working with 16-bit samples, set uint16_t as the SampleType.

Template Parameters
SampleTypeInteger type for storing sample in

Definition at line 10 of file basicwave.cpp.

Member Function Documentation

template<class SampleType >
SampleType BasicWave< SampleType >::getNextSample ( )
virtual

Retrieve next sample to play.

Retrieve the next sample from the buffer to play. If the end of the buffer has been reached, getNextSample() will automatically return to the beginning of the buffer.

Returns
Next sample

Implements Wave< SampleType >.

Definition at line 29 of file basicwave.cpp.


The documentation for this class was generated from the following files: