storing presets for data within a bpatcher
I’m making a patch intended for bpatcher to work with the dials from my midi controller. It has interface controls for scaling limits and output type (float, int, signal). It also has a learn mode for assigning the CC# it accepts input from. I would like to be able to save presets of the values within all of the bpatcher instances but I am unsure how to get started.
My first approach had a preset object outside the bpatchers that sent store and recall messages, and in the bpatcher a receive object would store or recall the preset value. It works fine, but only until the patch is closed, of course.
The documentation and google searches seem to point to the use of the pattr objects and storing to a coll. Does anyone have an example of using this approach?
For your Bpatcher dials, attach a pattr with argument #1_Name -( where Name is a meaningful identifier for that particular control in the Bpattr. Autopattr should also work for multiple controls. In the Bpatcher inspector, the first argument you provide will be the prefix and identifier of the pattr objects. So, if the first argument for the instance is ONE, the pattr will appear to your pattrstorage as ONE_Name. Rinse and repeat for subsequent BPatchers. #0 will assign a unique identifier to each instance, but I’m not sure if the instances will have the same Identifier next time they are reloaded…
Save as BP_pattrtest
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 436.3ocyT0saBCBF851mhF1scFQ2p0c2dNLlFrfSLUnAnctY7ce.skwzpSWV b6hRx2Ob5467cB6BC.K3aIRPzSQyhBB1EFDXSYRDzFG.1f1lWfj11.XJp.D2 TnFIXnMDW9Yv4ckJEDIgoPJJmYpCaySw1t4KVe+DWuHgFEEQjQXnEEV7F1Vi UsgxJHJoOH5j7J0gY8+kYBRtpYrRF7XbTxjACiidXX2Yz71K0fi5sRRS2fkE bj9lycbSkuhxdwCvoIFTFM9HHM2XeXn4H9BUSF4UsTzmddGLKmyTBdQ1nt5J xVKGLrRIh5qEO8MsK2RcSNbeV3s.6UcMsKouaaGZFu9D8wmR+.wsemSBSrpF bpUBmBsAodaE8lTwEsP9YZIplfyzylFnLiDPWToZruANA9D9IaM614Z2Qmyw eE18jaoc+21sCGAuUtc3261g831g+2c6ov+RytEVPAkc3q8V9Zx+08ljWIx6 lx1WShfNxg0blxb18YtWz8FfUTLlv7c2XpzPQriiG4etT1.u.1j7CYSiTgJK qIBYKjVhnMyq4BSXRrMjxZBsHp2i0zt9SCMnsO7CF5XvSC -----------end_max5_patcher-----------
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 548.3ocyV0ziSCCD8ryuhHetTUmO6xMPhq.2QnHmjgtdUpSjsaovp8+N1icx lcU.wBs6tGpk73wuLu27rcuMhPq6OAZZ7ai+RLgbaDgfgbAHg4D5d9olNtFS itGzZ9NftxulANYv3Jng20EmLtfnEC2WeyaJFi8sdoQx2C3JuSI3ciqHOrWH 6.C9MRlktV7SLc1l0atO29ClwjYgnCJPCRC2H5kU1hw3IUZIac9p3jjT69i2 DFh+ZXWdfL+X.7oSoSKMvMMWKj6lAVRVgCrxqbvjgHxJbn41wcQQtgUmGcjs fNV9RpiLjtmIcLk4.Hu7BpiZSuBVzNl+BJiIrrymLxJQYLXGYWPYbI2X1ygL 9DEj7qbmOC9p+OAoFwGTib4HWMQx2+4J6pFkAzlETlzI9uzFVa+L1IKpQKKF iQ4pcgqpoe5ie3OpDdIHMA8GdgHI+eTIjv2srZIcXN+mbLHQc1FqcJ92nPrm n2g8L3cxviQrT7j4V+kRamc1TyOBsU1p2tkJGGE0GL92NISJGg1zIrm6mAbl 0JZ+sM2NjxxGwyUDJKyMfpBj75NXVqlPCB37afKxCHwJrkVYhuY56li8TDcZ mP93G0QF6h+vFst+fpYTeBuUGeOmassOgDuDaVNrGjy0h1VPN2m1JzN9fs6M KZ39aqlxWUUS9qppI6BVMdaDeX3HnzAHwBwdyvM8J2zhU3TgzOEQz9mWNJFy eajCs6h9ELibpcM -----------end_max5_patcher-----------
I think if you name them, the names will stick on reload – but I’m a n00b at this myself so pinch of salt.
Thx mate it’s a clever way than the basic preset object. The trick is to stay generic with bpatcher. So i have to exclude my pattrobject from the sub patch hope that max will keep the reference outside the sub-patch;)
Forums > MaxMSP