Setting groups via message

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
simonluca
Posts: 2
Joined: Mon Oct 23, 2017 8:32 am

Setting groups via message

Post by simonluca » Mon Oct 23, 2017 8:48 am

Hello Daniele and Andrea,
I'd like to set groups in bach.roll via message and according to the Help this should be possible, but I'm not getting how:
"the group header element is only a way to embed or save such information with the object. Nevertheless, nothing in principle prevents you from setting groups via message." The Roll doesn't recognize "group" or "groups" messages, so I suppose i should somehow modify the header inserting the group infos there with the provided syntax, but I can't figure out how.

My goal is:
dumpselection -> do something on the selected chords -> refresh the (same or another) roll with the processed AND grouped chords

is that possible?

Have a nice day and thank you!

Simonluca

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

Re: Setting groups via message

Post by danieleghisi » Mon Oct 23, 2017 2:55 pm

Hi,

yes it is possible, although it is undocumented and hence subject to change.
You can see the groups syntax if you send "dump groups", and you can set the groups e.g. by sending something like

( groups ( ( 1 1 ) ( 2 3 ) ( 1 4 ) ) )

notice the external ( ), as any other heather element (e.g. slotinfo, commands...).

This groups 1st chor of voice 1, 3rd chord of voice 2 and 4th chord of voice 1 together.

Hope this helps,
d

simonluca
Posts: 2
Joined: Mon Oct 23, 2017 8:32 am

Re: Setting groups via message

Post by simonluca » Mon Oct 23, 2017 3:39 pm

Ciao Daniele,
thank you.
I assume that being in the header they would be lost if I cut&paste the content. So maybe a good approach would be to append some tag (Group 1, group 2, group n) to the chords name so the grouping information wouldn't be lost.

SL

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

Re: Setting groups via message

Post by danieleghisi » Mon Oct 23, 2017 10:59 pm

No, unfortunately cut'n'paste won't preserve groups, not at present.
A better approach might be using #names, then selecting the elements with a given name (#sel) and then Cmd/Ctrl+G to group them?

Post Reply