News:

SMF for DIYStompboxes.com!

Main Menu

How to save presets?

Started by mimmotronics, August 29, 2017, 02:10:29 PM

Previous topic - Next topic

mimmotronics

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?

Ice-9

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.
www.stanleyfx.co.uk

Sanity: doing the same thing over and over again and expecting the same result. Mick Taylor

Please at least have 1 forum post before sending me a PM demanding something.

mimmotronics

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?

ElectricDruid

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

Quote from: ElectricDruid on August 30, 2017, 06:05:20 AM
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?

potul

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

 "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.