Despite what it says in the help, when you send ‘get mykey’ to [dict mydict] you get the key and the value out of the second output (not just the value). Usually I don’t want to know the key so I have to loose it somehow, usually by using [route mykey].
I feel like there should be a better way to do this, is there?
That’s perfectly acceptable. You can also do "unpack s i" and get the second outlet. That would allow to have different keys and not worry about route.
True, but I still have to think about if I need [unpack s i], [unpack s f] etc.
taking the right output from [zl.slice 1] is the best I have come up with so far.
Shame you can’t pass the name of the dict an an argument to [dict] could easily make an abstraction then.
It is a silly small point but being able to do something like [dictutil mydict get mykey] and jut get the value would be ideal, 1 object not 3 much less visual noise in the patch.
The fact that dicts now exist at all is really great, so I will stop moaning and keep patching.
I usually put a message object with $2 or $2 $3 if the key contains another dict ;]
I’m using the following a fair bit as an abstraction:
----------begin_max5_patcher---------- 453.3ocwU00aBBCE8Y3WQS2qLCEDXt21uikkkJzo0.ERo5zY7+9nW.GZ.EIn 6EZtezdOmy81xdSC77zsrbL5Uz6HCi8lFFfKsCiJaCbBcaXLMGRCKXemNeE1 pLjhsUAtyjrLlHBsfopiIVmjtVEyTvFIUdynpvkbwhOkrPUYgI19SrsPNNS0 KAdfg8DazGU6o7XT6xXka.iOFhGAku.RO6VW3uREJAMARF+ljSiaFIm+CDg3 TTmiHkKNBTsuCll5OV8TTfcOTdSbI.i8p+di71G2FMp4VXZRBST1jvCfZkXn ctYeAtQlMwyB4540A2ZPffVI.YjHPGCrxBdvZmVNWmVDnkE32iQUqNZaD6wY d0Y7zDEJFEe6ZR0Xr+L8xKf.MTMg7+cGtCMIhGpPOQZWUld8G07gEudnJ5Jw SET4NPertjN4L9yNPcvwbw4+O.Hm1+ohWd5ZYXM1qadn+3WDKWwETMkZjj6I 4rjGEwDMeJIhmSmGy.pZ2ZW7lfC4JvQeIrQR2U7X2C4I3gIO98.Mm0QuqpiS e6VOF731G4wYfvo7pFMKaCSlWcl.RJdQZUpTa5aAlbQoIbhXIaCuNeWS8ocv 7WPb5TS7 -----------end_max5_patcher-----------
same result as zl slice but might be handy to be able to route some other keys while you’re at it.
Forums > MaxMSP