-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatchdata.h
49 lines (41 loc) · 1 KB
/
patchdata.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
#define SAMPLE_RATE 15734
#define SAMPLES_PER_FRAME ((SAMPLE_RATE)/60)
#define DEFAULT_VOLUME 0xff
#define WAVE_HEADER_LEN 44
#define PC_ENV_SPEED 0
#define PC_NOISE_PARAMS 1
#define PC_WAVE 2
#define PC_NOTE_UP 3
#define PC_NOTE_DOWN 4
#define PC_NOTE_CUT 5
#define PC_NOTE_HOLD 6
#define PC_ENV_VOL 7
#define PC_PITCH 8
#define PC_TREMOLO_LEVEL 9
#define PC_TREMOLO_RATE 10
#define PC_SLIDE 11
#define PC_SLIDE_SPEED 12
#define PC_LOOP_START 13
#define PC_LOOP_END 14
#define PATCH_END 255
#define NUM_WAVES 10
#define EXTRA_TIME 60
class PatchData : public wxTreeItemData {
public:
wxVector<long> data;
PatchData();
PatchData(const PatchData *p);
~PatchData();
void stop();
bool play(bool loop=false);
void retrigger();
bool generate_wave(wxVector<uint8_t> &out_data);
wxString last_error;
private:
wxVector<uint8_t> wave_data;
Mix_Chunk *wave;
int channel;
void free_chunk();
void add_headers(wxVector<uint8_t> &out_data);
bool is_noise_patch();
};