You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
what about controlling the contrast of the influence? Contrast zero would be like zoom = 0, contrast 1 would be only influence the strongest two (explicitly not going down to one, for keeping with authoritarian holistic principles). One may still want to have zoom as well, and combine the two.
contrast 0.0 = grey is all influences scaled to 0.5 * zoom.
contrast 0.5 = normal, all influences as the weights say - this is what zoom 0.0-1.0 already does
contrast 1.0 = b/w, means the high weights remain, and the low weights are suppressed by scaling down to 0
(like black&white contrast by keeping the top values fixed, and scaling pixels below it darker, clipping at 0=black )
// orig julian example for contrast
(
a = { 1.0.rand2 } ! 8;
f = { |x, contrast, minItems = 2|
var y = (x - contrast);
var minval = y.copy.sort.clipAt(minItems);
y.collect { |x| x.max(0) }.normalize(0, y.maxItem + contrast)
};
[0, 0.2, 0.5, 0.8, 1].collect { |c| f.(a, c) }.plot("contrasts [0, 0.2, 0.5, 0.8, 1]")
)
/* half-solution for 0-1 range
maximum abs value always remains where it is,
the other values are pushed toward zero
- at contrast 0, leave everything untouched [should be 0.5]
- at contrast 1, the top n minItems remain active, all others 0
- [ range 0-0.5 of proposal not done yet]
*/
// use bipolar values for 8 weights, as in influx
a = { 1.0.rand2 } ! 8;
a.postln.plot("orig");
(
// top value remains where it is
// minimum 2 elements remain active:
// minimum of 3 input elements needed ...
// contrast 0 leaves all values untouched,
f = { |x, contrast = 1, minItems = 2|
var absvals = x.abs;
var sortedabsvals = absvals.copy.sort { arg a, b; a > b };
var maxabs = sortedabsvals[0];
var minabs = sortedabsvals[minItems];
absvals.collect { |xval, i| xval.linlin(minabs * contrast, maxabs, 0, maxabs) * x[i].sign };
};
f.value(a, 1.0).plot;
)
// different contrast values with minItems 2
[0, 0.2, 0.5, 0.8, 1].collect { |c| f.(a, c, 2) }.plot("contrasts [0, 0.2, 0.5, 0.8, 1]", 400@400)
// different contrast values with minItems 1
[0, 0.2, 0.5, 0.8, 1].collect { |c| f.(a, c, 1) }.plot("contrasts [0, 0.2, 0.5, 0.8, 1]", 400@400)
// different contrast values with minItems 3
[0, 0.2, 0.5, 0.8, 1].collect { |c| f.(a, c, 3) }.plot("contrasts [0, 0.2, 0.5, 0.8, 1]", 400@400)
The text was updated successfully, but these errors were encountered:
// from @telephon email:
what about controlling the contrast of the influence? Contrast zero would be like zoom = 0, contrast 1 would be only influence the strongest two (explicitly not going down to one, for keeping with authoritarian holistic principles). One may still want to have zoom as well, and combine the two.
(like black&white contrast by keeping the top values fixed, and scaling pixels below it darker, clipping at 0=black )
The text was updated successfully, but these errors were encountered: