Forum Rule: Always post complete source code & details to reproduce any issue!
-
What's the simplest way to make my teensy-synth able to store a few presets?
I'm currently building a teensy-synth with lots of knobs and I I'd would like to be able to store a couple of presets on it.
My Idea is that once a preset is loaded, the parameters shouldn't change unless a knob is turned.
Eg if I load a preset with a closed filter, but the filter knob is open, the preset shouldn't change unless i turn the filter knob.
Is there any way to do this?
Thanks!
-
EEPROM? which Teensy?
Are these controls pots or rot. encoders?
-
I'm using a teensy 3.5, mostly using analog potentiometers.
I figured EEPROM could be used in some way, but I'm not sure how to implement it.
Any idea how it could be done, or some link to where i can read more?
-
Well analog pots have physical state so you'd need a way to toggle between the pots' current values and stored values. It would
be complicated to adjust presets after the event as the pots aren't motorized (I presume!) so will not be at the same position as the stored
value necessarily.
There must be lots of resources on using EEPROM. Have you searched these forums for "EEPROM" for instance? Do you need more than
8 bits per pot to store? If not an array of bytes in EEPROM would be simplest.
-
Senior Member+

Originally Posted by
MarkT
Well analog pots have physical state so you'd need a way to toggle between the pots' current values and stored values. It would
be complicated to adjust presets after the event as the pots aren't motorized (I presume!) so will not be at the same position as the stored
value necessarily.
There must be lots of resources on using EEPROM. Have you searched these forums for "EEPROM" for instance? Do you need more than
8 bits per pot to store? If not an array of bytes in EEPROM would be simplest.
Or just use larger types. IIRC, the EEPROM library was modified ages ago to support reading/writing arbitrary types.
-
Senior Member
Here's a link to the tool:
https://playground.arduino.cc/Code/EEPROMWriteAnything/
Also, if you will store not single variables but structures, I suggest you to use __attribute__((__packed__)) as descibed here:
https://cs50.stackexchange.com/quest...d-sizeof-error
-
Senior Member
Or put #pragma pack(push,1) before your structures and #pragma pack(pop) after as shown in the code snippet below:
Code:
#pragma pack(push,1)
struct nextionEventType {
char id;
union {
rep3Type reply3;
rep4Type reply4;
rep5Type reply5;
rep6Type reply6;
rep7Type reply7;
rep8Type reply8;
// uint8_t bytes[8];
};
}; // nextionEvent;
nextionEventType nextionEvent;
#pragma pack(pop)
-
Senior Member
for my sequencer project I use the 3.5 sd card. I hold 16 note and other values in an array and write the values of this array to a file on the sd card, and then read the file back when needed. this way I can have as many presets or favourite groups of values stored and recalled, and EEPROM size is note limiting. For example, a single files holds hteee 16 value buffers that contain note value, on/off state, slide, and accent.
-
Senior Member
i use a rotary with button combination, the rotary dials in the memory slot i want to save in, then one button retrieves what is in the memory and writes to the arrays that hold the values being applied for whatever, and another button writes the current values to the card file slot. This way I can create new favourites or recall presets.
-

Originally Posted by
MarkT
Well analog pots have physical state so you'd need a way to toggle between the pots' current values and stored values. It would
be complicated to adjust presets after the event as the pots aren't motorized (I presume!) so will not be at the same position as the stored
value necessarily.
Yes, that's precisely why I've chosen rotary encoders for my MIDI controller. But, I've also seen analog synth pots that don't become enabled until their voltage level matches the preset's level (come to Mama first, then we can talk). But, I'm not convinced of that feasibility. JS
Since I also plan to have multiple banks/levels of granularity (to reduce physical knobs & buttons), I'm also using RGB backlit knobs & buttons to indicate levels and which bank is being controlled, i.e. Red bank @ 50% brightness level. Unfortunately, those rotary encoders have distinctive detents, instead of a smooth 'action' feel, plus they're ~$25 ea. 4 banks = 1/4 $
-
TeensySynth 4.1 PCB, Panel, 7 Pots

Originally Posted by
albnys
I'm currently building a teensy-synth with lots of knobs and I I'd would like to be able to store a couple of presets on it.
My Idea is that once a preset is loaded, the parameters shouldn't change unless a knob is turned.
Eg if I load a preset with a closed filter, but the filter knob is open, the preset shouldn't change unless i turn the filter knob.
Is there any way to do this?
Thanks!
Your project sounds very similar to this Teensy Synth project:
https://github.com/ElectroTechnique/TSynth-Teensy4.1
You might find the code useful to include within yours. FYI, I purchased the Teensy Synth front panel, circuit board, and pots to see how it's multiplexers were used, prior to building my own design with rotary encoders.
IOW, now I have the whole kit and no intentions of using it. If you're interested, PM me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules