Sync current state of analog controls on pedalboard load#114
Sync current state of analog controls on pedalboard load#114sastraxi wants to merge 4 commits intoTreeFallSound:pistomp-v3from
Conversation
d18690e to
11beee2
Compare
rreichenbach
left a comment
There was a problem hiding this comment.
This is cool. I can't merge it though since this fork/branch needs a rebase.
|
This is very cool — thanks for the implementation. Since my unit has a lot of analog controls, I was wondering if this behavior could be made optional. For example, a per-control toggle in the analog control definition (something like autosync=1). For some controls it’s great to sync immediately on preset/pedalboard change, but for others I’d prefer to keep the value stored in the snapshot until the control is moved. From a usability standpoint, having this as a per-control option would cover both use cases cleanly. Thanks again for the great contributions. |
|
@renemadeira added! The default is @rreichenbach I re-did this PR based on the above feedback and also realizing that we can better encapsulate the controls by making them responsible for their own initialization. Let me know if you'd like any refactors. |
| # reinit hardware as specified by the new cfg context (after pedalboard change, etc.) | ||
| self.cfg = self.default_cfg.copy() | ||
|
|
||
| self.__init_midi_default() |
There was a problem hiding this comment.
This just does the same as the "pedalboard-specific config" below.
| # Footswitch configuration | ||
| self.__init_footswitches(self.cfg) |
There was a problem hiding this comment.
Same for this; already done below.
When using e.g. expression pedals with MOD pedalboard, this PR adds an initial "sync" where we read the value of the GPIO pin and send a MIDI message so that we don't have to e.g. wiggle the pedal to get it to reflect the current state of the analog input.