OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
channel.hpp
1#pragma once
2#include <array>
3#include <cinttypes>
4#include <utility>
5namespace ossia::net::midi
6{
7using midi_size_t = uint8_t;
8class midi_parameter;
9struct midi_channel
10{
11 // [ note, vel ]
12 std::pair<midi_size_t, midi_size_t> note_on{};
13 std::pair<midi_size_t, midi_size_t> note_off{};
14
15 // [ CC, value ]
16 std::pair<midi_size_t, midi_size_t> cc{};
17
18 // PC
19 midi_size_t pc{};
20
21 // PB
22 int32_t pb{};
23
24 // velocity or value
25 std::array<midi_size_t, 128> note_on_N = {{64}};
26 std::array<midi_size_t, 128> note_off_N = {{64}};
27 std::array<midi_size_t, 128> cc_N = {{64}};
28 // No need to store PC since they are only impulses
29
30 // Callbacks
31 midi_parameter* param_note_on{};
32 midi_parameter* param_note_off{};
33 midi_parameter* param_cc{};
34 midi_parameter* param_pc{};
35 midi_parameter* param_pb{};
36 std::array<midi_parameter*, 128> param_note_on_N = {{}};
37 std::array<midi_parameter*, 128> param_note_off_N = {{}};
38 std::array<midi_parameter*, 128> param_cc_N = {{}};
39 std::array<midi_parameter*, 128> param_pc_N = {{}};
40
41 bool callback_note_on{};
42 bool callback_note_off{};
43 bool callback_cc{};
44 bool callback_pc{};
45 bool callback_pb{};
46 std::array<bool, 128> callback_note_on_N = {{}};
47 std::array<bool, 128> callback_note_off_N = {{}};
48 std::array<bool, 128> callback_cc_N = {{}};
49 std::array<bool, 128> callback_pc_N = {{}};
50};
51}