Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: MIDI SYSEX buffer to small (USB-MIDI)

  1. #1
    Senior Member
    Join Date
    May 2018
    Posts
    108

    MIDI SYSEX buffer too small (USB-MIDI)

    Hi!

    I am writing some MIDI SYSEX code for https://www.parasitstudio.de/projects/microdexed/ and tried to implement a MIDI bank upload. Such a DX7 bank consists of 32 voices and together a SYSEX dump is 4104 bytes.

    I found that there are two places where the current USB-MIDI implementations have hard coded limits at 290 bytes:

    Code:
    .../arduino-teensy-1.8.12/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h
    .../arduino-teensy-1.8.12/hardware/teensy/avr/cores/teensy3/usb_midi.h
    So I decided to make the buffer larger (from 290 bytes to 4104 bytes):

    Code:
    sed -i.orig 's/SYSEX_MAX_LEN = 290/SYSEX_MAX_LEN = 4104/' /usr/local/arduino-teensy-1.8.12/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h
    sed -i.orig 's/^#define USB_MIDI_SYSEX_MAX 290/#define USB_MIDI_SYSEX_MAX 4104/' /usr/local/arduino-teensy-1.8.12/hardware/teensy/avr/cores/teensy3/usb_midi.h
    I think I found the right place, but there must be another limitation:
    If sending a complete bank (with https://github.com/gbevin/SendMIDI, e.g. 'sendmidi dev "MicroDexed MIDI" syx syf addon/SD/90/RitCh1.syx') the registered function for 'usbMIDI.setHandleSystemExclusive();' does only report 4097 bytes as received length - and not 4104 bytes.

    Has anyone an idea where the problem may be located?

    BTW: single voice updates with about 150 bytes are working!

    Thanks, Holger
    Last edited by C0d3man; 05-26-2020 at 02:18 PM.

  2. #2
    Senior Member
    Join Date
    May 2018
    Posts
    108

    [solved]

    Quote Originally Posted by C0d3man View Post
    Hi!

    I am writing some MIDI SYSEX code for https://www.parasitstudio.de/projects/microdexed/ and tried to implement a MIDI bank upload. Such a DX7 bank consists of 32 voices and together a SYSEX dump is 4104 bytes.

    I found that there are two places where the current USB-MIDI implementations have hard coded limits at 290 bytes:

    Code:
    .../arduino-teensy-1.8.12/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h
    .../arduino-teensy-1.8.12/hardware/teensy/avr/cores/teensy3/usb_midi.h
    So I decided to make the buffer larger (from 290 bytes to 4104 bytes):

    Code:
    sed -i.orig 's/SYSEX_MAX_LEN = 290/SYSEX_MAX_LEN = 4104/' /usr/local/arduino-teensy-1.8.12/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h
    sed -i.orig 's/^#define USB_MIDI_SYSEX_MAX 290/#define USB_MIDI_SYSEX_MAX 4104/' /usr/local/arduino-teensy-1.8.12/hardware/teensy/avr/cores/teensy3/usb_midi.h
    I think I found the right place, but there must be another limitation:
    If sending a complete bank (with https://github.com/gbevin/SendMIDI, e.g. 'sendmidi dev "MicroDexed MIDI" syx syf addon/SD/90/RitCh1.syx') the registered function for 'usbMIDI.setHandleSystemExclusive();' does only report 4097 bytes as received length - and not 4104 bytes.

    Has anyone an idea where the problem may be located?

    BTW: single voice updates with about 150 bytes are working!

    Thanks, Holger
    Ok, I solved my problem: The changed buffer sizes seemed to be ok, but I used the wrong program for uploading the data. If I use

    Code:
    amidi -p hw:2,0,0 -s addon/SD/90/RitCh1.syx
    it seems to work.

    Regards, Holger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •