Skip to content

Save SRAM on exit#46

Open
NicknineTheEagle wants to merge 1 commit into
nukeykt:masterfrom
NicknineTheEagle:nn/sram
Open

Save SRAM on exit#46
NicknineTheEagle wants to merge 1 commit into
nukeykt:masterfrom
NicknineTheEagle:nn/sram

Conversation

@NicknineTheEagle

@NicknineTheEagle NicknineTheEagle commented Apr 17, 2024

Copy link
Copy Markdown

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
Copy Markdown
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

NicknineTheEagle commented Apr 17, 2024

Copy link
Copy Markdown
Author

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

Falcosoft commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Falcosoft commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Author

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

@nukeykt

nukeykt commented Apr 17, 2024

Copy link
Copy Markdown
Owner

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
Copy Markdown
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.

@NicknineTheEagle NicknineTheEagle force-pushed the nn/sram branch 2 times, most recently from f4ea1cb to d473c20 Compare April 19, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Save SRAM [Suggestion] Attempt to “emulate” installed battery by saving and loading on exit and load, if possible

3 participants