Skip to content
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

Patches showing wrong bank #343

Open
milnak opened this issue Oct 7, 2024 · 4 comments
Open

Patches showing wrong bank #343

milnak opened this issue Oct 7, 2024 · 4 comments
Labels
bug Something isn't working Ready for release Will be part of the next release

Comments

@milnak
Copy link
Contributor

milnak commented Oct 7, 2024

This is my new adaptation, so maybe I'm doing something wrong?

I have 20 banks * 8 patches:

def bankDescriptors() -> list[Dict]:
    return [
        {
            "bank": x,
            "name": f"Bank {x + 1}",
            "size": 8,
            "type": "Patch",
            "isROM": False,
        }
        for x in range(20)
    ]

when I click on one of the "in synth" banks, e.g. "bank 20", I see friendlyProgramName called for program 152->159.
"Synth Bank" window shows "20-1", "20-2" (good), but center window shows "1-1", "1-2" ...

Is that expected? I also notice that if I do: MIDI > Import Patches > Import All, the center window has "1-1", "1-2", ... "1-8", "1-1", "1-2", ...

I see def friendlyProgramName(program): only getting program numbers from 0-7. Shouldn't the program number be set up to 159 (in my case) here?

@christofmuc
Copy link
Owner

Out of the top of my head, I think this is expected. The Python code assums all patches are enumerated sequentially across all banks, and the bank number and patch number are extracted from the combined total.

So patches 0-7 are Bank 1, patches 8-16 are Bank 2, etc.

If you see the center window not showing the bank, it got dropped somewhere. Checkout the properties of a patch, it additionally shows the location at import time. What does it say?

Did you implement numberFromDump()? That should also return the full bank * 8 + program. Sometimes, the bank can no longer be extracted from the patch because only the program number is stored, then the displayed value falls bank to bank 0.

@milnak
Copy link
Contributor Author

milnak commented Oct 7, 2024

Yes, I implemented numberFromDump.

I imported bank 10.
Center window shows:

[1-1 Classic Gt] [1-2 Steel Gt] .... [1-8 Slap Bass]

Properties shows:

Type: Patch
Import: Imported from synth Bank 10 on ...
Program: 1-1
In synth at: no place known

does that help?

@milnak
Copy link
Contributor Author

milnak commented Oct 8, 2024

I changed

def bankDescriptors() -> list[Dict]:
    return [
        {
            "bank": x,
            "name": f"Bank {x + 1}",
            "size": 8,
            "type": "Patch",
            "isROM": False,
        }
        for x in range(20)
    ]

to

def bankDescriptors() -> list[Dict]:
    return [
        {
            "bank": 0,
            "name": f"Patches",
            "size": 20 * 8,
            "type": "Patch",
            "isROM": False,
        }
    ]

and the bank numbers all show properly, so I'm guessing you might have a bug somewhere. Have you tested a case where bankDescriptor returns 20 banks?

@christofmuc christofmuc added the bug Something isn't working label Oct 8, 2024
christofmuc added a commit that referenced this issue Nov 2, 2024
…r, all patches were listed as 0 instead of the system resorting to counting the edit buffers.
@christofmuc
Copy link
Owner

I think I might have at least one fix for this, there were several problems with bank numbers when not being known defaulting to 0 and not NULL in the database, causing numbers to jump back to 0. I have some code in PR #361 , but this really needs a bit more testing before release. Thanks again for reporting!

@christofmuc christofmuc added the Ready for release Will be part of the next release label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Ready for release Will be part of the next release
Projects
None yet
Development

No branches or pull requests

2 participants