Closed mathieucarbou closed 7 years ago
Some time ago I changed the way the app and plugin communicated so that the plugin doesn't have any knowledge of the details of the particular MIDI control and the app doesn't have to know the control range--the app just sends a value between 0 and 1 for min and max and the plugin translates that to the allowable range.
To go to relative, we'd need to have the app save the state of the control--which we could do through a unordered_map<string,double> where string is the command string and double is the current state. Once we do that, we're not bound to 128 steps for relative encoders, but could use any arbitrary value (e.g., 1000 steps).
Currently, when data comes back from the plugin, we update the MIDI controller. With the map, when data comes back from the plugin, we'd update the map and update the MIDI controller.
Absolute controls would be sent straight to the plugin, as before. Relative controls would send a value relative to the current state as saved in the map.
I think a new class for control state (that includes information about the type of control--e.g., relative/absolute, button/continuous, channel, control number, type (CC, note, etc.) would be useful.
I'm starting by changing CommandMenu--working on getting it to recognize right mouse clicks, so that modifying the MIDI settings for a given command will be simplified.
Data on how relative values work (from BC MIDI documentation) modes (from BC MIDI documentation) showing -2 -1 0 +1 +2 relative-1 twos complement 7# 7F 00 01 02 relative-2 binary offset 3E 3F 40 41 42 relative-3 sign and magnitude 42 41 00 01 02 (note that bit 6 is 0 for positive values, -1 for negative values, bits 1-5 are the value
14-bit showing MSB LSB relative -1 7F7E 7F7F 0000 0001 0002 relative-2 (offset from 4000) 3F7E 3F7F 4000 4001 4002 relative-3 (sign is in bit 6 of MSB) 4002 4001 0000 0001 0002
Probably need the following (+ info on NRPN)
enum struct RelAbs {
Absolute, TwosComplement, BinaryOffset, SignMagnitude };
enum struct ControlType {
PitchWheel, Note, ControlChange };
I'm interested in relative presets as well. In the Paddy world, I had some buttons assigned for + and - large and small values of exposure for example... just a preference in one workflow I had to make fixed step adjustments for certain things vs using the knobs. (I use a BCR2000). The Paddy settings required a dialog box for value assignments. https://www.youtube.com/watch?v=JQUtw9WSuLs&t=216s
What's the status here? I want to use my seaboard block as a controller– you could use the "glide" functionality perfectly as a relative fader.
For commands that relates to LR sliders (i.e. encoders), we can add a checkbox on MIDI2LR GUI at the right to set wheter the value is relative or absolute.
Absolute, being the default, would match the range 0..127 to the LR slider value.
Relative, would just decrease the LR value by 1 or increase LR value by 1 (we would need to be careful of the min and max).
See: https://groups.google.com/forum/#!topic/midi2lr/p5Y0Nz6HARA
NB: Not all controllers support being configures in a way to send 0 or 127 depending if we turn left or right.