Skip to content

Numark Scratch: add initial mapping#4834

Merged
Swiftb0y merged 1 commit intomixxxdj:2.4from
alhadebe:NumarkScratch
Jun 12, 2024
Merged

Numark Scratch: add initial mapping#4834
Swiftb0y merged 1 commit intomixxxdj:2.4from
alhadebe:NumarkScratch

Conversation

@alhadebe
Copy link
Copy Markdown
Contributor

Add Numark Scratch mapping

@alhadebe
Copy link
Copy Markdown
Contributor Author

Documentation PR is here 492

Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 6, 2022

This PR is marked as stale because it has been open 90 days with no activity.

@github-actions github-actions Bot added stale Stale issues that haven't been updated for a long time. and removed stale Stale issues that haven't been updated for a long time. labels Oct 6, 2022
@alhadebe
Copy link
Copy Markdown
Contributor Author

@Swiftb0y I'm having trouble getting my head around Javascript. I'm going to need your help to finish this please 🙏🏾

@Swiftb0y
Copy link
Copy Markdown
Member

Sure, what exactly do you need help with? I'd be glad to help.

@Swiftb0y
Copy link
Copy Markdown
Member

Have you tried out Mixxx 2.4 yet? We added a way to change the effects on the filter knob of the mixer. That would match the way this controller controls effects much more closely.

@alhadebe
Copy link
Copy Markdown
Contributor Author

Sure, what exactly do you need help with? I'd be glad to help.

My issue is with trying to create components for some of my controls. I think there's unresolved comments from your initial review. The examples I have looked at from other mappings are just too complex for my level I think.

@alhadebe
Copy link
Copy Markdown
Contributor Author

alhadebe commented Mar 14, 2023

Have you tried out Mixxx 2.4 yet? We added a way to change the effects on the filter knob of the mixer. That would match the way this controller controls effects much more closely.

Yep I have had a play around, but I have not seen this new system coded out in a mapping. except maybe the s4 k3 but that mapping is above my paygrade.
Where I'm getting stuck is that I borrowed the effects code from the Mixtrack Platinum FX mapping

The other issue is that there is no mixxx SOP on how to map this.

image
The solution currently in place is
Each fx buttons enable one effect at a time & toggles all other fx buttons off (shift + fx buttons, enables multiple effects)
The Paddle sets super to max and routes both fx units to corresponding deck
this.enablePaddle = function(channel, control, value, _status, _group) {
this.isPaddleHoldOn = value !== 0;
for (var i = 0; i <=2 ; i++) {
engine.setValue("[EffectRack1_EffectUnit" + i + "]", "super1", Math.min(value, 1.0));
engine.setValue("[EffectRack1_EffectUnit" + i + "]", "group_[Channel" + deckNumber + "]_enable", (value !== 0));
}
this.updateEffects();
};
Do you have solutions on how to do this better than what's in my code? I don't know if the new effects system caters for this.
I think we need to come up with consistent way to map these as I have seen on more & more controllers (or maybe it'd just Numark)

**edited (grammar & spelling fix)

Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment on lines +16 to +22
// Default is false. When set to false, the EncoderKnob manages looping. Shift + EncoderKnob scrolls the library/loads track
// If set to true, the EncoderKnob scrolls the library/loads track. Shift + EncoderKnob manages looping.
NumarkScratch.invertLoopEncoderFunction = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is really a necessary feature?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With this encoder in Serato, the only option is to press shift + turn to scroll through the library and shift + push to load tracks, every damn time. The default is changing loop length and turning on loops, who uses loops that much, lol?
It's so unintuitive. and I rarely use loops (or haven't taken the time to learn). Numark should really have just added a browse encoder and load buttons. Rant over
Anyway, for this mapping inverting the encoder functions to non-standard is optional. I think this might be helpful to someone else.

Copy link
Copy Markdown
Member

@Swiftb0y Swiftb0y Mar 15, 2023

Choose a reason for hiding this comment

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

That's a fair assessment. As long as it doesn't complicate the design too much, its fine.

Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
@Swiftb0y
Copy link
Copy Markdown
Member

Do you have solutions on how to do this better than what's in my code? I don't know if the new effects system caters for this.
I think we need to come up with consistent way to map these as I have seen on more & more controllers (or maybe it'd just Numark)

The problem is that each manufacturer has their own opinion on how many and what effects should be accessible (compare Pioneer, Numark and Denon Prime Hardware). For now, IIUC you can use the "[QuickEffectRack1_[Channel" + i + "]]" loaded_chain_preset CO. IIUC you're supposed to set it to the index of the button. The downside is that the labels of the controller likely don't correspond to the effect actually being used by mixxx (partly stemming from the fact that these differ between manufacturers) but the upside is that you can manually configure your own effects and chains to be used by mixxx instead.

@alhadebe
Copy link
Copy Markdown
Contributor Author

Do you have solutions on how to do this better than what's in my code? I don't know if the new effects system caters for this.
I think we need to come up with consistent way to map these as I have seen on more & more controllers (or maybe it'd just Numark)

The problem is that each manufacturer has their own opinion on how many and what effects should be accessible (compare Pioneer, Numark and Denon Prime Hardware). For now, IIUC you can use the "[QuickEffectRack1_[Channel" + i + "]]" loaded_chain_preset CO. IIUC you're supposed to set it to the index of the button. The downside is that the labels of the controller likely don't correspond to the effect actually being used by mixxx (partly stemming from the fact that these differ between manufacturers) but the upside is that you can manually configure your own effects and chains to be used by mixxx instead.

@Swiftb0y To double check the mixer's effects are separate & independent from the filter. Will the Quick Effect CO system work still for this use case?

@Swiftb0y
Copy link
Copy Markdown
Member

To double check the mixer's effects are separate & independent from the filter. Will the Quick Effect CO system work still for this use case?

Can you elaborate? I'm afraid I don't quite understand what you mean.

@alhadebe
Copy link
Copy Markdown
Contributor Author

To double check the mixer's effects are separate & independent from the filter. Will the Quick Effect CO system work still for this use case?

Can you elaborate? I'm afraid I don't quite understand what you mean.

From my limited understanding I thought QuickEffects relate to the Filter and the new effect system allows changing the effect for the Filter knob to some other effect for controllers like the s4 mk3 and prime 4.

I'm having a hard time wrapping my head on how I can use QuickEffects for the Numark's standalone effects section.

Thanks for the help again.

@Swiftb0y
Copy link
Copy Markdown
Member

Ah I see the problem. Numarks concept of FX sections don't map cleanly to either the QuickEffects nor the separate EffectsUnits...

I think it would be best to just use the FX Select Buttons do specify the loaded_chain_preset of the first effects unit. The paddles should then just enable routing to that one fx unit.

What do you think?

@alhadebe alhadebe changed the base branch from main to 2.4 April 26, 2024 03:46
Comment on lines +198 to +200
NumarkScratch.setChannelInput = function(channel, control, value, _status, _group) {
const number = (control === 0x57) ? 1 : 2;
const channelgroup = "[Channel" + number + "]";

switch (value) {
case 0x00: // PC and turn on vinyl control
engine.setValue(channelgroup, "passthrough", 0);
engine.setValue(channelgroup, "vinylcontrol_enabled", 1);
break;
case 0x02: // PHONO/LINE and turn off vinyl control
engine.setValue(channelgroup, "passthrough", 1);
engine.setValue(channelgroup, "vinylcontrol_enabled", 0);
break;
}
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@JoergAtGithub I noticed you have similar code on your Reloop KUT mapping. For some reason on Mixxx startup, Mixxx is not reading the status of the switch even though I get a sysex response. I have to physically toggle the switch, after Mixxx has loaded for the status it to be read.

Could it be my code or is Mixxxx loading too quickly? Would appreciate your help. Besides this, the PR is ready for merging.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could it be my code or is Mixxx loading too quickly?

If you start mix first with the mapping disabled and then enable it later via the preferences, does it work reliably?
fyi I also have encountered a firmware bug on my NS6II where it sometimes sends the wrong switch value (though this was with the split cue toggle, not the input switches).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if it works with --qml, it might indeed be some sort of data race on startup. In that case, I'd call it acceptable to slightly delay the sysex inquiry message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Swiftb0y a 9 second delay works. Seems a little too long imo. Is that acceptable?

the 9sec correlates to how long it takes for Mixxx to open up for me, on Windows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could it be my code or is Mixxx loading too quickly?

If you start mix first with the mapping disabled and then enable it later via the preferences, does it work reliably? fyi I also have encountered a firmware bug on my NS6II where it sometimes sends the wrong switch value (though this was with the split cue toggle, not the input switches).

@Swiftb0y , if I start Mixxx first with the mapping disabled and then enable it later via the preferences, it work reliably.
If I also reload the mapping via text editor after Mixxx has fully loaded, it works reliably.

@alhadebe alhadebe requested a review from Swiftb0y June 5, 2024 10:16
@alhadebe
Copy link
Copy Markdown
Contributor Author

alhadebe commented Jun 5, 2024

@Swiftb0y I think this is ready to merge. I'm still having trouble with channel inputs. Mixxx is not setting the control correctly even though the controller reports the state on startup. When using --qml it works correctly though 🤷🏾‍♂️

Copy link
Copy Markdown
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

this looks pretty good so far. Just a couple nitpicks if you want to fix them. If not, its fine too, this mapping is very polished already. I'm sorry for forgetting about this until now.

Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
@alhadebe
Copy link
Copy Markdown
Contributor Author

alhadebe commented Jun 7, 2024

this looks pretty good so far. Just a couple nitpicks if you want to fix them. If not, its fine too, this mapping is very polished already. I'm sorry for forgetting about this until now.

No worries I'll fix up the nits. I'll take a look when I get home and then confirm once ready. Thanks for the review.

Copy link
Copy Markdown
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

last couple nitpicks

Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Comment thread res/controllers/Numark-Scratch-scripts.js Outdated
Copy link
Copy Markdown
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

last nitpick comment.

Comment thread res/controllers/Numark-Scratch-scripts.js
Copy link
Copy Markdown
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

LGTM. thank you for your patience and contribution.

@Swiftb0y
Copy link
Copy Markdown
Member

Can you do me a favor and squash all the commits down into a single one before I merge?

@alhadebe
Copy link
Copy Markdown
Contributor Author

alhadebe commented Jun 12, 2024

One last thing @Swiftb0y
case 0x7F: // Picnic Bench/Fast Cut
engine.setValue("[Mixer Profile]", "xFaderMode", 0);
engine.setValue("[Mixer Profile]", "xFaderCalibration", 0.9);
engine.setValue("[Mixer Profile]", "xFaderCurve", 7.0);

How far can I push these values? This is meant to be a scratch mixer with the fastest cut possible. Looking at the mixer settings & developer tools, I can set xFaderCalibration to 0.999307 and xFaderCurve to 999.6

@Swiftb0y
Copy link
Copy Markdown
Member

I'm actually not sure. These controls are suboptimal anyways. We really need a hybrid setting that combines both modes in Mixxx to a single slider so it can be mapped to the single knob present on most hardware.

Co-Authored-By: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
@alhadebe
Copy link
Copy Markdown
Contributor Author

alhadebe commented Jun 12, 2024

Squashed. Thanks for the review and the lessons @Swiftb0y

I'll investigate the xfadercurve & calibration values and issue another pr if it helps. I also want to introduce settings now that it is available in main.

manual is here pr 492

@Swiftb0y
Copy link
Copy Markdown
Member

Squashed. Thanks for the review and the lessons @Swiftb0y

Thanks for your patience ;)

I'll investigate the xfadercurve & calibration values and issue another pr if it helps.

I filed #13363 for the crossfader issue. I'd be very grateful if you'd look into options solving that from the C++ side.

I also want to introduce settings now that it is available in main.

👍

manual is here mixxxdj/manual#492

Yup, saw that. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants