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

Added poly_square oscillator contrib script. #141

Merged
merged 8 commits into from
May 24, 2022

Conversation

t-schreibs
Copy link
Contributor

This PR adds a new poly square oscillator script to the contrib directory.

@roryjamesallen
Copy link
Collaborator

not part of the review but just wanted to say how awesome this is, just such a cool proof that boundaries i thought were set in stone (no audio without extra hardware) can be broken by clever enough programmers!

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.

Wow this is awesome. I hope that you are proud of this work. Aside from pushing the boundaries of what the EuroPi is capable of, but you are doing it in a very clean and well factored and well thought out script. 👏

I've commented using our proposed contributing guidelines, give it a read if you haven't already: https://github.com/Allen-Synthesis/EuroPi/blob/contributing-updates/contributing.md

I've added some minor suggestions and questions. I'd like to understand the assembly code a little bit better, at least how it interfaces with the python, before I click the approve button. But I wanted to hand these comments over to you while I did that.

software/contrib/poly_square.md Outdated Show resolved Hide resolved
software/contrib/poly_square.py Outdated Show resolved Hide resolved
software/contrib/poly_square.py Outdated Show resolved Hide resolved
software/contrib/poly_square.py Outdated Show resolved Hide resolved
software/contrib/poly_square.py Show resolved Hide resolved
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.

Amazing work, thank you for the thorough and detailed script helping pave the way for more PIO scripts!

I'm not sure if it was intentional, but if you want to have this script included in the Menu, there's one more step; you'll need to import and add PolySquare to the list of scripts in contrib/menu.py as described at the end of the Menu Inclusion instructions.

software/contrib/poly_square.md Outdated Show resolved Hide resolved
software/contrib/poly_square.py Outdated Show resolved Hide resolved
Use EuroPi clamp instead of individual min & max calls.

Co-authored-by: Adam Wonak <adam.wonak@gmail.com>
@t-schreibs
Copy link
Contributor Author

New commit incoming with all of the above changes - plus a couple other small things I've noticed while reviewing the script.

…ax detune available; better tuning UI; refactored methods called in update_settings() so that oscillator_index is the parameter instead of the oscillator itself.
@t-schreibs
Copy link
Contributor Author

Amazing work, thank you for the thorough and detailed script helping pave the way for more PIO scripts!

I'm not sure if it was intentional, but if you want to have this script included in the Menu, there's one more step; you'll need to import and add PolySquare to the list of scripts in contrib/menu.py as described at the end of the Menu Inclusion instructions.

I do want this to happen, but I need to figure out a way to prevent the "tuning" mode menu from confusingly interfering every time you try to navigate back to the main script menu by holding both buttons down.

@roryjamesallen
Copy link
Collaborator

I do want this to happen, but I need to figure out a way to prevent the "tuning" mode menu from confusingly interfering every time you try to navigate back to the main script menu by holding both buttons down.

This is as far as I know just something that we accept with the double button press; that the single press handlers will also trigger unless you specifically write in something to prevent that (which would come at the cost of single presses being delayed as it works out whether the other button is also pressed, hence leaving it up to the user rather than making this delay default)

Yours certainly wouldn't be the first to have something pop up as you try to exit to menu with a double press, so I wouldn't worry too much about this, especially given the alternative is to potentially add an artificial lag to the usage of the tuning mode which will be accessed much more often than the main script menu

@t-schreibs
Copy link
Contributor Author

I forgot to mention this in my description of the previous commit, but I did also include some new functionality (just for fun): button 2 now toggles the maximum detune between a half step and a major 9th for those of us that enjoy a bit of chaos. This also required some changes in the code to save settings.

@awonak
Copy link
Collaborator

awonak commented May 11, 2022

One potential way to avoid button press confusion is to move all handler behavior off of handler which reacts to a press, and move it to handler_falling which reacts when the button is released. Dual long press will override your script release behavior so your script wont emit any side effect button behavior.

Personally, I prefer the snappy behavior of a handler press and have no problem with side effects of dual press given the user pressing the buttons are leaving the script, so it really doesn't matter if the script has a brief side effect.

@t-schreibs
Copy link
Contributor Author

One potential way to avoid button press confusion is to move all handler behavior off of handler which reacts to a press, and move it to handler_falling which reacts when the button is released. Dual long press will override your script release behavior so your script wont emit any side effect button behavior.

Personally, I prefer the snappy behavior of a handler press and have no problem with side effects of dual press given the user pressing the buttons are leaving the script, so it really doesn't matter if the script has a brief side effect.

That's a good point - and the script doesn't save the tuning changes until the button's falling handler is called, which is intercepted by the return to the menu anyways, so maybe it won't actually be much of an issue.

