Background:

Last week I made the (what I now know as "life-altering") commitment to buy (and did) my first usb+midi keyboard controller, a Samson Graphite M25. I have since set up my shop (since given my tools+configuration I could not use the Graphite Preset Editor and because everything works better if you get pd involved :---)) to run the kb into pd then into amsynth via jack, using pd as the midi interface: kb>pd>amsynth>out.

In the process, one thing I did was upgrade the 32 "pre", preset button knobs, to 120, using the ideas included in this abstraction: convert the 4 pads and their binary-ness into decimals, so I can then tell pd to make the knobs, 8x15, instead of 8x4 (the default PRE pad count), see below for clarification...


Requirement(s): Linux and shell external (though I am pretty sure a version using the "until" object is do-able, I did not find one and know the shell waaayyy better than until or even metro.

Synopsis: by pushing on various combinations of pads (could actually be any set of cc(?)'s) the resulting binary number is turned into a decimal which can then be used to re-route or set a different control, ex. PROG.

(from the _help file comments):

Purpose: convert binary values to decimals in order to simplify and expand the rerouting from one control to another, ex. from POLTYTOUCH to PROG.

The left inlet takes a routing/control value,;
ex. note/polytouch control, etc.;
the middle inlet takes the value from that control;
and the right inlet takes a bang to trigger/get/output;
the decimal equivalent.

4pad/trigger to 16 pad/trigger binary-to-decimal converter;
the patch converts the pressing of multiple pads;
to a binary number then to a decimal so that;
for ex. a 4 pad control can send signals from 1-15.

the "shell" external is required;
and the shell script, named:bin2dec_pd, is;
also required. It includes only a single line, echo "$((2#$1))".

FYI: in the polytouch instance, the control is looking for;
127 as a trigger value, so the pads must be pushed Completely down.

I DO believe a metro or until version;
of this is also possible but the shell was more expedient.;
-svanya

abs_4to16pads_bin_conv_sv.zip

abs_4to16pads_bin_conv_help_sv.png