Control Surface
main
MIDI Control Surface library for Arduino
Toggle main menu visibility
Loading...
Searching...
No Matches
src
MIDI_Senders
DigitalNoteSender.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
Control_Surface/Control_Surface_Class.hpp
>
4
5
BEGIN_CS_NAMESPACE
6
12
class
DigitalNoteSender
{
13
public
:
14
DigitalNoteSender
(uint8_t
velocity
= 0x7F) :
velocity
(
velocity
) {}
17
void
sendOn
(
MIDIAddress
address) {
18
Control_Surface
.sendNoteOn(address,
getVelocity
());
19
}
20
21
void
sendOff
(
MIDIAddress
address) {
22
Control_Surface
.sendNoteOff(address, 0x7F);
23
}
24
25
void
setVelocity
(uint8_t
velocity
) { this->velocity =
velocity
; }
26
uint8_t
getVelocity
()
const
{
return
this->
velocity
; }
27
28
private
:
29
uint8_t
velocity
;
30
};
31
32
END_CS_NAMESPACE
Control_Surface
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Definition
Control_Surface_Class.cpp:338
Control_Surface_Class.hpp
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:14
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:11
DigitalNoteSender::setVelocity
void setVelocity(uint8_t velocity)
Definition
DigitalNoteSender.hpp:25
DigitalNoteSender::getVelocity
uint8_t getVelocity() const
Definition
DigitalNoteSender.hpp:26
DigitalNoteSender::sendOn
void sendOn(MIDIAddress address)
Send a note on message to the given address with this object's velocity as velocity.
Definition
DigitalNoteSender.hpp:17
DigitalNoteSender::velocity
uint8_t velocity
Definition
DigitalNoteSender.hpp:29
DigitalNoteSender::sendOff
void sendOff(MIDIAddress address)
Send a note off message to the given address with 0x7F as velocity.
Definition
DigitalNoteSender.hpp:21
DigitalNoteSender::DigitalNoteSender
DigitalNoteSender(uint8_t velocity=0x7F)
Definition
DigitalNoteSender.hpp:14
MIDIAddress
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
Definition
MIDIAddress.hpp:145
Generated by
1.17.0