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

Master clock #162

Merged
merged 64 commits into from
Oct 16, 2022
Merged

Master clock #162

merged 64 commits into from
Oct 16, 2022

Conversation

gamecat69
Copy link
Contributor

Initial PR for the master clock script. Includes adding the script to the main menu.
Also includes minor CV Recorder changes as these are not yet merged into the main upstream branch.

Copy link
Collaborator

@mjaskula mjaskula 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 really good. The only thing we need for merge, from my point of view, is an import fix to allow the menu test to pass.

One note. When I first tried using it, I thought it was broken, because I couldn't get the bpm to change. This was because I hadn't read the manual and didn't know about config mode, after that it made sense. This is all to say that there might be room for a more intuitive UI,

I left a few other suggestions and questions, but I look forward to using this.

software/contrib/master_clock.py Outdated Show resolved Hide resolved
software/contrib/master_clock.py Outdated Show resolved Hide resolved
software/contrib/master_clock.py Show resolved Hide resolved
self.el.create_task(self.outputPulse(cv6))
else:
# 0 = random
cv6.value(randint(0, 1))
Copy link
Collaborator

Choose a reason for hiding this comment

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

[optional] The above section of code governing cv2-6 is just begging to be a for loop.

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 can't intuitively think of a for loop that would be more efficient or easier to read. I am open to suggestions though,

Copy link
Collaborator

@awonak awonak Aug 3, 2022

Choose a reason for hiding this comment

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

I think it would require a bit more refactoring by putting the division outputs into a list instead of individual class attributes, then enumerating over them and europi.cvs:

for idx, output in enumerate(self.divisionOutputs):
  if output and self.step % output == 0:
    self.el.create_task(self.outputPulse(cvs[idx + 1])
  else if output == 0:
    cvs[idx + 1].value(randint(0, 1)

That would clean up other code sections like159-170

# Only adjust values if k2 has moved. This avoids a potentially annoying UX
if self.previousselectedDivision != selectedDivision:
    self.divisionOutputs[self.activeOption] = selectedDivision
    self.saveState()

self.previousselectedDivision = selectedDivision

Looking over all the instances of self.divisionOutputX, I think it's doable, but would be a bit of a significant change to the script.

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. you were right the change was significant, but doing this streamlined a few other areas too! Done!

software/contrib/master_clock.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@roryjamesallen roryjamesallen left a comment

Choose a reason for hiding this comment

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

Really looking forward to having this script in my rack

Just need to resolve the conflicts and then LGTM

@gamecat69
Copy link
Contributor Author

Suggested changes made and merge conflicts resolved - let's merge ASAP!

@roryjamesallen
Copy link
Collaborator

It looks like the Turing machine has been accidentally removed and master clock not imported from the contrib folder, I think that's the only thing failing now!

@roryjamesallen roryjamesallen merged commit 7ef6dba into Allen-Synthesis:main Oct 16, 2022
@djmjr
Copy link
Contributor

djmjr commented Oct 16, 2022

Awesome work everyone! I think this script is an awesome addition to the EuroPi ecosystem!

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.

6 participants