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

Internal Clock Enhancements #49

Closed
wants to merge 1 commit into from

Conversation

djphazer
Copy link

This is a fairly elegant solution to #23 that's hopefully not too intrusive.

Clock Forwarding and internal clock Start/Stop are now independent settings. On the ClockSetup screen, turn encoder left to toggle Start/Stop, turn right to toggle Forwarding, indicated by a LINK_ICON. Long-press left encoder will still Pause/Unpause.
Internal clock always triggers Digital 1, will only trigger Digital 3 if forwarding is ON.

Functionally, I think it's exactly what I wanted. Open to feedback on the interface screen.

@djphazer djphazer changed the title Internal Clock Forwarding tweaks Internal Clock Enhancements Dec 21, 2022
@djphazer
Copy link
Author

After sufficient time and testing, I've rebased and squashed this down into a single commit. It's quite functional, but some code review would be a good idea...

Also, it probably depends on #59 to fit in memory

Copy link

@Spyes Spyes left a comment

Choose a reason for hiding this comment

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

Absolutely solid feature!!

@@ -91,44 +108,91 @@ protected:
}

private:
int cursor; // 0=Source, 1=Tempo, 2=Multiply
char cursor; // 0=Play/Stop, 1=Forwarding, 2=External PPQN, 3=Tempo, 4,5=Multiply
Copy link

Choose a reason for hiding this comment

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

Might be worthwhile to extract this to an enum, it'll make it much easier to understand at a glance the different cursor states

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, and there's probably a cursor variable in every other applet that should be an enum... I'll work on this.

Comment on lines 47 to 62
bool tock[3] = {0,0,0}; // The current tock value
int tocks_per_beat[3] = {1, 1, 24}; // Multiplier
int clock_ppqn = 4; // external clock multiple
bool cycle = 0; // Alternates for each tock, for display purposes
int count[3] = {0,0,0}; // Multiple counter, 0 is a special case when first starting the clock

bool boop[4]; // Manual triggers
Copy link

Choose a reason for hiding this comment

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

consider extracting hard-coded array lengths to consts

* Adapts to external clock at configurable PPQN (0 to disable)
* Separate internal clock multipliers/dividers for each hemisphere
  (0 to disable)
* Internal Clock sends realtime MIDI Clock/Start/Stop
* Forwarding only duplicates physical DIGITAL 1 -> DIGITAL 3
* Clock state data is stored with ClockSetup, not Metronome
@djphazer djphazer closed this Jun 13, 2024
@djphazer djphazer deleted the clock-setup-tweaks branch June 13, 2024 01:36
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