-
Notifications
You must be signed in to change notification settings - Fork 85
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
Master clock #162
Conversation
There was a problem hiding this 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
self.el.create_task(self.outputPulse(cv6)) | ||
else: | ||
# 0 = random | ||
cv6.value(randint(0, 1)) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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,
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
This reverts commit 1d8cf05.
There was a problem hiding this 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
Suggested changes made and merge conflicts resolved - let's merge ASAP! |
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! |
Awesome work everyone! I think this script is an awesome addition to the EuroPi ecosystem! |
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.