Is there higher-dimensional generative grammar? I'm interested in computer music, where there are approaches to treat pieces of music as sentences in generative grammars or L-systems. Instead of composing, one could then specify a grammar and let the computer generate the music. E.g. the Yale group around the late Paul Hudak are very strong in that.

It has struck me that we use seemingly one-dimensional representations of information to represent higher-dimensional things, like plant growth with L-systems. Music, to me, seems to have at least two dimensions: The obvious time dimension and the "instrument" dimension, i.e. the ability to have several different sounds at the same time. And indeed, music notation has exactly these two dimensions.

There are 2-dimensional programming languages like Befunge, which didn't strike me as very useful (yet), but I couldn't find anything about generative grammars, where the sentences are 2-dimensional.

By a 2-dimensional sentence I mean that the characters are spread on a 2-dimensional grid, e.g. like this:

ab cde
 aabce
dca  b


Production rules could have 2-dimensional sentences on either side of the rule as well:

a -&gt; bc
     e

b -&gt; cd
e    ab


Has something like this been studied before?

For example in computer music, this could be quite useful. Pieces like Ravel's Boléro could be generated by a 2-dimensional production rule like this:

t -&gt; tt
      t


This should be read as "If in a piece, the theme t is played by instrument 1 at some time, then we can produce a new piece in which t is played by instrument 1 at the same time, and immediately after by instrument 1 and 2."
Yes, there are n-dimensional grammars and in some cases specifically applied to music, see for example Grammar-based music composition by Jon McCormack, which talks about parametric extensions to L-grammars, or more generally, Regulated Array Grammars of Finite Index, Part I: Theoretical Investigations by Henning FERNAU, Rudolf FREUND and Markus HOLZER which talk about n-dimensional array grammars.