"reset to default value" question!


#1

Hey :slight_smile:

Was wondering if it is possible to acces "reset to default value" for a parameter, from within a patch? It would be super great to be able to push a button and all parameters on an object would be reset to the default value.

Any ideas?

Thanks!


#2

Going to bump this one. I have done a little bit of research and I think I found the code for the default value function, for one parameter type:

@Override
public void applyDefaultValue() {
if (((ParameterFrac32) parameter).DefaultValue != null) {
value.setRaw(((ParameterFrac32) parameter).DefaultValue.getRaw());
} else {
value.setRaw(0);
}
updateV();
needsTransmit = true;
}

But not 100% sure how to address it. Going to be trying a bit again tommorow, I think, comparing it to how I use the recall parameter value thing.


#3

preset manager is one way to do this, alternatively for simple cases you can embed as patch/object and redefine the parameter as an input, then manipulate it the normal way, while being mindful of any increases in dsp load.


#4

Yeah the reason to want this was actually to try to avoid using preset manager or use the PExParameterChange function. The param exchange function is great for sequencers you only need to use one of them for a whole sequence. But using it on everything, can be a bit tough on Axoloti.

If you could simply have a reset button that reset every parameter of an object it would be a lot "cheaper" for simpler setups...... I think :slight_smile: Cause the function is already there and the values etc are all ready set in the editor, you simply just need to trigger it.

Will see, I might try again one of the days. Have learned a little bit more codewise since i tried last time :slight_smile: