-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sostenuto.h
55 lines (42 loc) · 1.1 KB
/
Sostenuto.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
#pragma once
#include "IPlug_include_in_plug_hdr.h"
#include "IControls.h"
#include "IPlugPaths.h"
const int kNumPresets = 1;
enum EParams
{
kGain = 0,
kParamGain,
kParamMode,
kParamFreq1,
kParamFreq2,
kNumParams
};
enum EControlTags
{
midiView = 0,
keyboardGraphicView = 1
};
using namespace iplug;
using namespace igraphics;
class Sostenuto final : public Plugin
{
public:
Sostenuto(const InstanceInfo& info);
#if IPLUG_DSP // http://bit.ly/2S64BDd
void ProcessBlock(sample** inputs, sample** outputs, int nFrames) override;
void printMidiValues(int status, int channel, int controlChange, int noteNumber, int noteVelocity);
void addToActiveNotes(int note);
void removeNoteFromVector(int note);
void fillSostenutoNotes();
bool vectorContains(std::vector<int> vec, int note);
void ProcessMidiMsg(const IMidiMsg& msg) override;
private:
bool sostenuto = false;
int pedalValue = 64;
std::vector<int> activeNotes;
std::vector<int> sostenutoNotes;
std::mutex activeNoteMutex;
IVKeyboardControl *noUIKeyboard;
#endif
};