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

Feature/midi map #145

Merged
merged 25 commits into from
Jun 23, 2024
Merged

Feature/midi map #145

merged 25 commits into from
Jun 23, 2024

Conversation

x37v
Copy link
Contributor

@x37v x37v commented Jun 21, 2024

No description provided.

@x37v x37v requested a review from fde31 June 21, 2024 19:48
Copy link
Member

@fde31 fde31 left a comment

Choose a reason for hiding this comment

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

left a few inline comments. Additionally I noticed that the naming is a tad inconsistent as it uses at times midi and user times MIDI, should we just stick to the latter?

From a general UX perspective I'd be happy to tweak things a bit as I think it could be a more more obvious once one is in active "MIDIMapping" mode. Also I suspect we'd ideally like to disable changing parameter values from the UI when selecting a param to map and just maintain a "selection" state?

Another q would be - should we auto disable MIDI mapping when the user switches views / tabs or at least prevent direct navigation with a confirm dialogue?

src/actions/instances.ts Outdated Show resolved Hide resolved
src/actions/instances.ts Outdated Show resolved Hide resolved
src/actions/instances.ts Outdated Show resolved Hide resolved
src/models/instance.ts Outdated Show resolved Hide resolved
src/models/parameter.ts Outdated Show resolved Hide resolved
src/actions/instances.ts Show resolved Hide resolved
src/actions/instances.ts Outdated Show resolved Hide resolved
@x37v
Copy link
Contributor Author

x37v commented Jun 22, 2024

From a general UX perspective I'd be happy to tweak things a bit as I think it could be a more more obvious once one is in active "MIDIMapping" mode. Also I suspect we'd ideally like to disable changing parameter values from the UI when selecting a param to map and just maintain a "selection" state?

ahh yeah, that is a good idea!

Another q would be - should we auto disable MIDI mapping when the user switches views / tabs or at least prevent direct navigation with a confirm dialogue?

Yes, I was actually gonna ask about that, I briefly looked into it but then maybe i lost track

@fde31
Copy link
Member

fde31 commented Jun 22, 2024

From a general UX perspective I'd be happy to tweak things a bit as I think it could be a more more obvious once one is in active "MIDIMapping" mode. Also I suspect we'd ideally like to disable changing parameter values from the UI when selecting a param to map and just maintain a "selection" state?

ahh yeah, that is a good idea!

I can just clean that up as part of polishing the UI a bit. Was thinking we could just follow the Max color scheme a bit here to rely on something already existing.

Once u took a look at the suggestions just throw it my way and I can take a pass.

@x37v x37v requested a review from fde31 June 22, 2024 14:25
@x37v
Copy link
Contributor Author

x37v commented Jun 22, 2024

the Midi vs MIDI thing exists elsewhere too, I figure maybe we can do a cleanup pass after?

@fde31 fde31 force-pushed the feature/midi-map branch from 8f8c0fa to 58ba515 Compare June 23, 2024 09:30
@@ -315,7 +315,7 @@ export const clearParameterMidiMappingOnRemote = (id: InstanceStateRecord["id"],
if (!param) return;

const meta = param.getParsedMeta();
if (typeof meta === "object") {
if (typeof meta === "object" && !Array.isArray(meta)) {
Copy link
Member

Choose a reason for hiding this comment

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

fixes the TS build error as typeof [] is also an array. I guess the issue here is that AnyJSON means it could be any kind of value. I wonder if really what we want to ensure is that meta is a Record<string, AnyJSON> throughout and if not fall back to {}. Maybe even the Meta Editor should not allow any non JsonMap input as currently one could also provide [] which is valid JSON

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have meta that we support but a user might have other ideas for it.. if they use midi mapping, osc mapping, they need to use objects but if they're simply adding meta that they use in their own way, i figure we shouldn't limit them?

Copy link
Member

Choose a reason for hiding this comment

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

Hm, sure but the [param] object doesn't support it either - in fact doing anything than a Record<string, AnyJson> throws. Additionally setting it to eg [] means that functionality like MIDI mapping won't work so I personally am in favor of enforcing that it needs to be a JSON map at the top level.

@fde31
Copy link
Member

fde31 commented Jun 23, 2024

ok tweaked things by

  • introducing a violet colorscheme for active MIDI mapping
  • disabling midi mapping when changing types, navigating away, switching instances
  • general parameter MIDI mapping UX tweaks

Also noticed that our parameter column layout was broken, so fixed that.

Thing one issue is left if we really want to allow "any" JSON input in the meta editor or if it is safe to assume that meta should and will always be "" | Record<string, AnyJSON>. If that is the case I think we can further harden the validation of the JSON input and the parsing functions on the ParameterRecord

@fde31 fde31 self-requested a review June 23, 2024 13:33
Copy link
Contributor Author

@x37v x37v left a comment

Choose a reason for hiding this comment

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

i'll deal with the touch thing

src/actions/instances.ts Outdated Show resolved Hide resolved
@@ -315,7 +315,7 @@ export const clearParameterMidiMappingOnRemote = (id: InstanceStateRecord["id"],
if (!param) return;

const meta = param.getParsedMeta();
if (typeof meta === "object") {
if (typeof meta === "object" && !Array.isArray(meta)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have meta that we support but a user might have other ideas for it.. if they use midi mapping, osc mapping, they need to use objects but if they're simply adding meta that they use in their own way, i figure we shouldn't limit them?

@x37v x37v merged commit 7dd1b26 into develop Jun 23, 2024
1 check passed
@x37v x37v deleted the feature/midi-map branch June 23, 2024 14:53
@fde31
Copy link
Member

fde31 commented Jun 23, 2024

Gonna break out the remaining tasks / discussions into tickets

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