Go Down

Topic: Virtual, variable resistors, with saved presets recallable by MIDI (Read 21328 times) previous topic - next topic


Dare I say the soldering is done?!  

It's all closed up, and working great!  During play, there's absolutely no buzzing or injected noise whatsoever.  When the gain is turned up really loud (louder than I'll typically run it), there is some clicking when turning the Drive and Level knobs, but other than that, it is completely silent.

Now back to the software improvements.  For my own sense of organization, here is the list of things I'm looking to improve in the code:

  • Maybe change POT readings to ABS function?  Need to research more to know if it's worth it.
  • Instead of dividing by 4 to go from analog reading of 0-1023 to digipot value of 0-255, may change to >>2 if it uses less processor cycles
  • Move the following into EEPROM storage:
    • Array which stores preset values
    • MIDI Channel selection
    • Brightness selection
    • Active preset recalled, so it remembers when powered back on

  • Remove setting the Digi-POT variables to 0 upon power up, as the Digi-POTs have non-volitile memory and will remember
  • Add a menu which enables:
    • MIDI channel selection
    • Brightness selection
    • Possibly add an option for enabling MIDI expression pedal control over Drive or Level pot, with menu item for turning feature on, selecting which POT to control, and selecting which CC# to listen on

  • Make the preset number flash 3 times when a preset store function has completed
  • Add code comments to show EEPROM memory location where different items are stored (because I'll forget over time)
  • Add display item to show when the active values are different from what was recalled in the preset (light up a decimal point)

And, here is how it sits now:



    I don't mean to keep spamming the forum here ... I'm just using this as my log ... and in case anyone is following, here is the latest code build (attached).

    • The code now has preset values, MIDI channel, display brightness and last active preset number stored in EEPROM.  I also removed the arrays.  This significantly decreased the compiled code size of course, and it loads much faster now.  It went from 73% used down to 30% used.
    • I also made it so the Digi-POT values will not be updated until the POT's physical location is matched up with the currently applied values.  After that has happened, real-time updates occur when turning the knobs
    • I've added a feature to display a decimal point if the currently applied Digi-POT value is different from the value recalled by the preset.  Of course this only kicks on after the POT is actually controlling the Digi-POT (as stated in the item above).  I've set the 1st character position decimal point to indicate a variance with the Level POT, and the 2nd place decimal point to indicate a variance with the Drive POT.
    • Upon power up, it now recalls the preset which was active when it was powered down.  To do this, I had to use an EEPROM location to store the preset number when a preset save, or recall, happens.  I used EEPROM.update for it though, so maybe it'll last a long time?  But I'm not sure, seeing as I'll be changing presets quite a lot using this live. 
    • I added a double flash to the display when a preset is saved, and a single flash when a preset is recalled.
    • And I added comments to the beginning to document EEPROM storage locations for everything.

    I still want to add a menu feature, so I can adjust MIDI channel, display brightness, and possibly other things ... but for now, it's functional and usable on my pedal board like this :)

    Question on menus:  Is it a best practice to build a menu structure in a separate tab, and call it like a library?  I'll have to Google building nested menus in IDE and see how folks are doing it.

    Thanks again for the help, I really can't express my gratitude enough guys!

Go Up