]> git.sesse.net Git - nageru/blob - midi_mapping.proto
5809ffe02bfb1cc95f5405931beab4bd961a42dd
[nageru] / midi_mapping.proto
1 // Mappings from MIDI controllers to the UI. (We don't really build
2 // a more complicated data structure than this in Nageru itself either;
3 // we just edit and match directly against the protobuf.)
4
5 syntax = "proto2";
6
7 // A single, given controller mapping.
8 message MIDIControllerProto {
9         required int32 controller_number = 1;
10         // TODO: Add flags like invert here if/when we need them.
11 }
12
13 message MIDIButtonProto {
14         required int32 note_number = 1;
15 }
16
17 // All the mappings for a given a bus.
18 message MIDIMappingBusProto {
19         // TODO: If we need support for lots of buses (i.e., more than the typical eight
20         // on a mixer), add a system for bus banks, like we have for controller banks.
21         // optional int32 bus_bank = 1;
22
23         optional MIDIControllerProto treble = 2;
24         optional MIDIControllerProto mid = 3;
25         optional MIDIControllerProto bass = 4;
26         optional MIDIControllerProto gain = 5;
27         optional MIDIControllerProto compressor_threshold = 6;
28         optional MIDIControllerProto fader = 7;
29
30         // TODO: Add mute and cue? (Of course, we should those to the UI before
31         // making them MIDI controllable.)
32         optional MIDIButtonProto toggle_locut = 8;
33         optional MIDIButtonProto toggle_auto_gain_staging = 9;
34         optional MIDIButtonProto toggle_compressor = 10;
35         optional MIDIButtonProto clear_peak = 11;
36
37         // These are really global (controller bank change affects all buss),
38         // but it's not uncommon that we'd want one button per bus to switch banks.
39         // E.g., if the user binds the “mute” button to “next bank”, they'd want every
40         // mute button on the mixer to do that, so they need one mapping per bus.
41         optional MIDIButtonProto prev_bank = 12;
42         optional MIDIButtonProto next_bank = 13;
43         optional MIDIButtonProto select_bank_1 = 14;
44         optional MIDIButtonProto select_bank_2 = 15;
45         optional MIDIButtonProto select_bank_3 = 16;
46         optional MIDIButtonProto select_bank_4 = 17;
47         optional MIDIButtonProto select_bank_5 = 18;
48         optional MIDIButtonProto toggle_limiter = 19;
49         optional MIDIButtonProto toggle_auto_makeup_gain = 20;
50
51         // These are also global (they belong to the master bus), and unlike
52         // the bank change commands, one would usually have only one of each,
53         // but there's no reason to limit them to one each, and the editor UI
54         // becomes simpler if they are the treated the same way as the bank
55         // commands.
56         optional MIDIControllerProto locut = 21;
57         optional MIDIControllerProto limiter_threshold = 22;
58         optional MIDIControllerProto makeup_gain = 23;
59 }
60
61 // The top-level protobuf, containing all the bus mappings, as well as
62 // more global settings.
63 //
64 // Since a typical mixer will have fewer physical controls than what Nageru
65 // could use, Nageru supports so-called controller banks. A mapping can
66 // optionally belong to a bank, and if so, that mapping is only active when
67 // that bank is selected. The user can then select the current bank using
68 // other mappings, typically by having some mixer button assigned to
69 // “next bank”. This yields effective multiplexing of lesser-used controls.
70 message MIDIMappingProto {
71         optional int32 num_controller_banks = 1 [default = 0];  // Max 5.
72
73         // Bus controller banks.
74         optional int32 treble_bank = 2;
75         optional int32 mid_bank = 3;
76         optional int32 bass_bank = 4;
77         optional int32 gain_bank = 5;
78         optional int32 compressor_threshold_bank = 6;
79         optional int32 fader_bank = 7;
80
81         // Bus button banks.
82         optional int32 toggle_locut_bank = 8;
83         optional int32 toggle_auto_gain_staging_bank = 9;
84         optional int32 toggle_compressor_bank = 10;
85         optional int32 clear_peak_bank = 11;
86
87         // Global controller banks.
88         optional int32 locut_bank = 12;
89         optional int32 limiter_threshold_bank = 13;
90         optional int32 makeup_gain_bank = 14;
91
92         // Global buttons.
93         optional int32 toggle_limiter_bank = 15;
94         optional int32 toggle_auto_makeup_gain_bank = 16;
95
96         repeated MIDIMappingBusProto bus_mapping = 17;
97 }