Help finding which Surface Control Midi CC Constants to use for my pedal

I'm attempting to control an effects pedal using a custom midi controller I made using the Surface Control Library (@PieterP).

The documentation for my effects pedal show it can accept the following midi control messages:

CONTROL CHANGE

CC 20 BLEND Knob: 0=CCW 127=CW
CC 21 BANDS Knob: 0=CCW 127=CW
CC 22 TREBLE Knob: 0=CCW 127=CW
CC 23 GENDER Knob: 0=CCW 127=CW
CC 24 PITCH Knob: 0=CCW 127=CW

I reviewed the MIDI constants list:

https://tttapa.github.io/Control-Surface-doc/Doxygen/d4/dbe/namespaceMIDI__CC.html

I'm getting stuck on what constants to use for these control changes.

CC 20 is what constant etc.??

Here's my code:

CCPotentiometer vocoderPotentiometers[] {
  { A0, { MIDI_CC::20, CHANNEL_16 } }, //blend
  { A1, { MIDI_CC::21, CHANNEL_16 } }, //bands
  { A2, { MIDI_CC::22, CHANNEL_16 } }, //tone/treble
  { A3, { MIDI_CC::23, CHANNEL_16 } }, //gender
  { A10, { MIDI_CC::24, CHANNEL_16 } }, //pitch
};

There error I get is

expected unqualified-id before numeric constant

Also for patch/program control changes the pedal documentation says:

Program numbers 11 to 19 (11 = VOX ROBO 1, 9 = REFLEX-TUNE) select V256 modes without presets loaded.

I tried this:

ProgramChanger<9> programChanger {
  {
    MIDI_PC::11, // Vox Robo 1
    MIDI_PC::12, // Vox Robo 2
    MIDI_PC::13, // Vox Robo 3
    MIDI_PC::14, // Single Drone
    MIDI_PC::15, // Major Drone
    MIDI_PC::16, // Minor Drone
    MIDI_PC::17, // Transpostion
    MIDI_PC::18, // Instrument CTRL
    MIDI_PC::19, // Reflex Tune
  },
  CHANNEL_16, // MIDI channel to use
};

But get the same error.

I found the MIDI Namespace references doc and changed my program change code to this:

ProgramChanger<9> programChanger {
  {
    MIDI_PC::Vibraphone, // Vox Robo 1
    MIDI_PC::Marimba, // Vox Robo 2
    MIDI_PC::Xylophone, // Vox Robo 3
    MIDI_PC::Tubular_Bells, // Single Drone
    MIDI_PC::Dulcimer, // Major Drone
    MIDI_PC::Drawbar_Organ, // Minor Drone
    MIDI_PC::Percussive_Organ, // Transpostion
    MIDI_PC::Rock_Organ, // Instrument CTRL
    MIDI_PC::Church_Organ, // Reflex Tune
  },
  CHANNEL_16, // MIDI channel to use
};

This change halts the error, but I wanted to confirm that these are the correct constants to send to the pedal according to the documentation.

Does MIDI_PC::11 == Vibraphone etc??

The constants in the MIDI_CC and MIDI_PC namespaces are just ordinary integer constants. You can either use the named constants where it makes sense (e.g. when targeting General MIDI, or simply use an integer literal directly. For example:

CCPotentiometer vocoderPotentiometers[] {
  { A0, { 20, CHANNEL_16 } }, //blend
  { A1, { 21, CHANNEL_16 } }, //bands
  { A2, { 22, CHANNEL_16 } }, //tone/treble
  { A3, { 23, CHANNEL_16 } }, //gender
  { A10, { 24, CHANNEL_16 } }, //pitch
};

or

ProgramChanger<9> programChanger {
  {
    11, // Vox Robo 1
    12, // Vox Robo 2
    13, // Vox Robo 3
    14, // Single Drone
    15, // Major Drone
    16, // Minor Drone
    17, // Transpostion
    18, // Instrument CTRL
    19, // Reflex Tune
  },
  CHANNEL_16, // MIDI channel to use
};

Thanks @PieterP . I knew the answer must be simple!

Do you have an example of MidiChordButton usage?

I was trying to convert a NoteButton into a ChordButton but am hitting a wall with what arguments to pass through.

NoteButton A1_But8 {mux_1.pin(7), {MIDI_Notes::G(4), CHANNEL_16}};

to

const MIDIAddress noteAddress = {MIDI_Notes::C(4), CHANNEL_16};

MIDIChordButton A1_But8 {mux_1.pin(7), noteAddress, Chord<3> DominantSeventh,const Sender &sender};

The error I get is "invalid use of template-name 'CS::MIDIChordButton' without an argument list"

MIDIChordButton is indeed not a class, it's a class template. You should use NoteChordButton instead.

See Bank Transposer and ChordButton · tttapa/Control-Surface · Discussion #914 · GitHub for an example (this is for the bankable case, but the non-bankable case is very similar).

This is not valid C++ syntax when passing arguments to a constructor.

Thanks for the link @PieterP .

I think I have the syntax correct now:

NoteChordButton A1_But8 {mux_1.pin(12), {MIDI_Notes::C(4), CHANNEL_16}, Bass::Double + Chords::Major};

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.