-
Notifications
You must be signed in to change notification settings - Fork 0
/
Serialism.h
58 lines (48 loc) · 1.21 KB
/
Serialism.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
55
56
57
58
/*
* Serialism.h
*
* Created on: Jan 17, 2014
* Author: edwinrietmeijer
*
* This class creates an object which can generate note pitches returned as a vector of ints. Initially the
* 12 notes of the chromatic scale are used.
*
* The generated set can be reshuffled, and a vector of possible blocks of notes to grab from the generated
* set can be returned.
*
*/
#ifndef SERIALISM_H_
#define SERIALISM_H_
#define RANDOM_DEV mt19937
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include "Generator.h"
#include "GeneratorMediation.h"
namespace serialism {
class Serialism : virtual public generator::Generator {
private:
std::random_device rd;
const static int rev[];
const static int inv[];
const static int standardNoteSet[];
std::vector<int> initNoteSet_;
std::vector<int> noteSet_;
std::vector<int> noteSetIndexes_;
std::vector<int> serialSet_;
std::vector<int> blockSizes_;
int setIndexesSize_;
// Internal functions
void shuffleSetIndexes();
void generateSet();
void toScreen();
public:
Serialism();
// Script supported functions
void init();
int get( int );
virtual ~Serialism();
};
} // namespace serialism
#endif /* SERIALISM_H_ */