#N canvas 696 372 460 365 12;
#X obj 22 263 bendinfix;
#X floatatom 22 292 5 0 0 0 - - -, f 5;
#X msg 78 233 0;
#X obj 22 233 bendin;
#X text 21 321 corrected pitch bend value (-8192 - 8191 range);
#X text 22 206 pitch bend input;
#X text 113 234 Passing 0 as input gives the amount by which the result
is shifted. This will be -8192 for a vanilla-compatible bendin implementation
\, 0 otherwise., f 46;
#N canvas 477 282 494 344 META 0;
#X text 12 5 KEYWORDS control MIDI;
#X text 12 25 LICENSE MIT;
#X text 12 85 INLET_0 float;
#X text 12 105 OUTLET_0 float;
#X text 12 129 AUTHOR Albert Gräf;
#X text 12 149 WEBSITE https://agraef.github.io/purr-data/;
#X text 12 169 RELEASE_DATE 2020;
#X text 12 192 HELP_PATCH_AUTHORS Albert Gräf;
#X text 12 45 DESCRIPTION translate bendin output to signed values
for all Pd flavors;
#X restore 380 335 pd META;
#X text 18 2 bendinfix - correct bendin values for all Pd flavors;
#X text 17 41 Background: Pd has a long-standing bug (which won't be
fixed due to backward compatibility concerns) in that its bendin range
(0 - 16383) doesn't match its bendout range (-8192 - 8191). The former
is what MIDI readily yields \, while the latter is more convenient
for translating pitch bends into frequency offsets. The bendinfix object
translates bendin's output to the correct (signed) range \, and works
across all Pd flavors \, including Pd-L2ork and Purr Data where bendin
returns a signed result by default.;
#X connect 0 0 1 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
