base.hpp (303B)
1 #pragma once 2 3 namespace bogaudio { 4 namespace dsp { 5 6 struct Generator { 7 float _current = 0.0; 8 9 Generator() {} 10 virtual ~Generator() {} 11 12 float current() { 13 return _current; 14 } 15 16 float next() { 17 return _current = _next(); 18 } 19 20 virtual float _next() = 0; 21 }; 22 23 } // namespace dsp 24 } // namespace bogaudio