Petal - Accessing Knob 7 via Alt function

Hi , Im creating some effects in the Max Gen world and would like to know how I can programatically access a second layer of Knob Params .
So far I have 6 Knobs avaliable on the Petal but I would like to have access to some other less used Parameters by say Pressing and Holding Switch1. While Holding Switch1 Knob1 could then become Knob7.

How would I go about this?

This is solved below but I now need to work out how to store parameter values that can be recalled after a power cycle.

Many thanks,
AD

Thinking about this some more…
I guess I would need to be able to store the received ALT Knob7 parameter values in a registry somewhere so they get kept and not overwritten as the Switch1 is released and the knob gets rotated back to its preferred position.

Is it even possible to save values like this in Daisy Petal over a power cycle?

AD

Yay, I worked out the ALT KNOB Conundrum and successfully patched another 6 knobs, now 12 in total.
The additional 6 knobs are avaliable when pressing SW1 for more than 1 second.

My query remains about how to hold/store the values in the additional 6 parameters that will be kept and recalled after a power cycle?

Many thanks,

AD

QSPI is non-volatile memory, which should do what you want. It’s just a bit tricky to use, because the memory is erased in 4K blocks, and must be erased prior to writing it. But once you’re keeping that in mind, it’s pretty straight-forward. There’s an example of its use here: DaisyExamples/Seed3Test.cpp at master · electro-smith/DaisyExamples · GitHub

This needs some corrections:

  • QSPI is a peripheral name, not a flash memory type
  • memory used by Daisy is NOR flash on IS25LP064A chip
  • you can erase data in 4k subsectors, 64k sectors or perform mass erase for the whole chip. The smaller erase block size is used, the lower erase speed you get
  • QSPI peripheral supports several modes and you must switch between memory-mapped mode and indirect polling mode for read and erase/write operations respectively
  • erase operation resets every bit to 1 but you can overwrite previously written data without erasing. You can only overwrite bit value of 1 with 0, but this is sufficient for using “dirty bit” that you invalidate in order to avoid erasing old data every time you have to store something on flash. Appending new data this way is faster and reduces flash wear from writing to the same address every time.

Thank you,
Im more of a visual programmer kinda guy but i get the gist of whats happening there. As Im using Max Oopsy to deploy my Gen~ patches to the Petal is there a way to integrate this behaviour within Max or do I have to step outside that realm to achieve this?
Thanks,
AD