ofxPDSP
MidiPads.h
1 
2 // Pads
3 // ofxPDSP
4 // Nicola Pisanti, MIT License, 2016 - 2018
5 
6 #ifndef OFXPDSP_PDSPMIDIPADS_H_INCLUDED
7 #define OFXPDSP_PDSPMIDIPADS_H_INCLUDED
8 
9 #ifndef __ANDROID__
10 
11 #include "ofxMidi.h"
12 #include "../messages/header.h"
13 #include "../DSP/control/SequencerGateOutput.h"
14 #include "helper/Controller.h"
15 #include "MidiIn.h"
16 
21 namespace pdsp{ namespace midi {
22 
23 class Pads : public pdsp::Controller {
24 
25 public:
26  Pads();
27 
34  void addTriggerLayer(int noteLow, int noteHigh, int channel = 0 );
35 
43  void setTriggerLayer(int layerIndex, int noteLow, int noteHigh, int channel = 0 );
44 
49  void resizeLayers(int size);
50 
58  void simpleInit(int lowNote, int numLayer, int layerSpan=1, int channel=0);
59 
64  pdsp::SequencerGateOutput & out_trig( int layerIndex );
65 
70  int getLayerLow(int layerIndex) const;
71 
76  int getLayerHigh(int layerIndex) const;
77 
85  std::vector<pdsp::SequencerGateOutput> outs_trig;
86 
87  void processMidi(const pdsp::midi::Input &midiInProcessor, const int &bufferSize ) noexcept override;
92 private:
93  std::vector<pdsp::MessageBuffer> trigBuffers;
94  std::vector<int> lowThreshold;
95  std::vector<int> highThreshold;
96  std::vector<int> channels;
97 
98  int size;
99 };
100 
101 }} // end namespace
102 
103 #endif
104 
105 #endif // OFXPDSP_PDSPMIDIPADS_H_INCLUDED
Definition: MidiIn.h:22
Definition: MidiPads.h:23
Takes messages from a MessageBuffer and convert them in a trigger output.
Definition: SequencerGateOutput.h:20
pdsp::SequencerGateOutput & out_trig(int layerIndex)
return the trigger output of the given note layer.
Definition: MidiPads.cpp:154
int getLayerLow(int layerIndex) const
returns the low note for the given layer
Definition: MidiPads.cpp:96
void setTriggerLayer(int layerIndex, int noteLow, int noteHigh, int channel=0)
sets a trigger layer. This layer will parse the notes from noteLow o noteHigh (both included) and con...
Definition: MidiPads.cpp:60
int getLayerHigh(int layerIndex) const
returns the high note for the given layer
Definition: MidiPads.cpp:105
Definition: Controller.h:11
void addTriggerLayer(int noteLow, int noteHigh, int channel=0)
adds a new trigger layer. This will parse the notes from noteLow o noteHigh (both included) and conve...
Definition: MidiPads.cpp:43
Thread-safe value control with smoothing.
Definition: SequencerBridge.h:11
void simpleInit(int lowNote, int numLayer, int layerSpan=1, int channel=0)
inits the class setting its layer starting from low note, setting span notes for each layer...
Definition: MidiPads.cpp:75
void resizeLayers(int size)
resizes the trigger layers number
Definition: MidiPads.cpp:17