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

Add Sigma script #369

Merged
merged 19 commits into from
Aug 10, 2024
Merged

Add Sigma script #369

merged 19 commits into from
Aug 10, 2024

Conversation

chrisib
Copy link
Collaborator

@chrisib chrisib commented Jul 7, 2024

This adds a new random CV/Gate generator based on gaussian distributions rather than the even distributions used by most other scripts.

Outputs are paired in Gate (CV1-3) + Random Voltage (CV4-6) pairs. Voltage outputs can optionally be continuous, binned, or quantized to tone/semitone/quartertone (at 1V/octave) resolution.

This script is inspired by Magnetic Freak's Gaussian module (see https://magnetic-freak.com/ for details on that module).

Firmware changes include adding a new experimental.random_extras module to store useful random-related functions that are part of standard Python3, but are omitted from MicroPython.

@chrisib chrisib added new script Addition of a new contrib script improvement Improvement or optimization of an existing feature or script labels Jul 7, 2024
Copy link
Collaborator

@awonak awonak 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 like an awesome script, well done!

software/contrib/sigma.md Outdated Show resolved Hide resolved
Comment on lines 36 to 37
if lo < 0:
raise ValueError('lo must be non-negative')
Copy link
Collaborator

Choose a reason for hiding this comment

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

[discussion] I know this is copied from another source, but perhaps we can modify this to avoid throwing a runtime exception on the EuroPi?

Suggested change
if lo < 0:
raise ValueError('lo must be non-negative')
if lo < 0:
lo = 0

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also bisect_left may be a better fit for the new random_extras.py since I can see other scripts using it too.

Copy link
Collaborator Author

@chrisib chrisib Aug 7, 2024

Choose a reason for hiding this comment

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

I've moved bisect_left into a new experimental.bisect module. The exception has been edited out as well.

self.last_interaction_at = time.ticks_ms()

@b1.handler_falling
def on_b1_fall():
Copy link
Collaborator

Choose a reason for hiding this comment

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

[required] This looks like it will change the knob bank handler on both rise and fall? Shouldn't the button only change knob bank on one button direction? B2 changes AIN destination on rise, so I assume you intend to attach B1 behavior on rise alone too.

Copy link
Collaborator Author

@chrisib chrisib Aug 7, 2024

Choose a reason for hiding this comment

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

This looks like it will change the knob bank handler on both rise and fall?

That's correct; the intent is that the button acts as a momentary shift button. It should be held down to allow changing the binning mode or the jitter. I've changed the code slightly to make it clearer what's going on, but the intent is that the knob bank handler should be set on both the rising & falling edge in order that b1 act as a momentary button instead of a latched one.

chrisib added 10 commits August 7, 2024 18:40
… output voltage control (v1), add a simple debugging GUI. Script is finally being tested on live hardware
…output voltages at a desired time in the future
…with CV changes. Fewer overall outputs, but this feels like a good trade-off for functionality
…date the UI while scrolling through the bin modes
@awonak awonak merged commit 4c71d4b into Allen-Synthesis:main Aug 10, 2024
3 checks passed
@chrisib chrisib deleted the sigma branch January 10, 2025 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement or optimization of an existing feature or script new script Addition of a new contrib script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants