I’ve created objects for a footswitch, a bat switch, a potentiometer; I’ve created an object for the open effects box itself, with 4 pots, 2 bats, and 2 foot switches.
Plan is to implement handling of the relays, screen, and LEDs in the OpenEffectsBoxHW object.
Current code is pushed to my Git repository.
In my plan to have an object for the open effects box as a whole, including the firmware and the overall structure of the user interface, and another to wrap the physical object including the pin assignments, switch handling, etc., I wanted to have the hardware wrapper able to call back to the overall object when a switch changes state or is held to auto-repeat. The callback cannot be a static function, as it needs to modify member variables.
While it is apparently possible for an object to set a callback to one of its own methods, that callback has to include some way to refer to the object itself, so that the object structure and variables are available. However, that requires the hardware wrapper’s setCallback method to know about the calling class. Thus the hardware wrapper class has to include the calling class’ header file; but the calling class has to include the hardware wrapper class’ header file, since it’s instantiating that class for part of its functionality.
Seems like an infinite loop of inclusion; this can be protected in the usual way, but I haven’t been able to make it work.
Thus I’m going to abandon this line of attack and send a bunch of pointers to the hardware wrapper so it can set flags “thisThingyHasChangedState” for the calling class to poll. Ugh.
I have been working, both for myself and for my UMass classes, with the Open Effects Project as instantiated by Øyvind Mjanger’s company OnkartGromt.
Being more of a software geek than a hardware geek, I started by writing code to exercise all the hardware stuff – switches, knobs, relays, and jacks. Having gotten this under my belt, I’m now refactoring the code into object-oriented modules to make it clearer and cleaner and just all-around easier to work with.
If you are a UMass Amherst EE or CSE student and want to work with audio effects, check out my course ECE297DP on the M5 web site!