christofmuc / KnobKraft-orm

The KnobKraft Orm - The free modern cross-platform MIDI Sysex Librarian
GNU Affero General Public License v3.0
205 stars 27 forks source link

Bank dump capability relies on createBankDumpRequest() #232

Closed bboc closed 1 year ago

bboc commented 1 year ago

The Modor NF-1 is a device that does not support a bank dump requests, but is still able to transmit and receive bank dumps.

It seems that KnobKraft can only import bank dump data from sysex files when the back dump capability is recognized, which in turn requires createBankDumpRequest() to be present. Now when I add that function with some dummy message, I can import bank dump files, but then KnobKraft can't seem to import banks via anymore, because the device won't respond to the fake bank dump message.

I suggest adding a second capability "bank dump import", which only relies on isPartOfBankDump(), isBankDumpFinished() and extractPatchesFromBank().

So if createBankDumpRequest() is missing, it would still import banks via program dumps.

Andy2No commented 1 year ago

@bboc What happens if you tell Orm to import a bank from the synth, then start a bank transfer manually? Does it send anything to identify it as a bank, or just send a series of patch dumps?

It isn't essential to treat a bank as a bank, if it just sends a series of separate patches when asked to dump a bank. A lot of synths work that way - you can just use "Import patches from synth". The Orm should then let you choose one or more banks to request, but sends individual patch dump requests, waiting indefinitely for the synth to respond to each one - maybe only if you don't have bank dump/request set up in Orm. If the synth sends individual patch dumps when you tell it to send a bank, that should work.

For loading / saving to disk, I've imported banks successfully for synths like the Dave Smith/Sequential ones and the DeepMind, because they just use a concatenation of individual patches in a bank dump file - i.e. no special format. Exporting them as individual sysex files works better than exporting them as a whole bank, IMO, because it's more convenient to me to have individual patches saved separately, and no trouble to import multiple patches.

If the synth has a special format for banks, I guess you don't have that option.

I have a Modor NF-1m so I can help beta test your adaptation if you want.

bboc commented 1 year ago

@Andy2No the NF-1m does not take requests for sending a bank, but you can trigger a bank dump manually through the UI of the device, and you can also send bank dumps back to it.

Orm behaves like this:

I don't care much for storing individual program dumps, especially not when I have a librarian software. But I want to be able to download bank dumps from the internet, and import them straight from file into the librarian, instead of using some other software to get them into the synth, before the librarian app can import it.

Thanks for your offer, I did some refactoring on my Modor adaptation yesterday, I need to make some some basic smoke tests with the device, then I'll send it over to you so you can test it.

christofmuc commented 1 year ago

@bboc Understood, that should be a simple change, basically splitting the bankdumpcapability into a bankdumprequestcapability and a bankdumpimportcapablity. I'll see if I can get this done.

markusschloesser commented 1 year ago

maybe stupid question, but while working on my MKS70 adaptation, I found a discrepancy in extisting files and documetation with regards to extractPatchesFromBank. Sometimes it's def extractPatchesFromBank(messages)
and sometimes def extractPatchesFromBank(message)
(message vs messages ) , which one is it?

christofmuc commented 1 year ago

@markusschloesser Oh, in the current implementation it is still only a single MIDI message, that is "messages" is a mistake. I need to see how that slipped in!

markusschloesser commented 1 year ago

@markusschloesser Oh, in the current implementation it is still only a single MIDI message, that is "messages" is a mistake. I need to see how that slipped in!

is that also true (message), if synth sends back a series of patches? I am currently trying to do a Waldorf Pulse adaptation and it has

  1. single_program_request and sends 1 ONE patch, or
  2. Program_Bulk_Dump_Request where it sends multiple patches but with a different sysex than in case 1, whereas the payload is the same
christofmuc commented 1 year ago

yes, you can do a bulk dump request, return True on isPartOfBulkDump() and then extractPatchesFromBank gets called once per message you replied True to. That can return multiple patches, but if it is just one patch per bank dump message then it should be easy. I realize this is somewhat inconsistent with how isPartOfEditBufferDump() works though, maybe at some point we need to harmonize this.

christofmuc commented 1 year ago

This is fixed with today's 2.0.3 release.

Also, there is a new function for extractPatchesFromAllBankMessages(), which is addressing @markusschloesser 's message vs messages question. The new function uses messages like the isBankDumpFinished() method.