Output saved presets entry numbers
Hi all!
I'm trying to find a way to output all the presets entry numbers I have stored.
Can be either from [pattrstorage] or the [preset]. I'm not using [coll] or [dictionary for this]
I was looking for something like a "flush" on a coll. But instead of the entries values I'd like to have the entry number.
Say I have saved presets on 101 and 201: I'd like to have "101" and "201" as output.
Checked the manual with no glory.
Any idea id this is even possible?
Thanks!
i would write me a little custom GUI to replace the preset object with, which would do both.
mmm... sounds interesting...
thanks Roman. But, just to give me an idea: what would you use in it? And how would you structure it?
lets presuppose you like how [preset] works otherwise., oyu just want to add this preset number thing.
then you would just recreate its look and how it works using images or image objects or lcd or whatever, put it in a bpacther, and give it the three required options: pressing button 7 sends out preset 7 from preset, holding alt writes one, and whenever you press a button it also outputs the number.
there is an interesting bug in this example. maybe someone know whats wrong. fix is included of course. :)
#P outlet 719 340 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 700 284 257 9109513 "number when written";
#P number 717 310 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 571 357 50 9109513 print;
#P newex 550 239 40 9109513 i;
#P window linecount 2;
#P comment 18 481 322 9109513 ??? this doesnt work for some reason and trace routing in max4 is not giving you what you would expect from the trigger object;
#P window linecount 1;
#P newex 641 219 44 9109513 t b i;
#P newex 550 277 84 9109513 gate 2;
#P newex 641 191 47 9109513 + 1;
#P button 561 72 20 0;
#P button 540 72 20 0;
#P button 519 72 20 0;
#P button 498 72 20 0;
#P button 561 51 20 0;
#P button 540 51 20 0;
#P button 519 51 20 0;
#P button 498 51 20 0;
#P newex 580 145 44 9109513 t i b;
#P newex 641 165 84 9109513 modifiers;
#P message 580 116 50 9109513 3;
#P newex 588 317 84 9109513 prepend store;
#P flonum 563 425 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 516 413 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpreset 3;
#X append 3 1 27 425 563 flonum float 0.18 \; 26 413 516 flonum float 0.07 \; 24 403 472 flonum float 0.08 \;;
#P preset 503 356 47 27;
#P flonum 472 403 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 208 234 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 252 261 67 0;
#P newex 127 367 50 9109513 print;
#P newex 72 228 84 9109513 gate 2;
#P newex 201 199 47 9109513 + 1;
#P button 122 75 20 0;
#P button 101 75 20 0;
#P button 80 75 20 0;
#P button 59 75 20 0;
#P button 122 54 20 0;
#P button 101 54 20 0;
#P button 80 54 20 0;
#P button 59 54 20 0;
#P newex 76 147 84 9109513 t i b;
#P toggle 276 202 15 0;
#P newex 210 171 84 9109513 modifiers;
#P message 88 115 50 9109513 3;
#P newex 135 259 84 9109513 prepend store;
#P flonum 113 427 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 66 415 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpreset 3;
#X append 1 1 5 427 113 flonum float 0. \; 4 415 66 flonum float 18. \; 2 405 22 flonum float 0. \;;
#X append 2 1 5 427 113 flonum float 0. \; 4 415 66 flonum float 18. \; 2 405 22 flonum float 0. \;;
#X append 3 1 5 427 113 flonum float 0. \; 4 415 66 flonum float 18. \; 2 405 22 flonum float 0. \;;
#P preset 41 301 47 27;
#P flonum 22 405 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 310 188 49 9109513 shift?;
#P window linecount 2;
#P comment 452 479 257 9109513 using an extra trigger here. you migth also want to replace modifiers with something better;
#P connect 46 0 48 0;
#P connect 41 1 28 0;
#P connect 41 1 46 0;
#P connect 3 0 2 0;
#P connect 20 0 3 0;
#P connect 6 0 3 0;
#P connect 3 0 4 0;
#P connect 19 0 20 0;
#P connect 7 0 10 0;
#P connect 13 0 7 0;
#P connect 3 0 5 0;
#P connect 20 0 21 0;
#P connect 6 0 21 0;
#P connect 20 1 6 0;
#P connect 10 0 20 1;
#P connect 8 0 19 0;
#P connect 19 0 23 0;
#P connect 10 1 8 0;
#P connect 23 0 22 0;
#P connect 8 0 9 0;
#P connect 25 0 24 0;
#P connect 41 0 25 0;
#P connect 28 0 25 0;
#P connect 25 0 26 0;
#P connect 42 0 44 0;
#P connect 42 1 41 0;
#P connect 25 0 27 0;
#P connect 41 0 45 0;
#P connect 28 0 45 0;
#P connect 34 0 29 0;
#P connect 29 0 31 0;
#P connect 31 0 44 1;
#P connect 44 0 41 1;
#P connect 31 1 30 0;
#P connect 30 0 40 0;
#P connect 40 0 42 0;
#P window clipboard copycount 49;
but to answer your question.
you could also add new features to it, for example adding a delete function right to the buttons GUI would be the next i´d do here.
another point is that making your own GUI is the only way how be allowed to move "it" out of the patch.
preset itself must reside in the mother patch, it wont work in abstractions or bpatchers.
but a custom GUI will also work in another window or across the internet.
furthermore, you could combine or control multiple preset objects that way.
so you dont only do this for your "number if written" output, you get a lot more. :)
I am not using preset that much, don't like it.
But to extract stored preset numbers is easily done.
Even faster if you anyway store the preset file to disk.
Otherwise
Thank you guys, they look indeed some interesting structures to study more!
I'm actually using lots of presets and pattrstorage, and will need to see if I can do everything I now do with the new scheme. BUT I have been forever complaining of CPU spikes when recalling presets (and especially presets that recall other presets), so I think I'm definitely investigating more on that!
Again, thanks!