Oh that’s a great idea about the array - it shouldn’t be too bad to implement.
However, I don’t think align command should be inline, should be a comment in the line before the array/block, as otherwise the code would need to be moved around in the event that the line would be too long. I’ll try to set that up and see how it goes.
I think the array data being populated with data is something that’s unique to supercollider, but the other datastructures (i.e. events) are somethings that have analogs in other languages. The general feeling there is that all text is aligned left, and even though it’s awkward at first, I find that over time it kind of fades away and in very large codebases (i.e. over 20-50k sloc) having the alignment consistently left works better because even though the intra-block consistency may be a bit off, having the same alignment type in every block works well.
This is the precedent set by other formatters and I’m inclined to agree with it through my experience.
In my mind your code would be formatted as:
~event = (
degree: [3, 5],
octave: 3,
amp: 0.6,
finish: { ~legato = rrand(0.5, 2) },
callback: { "note played".postln }
);
And if the function block bled over the 80 character limit, then it would be formatted in K&R style. (Which leads me to - functions should be formatted in a single line if they are a single statement and the statement does not exceed the line limit.)