Skip to content

Improve bendin compatibility with vanilla.

Albert Gräf requested to merge aggraef/purr-data:fix-bendin into master

I'm really getting fed up by this, it bites me whenever I'm creating patches that use MIDI and are supposed to work with both Purr Data and Vanilla. Right now it's impossible to make this issue go away without manually editing patches (which I don't want to do) or using the -legacy option (which I don't like either, because it "fixes" bendin but also disables all the iemgui positioning goodness in Purr Data).

Anyway, here goes. The MR contains both the required code changes and corresponding changes in the documentation (bendin and bendout help patches). The blurb from the 1st commit explains it all:

This makes bendin use the vanilla range of 0..16383 by default. As was observed a long time ago, this is at odds with the bendout range of -8192..8191, and was thus fixed in pd-l2ork at some point. But Miller has decided that this bug won't ever be fixed in vanilla, and this is even documented in vanilla's midi-help.pd patch.

This discrepancy breaks countless patches involving MIDI. I'm running into this constantly myself. It's been possible to use -legacy to get vanilla's bendin, but it's better not to conflate legacy iemgui positioning issues with the bendin implementation. The former won't usually break interoperability, but the latter does.

So we introduce a new -correct-bendin option instead. Anyone who relies on pd-l2ork's bendin implementation can continue using it by putting that option into the startup options, while most people can run MIDI patches written for vanilla and have them just work OOTB.

We should have done it that way from the beginning, but hindsight is 20/20.

Edited by Albert Gräf

Merge request reports