abs-fetch-slider: using a value (slider) multiple ways based on creation argument
reuse a value by only changing the value;
once the value matches the previously set value;
for that index/creation argumet.;
Getting a (hardware) knob to serve multiple functions;
by only having it change its value once the previous value for that index is hit.;
(See the help file for details, using two ctlin to set multiple values)
I have found it very frustrating that when using hardware you can't use one knob for multiple purposes because the knob is literally always in the last state you left it.;
one creation argument: the identifying index;
two inlets: left: the incoming value and right the index;
one outlet the value for that index
When you change the index, just change the knob until the audio, image, value, etc., i.e. result starts changing.
It will ONLY change once the previously set value for that index is hit..
So it "saves state".
Whenever you make a patch, create a .pd file called "scraps", "trashcan", etc., ".pd" and include that patch as an abstraction in your main patch.
Then when you want to save a piece/section of code, comments (to yourself) you make, etc., just cut and paste them into that abstraction (for you to retrieve later if you want or need them).
Then once you've finished your patch/work just delete that abstraction.
I hope this makes your life easier and you less concerned about losing your work, ...even with the Undo feature.
Peace through sharing.
This is a real world example:
Controlling amsynth with an 8 knob usb midi controller
Aligning the midi map to the patch or sending in your current midi map to the patch, you can control the (primary) 8 sections of amsynth with a (standard) 8 knob usb midi controller. (I've added a few sliders to control some of the params that don't "fit").
The jack connections need to look like the below.
the patch works out to:
The abs synchronizes one line and three sine curves using the controlling knob/cc's values (between 0 and 127), i.e. the input, as their angle and their frequency dependent on which sine curve (2^n). Thus, it captures all combinations, just with fewer possible values depending on which sine curve is assigned to which outlet.
It takes 5 creation arguments:
$1 the identifying index for the abstraction
$2,$3,$4,$5 to determine which outlet receives which frequency/input. So, if used, for instance, with an adsr then [1p24p(sin) 1 0 1 2 3] then "a" would have 127 possible values, d 64, s 32, and r 16. Where as, in the case of ]1p24p(sin) 1 3 2 1 0] r would have 127, s 64, d 32, and a 16.
While it does limit the possible values for the controls/parameters to [127,64,32,16] (respectively) it offers a Lot of flexibity (as the -help file shows) and is very easy to understand.
So basically, for example, in a given synth setup using the abs as input and only 2 knobs/cc you control 16,129 (127^2) adsr presets.
The state chart is as follows (where🔺🔻represents a value going either up or down, and each arrow represents a set of 16 possible values).
0 1 2 3
I hope this is easy to understand and that it might "serve(s) you well".
Love through Music,
Let me know if you need help with this. I will (power allowing:-)) be happy to oblige.
p.s. the help files offers a lot of information and two examples (the classicsynth-help and 4 arrays to visually show what's happening).
I would hate to lose you to something as lowly as an external library ...
So have repackaged the patch without the moonlib dependency, so using vsliders instead of knobs.
s3s(sliders).zip (no moonlib dependency, vsliders instead of knobs)
Does is it work now?
I hope that helps and apologize for not doing this earlier.
p,s. as to libraries not loading: I do think it would be a good idea to ask about it. What you stand to gain far outweighs the cost. .
p.p.s. Thank you, for bringing this to my attention. Will include the vsliders version (above) in the original post. There's always room for improvement.
Here is the Miller/Help adsr with an added layer, such that, all 4 parameters can be controlled via one value, [0..127], in other words one midi [ctrlin].
It is mapped such that it includes all possible 81 combinations (of 3 values per parameter).
It takes a list of 12 values (on the right most inlet) to set the 3 values/parameter.
And the 2nd from right inlet as the ctrlin, i.e. [0..127] value, to change the values.
It includes a (far) right outlet indicating which of the 81 states the adsr is in.
"May it serve you well."
p.s. While sacrificing granularity, it makes up for it with compactness. Since, given only two knobs (one for filter and one for amp), I get 6561 comibinations.
p.p.s. As long as, I (the user) enters 12 appreciated values for the values list.