forked from addacsystem/ADDAC-Library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathADDAC_LFO.h
executable file
·54 lines (39 loc) · 1.32 KB
/
ADDAC_LFO.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* ADDAC_LFO
*
* ag.09/2011
* Version 0.1
*
* in the Arduino environment simply add at the very top:
#include <ADDAC_LFO.h> // This loads the Class when compiling
ADDAC_LFO LFO1; // This Instantiates 1 Class with the name "LFO1"
*
*
*/
#ifndef ADDAC_LFO_h
#define ADDAC_LFO_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include <WProgram.h>
#endif
#define addacMaxResolution 65535
class ADDAC_LFO{
public:
ADDAC_LFO();
void update(float _freq); // Function to be called from Arduino Environment
void SINupdate();
unsigned int SINget();
void sinMode(int _channel, bool _inverted, float _freq, float _mult, unsigned int _offset, float _bottom, float _top);
void sinMode(int _channel, bool _inverted, float _freq, float _mult, unsigned int _offset);
void cosinMode(int _channel, bool _inverted, float _freq, float _mult, unsigned int _offset, float _bottom, float _top);
void cosinMode(int _channel, bool _inverted, float _freq, float _mult, unsigned int _offset);
void lfosMode(int _MODE, int _type, int _channel);
unsigned long SINoldTimes[8];
boolean direction[8];
boolean Direction;
unsigned int rndStep[8];
unsigned int SINval, SIN;
float increment, position;
};
#endif