Go Down

Topic: Using alternative for USBMIDI. (Read 225 times) previous topic - next topic


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.

Code: [Select]

   * @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
  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).


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.


Apr 23, 2019, 01:39 am Last Edit: Apr 23, 2019, 02:18 am by PieterP
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.



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


Go Up