How to compose midi msg according to device

I am using Midi Library 5.0.2
I want to compose 2 types midi messeges
both are not in examples
First :- Change Bank
this is Midi requirment from my synth


when power is on my device is in Patch Mode.
I want to jump to User Performance .
I don't know about Msb Lsb.
what midi messege need here in code block??

Second :- Send Key Shift
This is Key shift requirment from my synth.


i will write mmH(28H - to - 58H) by a variable.
how to write these bytes sequence in code block??

Post a complete example sketch, or anything you wrote, that sends any kind of message to this MIDI entity.

It should be easy to see why what gets sent, and modify it so it sends what you want, not what it already does.

a7

i am trying for bank change to User performence

     case PRESSED:
                        MIDI.sendControlChange(0,85, 1); 
                        MIDI.sendControlChange(0,0, 1); 
                          MIDI.sendProgramChange(52, 1);
                break;

it does not work
and trying for key shift
before void setup()

 byte sysexArray[8] = {F0,7F,7F,04,04,00,50,F7}; 

on input key

  MIDI.sendSysEx(8, sysexArray, true); 

getting error.....

confuse about correct code for jump to User Performance Mode. And key shift

Please do not post pictures. Post text either as a block quote or code. Use the buttons in the message composition window.

I'm not able to say more at this time than...

...you have not entered numbers in the correct format.

byte sysexArray[8] = {0xF0, 0x7F, 0x7F, 0x04, 0x04, 0x0, 0x50, 0xF7}; 

works, and more typically by convention

byte sysexArray[8] = {0xf0, 0x7f, 0x7f, 0x04, 0x04, 0x0, 0x50, 0xf7}; 

a7

Thank you

byte sysexArray[8] = {0xF0, 0x7F, 0x7F, 0x04, 0x04, 0x0, 0x50, 0xF7};

Format working successfully.
But what midi messages required for jump to [User Performance] as you see image in my Post #1 ????
Please write any hint,,,

No, please post text.

Post your sketch that now compiles but does not yet do what you want. I know very little about MIDI, so it is probably more a MIDI question, or something specific to your MIDI device(s) rather than a code problem.

But a complete sketch and description of what it deos it shouldn't or does not do it should would help.

a7

this is my sketch where i am testing some midi functions one after one like(note on off/prog change /CC#/sysexclusive/ Bank change.) etc.


#include <MIDI.h>
#include <Keypad.h>                   
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

#define NUMFLAKES     10 // Number of snowflakes in the animation example

const byte ROWS = 15; 
const byte COLS = 10; 
char keys[ROWS][COLS] = {
{1,2,3,4,5,6,7,8,9,10},
{11,12,13,14,15,16,17,18,19,20},
{21,22,23,24,25,26,27,28,29,30},
{31,32,33,34,35,36,37,38,39,40},
{41,42,43,44,45,46,47,48,49,50},
{51,52,53,54,55,56,57,58,59,60},
{61,62,63,64,65,66,67,68,69,70},
{71,72,73,74,75,76,77,78,79,80},
{81,82,83,84,85,86,87,88,89,90},
{91,92,93,94,95,96,97,98,99,100},
{101,102,103,104,105,106,107,108,109,110},
{111,112,113,114,115,116,117,118,119,120},
{121,122,123,124,125,126,127,128,129,130},
{131,132,133,134,135,136,137,138,139,140},
{141,142,143,144,145,146,147,148,149,150}
};
byte rowPins[ROWS] = {4,5,6,7,8,9,10,11,12,14,15,16,17,22,23}; 
byte colPins[COLS] = {32,33,34,35,36,37,38,39,40,41}; 

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
String msg;
MIDI_CREATE_DEFAULT_INSTANCE();
 byte sysexArray[8] = {0xF0,0x7F,0x7F,0x04,0x04,0x00,50,0xF7}; // 0x28

void setup() {

    pinMode(LED_BUILTIN, OUTPUT);
    MIDI.begin(4);

    if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
    Serial.println(F("SSD1306 allocation failed"));
    for(;;); // Don't proceed, loop forever
  }
 display.display();
 display.clearDisplay();

    msg = "";

  
}

