# 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 -> bc
e

b -> 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 -> 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."

• There are "graph grammars" which may be at least related or useful. – usul May 1 '15 at 14:06
• your concept of "n-dimensional" seems to be your own & not to be defined in those terms in CS, & its not formally defined & seems to be used in multiple different ways above. – vzn May 2 '15 at 15:54
• @vzn, I'm asking whether this idea has been defined somewhere rigorously. I'm only giving a motivation why it might be useful. Why do you think it has been used in different ways here? – Turion May 2 '15 at 16:26
• actually thinking over your ideas, fourier analysis can sometimes isolate separate instruments and the "dimensions" you refer to and there is some CS/ algorithmic research on separating separate instruments or voices from a "mix" (eg multiple voices at a party). the question also reminds me of the way separate instruments have unique "overtone signatures". as for all grammars, they have aspects relating to "dimensions" you refer to... eg derivations take place in a 2-dimensional space or grid of symbols (or tree/ graph, etc) so in some ways the question is not clear or too broad (wrt SE stds). – vzn May 2 '15 at 16:53
• @vzn, fair enough, I've tried to clarify what I mean. – Turion May 2 '15 at 16:59