diff --git a/pd/src/x_midi.c b/pd/src/x_midi.c
index 84c9e06bb218edb9e3403be606ee55117234b1f3..b98034e1b50913476d55824046649503e3ddbcbd 100644
--- a/pd/src/x_midi.c
+++ b/pd/src/x_midi.c
@@ -356,7 +356,11 @@ void inmidi_pitchbend(int portno, int channel, int value)
     if (pd_this->pd_bendin_sym->s_thing)
     {
         t_atom at[2];
-        SETFLOAT(at, value-8192); // Ico fix the offset of the incoming pitchbend
+        // AG: -legacy behavior was changed so that it is consistent with
+        // vanilla bendin.
+        extern int sys_legacy;
+        int shift = sys_legacy ? 0 : 8192;
+        SETFLOAT(at, value-shift); // Ico fix the offset of the incoming pitchbend
         SETFLOAT(at+1, (channel + (portno << 4) + 1));
         pd_list(pd_this->pd_bendin_sym->s_thing, &s_list, 2, at);
     }