sequencer
byte.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstddef>
4 #include <cstdint>
5 
7 {
8  // clang-format off
9  constexpr auto note_on = std::byte{0x90};
10  constexpr auto note_off = std::byte{0x80};
11  constexpr auto polymorphic_key_pressure = std::byte{0xA0};
12  constexpr auto control_change = std::byte{0xB0};
13  constexpr auto program_change = std::byte{0xC0};
14  constexpr auto channel_pressure = std::byte{0xD0};
15  constexpr auto pitch_bend_change = std::byte{0xE0};
16 
17  // system common
18  constexpr auto song_position_pointer = std::byte{0xF2};
19  constexpr auto song_select = std::byte{0xF3};
20  constexpr auto tune_request = std::byte{0xF6};
21 
22  // system exclusive
23  constexpr auto sysex_start = std::byte{0xF0};
24  constexpr auto sysex_end = std::byte{0xF7};
25 
26  // realtime
27  constexpr auto realtime_clock = std::byte{0xF8};
28  constexpr auto realtime_start = std::byte{0xFA};
29  constexpr auto realtime_continue = std::byte{0xFB};
30  constexpr auto realtime_stop = std::byte{0xFC};
31  constexpr auto active_sensing = std::byte{0xFE};
32  constexpr auto reset_all = std::byte{0xFF};
33  // clang-format on
34 
35  namespace cc
36  {
37  constexpr auto lsb( std::byte msb )
38  {
39  return std::byte( static_cast< std::uint8_t >( msb ) + 0x20 );
40  }
41 
42  // clang-format off
43  constexpr auto bank_select_msb = std::byte{0x00};
44  constexpr auto bank_select_lsb = lsb(bank_select_msb);
45  constexpr auto modulation_wheel_msb = std::byte{0x01};
46  constexpr auto modulation_wheel_lsb = lsb(modulation_wheel_msb);
47  constexpr auto breath_controller_msb = std::byte{0x02};
48  constexpr auto breath_controller_lsb = lsb(breath_controller_msb);
49  constexpr auto foot_controller_msb = std::byte{0x04};
50  constexpr auto foot_controller_lsb = lsb(foot_controller_msb);
51  constexpr auto portamento_time_msb = std::byte{0x05};
52  constexpr auto portamento_time_lsb = lsb(portamento_time_msb);
53  constexpr auto data_entry_msb = std::byte{0x06};
54  constexpr auto data_entry_lsb = lsb(data_entry_msb);
55  constexpr auto channel_volume_msb = std::byte{0x07};
56  constexpr auto channel_volume_lsb = lsb(channel_volume_msb);
57  constexpr auto balance_msb = std::byte{0x08};
58  constexpr auto balance_lsb = lsb(balance_msb);
59  constexpr auto pan_msb = std::byte{0x0A};
60  constexpr auto pan_lsb = lsb(pan_msb);
61  constexpr auto expression_controller_msb = std::byte{0x0B};
62  constexpr auto expression_controller_lsb = lsb(expression_controller_msb);
63  constexpr auto effect_control_1_msb = std::byte{0x0C};
64  constexpr auto effect_control_1_lsb = lsb(effect_control_1_msb);
65  constexpr auto effect_control_2_msb = std::byte{0x0D};
66  constexpr auto effect_control_2_lsb = lsb(effect_control_2_msb);
67  constexpr auto general_purpose_controller_1_msb = std::byte{0x10};
68  constexpr auto general_purpose_controller_1_lsb = lsb(general_purpose_controller_1_msb);
69  constexpr auto general_purpose_controller_2_msb = std::byte{0x11};
70  constexpr auto general_purpose_controller_2_lsb = lsb(general_purpose_controller_2_msb);
71  constexpr auto general_purpose_controller_3_msb = std::byte{0x12};
72  constexpr auto general_purpose_controller_3_lsb = lsb(general_purpose_controller_3_msb);
73  constexpr auto general_purpose_controller_4_msb = std::byte{0x13};
74  constexpr auto general_purpose_controller_4_lsb = lsb(general_purpose_controller_4_msb);
75  constexpr auto damper_pedal = std::byte{0x40};
76  constexpr auto portamento = std::byte{0x41};
77  constexpr auto sostenuto = std::byte{0x42};
78  constexpr auto soft_pedal = std::byte{0x43};
79  constexpr auto hold_2 = std::byte{0x45};
80  constexpr auto effects_1_depth = std::byte{0x5B};
81  constexpr auto effects_2_depth = std::byte{0x5C};
82  constexpr auto effects_3_depth = std::byte{0x5D};
83  constexpr auto effects_4_depth = std::byte{0x5E};
84  constexpr auto effects_5_depth = std::byte{0x5F};
85  constexpr auto non_registered_parameter_number_lsb = std::byte{0x62};
86  constexpr auto non_registered_parameter_number_msb = std::byte{0x63};
87  constexpr auto registered_parameter_number_lsb = std::byte{0x64};
88  constexpr auto registered_parameter_number_msb = std::byte{0x65};
89  constexpr auto all_sounds_off = std::byte{0x78};
90  constexpr auto reset_all_controllers = std::byte{0x79};
91  constexpr auto local_control = std::byte{0x7A};
92  constexpr auto all_notes_off = std::byte{0x7B};
93  constexpr auto omni_mode_off = std::byte{0x7C};
94  constexpr auto omni_mode_on = std::byte{0x7D};
95  constexpr auto poly_mode_on = std::byte{0x7F};
96  // clang-format on
97  } // namespace cc
98 
99  namespace sysex
100  {
101  // clang-format off
102  constexpr auto device_control = std::byte{0x04};
103  // clang-format on
104  } // namespace sysex
105 } // namespace sequencer::midi::byte
constexpr auto general_purpose_controller_2_lsb
Definition: byte.hpp:70
constexpr auto sostenuto
Definition: byte.hpp:77
constexpr auto non_registered_parameter_number_msb
Definition: byte.hpp:86
constexpr auto effect_control_2_lsb
Definition: byte.hpp:66
constexpr auto active_sensing
Definition: byte.hpp:31
constexpr auto song_position_pointer
Definition: byte.hpp:18
Definition: byte.hpp:6
constexpr auto balance_msb
Definition: byte.hpp:57
constexpr auto channel_pressure
Definition: byte.hpp:14
constexpr auto expression_controller_msb
Definition: byte.hpp:61
constexpr auto reset_all
Definition: byte.hpp:32
constexpr auto breath_controller_msb
Definition: byte.hpp:47
constexpr auto song_select
Definition: byte.hpp:19
constexpr auto sysex_end
Definition: byte.hpp:24
constexpr auto channel_volume_msb
Definition: byte.hpp:55
constexpr auto all_sounds_off
Definition: byte.hpp:89
constexpr auto reset_all_controllers
Definition: byte.hpp:90
constexpr auto registered_parameter_number_msb
Definition: byte.hpp:88
constexpr auto foot_controller_msb
Definition: byte.hpp:49
constexpr auto effect_control_1_msb
Definition: byte.hpp:63
constexpr auto polymorphic_key_pressure
Definition: byte.hpp:11
constexpr auto balance_lsb
Definition: byte.hpp:58
constexpr auto general_purpose_controller_3_lsb
Definition: byte.hpp:72
constexpr auto sysex_start
Definition: byte.hpp:23
constexpr auto general_purpose_controller_4_lsb
Definition: byte.hpp:74
constexpr auto program_change
Definition: byte.hpp:13
constexpr auto breath_controller_lsb
Definition: byte.hpp:48
constexpr auto lsb(std::byte msb)
Definition: byte.hpp:37
constexpr auto general_purpose_controller_1_lsb
Definition: byte.hpp:68
constexpr auto pan_msb
Definition: byte.hpp:59
constexpr auto expression_controller_lsb
Definition: byte.hpp:62
constexpr auto effects_4_depth
Definition: byte.hpp:83
constexpr auto portamento_time_msb
Definition: byte.hpp:51
constexpr auto data_entry_lsb
Definition: byte.hpp:54
constexpr auto hold_2
Definition: byte.hpp:79
constexpr auto modulation_wheel_lsb
Definition: byte.hpp:46
constexpr auto bank_select_msb
Definition: byte.hpp:43
constexpr auto omni_mode_on
Definition: byte.hpp:94
constexpr auto bank_select_lsb
Definition: byte.hpp:44
constexpr auto data_entry_msb
Definition: byte.hpp:53
constexpr auto tune_request
Definition: byte.hpp:20
constexpr auto effects_3_depth
Definition: byte.hpp:82
constexpr auto omni_mode_off
Definition: byte.hpp:93
constexpr auto effect_control_1_lsb
Definition: byte.hpp:64
constexpr auto local_control
Definition: byte.hpp:91
constexpr auto damper_pedal
Definition: byte.hpp:75
constexpr auto effects_5_depth
Definition: byte.hpp:84
constexpr auto realtime_stop
Definition: byte.hpp:30
constexpr auto effects_2_depth
Definition: byte.hpp:81
constexpr auto soft_pedal
Definition: byte.hpp:78
constexpr auto general_purpose_controller_1_msb
Definition: byte.hpp:67
constexpr auto realtime_continue
Definition: byte.hpp:29
constexpr auto device_control
Definition: byte.hpp:102
constexpr auto non_registered_parameter_number_lsb
Definition: byte.hpp:85
constexpr auto note_on
Definition: byte.hpp:9
constexpr auto modulation_wheel_msb
Definition: byte.hpp:45
constexpr auto general_purpose_controller_4_msb
Definition: byte.hpp:73
constexpr auto channel_volume_lsb
Definition: byte.hpp:56
constexpr auto all_notes_off
Definition: byte.hpp:92
constexpr auto poly_mode_on
Definition: byte.hpp:95
constexpr auto note_off
Definition: byte.hpp:10
constexpr auto pitch_bend_change
Definition: byte.hpp:15
constexpr auto portamento_time_lsb
Definition: byte.hpp:52
constexpr auto foot_controller_lsb
Definition: byte.hpp:50
constexpr auto registered_parameter_number_lsb
Definition: byte.hpp:87
constexpr auto effects_1_depth
Definition: byte.hpp:80
constexpr auto realtime_clock
Definition: byte.hpp:27
constexpr auto realtime_start
Definition: byte.hpp:28
constexpr auto general_purpose_controller_2_msb
Definition: byte.hpp:69
constexpr auto control_change
Definition: byte.hpp:12
constexpr auto effect_control_2_msb
Definition: byte.hpp:65
constexpr auto general_purpose_controller_3_msb
Definition: byte.hpp:71
constexpr auto portamento
Definition: byte.hpp:76
constexpr auto pan_lsb
Definition: byte.hpp:60