-
Notifications
You must be signed in to change notification settings - Fork 30
Kawai K5000 #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Kawai K5000 #433
Conversation
(cherry picked from commit fa51671)
I need to drop for today, but my main suggestion is that we add a proper make_test_data function here and enable you to run and debug it - this is how I approach harder problems where there might be some bugs lurking. Running this from the Orm itself is much harder to figure out what is going on. I first get the module as a standalone to pass the test before I first try it in the Orm! |
I have added and pushed the test function, you might want to revisit the adaptation testing guide for this (long time I have looked at it). When I run the test (it is only one for now), I get this error:
This should be debuggable. You would need to create a run configuration in Pycharm for pytest, and use these parameters: |
Don't forget to pull my changes, and I'm off to bed now! |
will do! me too :-) |
also commited and pushed one single sound sysex to testdata |
also you probably guessed it already, but ✅ signals function working, ❌ function not working |
Channel/Sysex ID is confusing admittedly, but the main point here is to not put in None, but a 0. I made a comment on the code in line 367 where you use the channel's default value None. I think this should be 0 (which could be interpreted as sysex ID 1 or Midi channel 1 or whatever= |
ok, this fixes that one specific error, now we "just" need to fix the offset calculation 😂
|
…tter (old code was plain wrong) but now throws errors when hitting namefromdump
New code better, but still fails. |
You can see what is going on and what the expectations are by looking at test_adaptations.py, lines 401+ Each patch returned by extractPatchesFromAllBankMessages() has to be accepted by either isSingleProgramDump() or isEditBufferDump(), defined by a flag in the TestData() message returned by make_test_data(). single program dump is default. So the expectation is that the bank loader produces something that is accepted by isSingleProgramDump(). |
…s why subsequent one fail
adaptations/KawaiK5000.py
Outdated
bank_byte = bank_byte_map[bank_number] | ||
|
||
# Reconstruct SysEx message with updated bank and program number | ||
return message[:7] + [bank_byte, patch_number] + message[8:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks bogus - you split the message into 7 bytes at the front, and everything starting with byte 8 in the end. I'd think the message is one byte longer after this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks bogus - you split the message into 7 bytes at the front, and everything starting with byte 8 in the end. I'd think the message is one byte longer after this?
true, will look at it later in detail.
But do we actually need the function for this adaptation? synth has no edit buffer and extractbank stuff now does its own reconstruction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also you did see my commits from today?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saw them, but didn't check them yet. Probably Saturday!
The convertToProgramDump() is required for the bank functionality, so yes, this needs to be implemented. Should be possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saw them, but didn't check them yet. Probably Saturday!
👍
The convertToProgramDump() is required for the bank functionality, so yes, this needs to be implemented. Should be possible?
why? or where is the sysex header reconstruction supposed to be happening? right now I'm doing formatted_patch = [ 0xF0, KawaiSysexID, 0x00, OneBlockDump, 0x00, 0x0A, 0x00, bank_byte, patch_number, checksum ] + list(current_patch) + [0xF7]
at the end of extractPatchesFromAllBankMessages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit from today fixes this (confirmed successful write by synth)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convertToProgramDump() is called when pressing the patch button - as we cannot send to edit buffer when edit buffer is not implemented, the system falls back to patch the last program of the first bank into the program dump and send that to the synth.
So the function ought to inject the correct program position and potentially correct sysex ID/MIDI channel into the patch data before it is sent out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most adaptations now choose to store either edit buffers or program buffers in the database, and convert them on sending into the appropriate format. So extactPachesFromBank is good to create full program buffers, the convert... function really only alters the program place then.
… offsets also wrong
new code committed, though still not working 🙄 |
@christofmuc don't check anything for extractPatchesFromBank, got lots of new (uncommitted) code for that. Should be done later this weekend |
…rent banks. Still lots of debug print in there. And kk crashes when clicking on a patch
Check push from last night 😁 |
Perseverance! KnobKraft would crash if you return an empty bank descriptor array - it tries to calculate the program position for sending the patch into, the last number of the first bank, but if there are no banks, it'll crash right now. Can fix that, but that's for me because it did not detect a K5000 and didn't know the submodel. |
did you add to the k5000 branch?? Can only see it in main, which has the old code |
I did, this is the commit from me: 727a623 Did you update? |
# Conflicts: # adaptations/KawaiK5000.py
must have been a glitch in pycharm, now new and merged code pushed |
2 Problems:
When I click on Bank E, it actually gets Bank D but fails with the foreign key error. |
oh and could you please check if I implemented the fingerprinting correctly?
|
The assumption is that the fingerprint stays the same after renaming, so fingerprinting should blank out the name before hashing, or not included the name bytes at all. Rename is tested separately and seems to work. |
Imho that's a bug in kk (different treatment of bank ID)? |
Bank ID has to be 0, 1, 2, 3 for the C++ software, you can't have holes in there. KK will always call the first bank 0 and the second 1 - so the internal value is not the value that you would put into the request message. Currently, because there is either bank B or bank DEF, you will get "bank 1" when it wants to request bank D. |
I was under the impression that bank descriptors are specifically for describing the banks of the synths and not internal kk banks? Also I don't understand the discrepancy between tree bank getting and menu bank getting. |
Thank you! Then I don't understand what I am doing wrong. I blank sysex header, the name and the checksum of the patch (because Imho renaming changes that) |
…tually do not want the name to be part of the data that is submitted to the md5 function, because if you do, the md5 changes when the name changes
# Conflicts: # MidiKraft
…ading the given sysex file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's exactly what I was trying to do ;-)
…r works correctly. It seems to work, because it produces 40 single programs.
@markusschloesser Just FYI: I built a 2.6.2 which tries to fix the retry problem. Interested to hear if it works! |
with 2.6.2. and your changes I get
|
# Conflicts: # MidiKraft # adaptations/test_adaptations.py
Yes, when you use the release it will not use the changed file adaptations/testing/test_data.py, which we need for the K5000, but the one it was shipped with the installer. You'd need to copy the file from the checked out merge request into the directory where you installed the Orm. Not sure how you did the setup before? |
that worked! |
but doesn't solve the retry problem, in fact made it worse. bank request doesn't get send/nothings happening in midi log, unless I cancel the request, then gets send 3 times |
Bank management and sending from kk to synth currently NOT working