Pattrstorage | Select-operate based on Slot-Content

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
sydy
Posts: 155
Joined: Tue Mar 21, 2017 1:34 pm

Pattrstorage | Select-operate based on Slot-Content

Post by sydy » Fri Jul 26, 2019 3:50 pm

Hy,

These days I was working with bach and enjoyed it as always.
But there two things I'm not really happy about. I know that they have been discussed but – sorry – I'd like to insist again because they seem important – at least to me. Please apologize if this message is long. I'd be also glad to have some feedback if you think that my "problems" are the result of an inefficient coding.

1. The pattrstorage problem.
It's, at least for me, a real problem. The pattrworld, Pattrstorage is a very powerful tool in max, especially, when you're working with a large amount of data. Not only to store data, but also to transport, query, modify etc. A little example. I've built, nothing new, a synth with advanced random features concerning the envelopes. The synth works either as a "normal" synth with midi, osc or whatever controls. But it works also through "remote" message control. This controls should be presented as a score, like the beautiful bach.score, roll.
That means that I need two ways of (parameter) representations, which are complementary. The first is, let's say, an enhanced score (with bgslots, breakpoints etc.) and the second as a typical UI, which we all know from our maxpatches. The score allows a (selective) reduction of complexity and of course all the advantages of symbolic representation. The second is a clear, parametrical representation of all (active) data but on the same "page", instead of beeing layered into a bach.slot. ––
To query (and often modify) the data in the "normal" maxbased UI, I use autopattr and pattrstorage (often grab etc., works also very well with javascript...).
Anyway, I'd love to use directly the bach.slot as function or whatever editor-UI. Unfortunately, that's problematic for different reasons – am I wrong? The first reason is that the bach.slots are not seen by pattrstorage. Yes, there are workarounds (for eg. bach.slot and textedit as patterized object), but if you have a certain amount of data the @out t option can seriously slow down your data flow (traumatized), so It's probably not an option if your poly runs already on 16+ voices and you ask max to do a lot of random stuff with maybe a javascript or two on every event.
So what would be definitely great:
A pattrizeable bach.slots where you can decide if the data will be saved in the pattrstorage as native or text, i.e. maxformat (is this completely crazy?). That would allow me to quit using the function slot, and other object which are poor tools compared to the bach.slot. You could even use the z-slot as a multidimensional UI...

My (human-network) support-suggestion to the problem:
a) All members of the forum send a mail to cycling asking for, I quote Daniele,
the enhanced support for pattrstorage (prevent interpolation and "store state" only at given moments)
.
b) I'll post it on the Max/Msp facebook to give this request more public.

2.Select-operate in score,rolls based on Slot-content
Please add this feature. I'm sure it's a difficult task, but hey, if the slot as a tool is so powerfull for parameterstorage we should also be enabled to operate on it without having to look inside each slot. Of course, there are workarounds through lambda but that also means a lot of naming renaming and so on stuff, which makes your life a bit less happy when working with bach. So having the possibility to select notes based on their slot-content would make me happy :–) and seems very usefull.

Sorry for beeing so long. And thanks to your attention.
Wish you all a nice evenening,
m.

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: Pattrstorage | Select-operate based on Slot-Content

Post by danieleghisi » Fri Jul 26, 2019 7:49 pm

Hi sydy, I agree, both things are needed.

#1 is really impossible for us to code, until Cycling gives us that enhanced support for pattrstorage in their SDK. As you said: we need to be able to prevent interpolation, and we need to be able to only store the state at specific points, and not whenever the object is changed – I think pattrstorage is designed for "simple" objects, having as a state a single number or a short list, therefore it's no big deal to update the state whenever the mouse drags the slider bar, but can you imagine doing the same thing for a complex score while dragging a note?

As for #2, I completely agree: it's something I have also been needing. I have postponed adding a specific message ("select note if slot", for instance) beacuse there are intricacies. It is unclear to me what its syntax should be. And also, how do you treat different kind of slots? (functions have multiple points, each having multiple values; not to mention matrices, text, etc. etc.).
To me, the complete answer will only be when the scripting language (bell) used in [bach.eval] will extend to roll and score.
One may then do things such as "select note if note.slot:2.point:3.x > 2", or "select note if note.slot:3==note.prev.slot:3", well, you see the point.
But this requires adding to bell an object system; it's in the future, but it's quite far, to be honest.
That's why I am willing to consider adding a specific message as a temporary patch; if so, that's unfortunately going to be limited. I hesitate a bit. Can you give me (even privately) some examples of operations you constantly need? What kind of selection/operation messages would you need?

Daniele

sydy
Posts: 155
Joined: Tue Mar 21, 2017 1:34 pm

Re: Pattrstorage | Select-operate based on Slot-Content

Post by sydy » Wed Aug 14, 2019 2:11 pm

#1 ok. I'll wait for future devs. It's quite clear that this is a complicated issue.

#2
I think your conception sounds good. Although I'd be already happy about simpler query-possibilities than "select note if note.slot:2.point:3.x > 2", or "select note if note.slot:3==note.prev.slot:3"

The operate-on-selection-section contains already some useful stuff. Here are the things I'd love to have and which might not be so complicated as the above-mentioned implementation with the bell object system.

- select note where <slotname or slotnumber> == null (for empty slots)

operate on lll.slots : (realy usefull to me for generative elements or other stuff)
- select note where <slotname/slotnumer> <operators> <lll-element or full path>
- change slotitem <slotname/slotnumer> <lll-address or full path>
I might have tried it the wrong way. As I understand it you can't give an llll-slot the address of a specific element in the llll you want to change, delete or whatever. I tried it with nil... but it creates just an empty ( )

select function-slots based on simple content definition:
- select note where <slotname/slotnumer> <operators> <coordinates> @thresh (maybe even number of point...)
(I can then make better use of the existing change-,append etc.)

operate on the matrix-slots:
- select note where <slotname/slotnumer> <operators> <matrix values>
- change slotitem <slotname/slotnumer> <matrix values>

I don't know if this is particularly difficult. But it seems to me that it stays close to the functionalities you already implemented.
Let me know if there is a way to get these commands.

Thanks so much in advance and have a nice day.
m

gregoirelorieux
Posts: 5
Joined: Mon Mar 21, 2016 9:59 pm

Re: Pattrstorage | Select-operate based on Slot-Content

Post by gregoirelorieux » Tue Nov 05, 2019 3:27 pm

Hi all,
I'd just like to add a +1 to this one :
"select if slot 2 == -12"
"select if slot 23 == cross"

:)

belljonathan
Posts: 11
Joined: Fri Mar 24, 2017 12:48 pm

Re: Pattrstorage | Select-operate based on Slot-Content

Post by belljonathan » Fri Dec 06, 2019 6:32 pm

Hello!

I thought I should also reply to this thread to confirm that being able to select notes according to their slot content could be handy indeed.

For instance in my case, some notes of the score have an empty notehead, which I could select with something like "sel if slot 10 == none".

Cheers, and congrats again on the new release!

Jonathan

Post Reply