Using alternative for USBMIDI.

How does one establish an alternative default serial interface for either of pieterp’s midi controllers, Control-Surface or MIDI Controller. I am using a teensy 3.2 and a VS1053 breakout for a MIDI device. The VS1053 works with SoftwareSerial transmitting on digital pin2. The line of code in the test program for the VS1053 instantiates the interface with:

SoftwareSerial VS1053_MIDI(0, 2);

Below is the code from Control-Surface for CCPotentiometer. How might I replace line 16," USBMIDI_Interface midi; " so that I can send serial MIDI and print to the serial monitor to see what’s going on.

   * @brief   This is an example of the `CCPotentiometer` class of the 
   *          Control_Surface library.
   * 
   * Connect a potentiometer to analog pin A0. This will be the MIDI channel volume of channel 1.  
   * Map it in your DAW or DJ software.
   * 
   * Written by Pieter P, 28-08-2018  
   * https://github.com/tttapa/Control-Surface
   */
  
  // Include the Control Surface library
  #include <Control_Surface.h>
  
  // Instantiate a MIDI over USB interface.
  USBMIDI_Interface midi; 
  
  // Create a new instance of the class `CCPotentiometer`, called `potentiometer`,
  // on pin A0, that sends MIDI messages with controller 7 (channel volume)
  // on channel 1.
  CCPotentiometer potentiometer(A0, {MIDI_CC::Channel_Volume, CHANNEL_1});
  
  void setup() {
      // Initialize everything
      Control_Surface.begin();
  }
  
  void loop() {
      // Update the Control Surface (check whether the potentiometer's
      // input has changed since last time, if so, send the new value over MIDI).
      Control_Surface.loop();
  }

I am using a teensy 3.2

Use Serial.print for your debugging.
As the teensy looks like a USB MIDI device it can also look like a normal serial port. You might have to set a menu option in the IDE to say you want it to look like a serial port as well as a MIDI device.

Use SoftwareSerialMIDI_Interface and USBDebugMIDI_Interface instead.

List of all MIDI interfaces.

Try to avoid using SoftwareSerial. The Teensy has plenty of hardware serial ports, so SoftwareSerial is just wasting resources.

Pieter

Many thanks to Grumpy and pieterp, I'll get to trying those suggestions. I am sure to be back with more questions.

Iko

Here's an example that uses the debugging interface: