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

MC7000 add Fixed Loop + improvements + experimental beatcount #3738

Merged
merged 5 commits into from
Apr 17, 2021

Conversation

toszlanyi
Copy link
Contributor

What is updated:

  • changed record-speed from 33.3 to 33+1/3 to align Platter LEDs with GUI spinnies
  • reduced MIDI traffic for VU and Platter LEDs by adding comparison variables (only changed LEDs are sent)
  • simplified Jog calculation
  • added "Fixed Loop" PAD mode
  • I kept the experimental "Slicer LEDs" inside but created a variable set to false by default. If one wants to use that he needs to change the status to true.

Documentation gonna be changed after we are clear to merge those changes for 2.3
Thanks a lot for comments.

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

Most changes seem reasonable, only minor nitpicks.
Have yet to review the TrackPositionLEDs` method.

res/controllers/Denon-MC7000-scripts.js Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
Comment on lines 631 to 643
// Todo: check for latency and use it to normalize the jog factor so jog wont be
// depending on audio latency anymore.

Copy link
Member

Choose a reason for hiding this comment

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

I haven't worked with the jog wheel scratching code in a while but I never noticed this was an issue. Is there are Zulip or forum thread where this issue is discussed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - this is very obvious when you change from standard 23 to 5 ms the Jog is not usable - or it takes like 10 rounds to finally do something. TBH - I don't know if that has been discussed in chat already. I didn't

res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Show resolved Hide resolved
@Swiftb0y
Copy link
Member

Sorry, didn't realize this was still a Draft PR before I reviewed it.

@toszlanyi
Copy link
Contributor Author

Sorry, didn't realize this was still a Draft PR before I reviewed it.

Don't be sorry - at some point one needs to look into that. Thanks a lot for suggestions. Some are useful. Gonna change the variables definition to put var in front of each, instead using comma separated. Tbh - I like the comma separated much more. To let the for loop variables run from 0 to 7 is too obvious. I gonna change that. Cheers!

@toszlanyi
Copy link
Contributor Author

toszlanyi commented Mar 21, 2021

Have yet to review the TrackPositionLEDs` method.

to get the actual track position needs a lot of calculations, especially at low latency. They are easy enough but many. So I finally made the calculation only once and decide which LEDs are to be triggered for the Platter and PADs in Slicer Mode. I am using and tested this for a while already and it runs very well.

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

Still didn't finish reviewing TrackPositionLEDs fully because I don't understand the experimental features. If you point me to some higher level documentation (for example the documentation intended for users of the controller) I can continue.

res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
res/controllers/Denon-MC7000-scripts.js Outdated Show resolved Hide resolved
@toszlanyi toszlanyi changed the title MC7000 add Fixed Loop + improvements + experimental feature MC7000 add Fixed Loop + improvements + experimental beatcount Apr 8, 2021
@toszlanyi toszlanyi marked this pull request as ready for review April 8, 2021 07:56
@toszlanyi
Copy link
Contributor Author

I think the modifications are ready for a final review. Thanks a lot for the useful discussions so far. If you see any other point that is critical then please let me know. Cheers!

@Swiftb0y
Copy link
Member

Swiftb0y commented Apr 8, 2021

Thanks for your patience enduring my endless comments. Your code looks reasonable now.

@toszlanyi
Copy link
Contributor Author

PR #369 contains the manual change accordingly

@uklotzde uklotzde added this to the 2.3.0 milestone Apr 9, 2021
};

// Previous Rate range toggle
MC7000.prevRateRange = function(midichan, control, value, status, group) {
if (value === 0) {
return; // don't respond to note off messages
}
var deckNumber = script.deckFromGroup(group);
var deckOffset = script.deckFromGroup(group) - 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

script.deckFromGroup(group) - 1 is used very often. You might consider to extract a tiny helper function deckOffsetFromGroup() to not forget about the - 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Uwe - it gets strange if 3 people comment to the code review. I followed more or less and changed all the variables regarding deck or offset number as suggested here and mainly I used deckNumber - 1 but if i didn't need deckNumber then only deckOffset is used.

At the end it is the same and 3 people had 3 different opinions which gets a little frustrating.

@uklotzde , @Swiftb0y , @ronso0 ... Can you please clarify internally and then let me know which way you wanna go and I possibly change all over again.

Thanks you.

Copy link
Contributor

Choose a reason for hiding this comment

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

Using deckOffset is fine. I am just suggesting to move the duplicated code into a small helper function and then use that instead of the script.deckFromGroup() followed by the subtraction. The code will get more readable, no functional change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just some final polishing. Actually I wanted to ask if this PR is ready for merge before I stumbled upon this simple and obvious improvement. One of the basic refactoring patterns.

Copy link
Member

Choose a reason for hiding this comment

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

I agree, the change is not really conflicting with everything we discussed so far. Its just an addition to extract the script.deckFromGroup(group) - 1 part into its own function. this way its less likely you may forget the - 1part in the future.

Copy link
Member

Choose a reason for hiding this comment

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

I'd say we should merge now, the change can go in a separate PR.

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.

5 participants