-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMidiEventManager.h
42 lines (36 loc) · 1.07 KB
/
MidiEventManager.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
#pragma once
#include "NoteOnEvent.h"
#include <vector>
#include <map>
#include "global.h"
class MidiEventManager {
int div; // 分解能
int activeCh; // アクティブなチャンネル
int seq; // シーケンス位置(自動作曲、挿入時に使用)
int mea; // 現在の小節位置
int BlockSize, BlockWidth, BlockHeight;
int Base = 60;
// グリッドの位置
int x = 50;
int y = 50;
std::map<int, NoteOnEvent> noteMap[16];
public:
MidiEventManager();
void addNote(int Ch, int delta, int notenum, int gate, int vel = 100);
void addStartNote(int delta, int ch, int notenum, int vel);
void addEndNote(int delta, int ch, int notenum);
void deleteAllEvent();
void autoCreate(int length=480);
void Update(int focusch, int tick);
void draw();
int GetNoteData(int ch, int key) const;
int GetGateData(int ch, int key) const;
int GetVelData(int ch, int key) const;
void keyUp();
void keyDown();
void LowerOctave();
void HigherOctave();
// ファイル書き込みのためのデータを作成して、渡す
int getMidiMsgForSMF(unsigned char* data);
double loadMidiMsgFromSMF(int track, unsigned char* data, int size);
};