51 lines
1022 B
C
51 lines
1022 B
C
|
/*
|
||
|
* Filename: node.h
|
||
|
*
|
||
|
* Description:
|
||
|
*
|
||
|
*
|
||
|
* Version:
|
||
|
* Created: Tue Mar 10 18:45:45 2020
|
||
|
* Revision: None
|
||
|
* Author: Rachel Fae Fox (foxiepaws),fox@foxiepa.ws
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#include <array>
|
||
|
namespace amalgam {
|
||
|
typedef std::pair<double,double> Stereo;
|
||
|
typedef double Mono;
|
||
|
|
||
|
class Node {
|
||
|
protected:
|
||
|
unsigned int sr;
|
||
|
Stereo out;
|
||
|
public:
|
||
|
virtual void process();
|
||
|
Mono getMono() { return out.first + out.second; }
|
||
|
Stereo getStereo() { return out; }
|
||
|
Mono sampleMono() { process(); return out.first + out.second; }
|
||
|
Stereo sampleStereo() { process(); return out; }
|
||
|
};
|
||
|
class IEngine : Node {
|
||
|
protected:
|
||
|
double _freq;
|
||
|
bool _gate;
|
||
|
public:
|
||
|
// getters
|
||
|
double freq() { return _freq; }
|
||
|
bool gate() { return _gate; }
|
||
|
// setters
|
||
|
void freq(double v) { _freq = v;};
|
||
|
void gate(bool v) { _gate = v;};
|
||
|
};
|
||
|
class Instrument : Node {
|
||
|
std::array<IEngine*,32> engines;
|
||
|
unsigned int poly = 1;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
/* Local Variables: */
|
||
|
/* mode: c++ */
|
||
|
/* End: */
|