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

Implement shared settings menu #397

Draft
wants to merge 75 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a770e3c
Start implementing a new settings menu we can use in multiple scripts
chrisib Nov 27, 2024
2b1982a
Add a simple script to help debug the new settings menu. Implement ba…
chrisib Nov 30, 2024
f52dbb3
Give the menu control over the knob & button so we can add handlers
chrisib Nov 30, 2024
750e139
Add callbacks for long/short press
chrisib Nov 30, 2024
5eb16c8
Implement a multi-level menu based on Pam's for testing
chrisib Dec 1, 2024
df4fbd9
Fix a bug in the configuration save-to-file. Fix a bug where scrollin…
chrisib Dec 1, 2024
a8283a0
Dynamically generate menu entries for all CV outputs
chrisib Dec 1, 2024
bb3f423
Load the saved settings on startup
chrisib Dec 1, 2024
dc366c3
Make the ConfigSettings object subscriptable and searchable
chrisib Dec 1, 2024
e42a3ce
Fix loading & saving the menu settings
chrisib Dec 1, 2024
46c88e2
Linting
chrisib Dec 1, 2024
e2fbb45
Add missing comma
chrisib Dec 1, 2024
d3ec9f3
Don't use dicts for creating menu items implicitly; require calling t…
chrisib Dec 1, 2024
3ee905c
Set the number of arguments for the lambda, assign the graphics property
chrisib Dec 1, 2024
d5b1587
Expose the float resolution so we can have more/less precision if needed
chrisib Dec 1, 2024
08ed368
Linting
chrisib Dec 1, 2024
5b2cabd
The default linter is really inconsistent with how it wants arguments…
chrisib Dec 1, 2024
1e32ecb
Make MenuItem abstract to allow creating other customized menu items …
chrisib Dec 1, 2024
c3a8171
Update the documentation for the sequential switch, simplify the b1 h…
chrisib Dec 1, 2024
0dee4a4
More documentation updates, remove some unnecessary code
chrisib Dec 1, 2024
402ce10
Add a check to see if the menu is actually dirty & needs to be redraw…
chrisib Dec 1, 2024
a2f5e9c
Remove the menu test; now that we have functional scripts using the n…
chrisib Dec 1, 2024
b14a7a8
Linting
chrisib Dec 1, 2024
da0e201
Force a re-render on a clock pulse, allow B1 to be used as a manual c…
chrisib Dec 1, 2024
5e930a3
Linting
chrisib Dec 1, 2024
e2ac2c8
Fix using K1 to exit the screensaver
chrisib Dec 1, 2024
88ee008
Use regexes to check the JSON formatting in the tests; these should i…
chrisib Dec 1, 2024
f6191a1
Fix a bug in the type hints; referring to our own type is failing in …
chrisib Dec 3, 2024
088ae19
Add another test to make sure the class name actually resolves to a c…
chrisib Dec 3, 2024
9a8c648
Add support for using AIN and K1 to control Euclid
chrisib Dec 4, 2024
822dfe6
Update the euclid docs to specify that AIN and K1 are now used
chrisib Dec 4, 2024
0169bcf
Minor cleanup
chrisib Dec 4, 2024
bc493aa
Keep the same timer instance but init & deinit it when needed. Fix a …
chrisib Dec 4, 2024
6b814ea
Cleanup
chrisib Dec 4, 2024
982cb2c
Disable some annoying formatting checks
chrisib Dec 4, 2024
889cfe9
Restore accidentally overwritten euclid script
chrisib Dec 4, 2024
5c8f7e3
Move the autoselect timer object up to the menu level so we avoid a p…
chrisib Dec 5, 2024
3553e16
Change the I2C frequencies to a choice (there are finite options). Ch…
chrisib Dec 5, 2024
ebc2b78
Update configuration docs
chrisib Dec 5, 2024
f8bc4df
Add a first-draft configuration-editor tool. Fix some issues discover…
chrisib Dec 5, 2024
b112842
Fix a copy & paste error
chrisib Dec 5, 2024
293a8fd
Move the SettingsMenu to the bottom so the type hints don't make the …
chrisib Dec 5, 2024
eda8396
Use a normal loop, lower the float resolution
chrisib Dec 5, 2024
5079fdb
Separate the settings into sections, process the config point name to…
chrisib Dec 5, 2024
e3bd566
Move where we turn off format checking
chrisib Dec 5, 2024
a843e24
Some code optimization in the config editor, fix the boot-to-menu opt…
chrisib Dec 6, 2024
3b6145e
Reorganize the configuration manual to group things into the same sub…
chrisib Dec 6, 2024
58b47bf
Add a danger property to the config points so we can mark especially …
chrisib Dec 6, 2024
af63601
Start overhauling Pam's to use the new menu system
chrisib Dec 7, 2024
39f24db
Fix some format strings that weren't formatted, troubleshoot some ini…
chrisib Dec 7, 2024
f806a8b
Only apply the boolean labels for boolean configs; always using them …
chrisib Dec 7, 2024
88ec1bc
Fix a bug in the new ! rendering (fixed on my testing hardware, but n…
chrisib Dec 7, 2024
7158759
Fix bugs when dynamically changing choices
chrisib Dec 7, 2024
0bc0fc3
Re-add the CV input wrapper class; it's used for the S&H functionalit…
chrisib Dec 7, 2024
cd6f676
Make the default swing 50%; 0 results in notes being crushed out of e…
chrisib Dec 7, 2024
e090949
Re-implement the AIN/K1 gain + precision menu items
chrisib Dec 7, 2024
d3789be
Wake up from screensaver on a knob turn
chrisib Dec 7, 2024
a30d0e7
Rewrite the wrapper for K1/AIN
chrisib Dec 7, 2024
4436ed1
Allow AIN/K1 control over most menu items
chrisib Dec 7, 2024
0e14267
Add line breaks to the EuroPiScript settings files
chrisib Dec 7, 2024
e166158
Fix some bugs related to the new AIN/K1 selections. Add banks for loa…
chrisib Dec 7, 2024
01ed14f
Use regexes for checking JSON strings' validity
chrisib Dec 7, 2024
becd00e
Remove an extra newline
chrisib Dec 7, 2024
23a2b1d
Linting
chrisib Dec 7, 2024
7ff50ba
Missing comma
chrisib Dec 7, 2024
4fe7c56
Remove the autoselect knob & ain options from the wave_shape; we want…
chrisib Dec 10, 2024
29353f0
Show the auto-selected value in parentheses when applicable in the se…
chrisib Dec 15, 2024
5aae510
Fix a bug with the buffered analogue reader where knob percentages we…
chrisib Dec 15, 2024
47073c9
Add a ui_dirty flag to the MenuItem so we can re-render it on-demand …
chrisib Dec 15, 2024
2de33f6
Add `(S&H)` to the wave-shape ain & knob labels to differentiate them…
chrisib Dec 15, 2024
e4e9265
Fix a crash with the ActionMenuItem rendering
chrisib Dec 31, 2024
79d9286
Add missing `self.`
chrisib Dec 31, 2024
5f0b179
Add a note about where to find examples of the SettingsMenu in use
chrisib Dec 31, 2024
d551dd8
Add a dedicated example for the settings menu, mention the config edi…
chrisib Jan 1, 2025
aa5b524
Add additional documentation to the menu example, save the settings, …
chrisib Jan 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions software/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ default configuration:
}
```

CPU & Pico options:
System options:
- `EUROPI_MODEL` specifies the type of EuroPi module. Currently only `"europi"` is supported. Default: `"europi"`
- `PICO_MODEL` must be one of `"pico"` or `"pico w"`. Default: `"pico"`
- `CPU_FREQ` must be one of `250000000` or `125000000`. Default: `"250000000"`
- `MENU_AFTER_POWER_ON` is a boolean indicating whether or not the module should always return to the main menu when
it powers on. By default the EuroPi will re-launch the last-used program instead of returning to the main menu. Default: `false`

Display options:
- `ROTATE_DISPLAY` must be one of `false` or `true`. Default: `false`
Expand All @@ -45,19 +47,18 @@ External I²C options:
- `EXTERNAL_I2C_SCL` is the I²C SCL pin used for the external I²C interface. Only SCL capable pins can be selected. Default: `3`
- `EXTERNAL_I2C_CHANNEL` is the I²C channel used for the external I²C interface, either 0 or 1. Default: `1`
- `EXTERNAL_I2C_FREQUENCY` is the I²C frequency used for the external I²C interface. Default: `100000`
- `EXTERNAL_I2C_TIMEOUT` is the I²C timeout in microseconds for the external I²C interface. Default: `50000`
- `EXTERNAL_I2C_TIMEOUT` is the I²C timeout in milliseconds for the external I²C interface. Default: `1000`

I/O voltage options:
- `MAX_OUTPUT_VOLTAGE` is an integer in the range `[0, 10]` indicating the maximum voltage CV output can generate. Default: `10`
- `MAX_OUTPUT_VOLTAGE` is a float in the range `[0.0, 10.0]` indicating the maximum voltage CV output can generate. Default: `10.0`
The hardware is capable of 10V maximum
- `MAX_INPUT_VOLTAGE` is an integer in the range `[0, 12]` indicating the maximum allowed voltage into the `ain` jack.
The hardware is capable of 12V maximum. Default: `10`
- `GATE_VOLTAGE` is an integer in the range `[0, 10]` indicating the voltage that an output will produce when `cvx.on()`
is called. This value must not be higher than `MAX_OUTPUT_VOLTAGE`. Default: `5`
- `MAX_INPUT_VOLTAGE` is a float in the range `[0.0, 12.0]` indicating the maximum allowed voltage into the `ain` jack.
The hardware is capable of 12V maximum. Default: `10.0`
- `GATE_VOLTAGE` is a float in the range `[0.0, 10.0]` indicating the voltage that an output will produce when `cvx.on()`
is called. This value must not be higher than `MAX_OUTPUT_VOLTAGE`. Default: `5.0`

Power options:
- `MENU_AFTER_POWER_ON` is a boolean indicating whether or not the module should always return to the main menu when
it powers on. By default the EuroPi will re-launch the last-used program instead of returning to the main menu. Default: `false`
I/O voltage options should specify no more than 1 decimal point. i.e. `2.5` is acceptable, but `1.234` is not. These
limits are intended for broad compatibility configuration, not for precise tuning.


# Experimental configuration
Expand Down
23 changes: 15 additions & 8 deletions software/contrib/euclid.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@ of each pattern can be independently adjusted.

## I/O Assignments

- `ain`: not used
- `ain`: external CV control (if configured)
- `din`: external clock input
- `b1`: Open the settings menu for the selected CV channel, or apply the current
option if we're already in the settings menu
- `b2`: Toggle between the CV channel select menu & settings menu for that channel
- `k1`: Scroll between the CV channels in the main menu, or the available settings
for that channel in the settings menu
- `k2`: Scroll through the options for the current setting in the settings menu
- `b1`: manual clock input
- `b2`: Menu navigation
- `k1`: manual CV control (if configured)
- `k2`: Channel select, menu navigation
- `cv1` to `cv6`: euclidean rhythm outputs

Long-pressing B2 will switch between the visualization and menu mode. While in menu mode, K2 will
scroll through the available menu options. Short-press B2 to edit a setting, rotate K2 to choose the
desired value, then press B2 again to apply it.

All settings can be assigned either `Knob` or `AIN` as their value. When so-assigned, rotating K1
or applying voltage to AIN will automatically select a valid option from the setting. e.g. setting
CV1's `Pulses` setting to `AIN` will allow voltage sent to `AIN` to choose the number of pulses
generated by CV1.

## Settings

- Steps: the number of steps in the pattern (1-32)
Expand All @@ -41,4 +48,4 @@ re-applied automatically when the script restarts.
## Screensaver

After 20 minutes the screen will automatically go blank. Pressing either button
will wake the screen up and return to the channel menu.
or rotating either knob will wake the screen up and return to the channel menu.
Loading
Loading