Author Topic: How to save presets?  (Read 474 times)

0 Members and 1 Guest are viewing this topic.

mimmotronics

How to save presets?
« on: August 29, 2017, 02:10:29 PM »
So I want to incorporate the idea of saving preset parameters to some sort of memory in future builds..problem is, the only way I know how to accomplish this is to save on RAM chips..which are volatile. I know I could use an SD card, but I'm trying to see if there are better ways.

Does anybody have an idea for how to write preset parameters permanently? Similar to how the Delta Lab TimeLine rack units save their parameters, or even a basic form of loop station pedals (except instead of recording real-time audio it saves presets, much less memory intensive). I know the Delta Labs use 4.8V PCB mount rechargables to save their presets, but how does BOSS or TC accomplish it in their loop station lines?
Mimmotronics.com is where I document progress on effects pedal repairs, mods, builds, and audio circuit design. Follow me on Instagram and Facebook for updates. :)

Ice-9

Re: How to save presets?
« Reply #1 on: August 29, 2017, 04:02:38 PM »
The memory chips that are suitable for this are EEPROM's. What are you intending to use to control the patches and saving to memory, it would be possible to use a PIC as the micro controller or an Arduino. Depending on the amount of patch saving and such you could use the internal memory on the Arduino to save the settings without the need for an external EEPROM.
It's fairly straight forward, if you want to start it , press start. You can work out the rest of the controls for yourself !
Do me a lemon, that a poor IQ for a glass of water.

mimmotronics

Re: How to save presets?
« Reply #2 on: August 30, 2017, 02:03:30 AM »
That was great info Ice-9, thanks for the response. I essentially want to save potentiometer values in a preset bank. For example, the Rate of an LFO or the Repeats of an Echo would be good candidates for what I'm after.

I've thought about using encoders as inputs and digital pots as settable outputs. An Atmel micro would be the device at the heart of it. According to the recommendation by Ice-9, I could use an EEPROM to save the encoder value in, say, "preset 1" (memory address 0). Then when "preset 1" is selected the micro can read the saved value and interpret it as an output to the digital pot.

What should I understand about that approach?
Mimmotronics.com is where I document progress on effects pedal repairs, mods, builds, and audio circuit design. Follow me on Instagram and Facebook for updates. :)

ElectricDruid

Re: How to save presets?
« Reply #3 on: August 30, 2017, 06:05:20 AM »
You're pretty much there, at that. Writing a routine to write to EEPROM is often a bit tricky, since programming EEPROM is slow and modern chips are fast, so there's usually some waiting around to do ("put data in a register, wait until something happens, put next data in" sort of thing). But there are usually routines available for that sort of thing, so you probably don't have to do it from scratch.

One other thing to consider is what happens when you're on a patch setting and someone twists the knobs. Does the sound alter? Can you "edit" the patch settings? If so, does the value jump directly to the knob setting, or only pick it up when the knob passes the stored setting?
Easiest is to avoid editing, but you may want to add it.

In terms of memory, you won't need much. If you had four controls, even just 128 bytes of EEPROM would be 32 patches (a byte per control is enough - don't bother storing knob positions to 10 or 12-bit accuracy, there's no point).

HTH,
Tom

mimmotronics

Re: How to save presets?
« Reply #4 on: August 30, 2017, 12:20:09 PM »
One other thing to consider is what happens when you're on a patch setting and someone twists the knobs. Does the sound alter? Can you "edit" the patch settings? If so, does the value jump directly to the knob setting, or only pick it up when the knob passes the stored setting?
Easiest is to avoid editing, but you may want to add it.

Per editing, I'd like to have it so there is a dedicated Edit mode. Have a dedicated switch or hold one down for 3+ seconds to enable or disable editing, providing a preset is selected. Disabling Edit Mode would automatically save to the EEPROM the current encoder positions.

If a knob would turn while a setting was active, well that would just kick it out of whatever selected preset. Instead of the potentiometer data being read by the EEPROM it would automatically route back to reading from the encoders upon turning them, effectively kicking it out of the preset.

Quote
Writing a routine to write to EEPROM is often a bit tricky, since programming EEPROM is slow and modern chips are fast, so there's usually some waiting around to do ("put data in a register, wait until something happens, put next data in" sort of thing). But there are usually routines available for that sort of thing, so you probably don't have to do it from scratch.

I picked this up off the Arduino EEPROM library: https://www.arduino.cc/en/Reference/EEPROMWrite

An EEPROM write takes 3.3 ms to complete.

If this is the amount of time it takes to write to the chip I don't have much worry for it. As long as there's an ample amount of delay between clearing and loading the register...maybe I'm naive?
Mimmotronics.com is where I document progress on effects pedal repairs, mods, builds, and audio circuit design. Follow me on Instagram and Facebook for updates. :)

potul

Re: How to save presets?
« Reply #5 on: August 31, 2017, 04:55:45 PM »
3.3 ms is not an issue for the user. But as ElectricDruid was saying, with current uC, a lot of things can happen in 3.3ms, so you need to be sure you don't try do continue writing other things until the write operation is done.
If you use an arduino, it should be pretty straight forward, probably the library already takes care of it. It all depends on the platform you develop.

I did a project in the past with arduino that stored presets and did not have any issue using the eeprom library.

Hatredman

Re: How to save presets?
« Reply #6 on: August 31, 2017, 09:51:01 PM »
 "Disabling Edit Mode would automatically save to the EEPROM the current encoder positions."

I would do it a bit differently. What if you want to change some parameter (say, reverb intensity) for a particular venue, but don't want to overwrite your carefully crafted preset that works most of the time. I'd have an explicit save function, and all your edits priotlr to saving would be discarded on power off if not saved.


--
Scarlett Johansson uses a Burst Box with her Telecaster.

Kirk Hammet invented the Burst Box.