forked from raszhivin/arpeggiator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
engine.h
34 lines (29 loc) · 900 Bytes
/
engine.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
#include "Arduino.h"
typedef enum {C, CD, D, DD, E, F, FD, G, GD, A, AD, B} notes;
typedef enum {maj, minor, dim, aug} chord_types;
typedef struct {
short Shift;
chord_types chord_type;
} chord;
class arp {
private:
notes baseNote;
short baseOctave;
short octaveShift;
unsigned short steps;
unsigned int progression;
chord *mode;
int order;
public:
arp();
int setProgression(unsigned int p);
void play();
void updateArp(uint8_t baseNoteVal,uint8_t baseOctaveVal,uint8_t octaveShiftVal,uint8_t stepsVal,uint16_t indelayVal,uint8_t modenumVal,uint8_t orderVal);
void midibegin();
void synthbegin();
uint8_t modenum;
unsigned int indelay;
};
int* createChord(notes root, chord_types i, int *notes_array, unsigned short *sh1, unsigned short *sh2);
short midiByNote (notes note, short octave);
void shuffle(uint8_t *array, size_t n);