Newer
Older
music / app / src / main / cpp / Instrument.h
  1. #ifndef MUSIC_INSTRUMENT_H
  2. #define MUSIC_INSTRUMENT_H
  3.  
  4. class Instrument;
  5.  
  6. #include "effects/Envelope.h"
  7. #include "waveforms/Waveform.h"
  8. #include "AudioHost.h"
  9.  
  10. class Instrument {
  11. private:
  12. AudioHost *host;
  13. public:
  14. Instrument(AudioHost *host);
  15.  
  16. Envelope *const envelope = new Envelope();
  17. Waveform *wave;
  18.  
  19. void render(float *buffer, uint32_t count);
  20. void startNote(float frequency);
  21. void endNote();
  22. void setWaveform(WaveformType waveform);
  23. };
  24.  
  25. #endif