void SCN (int gg) {
  display.clearDisplay();
  display.setTextSize(1);             // Normal 1:1 pixel scale
  display.setTextColor(SSD1306_WHITE);        // Draw white text
  display.setCursor(0,0);             // Start at top-left corner
  display.println(gg);
  display.setCursor(50,0);             // Start at top-left corner
  display.println(msg);
  display.setCursor(0,16);             // Start at top-left corner
  display.println(analogRead(A0));
  display.display();
  
}

void loop() {

    if (kpd.getKeys())
    {
        for (int i=0; i<LIST_MAX; i++)   
        {      int mykey = kpd.key[i].kchar;
            if ( kpd.key[i].stateChanged )   
            {
                switch (kpd.key[i].kstate) {  
                    case PRESSED:
                    msg = " PRESSED.";  SCN (mykey);
                break;
                    case HOLD:
                    msg = " HOLD.";
                break;
                    case RELEASED:
                    msg = " RELEASED.";   SCN (mykey);
                break;
                    case IDLE:
                    msg = " IDLE.";
                }
            }
            // ----------------------------------------------------------------------------------------------
                  if (( kpd.key[i].stateChanged ) && (mykey < 31 )) 
            {
                switch (kpd.key[i].kstate) {  
                    case PRESSED:
                        byte sysexArray[8] = {0xF0,0x7F,0x7F,0x04,0x04,0x00,(mykey+40),0xF7};   
                   MIDI.sendSysEx(8, sysexArray, true);  
                break;
                } }
            // ----------------------------------------------------------------------------------------------
                 // ----------------------------------------------------------------------------------------------
                  if (( kpd.key[i].stateChanged ) && (mykey == 31 )) 
            {
                switch (kpd.key[i].kstate) {  
                    case PRESSED:
                        MIDI.sendControlChange(0,85, 1); 
                        MIDI.sendControlChange(0,0, 1); 
                          MIDI.sendProgramChange(52, 1);
                break;
                } }
            // ----------------------------------------------------------------------------------------------
        }
    }   
   
}  // End loop

other functions i have tested. But i could not understand midi command for jump to User Performance as you see below.

 7 Control Change
**If the corresponding Controller number is selected for the Matrix Control 1-4 Source parameter (PATCH EDIT:MTRX CTRL1-
4:Control 1-4 Source), the corresponding effect will occur.
**If a Controller number that corresponds to the System Control 1-4 Source parameter (SYSTEM:CONTROL:Sys Ctrl 1-4 Source)
is selected, the specified effect will apply if the Matrix Control 1-4 Source parameter (PATCH EDIT:MTRX CTRL1-4:Control
1-4 Source) is set to SYS CTRL1, SYS CTRL2, SYS CTRL3 or SYS CTRL4.
6 Bank Select (Controller number 0, 32)
Status 2nd byte 3rd byte
BnH 00H mmH
BnH 20H llH
n = MIDI channel number: 0H - FH (ch.1 - 16)
mm, ll = Bank number: 00 00H - 7F 7FH (bank.1 - bank.16384)
**Not received in Performance mode when the Receive Bank Select parameter (PERFORM EDIT:MIDI:BS or PART EDIT:MIDI:BS) is
OFF.
The Performances, Patterns, Patches and Drum Kits corresponding to each Bank Select are as follows.
BANK SELECT           |              PROGRAM             |       GROUP        |     NUMBER
MSB      |     LSB    |                NUMBER            |                    |
---------+------------+----------------------------------+----------------------+-------------
000       |           |          001 - 128               |     GM Patch       | 0001 - 0256
 :        |           |                                  |                    |
063       |           |          001 - 128               | GM Patch           | 0001 - 0256
085       |   000     |          001 - 128               | User Performance   | 001 - 128
          |   001     |          001 - 128               | User Pattern       | 001 - 128
          |   064     |          001 - 029               | Preset Performance | 001 - 029
          |   065     |          001 - 011               | Preset Pattern     | 001 - 011
086       |   000     |          001 - 008               | User Drum          | R501 - R508
          |   064     |           001 - 035              | Preset Drum        | 0001 - 0035
087       |  000      |           001 - 128               | User Patch         | 0501 - 0628
          |   001     |            001 - 128             | User Patch         | 0629 - 0756

please write what midi msg for User Performance????

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