<p>Yes, there are n-dimensional grammars and in some cases specifically applied to music, see for example <a href="http://users.monash.edu/~jonmc/research/Papers/L-systemsMusic.pdf" rel="nofollow noreferrer">Grammar-based music composition by Jon McCormack</a>, which talks about parametric extensions to L-grammars, or more generally, <a href="https://www.researchgate.net/publication/2608733_REGULATED_ARRAY_GRAMMARS_OF_FINITE_INDEX_Part_I_Theoretical_Investigations" rel="nofollow noreferrer">Regulated Array Grammars of Finite Index, Part I: Theoretical Investigations by Henning FERNAU, Rudolf FREUND and Markus HOLZER</a> which talk about n-dimensional array grammars.</p>

CC BY-SA 4.0
2018-07-30T18:06:00.997Z
n-dimensional array grammars is exactly what I was looking for! Thanks!
Turion
CC BY-SA 4.0
2018-07-28T10:05:21.557Z
2018-07-30T18:22:15.430Z
2018-07-30T18:22:15.430Z
Pluto
<p>there is some theoretical/ scientific/ applied research into modelling music with CS formal grammars. see eg</p>

<ul>
<li><p><a href="http://homepages.inf.ed.ac.uk/steedman/papers/music/slides5.pdf" rel="nofollow">Formal Grammars for Computational Musical Analysis</a> / Steedman </p></li>
<li><p><a href="http://www.jstor.org/stable/832733" rel="nofollow">Musical grammars and computer analysis: a Review</a> / Snell</p></li>
</ul>

<p>however grammars may generally be too "regular" to <em>generate</em> interesting music. for that there are different approaches being explored eg genetic algorithms &amp; there are many references on that. following, one highly cited article. this now known as the field of <a href="http://en.wikipedia.org/wiki/Evolutionary_music" rel="nofollow">evolutionary music</a></p>

<ul>
<li><a href="https://ece.umd.edu/~blj/papers/icmc95.pdf" rel="nofollow">COMPOSING WITH GENETIC ALGORITHMS</a> / Jacobs</li>
</ul>

CC BY-SA 3.0
2015-05-01T20:30:07.793Z
see also [computer music composition](http://cs.stackexchange.com/questions/20150/computer-music-composition) cs.se
vzn
CC BY-SA 3.0
2015-05-02T11:00:02.483Z
I don't see where 2-dimensional grammars come in here.
Turion
CC BY-SA 3.0
2015-05-01T20:28:09.527Z
2015-05-01T20:28:09.527Z
vzn
<p>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.</p>

<p>It has struck me that we use seemingly one-dimensional representations of information to represent higher-dimensional things, like <a href="https://en.wikipedia.org/wiki/L-system#Example_7:_Fractal_plant" rel="noreferrer">plant growth with L-systems</a>. 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.</p>

<p>There are 2-dimensional programming languages like <a href="https://en.wikipedia.org/wiki/Befunge" rel="noreferrer">Befunge</a>, which didn't strike me as very useful (yet), but I couldn't find anything about generative grammars, where the sentences are 2-dimensional.</p>

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

<pre><code>ab cde
 aabce
dca  b
</code></pre>

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

<pre><code>a -&gt; bc
     e

b -&gt; cd
e    ab
</code></pre>

<p><strong>Has something like this been studied before?</strong></p>

<p>For example in computer music, this could be quite useful. Pieces like <a href="https://en.wikipedia.org/wiki/Bol%C3%A9ro#Structure" rel="noreferrer">Ravel's Boléro</a> could be generated by a 2-dimensional production rule like this:</p>

<pre><code>t -&gt; tt
      t
</code></pre>

<p>This should be read as "If in a piece, the theme <code>t</code> is played by instrument 1 at some time, then we can produce a new piece in which <code>t</code> is played by instrument 1 at the same time, and immediately after by instrument 1 and 2."</p>

CC BY-SA 3.0
2015-05-01T14:06:57.457Z
There are "graph grammars" which may be at least related or useful.
usul
CC BY-SA 3.0
2015-05-02T15:54:26.887Z
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
CC BY-SA 3.0
2015-05-02T16:26:08.940Z
@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
CC BY-SA 3.0
2015-05-02T16:53:04.167Z
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
CC BY-SA 3.0
2015-05-02T16:59:45.857Z
@vzn, fair enough, I've tried to clarify what I mean.
Turion
<grammars>
Is there higher-dimensional generative grammar?
Turion
# Is there higher-dimensional generative grammar?

(Asked by: username_0 on 2015-05-01)

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

**Tags:** grammars

> **Comments:**
> **username_1**: There are "graph grammars" which may be at least related or useful.  
> **username_2**: 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.  
> **username_0**: @username_2, 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?  
> **username_2**: 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).  
> **username_0**: @username_2, fair enough, I've tried to clarify what I mean.  

---

## 2 answers

### Answer by username_3 on 2018-07-28. Score: 3 | Accepted answer

Yes, there are n-dimensional grammars and in some cases specifically applied to music, see for example [Grammar-based music composition by Jon McCormack](http://users.monash.edu/~jonmc/research/Papers/L-systemsMusic.pdf), 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](https://www.researchgate.net/publication/2608733_REGULATED_ARRAY_GRAMMARS_OF_FINITE_INDEX_Part_I_Theoretical_Investigations) which talk about n-dimensional array grammars.

> **Comments:**
> **username_0**: n-dimensional array grammars is exactly what I was looking for! Thanks!  

---

### Answer by username_2 on 2015-05-01. Score: 1

there is some theoretical/ scientific/ applied research into modelling music with CS formal grammars. see eg

* [Formal Grammars for Computational Musical Analysis](http://homepages.inf.ed.ac.uk/steedman/papers/music/slides5.pdf) / Steedman
* [Musical grammars and computer analysis: a Review](http://www.jstor.org/stable/832733) / Snell

however grammars may generally be too "regular" to *generate* interesting music. for that there are different approaches being explored eg genetic algorithms & there are many references on that. following, one highly cited article. this now known as the field of [evolutionary music](http://en.wikipedia.org/wiki/Evolutionary_music)

* [COMPOSING WITH GENETIC ALGORITHMS](https://ece.umd.edu/~blj/papers/icmc95.pdf) / Jacobs

> **Comments:**
> **username_2**: see also [computer music composition](http://cs.stackexchange.com/questions/20150/computer-music-composition) cs.se  
> **username_0**: I don't see where 2-dimensional grammars come in here.  

---

