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

WTSE overview class refactor #7755

Merged
merged 3 commits into from
Aug 14, 2024
Merged

Conversation

nuoun
Copy link
Contributor

@nuoun nuoun commented Aug 14, 2024

  • Changes WTSE overview class constructor to use similar style as FormulaModulatorEditor
  • Renames WavetableEquationEditor class to WavetableScriptEditor
  • Renames defaultWavetableFormula string to defaultWavetableScript
  • Adds preliminary Prelude to WTSE
  • Adds changes to WTSE UI
  • Adds WavetableScriptEditState struct to DAWExtraStateStorage and SurgePatch load_xml()/save_xml()
  • Increments XML file version to v25

nuoun added 2 commits August 14, 2024 05:04
- Changes WTSE overview class constructor to use similar style as FormulaModulatorEditor
- Renames WavetableEquationEditor class to WavetableScriptEditor
- Renames defaultWavetableFormula string to defaultWavetableScript
- Adds preliminary Prelude to WTSE
- Adds changes to WTSE UI
- Adds WavetableScriptEditState struct to DAWExtraStateStorage and SurgePatch load_xml()/save_xml()
- Increments XML file version to v25
@nuoun
Copy link
Contributor Author

nuoun commented Aug 14, 2024

Big PR with changes to SurgePatch that could use a thorough review when you can find the time, no rush so please take your time.

Copy link
Collaborator

@baconpaul baconpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great. Really just some minor cosmetic changes

I think we should also create an issue with a checklist for what we want to do to get to minimal viable WTSE. I added a few items here which would go on that list.

But I'm definitely happy to merge this

@@ -921,6 +922,11 @@ struct DAWExtraStateStorage
bool hasCustomEditor = false;
} oscExtraEditState[n_scenes][n_lfos];

struct WavetableScriptEditState
{
int codeOrPrelude{0};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a comment here briefly about what 'codeOrPrelude' means would be useful?

{
enum tags
{
tag_select_tab = 0x597500,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to use a different value here than other control areas just in case. Like just choose some other random starting number. In case messages do cross (which they should not)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did change this after I copied parts of the Formula overview classes and made sure 0x597500 is a unique value.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha sorry i should have checked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, I'm just glad I did it right :)

void onSkinChanged() override { rebuild(); }

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(WavetableScriptControlArea);
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't read this all that carefully but I am assuming it is ok since it looks copied from other similar with appropriate changes. But we should add an item to your work list before we ship 1.4 to do an accessibility check here (which I can help with).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add this to the WTSE issue.

return std::nullopt;
}

/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to leave this commented out code around is there? We have git history if we need it.


struct WavetableEquationEditor : public CodeEditorContainerWithApply,
/*
struct WavetableScriptEditor : public CodeEditorContainerWithApply,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same on commented out code here


bool shouldRepaintOnParamChange(const SurgePatch &patch, Parameter *p) override
{
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now but we should add an item to a list which is like "what happens if the wt editor is torn out and you change oscillator from wavetable to twist" or some such. We should make that a conscious decision at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a little test and I think this works fine, changing oscillator type does not affect the torn out window and the WT generation still works, ie. the generated wavetable is ready to go after switching back to the WT oscillator.

@nuoun
Copy link
Contributor Author

nuoun commented Aug 14, 2024

Good to hear, I think the old WTSE issue is still open so we can add start referring to that issue and I shall create a little roadmap / list of issues there.

And this last commit should take care of the unused code and add a description for the struct in SurgeStorage.

@baconpaul
Copy link
Collaborator

Super exciting! Merging!

@baconpaul baconpaul merged commit 8b615f4 into surge-synthesizer:main Aug 14, 2024
10 checks passed
@nuoun nuoun deleted the wtse-refactor branch August 14, 2024 14:29
@nuoun nuoun mentioned this pull request Aug 19, 2024
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.

2 participants