-
Notifications
You must be signed in to change notification settings - Fork 27
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
Kawai K5000 #433
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. |
…ist of bank descriptors.
Makes sense, only saw crash if K5000 not switched on (I think) |
Is the code understandable? Also did you see my question in #433 (comment)? |
…xed. consistent usage of bankdescriptors
New code committed |
Code looks pretty good, except I didn't dig into the big big function yet. The rest is clear. I added a program test data generator so you get better test coverage, and they all pass, which is good. calculateFingerprint is still missing for proper deduplication. |
did you add to the k5000 branch?? Can only see it in main, which has the old code |
Bank management and sending from kk to synth currently NOT working