Newer
Older
music / app / src / main / cpp / SineWave.h
@lukas lukas on 6 Aug 2022 382 bytes add envelope modulation
#ifndef MUSIC_SINEWAVE_H
#define MUSIC_SINEWAVE_H

class SineWave;

#include <stdint.h>
#include "AudioHost.h"

class SineWave {
private:
    float phaseStep, phase = 0;
    float frequency;
    AudioHost *host;
public:
    void initialize(AudioHost *host);
    float amplitude = 0.0f;
    void render(float *data, uint32_t frameCount);
    void setFrequency(float freq);
};

#endif