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

Save SRAM on exit #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NicknineTheEagle
Copy link

@NicknineTheEagle NicknineTheEagle commented Apr 17, 2024

This saves the contents of SRAM into a file on exit and loads them on startup to emulate the real module's behavior where SRAM is preserved during power down using a battery.

...granted, I don't know much about how the real SC-55 module works, I just made an educated guess and this code does seem to result in correct behavior. This also avoids the annoying bug carried over from real hardware where the module becomes out of tune if powered up with no battery until you reset it.

Fixes #23, fixes #45.

@Falcosoft
Copy link
Contributor

Hi,
#6 still remains relevant even after this patch.
With saving at exit and loading SRAM at startup you will not get a clean default state like after a proper reset.
Instead you will get an arbitrary state defined by the last used Midi track/game.

@NicknineTheEagle
Copy link
Author

NicknineTheEagle commented Apr 17, 2024

Hi, #6 still remains relevant even after this patch. With saving at exit and loading SRAM at startup you will not get a clean default state like after a proper reset. Instead you will get an arbitrary state defined by the last used Midi track/game.

#6 specifically references the pitch bug which is resolved by this PR:

If the reset bug isn't able to be fixed or will take a while

Auto-reset was proposed as a workaround. As such, I reasoned that the issue is not relevant in that particular scope anymore.

@Falcosoft
Copy link
Contributor

Falcosoft commented Apr 17, 2024

This way if the last used Midi used custom tuning you can get the same "out of tune" effect at startup.
At the middle/end of #45
there are a few proposal how to solve this problem (e.g. by always loading a clean saved state).
There should be at least an option for this.

@NicknineTheEagle
Copy link
Author

This way if the last used Midi used custom tuning you can get the same "out of tune" effect at startup.

That wouldn't be a bug anymore, no? That's how the module is intended to work, whatever settings you make persist until a reset command is issued.

@Falcosoft
Copy link
Contributor

Falcosoft commented Apr 17, 2024

The current behavior is not a "bug" either in this sense. It perfectly emulates a unit without battery.
But in practice this perfectly emulated behavior is not too desirable.
I'm arguing that something similar is also true for this patch. None of the software synths (even Munt that is also a close to the hardware emulator) preserves the last state but always starts in a clean default state.

@NicknineTheEagle
Copy link
Author

Right, I suppose auto-reset is a useful option to have.

@nukeykt
Copy link
Owner

nukeykt commented Apr 17, 2024

I will add configurable behavior once config file support is added, default will be saving and loading data from/to SRAM as real unit with battery will do. Also keep in mind that only SC-55mk1/mk2 have battery, CM-300 and 55st don't have one

@NicknineTheEagle
Copy link
Author

Also keep in mind that only SC-55mk1/mk2 have battery, CM-300 and 55st don't have one

Ah, I need to add a check for that then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants