MiniDexed icon indicating copy to clipboard operation
MiniDexed copied to clipboard

Sending cartridges over MIDI to MiniDexed fails

Open probonopd opened this issue 7 months ago • 5 comments

Sending cartridges over MIDI to MiniDexed fails, e.g., using https://bladesk.github.io/DX7II-Librarian/ "Send via MIDI DX7 voices".

We get

00:55:50.987 >1 - 192.168.0.59 mididevice - - - MIDI-SYSEX: channel: 0, len: 255, TG: 0
00:55:50.989 >1 - 192.168.0.59 mididevice - - - SYSEX handler return value: -1
00:55:50.989 >1 - 192.168.0.59 mididevice - - - SysEx end status byte not detected.
00:55:50.989 >1 - 192.168.0.59 mididevice - - - MIDI-SYSEX: channel: 0, len: 255, TG: 1
00:55:50.989 >1 - 192.168.0.59 mididevice - - - SYSEX handler return value: -1
00:55:50.990 >1 - 192.168.0.59 mididevice - - - SysEx end status byte not detected.
00:55:50.991 >1 - 192.168.0.59 mididevice - - - MIDI-SYSEX: channel: 0, len: 255, TG: 2
00:55:50.991 >1 - 192.168.0.59 mididevice - - - SYSEX handler return value: -1
00:55:50.991 >1 - 192.168.0.59 mididevice - - - SysEx end status byte not detected.
00:55:50.991 >1 - 192.168.0.59 mididevice - - - MIDI-SYSEX: channel: 0, len: 255, TG: 3
00:55:50.991 >1 - 192.168.0.59 mididevice - - - SYSEX handler return value: -1
00:55:50.991 >1 - 192.168.0.59 mididevice - - - SysEx end status byte not detected.
00:55:50.991 >1 - 192.168.0.59 mididevice - - - MIDI-SYSEX: channel: 0, len: 255, TG: 4
00:55:50.992 >1 - 192.168.0.59 mididevice - - - SYSEX handler return value: -1
00:55:50.992 >1 - 192.168.0.59 mididevice - - - SysEx end status byte not detected.
00:55:50.992 >1 - 192.168.0.59 mididevice - - - MIDI-SYSEX: channel: 0, len: 255, TG: 5
00:55:50.992 >1 - 192.168.0.59 mididevice - - - SYSEX handler return value: -1
00:55:50.992 >1 - 192.168.0.59 mididevice - - - SysEx end status byte not detected.

(Gosh, that syslog via network is awesome - no more taking pictures of HDMI screens!)

probonopd avatar Apr 22 '25 23:04 probonopd

Looking at

https://codeberg.org/dcoredump/Synth_Dexed/src/commit/d2e73d3ab9e958989342032ac7781d198183efb0/src/dexed.cpp#L975-L977

int16_t Dexed::checkSystemExclusive(const uint8_t* sysex, const uint16_t len)
/*
        -1:     SysEx end status byte not detected.
        -2:     SysEx vendor not Yamaha.
        -3:     Unknown SysEx parameter change.
        -4:     Unknown SysEx voice or function.
        -5:     Not a SysEx voice bulk upload.
        -6:     Wrong length for SysEx voice bulk upload (not 155).
        -7:     Checksum error for one voice.
        -8:     Not a SysEx bank bulk upload.
        -9:     Wrong length for SysEx bank bulk upload (not 4096).
        -10:    Checksum error for bank.
        -11:    Unknown SysEx message.
	64-77:	Function parameter changed.
	100:	Voice loaded.
	200:	Bank loaded.
	300-455:	Voice parameter changed.
*/
{
  int32_t bulk_checksum_calc = 0;
  const int8_t bulk_checksum = sysex[161];

  // Check for SYSEX end byte
  if (sysex[len - 1] != 0xf7)
    return(-1);

this seems to suggest that we don't feed the entire sysex in, and/or give it a wrong len?

Curiously, in the log it says len: 255 whereas a SysEx bank bulk upload is expected to have 4096.

probonopd avatar Apr 22 '25 23:04 probonopd

MiniDexed accepts just VCED (one voice) dumps. VMEM (32-voice) dumps aren't processed in any way. There was a discussion with @dcoredump about this long time ago. There is no clear way of doing it like on a real DX7. One way of doing this is to write the dump directly to voice directory, and ask the user for a file name after the dump finishes.

BobanSpasic avatar Apr 29 '25 17:04 BobanSpasic

VMEM (32-voice) dumps aren't processed in any way.

Yes, that's the "bug" ;-)

probonopd avatar Apr 29 '25 17:04 probonopd

The problem is that a bulk upload (VMEM) has to be stored somewhere and this is definitely not a task of the engine. The engine can “read in” a single voice (VCED), but what should the engine do with a bulk? It would have to be able to write to an SD or similar, and IMHO this is not the engine's job, so the problem has to be solved externally.

In MicroDexed it is also solved in such a way that the handling of bulk uploads is then (Teensy-specific) written to an SD.

dcoredump avatar May 01 '25 08:05 dcoredump

Thinking about it... you definitely have a point :-)

The behavior I intend for MiniDexed is that the bank that is currently selected for the TG(s) that listens on the MIDI channel gets overwritten (in RAM; MiniDexed doesn't write .syx files back anyhow yet).

So maybe this should be handled entirely outside of Synth_Dexed, would you agree?

probonopd avatar May 01 '25 08:05 probonopd