MIDI.sendNoteOn - Split midi notes to two devices don´t work

Hi there,

i´m an absolutely beginner regarding (Arduino) programming and just created my first sketch as you see below.
The fortyseveneffects midi library is used.

I have an Arduino Uno with a Chinese MidiShield. I try to split incoming midi notes to the two midi outputs of the shield, where a Volca Sample and a Volca Beats is connected to. The goal is to send midi notes on one channel to the Midi shield and send them to one of the two devices on different channels (3-10 Volca Sample, 14 Volca Beats) depending on the incoming midi note. While it works fine for the Volca Sample, i can´t get the Volca Beats to work.

(The Arduino seem to not alter any notes e.g. filtering, midi out/thru problems or something.
Testing midi shield Input on ch. 14 is sending correctly to the Volca Beats)

For the moment the workaround is to send midi signals to the arduino also on channel 14 (instead of desired channel 16).
So the correct keypresses are sent to the Volca Beats while the other keypresses are sent to the Volca Sample (via the Arduino). This works fine and both devices could be reached via one midi channel.

Anyhow that was not the goal of my first sketch / Arduino self programmed thing...

So the question is:
Why i can´t reach the Vocla Beats via channel 16, while it works fine for the Volca Sample ?!

Here is my code:

#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();

void setup()
{
  MIDI.setHandleNoteOn(myHandleNoteOn);
  MIDI.begin(16);                          // Listen to Channel 16 only (desired), for the workaround 14 is set here.
}

void loop()
{
  MIDI.read();                             // Read incoming Midi
}

void myHandleNoteOn(byte channel, byte note, byte velocity)
{
  switch (note)                             // Input Note -> Output Note \/
  { 
    case 37:
    MIDI.sendNoteOn(note, velocity, 3);     //  Note 37 pressed. note 37 sent on channel 3 to volca sample, (note irrelevant for Volca Sample)
    MIDI.sendNoteOn(note, 0, 3);            // "NoteOff" channel 3, same note // Volca Sample receives on Channels 3-10
    break;                                  
                                            
    case 40:                                
    MIDI.sendNoteOn(note, velocity, 4);
    MIDI.sendNoteOn(note, 0, 4);
    break;

    case 41:
    MIDI.sendNoteOn(note, velocity, 5);
    MIDI.sendNoteOn(note, 0, 5);
    break;

    case 44:
    MIDI.sendNoteOn(note, velocity, 6);
    MIDI.sendNoteOn(note, 0, 6);
    break;

    case 45:
    MIDI.sendNoteOn(note, velocity, 7);
    MIDI.sendNoteOn(note, 0, 7);
    break;

    case 47:
    MIDI.sendNoteOn(note, velocity, 8);
    MIDI.sendNoteOn(note, 0, 8);
    break;

    case 48:
    MIDI.sendNoteOn(note, velocity, 9);
    MIDI.sendNoteOn(note, 0, 9);
    break;

    case 49:
    MIDI.sendNoteOn(note, velocity, 10);
    MIDI.sendNoteOn(note, 0, 10);
    break;

    case 36:
    MIDI.sendNoteOn(note, velocity, 14);      // Volca Drum receives on channel 14, NoteOn channel 14, (note relevant for Volca Drums)
    MIDI.sendNoteOn(note, 0, 14);             // one case for the moment, will be eight when the Beats is reachable...
    break;                                    // THIS case is not working ! 

    default:                                  // do nothing;
    break;
  }
}

I hope i haven´t forget anything and this post is forum conform.
Any advice is appreciated ! Thanks in advance !

Tobi

Anyone ? Just a hint, maybe ?!

Sorry, I got lost somewhere in your explanation. You posted some code which looks like it will probably do what I think you want. Input different notes on MIDI ch 16, output of the same note on various channels depending on the input note?

So when you run it what exactly does happen? The only thing I can see that looks odd in the code is that you always send a NoteOff instantly after every NoteOn. I'd wonder if what you're sending it to can cope with such very short notes.

Steve

I Steve,

thanks for your answer and sorry for my confusing writings :stuck_out_tongue:

You understood correct. I like do send midinotes on channel 16 to the arduino.
The arduino then should send the same notes on different channels to two different devices.
Channel 3-10 are sent to one device. this works fine.
The other device, on channel 14 is not reachable. Nothing is happening when notes are send to channel 14 from the arduino.

The workaround is, sending notes on channel 14, which is the one device, volca drums. (Through the arduino without altering).
The arduino also receives notes on channel 14 and send the notes to channel 3-10.

So both devices are receiving midinotes and the goal is reached. But the way isn´t nice.

How exactly are your Volcas connected to the MIDI shield on the Arduino? It almost sounds as though you have the Beats plugged into the MIDI Thru connector so it just gets a copy of whatever is on the Input.

As I recall the Volcas only have MIDI In so to connect two Volca devices you need two MIDI Outs. Does your shield have two Outs or are you using a MIDI splitter or something like that ?

Steve

Hi Steve,

good advice. You´re right. It´s an MIDI output and a MIDI thru on that board. That is the point.
A splitter cable could do the trick...

And i thought the code is wrong somehow.

I will try a MIDI splitter cable or just use it like it is at the moment with the MIDI through.

Thanks for your input and sorry for the confusion :sweat_smile: ::slight_smile: