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

Bit Invader - Corrupt data when saving with connected controller #5799

Closed
zonkmachine opened this issue Nov 21, 2020 · 3 comments · Fixed by #5805
Closed

Bit Invader - Corrupt data when saving with connected controller #5799

zonkmachine opened this issue Nov 21, 2020 · 3 comments · Fixed by #5805
Assignees
Labels
Milestone

Comments

@zonkmachine
Copy link
Member

zonkmachine commented Nov 21, 2020

The Bit Invader wave gets corrupted on saving with a controller connected to the 'Length' knob.
Probably same issue as first noted here: #4705 (comment)
Comment from @PhysSong in #4705

I dumped the saved data. For some reason the decoded data contain Base64 data. I think the data were corrupted while converting to Base64 but not sure why.

The Bit Invader has also produces bad data (nan/inf). Unsure if that is directly connected to this issue.

Steps to reproduce

  • Add a Bit Invader and an LFO Controller.
  • Connect the Length knob to the controller.
  • Save and Reload multiple times and watch the graph of the Bit Invader get more and more destroyed in steps.

It also looks like this is related to when in the controller cycle you do a save. If the Length knob is at it's minimum you get the issue. If it's at it's maximum then I haven't seen any issues.

Screenshot

Created on lmms-1.2.1

  1. Original correct 2. One save/load (similar to issue described in Support various behaviors when increasing sample length after drawing a waveform in BitInvader #3797) 3. wave partly zeroed. 4. partly zeroed with extra glitches.
    bitinvader

Affected LMMS versions

Shown on lmms-1.2 and master (87875a1).

@zonkmachine zonkmachine changed the title Bit Invader - Corrupted data when saving with connected controller Bit Invader - Corrupt data when saving with connected controller Nov 21, 2020
@zonkmachine
Copy link
Member Author

Added to the description that it also looks like this is related to when in the controller cycle you do a save. If the Length knob is at it's minimum you get the issue. If it's at it's maximum then I haven't seen any issues so far.

@zonkmachine
Copy link
Member Author

BitInvader is created with a default sinewave, length 200, then whatever saved waveform is loaded and writes over the default one. If the saved wavefile is less than 200 samples long there will be a trailing part of the sine left in there. This is seen in graph 2-4 in the issue description. A quick fix for this could be to not load a default sinewave or the rest of the sample shape be written as 0 on load.

m_graph.setWaveToSine();

The other glitches seem to be fixed by changing:

m_graph.length() * sizeof(float), sampleString );

to:

200 * sizeof(float), sampleString );

The hard coded wave length should then probably be defined somewhere instead.

I've tested this (in the first case by not loading a sinewave) briefly and it seem to work well.

@zonkmachine
Copy link
Member Author

or the rest of the sample shape be written as 0 on load.

I went with this one. I think all the issues here is fixed by #5805

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

Successfully merging a pull request may close this issue.

1 participant