Standalone MIDI Controller

Solved!

It was part of my, part of Arduino's fault. Code I initially use works for both USB and GT-10 now, with dual-interface option.

My part was connecting the DIN leads in reverse (5v and TX), yet I tried this swapping before but...

Arduino's part was, when the board is not connected to the PC, even if it sends a message, TX or RX LEDs do not blink. So it was actually sending long before I know but somehow I've missed it...

1 Like

Hi again,

As I've solved my issue, I got another more simple one.

Can I add on/off LEDs to this code? Shall I use CCButtonLatching or this one is fine? The only thing I can add is, the switches I use have only 2 lugs, but as I'll get the outputs from the board itself not from the switches, I don't think it'll matter.

But I'm thinking about, how the actual state of the related function will be read from the GT-10.. Let's say,

I switched on Reverb lets say with a switch on this board,
LED also turned on (read from the board),
Then I changed the patch or bank in GT-10,
That patch doesn't have the Reverb on by default,
Would this LED still be on or go off..

Without trying, it's hard to say something of course, but I'd like to know the logic.

Glad you sorted things out, well done for sticking with it.

A glance of the schematic of Arduinos will show that the TX and RX pins are not controlled by the Arduino itself but by the chip doing the USB to serial conversion. We used to get a lot of questions like that but not so much in recent years.

When an Arduino generates a virtual USB interface with the PC it is harder to spot, but the principle is still the same, no PC, no flashing TX and RX lights. In this case the virtual USB software does the flashing.

That gets me all the time, so I use an oscilloscope to check this is right even before writing anything else in code.

Sure, you can use digitalWrite in your code to turn on/off the LED, e.g. based on the value returned by CCButtonLatched::getState().

This could be useful: https://github.com/tttapa/Control-Surface/issues/136#issuecomment-601956323
This part specifically:

const pin_t ledPins[] = {
  10, 
  11,
  12,
  13,
};

void setup() {
  for (pin_t ledPin : ledPins)
    ExtIO::pinMode(ledPin, OUTPUT);
  Control_Surface.begin();
}

template <class T, size_t N> constexpr size_t len(const T (&)[N]) { return N; }

void loop() {
  Control_Surface.loop();
  static_assert(len(ledPins) == len(buttons), "Use the same number of LEDs as the number of buttons!");
  for (size_t i = 0; i < len(buttons); ++i)
    ExtIO::digitalWrite(ledPins[i], buttons[i].getState());  
}

Thanks for help pieter!

One last and probably advanced question.

Is it possible to send sysex commands with the same logic i implement as cc's?

This gt-10 has this sysex list and literally every bit of function has a sysex command.
GT-10_MI.pdf (678.2 KB)

With that, i intend to something like this. Normally, you cant activate more than 2 effects in this device (fx1 and fx2) and they share the same effects between each other. What i intend to do is sort of swapping between effects using the sysex codes.

Say, a random sysex code like

fd 33 42 00 fd 00 for switch off and 01 for switch on for fx1 channel.

Fd 34 04 01 bb 05 is for phaser, 06 for flanger, 07 for tremolo etc..

What i want to try is that, when is click 1st switch, itll trigger the phaser, when i click 2nd switch itll trigger flanger etc.
One thing here is that whether it would be better to use a common switch to activate the fx1 and use others for individual fxs or assign each fx sysex along with on/off functions.

The detailed list is attached.

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