@mjaskula
Copy link
Collaborator

button 2 now toggles the maximum detune between a half step and a major 9th for those of us that enjoy a bit of chaos.

[Optional] I think that button 2 needs some kind of on screen indication of what mode we are in. I found it confusing to not know for sure what mode i was in.

@mjaskula
Copy link
Collaborator

mjaskula commented May 13, 2022

[Optional] I feel like the tuning would be more useful with a larger range (probably on both knobs).

My first impulse was to set up a nice fat drone, but the tuning controls didn't get me to where I wanted. At first, I thought that something might be wrong with the code or my module. Once I connected up a 1 v/oct source it behaved better. I guess I expected the tuning functionality to behave like the frequency knobs on my oscillators, giving me access to its entire range.

To elaborate, without a v/oct signal, the output is too low to really show off the module, even at the highest tuning. All of the chords sounded muddy to my ears, and stepping through the features wasn't that inspiring. Once I brought the pitch up with an external voltage it really came alive. I think it would be nice to have that experience more immediately.

Plus: better drones.

@mjaskula
Copy link
Collaborator

I'm not sure if it was intentional, but if you want to have this script included in the Menu, there's one more step

There's actually gonna be two, because there are some unmocked micropython classes being used.

I can work on fixing this if you want to have the menu working in this PR.

@t-schreibs
Copy link
Contributor Author

t-schreibs commented May 13, 2022

button 2 now toggles the maximum detune between a half step and a major 9th for those of us that enjoy a bit of chaos.

[Optional] I think that button 2 needs some kind of on screen indication of what mode we are in. I found it confusing to not know for sure what mode i was in.

That's a good idea. I'll probably remove the "Poly Square" title, shift the current polyphony mode text upward, and use the space below to clarify the detune mode.

@t-schreibs
Copy link
Contributor Author

[Optional] I feel like the tuning would be more useful with a larger range (probably on both knobs).

My first impulse was to set up a nice fat drone, but the tuning controls didn't get me to where I wanted. At first, I thought that something might be wrong with the code or my module. Once I connected up a 1 v/oct source it behaved better. I guess I expected the tuning functionality to behave like the frequency knobs on my oscillators, giving me access to its entire range.

To elaborate, without a v/oct signal, the output is too low to really show off the module, even at the highest tuning. All of the chords sounded muddy to my ears, and stepping through the features wasn't that inspiring. Once I brought the pitch up with an external voltage it really came alive. I think it would be nice to have that experience more immediately.

Plus: better drones.

That's a good idea. I originally wrote the script only to interact with an external V/oct, but now that we have the internal tuning it probably should have the full frequency range available.

@t-schreibs
Copy link
Contributor Author

I'm not sure if it was intentional, but if you want to have this script included in the Menu, there's one more step

There's actually gonna be two, because there are some unmocked micropython classes being used.

I can work on fixing this if you want to have the menu working in this PR.

Sounds good - I'll include it in the menu in my next commit.

@mjaskula mjaskula mentioned this pull request May 13, 2022
t-schreibs and others added 2 commits May 15, 2022 22:45
…des; tuning settings no longer change until the knobs have been moved; coarse tune range is now 8 octaves; fine tune range is now an octave; get_offset() now uses a modulo to prevent issues when there are less voltage offsets available than the number of oscillators; tuning UI has been updated to reflect the new coarse tuning range; the main UI now includes the max detune setting; tuning & detuning knob values are no longer quantized when read; doc updates; PolySquare has been added to the menu; added display name.
@t-schreibs
Copy link
Contributor Author

Hm, not sure why the menu imports test failed on my latest commit. 😢

@t-schreibs
Copy link
Contributor Author

Hm, not sure why the menu imports test failed on my latest commit. 😢

Oh, it's because that PR with the fix hasn't been merged yet - got it.

@mjaskula
Copy link
Collaborator

Hm, not sure why the menu imports test failed on my latest commit. 😢

Oh, it's because that PR with the fix hasn't been merged yet - got it.

Ok, the fix has been merged into the main branch upstream. You'll have to perform some git work to get the changes into this branch. Depending on your git philosophy you can either rebase your branch on the current main, or you can merge the upstream changes into your branch. I'm not sure how comfortable you are with git, but if you need help I'm glad to.

@t-schreibs
Copy link
Contributor Author

Ok, I've merged the upstream changes, and everything looks good to go now!

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.

Looks good. I still need to educate myself on the PIO assembly code, but no need to hold this up.

@awonak awonak merged commit 63c2549 into Allen-Synthesis:main May 24, 2022
@t-schreibs t-schreibs deleted the poly_square branch May 24, 2022 23:52
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.

4 participants